@masterteam/notification 0.0.26 → 0.0.27

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.
@@ -1,2 +1,2 @@
1
- /*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */
1
+ /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
2
  @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-border-style:solid;--tw-font-weight:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-slate-500:oklch(55.4% .046 257.417);--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--font-weight-medium:500;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab, red, red)){::placeholder{color:color-mix(in oklab, currentcolor 50%, transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){appearance:button}::file-selector-button{appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.fixed{position:fixed}.static{position:static}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.flex{display:flex}.h-4{height:calc(var(--spacing) * 4)}.h-12{height:calc(var(--spacing) * 12)}.\!w-\[25rem\]{width:25rem!important}.w-1\/2{width:50%}.w-4{width:calc(var(--spacing) * 4)}.w-12{width:calc(var(--spacing) * 12)}.w-full{width:100%}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-2{gap:calc(var(--spacing) * 2)}.gap-4{gap:calc(var(--spacing) * 4)}.rounded-full{border-radius:3.40282e38px}.border{border-style:var(--tw-border-style);border-width:1px}.border-surface{border-color:var(--p-content-border-color)}.bg-surface-50{background-color:var(--p-surface-50)}.p-4{padding:calc(var(--spacing) * 4)}.py-1{padding-block:var(--spacing)}.py-12{padding-block:calc(var(--spacing) * 12)}.ps-3{padding-inline-start:calc(var(--spacing) * 3)}.pe-2{padding-inline-end:calc(var(--spacing) * 2)}.pt-4{padding-top:calc(var(--spacing) * 4)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-slate-500{color:var(--color-slate-500)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}@media (hover:hover){.hover\:bg-surface-100:hover{background-color:var(--p-surface-100)}}}@layer keyframes{@keyframes enter{0%{opacity:var(--p-enter-opacity,1);transform:translate3d(var(--p-enter-translate-x,0), var(--p-enter-translate-y,0), 0) scale3d(var(--p-enter-scale,1), var(--p-enter-scale,1), var(--p-enter-scale,1)) rotate(var(--p-enter-rotate,0))}}@keyframes leave{to{opacity:var(--p-leave-opacity,1);transform:translate3d(var(--p-leave-translate-x,0), var(--p-leave-translate-y,0), 0) scale3d(var(--p-leave-scale,1), var(--p-leave-scale,1), var(--p-leave-scale,1)) rotate(var(--p-leave-rotate,0))}}@keyframes fadein{0%{opacity:0}to{opacity:1}}@keyframes fadeout{0%{opacity:1}to{opacity:0}}@keyframes infinite-scroll{0%{transform:translate(0)}to{transform:translate(-100%)}}@keyframes scalein{0%{opacity:0;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}@keyframes slidedown{0%{max-height:0}to{max-height:auto}}@keyframes slideup{0%{max-height:1000px}to{max-height:0}}@keyframes fadeinleft{0%{opacity:0;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:translate(-100%)}to{opacity:1;transform:translate(0%)}}@keyframes fadeoutleft{0%{opacity:1;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:translate(0%)}to{opacity:0;transform:translate(-100%)}}@keyframes fadeinright{0%{opacity:0;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:translate(100%)}to{opacity:1;transform:translate(0%)}}@keyframes fadeoutright{0%{opacity:1;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:translate(0%)}to{opacity:0;transform:translate(100%)}}@keyframes fadeinup{0%{opacity:0;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:translateY(-100%)}to{opacity:1;transform:translateY(0%)}}@keyframes fadeoutup{0%{opacity:1;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:translateY(0%)}to{opacity:0;transform:translateY(-100%)}}@keyframes fadeindown{0%{opacity:0;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:translateY(100%)}to{opacity:1;transform:translateY(0%)}}@keyframes fadeoutdown{0%{opacity:1;transition:transform .12s cubic-bezier(0,0,.2,1),opacity .12s cubic-bezier(0,0,.2,1);transform:translateY(0%)}to{opacity:0;transform:translateY(100%)}}@keyframes width{0%{width:0}to{width:100%}}@keyframes flip{0%{transform:perspective(2000px)rotateX(-100deg)}to{transform:perspective(2000px)rotateX(0)}}@keyframes flipleft{0%{opacity:0;transform:perspective(2000px)rotateY(-100deg)}to{opacity:1;transform:perspective(2000px)rotateY(0)}}@keyframes flipright{0%{opacity:0;transform:perspective(2000px)rotateY(100deg)}to{opacity:1;transform:perspective(2000px)rotateY(0)}}@keyframes flipup{0%{opacity:0;transform:perspective(2000px)rotateX(-100deg)}to{opacity:1;transform:perspective(2000px)rotateX(0)}}@keyframes zoomin{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes zoomindown{0%{opacity:0;transform:scale3d(.1,.1,.1)translateY(-1000px)}60%{opacity:1;transform:scale3d(.475,.475,.475)translateY(60px)}}@keyframes zoominleft{0%{opacity:0;transform:scale3d(.1,.1,.1)translate(-1000px)}60%{opacity:1;transform:scale3d(.475,.475,.475)translate(10px)}}}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}
@@ -37,7 +37,7 @@ class AddTemplateDialog {
37
37
  this.ref.close();
38
38
  }
39
39
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: AddTemplateDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
40
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: AddTemplateDialog, isStandalone: true, selector: "mt-add-template-dialog", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"modalService.contentClass\" class=\"p-4\">\r\n <mt-text-field\r\n [formControl]=\"templateNameControl\"\r\n [label]=\"'notification.templateName' | transloco\"\r\n [placeholder]=\"'notification.enterTemplateName' | transloco\"\r\n [required]=\"true\"\r\n />\r\n</div>\r\n\r\n<div [class]=\"modalService.footerClass\">\r\n <mt-button\r\n [label]=\"'notification.cancel' | transloco\"\r\n variant=\"outlined\"\r\n (onClick)=\"onCancel()\"\r\n />\r\n <mt-button\r\n [label]=\"'notification.save' | transloco\"\r\n [disabled]=\"!templateNameControl.valid\"\r\n (onClick)=\"onSave()\"\r\n />\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }] });
40
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: AddTemplateDialog, isStandalone: true, selector: "mt-add-template-dialog", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"modalService.contentClass\" class=\"p-4\">\r\n <mt-text-field\r\n [formControl]=\"templateNameControl\"\r\n [label]=\"'notification.templateName' | transloco\"\r\n [placeholder]=\"'notification.enterTemplateName' | transloco\"\r\n [required]=\"true\"\r\n />\r\n</div>\r\n\r\n<div [class]=\"modalService.footerClass\">\r\n <mt-button\r\n [label]=\"'notification.cancel' | transloco\"\r\n variant=\"outlined\"\r\n (onClick)=\"onCancel()\"\r\n />\r\n <mt-button\r\n [label]=\"'notification.save' | transloco\"\r\n [disabled]=\"!templateNameControl.valid\"\r\n (onClick)=\"onSave()\"\r\n />\r\n</div>\r\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }] });
41
41
  }
42
42
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: AddTemplateDialog, decorators: [{
43
43
  type: Component,
@@ -444,8 +444,8 @@ let NotificationState = class NotificationState extends CrudStateBase {
444
444
  request$: req$,
445
445
  updateState: (_state, data) => {
446
446
  const { events, templates } = this.flattenEventsResponse(data ?? []);
447
- const firstTemplate = templates[0];
448
- const firstEvent = events.find((e) => e.id === firstTemplate?.eventId);
447
+ const firstEvent = events[0];
448
+ const firstTemplate = templates.find((t) => t.eventId === firstEvent?.id);
449
449
  return {
450
450
  events,
451
451
  templates,
@@ -798,6 +798,17 @@ class NotificationFacade {
798
798
  receiversError = computed(() => this.errors()[NotificationActionKey.GetReceivers] ?? null, ...(ngDevMode ? [{ debugName: "receiversError" }] : /* istanbul ignore next */ []));
799
799
  propertiesError = computed(() => this.errors()[NotificationActionKey.GetProperties] ?? null, ...(ngDevMode ? [{ debugName: "propertiesError" }] : /* istanbul ignore next */ []));
800
800
  // Action Dispatchers - Configuration
801
+ /**
802
+ * Scopes this (shared, singleton) state to a module/event context.
803
+ *
804
+ * This only patches the scope fields — it does NOT clear previously
805
+ * loaded events/templates/selection from whatever context was active
806
+ * before. Every caller that rescopes (switching component, tab, or
807
+ * selected step/node) MUST call {@link resetState} immediately before
808
+ * this, so there is no window where the new context reads stale data
809
+ * from the old one. See `workflow-builder.ts` / `escalation-builder.ts`
810
+ * for the reference call sites.
811
+ */
801
812
  setModuleInfo(moduleType, moduleId, parentModuleType, parentModuleId, parentPath) {
802
813
  return this.store.dispatch(new SetModuleInfo(moduleType, moduleId, parentModuleType, parentModuleId, parentPath));
803
814
  }
@@ -975,18 +986,37 @@ class NotificationTemplate {
975
986
  activeChannel = computed(() => this.selectedTemplate()?.channel ?? this.channelSignal(), ...(ngDevMode ? [{ debugName: "activeChannel" }] : /* istanbul ignore next */ []));
976
987
  shouldUseMultilingualProperties = computed(() => this.activeChannel() !== 'app', ...(ngDevMode ? [{ debugName: "shouldUseMultilingualProperties" }] : /* istanbul ignore next */ []));
977
988
  isFormInvalid = computed(() => !this.form.controls['name'].value?.trim(), ...(ngDevMode ? [{ debugName: "isFormInvalid" }] : /* istanbul ignore next */ []));
989
+ /**
990
+ * Snapshot of the form's default shape, captured before any context ever
991
+ * patches it. Used by {@link resetTemplateFields} to clear the form when the
992
+ * selected template resolves to nothing, so a component switching context
993
+ * never keeps displaying a previous context's values (see
994
+ * `ResetNotificationState` for the store-level counterpart of this reset).
995
+ */
996
+ emptyFormValue = this.form.getRawValue();
978
997
  constructor() {
979
998
  effect(() => {
980
999
  const eventName = this.selectedEventName();
981
- if (eventName && this.form.controls['event'].value !== eventName) {
982
- this.form.controls['event'].setValue(eventName, { emitEvent: false });
1000
+ if (eventName) {
1001
+ if (this.form.controls['event'].value !== eventName) {
1002
+ this.form.controls['event'].setValue(eventName, {
1003
+ emitEvent: false,
1004
+ });
1005
+ }
1006
+ }
1007
+ else {
1008
+ this.form.controls['event'].setValue(null, { emitEvent: false });
983
1009
  }
984
1010
  });
985
1011
  effect(() => {
986
1012
  this.selectedTemplateId(); // depend on selected template id
987
1013
  const template = untracked(this.selectedTemplate);
988
- if (template)
1014
+ if (template) {
989
1015
  this.patchForm(template);
1016
+ }
1017
+ else {
1018
+ this.resetTemplateFields();
1019
+ }
990
1020
  });
991
1021
  effect(() => {
992
1022
  const template = this.selectedTemplate();
@@ -1120,6 +1150,32 @@ class NotificationTemplate {
1120
1150
  // ============================================================================
1121
1151
  // Private Methods
1122
1152
  // ============================================================================
1153
+ /**
1154
+ * Clears every template-owned control back to the captured empty shape.
1155
+ *
1156
+ * `event` is deliberately excluded, so `patchValue` leaves whatever the event
1157
+ * effect (or the user's own pick) put in that control. An event with no
1158
+ * templates yet — a brand-new one, or one whose last template was just
1159
+ * deleted — resolves `selectedTemplate` to null, and this effect runs after
1160
+ * the event effect in the same flush: resetting the whole group there would
1161
+ * blank the event picker the user just used, while `selectedEvent()` stays
1162
+ * truthy and keeps the tabs/add-template row visible. Leaving the control
1163
+ * alone also keeps the two effects ordering-independent — on a full
1164
+ * `ResetNotificationState` the event effect has already nulled it, and that
1165
+ * null is carried through.
1166
+ *
1167
+ * `channel` is restored through {@link channelControl} with events enabled
1168
+ * because `channelSignal` is a `toSignal` of its `valueChanges` and is the
1169
+ * only consumer of them on this form — a silent reset would leave
1170
+ * `activeChannel()` reporting the previous template's channel.
1171
+ */
1172
+ resetTemplateFields() {
1173
+ const { event: _event, channel, ...templateFields } = this.emptyFormValue;
1174
+ this.form.patchValue(templateFields, { emitEvent: false });
1175
+ this.channelControl.setValue(channel);
1176
+ this.form.markAsPristine();
1177
+ this.form.markAsUntouched();
1178
+ }
1123
1179
  appendToControl(key, value) {
1124
1180
  const ctrl = this.form.controls[key];
1125
1181
  ctrl?.setValue(`${ctrl.value ?? ''} ${value}`);
@@ -1178,7 +1234,7 @@ class NotificationTemplate {
1178
1234
  };
1179
1235
  }
1180
1236
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NotificationTemplate, deps: [], target: i0.ɵɵFactoryTarget.Component });
1181
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: NotificationTemplate, isStandalone: true, selector: "mt-notification-template", ngImport: i0, template: "<div class=\"flex flex-col gap-4 p-4\" [formGroup]=\"form\">\r\n <!-- Loading State -->\r\n @if (isLoadingEvents()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"w-1/2\">\r\n <p-skeleton width=\"4rem\" height=\"1rem\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <div class=\"flex items-center justify-between\">\r\n <div class=\"flex gap-2\">\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <p-skeleton width=\"8rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"100%\" height=\"8rem\" borderRadius=\"0.5rem\" />\r\n <div class=\"flex justify-end gap-2 pt-4\">\r\n <p-skeleton width=\"6rem\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"6rem\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n </div>\r\n } @else if (events().length === 0) {\r\n <!-- Empty State -->\r\n <mt-card>\r\n <div\r\n class=\"flex flex-col items-center justify-center py-12 text-slate-500\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mb-2 h-12 w-12\" />\r\n <p>{{ \"notification.noEventsFound\" | transloco }}</p>\r\n </div>\r\n </mt-card>\r\n } @else {\r\n <!-- Event Selector -->\r\n <div class=\"w-1/2\">\r\n <mt-select-field\r\n formControlName=\"event\"\r\n [options]=\"events()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'eventName'\"\r\n [label]=\"'notification.events' | transloco\"\r\n [placeholder]=\"'notification.selectEvent' | transloco\"\r\n [required]=\"true\"\r\n [filter]=\"false\"\r\n (onChange)=\"onEventChange($event)\"\r\n />\r\n </div>\r\n\r\n @if (selectedEvent()) {\r\n <!-- Template Tabs + Add notification -->\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <mt-tabs\r\n [active]=\"selectedTemplateId()\"\r\n [options]=\"templateTabs()\"\r\n (activeChange)=\"onTemplateTabChange($event)\"\r\n />\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"'notification.addNotification' | transloco\"\r\n size=\"small\"\r\n [loading]=\"isAddingTemplate()\"\r\n (onClick)=\"onAddTemplateClick()\"\r\n />\r\n </div>\r\n\r\n <!-- Template Content -->\r\n @if (selectedTemplate(); as template) {\r\n <div class=\"flex flex-col gap-4\">\r\n <!-- Name -->\r\n <div class=\"w-full\">\r\n <mt-text-field\r\n formControlName=\"name\"\r\n [label]=\"'notification.name' | transloco\"\r\n [placeholder]=\"'notification.enterName' | transloco\"\r\n [required]=\"true\"\r\n />\r\n </div>\r\n <!-- Channel & Properties Picker -->\r\n <div class=\"flex flex-col gap-4\">\r\n <mt-select-field\r\n formControlName=\"channel\"\r\n [options]=\"channelOptions()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'key'\"\r\n [label]=\"'notification.channel.label' | transloco\"\r\n [placeholder]=\"'notification.selectChannel' | transloco\"\r\n [required]=\"true\"\r\n [filter]=\"false\"\r\n [disabled]=\"true\"\r\n />\r\n <mt-select-field\r\n [options]=\"propertyGroups()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'key'\"\r\n [group]=\"true\"\r\n [optionGroupLabel]=\"'groupName'\"\r\n [optionGroupChildren]=\"'properties'\"\r\n [label]=\"'notification.propertiesList' | transloco\"\r\n [placeholder]=\"'notification.selectProperty' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [filter]=\"true\"\r\n [filterBy]=\"'name'\"\r\n [loading]=\"isLoadingProperties()\"\r\n [formControl]=\"propertyPickerControl\"\r\n (onChange)=\"onAddProperty($event)\"\r\n />\r\n </div>\r\n <!-- Channel Content Editors -->\r\n @for (ch of channelConfigs; track ch.key) {\r\n @if (form.controls[\"channel\"].value === ch.key) {\r\n <!-- Bilingual Content Fields -->\r\n @if (isBilingual(ch) && ch.translatableKey) {\r\n <ng-container [formGroupName]=\"ch.translatableKey\">\r\n @if (ch.useRichEditor) {\r\n <mt-editor-field\r\n formControlName=\"en\"\r\n [label]=\"'notification.english' | transloco\"\r\n dir=\"ltr\"\r\n />\r\n <mt-editor-field\r\n formControlName=\"ar\"\r\n [label]=\"'notification.arabic' | transloco\"\r\n dir=\"rtl\"\r\n />\r\n } @else {\r\n <mt-textarea-field\r\n formControlName=\"en\"\r\n [label]=\"'notification.english' | transloco\"\r\n [rows]=\"'6'\"\r\n dir=\"ltr\"\r\n />\r\n <mt-textarea-field\r\n formControlName=\"ar\"\r\n [label]=\"'notification.arabic' | transloco\"\r\n [rows]=\"'6'\"\r\n dir=\"rtl\"\r\n />\r\n }\r\n </ng-container>\r\n } @else if (ch.templateKey) {\r\n <!-- Non-Bilingual Content Field -->\r\n @if (ch.useRichEditor) {\r\n <mt-editor-field\r\n [formControlName]=\"ch.templateKey\"\r\n [label]=\"'notification.notificationBody' | transloco\"\r\n />\r\n } @else {\r\n <mt-textarea-field\r\n [formControlName]=\"ch.templateKey\"\r\n [label]=\"'notification.notificationBody' | transloco\"\r\n [rows]=\"'6'\"\r\n />\r\n }\r\n }\r\n <!-- Bilingual Toggle -->\r\n @if (ch.bilingualOptional) {\r\n <mt-toggle-field\r\n [formControlName]=\"ch.key + 'Bilingual'\"\r\n [label]=\"'notification.bilingual' | transloco\"\r\n />\r\n }\r\n }\r\n }\r\n <!-- Receivers -->\r\n <div class=\"w-full\">\r\n <mt-select-field\r\n [options]=\"availableReceiverGroups()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'id'\"\r\n [group]=\"true\"\r\n [optionGroupLabel]=\"'groupName'\"\r\n [optionGroupChildren]=\"'items'\"\r\n [label]=\"'notification.receivers' | transloco\"\r\n [placeholder]=\"'notification.selectReceiver' | transloco\"\r\n [filter]=\"true\"\r\n [filterBy]=\"'name'\"\r\n [loading]=\"isLoadingReceivers()\"\r\n [formControl]=\"receiverPickerControl\"\r\n (onChange)=\"onAddReceiver($event)\"\r\n />\r\n </div>\r\n @if ((template.receivers ?? []).length > 0) {\r\n <div class=\"flex w-full flex-wrap gap-2\">\r\n @for (receiver of template.receivers; track receiver.id) {\r\n <div\r\n class=\"flex items-center gap-2 rounded-full border border-surface bg-surface-50 py-1 pe-2 ps-3 text-sm transition-colors hover:bg-surface-100\"\r\n >\r\n <mt-icon\r\n icon=\"user.user-01\"\r\n class=\"h-4 w-4 shrink-0 text-slate-500\"\r\n />\r\n <span class=\"font-medium\">{{ receiver.name?.display }}</span>\r\n @if (!receiver.isSystem) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [text]=\"true\"\r\n [loading]=\"isReceiverDeleting(receiver.id)\"\r\n (onClick)=\"onDeleteReceiver(receiver)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n <!-- Actions -->\r\n <div class=\"flex justify-end gap-2 pt-4\">\r\n @if (!template.isSystem) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [label]=\"'notification.delete' | transloco\"\r\n severity=\"danger\"\r\n [loading]=\"isDeletingTemplate()\"\r\n [disabled]=\"isUpdatingTemplate()\"\r\n (onClick)=\"onDeleteTemplate()\"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.save-01\"\r\n [label]=\"'notification.save' | transloco\"\r\n [loading]=\"isUpdatingTemplate()\"\r\n [disabled]=\"isDeletingTemplate() || isFormInvalid()\"\r\n (onClick)=\"onSaveTemplate()\"\r\n />\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- No template selected -->\r\n <div\r\n class=\"flex flex-col items-center justify-center py-12 text-slate-500\"\r\n >\r\n <mt-icon icon=\"alert.bell-01\" class=\"mb-2 h-12 w-12\" />\r\n <p>{{ \"notification.selectTemplatePrompt\" | transloco }}</p>\r\n </div>\r\n }\r\n }\r\n }\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep mt-textarea-field>.flex.items-center,:host ::ng-deep mt-editor-field>.flex.items-center{direction:ltr}:host-context([dir=rtl]) ::ng-deep mt-textarea-field>.flex.items-center,:host-context([dir=rtl]) ::ng-deep mt-editor-field>.flex.items-center{direction:rtl}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: EditorField, selector: "mt-editor-field", inputs: ["label", "hint", "placeholder", "readonly", "theme", "height", "dir", "modules", "required"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1237
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: NotificationTemplate, isStandalone: true, selector: "mt-notification-template", ngImport: i0, template: "<div class=\"flex flex-col gap-4 p-4\" [formGroup]=\"form\">\r\n <!-- Loading State -->\r\n @if (isLoadingEvents()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"w-1/2\">\r\n <p-skeleton width=\"4rem\" height=\"1rem\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <div class=\"flex items-center justify-between\">\r\n <div class=\"flex gap-2\">\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <p-skeleton width=\"8rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"100%\" height=\"8rem\" borderRadius=\"0.5rem\" />\r\n <div class=\"flex justify-end gap-2 pt-4\">\r\n <p-skeleton width=\"6rem\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"6rem\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n </div>\r\n } @else if (events().length === 0) {\r\n <!-- Empty State -->\r\n <mt-card>\r\n <div\r\n class=\"flex flex-col items-center justify-center py-12 text-slate-500\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mb-2 h-12 w-12\" />\r\n <p>{{ \"notification.noEventsFound\" | transloco }}</p>\r\n </div>\r\n </mt-card>\r\n } @else {\r\n <!-- Event Selector -->\r\n <div class=\"w-1/2\">\r\n <mt-select-field\r\n formControlName=\"event\"\r\n [options]=\"events()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'eventName'\"\r\n [label]=\"'notification.events' | transloco\"\r\n [placeholder]=\"'notification.selectEvent' | transloco\"\r\n [required]=\"true\"\r\n [filter]=\"false\"\r\n (onChange)=\"onEventChange($event)\"\r\n />\r\n </div>\r\n\r\n @if (selectedEvent()) {\r\n <!-- Template Tabs + Add notification -->\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <mt-tabs\r\n [active]=\"selectedTemplateId()\"\r\n [options]=\"templateTabs()\"\r\n (activeChange)=\"onTemplateTabChange($event)\"\r\n />\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"'notification.addNotification' | transloco\"\r\n size=\"small\"\r\n [loading]=\"isAddingTemplate()\"\r\n (onClick)=\"onAddTemplateClick()\"\r\n />\r\n </div>\r\n\r\n <!-- Template Content -->\r\n @if (selectedTemplate(); as template) {\r\n <div class=\"flex flex-col gap-4\">\r\n <!-- Name -->\r\n <div class=\"w-full\">\r\n <mt-text-field\r\n formControlName=\"name\"\r\n [label]=\"'notification.name' | transloco\"\r\n [placeholder]=\"'notification.enterName' | transloco\"\r\n [required]=\"true\"\r\n />\r\n </div>\r\n <!-- Channel & Properties Picker -->\r\n <div class=\"flex flex-col gap-4\">\r\n <mt-select-field\r\n formControlName=\"channel\"\r\n [options]=\"channelOptions()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'key'\"\r\n [label]=\"'notification.channel.label' | transloco\"\r\n [placeholder]=\"'notification.selectChannel' | transloco\"\r\n [required]=\"true\"\r\n [filter]=\"false\"\r\n [disabled]=\"true\"\r\n />\r\n <mt-select-field\r\n [options]=\"propertyGroups()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'key'\"\r\n [group]=\"true\"\r\n [optionGroupLabel]=\"'groupName'\"\r\n [optionGroupChildren]=\"'properties'\"\r\n [label]=\"'notification.propertiesList' | transloco\"\r\n [placeholder]=\"'notification.selectProperty' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [filter]=\"true\"\r\n [filterBy]=\"'name'\"\r\n [loading]=\"isLoadingProperties()\"\r\n [formControl]=\"propertyPickerControl\"\r\n (onChange)=\"onAddProperty($event)\"\r\n />\r\n </div>\r\n <!-- Channel Content Editors -->\r\n @for (ch of channelConfigs; track ch.key) {\r\n @if (form.controls[\"channel\"].value === ch.key) {\r\n <!-- Bilingual Content Fields -->\r\n @if (isBilingual(ch) && ch.translatableKey) {\r\n <ng-container [formGroupName]=\"ch.translatableKey\">\r\n @if (ch.useRichEditor) {\r\n <mt-editor-field\r\n formControlName=\"en\"\r\n [label]=\"'notification.english' | transloco\"\r\n dir=\"ltr\"\r\n />\r\n <mt-editor-field\r\n formControlName=\"ar\"\r\n [label]=\"'notification.arabic' | transloco\"\r\n dir=\"rtl\"\r\n />\r\n } @else {\r\n <mt-textarea-field\r\n formControlName=\"en\"\r\n [label]=\"'notification.english' | transloco\"\r\n [rows]=\"'6'\"\r\n dir=\"ltr\"\r\n />\r\n <mt-textarea-field\r\n formControlName=\"ar\"\r\n [label]=\"'notification.arabic' | transloco\"\r\n [rows]=\"'6'\"\r\n dir=\"rtl\"\r\n />\r\n }\r\n </ng-container>\r\n } @else if (ch.templateKey) {\r\n <!-- Non-Bilingual Content Field -->\r\n @if (ch.useRichEditor) {\r\n <mt-editor-field\r\n [formControlName]=\"ch.templateKey\"\r\n [label]=\"'notification.notificationBody' | transloco\"\r\n />\r\n } @else {\r\n <mt-textarea-field\r\n [formControlName]=\"ch.templateKey\"\r\n [label]=\"'notification.notificationBody' | transloco\"\r\n [rows]=\"'6'\"\r\n />\r\n }\r\n }\r\n <!-- Bilingual Toggle -->\r\n @if (ch.bilingualOptional) {\r\n <mt-toggle-field\r\n [formControlName]=\"ch.key + 'Bilingual'\"\r\n [label]=\"'notification.bilingual' | transloco\"\r\n />\r\n }\r\n }\r\n }\r\n <!-- Receivers -->\r\n <div class=\"w-full\">\r\n <mt-select-field\r\n [options]=\"availableReceiverGroups()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'id'\"\r\n [group]=\"true\"\r\n [optionGroupLabel]=\"'groupName'\"\r\n [optionGroupChildren]=\"'items'\"\r\n [label]=\"'notification.receivers' | transloco\"\r\n [placeholder]=\"'notification.selectReceiver' | transloco\"\r\n [filter]=\"true\"\r\n [filterBy]=\"'name'\"\r\n [loading]=\"isLoadingReceivers()\"\r\n [formControl]=\"receiverPickerControl\"\r\n (onChange)=\"onAddReceiver($event)\"\r\n />\r\n </div>\r\n @if ((template.receivers ?? []).length > 0) {\r\n <div class=\"flex w-full flex-wrap gap-2\">\r\n @for (receiver of template.receivers; track receiver.id) {\r\n <div\r\n class=\"flex items-center gap-2 rounded-full border border-surface bg-surface-50 py-1 pe-2 ps-3 text-sm transition-colors hover:bg-surface-100\"\r\n >\r\n <mt-icon\r\n icon=\"user.user-01\"\r\n class=\"h-4 w-4 shrink-0 text-slate-500\"\r\n />\r\n <span class=\"font-medium\">{{ receiver.name?.display }}</span>\r\n @if (!receiver.isSystem) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [text]=\"true\"\r\n [loading]=\"isReceiverDeleting(receiver.id)\"\r\n (onClick)=\"onDeleteReceiver(receiver)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n <!-- Actions -->\r\n <div class=\"flex justify-end gap-2 pt-4\">\r\n @if (!template.isSystem) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [label]=\"'notification.delete' | transloco\"\r\n severity=\"danger\"\r\n [loading]=\"isDeletingTemplate()\"\r\n [disabled]=\"isUpdatingTemplate()\"\r\n (onClick)=\"onDeleteTemplate()\"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.save-01\"\r\n [label]=\"'notification.save' | transloco\"\r\n [loading]=\"isUpdatingTemplate()\"\r\n [disabled]=\"isDeletingTemplate() || isFormInvalid()\"\r\n (onClick)=\"onSaveTemplate()\"\r\n />\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- No template selected -->\r\n <div\r\n class=\"flex flex-col items-center justify-center py-12 text-slate-500\"\r\n >\r\n <mt-icon icon=\"alert.bell-01\" class=\"mb-2 h-12 w-12\" />\r\n <p>{{ \"notification.selectTemplatePrompt\" | transloco }}</p>\r\n </div>\r\n }\r\n }\r\n }\r\n</div>\r\n", styles: [":host{display:block;width:100%;height:100%}:host ::ng-deep mt-textarea-field>.flex.items-center,:host ::ng-deep mt-editor-field>.flex.items-center{direction:ltr}:host-context([dir=rtl]) ::ng-deep mt-textarea-field>.flex.items-center,:host-context([dir=rtl]) ::ng-deep mt-editor-field>.flex.items-center{direction:rtl}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],[formArray],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1.FormGroupName, selector: "[formGroupName]", inputs: ["formGroupName"] }, { kind: "ngmodule", type: TranslocoModule }, { kind: "component", type: Card, selector: "mt-card", inputs: ["class", "title", "paddingless"] }, { kind: "component", type: Button, selector: "mt-button", inputs: ["icon", "label", "tooltip", "class", "type", "styleClass", "severity", "badge", "variant", "badgeSeverity", "size", "iconPos", "autofocus", "fluid", "raised", "rounded", "text", "plain", "outlined", "link", "disabled", "loading", "pInputs", "ariaLabel"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "component", type: SelectField, selector: "mt-select-field", inputs: ["field", "hint", "label", "placeholder", "hasPlaceholderPrefix", "class", "readonly", "pInputs", "options", "optionValue", "optionLabel", "filter", "filterBy", "dataKey", "showClear", "clearAfterSelect", "required", "group", "size", "optionGroupLabel", "optionGroupChildren", "loading", "optionIcon", "optionIconColor", "optionIconShape", "optionAvatarShape", "optionGroupIcon", "optionGroupIconColor", "optionGroupIconShape", "optionGroupAvatarShape", "markCurrentUser"], outputs: ["onChange"] }, { kind: "component", type: TextField, selector: "mt-text-field", inputs: ["field", "hint", "label", "placeholder", "class", "type", "readonly", "pInputs", "required", "maxLength", "icon", "iconPosition"] }, { kind: "component", type: TextareaField, selector: "mt-textarea-field", inputs: ["field", "hint", "label", "placeholder", "class", "readonly", "noErrorStyle", "pInputs", "rows", "required", "maxLength"] }, { kind: "component", type: EditorField, selector: "mt-editor-field", inputs: ["label", "hint", "placeholder", "readonly", "theme", "height", "dir", "modules", "required"] }, { kind: "component", type: ToggleField, selector: "mt-toggle-field", inputs: ["label", "inputId", "labelPosition", "placeholder", "readonly", "pInputs", "required", "toggleShape", "size", "icon", "descriptionCard"], outputs: ["onChange"] }, { kind: "component", type: Tabs, selector: "mt-tabs", inputs: ["options", "optionLabel", "optionValue", "active", "mode", "moreLabel", "defaultIcon", "size", "fluid", "disabled", "searchThreshold"], outputs: ["activeChange", "onChange"] }, { kind: "component", type: Icon, selector: "mt-icon", inputs: ["icon"] }, { kind: "component", type: Skeleton, selector: "p-skeleton", inputs: ["styleClass", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "pipe", type: i2.TranslocoPipe, name: "transloco" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1182
1238
  }
1183
1239
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: NotificationTemplate, decorators: [{
1184
1240
  type: Component,
@@ -1 +1 @@
1
- {"version":3,"file":"masterteam-notification.mjs","sources":["../../../../packages/masterteam/notification/src/lib/add-template-dialog/add-template-dialog.ts","../../../../packages/masterteam/notification/src/lib/add-template-dialog/add-template-dialog.html","../../../../packages/masterteam/notification/src/store/notification/notification.model.ts","../../../../packages/masterteam/notification/src/store/notification/notification.actions.ts","../../../../packages/masterteam/notification/src/store/notification/notification.state.ts","../../../../packages/masterteam/notification/src/store/notification/notification.facade.ts","../../../../packages/masterteam/notification/src/lib/notification-template/notification-template.ts","../../../../packages/masterteam/notification/src/lib/notification-template/notification-template.html","../../../../packages/masterteam/notification/src/store/app.state.ts","../../../../packages/masterteam/notification/src/masterteam-notification.ts"],"sourcesContent":["import { Component, inject, input } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport { TranslocoModule } from '@jsverse/transloco';\r\nimport { ModalRef } from '@masterteam/components/dialog';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { TextField } from '@masterteam/components/text-field';\r\nimport { Button } from '@masterteam/components/button';\r\n\r\n@Component({\r\n selector: 'mt-add-template-dialog',\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n TranslocoModule,\r\n TextField,\r\n Button,\r\n ],\r\n templateUrl: './add-template-dialog.html',\r\n})\r\nexport class AddTemplateDialog {\r\n readonly modalService = inject(ModalService);\r\n private readonly ref = inject(ModalRef);\r\n\r\n data = input<any>(null);\r\n\r\n templateNameControl = new FormControl<string>('', [Validators.required]);\r\n\r\n onSave(): void {\r\n if (this.templateNameControl.valid) {\r\n this.ref.close({ name: this.templateNameControl.value?.trim() });\r\n }\r\n }\r\n\r\n onCancel(): void {\r\n this.ref.close();\r\n }\r\n}\r\n","<div [class]=\"modalService.contentClass\" class=\"p-4\">\r\n <mt-text-field\r\n [formControl]=\"templateNameControl\"\r\n [label]=\"'notification.templateName' | transloco\"\r\n [placeholder]=\"'notification.enterTemplateName' | transloco\"\r\n [required]=\"true\"\r\n />\r\n</div>\r\n\r\n<div [class]=\"modalService.footerClass\">\r\n <mt-button\r\n [label]=\"'notification.cancel' | transloco\"\r\n variant=\"outlined\"\r\n (onClick)=\"onCancel()\"\r\n />\r\n <mt-button\r\n [label]=\"'notification.save' | transloco\"\r\n [disabled]=\"!templateNameControl.valid\"\r\n (onClick)=\"onSave()\"\r\n />\r\n</div>\r\n","import type { LoadingStateShape } from '@masterteam/components';\r\n\r\n// ============================================================================\r\n// Action Keys Enum\r\n// ============================================================================\r\nexport enum NotificationActionKey {\r\n GetEvents = 'getEvents',\r\n GetReceivers = 'getReceivers',\r\n GetProperties = 'getProperties',\r\n AddReceivers = 'addReceivers',\r\n DeleteReceiver = 'deleteReceiver',\r\n AddTemplate = 'addTemplate',\r\n UpdateTemplate = 'updateTemplate',\r\n DeleteTemplate = 'deleteTemplate',\r\n}\r\n\r\n// ============================================================================\r\n// Channel Types\r\n// ============================================================================\r\nexport type NotificationChannel = 'email' | 'sms' | 'app';\r\n\r\nexport interface ChannelConfig {\r\n key: NotificationChannel;\r\n labelKey: string;\r\n /** Whether this channel supports bilingual content */\r\n supportsBilingual: boolean;\r\n /** Whether bilingual is optional (true = show toggle) */\r\n bilingualOptional: boolean;\r\n /** Whether this channel uses rich text editor (false = textarea) */\r\n useRichEditor: boolean;\r\n /** Payload key for non-bilingual template (string value) */\r\n templateKey?: string;\r\n /** Payload key for bilingual template (object with en/ar) */\r\n translatableKey?: string;\r\n}\r\n\r\nexport const CHANNEL_CONFIGS: ChannelConfig[] = [\r\n {\r\n key: 'email',\r\n labelKey: 'notification.channel.email',\r\n supportsBilingual: false,\r\n bilingualOptional: false,\r\n useRichEditor: true,\r\n templateKey: 'emailTemplate',\r\n },\r\n {\r\n key: 'sms',\r\n labelKey: 'notification.channel.sms',\r\n supportsBilingual: false,\r\n bilingualOptional: false,\r\n useRichEditor: false,\r\n templateKey: 'smsTemplate',\r\n },\r\n {\r\n key: 'app',\r\n labelKey: 'notification.channel.app',\r\n supportsBilingual: true,\r\n bilingualOptional: false,\r\n useRichEditor: true,\r\n translatableKey: 'appTemplate',\r\n },\r\n];\r\n\r\n/** Helper to get channel config by key */\r\nexport function getChannelConfig(key: NotificationChannel): ChannelConfig {\r\n return CHANNEL_CONFIGS.find((c) => c.key === key) ?? CHANNEL_CONFIGS[0];\r\n}\r\n\r\n/** Build form control name for a channel field */\r\nexport function getFormControlName(\r\n ch: ChannelConfig,\r\n type: 'single' | 'en' | 'ar',\r\n): string | null {\r\n if (type === 'single') return ch.templateKey ?? null;\r\n if (!ch.translatableKey) return null;\r\n return type === 'en'\r\n ? `${ch.translatableKey}.en`\r\n : `${ch.translatableKey}.ar`;\r\n}\r\n\r\n// ============================================================================\r\n// Translatable Content\r\n// ============================================================================\r\nexport interface TranslatableContent {\r\n en: string;\r\n ar: string;\r\n}\r\n\r\n// ============================================================================\r\n// Receiver Types\r\n// ============================================================================\r\nexport interface ReceiverItem {\r\n id: string | number;\r\n identifier: string;\r\n name: any;\r\n type: string;\r\n isSystem?: boolean;\r\n}\r\n\r\nexport interface ReceiverGroup {\r\n groupName: string;\r\n items: ReceiverItem[] | ReceiverSubGroup[];\r\n}\r\n\r\nexport interface ReceiverSubGroup {\r\n subGroupName: string;\r\n items: ReceiverItem[];\r\n}\r\n\r\nexport interface ReceiverOptionGroup {\r\n groupName: string;\r\n items: ReceiverItem[];\r\n}\r\n\r\n// ============================================================================\r\n// Property Types\r\n// ============================================================================\r\nexport interface NotificationProperty {\r\n key: string;\r\n name: string;\r\n groupName?: string;\r\n}\r\n\r\nexport interface PropertyGroup {\r\n groupName: string;\r\n properties: NotificationProperty[];\r\n}\r\n\r\n// ============================================================================\r\n// Template Types\r\n// ============================================================================\r\nexport interface NotificationTemplateItem {\r\n id: string | number;\r\n eventId: string | number; // Link to parent event\r\n name: string;\r\n isSystem: boolean;\r\n channel: NotificationChannel;\r\n receivers: ReceiverItem[];\r\n emailTemplate: string;\r\n emailContentTranslatable: TranslatableContent;\r\n smsTemplate: string;\r\n appTemplate: TranslatableContent;\r\n conditionFormula?: string;\r\n}\r\n\r\n// ============================================================================\r\n// Event Types\r\n// ============================================================================\r\nexport interface NotificationEvent {\r\n id: string | number;\r\n eventName: string;\r\n name: string;\r\n}\r\n\r\n// ============================================================================\r\n// Action Types (Workflow)\r\n// ============================================================================\r\nexport interface NotificationAction {\r\n id: string | number;\r\n name: string;\r\n type: string;\r\n}\r\n\r\nexport interface ActionGroup {\r\n activity: string;\r\n items: NotificationAction[];\r\n}\r\n\r\n// ============================================================================\r\n// Payloads\r\n// ============================================================================\r\nexport interface ReceiverPayloadItem {\r\n id: string | number;\r\n type: string;\r\n}\r\n\r\nexport interface AddReceiversPayload {\r\n receivers: ReceiverPayloadItem[];\r\n}\r\n\r\nexport interface AddTemplatePayload {\r\n name: string;\r\n channel: NotificationChannel;\r\n}\r\n\r\nexport interface UpdateTemplatePayload {\r\n title: string;\r\n emailTemplate?: string;\r\n emailContentTranslatable?: TranslatableContent;\r\n smsTemplate?: string;\r\n appTemplate?: TranslatableContent;\r\n conditionFormula?: string;\r\n}\r\n\r\n// ============================================================================\r\n// State Model\r\n// ============================================================================\r\nexport interface NotificationStateModel extends LoadingStateShape<NotificationActionKey> {\r\n // Module configuration\r\n moduleType: string | null;\r\n moduleId: string | number | null;\r\n parentModuleType: string | null;\r\n parentModuleId: string | number | null;\r\n parentPath: string;\r\n\r\n // Action mode (for workflow)\r\n isActionMode: boolean;\r\n selectedActionId: string | number | null;\r\n\r\n // Data collections\r\n events: NotificationEvent[];\r\n templates: NotificationTemplateItem[]; // Flattened templates\r\n actions: NotificationAction[];\r\n receivers: ReceiverItem[];\r\n receiverGroups: ReceiverOptionGroup[];\r\n propertyGroups: PropertyGroup[];\r\n\r\n // Selection state\r\n selectedEventName: string | null;\r\n selectedTemplateId: string | number | null;\r\n}\r\n","import type {\r\n AddReceiversPayload,\r\n AddTemplatePayload,\r\n UpdateTemplatePayload,\r\n} from './notification.model';\r\n\r\n// ============================================================================\r\n// Module Configuration\r\n// ============================================================================\r\nexport class SetModuleInfo {\r\n static readonly type = '[Notification] Set Module Info';\r\n constructor(\r\n public moduleType: string,\r\n public moduleId: string | number,\r\n public parentModuleType?: string,\r\n public parentModuleId?: string | number,\r\n public parentPath?: string,\r\n ) {}\r\n}\r\n\r\n// ============================================================================\r\n// Data Loading Actions\r\n// ============================================================================\r\nexport class GetEvents {\r\n static readonly type = '[Notification] Get Events';\r\n}\r\n\r\nexport class GetReceivers {\r\n static readonly type = '[Notification] Get Receivers';\r\n}\r\n\r\nexport class GetProperties {\r\n static readonly type = '[Notification] Get Properties';\r\n constructor(public isMultiLang?: boolean) {}\r\n}\r\n\r\n// ============================================================================\r\n// Action Mode (Workflow)\r\n// ============================================================================\r\nexport class SetActionMode {\r\n static readonly type = '[Notification] Set Action Mode';\r\n constructor(public actionId: string | number | null) {}\r\n}\r\n\r\nexport class GetActionReceivers {\r\n static readonly type = '[Notification] Get Action Receivers';\r\n constructor(public actionId: string | number) {}\r\n}\r\n\r\nexport class GetActionProperties {\r\n static readonly type = '[Notification] Get Action Properties';\r\n constructor(\r\n public actionId: string | number,\r\n public isMultiLang?: boolean,\r\n ) {}\r\n}\r\n\r\n// ============================================================================\r\n// Selection Actions\r\n// ============================================================================\r\nexport class SelectEvent {\r\n static readonly type = '[Notification] Select Event';\r\n constructor(public eventName: string) {}\r\n}\r\n\r\nexport class SelectTemplate {\r\n static readonly type = '[Notification] Select Template';\r\n constructor(public templateId: string | number) {}\r\n}\r\n\r\n// ============================================================================\r\n// Receiver CRUD\r\n// ============================================================================\r\nexport class AddReceivers {\r\n static readonly type = '[Notification] Add Receivers';\r\n constructor(\r\n public templateId: string | number,\r\n public payload: AddReceiversPayload,\r\n ) {}\r\n}\r\n\r\nexport class DeleteReceiver {\r\n static readonly type = '[Notification] Delete Receiver';\r\n constructor(public receiverId: string | number) {}\r\n}\r\n\r\n// ============================================================================\r\n// Template CRUD\r\n// ============================================================================\r\nexport class AddTemplate {\r\n static readonly type = '[Notification] Add Template';\r\n constructor(\r\n public eventId: string | number,\r\n public payload: AddTemplatePayload,\r\n ) {}\r\n}\r\n\r\nexport class UpdateTemplate {\r\n static readonly type = '[Notification] Update Template';\r\n constructor(\r\n public templateId: string | number,\r\n public payload: UpdateTemplatePayload,\r\n ) {}\r\n}\r\n\r\nexport class DeleteTemplate {\r\n static readonly type = '[Notification] Delete Template';\r\n constructor(public templateId: string | number) {}\r\n}\r\n\r\n// ============================================================================\r\n// Reset State\r\n// ============================================================================\r\nexport class ResetNotificationState {\r\n static readonly type = '[Notification] Reset State';\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\r\nimport {\r\n CrudStateBase,\r\n handleApiRequest,\r\n Response,\r\n} from '@masterteam/components';\r\n\r\nimport {\r\n NotificationActionKey,\r\n NotificationStateModel,\r\n NotificationEvent,\r\n NotificationTemplateItem,\r\n ReceiverItem,\r\n ReceiverGroup,\r\n ReceiverOptionGroup,\r\n ReceiverSubGroup,\r\n PropertyGroup,\r\n} from './notification.model';\r\nimport {\r\n AddReceivers,\r\n AddTemplate,\r\n DeleteReceiver,\r\n DeleteTemplate,\r\n GetActionProperties,\r\n GetActionReceivers,\r\n GetEvents,\r\n GetProperties,\r\n GetReceivers,\r\n ResetNotificationState,\r\n SelectEvent,\r\n SelectTemplate,\r\n SetActionMode,\r\n SetModuleInfo,\r\n UpdateTemplate,\r\n} from './notification.actions';\r\n\r\n// Default State\r\n\r\nconst DEFAULT_STATE: NotificationStateModel = {\r\n // Module configuration\r\n moduleType: null,\r\n moduleId: null,\r\n parentModuleType: null,\r\n parentModuleId: null,\r\n parentPath: '',\r\n\r\n // Action mode\r\n isActionMode: false,\r\n selectedActionId: null,\r\n\r\n // Data collections\r\n events: [],\r\n templates: [], // Flattened templates\r\n actions: [],\r\n receivers: [],\r\n receiverGroups: [],\r\n propertyGroups: [],\r\n\r\n // Selection state\r\n selectedEventName: null,\r\n selectedTemplateId: null,\r\n\r\n // Loading state (from LoadingStateShape)\r\n loadingActive: [],\r\n errors: {},\r\n};\r\n\r\n// State Definition\r\n\r\n@State<NotificationStateModel>({\r\n name: 'notification',\r\n defaults: DEFAULT_STATE,\r\n})\r\n@Injectable()\r\nexport class NotificationState extends CrudStateBase<\r\n NotificationTemplateItem,\r\n NotificationStateModel,\r\n NotificationActionKey\r\n> {\r\n private readonly http = inject(HttpClient);\r\n private readonly baseUrl = 'notifications';\r\n\r\n // Selectors - Individual selectors for fine-grained reactivity\r\n @Selector()\r\n static getState(state: NotificationStateModel): NotificationStateModel {\r\n return state;\r\n }\r\n\r\n @Selector()\r\n static getEvents(state: NotificationStateModel): NotificationEvent[] {\r\n return state.events;\r\n }\r\n\r\n @Selector()\r\n static getTemplates(\r\n state: NotificationStateModel,\r\n ): NotificationTemplateItem[] {\r\n return state.templates;\r\n }\r\n\r\n @Selector()\r\n static getReceivers(state: NotificationStateModel): ReceiverItem[] {\r\n return state.receivers;\r\n }\r\n\r\n @Selector()\r\n static getReceiverGroups(\r\n state: NotificationStateModel,\r\n ): ReceiverOptionGroup[] {\r\n return state.receiverGroups;\r\n }\r\n\r\n @Selector()\r\n static getPropertyGroups(state: NotificationStateModel): PropertyGroup[] {\r\n return state.propertyGroups;\r\n }\r\n\r\n @Selector()\r\n static getSelectedEventName(state: NotificationStateModel): string | null {\r\n return state.selectedEventName;\r\n }\r\n\r\n @Selector()\r\n static getSelectedTemplateId(\r\n state: NotificationStateModel,\r\n ): string | number | null {\r\n return state.selectedTemplateId;\r\n }\r\n\r\n @Selector()\r\n static getLoadingActive(state: NotificationStateModel): string[] {\r\n return state.loadingActive;\r\n }\r\n\r\n @Selector()\r\n static getErrors(\r\n state: NotificationStateModel,\r\n ): Record<string, string | null> {\r\n return state.errors;\r\n }\r\n\r\n // Derived selectors\r\n @Selector([\r\n NotificationState.getEvents,\r\n NotificationState.getSelectedEventName,\r\n ])\r\n static getSelectedEvent(\r\n events: NotificationEvent[],\r\n selectedEventName: string | null,\r\n ): NotificationEvent | null {\r\n return events.find((e) => e.eventName === selectedEventName) ?? null;\r\n }\r\n\r\n @Selector([\r\n NotificationState.getTemplates,\r\n NotificationState.getSelectedEvent,\r\n ])\r\n static getEventTemplates(\r\n templates: NotificationTemplateItem[],\r\n selectedEvent: NotificationEvent | null,\r\n ): NotificationTemplateItem[] {\r\n if (!selectedEvent) return [];\r\n return templates.filter((t) => t.eventId === selectedEvent.id);\r\n }\r\n\r\n @Selector([\r\n NotificationState.getTemplates,\r\n NotificationState.getSelectedTemplateId,\r\n ])\r\n static getSelectedTemplate(\r\n templates: NotificationTemplateItem[],\r\n selectedTemplateId: string | number | null,\r\n ): NotificationTemplateItem | null {\r\n return templates.find((t) => t.id === selectedTemplateId) ?? null;\r\n }\r\n\r\n @Selector([\r\n NotificationState.getReceivers,\r\n NotificationState.getSelectedTemplate,\r\n ])\r\n static getAvailableReceivers(\r\n receivers: ReceiverItem[],\r\n selectedTemplate: NotificationTemplateItem | null,\r\n ): ReceiverItem[] {\r\n if (!selectedTemplate) return receivers;\r\n const templateReceivers = selectedTemplate.receivers ?? [];\r\n const assignedIds = new Set(templateReceivers.map((r) => r.identifier));\r\n return receivers.filter((r) => !assignedIds.has(String(r.id)));\r\n }\r\n\r\n @Selector([\r\n NotificationState.getReceiverGroups,\r\n NotificationState.getSelectedTemplate,\r\n ])\r\n static getAvailableReceiverGroups(\r\n receiverGroups: ReceiverOptionGroup[],\r\n selectedTemplate: NotificationTemplateItem | null,\r\n ): ReceiverOptionGroup[] {\r\n if (!selectedTemplate) return receiverGroups;\r\n\r\n const assignedIds = new Set(\r\n (selectedTemplate.receivers ?? []).map((r) => r.identifier),\r\n );\r\n\r\n return receiverGroups\r\n .map((group) => ({\r\n ...group,\r\n items: group.items.filter((item) => !assignedIds.has(String(item.id))),\r\n }))\r\n .filter((group) => group.items.length > 0);\r\n }\r\n\r\n // Helper Methods\r\n\r\n /** API returns events with nested templates - we flatten for state */\r\n private flattenEventsResponse(\r\n eventsWithTemplates: Array<\r\n NotificationEvent & { templates: NotificationTemplateItem[] }\r\n >,\r\n ): { events: NotificationEvent[]; templates: NotificationTemplateItem[] } {\r\n const events: NotificationEvent[] = [];\r\n const templates: NotificationTemplateItem[] = [];\r\n\r\n for (const event of eventsWithTemplates) {\r\n const { templates: eventTemplates, ...eventData } = event;\r\n events.push(eventData);\r\n templates.push(\r\n ...eventTemplates.map((t) => ({ ...t, eventId: event.id })),\r\n );\r\n }\r\n\r\n return { events, templates };\r\n }\r\n\r\n private normalizeReceiverGroups(\r\n groups: ReceiverGroup[],\r\n ): ReceiverOptionGroup[] {\r\n return groups\r\n .map((group) => ({\r\n groupName: group.groupName,\r\n items: this.flattenReceiverItems(group.items),\r\n }))\r\n .filter((group) => group.items.length > 0);\r\n }\r\n\r\n private flattenReceiverItems(\r\n items: Array<ReceiverItem | ReceiverSubGroup> | null | undefined,\r\n parentLabel?: string,\r\n ): ReceiverItem[] {\r\n if (!Array.isArray(items)) {\r\n return [];\r\n }\r\n\r\n return items.flatMap((item) => {\r\n const subGroupItems = (item as ReceiverSubGroup).items;\r\n if (Array.isArray(subGroupItems)) {\r\n const subGroupName = (item as ReceiverSubGroup).subGroupName;\r\n const nextLabel = subGroupName\r\n ? parentLabel\r\n ? `${parentLabel} - ${subGroupName}`\r\n : subGroupName\r\n : parentLabel;\r\n\r\n return this.flattenReceiverItems(subGroupItems, nextLabel);\r\n }\r\n\r\n const receiver = item as ReceiverItem;\r\n if (receiver.id == null || !receiver.name) {\r\n return [];\r\n }\r\n\r\n return [\r\n {\r\n ...receiver,\r\n name: parentLabel\r\n ? `${parentLabel} - ${receiver.name}`\r\n : receiver.name,\r\n },\r\n ];\r\n });\r\n }\r\n\r\n private hasOwnField<T extends object>(\r\n value: T,\r\n field: keyof NotificationTemplateItem,\r\n ): boolean {\r\n return Object.prototype.hasOwnProperty.call(value, field);\r\n }\r\n\r\n private mergeUpdatedTemplate(\r\n existingTemplate: NotificationTemplateItem,\r\n updatedTemplate: Partial<NotificationTemplateItem>,\r\n ): NotificationTemplateItem {\r\n const mergedTemplate: NotificationTemplateItem = {\r\n ...existingTemplate,\r\n name: updatedTemplate.name ?? existingTemplate.name,\r\n };\r\n\r\n if (this.hasOwnField(updatedTemplate, 'emailTemplate')) {\r\n mergedTemplate.emailTemplate = updatedTemplate.emailTemplate ?? '';\r\n }\r\n\r\n if (\r\n this.hasOwnField(updatedTemplate, 'emailContentTranslatable') &&\r\n updatedTemplate.emailContentTranslatable\r\n ) {\r\n mergedTemplate.emailContentTranslatable = {\r\n ...existingTemplate.emailContentTranslatable,\r\n ...updatedTemplate.emailContentTranslatable,\r\n };\r\n }\r\n\r\n if (this.hasOwnField(updatedTemplate, 'smsTemplate')) {\r\n mergedTemplate.smsTemplate = updatedTemplate.smsTemplate ?? '';\r\n }\r\n\r\n if (\r\n this.hasOwnField(updatedTemplate, 'appTemplate') &&\r\n updatedTemplate.appTemplate\r\n ) {\r\n mergedTemplate.appTemplate = {\r\n ...existingTemplate.appTemplate,\r\n ...updatedTemplate.appTemplate,\r\n };\r\n }\r\n\r\n if (this.hasOwnField(updatedTemplate, 'conditionFormula')) {\r\n mergedTemplate.conditionFormula = updatedTemplate.conditionFormula;\r\n }\r\n\r\n return mergedTemplate;\r\n }\r\n\r\n // Module Configuration\r\n\r\n @Action(SetModuleInfo)\r\n setModuleInfo(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: SetModuleInfo,\r\n ) {\r\n let parentPath = '';\r\n if (action.parentModuleType && action.parentModuleId) {\r\n parentPath = `/${action.parentModuleType}/${action.parentModuleId}`;\r\n } else if (action.parentPath) {\r\n parentPath = action.parentPath;\r\n }\r\n\r\n ctx.patchState({\r\n moduleType: action.moduleType,\r\n moduleId: action.moduleId,\r\n parentModuleType: action.parentModuleType ?? null,\r\n parentModuleId: action.parentModuleId ?? null,\r\n parentPath,\r\n isActionMode: action.moduleType === 'workflow',\r\n });\r\n }\r\n\r\n @Action(ResetNotificationState)\r\n resetState(ctx: StateContext<NotificationStateModel>) {\r\n ctx.setState(DEFAULT_STATE);\r\n }\r\n\r\n // Data Loading Actions (Normal Mode)\r\n\r\n @Action(GetEvents)\r\n getEvents(ctx: StateContext<NotificationStateModel>) {\r\n const { moduleType, moduleId, parentPath } = ctx.getState();\r\n // API returns events with nested templates\r\n type EventWithTemplates = NotificationEvent & {\r\n templates: NotificationTemplateItem[];\r\n };\r\n const req$ = this.http.get<Response<EventWithTemplates[]>>(\r\n `${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/events`,\r\n );\r\n\r\n return this.load(ctx, {\r\n key: NotificationActionKey.GetEvents,\r\n request$: req$,\r\n updateState: (_state, data) => {\r\n const { events, templates } = this.flattenEventsResponse(data ?? []);\r\n const firstTemplate = templates[0];\r\n const firstEvent = events.find((e) => e.id === firstTemplate?.eventId);\r\n return {\r\n events,\r\n templates,\r\n selectedEventName: firstEvent?.eventName ?? null,\r\n selectedTemplateId: firstTemplate?.id ?? null,\r\n };\r\n },\r\n });\r\n }\r\n\r\n @Action(GetReceivers)\r\n getReceivers(ctx: StateContext<NotificationStateModel>) {\r\n const { parentPath, moduleType, moduleId } = ctx.getState();\r\n const req$ = this.http.get<Response<ReceiverGroup[]>>(\r\n `${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/receivers`,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.GetReceivers,\r\n request$: req$,\r\n onSuccess: (response) => {\r\n const receiverGroups = this.normalizeReceiverGroups(\r\n response.data ?? [],\r\n );\r\n return {\r\n receiverGroups,\r\n receivers: receiverGroups.flatMap((group) => group.items),\r\n };\r\n },\r\n });\r\n }\r\n\r\n @Action(GetProperties)\r\n getProperties(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: GetProperties,\r\n ) {\r\n const { moduleType, moduleId, parentPath } = ctx.getState();\r\n const url = `${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/properties?IsMultiLanguageEnabled=${action.isMultiLang ? 'true' : 'false'}`;\r\n\r\n const req$ = this.http.get<Response<PropertyGroup[]>>(url);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.GetProperties,\r\n request$: req$,\r\n onSuccess: (response) => ({\r\n propertyGroups:\r\n response.data?.map((group) => ({\r\n ...group,\r\n icon: 'custom.list-cards',\r\n })) ?? [],\r\n }),\r\n });\r\n }\r\n\r\n // Action Mode (Workflow)\r\n\r\n @Action(SetActionMode)\r\n setActionMode(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: SetActionMode,\r\n ) {\r\n ctx.patchState({\r\n selectedActionId: action.actionId,\r\n });\r\n }\r\n\r\n @Action(GetActionReceivers)\r\n getActionReceivers(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: GetActionReceivers,\r\n ) {\r\n const req$ = this.http.get<Response<ReceiverGroup[]>>(\r\n `${this.baseUrl}/action/${action.actionId}/receivers`,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.GetReceivers,\r\n request$: req$,\r\n onSuccess: (response) => {\r\n const receiverGroups = this.normalizeReceiverGroups(\r\n response.data ?? [],\r\n );\r\n return {\r\n receiverGroups,\r\n receivers: receiverGroups.flatMap((group) => group.items),\r\n };\r\n },\r\n });\r\n }\r\n\r\n @Action(GetActionProperties)\r\n getActionProperties(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: GetActionProperties,\r\n ) {\r\n const url = `${this.baseUrl}/action/${action.actionId}/properties?IsMultiLanguageEnabled=${action.isMultiLang ? 'true' : 'false'}`;\r\n\r\n const req$ = this.http.get<Response<PropertyGroup[]>>(url);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.GetProperties,\r\n request$: req$,\r\n onSuccess: (response) => ({\r\n propertyGroups: response.data ?? [],\r\n }),\r\n });\r\n }\r\n\r\n // Selection Actions\r\n\r\n @Action(SelectEvent)\r\n selectEvent(ctx: StateContext<NotificationStateModel>, action: SelectEvent) {\r\n const state = ctx.getState();\r\n const event = state.events.find((e) => e.eventName === action.eventName);\r\n const eventTemplates = state.templates.filter(\r\n (t) => t.eventId === event?.id,\r\n );\r\n ctx.patchState({\r\n selectedEventName: action.eventName,\r\n selectedTemplateId: eventTemplates[0]?.id ?? null,\r\n });\r\n }\r\n\r\n @Action(SelectTemplate)\r\n selectTemplate(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: SelectTemplate,\r\n ) {\r\n ctx.patchState({ selectedTemplateId: action.templateId });\r\n }\r\n\r\n // Receiver CRUD\r\n @Action(AddReceivers)\r\n addReceivers(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: AddReceivers,\r\n ) {\r\n const req$ = this.http.post<Response<ReceiverItem[]>>(\r\n `${this.baseUrl}/templates/${action.templateId}`,\r\n action.payload,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.AddReceivers,\r\n request$: req$,\r\n onSuccess: (response, state) => {\r\n const newReceivers = response.data ?? [];\r\n const templates = this.adapter.updateOne(\r\n state.templates,\r\n action.templateId,\r\n {\r\n receivers: [\r\n ...(state.templates.find((t) => t.id === action.templateId)\r\n ?.receivers ?? []),\r\n ...newReceivers,\r\n ],\r\n },\r\n 'id',\r\n );\r\n return { templates };\r\n },\r\n });\r\n }\r\n\r\n @Action(DeleteReceiver)\r\n deleteReceiver(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: DeleteReceiver,\r\n ) {\r\n const state = ctx.getState();\r\n const template = this.getSelectedTemplate(state);\r\n\r\n if (!template) {\r\n return;\r\n }\r\n\r\n const req$ = this.http.delete<Response<void>>(\r\n `${this.baseUrl}/receivers/${action.receiverId}`,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.DeleteReceiver,\r\n request$: req$,\r\n onSuccess: (_, currentState) => {\r\n const templates = this.adapter.updateOne(\r\n currentState.templates,\r\n template.id,\r\n {\r\n receivers: template.receivers.filter(\r\n (r) => r.id !== action.receiverId,\r\n ),\r\n },\r\n 'id',\r\n );\r\n return { templates };\r\n },\r\n });\r\n }\r\n\r\n // Template CRUD\r\n @Action(AddTemplate)\r\n addTemplate(ctx: StateContext<NotificationStateModel>, action: AddTemplate) {\r\n const req$ = this.http.post<Response<NotificationTemplateItem>>(\r\n `${this.baseUrl}/events/${action.eventId}`,\r\n action.payload,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.AddTemplate,\r\n request$: req$,\r\n onSuccess: (response, state) => {\r\n const newTemplate = response.data;\r\n if (!newTemplate) return {};\r\n\r\n return {\r\n templates: this.adapter.addOne(state.templates, {\r\n ...newTemplate,\r\n eventId: action.eventId,\r\n }),\r\n selectedTemplateId: newTemplate.id,\r\n };\r\n },\r\n });\r\n }\r\n\r\n @Action(UpdateTemplate)\r\n updateTemplate(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: UpdateTemplate,\r\n ) {\r\n const req$ = this.http.put<Response<Partial<NotificationTemplateItem>>>(\r\n `${this.baseUrl}/templates/${action.templateId}`,\r\n action.payload,\r\n {\r\n headers: new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n }),\r\n },\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.UpdateTemplate,\r\n request$: req$,\r\n onSuccess: (response, state) => {\r\n const updatedTemplate = response.data;\r\n if (!updatedTemplate) return {};\r\n\r\n // Preserve existing fields that API may not return or shouldn't change\r\n const existingTemplate = state.templates.find(\r\n (t) => t.id === action.templateId,\r\n );\r\n\r\n if (!existingTemplate) return {};\r\n\r\n // Only update name and content fields, preserve channel/eventId/receivers\r\n const templates = this.adapter.upsertOne(\r\n state.templates,\r\n this.mergeUpdatedTemplate(existingTemplate, updatedTemplate),\r\n 'id',\r\n );\r\n return { templates };\r\n },\r\n });\r\n }\r\n\r\n @Action(DeleteTemplate)\r\n deleteTemplate(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: DeleteTemplate,\r\n ) {\r\n const req$ = this.http.delete<Response<void>>(\r\n `${this.baseUrl}/templates/${action.templateId}`,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.DeleteTemplate,\r\n request$: req$,\r\n onSuccess: (_, state) => {\r\n const templates = this.adapter.removeOne(\r\n state.templates,\r\n action.templateId,\r\n 'id',\r\n );\r\n\r\n // Select first template of current event after deletion\r\n const currentEvent = state.events.find(\r\n (e) => e.eventName === state.selectedEventName,\r\n );\r\n const eventTemplates = templates.filter(\r\n (t) => t.eventId === currentEvent?.id,\r\n );\r\n const systemTemplate = eventTemplates.find((t) => t.isSystem);\r\n\r\n return {\r\n templates,\r\n selectedTemplateId:\r\n systemTemplate?.id ?? eventTemplates[0]?.id ?? null,\r\n };\r\n },\r\n });\r\n }\r\n\r\n // Private Helpers\r\n private getSelectedTemplate(\r\n state: NotificationStateModel,\r\n ): NotificationTemplateItem | null {\r\n return (\r\n state.templates.find((t) => t.id === state.selectedTemplateId) ?? null\r\n );\r\n }\r\n}\r\n","import { Injectable, computed, inject } from '@angular/core';\r\nimport { Store, select } from '@ngxs/store';\r\n\r\nimport {\r\n NotificationActionKey,\r\n AddReceiversPayload,\r\n AddTemplatePayload,\r\n UpdateTemplatePayload,\r\n} from './notification.model';\r\nimport {\r\n AddReceivers,\r\n AddTemplate,\r\n DeleteReceiver,\r\n DeleteTemplate,\r\n GetActionProperties,\r\n GetActionReceivers,\r\n GetEvents,\r\n GetProperties,\r\n GetReceivers,\r\n ResetNotificationState,\r\n SelectEvent,\r\n SelectTemplate,\r\n SetActionMode,\r\n SetModuleInfo,\r\n UpdateTemplate,\r\n} from './notification.actions';\r\nimport { NotificationState } from './notification.state';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class NotificationFacade {\r\n private readonly store = inject(Store);\r\n\r\n // ============================================================================\r\n // Data Selectors - Memoized by NGXS (fine-grained reactivity)\r\n // ============================================================================\r\n readonly events = select(NotificationState.getEvents);\r\n readonly templates = select(NotificationState.getEventTemplates);\r\n readonly receivers = select(NotificationState.getReceivers);\r\n readonly receiverGroups = select(NotificationState.getReceiverGroups);\r\n readonly propertyGroups = select(NotificationState.getPropertyGroups);\r\n\r\n // Selection selectors\r\n readonly selectedEventName = select(NotificationState.getSelectedEventName);\r\n readonly selectedTemplateId = select(NotificationState.getSelectedTemplateId);\r\n readonly selectedEvent = select(NotificationState.getSelectedEvent);\r\n readonly selectedTemplate = select(NotificationState.getSelectedTemplate);\r\n readonly availableReceivers = select(NotificationState.getAvailableReceivers);\r\n readonly availableReceiverGroups = select(\r\n NotificationState.getAvailableReceiverGroups,\r\n );\r\n\r\n // ============================================================================\r\n // Loading/Error Slices - Memoized by NGXS\r\n // ============================================================================\r\n private readonly loadingActive = select(NotificationState.getLoadingActive);\r\n private readonly errors = select(NotificationState.getErrors);\r\n\r\n // ============================================================================\r\n // Loading Signals - Computed from slice (minimal reactivity)\r\n // ============================================================================\r\n readonly isLoadingEvents = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.GetEvents),\r\n );\r\n readonly isLoadingReceivers = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.GetReceivers),\r\n );\r\n readonly isLoadingProperties = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.GetProperties),\r\n );\r\n readonly isAddingReceivers = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.AddReceivers),\r\n );\r\n readonly isDeletingReceiver = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.DeleteReceiver),\r\n );\r\n readonly isAddingTemplate = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.AddTemplate),\r\n );\r\n readonly isUpdatingTemplate = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.UpdateTemplate),\r\n );\r\n readonly isDeletingTemplate = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.DeleteTemplate),\r\n );\r\n\r\n // ============================================================================\r\n // Error Signals - Computed from slice (minimal reactivity)\r\n // ============================================================================\r\n readonly eventsError = computed(\r\n () => this.errors()[NotificationActionKey.GetEvents] ?? null,\r\n );\r\n readonly receiversError = computed(\r\n () => this.errors()[NotificationActionKey.GetReceivers] ?? null,\r\n );\r\n readonly propertiesError = computed(\r\n () => this.errors()[NotificationActionKey.GetProperties] ?? null,\r\n );\r\n\r\n // Action Dispatchers - Configuration\r\n setModuleInfo(\r\n moduleType: string,\r\n moduleId: string | number,\r\n parentModuleType?: string,\r\n parentModuleId?: string | number,\r\n parentPath?: string,\r\n ) {\r\n return this.store.dispatch(\r\n new SetModuleInfo(\r\n moduleType,\r\n moduleId,\r\n parentModuleType,\r\n parentModuleId,\r\n parentPath,\r\n ),\r\n );\r\n }\r\n\r\n resetState() {\r\n return this.store.dispatch(new ResetNotificationState());\r\n }\r\n\r\n // Action Dispatchers - Data Loading\r\n loadEvents() {\r\n return this.store.dispatch(new GetEvents());\r\n }\r\n\r\n loadReceivers() {\r\n return this.store.dispatch(new GetReceivers());\r\n }\r\n\r\n loadProperties(isMultiLang?: boolean) {\r\n return this.store.dispatch(new GetProperties(isMultiLang));\r\n }\r\n\r\n loadPropertiesForCurrentContext(isMultiLang?: boolean) {\r\n const state = this.store.selectSnapshot(NotificationState.getState);\r\n\r\n if (state.isActionMode && state.selectedActionId != null) {\r\n return this.store.dispatch(\r\n new GetActionProperties(state.selectedActionId, isMultiLang),\r\n );\r\n }\r\n\r\n return this.store.dispatch(new GetProperties(isMultiLang));\r\n }\r\n\r\n // Action Dispatchers - Action Mode (Workflow)\r\n setActionMode(actionId: string | number | null) {\r\n return this.store.dispatch(new SetActionMode(actionId));\r\n }\r\n\r\n loadActionReceivers(actionId: string | number) {\r\n return this.store.dispatch(new GetActionReceivers(actionId));\r\n }\r\n\r\n loadActionProperties(actionId: string | number, isMultiLang?: boolean) {\r\n return this.store.dispatch(new GetActionProperties(actionId, isMultiLang));\r\n }\r\n\r\n // Action Dispatchers - Selection\r\n selectEvent(eventName: string) {\r\n return this.store.dispatch(new SelectEvent(eventName));\r\n }\r\n\r\n selectTemplate(templateId: string | number) {\r\n return this.store.dispatch(new SelectTemplate(templateId));\r\n }\r\n\r\n // Action Dispatchers - Receiver CRUD\r\n addReceivers(templateId: string | number, payload: AddReceiversPayload) {\r\n return this.store.dispatch(new AddReceivers(templateId, payload));\r\n }\r\n\r\n deleteReceiver(receiverId: string | number) {\r\n return this.store.dispatch(new DeleteReceiver(receiverId));\r\n }\r\n\r\n // Action Dispatchers - Template CRUD\r\n\r\n addTemplate(eventId: string | number, payload: AddTemplatePayload) {\r\n return this.store.dispatch(new AddTemplate(eventId, payload));\r\n }\r\n\r\n updateTemplate(templateId: string | number, payload: UpdateTemplatePayload) {\r\n return this.store.dispatch(new UpdateTemplate(templateId, payload));\r\n }\r\n\r\n deleteTemplate(templateId: string | number) {\r\n return this.store.dispatch(new DeleteTemplate(templateId));\r\n }\r\n\r\n loadBaseData() {\r\n this.loadEvents();\r\n this.loadReceivers();\r\n }\r\n\r\n /**\r\n * Load all data for normal mode (non-workflow)\r\n */\r\n loadAllData(isMultiLang = true) {\r\n this.loadEvents();\r\n this.loadReceivers();\r\n this.loadPropertiesForCurrentContext(isMultiLang);\r\n }\r\n}\r\n","import {\r\n Component,\r\n ChangeDetectionStrategy,\r\n inject,\r\n signal,\r\n computed,\r\n effect,\r\n untracked,\r\n} from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { TranslocoModule, TranslocoService } from '@jsverse/transloco';\r\n\r\n// Components\r\nimport { Card } from '@masterteam/components/card';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { SelectField } from '@masterteam/components/select-field';\r\nimport { TextField } from '@masterteam/components/text-field';\r\nimport { TextareaField } from '@masterteam/components/textarea-field';\r\nimport { EditorField } from '@masterteam/components/editor-field';\r\nimport { ToggleField } from '@masterteam/components/toggle-field';\r\nimport { Tabs } from '@masterteam/components/tabs';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { ConfirmationService } from '@masterteam/components/confirmation';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { Skeleton } from 'primeng/skeleton';\r\n\r\n// Dialog\r\nimport { AddTemplateDialog } from '../add-template-dialog/add-template-dialog';\r\n\r\n// Store\r\nimport {\r\n NotificationFacade,\r\n NotificationChannel,\r\n NotificationTemplateItem,\r\n ReceiverItem,\r\n UpdateTemplatePayload,\r\n CHANNEL_CONFIGS,\r\n ChannelConfig,\r\n getChannelConfig,\r\n} from '../../store/notification';\r\n\r\n@Component({\r\n selector: 'mt-notification-template',\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n TranslocoModule,\r\n Card,\r\n Button,\r\n SelectField,\r\n TextField,\r\n TextareaField,\r\n EditorField,\r\n ToggleField,\r\n Tabs,\r\n Icon,\r\n Skeleton,\r\n ],\r\n templateUrl: './notification-template.html',\r\n styleUrl: './notification-template.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class NotificationTemplate {\r\n private readonly facade = inject(NotificationFacade);\r\n private readonly transloco = inject(TranslocoService);\r\n private readonly confirmationService = inject(ConfirmationService);\r\n private readonly modalService = inject(ModalService);\r\n\r\n // ============================================================================\r\n // Data Signals from Facade\r\n // ============================================================================\r\n readonly events = this.facade.events;\r\n readonly templates = this.facade.templates;\r\n readonly receivers = this.facade.receivers;\r\n readonly propertyGroups = this.facade.propertyGroups;\r\n\r\n // Selection Signals\r\n readonly selectedEventName = this.facade.selectedEventName;\r\n readonly selectedTemplateId = this.facade.selectedTemplateId;\r\n readonly selectedEvent = this.facade.selectedEvent;\r\n readonly selectedTemplate = this.facade.selectedTemplate;\r\n readonly availableReceivers = this.facade.availableReceivers;\r\n readonly availableReceiverGroups = this.facade.availableReceiverGroups;\r\n\r\n // ============================================================================\r\n // Loading States from Facade\r\n // ============================================================================\r\n readonly isLoadingEvents = this.facade.isLoadingEvents;\r\n readonly isLoadingReceivers = this.facade.isLoadingReceivers;\r\n readonly isLoadingProperties = this.facade.isLoadingProperties;\r\n readonly isUpdatingTemplate = this.facade.isUpdatingTemplate;\r\n readonly isDeletingTemplate = this.facade.isDeletingTemplate;\r\n readonly isAddingTemplate = this.facade.isAddingTemplate;\r\n\r\n // ============================================================================\r\n // Error States from Facade\r\n // ============================================================================\r\n readonly eventsError = this.facade.eventsError;\r\n readonly propertiesError = this.facade.propertiesError;\r\n\r\n // ============================================================================\r\n // Local State\r\n // ============================================================================\r\n readonly deletingReceiverIds = signal<(string | number)[]>([]);\r\n readonly addingReceiverIds = signal<(string | number)[]>([]);\r\n\r\n // ============================================================================\r\n // Form - Dynamic controls based on CHANNEL_CONFIGS\r\n // ============================================================================\r\n readonly form = this.buildForm();\r\n readonly propertyPickerControl = new FormControl<string | null>(null);\r\n readonly receiverPickerControl = new FormControl<string | number | null>(\r\n null,\r\n );\r\n private readonly channelControl = this.form.controls[\r\n 'channel'\r\n ] as FormControl<NotificationChannel>;\r\n readonly channelSignal = toSignal(this.channelControl.valueChanges, {\r\n initialValue: this.channelControl.value,\r\n });\r\n private buildForm(): FormGroup {\r\n const fc = (v = '') => new FormControl<string>(v, { nonNullable: true });\r\n const controls: Record<string, FormControl | FormGroup> = {\r\n event: new FormControl<string | null>(null),\r\n name: fc(),\r\n channel: new FormControl<NotificationChannel>('email', {\r\n nonNullable: true,\r\n }),\r\n };\r\n\r\n for (const ch of CHANNEL_CONFIGS) {\r\n if (ch.templateKey) controls[ch.templateKey] = fc();\r\n if (ch.translatableKey) {\r\n // Nested FormGroup to match payload structure { en: '', ar: '' }\r\n controls[ch.translatableKey] = new FormGroup({\r\n en: fc(),\r\n ar: fc(),\r\n });\r\n }\r\n if (ch.bilingualOptional) {\r\n controls[`${ch.key}Bilingual`] = new FormControl<boolean>(false, {\r\n nonNullable: true,\r\n });\r\n }\r\n }\r\n return new FormGroup(controls);\r\n }\r\n\r\n // ============================================================================\r\n // Computed\r\n // ============================================================================\r\n readonly channelConfigs = CHANNEL_CONFIGS;\r\n\r\n /** Check if channel should show bilingual fields - reads from form */\r\n isBilingual(ch: ChannelConfig): boolean {\r\n if (!ch.supportsBilingual) return false;\r\n if (!ch.bilingualOptional) return true; // forced bilingual (app)\r\n return this.form.controls[`${ch.key}Bilingual`]?.value ?? false;\r\n }\r\n\r\n readonly channelOptions = computed(() =>\r\n CHANNEL_CONFIGS.map((c) => ({\r\n ...c,\r\n name: this.transloco.translate(c.labelKey),\r\n })),\r\n );\r\n\r\n /** Templates of the selected event, rendered as tabs. */\r\n readonly templateTabs = computed(() =>\r\n this.templates().map((t) => ({\r\n label: t.name,\r\n value: t.id,\r\n isSystem: t.isSystem,\r\n })),\r\n );\r\n\r\n readonly activeChannel = computed<NotificationChannel>(\r\n () => this.selectedTemplate()?.channel ?? this.channelSignal(),\r\n );\r\n\r\n readonly shouldUseMultilingualProperties = computed(\r\n () => this.activeChannel() !== 'app',\r\n );\r\n\r\n readonly isFormInvalid = computed(\r\n () => !this.form.controls['name'].value?.trim(),\r\n );\r\n\r\n constructor() {\r\n effect(() => {\r\n const eventName = this.selectedEventName();\r\n if (eventName && this.form.controls['event'].value !== eventName) {\r\n this.form.controls['event'].setValue(eventName, { emitEvent: false });\r\n }\r\n });\r\n\r\n effect(() => {\r\n this.selectedTemplateId(); // depend on selected template id\r\n const template = untracked(this.selectedTemplate);\r\n if (template) this.patchForm(template);\r\n });\r\n\r\n effect(() => {\r\n const template = this.selectedTemplate();\r\n if (!template) {\r\n return;\r\n }\r\n\r\n this.facade.loadPropertiesForCurrentContext(\r\n this.shouldUseMultilingualProperties(),\r\n );\r\n });\r\n }\r\n\r\n // ============================================================================\r\n // Event Handlers\r\n // ============================================================================\r\n onEventChange(eventName: string): void {\r\n if (eventName) this.facade.selectEvent(eventName);\r\n }\r\n\r\n onTemplateTabChange(templateId: string | number): void {\r\n this.facade.selectTemplate(templateId);\r\n }\r\n\r\n // Channel is fixed per template - set on creation only\r\n\r\n onAddProperty(propertyKey: string): void {\r\n if (!propertyKey) return;\r\n\r\n const tag = `{{${propertyKey}}}`;\r\n const ch = getChannelConfig(this.form.controls['channel'].value);\r\n\r\n if (this.isBilingual(ch) && ch.translatableKey) {\r\n const group = this.form.get(ch.translatableKey) as FormGroup;\r\n if (group) {\r\n const enCtrl = group.get('en') as FormControl<string>;\r\n const arCtrl = group.get('ar') as FormControl<string>;\r\n enCtrl?.setValue(`${enCtrl.value ?? ''} ${tag}`);\r\n arCtrl?.setValue(`${arCtrl.value ?? ''} ${tag}`);\r\n }\r\n } else if (ch.templateKey) {\r\n this.appendToControl(ch.templateKey, tag);\r\n }\r\n\r\n setTimeout(() => {\r\n this.propertyPickerControl.reset();\r\n }, 0);\r\n }\r\n\r\n onAddReceiver(receiverId: string | number): void {\r\n const template = this.selectedTemplate();\r\n if (!receiverId || !template) {\r\n setTimeout(() => this.receiverPickerControl.reset(), 0);\r\n return;\r\n }\r\n if (this.addingReceiverIds().includes(receiverId)) {\r\n setTimeout(() => this.receiverPickerControl.reset(), 0);\r\n return;\r\n }\r\n const selectedReceiver = this.availableReceivers().find(\r\n (r) => r.id === receiverId,\r\n );\r\n if (!selectedReceiver) {\r\n setTimeout(() => this.receiverPickerControl.reset(), 0);\r\n return;\r\n }\r\n this.addingReceiverIds.update((ids) => [...ids, receiverId]);\r\n this.facade\r\n .addReceivers(template.id, {\r\n receivers: [\r\n {\r\n id: selectedReceiver.id,\r\n type: selectedReceiver.type,\r\n },\r\n ],\r\n })\r\n .subscribe({\r\n complete: () =>\r\n this.addingReceiverIds.update((ids) =>\r\n ids.filter((id) => id !== receiverId),\r\n ),\r\n error: () =>\r\n this.addingReceiverIds.update((ids) =>\r\n ids.filter((id) => id !== receiverId),\r\n ),\r\n });\r\n setTimeout(() => this.receiverPickerControl.reset(), 0);\r\n }\r\n\r\n onDeleteReceiver(receiver: ReceiverItem): void {\r\n this.confirmationService.confirmDelete({\r\n type: 'dialog',\r\n accept: () => {\r\n this.deletingReceiverIds.update((ids) => [...ids, receiver.id]);\r\n this.facade.deleteReceiver(receiver.id).subscribe({\r\n complete: () => {\r\n this.deletingReceiverIds.update((ids) =>\r\n ids.filter((id) => id !== receiver.id),\r\n );\r\n },\r\n error: () => {\r\n this.deletingReceiverIds.update((ids) =>\r\n ids.filter((id) => id !== receiver.id),\r\n );\r\n },\r\n });\r\n },\r\n });\r\n }\r\n\r\n isReceiverDeleting(receiverId: string | number): boolean {\r\n return this.deletingReceiverIds().includes(receiverId);\r\n }\r\n\r\n onSaveTemplate(): void {\r\n const template = this.selectedTemplate();\r\n if (!template || this.isFormInvalid()) {\r\n this.form.markAllAsTouched();\r\n return;\r\n }\r\n\r\n // Build payload dynamically from all channel controls\r\n const payload = this.buildUpdatePayload(template);\r\n this.facade.updateTemplate(template.id, payload);\r\n }\r\n\r\n onDeleteTemplate(): void {\r\n const template = this.selectedTemplate();\r\n if (!template || template.isSystem) return;\r\n\r\n this.confirmationService.confirm({\r\n type: 'dialog',\r\n message: this.transloco.translate('notification.deleteTemplateMessage'),\r\n icon: 'general.trash-01',\r\n acceptButton: { severity: 'danger' },\r\n accept: () => this.facade.deleteTemplate(template.id),\r\n });\r\n }\r\n\r\n onAddTemplateClick(): void {\r\n const event = this.selectedEvent();\r\n if (!event) return;\r\n\r\n const ref = this.modalService.openModal(AddTemplateDialog, 'dialog', {\r\n header: this.transloco.translate('notification.addTemplate'),\r\n styleClass: '!w-[25rem]',\r\n });\r\n\r\n ref.onClose.subscribe((result: { name: string } | undefined) => {\r\n if (result?.name) {\r\n this.facade.addTemplate(event.id, {\r\n name: result.name,\r\n channel: this.form.controls['channel'].value,\r\n });\r\n }\r\n });\r\n }\r\n\r\n // ============================================================================\r\n // Private Methods\r\n // ============================================================================\r\n private appendToControl(key: string, value: string): void {\r\n const ctrl = this.form.controls[key] as FormControl<string>;\r\n ctrl?.setValue(`${ctrl.value ?? ''} ${value}`);\r\n }\r\n\r\n private patchForm(template: NotificationTemplateItem): void {\r\n const channel = template.channel || 'email';\r\n\r\n this.form.patchValue({\r\n name: template.name,\r\n channel: channel,\r\n });\r\n\r\n // Patch all channel controls dynamically\r\n const t = template as unknown as Record<string, unknown>;\r\n for (const ch of CHANNEL_CONFIGS) {\r\n if (ch.templateKey) {\r\n this.form\r\n .get(ch.templateKey)\r\n ?.setValue((t[ch.templateKey] as string) ?? '');\r\n }\r\n if (ch.translatableKey) {\r\n const trans =\r\n (t[ch.translatableKey] as { en?: string; ar?: string }) ?? {};\r\n this.form.get(ch.translatableKey)?.patchValue({\r\n en: trans.en ?? '',\r\n ar: trans.ar ?? '',\r\n });\r\n }\r\n }\r\n }\r\n\r\n private buildUpdatePayload(\r\n template: NotificationTemplateItem,\r\n ): UpdateTemplatePayload {\r\n const title = this.form.controls['name'].value?.trim() || template.name;\r\n\r\n // The backend treats this PUT as a full replace: any channel template\r\n // omitted from the payload is nulled out. Always send email/sms/app\r\n // together — patchForm() populates every channel control from the loaded\r\n // template, so channels not edited this session keep their values.\r\n const payload: UpdateTemplatePayload = { title };\r\n const target = payload as unknown as Record<string, unknown>;\r\n\r\n for (const ch of CHANNEL_CONFIGS) {\r\n if (ch.templateKey) {\r\n target[ch.templateKey] = this.getTemplateControlValue(ch.templateKey);\r\n }\r\n if (ch.translatableKey) {\r\n target[ch.translatableKey] = this.getTranslatableControlValue(\r\n ch.translatableKey,\r\n );\r\n }\r\n }\r\n\r\n return payload;\r\n }\r\n\r\n private getTemplateControlValue(controlName: string): string {\r\n const control = this.form.get(controlName) as FormControl<string> | null;\r\n return control?.value ?? '';\r\n }\r\n\r\n private getTranslatableControlValue(controlName: string): {\r\n en: string;\r\n ar: string;\r\n } {\r\n const group = this.form.get(controlName) as FormGroup | null;\r\n const value = group?.getRawValue() as\r\n | { en?: string | null; ar?: string | null }\r\n | undefined;\r\n\r\n return {\r\n en: value?.en ?? '',\r\n ar: value?.ar ?? '',\r\n };\r\n }\r\n}\r\n\r\nexport default NotificationTemplate;\r\n","<div class=\"flex flex-col gap-4 p-4\" [formGroup]=\"form\">\r\n <!-- Loading State -->\r\n @if (isLoadingEvents()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"w-1/2\">\r\n <p-skeleton width=\"4rem\" height=\"1rem\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <div class=\"flex items-center justify-between\">\r\n <div class=\"flex gap-2\">\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <p-skeleton width=\"8rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"100%\" height=\"8rem\" borderRadius=\"0.5rem\" />\r\n <div class=\"flex justify-end gap-2 pt-4\">\r\n <p-skeleton width=\"6rem\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"6rem\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n </div>\r\n } @else if (events().length === 0) {\r\n <!-- Empty State -->\r\n <mt-card>\r\n <div\r\n class=\"flex flex-col items-center justify-center py-12 text-slate-500\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mb-2 h-12 w-12\" />\r\n <p>{{ \"notification.noEventsFound\" | transloco }}</p>\r\n </div>\r\n </mt-card>\r\n } @else {\r\n <!-- Event Selector -->\r\n <div class=\"w-1/2\">\r\n <mt-select-field\r\n formControlName=\"event\"\r\n [options]=\"events()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'eventName'\"\r\n [label]=\"'notification.events' | transloco\"\r\n [placeholder]=\"'notification.selectEvent' | transloco\"\r\n [required]=\"true\"\r\n [filter]=\"false\"\r\n (onChange)=\"onEventChange($event)\"\r\n />\r\n </div>\r\n\r\n @if (selectedEvent()) {\r\n <!-- Template Tabs + Add notification -->\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <mt-tabs\r\n [active]=\"selectedTemplateId()\"\r\n [options]=\"templateTabs()\"\r\n (activeChange)=\"onTemplateTabChange($event)\"\r\n />\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"'notification.addNotification' | transloco\"\r\n size=\"small\"\r\n [loading]=\"isAddingTemplate()\"\r\n (onClick)=\"onAddTemplateClick()\"\r\n />\r\n </div>\r\n\r\n <!-- Template Content -->\r\n @if (selectedTemplate(); as template) {\r\n <div class=\"flex flex-col gap-4\">\r\n <!-- Name -->\r\n <div class=\"w-full\">\r\n <mt-text-field\r\n formControlName=\"name\"\r\n [label]=\"'notification.name' | transloco\"\r\n [placeholder]=\"'notification.enterName' | transloco\"\r\n [required]=\"true\"\r\n />\r\n </div>\r\n <!-- Channel & Properties Picker -->\r\n <div class=\"flex flex-col gap-4\">\r\n <mt-select-field\r\n formControlName=\"channel\"\r\n [options]=\"channelOptions()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'key'\"\r\n [label]=\"'notification.channel.label' | transloco\"\r\n [placeholder]=\"'notification.selectChannel' | transloco\"\r\n [required]=\"true\"\r\n [filter]=\"false\"\r\n [disabled]=\"true\"\r\n />\r\n <mt-select-field\r\n [options]=\"propertyGroups()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'key'\"\r\n [group]=\"true\"\r\n [optionGroupLabel]=\"'groupName'\"\r\n [optionGroupChildren]=\"'properties'\"\r\n [label]=\"'notification.propertiesList' | transloco\"\r\n [placeholder]=\"'notification.selectProperty' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [filter]=\"true\"\r\n [filterBy]=\"'name'\"\r\n [loading]=\"isLoadingProperties()\"\r\n [formControl]=\"propertyPickerControl\"\r\n (onChange)=\"onAddProperty($event)\"\r\n />\r\n </div>\r\n <!-- Channel Content Editors -->\r\n @for (ch of channelConfigs; track ch.key) {\r\n @if (form.controls[\"channel\"].value === ch.key) {\r\n <!-- Bilingual Content Fields -->\r\n @if (isBilingual(ch) && ch.translatableKey) {\r\n <ng-container [formGroupName]=\"ch.translatableKey\">\r\n @if (ch.useRichEditor) {\r\n <mt-editor-field\r\n formControlName=\"en\"\r\n [label]=\"'notification.english' | transloco\"\r\n dir=\"ltr\"\r\n />\r\n <mt-editor-field\r\n formControlName=\"ar\"\r\n [label]=\"'notification.arabic' | transloco\"\r\n dir=\"rtl\"\r\n />\r\n } @else {\r\n <mt-textarea-field\r\n formControlName=\"en\"\r\n [label]=\"'notification.english' | transloco\"\r\n [rows]=\"'6'\"\r\n dir=\"ltr\"\r\n />\r\n <mt-textarea-field\r\n formControlName=\"ar\"\r\n [label]=\"'notification.arabic' | transloco\"\r\n [rows]=\"'6'\"\r\n dir=\"rtl\"\r\n />\r\n }\r\n </ng-container>\r\n } @else if (ch.templateKey) {\r\n <!-- Non-Bilingual Content Field -->\r\n @if (ch.useRichEditor) {\r\n <mt-editor-field\r\n [formControlName]=\"ch.templateKey\"\r\n [label]=\"'notification.notificationBody' | transloco\"\r\n />\r\n } @else {\r\n <mt-textarea-field\r\n [formControlName]=\"ch.templateKey\"\r\n [label]=\"'notification.notificationBody' | transloco\"\r\n [rows]=\"'6'\"\r\n />\r\n }\r\n }\r\n <!-- Bilingual Toggle -->\r\n @if (ch.bilingualOptional) {\r\n <mt-toggle-field\r\n [formControlName]=\"ch.key + 'Bilingual'\"\r\n [label]=\"'notification.bilingual' | transloco\"\r\n />\r\n }\r\n }\r\n }\r\n <!-- Receivers -->\r\n <div class=\"w-full\">\r\n <mt-select-field\r\n [options]=\"availableReceiverGroups()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'id'\"\r\n [group]=\"true\"\r\n [optionGroupLabel]=\"'groupName'\"\r\n [optionGroupChildren]=\"'items'\"\r\n [label]=\"'notification.receivers' | transloco\"\r\n [placeholder]=\"'notification.selectReceiver' | transloco\"\r\n [filter]=\"true\"\r\n [filterBy]=\"'name'\"\r\n [loading]=\"isLoadingReceivers()\"\r\n [formControl]=\"receiverPickerControl\"\r\n (onChange)=\"onAddReceiver($event)\"\r\n />\r\n </div>\r\n @if ((template.receivers ?? []).length > 0) {\r\n <div class=\"flex w-full flex-wrap gap-2\">\r\n @for (receiver of template.receivers; track receiver.id) {\r\n <div\r\n class=\"flex items-center gap-2 rounded-full border border-surface bg-surface-50 py-1 pe-2 ps-3 text-sm transition-colors hover:bg-surface-100\"\r\n >\r\n <mt-icon\r\n icon=\"user.user-01\"\r\n class=\"h-4 w-4 shrink-0 text-slate-500\"\r\n />\r\n <span class=\"font-medium\">{{ receiver.name?.display }}</span>\r\n @if (!receiver.isSystem) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [text]=\"true\"\r\n [loading]=\"isReceiverDeleting(receiver.id)\"\r\n (onClick)=\"onDeleteReceiver(receiver)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n <!-- Actions -->\r\n <div class=\"flex justify-end gap-2 pt-4\">\r\n @if (!template.isSystem) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [label]=\"'notification.delete' | transloco\"\r\n severity=\"danger\"\r\n [loading]=\"isDeletingTemplate()\"\r\n [disabled]=\"isUpdatingTemplate()\"\r\n (onClick)=\"onDeleteTemplate()\"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.save-01\"\r\n [label]=\"'notification.save' | transloco\"\r\n [loading]=\"isUpdatingTemplate()\"\r\n [disabled]=\"isDeletingTemplate() || isFormInvalid()\"\r\n (onClick)=\"onSaveTemplate()\"\r\n />\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- No template selected -->\r\n <div\r\n class=\"flex flex-col items-center justify-center py-12 text-slate-500\"\r\n >\r\n <mt-icon icon=\"alert.bell-01\" class=\"mb-2 h-12 w-12\" />\r\n <p>{{ \"notification.selectTemplatePrompt\" | transloco }}</p>\r\n </div>\r\n }\r\n }\r\n }\r\n</div>\r\n","import { NotificationState } from './notification/notification.state';\r\n\r\nexport const APP_STATES = [NotificationState];\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAqBa,iBAAiB,CAAA;AACnB,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AAC3B,IAAA,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC;AAEvC,IAAA,IAAI,GAAG,KAAK,CAAM,IAAI,2EAAC;AAEvB,IAAA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,IAAI,EAAA,QAAA,EAAA,SAAA,EAAA,MAAA,EAAA,CAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EACJ,QAAQ,EAAA,QAAA,EAAA,YAAA,EAAA,MAAA,EAAA,CAAA,YAAA,EAAA,OAAA,EAAA,WAAA,EAAA,cAAA,EAAA,MAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,aAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAMC,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAtBhC,SAAS;+BACE,0BAA0B,EAAA,UAAA,EACxB,IAAI,EAAA,OAAA,EACP;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,eAAe;wBACf,IAAI;wBACJ,MAAM;wBACN,WAAW;wBACX,SAAS;wBACT,aAAa;wBACb,WAAW;wBACX,WAAW;wBACX,IAAI;wBACJ,IAAI;wBACJ,QAAQ;qBACT,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,omUAAA,EAAA,MAAA,EAAA,CAAA,iUAAA,CAAA,EAAA;;;AE7D1C,MAAM,UAAU,GAAG,CAAC,iBAAiB;;ACF5C;;AAEG;;;;"}
1
+ {"version":3,"file":"masterteam-notification.mjs","sources":["../../../../packages/masterteam/notification/src/lib/add-template-dialog/add-template-dialog.ts","../../../../packages/masterteam/notification/src/lib/add-template-dialog/add-template-dialog.html","../../../../packages/masterteam/notification/src/store/notification/notification.model.ts","../../../../packages/masterteam/notification/src/store/notification/notification.actions.ts","../../../../packages/masterteam/notification/src/store/notification/notification.state.ts","../../../../packages/masterteam/notification/src/store/notification/notification.facade.ts","../../../../packages/masterteam/notification/src/lib/notification-template/notification-template.ts","../../../../packages/masterteam/notification/src/lib/notification-template/notification-template.html","../../../../packages/masterteam/notification/src/store/app.state.ts","../../../../packages/masterteam/notification/src/masterteam-notification.ts"],"sourcesContent":["import { Component, inject, input } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport { TranslocoModule } from '@jsverse/transloco';\r\nimport { ModalRef } from '@masterteam/components/dialog';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { TextField } from '@masterteam/components/text-field';\r\nimport { Button } from '@masterteam/components/button';\r\n\r\n@Component({\r\n selector: 'mt-add-template-dialog',\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n TranslocoModule,\r\n TextField,\r\n Button,\r\n ],\r\n templateUrl: './add-template-dialog.html',\r\n})\r\nexport class AddTemplateDialog {\r\n readonly modalService = inject(ModalService);\r\n private readonly ref = inject(ModalRef);\r\n\r\n data = input<any>(null);\r\n\r\n templateNameControl = new FormControl<string>('', [Validators.required]);\r\n\r\n onSave(): void {\r\n if (this.templateNameControl.valid) {\r\n this.ref.close({ name: this.templateNameControl.value?.trim() });\r\n }\r\n }\r\n\r\n onCancel(): void {\r\n this.ref.close();\r\n }\r\n}\r\n","<div [class]=\"modalService.contentClass\" class=\"p-4\">\r\n <mt-text-field\r\n [formControl]=\"templateNameControl\"\r\n [label]=\"'notification.templateName' | transloco\"\r\n [placeholder]=\"'notification.enterTemplateName' | transloco\"\r\n [required]=\"true\"\r\n />\r\n</div>\r\n\r\n<div [class]=\"modalService.footerClass\">\r\n <mt-button\r\n [label]=\"'notification.cancel' | transloco\"\r\n variant=\"outlined\"\r\n (onClick)=\"onCancel()\"\r\n />\r\n <mt-button\r\n [label]=\"'notification.save' | transloco\"\r\n [disabled]=\"!templateNameControl.valid\"\r\n (onClick)=\"onSave()\"\r\n />\r\n</div>\r\n","import type { LoadingStateShape } from '@masterteam/components';\r\n\r\n// ============================================================================\r\n// Action Keys Enum\r\n// ============================================================================\r\nexport enum NotificationActionKey {\r\n GetEvents = 'getEvents',\r\n GetReceivers = 'getReceivers',\r\n GetProperties = 'getProperties',\r\n AddReceivers = 'addReceivers',\r\n DeleteReceiver = 'deleteReceiver',\r\n AddTemplate = 'addTemplate',\r\n UpdateTemplate = 'updateTemplate',\r\n DeleteTemplate = 'deleteTemplate',\r\n}\r\n\r\n// ============================================================================\r\n// Channel Types\r\n// ============================================================================\r\nexport type NotificationChannel = 'email' | 'sms' | 'app';\r\n\r\nexport interface ChannelConfig {\r\n key: NotificationChannel;\r\n labelKey: string;\r\n /** Whether this channel supports bilingual content */\r\n supportsBilingual: boolean;\r\n /** Whether bilingual is optional (true = show toggle) */\r\n bilingualOptional: boolean;\r\n /** Whether this channel uses rich text editor (false = textarea) */\r\n useRichEditor: boolean;\r\n /** Payload key for non-bilingual template (string value) */\r\n templateKey?: string;\r\n /** Payload key for bilingual template (object with en/ar) */\r\n translatableKey?: string;\r\n}\r\n\r\nexport const CHANNEL_CONFIGS: ChannelConfig[] = [\r\n {\r\n key: 'email',\r\n labelKey: 'notification.channel.email',\r\n supportsBilingual: false,\r\n bilingualOptional: false,\r\n useRichEditor: true,\r\n templateKey: 'emailTemplate',\r\n },\r\n {\r\n key: 'sms',\r\n labelKey: 'notification.channel.sms',\r\n supportsBilingual: false,\r\n bilingualOptional: false,\r\n useRichEditor: false,\r\n templateKey: 'smsTemplate',\r\n },\r\n {\r\n key: 'app',\r\n labelKey: 'notification.channel.app',\r\n supportsBilingual: true,\r\n bilingualOptional: false,\r\n useRichEditor: true,\r\n translatableKey: 'appTemplate',\r\n },\r\n];\r\n\r\n/** Helper to get channel config by key */\r\nexport function getChannelConfig(key: NotificationChannel): ChannelConfig {\r\n return CHANNEL_CONFIGS.find((c) => c.key === key) ?? CHANNEL_CONFIGS[0];\r\n}\r\n\r\n/** Build form control name for a channel field */\r\nexport function getFormControlName(\r\n ch: ChannelConfig,\r\n type: 'single' | 'en' | 'ar',\r\n): string | null {\r\n if (type === 'single') return ch.templateKey ?? null;\r\n if (!ch.translatableKey) return null;\r\n return type === 'en'\r\n ? `${ch.translatableKey}.en`\r\n : `${ch.translatableKey}.ar`;\r\n}\r\n\r\n// ============================================================================\r\n// Translatable Content\r\n// ============================================================================\r\nexport interface TranslatableContent {\r\n en: string;\r\n ar: string;\r\n}\r\n\r\n// ============================================================================\r\n// Receiver Types\r\n// ============================================================================\r\nexport interface ReceiverItem {\r\n id: string | number;\r\n identifier: string;\r\n name: any;\r\n type: string;\r\n isSystem?: boolean;\r\n}\r\n\r\nexport interface ReceiverGroup {\r\n groupName: string;\r\n items: ReceiverItem[] | ReceiverSubGroup[];\r\n}\r\n\r\nexport interface ReceiverSubGroup {\r\n subGroupName: string;\r\n items: ReceiverItem[];\r\n}\r\n\r\nexport interface ReceiverOptionGroup {\r\n groupName: string;\r\n items: ReceiverItem[];\r\n}\r\n\r\n// ============================================================================\r\n// Property Types\r\n// ============================================================================\r\nexport interface NotificationProperty {\r\n key: string;\r\n name: string;\r\n groupName?: string;\r\n}\r\n\r\nexport interface PropertyGroup {\r\n groupName: string;\r\n properties: NotificationProperty[];\r\n}\r\n\r\n// ============================================================================\r\n// Template Types\r\n// ============================================================================\r\nexport interface NotificationTemplateItem {\r\n id: string | number;\r\n eventId: string | number; // Link to parent event\r\n name: string;\r\n isSystem: boolean;\r\n channel: NotificationChannel;\r\n receivers: ReceiverItem[];\r\n emailTemplate: string;\r\n emailContentTranslatable: TranslatableContent;\r\n smsTemplate: string;\r\n appTemplate: TranslatableContent;\r\n conditionFormula?: string;\r\n}\r\n\r\n// ============================================================================\r\n// Event Types\r\n// ============================================================================\r\nexport interface NotificationEvent {\r\n id: string | number;\r\n eventName: string;\r\n name: string;\r\n}\r\n\r\n// ============================================================================\r\n// Action Types (Workflow)\r\n// ============================================================================\r\nexport interface NotificationAction {\r\n id: string | number;\r\n name: string;\r\n type: string;\r\n}\r\n\r\nexport interface ActionGroup {\r\n activity: string;\r\n items: NotificationAction[];\r\n}\r\n\r\n// ============================================================================\r\n// Payloads\r\n// ============================================================================\r\nexport interface ReceiverPayloadItem {\r\n id: string | number;\r\n type: string;\r\n}\r\n\r\nexport interface AddReceiversPayload {\r\n receivers: ReceiverPayloadItem[];\r\n}\r\n\r\nexport interface AddTemplatePayload {\r\n name: string;\r\n channel: NotificationChannel;\r\n}\r\n\r\nexport interface UpdateTemplatePayload {\r\n title: string;\r\n emailTemplate?: string;\r\n emailContentTranslatable?: TranslatableContent;\r\n smsTemplate?: string;\r\n appTemplate?: TranslatableContent;\r\n conditionFormula?: string;\r\n}\r\n\r\n// ============================================================================\r\n// State Model\r\n// ============================================================================\r\nexport interface NotificationStateModel extends LoadingStateShape<NotificationActionKey> {\r\n // Module configuration\r\n moduleType: string | null;\r\n moduleId: string | number | null;\r\n parentModuleType: string | null;\r\n parentModuleId: string | number | null;\r\n parentPath: string;\r\n\r\n // Action mode (for workflow)\r\n isActionMode: boolean;\r\n selectedActionId: string | number | null;\r\n\r\n // Data collections\r\n events: NotificationEvent[];\r\n templates: NotificationTemplateItem[]; // Flattened templates\r\n actions: NotificationAction[];\r\n receivers: ReceiverItem[];\r\n receiverGroups: ReceiverOptionGroup[];\r\n propertyGroups: PropertyGroup[];\r\n\r\n // Selection state\r\n selectedEventName: string | null;\r\n selectedTemplateId: string | number | null;\r\n}\r\n","import type {\r\n AddReceiversPayload,\r\n AddTemplatePayload,\r\n UpdateTemplatePayload,\r\n} from './notification.model';\r\n\r\n// ============================================================================\r\n// Module Configuration\r\n// ============================================================================\r\nexport class SetModuleInfo {\r\n static readonly type = '[Notification] Set Module Info';\r\n constructor(\r\n public moduleType: string,\r\n public moduleId: string | number,\r\n public parentModuleType?: string,\r\n public parentModuleId?: string | number,\r\n public parentPath?: string,\r\n ) {}\r\n}\r\n\r\n// ============================================================================\r\n// Data Loading Actions\r\n// ============================================================================\r\nexport class GetEvents {\r\n static readonly type = '[Notification] Get Events';\r\n}\r\n\r\nexport class GetReceivers {\r\n static readonly type = '[Notification] Get Receivers';\r\n}\r\n\r\nexport class GetProperties {\r\n static readonly type = '[Notification] Get Properties';\r\n constructor(public isMultiLang?: boolean) {}\r\n}\r\n\r\n// ============================================================================\r\n// Action Mode (Workflow)\r\n// ============================================================================\r\nexport class SetActionMode {\r\n static readonly type = '[Notification] Set Action Mode';\r\n constructor(public actionId: string | number | null) {}\r\n}\r\n\r\nexport class GetActionReceivers {\r\n static readonly type = '[Notification] Get Action Receivers';\r\n constructor(public actionId: string | number) {}\r\n}\r\n\r\nexport class GetActionProperties {\r\n static readonly type = '[Notification] Get Action Properties';\r\n constructor(\r\n public actionId: string | number,\r\n public isMultiLang?: boolean,\r\n ) {}\r\n}\r\n\r\n// ============================================================================\r\n// Selection Actions\r\n// ============================================================================\r\nexport class SelectEvent {\r\n static readonly type = '[Notification] Select Event';\r\n constructor(public eventName: string) {}\r\n}\r\n\r\nexport class SelectTemplate {\r\n static readonly type = '[Notification] Select Template';\r\n constructor(public templateId: string | number) {}\r\n}\r\n\r\n// ============================================================================\r\n// Receiver CRUD\r\n// ============================================================================\r\nexport class AddReceivers {\r\n static readonly type = '[Notification] Add Receivers';\r\n constructor(\r\n public templateId: string | number,\r\n public payload: AddReceiversPayload,\r\n ) {}\r\n}\r\n\r\nexport class DeleteReceiver {\r\n static readonly type = '[Notification] Delete Receiver';\r\n constructor(public receiverId: string | number) {}\r\n}\r\n\r\n// ============================================================================\r\n// Template CRUD\r\n// ============================================================================\r\nexport class AddTemplate {\r\n static readonly type = '[Notification] Add Template';\r\n constructor(\r\n public eventId: string | number,\r\n public payload: AddTemplatePayload,\r\n ) {}\r\n}\r\n\r\nexport class UpdateTemplate {\r\n static readonly type = '[Notification] Update Template';\r\n constructor(\r\n public templateId: string | number,\r\n public payload: UpdateTemplatePayload,\r\n ) {}\r\n}\r\n\r\nexport class DeleteTemplate {\r\n static readonly type = '[Notification] Delete Template';\r\n constructor(public templateId: string | number) {}\r\n}\r\n\r\n// ============================================================================\r\n// Reset State\r\n// ============================================================================\r\nexport class ResetNotificationState {\r\n static readonly type = '[Notification] Reset State';\r\n}\r\n","import { HttpClient, HttpHeaders } from '@angular/common/http';\r\nimport { Injectable, inject } from '@angular/core';\r\nimport { Action, Selector, State, StateContext } from '@ngxs/store';\r\nimport {\r\n CrudStateBase,\r\n handleApiRequest,\r\n Response,\r\n} from '@masterteam/components';\r\n\r\nimport {\r\n NotificationActionKey,\r\n NotificationStateModel,\r\n NotificationEvent,\r\n NotificationTemplateItem,\r\n ReceiverItem,\r\n ReceiverGroup,\r\n ReceiverOptionGroup,\r\n ReceiverSubGroup,\r\n PropertyGroup,\r\n} from './notification.model';\r\nimport {\r\n AddReceivers,\r\n AddTemplate,\r\n DeleteReceiver,\r\n DeleteTemplate,\r\n GetActionProperties,\r\n GetActionReceivers,\r\n GetEvents,\r\n GetProperties,\r\n GetReceivers,\r\n ResetNotificationState,\r\n SelectEvent,\r\n SelectTemplate,\r\n SetActionMode,\r\n SetModuleInfo,\r\n UpdateTemplate,\r\n} from './notification.actions';\r\n\r\n// Default State\r\n\r\nconst DEFAULT_STATE: NotificationStateModel = {\r\n // Module configuration\r\n moduleType: null,\r\n moduleId: null,\r\n parentModuleType: null,\r\n parentModuleId: null,\r\n parentPath: '',\r\n\r\n // Action mode\r\n isActionMode: false,\r\n selectedActionId: null,\r\n\r\n // Data collections\r\n events: [],\r\n templates: [], // Flattened templates\r\n actions: [],\r\n receivers: [],\r\n receiverGroups: [],\r\n propertyGroups: [],\r\n\r\n // Selection state\r\n selectedEventName: null,\r\n selectedTemplateId: null,\r\n\r\n // Loading state (from LoadingStateShape)\r\n loadingActive: [],\r\n errors: {},\r\n};\r\n\r\n// State Definition\r\n\r\n@State<NotificationStateModel>({\r\n name: 'notification',\r\n defaults: DEFAULT_STATE,\r\n})\r\n@Injectable()\r\nexport class NotificationState extends CrudStateBase<\r\n NotificationTemplateItem,\r\n NotificationStateModel,\r\n NotificationActionKey\r\n> {\r\n private readonly http = inject(HttpClient);\r\n private readonly baseUrl = 'notifications';\r\n\r\n // Selectors - Individual selectors for fine-grained reactivity\r\n @Selector()\r\n static getState(state: NotificationStateModel): NotificationStateModel {\r\n return state;\r\n }\r\n\r\n @Selector()\r\n static getEvents(state: NotificationStateModel): NotificationEvent[] {\r\n return state.events;\r\n }\r\n\r\n @Selector()\r\n static getTemplates(\r\n state: NotificationStateModel,\r\n ): NotificationTemplateItem[] {\r\n return state.templates;\r\n }\r\n\r\n @Selector()\r\n static getReceivers(state: NotificationStateModel): ReceiverItem[] {\r\n return state.receivers;\r\n }\r\n\r\n @Selector()\r\n static getReceiverGroups(\r\n state: NotificationStateModel,\r\n ): ReceiverOptionGroup[] {\r\n return state.receiverGroups;\r\n }\r\n\r\n @Selector()\r\n static getPropertyGroups(state: NotificationStateModel): PropertyGroup[] {\r\n return state.propertyGroups;\r\n }\r\n\r\n @Selector()\r\n static getSelectedEventName(state: NotificationStateModel): string | null {\r\n return state.selectedEventName;\r\n }\r\n\r\n @Selector()\r\n static getSelectedTemplateId(\r\n state: NotificationStateModel,\r\n ): string | number | null {\r\n return state.selectedTemplateId;\r\n }\r\n\r\n @Selector()\r\n static getLoadingActive(state: NotificationStateModel): string[] {\r\n return state.loadingActive;\r\n }\r\n\r\n @Selector()\r\n static getErrors(\r\n state: NotificationStateModel,\r\n ): Record<string, string | null> {\r\n return state.errors;\r\n }\r\n\r\n // Derived selectors\r\n @Selector([\r\n NotificationState.getEvents,\r\n NotificationState.getSelectedEventName,\r\n ])\r\n static getSelectedEvent(\r\n events: NotificationEvent[],\r\n selectedEventName: string | null,\r\n ): NotificationEvent | null {\r\n return events.find((e) => e.eventName === selectedEventName) ?? null;\r\n }\r\n\r\n @Selector([\r\n NotificationState.getTemplates,\r\n NotificationState.getSelectedEvent,\r\n ])\r\n static getEventTemplates(\r\n templates: NotificationTemplateItem[],\r\n selectedEvent: NotificationEvent | null,\r\n ): NotificationTemplateItem[] {\r\n if (!selectedEvent) return [];\r\n return templates.filter((t) => t.eventId === selectedEvent.id);\r\n }\r\n\r\n @Selector([\r\n NotificationState.getTemplates,\r\n NotificationState.getSelectedTemplateId,\r\n ])\r\n static getSelectedTemplate(\r\n templates: NotificationTemplateItem[],\r\n selectedTemplateId: string | number | null,\r\n ): NotificationTemplateItem | null {\r\n return templates.find((t) => t.id === selectedTemplateId) ?? null;\r\n }\r\n\r\n @Selector([\r\n NotificationState.getReceivers,\r\n NotificationState.getSelectedTemplate,\r\n ])\r\n static getAvailableReceivers(\r\n receivers: ReceiverItem[],\r\n selectedTemplate: NotificationTemplateItem | null,\r\n ): ReceiverItem[] {\r\n if (!selectedTemplate) return receivers;\r\n const templateReceivers = selectedTemplate.receivers ?? [];\r\n const assignedIds = new Set(templateReceivers.map((r) => r.identifier));\r\n return receivers.filter((r) => !assignedIds.has(String(r.id)));\r\n }\r\n\r\n @Selector([\r\n NotificationState.getReceiverGroups,\r\n NotificationState.getSelectedTemplate,\r\n ])\r\n static getAvailableReceiverGroups(\r\n receiverGroups: ReceiverOptionGroup[],\r\n selectedTemplate: NotificationTemplateItem | null,\r\n ): ReceiverOptionGroup[] {\r\n if (!selectedTemplate) return receiverGroups;\r\n\r\n const assignedIds = new Set(\r\n (selectedTemplate.receivers ?? []).map((r) => r.identifier),\r\n );\r\n\r\n return receiverGroups\r\n .map((group) => ({\r\n ...group,\r\n items: group.items.filter((item) => !assignedIds.has(String(item.id))),\r\n }))\r\n .filter((group) => group.items.length > 0);\r\n }\r\n\r\n // Helper Methods\r\n\r\n /** API returns events with nested templates - we flatten for state */\r\n private flattenEventsResponse(\r\n eventsWithTemplates: Array<\r\n NotificationEvent & { templates: NotificationTemplateItem[] }\r\n >,\r\n ): { events: NotificationEvent[]; templates: NotificationTemplateItem[] } {\r\n const events: NotificationEvent[] = [];\r\n const templates: NotificationTemplateItem[] = [];\r\n\r\n for (const event of eventsWithTemplates) {\r\n const { templates: eventTemplates, ...eventData } = event;\r\n events.push(eventData);\r\n templates.push(\r\n ...eventTemplates.map((t) => ({ ...t, eventId: event.id })),\r\n );\r\n }\r\n\r\n return { events, templates };\r\n }\r\n\r\n private normalizeReceiverGroups(\r\n groups: ReceiverGroup[],\r\n ): ReceiverOptionGroup[] {\r\n return groups\r\n .map((group) => ({\r\n groupName: group.groupName,\r\n items: this.flattenReceiverItems(group.items),\r\n }))\r\n .filter((group) => group.items.length > 0);\r\n }\r\n\r\n private flattenReceiverItems(\r\n items: Array<ReceiverItem | ReceiverSubGroup> | null | undefined,\r\n parentLabel?: string,\r\n ): ReceiverItem[] {\r\n if (!Array.isArray(items)) {\r\n return [];\r\n }\r\n\r\n return items.flatMap((item) => {\r\n const subGroupItems = (item as ReceiverSubGroup).items;\r\n if (Array.isArray(subGroupItems)) {\r\n const subGroupName = (item as ReceiverSubGroup).subGroupName;\r\n const nextLabel = subGroupName\r\n ? parentLabel\r\n ? `${parentLabel} - ${subGroupName}`\r\n : subGroupName\r\n : parentLabel;\r\n\r\n return this.flattenReceiverItems(subGroupItems, nextLabel);\r\n }\r\n\r\n const receiver = item as ReceiverItem;\r\n if (receiver.id == null || !receiver.name) {\r\n return [];\r\n }\r\n\r\n return [\r\n {\r\n ...receiver,\r\n name: parentLabel\r\n ? `${parentLabel} - ${receiver.name}`\r\n : receiver.name,\r\n },\r\n ];\r\n });\r\n }\r\n\r\n private hasOwnField<T extends object>(\r\n value: T,\r\n field: keyof NotificationTemplateItem,\r\n ): boolean {\r\n return Object.prototype.hasOwnProperty.call(value, field);\r\n }\r\n\r\n private mergeUpdatedTemplate(\r\n existingTemplate: NotificationTemplateItem,\r\n updatedTemplate: Partial<NotificationTemplateItem>,\r\n ): NotificationTemplateItem {\r\n const mergedTemplate: NotificationTemplateItem = {\r\n ...existingTemplate,\r\n name: updatedTemplate.name ?? existingTemplate.name,\r\n };\r\n\r\n if (this.hasOwnField(updatedTemplate, 'emailTemplate')) {\r\n mergedTemplate.emailTemplate = updatedTemplate.emailTemplate ?? '';\r\n }\r\n\r\n if (\r\n this.hasOwnField(updatedTemplate, 'emailContentTranslatable') &&\r\n updatedTemplate.emailContentTranslatable\r\n ) {\r\n mergedTemplate.emailContentTranslatable = {\r\n ...existingTemplate.emailContentTranslatable,\r\n ...updatedTemplate.emailContentTranslatable,\r\n };\r\n }\r\n\r\n if (this.hasOwnField(updatedTemplate, 'smsTemplate')) {\r\n mergedTemplate.smsTemplate = updatedTemplate.smsTemplate ?? '';\r\n }\r\n\r\n if (\r\n this.hasOwnField(updatedTemplate, 'appTemplate') &&\r\n updatedTemplate.appTemplate\r\n ) {\r\n mergedTemplate.appTemplate = {\r\n ...existingTemplate.appTemplate,\r\n ...updatedTemplate.appTemplate,\r\n };\r\n }\r\n\r\n if (this.hasOwnField(updatedTemplate, 'conditionFormula')) {\r\n mergedTemplate.conditionFormula = updatedTemplate.conditionFormula;\r\n }\r\n\r\n return mergedTemplate;\r\n }\r\n\r\n // Module Configuration\r\n\r\n @Action(SetModuleInfo)\r\n setModuleInfo(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: SetModuleInfo,\r\n ) {\r\n let parentPath = '';\r\n if (action.parentModuleType && action.parentModuleId) {\r\n parentPath = `/${action.parentModuleType}/${action.parentModuleId}`;\r\n } else if (action.parentPath) {\r\n parentPath = action.parentPath;\r\n }\r\n\r\n ctx.patchState({\r\n moduleType: action.moduleType,\r\n moduleId: action.moduleId,\r\n parentModuleType: action.parentModuleType ?? null,\r\n parentModuleId: action.parentModuleId ?? null,\r\n parentPath,\r\n isActionMode: action.moduleType === 'workflow',\r\n });\r\n }\r\n\r\n @Action(ResetNotificationState)\r\n resetState(ctx: StateContext<NotificationStateModel>) {\r\n ctx.setState(DEFAULT_STATE);\r\n }\r\n\r\n // Data Loading Actions (Normal Mode)\r\n\r\n @Action(GetEvents)\r\n getEvents(ctx: StateContext<NotificationStateModel>) {\r\n const { moduleType, moduleId, parentPath } = ctx.getState();\r\n // API returns events with nested templates\r\n type EventWithTemplates = NotificationEvent & {\r\n templates: NotificationTemplateItem[];\r\n };\r\n const req$ = this.http.get<Response<EventWithTemplates[]>>(\r\n `${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/events`,\r\n );\r\n\r\n return this.load(ctx, {\r\n key: NotificationActionKey.GetEvents,\r\n request$: req$,\r\n updateState: (_state, data) => {\r\n const { events, templates } = this.flattenEventsResponse(data ?? []);\r\n const firstEvent = events[0];\r\n const firstTemplate = templates.find(\r\n (t) => t.eventId === firstEvent?.id,\r\n );\r\n return {\r\n events,\r\n templates,\r\n selectedEventName: firstEvent?.eventName ?? null,\r\n selectedTemplateId: firstTemplate?.id ?? null,\r\n };\r\n },\r\n });\r\n }\r\n\r\n @Action(GetReceivers)\r\n getReceivers(ctx: StateContext<NotificationStateModel>) {\r\n const { parentPath, moduleType, moduleId } = ctx.getState();\r\n const req$ = this.http.get<Response<ReceiverGroup[]>>(\r\n `${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/receivers`,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.GetReceivers,\r\n request$: req$,\r\n onSuccess: (response) => {\r\n const receiverGroups = this.normalizeReceiverGroups(\r\n response.data ?? [],\r\n );\r\n return {\r\n receiverGroups,\r\n receivers: receiverGroups.flatMap((group) => group.items),\r\n };\r\n },\r\n });\r\n }\r\n\r\n @Action(GetProperties)\r\n getProperties(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: GetProperties,\r\n ) {\r\n const { moduleType, moduleId, parentPath } = ctx.getState();\r\n const url = `${this.baseUrl}${parentPath}/${moduleType}/${moduleId}/properties?IsMultiLanguageEnabled=${action.isMultiLang ? 'true' : 'false'}`;\r\n\r\n const req$ = this.http.get<Response<PropertyGroup[]>>(url);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.GetProperties,\r\n request$: req$,\r\n onSuccess: (response) => ({\r\n propertyGroups:\r\n response.data?.map((group) => ({\r\n ...group,\r\n icon: 'custom.list-cards',\r\n })) ?? [],\r\n }),\r\n });\r\n }\r\n\r\n // Action Mode (Workflow)\r\n\r\n @Action(SetActionMode)\r\n setActionMode(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: SetActionMode,\r\n ) {\r\n ctx.patchState({\r\n selectedActionId: action.actionId,\r\n });\r\n }\r\n\r\n @Action(GetActionReceivers)\r\n getActionReceivers(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: GetActionReceivers,\r\n ) {\r\n const req$ = this.http.get<Response<ReceiverGroup[]>>(\r\n `${this.baseUrl}/action/${action.actionId}/receivers`,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.GetReceivers,\r\n request$: req$,\r\n onSuccess: (response) => {\r\n const receiverGroups = this.normalizeReceiverGroups(\r\n response.data ?? [],\r\n );\r\n return {\r\n receiverGroups,\r\n receivers: receiverGroups.flatMap((group) => group.items),\r\n };\r\n },\r\n });\r\n }\r\n\r\n @Action(GetActionProperties)\r\n getActionProperties(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: GetActionProperties,\r\n ) {\r\n const url = `${this.baseUrl}/action/${action.actionId}/properties?IsMultiLanguageEnabled=${action.isMultiLang ? 'true' : 'false'}`;\r\n\r\n const req$ = this.http.get<Response<PropertyGroup[]>>(url);\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.GetProperties,\r\n request$: req$,\r\n onSuccess: (response) => ({\r\n propertyGroups: response.data ?? [],\r\n }),\r\n });\r\n }\r\n\r\n // Selection Actions\r\n\r\n @Action(SelectEvent)\r\n selectEvent(ctx: StateContext<NotificationStateModel>, action: SelectEvent) {\r\n const state = ctx.getState();\r\n const event = state.events.find((e) => e.eventName === action.eventName);\r\n const eventTemplates = state.templates.filter(\r\n (t) => t.eventId === event?.id,\r\n );\r\n ctx.patchState({\r\n selectedEventName: action.eventName,\r\n selectedTemplateId: eventTemplates[0]?.id ?? null,\r\n });\r\n }\r\n\r\n @Action(SelectTemplate)\r\n selectTemplate(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: SelectTemplate,\r\n ) {\r\n ctx.patchState({ selectedTemplateId: action.templateId });\r\n }\r\n\r\n // Receiver CRUD\r\n @Action(AddReceivers)\r\n addReceivers(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: AddReceivers,\r\n ) {\r\n const req$ = this.http.post<Response<ReceiverItem[]>>(\r\n `${this.baseUrl}/templates/${action.templateId}`,\r\n action.payload,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.AddReceivers,\r\n request$: req$,\r\n onSuccess: (response, state) => {\r\n const newReceivers = response.data ?? [];\r\n const templates = this.adapter.updateOne(\r\n state.templates,\r\n action.templateId,\r\n {\r\n receivers: [\r\n ...(state.templates.find((t) => t.id === action.templateId)\r\n ?.receivers ?? []),\r\n ...newReceivers,\r\n ],\r\n },\r\n 'id',\r\n );\r\n return { templates };\r\n },\r\n });\r\n }\r\n\r\n @Action(DeleteReceiver)\r\n deleteReceiver(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: DeleteReceiver,\r\n ) {\r\n const state = ctx.getState();\r\n const template = this.getSelectedTemplate(state);\r\n\r\n if (!template) {\r\n return;\r\n }\r\n\r\n const req$ = this.http.delete<Response<void>>(\r\n `${this.baseUrl}/receivers/${action.receiverId}`,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.DeleteReceiver,\r\n request$: req$,\r\n onSuccess: (_, currentState) => {\r\n const templates = this.adapter.updateOne(\r\n currentState.templates,\r\n template.id,\r\n {\r\n receivers: template.receivers.filter(\r\n (r) => r.id !== action.receiverId,\r\n ),\r\n },\r\n 'id',\r\n );\r\n return { templates };\r\n },\r\n });\r\n }\r\n\r\n // Template CRUD\r\n @Action(AddTemplate)\r\n addTemplate(ctx: StateContext<NotificationStateModel>, action: AddTemplate) {\r\n const req$ = this.http.post<Response<NotificationTemplateItem>>(\r\n `${this.baseUrl}/events/${action.eventId}`,\r\n action.payload,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.AddTemplate,\r\n request$: req$,\r\n onSuccess: (response, state) => {\r\n const newTemplate = response.data;\r\n if (!newTemplate) return {};\r\n\r\n return {\r\n templates: this.adapter.addOne(state.templates, {\r\n ...newTemplate,\r\n eventId: action.eventId,\r\n }),\r\n selectedTemplateId: newTemplate.id,\r\n };\r\n },\r\n });\r\n }\r\n\r\n @Action(UpdateTemplate)\r\n updateTemplate(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: UpdateTemplate,\r\n ) {\r\n const req$ = this.http.put<Response<Partial<NotificationTemplateItem>>>(\r\n `${this.baseUrl}/templates/${action.templateId}`,\r\n action.payload,\r\n {\r\n headers: new HttpHeaders({\r\n 'Content-Type': 'application/json',\r\n }),\r\n },\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.UpdateTemplate,\r\n request$: req$,\r\n onSuccess: (response, state) => {\r\n const updatedTemplate = response.data;\r\n if (!updatedTemplate) return {};\r\n\r\n // Preserve existing fields that API may not return or shouldn't change\r\n const existingTemplate = state.templates.find(\r\n (t) => t.id === action.templateId,\r\n );\r\n\r\n if (!existingTemplate) return {};\r\n\r\n // Only update name and content fields, preserve channel/eventId/receivers\r\n const templates = this.adapter.upsertOne(\r\n state.templates,\r\n this.mergeUpdatedTemplate(existingTemplate, updatedTemplate),\r\n 'id',\r\n );\r\n return { templates };\r\n },\r\n });\r\n }\r\n\r\n @Action(DeleteTemplate)\r\n deleteTemplate(\r\n ctx: StateContext<NotificationStateModel>,\r\n action: DeleteTemplate,\r\n ) {\r\n const req$ = this.http.delete<Response<void>>(\r\n `${this.baseUrl}/templates/${action.templateId}`,\r\n );\r\n\r\n return handleApiRequest({\r\n ctx,\r\n key: NotificationActionKey.DeleteTemplate,\r\n request$: req$,\r\n onSuccess: (_, state) => {\r\n const templates = this.adapter.removeOne(\r\n state.templates,\r\n action.templateId,\r\n 'id',\r\n );\r\n\r\n // Select first template of current event after deletion\r\n const currentEvent = state.events.find(\r\n (e) => e.eventName === state.selectedEventName,\r\n );\r\n const eventTemplates = templates.filter(\r\n (t) => t.eventId === currentEvent?.id,\r\n );\r\n const systemTemplate = eventTemplates.find((t) => t.isSystem);\r\n\r\n return {\r\n templates,\r\n selectedTemplateId:\r\n systemTemplate?.id ?? eventTemplates[0]?.id ?? null,\r\n };\r\n },\r\n });\r\n }\r\n\r\n // Private Helpers\r\n private getSelectedTemplate(\r\n state: NotificationStateModel,\r\n ): NotificationTemplateItem | null {\r\n return (\r\n state.templates.find((t) => t.id === state.selectedTemplateId) ?? null\r\n );\r\n }\r\n}\r\n","import { Injectable, computed, inject } from '@angular/core';\r\nimport { Store, select } from '@ngxs/store';\r\n\r\nimport {\r\n NotificationActionKey,\r\n AddReceiversPayload,\r\n AddTemplatePayload,\r\n UpdateTemplatePayload,\r\n} from './notification.model';\r\nimport {\r\n AddReceivers,\r\n AddTemplate,\r\n DeleteReceiver,\r\n DeleteTemplate,\r\n GetActionProperties,\r\n GetActionReceivers,\r\n GetEvents,\r\n GetProperties,\r\n GetReceivers,\r\n ResetNotificationState,\r\n SelectEvent,\r\n SelectTemplate,\r\n SetActionMode,\r\n SetModuleInfo,\r\n UpdateTemplate,\r\n} from './notification.actions';\r\nimport { NotificationState } from './notification.state';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class NotificationFacade {\r\n private readonly store = inject(Store);\r\n\r\n // ============================================================================\r\n // Data Selectors - Memoized by NGXS (fine-grained reactivity)\r\n // ============================================================================\r\n readonly events = select(NotificationState.getEvents);\r\n readonly templates = select(NotificationState.getEventTemplates);\r\n readonly receivers = select(NotificationState.getReceivers);\r\n readonly receiverGroups = select(NotificationState.getReceiverGroups);\r\n readonly propertyGroups = select(NotificationState.getPropertyGroups);\r\n\r\n // Selection selectors\r\n readonly selectedEventName = select(NotificationState.getSelectedEventName);\r\n readonly selectedTemplateId = select(NotificationState.getSelectedTemplateId);\r\n readonly selectedEvent = select(NotificationState.getSelectedEvent);\r\n readonly selectedTemplate = select(NotificationState.getSelectedTemplate);\r\n readonly availableReceivers = select(NotificationState.getAvailableReceivers);\r\n readonly availableReceiverGroups = select(\r\n NotificationState.getAvailableReceiverGroups,\r\n );\r\n\r\n // ============================================================================\r\n // Loading/Error Slices - Memoized by NGXS\r\n // ============================================================================\r\n private readonly loadingActive = select(NotificationState.getLoadingActive);\r\n private readonly errors = select(NotificationState.getErrors);\r\n\r\n // ============================================================================\r\n // Loading Signals - Computed from slice (minimal reactivity)\r\n // ============================================================================\r\n readonly isLoadingEvents = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.GetEvents),\r\n );\r\n readonly isLoadingReceivers = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.GetReceivers),\r\n );\r\n readonly isLoadingProperties = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.GetProperties),\r\n );\r\n readonly isAddingReceivers = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.AddReceivers),\r\n );\r\n readonly isDeletingReceiver = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.DeleteReceiver),\r\n );\r\n readonly isAddingTemplate = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.AddTemplate),\r\n );\r\n readonly isUpdatingTemplate = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.UpdateTemplate),\r\n );\r\n readonly isDeletingTemplate = computed(() =>\r\n this.loadingActive().includes(NotificationActionKey.DeleteTemplate),\r\n );\r\n\r\n // ============================================================================\r\n // Error Signals - Computed from slice (minimal reactivity)\r\n // ============================================================================\r\n readonly eventsError = computed(\r\n () => this.errors()[NotificationActionKey.GetEvents] ?? null,\r\n );\r\n readonly receiversError = computed(\r\n () => this.errors()[NotificationActionKey.GetReceivers] ?? null,\r\n );\r\n readonly propertiesError = computed(\r\n () => this.errors()[NotificationActionKey.GetProperties] ?? null,\r\n );\r\n\r\n // Action Dispatchers - Configuration\r\n\r\n /**\r\n * Scopes this (shared, singleton) state to a module/event context.\r\n *\r\n * This only patches the scope fields — it does NOT clear previously\r\n * loaded events/templates/selection from whatever context was active\r\n * before. Every caller that rescopes (switching component, tab, or\r\n * selected step/node) MUST call {@link resetState} immediately before\r\n * this, so there is no window where the new context reads stale data\r\n * from the old one. See `workflow-builder.ts` / `escalation-builder.ts`\r\n * for the reference call sites.\r\n */\r\n setModuleInfo(\r\n moduleType: string,\r\n moduleId: string | number,\r\n parentModuleType?: string,\r\n parentModuleId?: string | number,\r\n parentPath?: string,\r\n ) {\r\n return this.store.dispatch(\r\n new SetModuleInfo(\r\n moduleType,\r\n moduleId,\r\n parentModuleType,\r\n parentModuleId,\r\n parentPath,\r\n ),\r\n );\r\n }\r\n\r\n resetState() {\r\n return this.store.dispatch(new ResetNotificationState());\r\n }\r\n\r\n // Action Dispatchers - Data Loading\r\n loadEvents() {\r\n return this.store.dispatch(new GetEvents());\r\n }\r\n\r\n loadReceivers() {\r\n return this.store.dispatch(new GetReceivers());\r\n }\r\n\r\n loadProperties(isMultiLang?: boolean) {\r\n return this.store.dispatch(new GetProperties(isMultiLang));\r\n }\r\n\r\n loadPropertiesForCurrentContext(isMultiLang?: boolean) {\r\n const state = this.store.selectSnapshot(NotificationState.getState);\r\n\r\n if (state.isActionMode && state.selectedActionId != null) {\r\n return this.store.dispatch(\r\n new GetActionProperties(state.selectedActionId, isMultiLang),\r\n );\r\n }\r\n\r\n return this.store.dispatch(new GetProperties(isMultiLang));\r\n }\r\n\r\n // Action Dispatchers - Action Mode (Workflow)\r\n setActionMode(actionId: string | number | null) {\r\n return this.store.dispatch(new SetActionMode(actionId));\r\n }\r\n\r\n loadActionReceivers(actionId: string | number) {\r\n return this.store.dispatch(new GetActionReceivers(actionId));\r\n }\r\n\r\n loadActionProperties(actionId: string | number, isMultiLang?: boolean) {\r\n return this.store.dispatch(new GetActionProperties(actionId, isMultiLang));\r\n }\r\n\r\n // Action Dispatchers - Selection\r\n selectEvent(eventName: string) {\r\n return this.store.dispatch(new SelectEvent(eventName));\r\n }\r\n\r\n selectTemplate(templateId: string | number) {\r\n return this.store.dispatch(new SelectTemplate(templateId));\r\n }\r\n\r\n // Action Dispatchers - Receiver CRUD\r\n addReceivers(templateId: string | number, payload: AddReceiversPayload) {\r\n return this.store.dispatch(new AddReceivers(templateId, payload));\r\n }\r\n\r\n deleteReceiver(receiverId: string | number) {\r\n return this.store.dispatch(new DeleteReceiver(receiverId));\r\n }\r\n\r\n // Action Dispatchers - Template CRUD\r\n\r\n addTemplate(eventId: string | number, payload: AddTemplatePayload) {\r\n return this.store.dispatch(new AddTemplate(eventId, payload));\r\n }\r\n\r\n updateTemplate(templateId: string | number, payload: UpdateTemplatePayload) {\r\n return this.store.dispatch(new UpdateTemplate(templateId, payload));\r\n }\r\n\r\n deleteTemplate(templateId: string | number) {\r\n return this.store.dispatch(new DeleteTemplate(templateId));\r\n }\r\n\r\n loadBaseData() {\r\n this.loadEvents();\r\n this.loadReceivers();\r\n }\r\n\r\n /**\r\n * Load all data for normal mode (non-workflow)\r\n */\r\n loadAllData(isMultiLang = true) {\r\n this.loadEvents();\r\n this.loadReceivers();\r\n this.loadPropertiesForCurrentContext(isMultiLang);\r\n }\r\n}\r\n","import {\r\n Component,\r\n ChangeDetectionStrategy,\r\n inject,\r\n signal,\r\n computed,\r\n effect,\r\n untracked,\r\n} from '@angular/core';\r\nimport { toSignal } from '@angular/core/rxjs-interop';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormControl, FormGroup, ReactiveFormsModule } from '@angular/forms';\r\nimport { TranslocoModule, TranslocoService } from '@jsverse/transloco';\r\n\r\n// Components\r\nimport { Card } from '@masterteam/components/card';\r\nimport { Button } from '@masterteam/components/button';\r\nimport { SelectField } from '@masterteam/components/select-field';\r\nimport { TextField } from '@masterteam/components/text-field';\r\nimport { TextareaField } from '@masterteam/components/textarea-field';\r\nimport { EditorField } from '@masterteam/components/editor-field';\r\nimport { ToggleField } from '@masterteam/components/toggle-field';\r\nimport { Tabs } from '@masterteam/components/tabs';\r\nimport { Icon } from '@masterteam/icons';\r\nimport { ConfirmationService } from '@masterteam/components/confirmation';\r\nimport { ModalService } from '@masterteam/components/modal';\r\nimport { Skeleton } from 'primeng/skeleton';\r\n\r\n// Dialog\r\nimport { AddTemplateDialog } from '../add-template-dialog/add-template-dialog';\r\n\r\n// Store\r\nimport {\r\n NotificationFacade,\r\n NotificationChannel,\r\n NotificationTemplateItem,\r\n ReceiverItem,\r\n UpdateTemplatePayload,\r\n CHANNEL_CONFIGS,\r\n ChannelConfig,\r\n getChannelConfig,\r\n} from '../../store/notification';\r\n\r\n@Component({\r\n selector: 'mt-notification-template',\r\n standalone: true,\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n TranslocoModule,\r\n Card,\r\n Button,\r\n SelectField,\r\n TextField,\r\n TextareaField,\r\n EditorField,\r\n ToggleField,\r\n Tabs,\r\n Icon,\r\n Skeleton,\r\n ],\r\n templateUrl: './notification-template.html',\r\n styleUrl: './notification-template.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class NotificationTemplate {\r\n private readonly facade = inject(NotificationFacade);\r\n private readonly transloco = inject(TranslocoService);\r\n private readonly confirmationService = inject(ConfirmationService);\r\n private readonly modalService = inject(ModalService);\r\n\r\n // ============================================================================\r\n // Data Signals from Facade\r\n // ============================================================================\r\n readonly events = this.facade.events;\r\n readonly templates = this.facade.templates;\r\n readonly receivers = this.facade.receivers;\r\n readonly propertyGroups = this.facade.propertyGroups;\r\n\r\n // Selection Signals\r\n readonly selectedEventName = this.facade.selectedEventName;\r\n readonly selectedTemplateId = this.facade.selectedTemplateId;\r\n readonly selectedEvent = this.facade.selectedEvent;\r\n readonly selectedTemplate = this.facade.selectedTemplate;\r\n readonly availableReceivers = this.facade.availableReceivers;\r\n readonly availableReceiverGroups = this.facade.availableReceiverGroups;\r\n\r\n // ============================================================================\r\n // Loading States from Facade\r\n // ============================================================================\r\n readonly isLoadingEvents = this.facade.isLoadingEvents;\r\n readonly isLoadingReceivers = this.facade.isLoadingReceivers;\r\n readonly isLoadingProperties = this.facade.isLoadingProperties;\r\n readonly isUpdatingTemplate = this.facade.isUpdatingTemplate;\r\n readonly isDeletingTemplate = this.facade.isDeletingTemplate;\r\n readonly isAddingTemplate = this.facade.isAddingTemplate;\r\n\r\n // ============================================================================\r\n // Error States from Facade\r\n // ============================================================================\r\n readonly eventsError = this.facade.eventsError;\r\n readonly propertiesError = this.facade.propertiesError;\r\n\r\n // ============================================================================\r\n // Local State\r\n // ============================================================================\r\n readonly deletingReceiverIds = signal<(string | number)[]>([]);\r\n readonly addingReceiverIds = signal<(string | number)[]>([]);\r\n\r\n // ============================================================================\r\n // Form - Dynamic controls based on CHANNEL_CONFIGS\r\n // ============================================================================\r\n readonly form = this.buildForm();\r\n readonly propertyPickerControl = new FormControl<string | null>(null);\r\n readonly receiverPickerControl = new FormControl<string | number | null>(\r\n null,\r\n );\r\n private readonly channelControl = this.form.controls[\r\n 'channel'\r\n ] as FormControl<NotificationChannel>;\r\n readonly channelSignal = toSignal(this.channelControl.valueChanges, {\r\n initialValue: this.channelControl.value,\r\n });\r\n private buildForm(): FormGroup {\r\n const fc = (v = '') => new FormControl<string>(v, { nonNullable: true });\r\n const controls: Record<string, FormControl | FormGroup> = {\r\n event: new FormControl<string | null>(null),\r\n name: fc(),\r\n channel: new FormControl<NotificationChannel>('email', {\r\n nonNullable: true,\r\n }),\r\n };\r\n\r\n for (const ch of CHANNEL_CONFIGS) {\r\n if (ch.templateKey) controls[ch.templateKey] = fc();\r\n if (ch.translatableKey) {\r\n // Nested FormGroup to match payload structure { en: '', ar: '' }\r\n controls[ch.translatableKey] = new FormGroup({\r\n en: fc(),\r\n ar: fc(),\r\n });\r\n }\r\n if (ch.bilingualOptional) {\r\n controls[`${ch.key}Bilingual`] = new FormControl<boolean>(false, {\r\n nonNullable: true,\r\n });\r\n }\r\n }\r\n return new FormGroup(controls);\r\n }\r\n\r\n // ============================================================================\r\n // Computed\r\n // ============================================================================\r\n readonly channelConfigs = CHANNEL_CONFIGS;\r\n\r\n /** Check if channel should show bilingual fields - reads from form */\r\n isBilingual(ch: ChannelConfig): boolean {\r\n if (!ch.supportsBilingual) return false;\r\n if (!ch.bilingualOptional) return true; // forced bilingual (app)\r\n return this.form.controls[`${ch.key}Bilingual`]?.value ?? false;\r\n }\r\n\r\n readonly channelOptions = computed(() =>\r\n CHANNEL_CONFIGS.map((c) => ({\r\n ...c,\r\n name: this.transloco.translate(c.labelKey),\r\n })),\r\n );\r\n\r\n /** Templates of the selected event, rendered as tabs. */\r\n readonly templateTabs = computed(() =>\r\n this.templates().map((t) => ({\r\n label: t.name,\r\n value: t.id,\r\n isSystem: t.isSystem,\r\n })),\r\n );\r\n\r\n readonly activeChannel = computed<NotificationChannel>(\r\n () => this.selectedTemplate()?.channel ?? this.channelSignal(),\r\n );\r\n\r\n readonly shouldUseMultilingualProperties = computed(\r\n () => this.activeChannel() !== 'app',\r\n );\r\n\r\n readonly isFormInvalid = computed(\r\n () => !this.form.controls['name'].value?.trim(),\r\n );\r\n\r\n /**\r\n * Snapshot of the form's default shape, captured before any context ever\r\n * patches it. Used by {@link resetTemplateFields} to clear the form when the\r\n * selected template resolves to nothing, so a component switching context\r\n * never keeps displaying a previous context's values (see\r\n * `ResetNotificationState` for the store-level counterpart of this reset).\r\n */\r\n private readonly emptyFormValue = this.form.getRawValue();\r\n\r\n constructor() {\r\n effect(() => {\r\n const eventName = this.selectedEventName();\r\n if (eventName) {\r\n if (this.form.controls['event'].value !== eventName) {\r\n this.form.controls['event'].setValue(eventName, {\r\n emitEvent: false,\r\n });\r\n }\r\n } else {\r\n this.form.controls['event'].setValue(null, { emitEvent: false });\r\n }\r\n });\r\n\r\n effect(() => {\r\n this.selectedTemplateId(); // depend on selected template id\r\n const template = untracked(this.selectedTemplate);\r\n if (template) {\r\n this.patchForm(template);\r\n } else {\r\n this.resetTemplateFields();\r\n }\r\n });\r\n\r\n effect(() => {\r\n const template = this.selectedTemplate();\r\n if (!template) {\r\n return;\r\n }\r\n\r\n this.facade.loadPropertiesForCurrentContext(\r\n this.shouldUseMultilingualProperties(),\r\n );\r\n });\r\n }\r\n\r\n // ============================================================================\r\n // Event Handlers\r\n // ============================================================================\r\n onEventChange(eventName: string): void {\r\n if (eventName) this.facade.selectEvent(eventName);\r\n }\r\n\r\n onTemplateTabChange(templateId: string | number): void {\r\n this.facade.selectTemplate(templateId);\r\n }\r\n\r\n // Channel is fixed per template - set on creation only\r\n\r\n onAddProperty(propertyKey: string): void {\r\n if (!propertyKey) return;\r\n\r\n const tag = `{{${propertyKey}}}`;\r\n const ch = getChannelConfig(this.form.controls['channel'].value);\r\n\r\n if (this.isBilingual(ch) && ch.translatableKey) {\r\n const group = this.form.get(ch.translatableKey) as FormGroup;\r\n if (group) {\r\n const enCtrl = group.get('en') as FormControl<string>;\r\n const arCtrl = group.get('ar') as FormControl<string>;\r\n enCtrl?.setValue(`${enCtrl.value ?? ''} ${tag}`);\r\n arCtrl?.setValue(`${arCtrl.value ?? ''} ${tag}`);\r\n }\r\n } else if (ch.templateKey) {\r\n this.appendToControl(ch.templateKey, tag);\r\n }\r\n\r\n setTimeout(() => {\r\n this.propertyPickerControl.reset();\r\n }, 0);\r\n }\r\n\r\n onAddReceiver(receiverId: string | number): void {\r\n const template = this.selectedTemplate();\r\n if (!receiverId || !template) {\r\n setTimeout(() => this.receiverPickerControl.reset(), 0);\r\n return;\r\n }\r\n if (this.addingReceiverIds().includes(receiverId)) {\r\n setTimeout(() => this.receiverPickerControl.reset(), 0);\r\n return;\r\n }\r\n const selectedReceiver = this.availableReceivers().find(\r\n (r) => r.id === receiverId,\r\n );\r\n if (!selectedReceiver) {\r\n setTimeout(() => this.receiverPickerControl.reset(), 0);\r\n return;\r\n }\r\n this.addingReceiverIds.update((ids) => [...ids, receiverId]);\r\n this.facade\r\n .addReceivers(template.id, {\r\n receivers: [\r\n {\r\n id: selectedReceiver.id,\r\n type: selectedReceiver.type,\r\n },\r\n ],\r\n })\r\n .subscribe({\r\n complete: () =>\r\n this.addingReceiverIds.update((ids) =>\r\n ids.filter((id) => id !== receiverId),\r\n ),\r\n error: () =>\r\n this.addingReceiverIds.update((ids) =>\r\n ids.filter((id) => id !== receiverId),\r\n ),\r\n });\r\n setTimeout(() => this.receiverPickerControl.reset(), 0);\r\n }\r\n\r\n onDeleteReceiver(receiver: ReceiverItem): void {\r\n this.confirmationService.confirmDelete({\r\n type: 'dialog',\r\n accept: () => {\r\n this.deletingReceiverIds.update((ids) => [...ids, receiver.id]);\r\n this.facade.deleteReceiver(receiver.id).subscribe({\r\n complete: () => {\r\n this.deletingReceiverIds.update((ids) =>\r\n ids.filter((id) => id !== receiver.id),\r\n );\r\n },\r\n error: () => {\r\n this.deletingReceiverIds.update((ids) =>\r\n ids.filter((id) => id !== receiver.id),\r\n );\r\n },\r\n });\r\n },\r\n });\r\n }\r\n\r\n isReceiverDeleting(receiverId: string | number): boolean {\r\n return this.deletingReceiverIds().includes(receiverId);\r\n }\r\n\r\n onSaveTemplate(): void {\r\n const template = this.selectedTemplate();\r\n if (!template || this.isFormInvalid()) {\r\n this.form.markAllAsTouched();\r\n return;\r\n }\r\n\r\n // Build payload dynamically from all channel controls\r\n const payload = this.buildUpdatePayload(template);\r\n this.facade.updateTemplate(template.id, payload);\r\n }\r\n\r\n onDeleteTemplate(): void {\r\n const template = this.selectedTemplate();\r\n if (!template || template.isSystem) return;\r\n\r\n this.confirmationService.confirm({\r\n type: 'dialog',\r\n message: this.transloco.translate('notification.deleteTemplateMessage'),\r\n icon: 'general.trash-01',\r\n acceptButton: { severity: 'danger' },\r\n accept: () => this.facade.deleteTemplate(template.id),\r\n });\r\n }\r\n\r\n onAddTemplateClick(): void {\r\n const event = this.selectedEvent();\r\n if (!event) return;\r\n\r\n const ref = this.modalService.openModal(AddTemplateDialog, 'dialog', {\r\n header: this.transloco.translate('notification.addTemplate'),\r\n styleClass: '!w-[25rem]',\r\n });\r\n\r\n ref.onClose.subscribe((result: { name: string } | undefined) => {\r\n if (result?.name) {\r\n this.facade.addTemplate(event.id, {\r\n name: result.name,\r\n channel: this.form.controls['channel'].value,\r\n });\r\n }\r\n });\r\n }\r\n\r\n // ============================================================================\r\n // Private Methods\r\n // ============================================================================\r\n\r\n /**\r\n * Clears every template-owned control back to the captured empty shape.\r\n *\r\n * `event` is deliberately excluded, so `patchValue` leaves whatever the event\r\n * effect (or the user's own pick) put in that control. An event with no\r\n * templates yet — a brand-new one, or one whose last template was just\r\n * deleted — resolves `selectedTemplate` to null, and this effect runs after\r\n * the event effect in the same flush: resetting the whole group there would\r\n * blank the event picker the user just used, while `selectedEvent()` stays\r\n * truthy and keeps the tabs/add-template row visible. Leaving the control\r\n * alone also keeps the two effects ordering-independent — on a full\r\n * `ResetNotificationState` the event effect has already nulled it, and that\r\n * null is carried through.\r\n *\r\n * `channel` is restored through {@link channelControl} with events enabled\r\n * because `channelSignal` is a `toSignal` of its `valueChanges` and is the\r\n * only consumer of them on this form — a silent reset would leave\r\n * `activeChannel()` reporting the previous template's channel.\r\n */\r\n private resetTemplateFields(): void {\r\n const { event: _event, channel, ...templateFields } = this.emptyFormValue;\r\n this.form.patchValue(templateFields, { emitEvent: false });\r\n this.channelControl.setValue(channel);\r\n this.form.markAsPristine();\r\n this.form.markAsUntouched();\r\n }\r\n\r\n private appendToControl(key: string, value: string): void {\r\n const ctrl = this.form.controls[key] as FormControl<string>;\r\n ctrl?.setValue(`${ctrl.value ?? ''} ${value}`);\r\n }\r\n\r\n private patchForm(template: NotificationTemplateItem): void {\r\n const channel = template.channel || 'email';\r\n\r\n this.form.patchValue({\r\n name: template.name,\r\n channel: channel,\r\n });\r\n\r\n // Patch all channel controls dynamically\r\n const t = template as unknown as Record<string, unknown>;\r\n for (const ch of CHANNEL_CONFIGS) {\r\n if (ch.templateKey) {\r\n this.form\r\n .get(ch.templateKey)\r\n ?.setValue((t[ch.templateKey] as string) ?? '');\r\n }\r\n if (ch.translatableKey) {\r\n const trans =\r\n (t[ch.translatableKey] as { en?: string; ar?: string }) ?? {};\r\n this.form.get(ch.translatableKey)?.patchValue({\r\n en: trans.en ?? '',\r\n ar: trans.ar ?? '',\r\n });\r\n }\r\n }\r\n }\r\n\r\n private buildUpdatePayload(\r\n template: NotificationTemplateItem,\r\n ): UpdateTemplatePayload {\r\n const title = this.form.controls['name'].value?.trim() || template.name;\r\n\r\n // The backend treats this PUT as a full replace: any channel template\r\n // omitted from the payload is nulled out. Always send email/sms/app\r\n // together — patchForm() populates every channel control from the loaded\r\n // template, so channels not edited this session keep their values.\r\n const payload: UpdateTemplatePayload = { title };\r\n const target = payload as unknown as Record<string, unknown>;\r\n\r\n for (const ch of CHANNEL_CONFIGS) {\r\n if (ch.templateKey) {\r\n target[ch.templateKey] = this.getTemplateControlValue(ch.templateKey);\r\n }\r\n if (ch.translatableKey) {\r\n target[ch.translatableKey] = this.getTranslatableControlValue(\r\n ch.translatableKey,\r\n );\r\n }\r\n }\r\n\r\n return payload;\r\n }\r\n\r\n private getTemplateControlValue(controlName: string): string {\r\n const control = this.form.get(controlName) as FormControl<string> | null;\r\n return control?.value ?? '';\r\n }\r\n\r\n private getTranslatableControlValue(controlName: string): {\r\n en: string;\r\n ar: string;\r\n } {\r\n const group = this.form.get(controlName) as FormGroup | null;\r\n const value = group?.getRawValue() as\r\n | { en?: string | null; ar?: string | null }\r\n | undefined;\r\n\r\n return {\r\n en: value?.en ?? '',\r\n ar: value?.ar ?? '',\r\n };\r\n }\r\n}\r\n\r\nexport default NotificationTemplate;\r\n","<div class=\"flex flex-col gap-4 p-4\" [formGroup]=\"form\">\r\n <!-- Loading State -->\r\n @if (isLoadingEvents()) {\r\n <div class=\"flex flex-col gap-4\">\r\n <div class=\"w-1/2\">\r\n <p-skeleton width=\"4rem\" height=\"1rem\" styleClass=\"mb-2\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <div class=\"flex items-center justify-between\">\r\n <div class=\"flex gap-2\">\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"5rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <p-skeleton width=\"8rem\" height=\"2.25rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"100%\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"100%\" height=\"8rem\" borderRadius=\"0.5rem\" />\r\n <div class=\"flex justify-end gap-2 pt-4\">\r\n <p-skeleton width=\"6rem\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n <p-skeleton width=\"6rem\" height=\"2.5rem\" borderRadius=\"0.5rem\" />\r\n </div>\r\n </div>\r\n } @else if (events().length === 0) {\r\n <!-- Empty State -->\r\n <mt-card>\r\n <div\r\n class=\"flex flex-col items-center justify-center py-12 text-slate-500\"\r\n >\r\n <mt-icon icon=\"alert.alert-circle\" class=\"mb-2 h-12 w-12\" />\r\n <p>{{ \"notification.noEventsFound\" | transloco }}</p>\r\n </div>\r\n </mt-card>\r\n } @else {\r\n <!-- Event Selector -->\r\n <div class=\"w-1/2\">\r\n <mt-select-field\r\n formControlName=\"event\"\r\n [options]=\"events()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'eventName'\"\r\n [label]=\"'notification.events' | transloco\"\r\n [placeholder]=\"'notification.selectEvent' | transloco\"\r\n [required]=\"true\"\r\n [filter]=\"false\"\r\n (onChange)=\"onEventChange($event)\"\r\n />\r\n </div>\r\n\r\n @if (selectedEvent()) {\r\n <!-- Template Tabs + Add notification -->\r\n <div class=\"flex items-center justify-between gap-2\">\r\n <mt-tabs\r\n [active]=\"selectedTemplateId()\"\r\n [options]=\"templateTabs()\"\r\n (activeChange)=\"onTemplateTabChange($event)\"\r\n />\r\n <mt-button\r\n icon=\"general.plus\"\r\n [label]=\"'notification.addNotification' | transloco\"\r\n size=\"small\"\r\n [loading]=\"isAddingTemplate()\"\r\n (onClick)=\"onAddTemplateClick()\"\r\n />\r\n </div>\r\n\r\n <!-- Template Content -->\r\n @if (selectedTemplate(); as template) {\r\n <div class=\"flex flex-col gap-4\">\r\n <!-- Name -->\r\n <div class=\"w-full\">\r\n <mt-text-field\r\n formControlName=\"name\"\r\n [label]=\"'notification.name' | transloco\"\r\n [placeholder]=\"'notification.enterName' | transloco\"\r\n [required]=\"true\"\r\n />\r\n </div>\r\n <!-- Channel & Properties Picker -->\r\n <div class=\"flex flex-col gap-4\">\r\n <mt-select-field\r\n formControlName=\"channel\"\r\n [options]=\"channelOptions()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'key'\"\r\n [label]=\"'notification.channel.label' | transloco\"\r\n [placeholder]=\"'notification.selectChannel' | transloco\"\r\n [required]=\"true\"\r\n [filter]=\"false\"\r\n [disabled]=\"true\"\r\n />\r\n <mt-select-field\r\n [options]=\"propertyGroups()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'key'\"\r\n [group]=\"true\"\r\n [optionGroupLabel]=\"'groupName'\"\r\n [optionGroupChildren]=\"'properties'\"\r\n [label]=\"'notification.propertiesList' | transloco\"\r\n [placeholder]=\"'notification.selectProperty' | transloco\"\r\n [hasPlaceholderPrefix]=\"false\"\r\n [filter]=\"true\"\r\n [filterBy]=\"'name'\"\r\n [loading]=\"isLoadingProperties()\"\r\n [formControl]=\"propertyPickerControl\"\r\n (onChange)=\"onAddProperty($event)\"\r\n />\r\n </div>\r\n <!-- Channel Content Editors -->\r\n @for (ch of channelConfigs; track ch.key) {\r\n @if (form.controls[\"channel\"].value === ch.key) {\r\n <!-- Bilingual Content Fields -->\r\n @if (isBilingual(ch) && ch.translatableKey) {\r\n <ng-container [formGroupName]=\"ch.translatableKey\">\r\n @if (ch.useRichEditor) {\r\n <mt-editor-field\r\n formControlName=\"en\"\r\n [label]=\"'notification.english' | transloco\"\r\n dir=\"ltr\"\r\n />\r\n <mt-editor-field\r\n formControlName=\"ar\"\r\n [label]=\"'notification.arabic' | transloco\"\r\n dir=\"rtl\"\r\n />\r\n } @else {\r\n <mt-textarea-field\r\n formControlName=\"en\"\r\n [label]=\"'notification.english' | transloco\"\r\n [rows]=\"'6'\"\r\n dir=\"ltr\"\r\n />\r\n <mt-textarea-field\r\n formControlName=\"ar\"\r\n [label]=\"'notification.arabic' | transloco\"\r\n [rows]=\"'6'\"\r\n dir=\"rtl\"\r\n />\r\n }\r\n </ng-container>\r\n } @else if (ch.templateKey) {\r\n <!-- Non-Bilingual Content Field -->\r\n @if (ch.useRichEditor) {\r\n <mt-editor-field\r\n [formControlName]=\"ch.templateKey\"\r\n [label]=\"'notification.notificationBody' | transloco\"\r\n />\r\n } @else {\r\n <mt-textarea-field\r\n [formControlName]=\"ch.templateKey\"\r\n [label]=\"'notification.notificationBody' | transloco\"\r\n [rows]=\"'6'\"\r\n />\r\n }\r\n }\r\n <!-- Bilingual Toggle -->\r\n @if (ch.bilingualOptional) {\r\n <mt-toggle-field\r\n [formControlName]=\"ch.key + 'Bilingual'\"\r\n [label]=\"'notification.bilingual' | transloco\"\r\n />\r\n }\r\n }\r\n }\r\n <!-- Receivers -->\r\n <div class=\"w-full\">\r\n <mt-select-field\r\n [options]=\"availableReceiverGroups()\"\r\n [optionLabel]=\"'name'\"\r\n [optionValue]=\"'id'\"\r\n [group]=\"true\"\r\n [optionGroupLabel]=\"'groupName'\"\r\n [optionGroupChildren]=\"'items'\"\r\n [label]=\"'notification.receivers' | transloco\"\r\n [placeholder]=\"'notification.selectReceiver' | transloco\"\r\n [filter]=\"true\"\r\n [filterBy]=\"'name'\"\r\n [loading]=\"isLoadingReceivers()\"\r\n [formControl]=\"receiverPickerControl\"\r\n (onChange)=\"onAddReceiver($event)\"\r\n />\r\n </div>\r\n @if ((template.receivers ?? []).length > 0) {\r\n <div class=\"flex w-full flex-wrap gap-2\">\r\n @for (receiver of template.receivers; track receiver.id) {\r\n <div\r\n class=\"flex items-center gap-2 rounded-full border border-surface bg-surface-50 py-1 pe-2 ps-3 text-sm transition-colors hover:bg-surface-100\"\r\n >\r\n <mt-icon\r\n icon=\"user.user-01\"\r\n class=\"h-4 w-4 shrink-0 text-slate-500\"\r\n />\r\n <span class=\"font-medium\">{{ receiver.name?.display }}</span>\r\n @if (!receiver.isSystem) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n severity=\"danger\"\r\n size=\"small\"\r\n [text]=\"true\"\r\n [loading]=\"isReceiverDeleting(receiver.id)\"\r\n (onClick)=\"onDeleteReceiver(receiver)\"\r\n />\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n <!-- Actions -->\r\n <div class=\"flex justify-end gap-2 pt-4\">\r\n @if (!template.isSystem) {\r\n <mt-button\r\n icon=\"general.trash-01\"\r\n [label]=\"'notification.delete' | transloco\"\r\n severity=\"danger\"\r\n [loading]=\"isDeletingTemplate()\"\r\n [disabled]=\"isUpdatingTemplate()\"\r\n (onClick)=\"onDeleteTemplate()\"\r\n />\r\n }\r\n <mt-button\r\n icon=\"general.save-01\"\r\n [label]=\"'notification.save' | transloco\"\r\n [loading]=\"isUpdatingTemplate()\"\r\n [disabled]=\"isDeletingTemplate() || isFormInvalid()\"\r\n (onClick)=\"onSaveTemplate()\"\r\n />\r\n </div>\r\n </div>\r\n } @else {\r\n <!-- No template selected -->\r\n <div\r\n class=\"flex flex-col items-center justify-center py-12 text-slate-500\"\r\n >\r\n <mt-icon icon=\"alert.bell-01\" class=\"mb-2 h-12 w-12\" />\r\n <p>{{ \"notification.selectTemplatePrompt\" | transloco }}</p>\r\n </div>\r\n }\r\n }\r\n }\r\n</div>\r\n","import { NotificationState } from './notification/notification.state';\r\n\r\nexport const APP_STATES = [NotificationState];\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;MAqBa,iBAAiB,CAAA;AACnB,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AAC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EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAMC,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBAtBhC,SAAS;+BACE,0BAA0B,EAAA,UAAA,EACxB,IAAI,EAAA,OAAA,EACP;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,eAAe;wBACf,IAAI;wBACJ,MAAM;wBACN,WAAW;wBACX,SAAS;wBACT,aAAa;wBACb,WAAW;wBACX,WAAW;wBACX,IAAI;wBACJ,IAAI;wBACJ,QAAQ;qBACT,EAAA,eAAA,EAGgB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,omUAAA,EAAA,MAAA,EAAA,CAAA,iUAAA,CAAA,EAAA;;;AE7D1C,MAAM,UAAU,GAAG,CAAC,iBAAiB;;ACF5C;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@masterteam/notification",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "publishConfig": {
5
5
  "directory": "../../../dist/masterteam/notification",
6
6
  "linkDirectory": false,
@@ -19,8 +19,8 @@
19
19
  "tailwindcss": "^4.2.2",
20
20
  "tailwindcss-primeui": "^0.6.1",
21
21
  "@ngxs/store": "^20.1.0",
22
- "@masterteam/components": "^0.0.197",
23
- "@masterteam/forms": "^0.0.96",
22
+ "@masterteam/components": "^0.0.277",
23
+ "@masterteam/forms": "^0.0.142",
24
24
  "@masterteam/icons": "^0.0.17"
25
25
  },
26
26
  "sideEffects": false,
@@ -282,6 +282,17 @@ declare class NotificationFacade {
282
282
  readonly eventsError: _angular_core.Signal<string | null>;
283
283
  readonly receiversError: _angular_core.Signal<string | null>;
284
284
  readonly propertiesError: _angular_core.Signal<string | null>;
285
+ /**
286
+ * Scopes this (shared, singleton) state to a module/event context.
287
+ *
288
+ * This only patches the scope fields — it does NOT clear previously
289
+ * loaded events/templates/selection from whatever context was active
290
+ * before. Every caller that rescopes (switching component, tab, or
291
+ * selected step/node) MUST call {@link resetState} immediately before
292
+ * this, so there is no window where the new context reads stale data
293
+ * from the old one. See `workflow-builder.ts` / `escalation-builder.ts`
294
+ * for the reference call sites.
295
+ */
285
296
  setModuleInfo(moduleType: string, moduleId: string | number, parentModuleType?: string, parentModuleId?: string | number, parentPath?: string): rxjs.Observable<void>;
286
297
  resetState(): rxjs.Observable<void>;
287
298
  loadEvents(): rxjs.Observable<void>;
@@ -360,6 +371,14 @@ declare class NotificationTemplate {
360
371
  readonly activeChannel: _angular_core.Signal<NotificationChannel>;
361
372
  readonly shouldUseMultilingualProperties: _angular_core.Signal<boolean>;
362
373
  readonly isFormInvalid: _angular_core.Signal<boolean>;
374
+ /**
375
+ * Snapshot of the form's default shape, captured before any context ever
376
+ * patches it. Used by {@link resetTemplateFields} to clear the form when the
377
+ * selected template resolves to nothing, so a component switching context
378
+ * never keeps displaying a previous context's values (see
379
+ * `ResetNotificationState` for the store-level counterpart of this reset).
380
+ */
381
+ private readonly emptyFormValue;
363
382
  constructor();
364
383
  onEventChange(eventName: string): void;
365
384
  onTemplateTabChange(templateId: string | number): void;
@@ -370,6 +389,26 @@ declare class NotificationTemplate {
370
389
  onSaveTemplate(): void;
371
390
  onDeleteTemplate(): void;
372
391
  onAddTemplateClick(): void;
392
+ /**
393
+ * Clears every template-owned control back to the captured empty shape.
394
+ *
395
+ * `event` is deliberately excluded, so `patchValue` leaves whatever the event
396
+ * effect (or the user's own pick) put in that control. An event with no
397
+ * templates yet — a brand-new one, or one whose last template was just
398
+ * deleted — resolves `selectedTemplate` to null, and this effect runs after
399
+ * the event effect in the same flush: resetting the whole group there would
400
+ * blank the event picker the user just used, while `selectedEvent()` stays
401
+ * truthy and keeps the tabs/add-template row visible. Leaving the control
402
+ * alone also keeps the two effects ordering-independent — on a full
403
+ * `ResetNotificationState` the event effect has already nulled it, and that
404
+ * null is carried through.
405
+ *
406
+ * `channel` is restored through {@link channelControl} with events enabled
407
+ * because `channelSignal` is a `toSignal` of its `valueChanges` and is the
408
+ * only consumer of them on this form — a silent reset would leave
409
+ * `activeChannel()` reporting the previous template's channel.
410
+ */
411
+ private resetTemplateFields;
373
412
  private appendToControl;
374
413
  private patchForm;
375
414
  private buildUpdatePayload;