@memberjunction/ng-base-forms 6.2.0-edge.6 → 6.2.0-edge.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +10 -0
  2. package/dist/lib/apply/form-placement-preview.component.d.ts.map +1 -1
  3. package/dist/lib/apply/form-placement-preview.component.js +1 -0
  4. package/dist/lib/apply/form-placement-preview.component.js.map +1 -1
  5. package/dist/lib/base-form-component.d.ts +15 -2
  6. package/dist/lib/base-form-component.d.ts.map +1 -1
  7. package/dist/lib/base-form-component.js +18 -8
  8. package/dist/lib/base-form-component.js.map +1 -1
  9. package/dist/lib/chrome/form-chrome-coordinator.service.d.ts.map +1 -1
  10. package/dist/lib/chrome/form-chrome-coordinator.service.js +4 -1
  11. package/dist/lib/chrome/form-chrome-coordinator.service.js.map +1 -1
  12. package/dist/lib/chrome/phone-viewport.d.ts +15 -0
  13. package/dist/lib/chrome/phone-viewport.d.ts.map +1 -0
  14. package/dist/lib/chrome/phone-viewport.js +28 -0
  15. package/dist/lib/chrome/phone-viewport.js.map +1 -0
  16. package/dist/lib/comments/form-record-comments-coordinator.service.d.ts +159 -0
  17. package/dist/lib/comments/form-record-comments-coordinator.service.d.ts.map +1 -0
  18. package/dist/lib/comments/form-record-comments-coordinator.service.js +421 -0
  19. package/dist/lib/comments/form-record-comments-coordinator.service.js.map +1 -0
  20. package/dist/lib/comments/record-comments.component.d.ts +205 -0
  21. package/dist/lib/comments/record-comments.component.d.ts.map +1 -0
  22. package/dist/lib/comments/record-comments.component.js +2019 -0
  23. package/dist/lib/comments/record-comments.component.js.map +1 -0
  24. package/dist/lib/container/record-form-container.component.d.ts +47 -1
  25. package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
  26. package/dist/lib/container/record-form-container.component.js +877 -316
  27. package/dist/lib/container/record-form-container.component.js.map +1 -1
  28. package/dist/lib/field/default-fk-lookup-strategy.d.ts.map +1 -1
  29. package/dist/lib/field/default-fk-lookup-strategy.js +14 -6
  30. package/dist/lib/field/default-fk-lookup-strategy.js.map +1 -1
  31. package/dist/lib/field/fk-lookup-strategy.d.ts +11 -0
  32. package/dist/lib/field/fk-lookup-strategy.d.ts.map +1 -1
  33. package/dist/lib/field/fk-lookup-strategy.js +10 -0
  34. package/dist/lib/field/fk-lookup-strategy.js.map +1 -1
  35. package/dist/lib/field/fk-search-utils.d.ts +17 -0
  36. package/dist/lib/field/fk-search-utils.d.ts.map +1 -1
  37. package/dist/lib/field/fk-search-utils.js +29 -0
  38. package/dist/lib/field/fk-search-utils.js.map +1 -1
  39. package/dist/lib/field/form-field.component.d.ts +35 -1
  40. package/dist/lib/field/form-field.component.d.ts.map +1 -1
  41. package/dist/lib/field/form-field.component.js +631 -446
  42. package/dist/lib/field/form-field.component.js.map +1 -1
  43. package/dist/lib/host/entity-form-host.component.d.ts +6 -0
  44. package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
  45. package/dist/lib/host/entity-form-host.component.js +17 -3
  46. package/dist/lib/host/entity-form-host.component.js.map +1 -1
  47. package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
  48. package/dist/lib/interactive-form/interactive-form.component.js +1 -0
  49. package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
  50. package/dist/lib/links/record-links.component.d.ts +6 -0
  51. package/dist/lib/links/record-links.component.d.ts.map +1 -1
  52. package/dist/lib/links/record-links.component.js +30 -7
  53. package/dist/lib/links/record-links.component.js.map +1 -1
  54. package/dist/lib/panel/collapsible-panel.component.d.ts +5 -0
  55. package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
  56. package/dist/lib/panel/collapsible-panel.component.js +109 -30
  57. package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
  58. package/dist/lib/preview-popover/record-preview-popover.component.d.ts +8 -1
  59. package/dist/lib/preview-popover/record-preview-popover.component.d.ts.map +1 -1
  60. package/dist/lib/preview-popover/record-preview-popover.component.js +33 -9
  61. package/dist/lib/preview-popover/record-preview-popover.component.js.map +1 -1
  62. package/dist/lib/related-grid-height.d.ts +2 -2
  63. package/dist/lib/related-grid-height.d.ts.map +1 -1
  64. package/dist/lib/related-grid-height.js +2 -2
  65. package/dist/lib/related-grid-height.js.map +1 -1
  66. package/dist/lib/section-indicators/form-section-indicators.d.ts +4 -0
  67. package/dist/lib/section-indicators/form-section-indicators.d.ts.map +1 -1
  68. package/dist/lib/section-indicators/form-section-indicators.js +15 -1
  69. package/dist/lib/section-indicators/form-section-indicators.js.map +1 -1
  70. package/dist/lib/toolbar/actions/record-comments-toolbar-action.d.ts +17 -0
  71. package/dist/lib/toolbar/actions/record-comments-toolbar-action.d.ts.map +1 -0
  72. package/dist/lib/toolbar/actions/record-comments-toolbar-action.js +52 -0
  73. package/dist/lib/toolbar/actions/record-comments-toolbar-action.js.map +1 -0
  74. package/dist/lib/toolbar/base-form-toolbar-action.d.ts +9 -0
  75. package/dist/lib/toolbar/base-form-toolbar-action.d.ts.map +1 -1
  76. package/dist/lib/toolbar/base-form-toolbar-action.js.map +1 -1
  77. package/dist/lib/toolbar/form-toolbar.component.d.ts +107 -2
  78. package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
  79. package/dist/lib/toolbar/form-toolbar.component.js +927 -415
  80. package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
  81. package/dist/lib/types/form-toolbar-item.d.ts +1 -1
  82. package/dist/lib/types/form-toolbar-item.d.ts.map +1 -1
  83. package/dist/lib/types/form-toolbar-item.js.map +1 -1
  84. package/dist/lib/types/form-types.d.ts +8 -0
  85. package/dist/lib/types/form-types.d.ts.map +1 -1
  86. package/dist/lib/types/form-types.js.map +1 -1
  87. package/dist/lib/types/toolbar-config.d.ts +2 -0
  88. package/dist/lib/types/toolbar-config.d.ts.map +1 -1
  89. package/dist/lib/types/toolbar-config.js.map +1 -1
  90. package/dist/module.d.ts +15 -14
  91. package/dist/module.d.ts.map +1 -1
  92. package/dist/module.js +15 -5
  93. package/dist/module.js.map +1 -1
  94. package/dist/public-api.d.ts +3 -0
  95. package/dist/public-api.d.ts.map +1 -1
  96. package/dist/public-api.js +3 -0
  97. package/dist/public-api.js.map +1 -1
  98. package/package.json +20 -20
@@ -0,0 +1,2019 @@
1
+ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, EventEmitter, HostListener, Input, Output, ViewChild, inject } from '@angular/core';
2
+ import { LogError, RunView } from '@memberjunction/core';
3
+ import { ParseConversationAnchorMetadata, UserInfoEngine } from '@memberjunction/core-entities';
4
+ import { EscapeHTML, EscapeSQLString, NormalizeUUID } from '@memberjunction/global';
5
+ import { BaseAngularComponent } from '@memberjunction/ng-base-types';
6
+ import { FormRecordCommentsCoordinatorService } from './form-record-comments-coordinator.service';
7
+ import * as i0 from "@angular/core";
8
+ const _c0 = ["newThreadTextarea"];
9
+ const _forTrack0 = ($index, $item) => $item.ID;
10
+ const _forTrack1 = ($index, $item) => $item.GroupKey;
11
+ const _forTrack2 = ($index, $item) => $item.Conversation.ID;
12
+ function MjRecordCommentsComponent_Conditional_0_Conditional_8_Template(rf, ctx) { if (rf & 1) {
13
+ i0.ɵɵelementStart(0, "span", 8);
14
+ i0.ɵɵtext(1);
15
+ i0.ɵɵelementEnd();
16
+ } if (rf & 2) {
17
+ const ctx_r1 = i0.ɵɵnextContext(2);
18
+ i0.ɵɵattribute("aria-label", ctx_r1.OpenCount + " open comment threads");
19
+ i0.ɵɵadvance();
20
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.OpenCount, " ");
21
+ } }
22
+ function MjRecordCommentsComponent_Conditional_0_Conditional_22_Template(rf, ctx) { if (rf & 1) {
23
+ const _r3 = i0.ɵɵgetCurrentView();
24
+ i0.ɵɵelementStart(0, "div", 17)(1, "span", 22);
25
+ i0.ɵɵelement(2, "i", 23);
26
+ i0.ɵɵtext(3, " Anchored to: ");
27
+ i0.ɵɵelementStart(4, "strong");
28
+ i0.ɵɵtext(5);
29
+ i0.ɵɵelementEnd()();
30
+ i0.ɵɵelementStart(6, "button", 24);
31
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Conditional_22_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnClearTargetFilter()); });
32
+ i0.ɵɵtext(7, " Show all ");
33
+ i0.ɵɵelement(8, "i", 13);
34
+ i0.ɵɵelementEnd()();
35
+ } if (rf & 2) {
36
+ const ctx_r1 = i0.ɵɵnextContext(2);
37
+ i0.ɵɵadvance(5);
38
+ i0.ɵɵtextInterpolate(ctx_r1.TargetFilter.Label);
39
+ } }
40
+ function MjRecordCommentsComponent_Conditional_0_Conditional_23_Template(rf, ctx) { if (rf & 1) {
41
+ const _r4 = i0.ɵɵgetCurrentView();
42
+ i0.ɵɵelementStart(0, "div", 18);
43
+ i0.ɵɵelement(1, "i", 25);
44
+ i0.ɵɵelementStart(2, "span");
45
+ i0.ɵɵtext(3);
46
+ i0.ɵɵelementEnd();
47
+ i0.ɵɵelementStart(4, "button", 26);
48
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Conditional_23_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.ErrorBannerMessage = null); });
49
+ i0.ɵɵelement(5, "i", 13);
50
+ i0.ɵɵelementEnd()();
51
+ } if (rf & 2) {
52
+ const ctx_r1 = i0.ɵɵnextContext(2);
53
+ i0.ɵɵadvance(3);
54
+ i0.ɵɵtextInterpolate(ctx_r1.ErrorBannerMessage);
55
+ } }
56
+ function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_6_For_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
57
+ i0.ɵɵelementStart(0, "span", 41);
58
+ i0.ɵɵtext(1);
59
+ i0.ɵɵelementEnd();
60
+ } if (rf & 2) {
61
+ const cand_r7 = i0.ɵɵnextContext().$implicit;
62
+ i0.ɵɵadvance();
63
+ i0.ɵɵtextInterpolate(cand_r7.Subtitle);
64
+ } }
65
+ function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_6_For_2_Template(rf, ctx) { if (rf & 1) {
66
+ const _r6 = i0.ɵɵgetCurrentView();
67
+ i0.ɵɵelementStart(0, "li", 37);
68
+ i0.ɵɵlistener("mousedown", function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_6_For_2_Template_li_mousedown_0_listener($event) { const cand_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.InsertMentionCandidate(cand_r7, "new")); });
69
+ i0.ɵɵelementStart(1, "span", 38);
70
+ i0.ɵɵelement(2, "i", 39);
71
+ i0.ɵɵelementEnd();
72
+ i0.ɵɵelementStart(3, "span", 40);
73
+ i0.ɵɵtext(4);
74
+ i0.ɵɵelementEnd();
75
+ i0.ɵɵconditionalCreate(5, MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_6_For_2_Conditional_5_Template, 2, 1, "span", 41);
76
+ i0.ɵɵelementEnd();
77
+ } if (rf & 2) {
78
+ const cand_r7 = ctx.$implicit;
79
+ const ɵ$index_85_r8 = ctx.$index;
80
+ const ctx_r1 = i0.ɵɵnextContext(4);
81
+ i0.ɵɵclassProp("mj-record-comments__mention-option--active", ɵ$index_85_r8 === (ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.SelectedIndex));
82
+ i0.ɵɵattribute("aria-selected", ɵ$index_85_r8 === (ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.SelectedIndex));
83
+ i0.ɵɵadvance();
84
+ i0.ɵɵattribute("data-type", cand_r7.Type);
85
+ i0.ɵɵadvance();
86
+ i0.ɵɵclassMap(cand_r7.Type === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
87
+ i0.ɵɵadvance(2);
88
+ i0.ɵɵtextInterpolate(cand_r7.Name);
89
+ i0.ɵɵadvance();
90
+ i0.ɵɵconditional(cand_r7.Subtitle ? 5 : -1);
91
+ } }
92
+ function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_6_Template(rf, ctx) { if (rf & 1) {
93
+ i0.ɵɵelementStart(0, "ul", 31);
94
+ i0.ɵɵrepeaterCreate(1, MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_6_For_2_Template, 6, 8, "li", 36, _forTrack0);
95
+ i0.ɵɵelementEnd();
96
+ } if (rf & 2) {
97
+ const ctx_r1 = i0.ɵɵnextContext(3);
98
+ i0.ɵɵadvance();
99
+ i0.ɵɵrepeater(ctx_r1.FilteredMentionCandidates);
100
+ } }
101
+ function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_8_For_2_Template(rf, ctx) { if (rf & 1) {
102
+ const _r9 = i0.ɵɵgetCurrentView();
103
+ i0.ɵɵelementStart(0, "span", 43);
104
+ i0.ɵɵelement(1, "i", 39);
105
+ i0.ɵɵelementStart(2, "span");
106
+ i0.ɵɵtext(3);
107
+ i0.ɵɵelementEnd();
108
+ i0.ɵɵelementStart(4, "button", 44);
109
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_8_For_2_Template_button_click_4_listener() { const m_r10 = i0.ɵɵrestoreView(_r9).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.RemoveDraftMention(m_r10, "new")); });
110
+ i0.ɵɵelement(5, "i", 13);
111
+ i0.ɵɵelementEnd()();
112
+ } if (rf & 2) {
113
+ const m_r10 = ctx.$implicit;
114
+ i0.ɵɵclassProp("mj-record-comments__draft-mention-chip--agent", m_r10.Type === "agent");
115
+ i0.ɵɵadvance();
116
+ i0.ɵɵclassMap(m_r10.Type === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
117
+ i0.ɵɵadvance(2);
118
+ i0.ɵɵtextInterpolate1("@", m_r10.Name);
119
+ i0.ɵɵadvance();
120
+ i0.ɵɵproperty("title", "Remove @" + m_r10.Name);
121
+ i0.ɵɵattribute("aria-label", "Remove @" + m_r10.Name);
122
+ } }
123
+ function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_8_Template(rf, ctx) { if (rf & 1) {
124
+ i0.ɵɵelementStart(0, "div", 32);
125
+ i0.ɵɵrepeaterCreate(1, MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_8_For_2_Template, 6, 7, "span", 42, _forTrack0);
126
+ i0.ɵɵelementEnd();
127
+ } if (rf & 2) {
128
+ i0.ɵɵnextContext();
129
+ const drawerNewDraftMentions_r11 = i0.ɵɵreadContextLet(7);
130
+ i0.ɵɵadvance();
131
+ i0.ɵɵrepeater(drawerNewDraftMentions_r11);
132
+ } }
133
+ function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_11_Template(rf, ctx) { if (rf & 1) {
134
+ i0.ɵɵelement(0, "i", 45);
135
+ i0.ɵɵtext(1, " Posting... ");
136
+ } }
137
+ function MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_12_Template(rf, ctx) { if (rf & 1) {
138
+ i0.ɵɵelement(0, "i", 46);
139
+ i0.ɵɵtext(1, " Comment ");
140
+ } }
141
+ function MjRecordCommentsComponent_Conditional_0_Conditional_24_Template(rf, ctx) { if (rf & 1) {
142
+ const _r5 = i0.ɵɵgetCurrentView();
143
+ i0.ɵɵelementStart(0, "form", 27);
144
+ i0.ɵɵlistener("submit", function MjRecordCommentsComponent_Conditional_0_Conditional_24_Template_form_submit_0_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.OnSubmitNewThread()); });
145
+ i0.ɵɵelementStart(1, "label", 28);
146
+ i0.ɵɵtext(2);
147
+ i0.ɵɵelementEnd();
148
+ i0.ɵɵelementStart(3, "div", 29)(4, "textarea", 30, 0);
149
+ i0.ɵɵlistener("input", function MjRecordCommentsComponent_Conditional_0_Conditional_24_Template_textarea_input_4_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnNewThreadInput($event)); })("compositionend", function MjRecordCommentsComponent_Conditional_0_Conditional_24_Template_textarea_compositionend_4_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnComposerCompositionEnd($event)); })("keydown", function MjRecordCommentsComponent_Conditional_0_Conditional_24_Template_textarea_keydown_4_listener($event) { i0.ɵɵrestoreView(_r5); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnComposerKeydown($event, "new")); });
150
+ i0.ɵɵelementEnd();
151
+ i0.ɵɵconditionalCreate(6, MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_6_Template, 3, 0, "ul", 31);
152
+ i0.ɵɵelementEnd();
153
+ i0.ɵɵdeclareLet(7);
154
+ i0.ɵɵconditionalCreate(8, MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_8_Template, 3, 0, "div", 32);
155
+ i0.ɵɵelementStart(9, "div", 33)(10, "button", 34);
156
+ i0.ɵɵconditionalCreate(11, MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_11_Template, 2, 0)(12, MjRecordCommentsComponent_Conditional_0_Conditional_24_Conditional_12_Template, 2, 0);
157
+ i0.ɵɵelementEnd();
158
+ i0.ɵɵelementStart(13, "span", 35);
159
+ i0.ɵɵtext(14, "Enter to send \u00B7 Shift+Enter for newline \u00B7 @ to mention");
160
+ i0.ɵɵelementEnd()()();
161
+ } if (rf & 2) {
162
+ const ctx_r1 = i0.ɵɵnextContext(2);
163
+ i0.ɵɵadvance(2);
164
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.TargetFilter ? "Comment on " + ctx_r1.TargetFilter.Label : "Add a comment on this record", " ");
165
+ i0.ɵɵadvance(2);
166
+ i0.ɵɵproperty("value", ctx_r1.NewThreadMessage)("placeholder", ctx_r1.TargetFilter ? "Comment on " + ctx_r1.TargetFilter.Label + "... (use @ to mention)" : "Comment on this record... (use @ to mention)");
167
+ i0.ɵɵadvance(2);
168
+ i0.ɵɵconditional((ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.Target) === "new" && ctx_r1.FilteredMentionCandidates.length > 0 ? 6 : -1);
169
+ i0.ɵɵadvance();
170
+ const drawerNewDraftMentions_r12 = i0.ɵɵstoreLet(ctx_r1.GetDraftMentions("new"));
171
+ i0.ɵɵadvance();
172
+ i0.ɵɵconditional(drawerNewDraftMentions_r12.length > 0 ? 8 : -1);
173
+ i0.ɵɵadvance(2);
174
+ i0.ɵɵproperty("disabled", !ctx_r1.NewThreadMessage.trim() || ctx_r1.IsSubmittingNewThread);
175
+ i0.ɵɵadvance();
176
+ i0.ɵɵconditional(ctx_r1.IsSubmittingNewThread ? 11 : 12);
177
+ } }
178
+ function MjRecordCommentsComponent_Conditional_0_Conditional_26_Template(rf, ctx) { if (rf & 1) {
179
+ i0.ɵɵelementStart(0, "div", 21);
180
+ i0.ɵɵelement(1, "i", 47);
181
+ i0.ɵɵelementStart(2, "p");
182
+ i0.ɵɵtext(3, "Loading conversations...");
183
+ i0.ɵɵelementEnd()();
184
+ } }
185
+ function MjRecordCommentsComponent_Conditional_0_Conditional_27_Template(rf, ctx) { if (rf & 1) {
186
+ i0.ɵɵelementStart(0, "div", 21);
187
+ i0.ɵɵelement(1, "i", 48);
188
+ i0.ɵɵelementStart(2, "p", 49);
189
+ i0.ɵɵtext(3);
190
+ i0.ɵɵelementEnd();
191
+ i0.ɵɵelementStart(4, "p", 50);
192
+ i0.ɵɵtext(5, " Hover over any field or section header to anchor a discussion directly to that part of the record. ");
193
+ i0.ɵɵelementEnd()();
194
+ } if (rf & 2) {
195
+ const ctx_r1 = i0.ɵɵnextContext(2);
196
+ i0.ɵɵadvance(3);
197
+ i0.ɵɵtextInterpolate1("No ", ctx_r1.StatusFilter === "all" ? "" : ctx_r1.StatusFilter, " comments yet");
198
+ } }
199
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
200
+ i0.ɵɵelementStart(0, "div", 52);
201
+ i0.ɵɵelement(1, "i", 39);
202
+ i0.ɵɵelementStart(2, "span", 54);
203
+ i0.ɵɵtext(3);
204
+ i0.ɵɵelementEnd();
205
+ i0.ɵɵelementStart(4, "span", 55);
206
+ i0.ɵɵtext(5);
207
+ i0.ɵɵelementEnd()();
208
+ } if (rf & 2) {
209
+ const group_r13 = i0.ɵɵnextContext().$implicit;
210
+ i0.ɵɵadvance();
211
+ i0.ɵɵclassMap(group_r13.GroupIcon + " mj-record-comments__section-group-icon");
212
+ i0.ɵɵadvance(2);
213
+ i0.ɵɵtextInterpolate(group_r13.GroupTitle);
214
+ i0.ɵɵadvance(2);
215
+ i0.ɵɵtextInterpolate(group_r13.Threads.length);
216
+ } }
217
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_7_Template(rf, ctx) { if (rf & 1) {
218
+ i0.ɵɵelementStart(0, "span", 60);
219
+ i0.ɵɵelement(1, "i", 65);
220
+ i0.ɵɵtext(2, " FLS ");
221
+ i0.ɵɵelementEnd();
222
+ } if (rf & 2) {
223
+ const thread_r15 = i0.ɵɵnextContext().$implicit;
224
+ i0.ɵɵproperty("title", "FLS-protected fields referenced: " + thread_r15.RestrictedFields.join(", "));
225
+ } }
226
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_8_Template(rf, ctx) { if (rf & 1) {
227
+ const _r16 = i0.ɵɵgetCurrentView();
228
+ i0.ɵɵelementStart(0, "div", 61)(1, "button", 66);
229
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_8_Template_button_click_1_listener($event) { i0.ɵɵrestoreView(_r16); const thread_r15 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.OnToggleResolve(thread_r15, $event)); });
230
+ i0.ɵɵelement(2, "i", 39);
231
+ i0.ɵɵelementStart(3, "span");
232
+ i0.ɵɵtext(4);
233
+ i0.ɵɵelementEnd()()();
234
+ } if (rf & 2) {
235
+ const thread_r15 = i0.ɵɵnextContext().$implicit;
236
+ const ctx_r1 = i0.ɵɵnextContext(4);
237
+ i0.ɵɵadvance();
238
+ i0.ɵɵclassProp("mj-record-comments__resolve-btn--resolved", thread_r15.Conversation.IsResolved);
239
+ i0.ɵɵproperty("disabled", ctx_r1.ResolvingConversationId === thread_r15.Conversation.ID)("title", thread_r15.Conversation.IsResolved ? "Reopen thread" : "Resolve thread");
240
+ i0.ɵɵadvance();
241
+ i0.ɵɵclassMap(thread_r15.Conversation.IsResolved ? "fa-solid fa-rotate-left" : "fa-solid fa-check");
242
+ i0.ɵɵadvance(2);
243
+ i0.ɵɵtextInterpolate(thread_r15.Conversation.IsResolved ? "Reopen" : "Resolve");
244
+ } }
245
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_9_Conditional_5_Template(rf, ctx) { if (rf & 1) {
246
+ i0.ɵɵelementStart(0, "span", 70);
247
+ i0.ɵɵelement(1, "i", 71);
248
+ i0.ɵɵtext(2, " Now: ");
249
+ i0.ɵɵelementStart(3, "code");
250
+ i0.ɵɵtext(4);
251
+ i0.ɵɵelementEnd()();
252
+ } if (rf & 2) {
253
+ const thread_r15 = i0.ɵɵnextContext(2).$implicit;
254
+ i0.ɵɵadvance(4);
255
+ i0.ɵɵtextInterpolate(thread_r15.CurrentLiveValue);
256
+ } }
257
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_9_Template(rf, ctx) { if (rf & 1) {
258
+ i0.ɵɵelementStart(0, "div", 67)(1, "span", 68);
259
+ i0.ɵɵtext(2, "Value when commented:");
260
+ i0.ɵɵelementEnd();
261
+ i0.ɵɵelementStart(3, "code", 69);
262
+ i0.ɵɵtext(4);
263
+ i0.ɵɵelementEnd();
264
+ i0.ɵɵconditionalCreate(5, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_9_Conditional_5_Template, 5, 1, "span", 70);
265
+ i0.ɵɵelementEnd();
266
+ } if (rf & 2) {
267
+ const thread_r15 = i0.ɵɵnextContext().$implicit;
268
+ i0.ɵɵclassProp("mj-record-comments__quoted-value--changed", thread_r15.HasValueChangedSinceComment);
269
+ i0.ɵɵadvance(4);
270
+ i0.ɵɵtextInterpolate(thread_r15.QuotedValue);
271
+ i0.ɵɵadvance();
272
+ i0.ɵɵconditional(thread_r15.HasValueChangedSinceComment && thread_r15.CurrentLiveValue !== null ? 5 : -1);
273
+ } }
274
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Conditional_0_Template(rf, ctx) { if (rf & 1) {
275
+ const _r17 = i0.ɵɵgetCurrentView();
276
+ i0.ɵɵelementStart(0, "button", 82);
277
+ i0.ɵɵlistener("Navigate", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Conditional_0_Template_button_Navigate_0_listener($event) { i0.ɵɵrestoreView(_r17); const ctx_r1 = i0.ɵɵnextContext(7); return i0.ɵɵresetView(ctx_r1.OnMentionRecordNavigate($event)); });
278
+ i0.ɵɵelement(1, "i", 39);
279
+ i0.ɵɵelementStart(2, "span");
280
+ i0.ɵɵtext(3);
281
+ i0.ɵɵelementEnd()();
282
+ } if (rf & 2) {
283
+ const seg_r18 = i0.ɵɵnextContext().$implicit;
284
+ i0.ɵɵclassProp("mj-record-comments__mention-pill--agent", seg_r18.MentionType === "agent")("mj-record-comments__mention-pill--user", seg_r18.MentionType === "user");
285
+ i0.ɵɵproperty("EntityName", seg_r18.EntityName)("RecordID", seg_r18.ID)("DisplayName", seg_r18.Name)("title", "Open " + seg_r18.Name + " (" + (seg_r18.MentionType === "agent" ? "AI Agent" : "User") + ")");
286
+ i0.ɵɵadvance();
287
+ i0.ɵɵclassMap(seg_r18.MentionType === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
288
+ i0.ɵɵadvance(2);
289
+ i0.ɵɵtextInterpolate1("@", seg_r18.Name);
290
+ } }
291
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Conditional_1_Template(rf, ctx) { if (rf & 1) {
292
+ i0.ɵɵelementStart(0, "span", 83);
293
+ i0.ɵɵelement(1, "i", 39);
294
+ i0.ɵɵelementStart(2, "span");
295
+ i0.ɵɵtext(3);
296
+ i0.ɵɵelementEnd()();
297
+ } if (rf & 2) {
298
+ const seg_r18 = i0.ɵɵnextContext().$implicit;
299
+ i0.ɵɵclassProp("mj-record-comments__mention-pill--agent", seg_r18.MentionType === "agent")("mj-record-comments__mention-pill--user", seg_r18.MentionType === "user");
300
+ i0.ɵɵadvance();
301
+ i0.ɵɵclassMap(seg_r18.MentionType === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
302
+ i0.ɵɵadvance(2);
303
+ i0.ɵɵtextInterpolate1("@", seg_r18.Name);
304
+ } }
305
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Conditional_2_Template(rf, ctx) { if (rf & 1) {
306
+ i0.ɵɵelementStart(0, "span", 81);
307
+ i0.ɵɵtext(1);
308
+ i0.ɵɵelementEnd();
309
+ } if (rf & 2) {
310
+ const seg_r18 = i0.ɵɵnextContext().$implicit;
311
+ i0.ɵɵadvance();
312
+ i0.ɵɵtextInterpolate(seg_r18.Text);
313
+ } }
314
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Template(rf, ctx) { if (rf & 1) {
315
+ i0.ɵɵconditionalCreate(0, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Conditional_0_Template, 4, 11, "button", 79)(1, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Conditional_1_Template, 4, 7, "span", 80)(2, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Conditional_2_Template, 2, 1, "span", 81);
316
+ } if (rf & 2) {
317
+ const seg_r18 = ctx.$implicit;
318
+ i0.ɵɵconditional(seg_r18.Kind === "mention" && seg_r18.ID ? 0 : seg_r18.Kind === "mention" ? 1 : 2);
319
+ } }
320
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_Template(rf, ctx) { if (rf & 1) {
321
+ i0.ɵɵelementStart(0, "div", 72)(1, "div", 73);
322
+ i0.ɵɵtext(2);
323
+ i0.ɵɵelementEnd();
324
+ i0.ɵɵelementStart(3, "div", 74)(4, "div", 75)(5, "span", 76);
325
+ i0.ɵɵtext(6);
326
+ i0.ɵɵelementEnd();
327
+ i0.ɵɵelementStart(7, "span", 77);
328
+ i0.ɵɵtext(8);
329
+ i0.ɵɵelementEnd()();
330
+ i0.ɵɵelementStart(9, "div", 78);
331
+ i0.ɵɵrepeaterCreate(10, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_For_11_Template, 3, 1, null, null, i0.ɵɵrepeaterTrackByIndex);
332
+ i0.ɵɵelementEnd()()();
333
+ } if (rf & 2) {
334
+ const msg_r19 = ctx.$implicit;
335
+ const ctx_r1 = i0.ɵɵnextContext(5);
336
+ i0.ɵɵclassProp("mj-record-comments__message--ai", msg_r19.Role === "AI");
337
+ i0.ɵɵadvance();
338
+ i0.ɵɵclassProp("mj-record-comments__avatar--ai", msg_r19.Role === "AI");
339
+ i0.ɵɵadvance();
340
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.FormatAuthorInitials(msg_r19), " ");
341
+ i0.ɵɵadvance(4);
342
+ i0.ɵɵtextInterpolate1(" ", msg_r19.Role === "AI" ? "AI Assistant" : msg_r19.User || "User", " ");
343
+ i0.ɵɵadvance(2);
344
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.FormatRelativeTime(msg_r19.__mj_CreatedAt), " ");
345
+ i0.ɵɵadvance(2);
346
+ i0.ɵɵrepeater(ctx_r1.ParseMessageSegments(msg_r19.Message));
347
+ } }
348
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_1_For_2_Template(rf, ctx) { if (rf & 1) {
349
+ const _r21 = i0.ɵɵgetCurrentView();
350
+ i0.ɵɵelementStart(0, "span", 43);
351
+ i0.ɵɵelement(1, "i", 39);
352
+ i0.ɵɵelementStart(2, "span");
353
+ i0.ɵɵtext(3);
354
+ i0.ɵɵelementEnd();
355
+ i0.ɵɵelementStart(4, "button", 44);
356
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_1_For_2_Template_button_click_4_listener() { const m_r22 = i0.ɵɵrestoreView(_r21).$implicit; const thread_r15 = i0.ɵɵnextContext(3).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.RemoveDraftMention(m_r22, thread_r15.Conversation.ID)); });
357
+ i0.ɵɵelement(5, "i", 13);
358
+ i0.ɵɵelementEnd()();
359
+ } if (rf & 2) {
360
+ const m_r22 = ctx.$implicit;
361
+ i0.ɵɵclassProp("mj-record-comments__draft-mention-chip--agent", m_r22.Type === "agent");
362
+ i0.ɵɵadvance();
363
+ i0.ɵɵclassMap(m_r22.Type === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
364
+ i0.ɵɵadvance(2);
365
+ i0.ɵɵtextInterpolate1("@", m_r22.Name);
366
+ i0.ɵɵadvance();
367
+ i0.ɵɵproperty("title", "Remove @" + m_r22.Name);
368
+ i0.ɵɵattribute("aria-label", "Remove @" + m_r22.Name);
369
+ } }
370
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_1_Template(rf, ctx) { if (rf & 1) {
371
+ i0.ɵɵelementStart(0, "div", 84);
372
+ i0.ɵɵrepeaterCreate(1, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_1_For_2_Template, 6, 7, "span", 42, _forTrack0);
373
+ i0.ɵɵelementEnd();
374
+ } if (rf & 2) {
375
+ i0.ɵɵnextContext();
376
+ const drawerReplyDraftMentions_r23 = i0.ɵɵreadContextLet(0);
377
+ i0.ɵɵadvance();
378
+ i0.ɵɵrepeater(drawerReplyDraftMentions_r23);
379
+ } }
380
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_7_For_2_Conditional_5_Template(rf, ctx) { if (rf & 1) {
381
+ i0.ɵɵelementStart(0, "span", 41);
382
+ i0.ɵɵtext(1);
383
+ i0.ɵɵelementEnd();
384
+ } if (rf & 2) {
385
+ const cand_r25 = i0.ɵɵnextContext().$implicit;
386
+ i0.ɵɵadvance();
387
+ i0.ɵɵtextInterpolate(cand_r25.Subtitle);
388
+ } }
389
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_7_For_2_Template(rf, ctx) { if (rf & 1) {
390
+ const _r24 = i0.ɵɵgetCurrentView();
391
+ i0.ɵɵelementStart(0, "li", 37);
392
+ i0.ɵɵlistener("mousedown", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_7_For_2_Template_li_mousedown_0_listener($event) { const cand_r25 = i0.ɵɵrestoreView(_r24).$implicit; const thread_r15 = i0.ɵɵnextContext(3).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.InsertMentionCandidate(cand_r25, thread_r15.Conversation.ID)); });
393
+ i0.ɵɵelementStart(1, "span", 38);
394
+ i0.ɵɵelement(2, "i", 39);
395
+ i0.ɵɵelementEnd();
396
+ i0.ɵɵelementStart(3, "span", 40);
397
+ i0.ɵɵtext(4);
398
+ i0.ɵɵelementEnd();
399
+ i0.ɵɵconditionalCreate(5, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_7_For_2_Conditional_5_Template, 2, 1, "span", 41);
400
+ i0.ɵɵelementEnd();
401
+ } if (rf & 2) {
402
+ const cand_r25 = ctx.$implicit;
403
+ const ɵ$index_284_r26 = ctx.$index;
404
+ const ctx_r1 = i0.ɵɵnextContext(7);
405
+ i0.ɵɵclassProp("mj-record-comments__mention-option--active", ɵ$index_284_r26 === (ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.SelectedIndex));
406
+ i0.ɵɵattribute("aria-selected", ɵ$index_284_r26 === (ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.SelectedIndex));
407
+ i0.ɵɵadvance();
408
+ i0.ɵɵattribute("data-type", cand_r25.Type);
409
+ i0.ɵɵadvance();
410
+ i0.ɵɵclassMap(cand_r25.Type === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
411
+ i0.ɵɵadvance(2);
412
+ i0.ɵɵtextInterpolate(cand_r25.Name);
413
+ i0.ɵɵadvance();
414
+ i0.ɵɵconditional(cand_r25.Subtitle ? 5 : -1);
415
+ } }
416
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_7_Template(rf, ctx) { if (rf & 1) {
417
+ i0.ɵɵelementStart(0, "ul", 31);
418
+ i0.ɵɵrepeaterCreate(1, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_7_For_2_Template, 6, 8, "li", 36, _forTrack0);
419
+ i0.ɵɵelementEnd();
420
+ } if (rf & 2) {
421
+ const ctx_r1 = i0.ɵɵnextContext(6);
422
+ i0.ɵɵadvance();
423
+ i0.ɵɵrepeater(ctx_r1.FilteredMentionCandidates);
424
+ } }
425
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Template(rf, ctx) { if (rf & 1) {
426
+ const _r20 = i0.ɵɵgetCurrentView();
427
+ i0.ɵɵdeclareLet(0);
428
+ i0.ɵɵconditionalCreate(1, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_1_Template, 3, 0, "div", 84);
429
+ i0.ɵɵelementStart(2, "form", 85);
430
+ i0.ɵɵlistener("submit", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Template_form_submit_2_listener($event) { i0.ɵɵrestoreView(_r20); const thread_r15 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(4); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.OnSubmitReply(thread_r15.Conversation.ID)); });
431
+ i0.ɵɵelementStart(3, "label", 86);
432
+ i0.ɵɵtext(4);
433
+ i0.ɵɵelementEnd();
434
+ i0.ɵɵelementStart(5, "div", 29)(6, "textarea", 87);
435
+ i0.ɵɵlistener("input", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Template_textarea_input_6_listener($event) { i0.ɵɵrestoreView(_r20); const thread_r15 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.OnReplyInput(thread_r15.Conversation.ID, $event)); })("compositionend", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Template_textarea_compositionend_6_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.OnComposerCompositionEnd($event)); })("keydown", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Template_textarea_keydown_6_listener($event) { i0.ɵɵrestoreView(_r20); const thread_r15 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.OnComposerKeydown($event, thread_r15.Conversation.ID)); });
436
+ i0.ɵɵelementEnd();
437
+ i0.ɵɵconditionalCreate(7, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Conditional_7_Template, 3, 0, "ul", 31);
438
+ i0.ɵɵelementEnd();
439
+ i0.ɵɵelementStart(8, "button", 88);
440
+ i0.ɵɵelement(9, "i", 46);
441
+ i0.ɵɵelementEnd()();
442
+ } if (rf & 2) {
443
+ const thread_r15 = i0.ɵɵnextContext().$implicit;
444
+ const ctx_r1 = i0.ɵɵnextContext(4);
445
+ const drawerReplyDraftMentions_r27 = i0.ɵɵstoreLet(ctx_r1.GetDraftMentions(thread_r15.Conversation.ID));
446
+ i0.ɵɵadvance();
447
+ i0.ɵɵconditional(drawerReplyDraftMentions_r27.length > 0 ? 1 : -1);
448
+ i0.ɵɵadvance(2);
449
+ i0.ɵɵattribute("for", "mj-reply-" + thread_r15.Conversation.ID);
450
+ i0.ɵɵadvance();
451
+ i0.ɵɵtextInterpolate1(" Reply to ", thread_r15.AnchorBadgeLabel, " thread ");
452
+ i0.ɵɵadvance(2);
453
+ i0.ɵɵproperty("id", "mj-reply-" + thread_r15.Conversation.ID)("value", ctx_r1.GetReplyDraft(thread_r15.Conversation.ID));
454
+ i0.ɵɵadvance();
455
+ i0.ɵɵconditional((ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.Target) === thread_r15.Conversation.ID && ctx_r1.FilteredMentionCandidates.length > 0 ? 7 : -1);
456
+ i0.ɵɵadvance();
457
+ i0.ɵɵproperty("disabled", !ctx_r1.GetReplyDraft(thread_r15.Conversation.ID).trim() || ctx_r1.SubmittingReplyConversationId === thread_r15.Conversation.ID);
458
+ } }
459
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Template(rf, ctx) { if (rf & 1) {
460
+ const _r14 = i0.ɵɵgetCurrentView();
461
+ i0.ɵɵelementStart(0, "article", 56)(1, "div", 57)(2, "button", 58);
462
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Template_button_click_2_listener() { const thread_r15 = i0.ɵɵrestoreView(_r14).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.OnAnchorBadgeClick(thread_r15)); });
463
+ i0.ɵɵelement(3, "i", 39);
464
+ i0.ɵɵelementStart(4, "span");
465
+ i0.ɵɵtext(5);
466
+ i0.ɵɵelementEnd();
467
+ i0.ɵɵelement(6, "i", 59);
468
+ i0.ɵɵelementEnd();
469
+ i0.ɵɵconditionalCreate(7, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_7_Template, 3, 1, "span", 60);
470
+ i0.ɵɵconditionalCreate(8, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_8_Template, 5, 7, "div", 61);
471
+ i0.ɵɵelementEnd();
472
+ i0.ɵɵconditionalCreate(9, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_9_Template, 6, 4, "div", 62);
473
+ i0.ɵɵelementStart(10, "div", 63);
474
+ i0.ɵɵrepeaterCreate(11, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_For_12_Template, 12, 7, "div", 64, _forTrack0);
475
+ i0.ɵɵelementEnd();
476
+ i0.ɵɵconditionalCreate(13, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Conditional_13_Template, 10, 8);
477
+ i0.ɵɵelementEnd();
478
+ } if (rf & 2) {
479
+ const thread_r15 = ctx.$implicit;
480
+ const ctx_r1 = i0.ɵɵnextContext(4);
481
+ i0.ɵɵclassProp("mj-record-comments__thread--resolved", thread_r15.Conversation.IsResolved);
482
+ i0.ɵɵadvance(2);
483
+ i0.ɵɵproperty("title", i0.ɵɵinterpolate1("Jump to ", thread_r15.AnchorBadgeLabel, " on form"));
484
+ i0.ɵɵattribute("data-anchor-type", thread_r15.AnchorType);
485
+ i0.ɵɵadvance();
486
+ i0.ɵɵclassMap(thread_r15.AnchorIcon);
487
+ i0.ɵɵadvance(2);
488
+ i0.ɵɵtextInterpolate(thread_r15.AnchorBadgeLabel);
489
+ i0.ɵɵadvance(2);
490
+ i0.ɵɵconditional(thread_r15.RestrictedFields.length > 0 ? 7 : -1);
491
+ i0.ɵɵadvance();
492
+ i0.ɵɵconditional(ctx_r1.CanUserPostComments ? 8 : -1);
493
+ i0.ɵɵadvance();
494
+ i0.ɵɵconditional(thread_r15.QuotedValue !== null ? 9 : -1);
495
+ i0.ɵɵadvance(2);
496
+ i0.ɵɵrepeater(thread_r15.Messages);
497
+ i0.ɵɵadvance(2);
498
+ i0.ɵɵconditional(ctx_r1.CanUserPostComments ? 13 : -1);
499
+ } }
500
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_Template(rf, ctx) { if (rf & 1) {
501
+ i0.ɵɵelementStart(0, "section", 51);
502
+ i0.ɵɵconditionalCreate(1, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_Conditional_1_Template, 6, 4, "div", 52);
503
+ i0.ɵɵrepeaterCreate(2, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_For_3_Template, 14, 12, "article", 53, _forTrack2);
504
+ i0.ɵɵelementEnd();
505
+ } if (rf & 2) {
506
+ const group_r13 = ctx.$implicit;
507
+ const ctx_r1 = i0.ɵɵnextContext(3);
508
+ i0.ɵɵadvance();
509
+ i0.ɵɵconditional(!ctx_r1.TargetFilter ? 1 : -1);
510
+ i0.ɵɵadvance();
511
+ i0.ɵɵrepeater(group_r13.Threads);
512
+ } }
513
+ function MjRecordCommentsComponent_Conditional_0_Conditional_28_Template(rf, ctx) { if (rf & 1) {
514
+ i0.ɵɵrepeaterCreate(0, MjRecordCommentsComponent_Conditional_0_Conditional_28_For_1_Template, 4, 1, "section", 51, _forTrack1);
515
+ } if (rf & 2) {
516
+ const ctx_r1 = i0.ɵɵnextContext(2);
517
+ i0.ɵɵrepeater(ctx_r1.GroupedVisibleThreads);
518
+ } }
519
+ function MjRecordCommentsComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
520
+ const _r1 = i0.ɵɵgetCurrentView();
521
+ i0.ɵɵelementStart(0, "div", 1);
522
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnClose()); });
523
+ i0.ɵɵelementEnd();
524
+ i0.ɵɵelementStart(1, "aside", 2)(2, "div", 3);
525
+ i0.ɵɵlistener("mousedown", function MjRecordCommentsComponent_Conditional_0_Template_div_mousedown_2_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnDrawerResizeStart($event)); });
526
+ i0.ɵɵelementEnd();
527
+ i0.ɵɵelementStart(3, "header", 4)(4, "div", 5);
528
+ i0.ɵɵelement(5, "i", 6);
529
+ i0.ɵɵelementStart(6, "h3", 7);
530
+ i0.ɵɵtext(7, "Comments");
531
+ i0.ɵɵelementEnd();
532
+ i0.ɵɵconditionalCreate(8, MjRecordCommentsComponent_Conditional_0_Conditional_8_Template, 2, 2, "span", 8);
533
+ i0.ɵɵelementEnd();
534
+ i0.ɵɵelementStart(9, "div", 9)(10, "button", 10);
535
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Template_button_click_10_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnRefresh()); });
536
+ i0.ɵɵelement(11, "i", 11);
537
+ i0.ɵɵelementEnd();
538
+ i0.ɵɵelementStart(12, "button", 12);
539
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Template_button_click_12_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnClose()); });
540
+ i0.ɵɵelement(13, "i", 13);
541
+ i0.ɵɵelementEnd()()();
542
+ i0.ɵɵelementStart(14, "div", 14)(15, "div", 15)(16, "button", 16);
543
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Template_button_click_16_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnStatusFilterChange("open")); });
544
+ i0.ɵɵtext(17);
545
+ i0.ɵɵelementEnd();
546
+ i0.ɵɵelementStart(18, "button", 16);
547
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Template_button_click_18_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnStatusFilterChange("resolved")); });
548
+ i0.ɵɵtext(19);
549
+ i0.ɵɵelementEnd();
550
+ i0.ɵɵelementStart(20, "button", 16);
551
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_0_Template_button_click_20_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnStatusFilterChange("all")); });
552
+ i0.ɵɵtext(21, " All ");
553
+ i0.ɵɵelementEnd()();
554
+ i0.ɵɵconditionalCreate(22, MjRecordCommentsComponent_Conditional_0_Conditional_22_Template, 9, 1, "div", 17);
555
+ i0.ɵɵelementEnd();
556
+ i0.ɵɵconditionalCreate(23, MjRecordCommentsComponent_Conditional_0_Conditional_23_Template, 6, 1, "div", 18);
557
+ i0.ɵɵconditionalCreate(24, MjRecordCommentsComponent_Conditional_0_Conditional_24_Template, 15, 8, "form", 19);
558
+ i0.ɵɵelementStart(25, "div", 20);
559
+ i0.ɵɵconditionalCreate(26, MjRecordCommentsComponent_Conditional_0_Conditional_26_Template, 4, 0, "div", 21)(27, MjRecordCommentsComponent_Conditional_0_Conditional_27_Template, 6, 1, "div", 21)(28, MjRecordCommentsComponent_Conditional_0_Conditional_28_Template, 2, 0);
560
+ i0.ɵɵelementEnd()();
561
+ } if (rf & 2) {
562
+ const ctx_r1 = i0.ɵɵnextContext();
563
+ i0.ɵɵadvance();
564
+ i0.ɵɵstyleProp("width", ctx_r1.EffectiveDrawerWidthPx, "px");
565
+ i0.ɵɵclassProp("mj-record-comments-drawer--resizing", ctx_r1.IsResizingDrawer);
566
+ i0.ɵɵadvance(7);
567
+ i0.ɵɵconditional(ctx_r1.OpenCount > 0 ? 8 : -1);
568
+ i0.ɵɵadvance(2);
569
+ i0.ɵɵproperty("disabled", ctx_r1.IsLoading);
570
+ i0.ɵɵadvance();
571
+ i0.ɵɵclassProp("fa-spin", ctx_r1.IsLoading);
572
+ i0.ɵɵadvance(5);
573
+ i0.ɵɵclassProp("mj-record-comments__status-tab--active", ctx_r1.StatusFilter === "open");
574
+ i0.ɵɵattribute("aria-selected", ctx_r1.StatusFilter === "open");
575
+ i0.ɵɵadvance();
576
+ i0.ɵɵtextInterpolate1(" Open (", ctx_r1.OpenCount, ") ");
577
+ i0.ɵɵadvance();
578
+ i0.ɵɵclassProp("mj-record-comments__status-tab--active", ctx_r1.StatusFilter === "resolved");
579
+ i0.ɵɵattribute("aria-selected", ctx_r1.StatusFilter === "resolved");
580
+ i0.ɵɵadvance();
581
+ i0.ɵɵtextInterpolate1(" Resolved (", ctx_r1.ResolvedCount, ") ");
582
+ i0.ɵɵadvance();
583
+ i0.ɵɵclassProp("mj-record-comments__status-tab--active", ctx_r1.StatusFilter === "all");
584
+ i0.ɵɵattribute("aria-selected", ctx_r1.StatusFilter === "all");
585
+ i0.ɵɵadvance(2);
586
+ i0.ɵɵconditional(ctx_r1.TargetFilter ? 22 : -1);
587
+ i0.ɵɵadvance();
588
+ i0.ɵɵconditional(ctx_r1.ErrorBannerMessage ? 23 : -1);
589
+ i0.ɵɵadvance();
590
+ i0.ɵɵconditional(ctx_r1.CanUserPostComments ? 24 : -1);
591
+ i0.ɵɵadvance(2);
592
+ i0.ɵɵconditional(ctx_r1.IsLoading && ctx_r1.VisibleThreads.length === 0 ? 26 : ctx_r1.VisibleThreads.length === 0 ? 27 : 28);
593
+ } }
594
+ function MjRecordCommentsComponent_Conditional_1_Conditional_14_Template(rf, ctx) { if (rf & 1) {
595
+ i0.ɵɵelementStart(0, "div", 18);
596
+ i0.ɵɵelement(1, "i", 25);
597
+ i0.ɵɵelementStart(2, "span");
598
+ i0.ɵɵtext(3);
599
+ i0.ɵɵelementEnd()();
600
+ } if (rf & 2) {
601
+ const ctx_r1 = i0.ɵɵnextContext(2);
602
+ i0.ɵɵadvance(3);
603
+ i0.ɵɵtextInterpolate(ctx_r1.ErrorBannerMessage);
604
+ } }
605
+ function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_4_Template(rf, ctx) { if (rf & 1) {
606
+ const _r29 = i0.ɵɵgetCurrentView();
607
+ i0.ɵɵelementStart(0, "button", 101);
608
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_4_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r29); const thread_r30 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnToggleResolve(thread_r30, $event)); });
609
+ i0.ɵɵelement(1, "i", 102);
610
+ i0.ɵɵelementStart(2, "span");
611
+ i0.ɵɵtext(3, "Resolve");
612
+ i0.ɵɵelementEnd()();
613
+ } if (rf & 2) {
614
+ const thread_r30 = i0.ɵɵnextContext().$implicit;
615
+ const ctx_r1 = i0.ɵɵnextContext(2);
616
+ i0.ɵɵproperty("disabled", ctx_r1.ResolvingConversationId === thread_r30.Conversation.ID);
617
+ } }
618
+ function MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Conditional_0_Template(rf, ctx) { if (rf & 1) {
619
+ const _r31 = i0.ɵɵgetCurrentView();
620
+ i0.ɵɵelementStart(0, "button", 82);
621
+ i0.ɵɵlistener("Navigate", function MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Conditional_0_Template_button_Navigate_0_listener($event) { i0.ɵɵrestoreView(_r31); const ctx_r1 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r1.OnMentionRecordNavigate($event)); });
622
+ i0.ɵɵelement(1, "i", 39);
623
+ i0.ɵɵelementStart(2, "span");
624
+ i0.ɵɵtext(3);
625
+ i0.ɵɵelementEnd()();
626
+ } if (rf & 2) {
627
+ const seg_r32 = i0.ɵɵnextContext().$implicit;
628
+ i0.ɵɵclassProp("mj-record-comments__mention-pill--agent", seg_r32.MentionType === "agent")("mj-record-comments__mention-pill--user", seg_r32.MentionType === "user");
629
+ i0.ɵɵproperty("EntityName", seg_r32.EntityName)("RecordID", seg_r32.ID)("DisplayName", seg_r32.Name)("title", "Open " + seg_r32.Name + " (" + (seg_r32.MentionType === "agent" ? "AI Agent" : "User") + ")");
630
+ i0.ɵɵadvance();
631
+ i0.ɵɵclassMap(seg_r32.MentionType === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
632
+ i0.ɵɵadvance(2);
633
+ i0.ɵɵtextInterpolate1("@", seg_r32.Name);
634
+ } }
635
+ function MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Conditional_1_Template(rf, ctx) { if (rf & 1) {
636
+ i0.ɵɵelementStart(0, "span", 83);
637
+ i0.ɵɵelement(1, "i", 39);
638
+ i0.ɵɵelementStart(2, "span");
639
+ i0.ɵɵtext(3);
640
+ i0.ɵɵelementEnd()();
641
+ } if (rf & 2) {
642
+ const seg_r32 = i0.ɵɵnextContext().$implicit;
643
+ i0.ɵɵclassProp("mj-record-comments__mention-pill--agent", seg_r32.MentionType === "agent")("mj-record-comments__mention-pill--user", seg_r32.MentionType === "user");
644
+ i0.ɵɵadvance();
645
+ i0.ɵɵclassMap(seg_r32.MentionType === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
646
+ i0.ɵɵadvance(2);
647
+ i0.ɵɵtextInterpolate1("@", seg_r32.Name);
648
+ } }
649
+ function MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Conditional_2_Template(rf, ctx) { if (rf & 1) {
650
+ i0.ɵɵelementStart(0, "span", 81);
651
+ i0.ɵɵtext(1);
652
+ i0.ɵɵelementEnd();
653
+ } if (rf & 2) {
654
+ const seg_r32 = i0.ɵɵnextContext().$implicit;
655
+ i0.ɵɵadvance();
656
+ i0.ɵɵtextInterpolate(seg_r32.Text);
657
+ } }
658
+ function MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Template(rf, ctx) { if (rf & 1) {
659
+ i0.ɵɵconditionalCreate(0, MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Conditional_0_Template, 4, 11, "button", 79)(1, MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Conditional_1_Template, 4, 7, "span", 80)(2, MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Conditional_2_Template, 2, 1, "span", 81);
660
+ } if (rf & 2) {
661
+ const seg_r32 = ctx.$implicit;
662
+ i0.ɵɵconditional(seg_r32.Kind === "mention" && seg_r32.ID ? 0 : seg_r32.Kind === "mention" ? 1 : 2);
663
+ } }
664
+ function MjRecordCommentsComponent_Conditional_1_For_17_For_7_Template(rf, ctx) { if (rf & 1) {
665
+ i0.ɵɵelementStart(0, "div", 72)(1, "div", 73);
666
+ i0.ɵɵtext(2);
667
+ i0.ɵɵelementEnd();
668
+ i0.ɵɵelementStart(3, "div", 74)(4, "div", 75)(5, "span", 76);
669
+ i0.ɵɵtext(6);
670
+ i0.ɵɵelementEnd();
671
+ i0.ɵɵelementStart(7, "span", 77);
672
+ i0.ɵɵtext(8);
673
+ i0.ɵɵelementEnd()();
674
+ i0.ɵɵelementStart(9, "div", 78);
675
+ i0.ɵɵrepeaterCreate(10, MjRecordCommentsComponent_Conditional_1_For_17_For_7_For_11_Template, 3, 1, null, null, i0.ɵɵrepeaterTrackByIndex);
676
+ i0.ɵɵelementEnd()()();
677
+ } if (rf & 2) {
678
+ const msg_r33 = ctx.$implicit;
679
+ const ctx_r1 = i0.ɵɵnextContext(3);
680
+ i0.ɵɵclassProp("mj-record-comments__message--ai", msg_r33.Role === "AI");
681
+ i0.ɵɵadvance();
682
+ i0.ɵɵclassProp("mj-record-comments__avatar--ai", msg_r33.Role === "AI");
683
+ i0.ɵɵadvance();
684
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.FormatAuthorInitials(msg_r33), " ");
685
+ i0.ɵɵadvance(4);
686
+ i0.ɵɵtextInterpolate1(" ", msg_r33.Role === "AI" ? "AI Assistant" : msg_r33.User || "User", " ");
687
+ i0.ɵɵadvance(2);
688
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.FormatRelativeTime(msg_r33.__mj_CreatedAt), " ");
689
+ i0.ɵɵadvance(2);
690
+ i0.ɵɵrepeater(ctx_r1.ParseMessageSegments(msg_r33.Message));
691
+ } }
692
+ function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_1_For_2_Template(rf, ctx) { if (rf & 1) {
693
+ const _r35 = i0.ɵɵgetCurrentView();
694
+ i0.ɵɵelementStart(0, "span", 43);
695
+ i0.ɵɵelement(1, "i", 39);
696
+ i0.ɵɵelementStart(2, "span");
697
+ i0.ɵɵtext(3);
698
+ i0.ɵɵelementEnd();
699
+ i0.ɵɵelementStart(4, "button", 44);
700
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_1_For_2_Template_button_click_4_listener() { const m_r36 = i0.ɵɵrestoreView(_r35).$implicit; const thread_r30 = i0.ɵɵnextContext(3).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.RemoveDraftMention(m_r36, thread_r30.Conversation.ID)); });
701
+ i0.ɵɵelement(5, "i", 13);
702
+ i0.ɵɵelementEnd()();
703
+ } if (rf & 2) {
704
+ const m_r36 = ctx.$implicit;
705
+ i0.ɵɵclassProp("mj-record-comments__draft-mention-chip--agent", m_r36.Type === "agent");
706
+ i0.ɵɵadvance();
707
+ i0.ɵɵclassMap(m_r36.Type === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
708
+ i0.ɵɵadvance(2);
709
+ i0.ɵɵtextInterpolate1("@", m_r36.Name);
710
+ i0.ɵɵadvance();
711
+ i0.ɵɵproperty("title", "Remove @" + m_r36.Name);
712
+ i0.ɵɵattribute("aria-label", "Remove @" + m_r36.Name);
713
+ } }
714
+ function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_1_Template(rf, ctx) { if (rf & 1) {
715
+ i0.ɵɵelementStart(0, "div", 84);
716
+ i0.ɵɵrepeaterCreate(1, MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_1_For_2_Template, 6, 7, "span", 42, _forTrack0);
717
+ i0.ɵɵelementEnd();
718
+ } if (rf & 2) {
719
+ i0.ɵɵnextContext();
720
+ const popoverReplyDraftMentions_r37 = i0.ɵɵreadContextLet(0);
721
+ i0.ɵɵadvance();
722
+ i0.ɵɵrepeater(popoverReplyDraftMentions_r37);
723
+ } }
724
+ function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_7_For_2_Template(rf, ctx) { if (rf & 1) {
725
+ const _r38 = i0.ɵɵgetCurrentView();
726
+ i0.ɵɵelementStart(0, "li", 37);
727
+ i0.ɵɵlistener("mousedown", function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_7_For_2_Template_li_mousedown_0_listener($event) { const cand_r39 = i0.ɵɵrestoreView(_r38).$implicit; const thread_r30 = i0.ɵɵnextContext(3).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.InsertMentionCandidate(cand_r39, thread_r30.Conversation.ID)); });
728
+ i0.ɵɵelementStart(1, "span", 38);
729
+ i0.ɵɵelement(2, "i", 39);
730
+ i0.ɵɵelementEnd();
731
+ i0.ɵɵelementStart(3, "span", 40);
732
+ i0.ɵɵtext(4);
733
+ i0.ɵɵelementEnd()();
734
+ } if (rf & 2) {
735
+ const cand_r39 = ctx.$implicit;
736
+ const ɵ$index_426_r40 = ctx.$index;
737
+ const ctx_r1 = i0.ɵɵnextContext(5);
738
+ i0.ɵɵclassProp("mj-record-comments__mention-option--active", ɵ$index_426_r40 === (ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.SelectedIndex));
739
+ i0.ɵɵattribute("aria-selected", ɵ$index_426_r40 === (ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.SelectedIndex));
740
+ i0.ɵɵadvance();
741
+ i0.ɵɵattribute("data-type", cand_r39.Type);
742
+ i0.ɵɵadvance();
743
+ i0.ɵɵclassMap(cand_r39.Type === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
744
+ i0.ɵɵadvance(2);
745
+ i0.ɵɵtextInterpolate(cand_r39.Name);
746
+ } }
747
+ function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_7_Template(rf, ctx) { if (rf & 1) {
748
+ i0.ɵɵelementStart(0, "ul", 31);
749
+ i0.ɵɵrepeaterCreate(1, MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_7_For_2_Template, 5, 7, "li", 36, _forTrack0);
750
+ i0.ɵɵelementEnd();
751
+ } if (rf & 2) {
752
+ const ctx_r1 = i0.ɵɵnextContext(4);
753
+ i0.ɵɵadvance();
754
+ i0.ɵɵrepeater(ctx_r1.FilteredMentionCandidates);
755
+ } }
756
+ function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Template(rf, ctx) { if (rf & 1) {
757
+ const _r34 = i0.ɵɵgetCurrentView();
758
+ i0.ɵɵdeclareLet(0);
759
+ i0.ɵɵconditionalCreate(1, MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_1_Template, 3, 0, "div", 84);
760
+ i0.ɵɵelementStart(2, "form", 85);
761
+ i0.ɵɵlistener("submit", function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Template_form_submit_2_listener($event) { i0.ɵɵrestoreView(_r34); const thread_r30 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.OnSubmitReply(thread_r30.Conversation.ID)); });
762
+ i0.ɵɵelementStart(3, "label", 86);
763
+ i0.ɵɵtext(4);
764
+ i0.ɵɵelementEnd();
765
+ i0.ɵɵelementStart(5, "div", 29)(6, "textarea", 87);
766
+ i0.ɵɵlistener("input", function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Template_textarea_input_6_listener($event) { i0.ɵɵrestoreView(_r34); const thread_r30 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnReplyInput(thread_r30.Conversation.ID, $event)); })("compositionend", function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Template_textarea_compositionend_6_listener($event) { i0.ɵɵrestoreView(_r34); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnComposerCompositionEnd($event)); })("keydown", function MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Template_textarea_keydown_6_listener($event) { i0.ɵɵrestoreView(_r34); const thread_r30 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnComposerKeydown($event, thread_r30.Conversation.ID)); });
767
+ i0.ɵɵelementEnd();
768
+ i0.ɵɵconditionalCreate(7, MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Conditional_7_Template, 3, 0, "ul", 31);
769
+ i0.ɵɵelementEnd();
770
+ i0.ɵɵelementStart(8, "button", 88);
771
+ i0.ɵɵelement(9, "i", 46);
772
+ i0.ɵɵelementEnd()();
773
+ } if (rf & 2) {
774
+ const thread_r30 = i0.ɵɵnextContext().$implicit;
775
+ const ctx_r1 = i0.ɵɵnextContext(2);
776
+ const popoverReplyDraftMentions_r41 = i0.ɵɵstoreLet(ctx_r1.GetDraftMentions(thread_r30.Conversation.ID));
777
+ i0.ɵɵadvance();
778
+ i0.ɵɵconditional(popoverReplyDraftMentions_r41.length > 0 ? 1 : -1);
779
+ i0.ɵɵadvance(2);
780
+ i0.ɵɵattribute("for", "mj-popover-reply-" + thread_r30.Conversation.ID);
781
+ i0.ɵɵadvance();
782
+ i0.ɵɵtextInterpolate1(" Reply to ", ctx_r1.PopoverTarget.Label, " ");
783
+ i0.ɵɵadvance(2);
784
+ i0.ɵɵproperty("id", "mj-popover-reply-" + thread_r30.Conversation.ID)("value", ctx_r1.GetReplyDraft(thread_r30.Conversation.ID));
785
+ i0.ɵɵadvance();
786
+ i0.ɵɵconditional((ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.Target) === thread_r30.Conversation.ID && ctx_r1.FilteredMentionCandidates.length > 0 ? 7 : -1);
787
+ i0.ɵɵadvance();
788
+ i0.ɵɵproperty("disabled", !ctx_r1.GetReplyDraft(thread_r30.Conversation.ID).trim() || ctx_r1.SubmittingReplyConversationId === thread_r30.Conversation.ID);
789
+ } }
790
+ function MjRecordCommentsComponent_Conditional_1_For_17_Template(rf, ctx) { if (rf & 1) {
791
+ i0.ɵɵelementStart(0, "article", 97)(1, "div", 57)(2, "span", 99);
792
+ i0.ɵɵtext(3);
793
+ i0.ɵɵelementEnd();
794
+ i0.ɵɵconditionalCreate(4, MjRecordCommentsComponent_Conditional_1_For_17_Conditional_4_Template, 4, 1, "button", 100);
795
+ i0.ɵɵelementEnd();
796
+ i0.ɵɵelementStart(5, "div", 63);
797
+ i0.ɵɵrepeaterCreate(6, MjRecordCommentsComponent_Conditional_1_For_17_For_7_Template, 12, 7, "div", 64, _forTrack0);
798
+ i0.ɵɵelementEnd();
799
+ i0.ɵɵconditionalCreate(8, MjRecordCommentsComponent_Conditional_1_For_17_Conditional_8_Template, 10, 8);
800
+ i0.ɵɵelementEnd();
801
+ } if (rf & 2) {
802
+ const thread_r30 = ctx.$implicit;
803
+ const ctx_r1 = i0.ɵɵnextContext(2);
804
+ i0.ɵɵadvance(3);
805
+ i0.ɵɵtextInterpolate2(" ", thread_r30.Messages.length, " ", thread_r30.Messages.length === 1 ? "comment" : "comments", " ");
806
+ i0.ɵɵadvance();
807
+ i0.ɵɵconditional(ctx_r1.CanUserPostComments ? 4 : -1);
808
+ i0.ɵɵadvance(2);
809
+ i0.ɵɵrepeater(thread_r30.Messages);
810
+ i0.ɵɵadvance(2);
811
+ i0.ɵɵconditional(ctx_r1.CanUserPostComments ? 8 : -1);
812
+ } }
813
+ function MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_6_For_2_Template(rf, ctx) { if (rf & 1) {
814
+ const _r43 = i0.ɵɵgetCurrentView();
815
+ i0.ɵɵelementStart(0, "li", 37);
816
+ i0.ɵɵlistener("mousedown", function MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_6_For_2_Template_li_mousedown_0_listener($event) { const cand_r44 = i0.ɵɵrestoreView(_r43).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.InsertMentionCandidate(cand_r44, "new")); });
817
+ i0.ɵɵelementStart(1, "span", 38);
818
+ i0.ɵɵelement(2, "i", 39);
819
+ i0.ɵɵelementEnd();
820
+ i0.ɵɵelementStart(3, "span", 40);
821
+ i0.ɵɵtext(4);
822
+ i0.ɵɵelementEnd()();
823
+ } if (rf & 2) {
824
+ const cand_r44 = ctx.$implicit;
825
+ const ɵ$index_453_r45 = ctx.$index;
826
+ const ctx_r1 = i0.ɵɵnextContext(4);
827
+ i0.ɵɵclassProp("mj-record-comments__mention-option--active", ɵ$index_453_r45 === (ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.SelectedIndex));
828
+ i0.ɵɵattribute("aria-selected", ɵ$index_453_r45 === (ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.SelectedIndex));
829
+ i0.ɵɵadvance();
830
+ i0.ɵɵattribute("data-type", cand_r44.Type);
831
+ i0.ɵɵadvance();
832
+ i0.ɵɵclassMap(cand_r44.Type === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
833
+ i0.ɵɵadvance(2);
834
+ i0.ɵɵtextInterpolate(cand_r44.Name);
835
+ } }
836
+ function MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_6_Template(rf, ctx) { if (rf & 1) {
837
+ i0.ɵɵelementStart(0, "ul", 31);
838
+ i0.ɵɵrepeaterCreate(1, MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_6_For_2_Template, 5, 7, "li", 36, _forTrack0);
839
+ i0.ɵɵelementEnd();
840
+ } if (rf & 2) {
841
+ const ctx_r1 = i0.ɵɵnextContext(3);
842
+ i0.ɵɵadvance();
843
+ i0.ɵɵrepeater(ctx_r1.FilteredMentionCandidates);
844
+ } }
845
+ function MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_8_For_2_Template(rf, ctx) { if (rf & 1) {
846
+ const _r46 = i0.ɵɵgetCurrentView();
847
+ i0.ɵɵelementStart(0, "span", 43);
848
+ i0.ɵɵelement(1, "i", 39);
849
+ i0.ɵɵelementStart(2, "span");
850
+ i0.ɵɵtext(3);
851
+ i0.ɵɵelementEnd();
852
+ i0.ɵɵelementStart(4, "button", 44);
853
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_8_For_2_Template_button_click_4_listener() { const m_r47 = i0.ɵɵrestoreView(_r46).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.RemoveDraftMention(m_r47, "new")); });
854
+ i0.ɵɵelement(5, "i", 13);
855
+ i0.ɵɵelementEnd()();
856
+ } if (rf & 2) {
857
+ const m_r47 = ctx.$implicit;
858
+ i0.ɵɵclassProp("mj-record-comments__draft-mention-chip--agent", m_r47.Type === "agent");
859
+ i0.ɵɵadvance();
860
+ i0.ɵɵclassMap(m_r47.Type === "agent" ? "fa-solid fa-robot" : "fa-solid fa-user");
861
+ i0.ɵɵadvance(2);
862
+ i0.ɵɵtextInterpolate1("@", m_r47.Name);
863
+ i0.ɵɵadvance();
864
+ i0.ɵɵproperty("title", "Remove @" + m_r47.Name);
865
+ i0.ɵɵattribute("aria-label", "Remove @" + m_r47.Name);
866
+ } }
867
+ function MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_8_Template(rf, ctx) { if (rf & 1) {
868
+ i0.ɵɵelementStart(0, "div", 32);
869
+ i0.ɵɵrepeaterCreate(1, MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_8_For_2_Template, 6, 7, "span", 42, _forTrack0);
870
+ i0.ɵɵelementEnd();
871
+ } if (rf & 2) {
872
+ i0.ɵɵnextContext();
873
+ const popoverNewDraftMentions_r48 = i0.ɵɵreadContextLet(7);
874
+ i0.ɵɵadvance();
875
+ i0.ɵɵrepeater(popoverNewDraftMentions_r48);
876
+ } }
877
+ function MjRecordCommentsComponent_Conditional_1_Conditional_18_Template(rf, ctx) { if (rf & 1) {
878
+ const _r42 = i0.ɵɵgetCurrentView();
879
+ i0.ɵɵelementStart(0, "form", 103);
880
+ i0.ɵɵlistener("submit", function MjRecordCommentsComponent_Conditional_1_Conditional_18_Template_form_submit_0_listener($event) { i0.ɵɵrestoreView(_r42); const ctx_r1 = i0.ɵɵnextContext(2); $event.preventDefault(); return i0.ɵɵresetView(ctx_r1.OnSubmitNewThread()); });
881
+ i0.ɵɵelementStart(1, "label", 104);
882
+ i0.ɵɵtext(2);
883
+ i0.ɵɵelementEnd();
884
+ i0.ɵɵelementStart(3, "div", 29)(4, "textarea", 105, 0);
885
+ i0.ɵɵlistener("input", function MjRecordCommentsComponent_Conditional_1_Conditional_18_Template_textarea_input_4_listener($event) { i0.ɵɵrestoreView(_r42); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnNewThreadInput($event)); })("compositionend", function MjRecordCommentsComponent_Conditional_1_Conditional_18_Template_textarea_compositionend_4_listener($event) { i0.ɵɵrestoreView(_r42); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnComposerCompositionEnd($event)); })("keydown", function MjRecordCommentsComponent_Conditional_1_Conditional_18_Template_textarea_keydown_4_listener($event) { i0.ɵɵrestoreView(_r42); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnComposerKeydown($event, "new")); });
886
+ i0.ɵɵelementEnd();
887
+ i0.ɵɵconditionalCreate(6, MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_6_Template, 3, 0, "ul", 31);
888
+ i0.ɵɵelementEnd();
889
+ i0.ɵɵdeclareLet(7);
890
+ i0.ɵɵconditionalCreate(8, MjRecordCommentsComponent_Conditional_1_Conditional_18_Conditional_8_Template, 3, 0, "div", 32);
891
+ i0.ɵɵelementStart(9, "div", 33)(10, "button", 34);
892
+ i0.ɵɵelement(11, "i", 46);
893
+ i0.ɵɵtext(12, " Comment ");
894
+ i0.ɵɵelementEnd();
895
+ i0.ɵɵelementStart(13, "button", 106);
896
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_1_Conditional_18_Template_button_click_13_listener() { i0.ɵɵrestoreView(_r42); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnClose()); });
897
+ i0.ɵɵtext(14, " Cancel ");
898
+ i0.ɵɵelementEnd()()();
899
+ } if (rf & 2) {
900
+ const ctx_r1 = i0.ɵɵnextContext(2);
901
+ i0.ɵɵadvance(2);
902
+ i0.ɵɵtextInterpolate1(" Start a new comment thread on ", ctx_r1.PopoverTarget.Label, " ");
903
+ i0.ɵɵadvance(2);
904
+ i0.ɵɵproperty("value", ctx_r1.NewThreadMessage)("placeholder", ctx_r1.VisibleThreads.length > 0 ? "Start another thread on " + ctx_r1.PopoverTarget.Label + "..." : "Comment on " + ctx_r1.PopoverTarget.Label + "... (@ to mention)");
905
+ i0.ɵɵadvance(2);
906
+ i0.ɵɵconditional((ctx_r1.ActiveMentionContext == null ? null : ctx_r1.ActiveMentionContext.Target) === "new" && ctx_r1.FilteredMentionCandidates.length > 0 ? 6 : -1);
907
+ i0.ɵɵadvance();
908
+ const popoverNewDraftMentions_r49 = i0.ɵɵstoreLet(ctx_r1.GetDraftMentions("new"));
909
+ i0.ɵɵadvance();
910
+ i0.ɵɵconditional(popoverNewDraftMentions_r49.length > 0 ? 8 : -1);
911
+ i0.ɵɵadvance(2);
912
+ i0.ɵɵproperty("disabled", !ctx_r1.NewThreadMessage.trim() || ctx_r1.IsSubmittingNewThread);
913
+ } }
914
+ function MjRecordCommentsComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
915
+ const _r28 = i0.ɵɵgetCurrentView();
916
+ i0.ɵɵelementStart(0, "div", 89);
917
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_1_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r28); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnClose()); });
918
+ i0.ɵɵelementEnd();
919
+ i0.ɵɵelementStart(1, "section", 90)(2, "header", 91)(3, "div", 5);
920
+ i0.ɵɵelement(4, "i", 6);
921
+ i0.ɵɵelementStart(5, "h4", 7);
922
+ i0.ɵɵtext(6);
923
+ i0.ɵɵelementEnd()();
924
+ i0.ɵɵelementStart(7, "div", 9)(8, "button", 92);
925
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_1_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r28); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnTogglePopoverExpand()); });
926
+ i0.ɵɵelement(9, "i", 39);
927
+ i0.ɵɵelementEnd();
928
+ i0.ɵɵelementStart(10, "button", 93);
929
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_1_Template_button_click_10_listener() { i0.ɵɵrestoreView(_r28); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnSwitchPopoverToDrawer()); });
930
+ i0.ɵɵelement(11, "i", 94);
931
+ i0.ɵɵelementEnd();
932
+ i0.ɵɵelementStart(12, "button", 95);
933
+ i0.ɵɵlistener("click", function MjRecordCommentsComponent_Conditional_1_Template_button_click_12_listener() { i0.ɵɵrestoreView(_r28); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnClose()); });
934
+ i0.ɵɵelement(13, "i", 13);
935
+ i0.ɵɵelementEnd()()();
936
+ i0.ɵɵconditionalCreate(14, MjRecordCommentsComponent_Conditional_1_Conditional_14_Template, 4, 1, "div", 18);
937
+ i0.ɵɵelementStart(15, "div", 96);
938
+ i0.ɵɵrepeaterCreate(16, MjRecordCommentsComponent_Conditional_1_For_17_Template, 9, 4, "article", 97, _forTrack2);
939
+ i0.ɵɵelementEnd();
940
+ i0.ɵɵconditionalCreate(18, MjRecordCommentsComponent_Conditional_1_Conditional_18_Template, 15, 7, "form", 98);
941
+ i0.ɵɵelementEnd();
942
+ } if (rf & 2) {
943
+ const ctx_r1 = i0.ɵɵnextContext();
944
+ i0.ɵɵadvance();
945
+ i0.ɵɵclassProp("mj-record-comments-popover--expanded", ctx_r1.IsPopoverExpanded);
946
+ i0.ɵɵproperty("ngStyle", ctx_r1.PopoverStyle);
947
+ i0.ɵɵattribute("aria-label", "Comments on " + ctx_r1.PopoverTarget.Label);
948
+ i0.ɵɵadvance(5);
949
+ i0.ɵɵtextInterpolate(ctx_r1.PopoverTarget.Label);
950
+ i0.ɵɵadvance(2);
951
+ i0.ɵɵproperty("title", ctx_r1.IsPopoverExpanded ? "Restore dialog size" : "Expand dialog");
952
+ i0.ɵɵattribute("aria-label", ctx_r1.IsPopoverExpanded ? "Restore dialog size" : "Expand dialog");
953
+ i0.ɵɵadvance();
954
+ i0.ɵɵclassMap(ctx_r1.IsPopoverExpanded ? "fa-solid fa-compress" : "fa-solid fa-expand");
955
+ i0.ɵɵadvance(5);
956
+ i0.ɵɵconditional(ctx_r1.ErrorBannerMessage ? 14 : -1);
957
+ i0.ɵɵadvance(2);
958
+ i0.ɵɵrepeater(ctx_r1.VisibleThreads);
959
+ i0.ɵɵadvance(2);
960
+ i0.ɵɵconditional(ctx_r1.CanUserPostComments ? 18 : -1);
961
+ } }
962
+ const JSON_MENTION_REGEX = /@\{[^{}]+\}/g;
963
+ /**
964
+ * Renders threaded, anchored record comments (`MJ: Conversations` + `MJ: Conversation Details`)
965
+ * in either a right-hand slide-in `'drawer'` or an inline field/section-tethered `'popover'`.
966
+ */
967
+ export class MjRecordCommentsComponent extends BaseAngularComponent {
968
+ cdr = inject(ChangeDetectorRef);
969
+ hostRef = inject((ElementRef));
970
+ Coordinator = inject(FormRecordCommentsCoordinatorService, { optional: true });
971
+ static COMMENTS_WIDTH_SETTING_KEY = 'MJ_CommentsPanel_Width';
972
+ static DEFAULT_DRAWER_WIDTH_PX = 400;
973
+ static MIN_DRAWER_WIDTH_PX = 340;
974
+ static MAX_DRAWER_WIDTH_PX = 860;
975
+ Record = null;
976
+ Mode = 'drawer';
977
+ IsOpen = false;
978
+ WidthPx = 400;
979
+ Close = new EventEmitter();
980
+ CommentCountChange = new EventEmitter();
981
+ RollupChange = new EventEmitter();
982
+ NavigateToAnchor = new EventEmitter();
983
+ Navigate = new EventEmitter();
984
+ WidthChanged = new EventEmitter();
985
+ newThreadTextarea;
986
+ NewThreadMessage = '';
987
+ IsSubmittingNewThread = false;
988
+ ReplyDraftByConversationId = new Map();
989
+ SubmittingReplyConversationId = null;
990
+ ResolvingConversationId = null;
991
+ ErrorBannerMessage = null;
992
+ IsPopoverExpanded = false;
993
+ IsResizingDrawer = false;
994
+ drawerResizeCleanup = null;
995
+ // @Mention autocomplete state
996
+ MentionCandidates = [];
997
+ FilteredMentionCandidates = [];
998
+ SelectedMentionsByContext = new Map();
999
+ ActiveMentionContext = null;
1000
+ mentionCandidatesLoaded = false;
1001
+ // IME composition tracking (per modern-web-guidance `ime-safe-enter-submit`)
1002
+ lastCompositionEndAt = null;
1003
+ coordinatorSub = null;
1004
+ mentionSearchTimer = null;
1005
+ lastSearchedMentionQuery = '';
1006
+ ngOnInit() {
1007
+ this.loadPersistedDrawerWidth();
1008
+ if (this.Coordinator) {
1009
+ this.coordinatorSub = this.Coordinator.Changed$.subscribe(() => {
1010
+ const rollup = this.Coordinator.Rollup;
1011
+ this.CommentCountChange.emit(rollup.TotalOpenCount);
1012
+ this.RollupChange.emit(rollup);
1013
+ this.cdr.markForCheck();
1014
+ });
1015
+ if (this.Record) {
1016
+ this.Coordinator.BindRecord(this.Record, this.ProviderToUse);
1017
+ }
1018
+ }
1019
+ }
1020
+ get EffectiveDrawerWidthPx() {
1021
+ if (this.WidthPx > 0) {
1022
+ return Math.max(MjRecordCommentsComponent.MIN_DRAWER_WIDTH_PX, Math.min(MjRecordCommentsComponent.MAX_DRAWER_WIDTH_PX, this.WidthPx));
1023
+ }
1024
+ return MjRecordCommentsComponent.DEFAULT_DRAWER_WIDTH_PX;
1025
+ }
1026
+ loadPersistedDrawerWidth() {
1027
+ if (this.Mode !== 'drawer')
1028
+ return;
1029
+ try {
1030
+ const saved = UserInfoEngine.Instance.GetSetting(MjRecordCommentsComponent.COMMENTS_WIDTH_SETTING_KEY);
1031
+ if (saved) {
1032
+ const parsed = parseInt(saved, 10);
1033
+ if (!isNaN(parsed) && parsed > 0) {
1034
+ this.WidthPx = Math.max(MjRecordCommentsComponent.MIN_DRAWER_WIDTH_PX, Math.min(MjRecordCommentsComponent.MAX_DRAWER_WIDTH_PX, parsed));
1035
+ }
1036
+ }
1037
+ }
1038
+ catch {
1039
+ // Fall back to default width when UserInfoEngine is not initialized (e.g. unit tests)
1040
+ }
1041
+ }
1042
+ ngOnChanges(changes) {
1043
+ if (changes['Record'] && this.Coordinator) {
1044
+ this.Coordinator.BindRecord(this.Record, this.ProviderToUse);
1045
+ }
1046
+ if (changes['IsOpen'] && this.IsOpen) {
1047
+ if (this.Coordinator && !this.Coordinator.IsLoaded && !this.Coordinator.IsLoading) {
1048
+ void this.Coordinator.LoadForRecord(this.Record, this.ProviderToUse);
1049
+ }
1050
+ setTimeout(() => {
1051
+ this.newThreadTextarea?.nativeElement?.focus();
1052
+ }, 40);
1053
+ }
1054
+ }
1055
+ ngOnDestroy() {
1056
+ this.coordinatorSub?.unsubscribe();
1057
+ this.coordinatorSub = null;
1058
+ this.drawerResizeCleanup?.();
1059
+ this.drawerResizeCleanup = null;
1060
+ if (this.mentionSearchTimer) {
1061
+ clearTimeout(this.mentionSearchTimer);
1062
+ this.mentionSearchTimer = null;
1063
+ }
1064
+ }
1065
+ get CanUserPostComments() {
1066
+ const entityInfo = this.Record?.EntityInfo;
1067
+ if (!entityInfo)
1068
+ return true;
1069
+ if (entityInfo.AllowRecordComments === false)
1070
+ return false;
1071
+ const user = this.Coordinator?.CurrentUser ?? this.ProviderToUse?.CurrentUser;
1072
+ if (!user)
1073
+ return true;
1074
+ return entityInfo.CanUserComment(user);
1075
+ }
1076
+ OnEscapeKey(event) {
1077
+ if (this.ActiveMentionContext) {
1078
+ this.ActiveMentionContext = null;
1079
+ event.stopPropagation();
1080
+ this.cdr.markForCheck();
1081
+ return;
1082
+ }
1083
+ if (this.Mode === 'popover' && this.PopoverTarget) {
1084
+ this.OnClose();
1085
+ event.stopPropagation();
1086
+ }
1087
+ }
1088
+ get PopoverTarget() {
1089
+ return this.Coordinator?.ActivePopoverTarget ?? null;
1090
+ }
1091
+ get PopoverStyle() {
1092
+ const rect = this.PopoverTarget?.AnchorRect;
1093
+ const cardWidth = this.IsPopoverExpanded ? 560 : 400;
1094
+ const cardMaxHeight = this.IsPopoverExpanded ? 640 : 480;
1095
+ if (!rect || typeof window === 'undefined') {
1096
+ return {
1097
+ top: '96px',
1098
+ right: '24px',
1099
+ width: `${cardWidth}px`
1100
+ };
1101
+ }
1102
+ const viewportW = window.innerWidth || 1280;
1103
+ const viewportH = window.innerHeight || 800;
1104
+ let left = rect.left;
1105
+ if (left + cardWidth + 16 > viewportW) {
1106
+ left = Math.max(16, viewportW - cardWidth - 16);
1107
+ }
1108
+ let top = rect.bottom + 8;
1109
+ if (top + cardMaxHeight > viewportH && rect.top - cardMaxHeight - 8 > 16) {
1110
+ top = Math.max(16, rect.top - Math.min(cardMaxHeight, 340) - 8);
1111
+ }
1112
+ else if (top + 280 > viewportH) {
1113
+ top = Math.max(16, viewportH - Math.min(cardMaxHeight, viewportH - 32));
1114
+ }
1115
+ return {
1116
+ top: `${Math.round(top)}px`,
1117
+ left: `${Math.round(left)}px`,
1118
+ width: `${cardWidth}px`
1119
+ };
1120
+ }
1121
+ OnTogglePopoverExpand() {
1122
+ this.IsPopoverExpanded = !this.IsPopoverExpanded;
1123
+ this.cdr.markForCheck();
1124
+ }
1125
+ OnDrawerResizeStart(event) {
1126
+ event.preventDefault();
1127
+ event.stopPropagation();
1128
+ if (typeof window === 'undefined')
1129
+ return;
1130
+ this.IsResizingDrawer = true;
1131
+ const onMouseMove = (moveEvent) => {
1132
+ const viewportW = window.innerWidth || 1280;
1133
+ const desiredWidth = viewportW - moveEvent.clientX;
1134
+ this.WidthPx = Math.max(MjRecordCommentsComponent.MIN_DRAWER_WIDTH_PX, Math.min(MjRecordCommentsComponent.MAX_DRAWER_WIDTH_PX, Math.round(desiredWidth)));
1135
+ this.cdr.markForCheck();
1136
+ };
1137
+ const onMouseUp = () => {
1138
+ this.IsResizingDrawer = false;
1139
+ this.drawerResizeCleanup?.();
1140
+ this.drawerResizeCleanup = null;
1141
+ this.PersistDrawerWidth(this.WidthPx);
1142
+ this.cdr.markForCheck();
1143
+ };
1144
+ window.addEventListener('mousemove', onMouseMove);
1145
+ window.addEventListener('mouseup', onMouseUp);
1146
+ this.drawerResizeCleanup = () => {
1147
+ window.removeEventListener('mousemove', onMouseMove);
1148
+ window.removeEventListener('mouseup', onMouseUp);
1149
+ };
1150
+ }
1151
+ /**
1152
+ * Persists the comments drawer width in `UserInfoEngine` (`MJ_CommentsPanel_Width`) and emits `WidthChanged`.
1153
+ */
1154
+ PersistDrawerWidth(widthPx) {
1155
+ const clamped = Math.max(MjRecordCommentsComponent.MIN_DRAWER_WIDTH_PX, Math.min(MjRecordCommentsComponent.MAX_DRAWER_WIDTH_PX, Math.round(widthPx)));
1156
+ this.WidthPx = clamped;
1157
+ this.WidthChanged.emit(clamped);
1158
+ try {
1159
+ UserInfoEngine.Instance.SetSettingDebounced(MjRecordCommentsComponent.COMMENTS_WIDTH_SETTING_KEY, String(clamped));
1160
+ }
1161
+ catch {
1162
+ // Ignore when UserInfoEngine is not initialized in unit tests
1163
+ }
1164
+ }
1165
+ get StatusFilter() {
1166
+ return this.Coordinator?.DrawerStatusFilter ?? 'open';
1167
+ }
1168
+ get TargetFilter() {
1169
+ return this.Mode === 'popover'
1170
+ ? this.PopoverTarget
1171
+ : (this.Coordinator?.DrawerTargetFilter ?? null);
1172
+ }
1173
+ get OpenCount() {
1174
+ return this.Coordinator?.Rollup.TotalOpenCount ?? 0;
1175
+ }
1176
+ get ResolvedCount() {
1177
+ return this.Coordinator?.Rollup.TotalResolvedCount ?? 0;
1178
+ }
1179
+ get IsLoading() {
1180
+ return this.Coordinator?.IsLoading ?? false;
1181
+ }
1182
+ get VisibleThreads() {
1183
+ const coordinator = this.Coordinator;
1184
+ if (!coordinator)
1185
+ return [];
1186
+ const statusFilter = this.Mode === 'popover' ? 'open' : this.StatusFilter;
1187
+ const targetFilter = this.TargetFilter;
1188
+ const out = [];
1189
+ for (const conv of coordinator.Conversations) {
1190
+ if (!conv.AnchorType)
1191
+ continue;
1192
+ if (statusFilter === 'open' && conv.IsResolved)
1193
+ continue;
1194
+ if (statusFilter === 'resolved' && !conv.IsResolved)
1195
+ continue;
1196
+ const meta = ParseConversationAnchorMetadata(conv.AnchorMetadataObject ?? conv.AnchorMetadata);
1197
+ if (targetFilter) {
1198
+ if (!this.matchesTargetFilter(conv, meta, targetFilter)) {
1199
+ continue;
1200
+ }
1201
+ }
1202
+ out.push(this.buildThreadView(conv, meta, coordinator.GetDetailsForConversation(conv.ID)));
1203
+ }
1204
+ return out;
1205
+ }
1206
+ /**
1207
+ * Organizes `VisibleThreads` into logical section groups (`Details / Model Overview`,
1208
+ * `System Metadata`, `Record Comments`, etc.) so the side-rail drawer shows all record
1209
+ * comments clearly organized in one place.
1210
+ */
1211
+ get GroupedVisibleThreads() {
1212
+ const threads = this.VisibleThreads;
1213
+ if (threads.length === 0)
1214
+ return [];
1215
+ const groupsByKey = new Map();
1216
+ for (const thread of threads) {
1217
+ const key = thread.SectionGroupKey;
1218
+ let group = groupsByKey.get(key);
1219
+ if (!group) {
1220
+ group = {
1221
+ GroupKey: key,
1222
+ GroupTitle: thread.SectionGroupTitle,
1223
+ GroupIcon: thread.SectionGroupIcon,
1224
+ Threads: []
1225
+ };
1226
+ groupsByKey.set(key, group);
1227
+ }
1228
+ group.Threads.push(thread);
1229
+ }
1230
+ return Array.from(groupsByKey.values());
1231
+ }
1232
+ OnStatusFilterChange(status) {
1233
+ this.Coordinator?.SetDrawerStatusFilter(status);
1234
+ }
1235
+ OnClearTargetFilter() {
1236
+ this.Coordinator?.SetDrawerTargetFilter(null);
1237
+ }
1238
+ OnSwitchPopoverToDrawer() {
1239
+ this.IsPopoverExpanded = false;
1240
+ this.Coordinator?.SetDrawerOpen(true, null);
1241
+ }
1242
+ OnClose() {
1243
+ if (this.Mode === 'popover') {
1244
+ this.Coordinator?.ClosePopover();
1245
+ }
1246
+ else {
1247
+ this.Coordinator?.SetDrawerOpen(false);
1248
+ }
1249
+ this.Close.emit();
1250
+ }
1251
+ OnRefresh() {
1252
+ void this.Coordinator?.LoadForRecord(this.Record, this.ProviderToUse, true);
1253
+ }
1254
+ OnAnchorBadgeClick(thread) {
1255
+ const req = {
1256
+ AnchorType: thread.AnchorType,
1257
+ AnchorKey: thread.AnchorKey,
1258
+ SectionKey: thread.Metadata?.sectionKey ?? (thread.AnchorType === 'Section' ? thread.AnchorKey : null),
1259
+ GroupKey: thread.Metadata?.groupKey ?? (thread.AnchorType === 'Group' ? thread.AnchorKey : null)
1260
+ };
1261
+ this.Coordinator?.RequestNavigateToAnchor(req);
1262
+ this.NavigateToAnchor.emit(req);
1263
+ if (this.Mode === 'popover') {
1264
+ this.Coordinator?.ClosePopover();
1265
+ }
1266
+ }
1267
+ /**
1268
+ * Records the native `event.timeStamp` on `compositionend` per `ime-safe-enter-submit`
1269
+ * to prevent premature submission on Safari where `compositionend` fires before `keydown`.
1270
+ */
1271
+ OnComposerCompositionEnd(event) {
1272
+ this.lastCompositionEndAt = event.timeStamp;
1273
+ }
1274
+ /**
1275
+ * Handles keyboard navigation in `@mention` menu and IME-safe `Enter` (without `Shift`)
1276
+ * or `Cmd/Ctrl+Enter` submission in comment textareas.
1277
+ */
1278
+ OnComposerKeydown(event, contextKey) {
1279
+ if (this.ActiveMentionContext && this.ActiveMentionContext.Target === contextKey && this.FilteredMentionCandidates.length > 0) {
1280
+ if (event.key === 'ArrowDown') {
1281
+ event.preventDefault();
1282
+ this.ActiveMentionContext.SelectedIndex =
1283
+ (this.ActiveMentionContext.SelectedIndex + 1) % this.FilteredMentionCandidates.length;
1284
+ this.cdr.markForCheck();
1285
+ return;
1286
+ }
1287
+ if (event.key === 'ArrowUp') {
1288
+ event.preventDefault();
1289
+ this.ActiveMentionContext.SelectedIndex =
1290
+ (this.ActiveMentionContext.SelectedIndex - 1 + this.FilteredMentionCandidates.length) %
1291
+ this.FilteredMentionCandidates.length;
1292
+ this.cdr.markForCheck();
1293
+ return;
1294
+ }
1295
+ if (event.key === 'Enter' || event.key === 'Tab') {
1296
+ if (event.isComposing || event.keyCode === 229) {
1297
+ return;
1298
+ }
1299
+ event.preventDefault();
1300
+ const chosen = this.FilteredMentionCandidates[this.ActiveMentionContext.SelectedIndex];
1301
+ if (chosen) {
1302
+ this.InsertMentionCandidate(chosen, contextKey);
1303
+ }
1304
+ return;
1305
+ }
1306
+ }
1307
+ const isCmdOrCtrlEnter = event.key === 'Enter' && (event.metaKey || event.ctrlKey);
1308
+ const isPlainEnter = event.key === 'Enter' && !event.shiftKey && !event.metaKey && !event.ctrlKey && !event.altKey;
1309
+ if (isCmdOrCtrlEnter || isPlainEnter) {
1310
+ event.preventDefault();
1311
+ if (isPlainEnter) {
1312
+ if (event.isComposing || event.keyCode === 229) {
1313
+ return;
1314
+ }
1315
+ if (this.lastCompositionEndAt !== null &&
1316
+ Math.abs(event.timeStamp - this.lastCompositionEndAt) < 50) {
1317
+ return;
1318
+ }
1319
+ }
1320
+ if (contextKey === 'new') {
1321
+ void this.OnSubmitNewThread();
1322
+ }
1323
+ else {
1324
+ void this.OnSubmitReply(contextKey);
1325
+ }
1326
+ }
1327
+ }
1328
+ OnNewThreadInput(event) {
1329
+ const textarea = event.target;
1330
+ this.NewThreadMessage = textarea.value;
1331
+ this.updateMentionAutocomplete('new', textarea.value, textarea.selectionStart ?? textarea.value.length);
1332
+ }
1333
+ OnReplyInput(conversationId, event) {
1334
+ const textarea = event.target;
1335
+ this.ReplyDraftByConversationId.set(NormalizeUUID(conversationId), textarea.value);
1336
+ this.updateMentionAutocomplete(conversationId, textarea.value, textarea.selectionStart ?? textarea.value.length);
1337
+ }
1338
+ GetReplyDraft(conversationId) {
1339
+ return this.ReplyDraftByConversationId.get(NormalizeUUID(conversationId)) ?? '';
1340
+ }
1341
+ InsertMentionCandidate(candidate, contextKey) {
1342
+ const active = this.ActiveMentionContext;
1343
+ if (!active)
1344
+ return;
1345
+ const normKey = contextKey === 'new' ? 'new' : NormalizeUUID(contextKey);
1346
+ let contextMap = this.SelectedMentionsByContext.get(normKey);
1347
+ if (!contextMap) {
1348
+ contextMap = new Map();
1349
+ this.SelectedMentionsByContext.set(normKey, contextMap);
1350
+ }
1351
+ contextMap.set(candidate.Name.trim().toLowerCase(), candidate);
1352
+ const displayToken = `@${candidate.Name} `;
1353
+ const currentText = contextKey === 'new' ? this.NewThreadMessage : this.GetReplyDraft(contextKey);
1354
+ const before = currentText.slice(0, active.TriggerIndex);
1355
+ const after = currentText.slice(active.TriggerIndex + 1 + active.Query.length);
1356
+ const updated = `${before}${displayToken}${after}`;
1357
+ if (contextKey === 'new') {
1358
+ this.NewThreadMessage = updated;
1359
+ }
1360
+ else {
1361
+ this.ReplyDraftByConversationId.set(normKey, updated);
1362
+ }
1363
+ this.ActiveMentionContext = null;
1364
+ this.cdr.markForCheck();
1365
+ }
1366
+ /**
1367
+ * Returns the list of mentioned users/agents currently present in the draft for `contextKey`,
1368
+ * used to render interactive tagged chips right inside the composer.
1369
+ */
1370
+ GetDraftMentions(contextKey) {
1371
+ const normKey = contextKey === 'new' ? 'new' : NormalizeUUID(contextKey);
1372
+ const text = (contextKey === 'new' ? this.NewThreadMessage : this.GetReplyDraft(contextKey)).toLowerCase();
1373
+ if (!text.includes('@'))
1374
+ return [];
1375
+ const candidatesByName = new Map();
1376
+ const contextMap = this.SelectedMentionsByContext.get(normKey);
1377
+ if (contextMap) {
1378
+ for (const [k, v] of contextMap.entries()) {
1379
+ candidatesByName.set(k, v);
1380
+ }
1381
+ }
1382
+ for (const cand of this.MentionCandidates ?? []) {
1383
+ const key = cand.Name.trim().toLowerCase();
1384
+ if (!candidatesByName.has(key)) {
1385
+ candidatesByName.set(key, cand);
1386
+ }
1387
+ }
1388
+ const matched = [];
1389
+ for (const [nameLower, cand] of candidatesByName.entries()) {
1390
+ if (nameLower && text.includes(`@${nameLower}`)) {
1391
+ matched.push(cand);
1392
+ }
1393
+ }
1394
+ return matched;
1395
+ }
1396
+ /**
1397
+ * Removes a tagged mention chip from the composer draft.
1398
+ */
1399
+ RemoveDraftMention(candidate, contextKey) {
1400
+ const normKey = contextKey === 'new' ? 'new' : NormalizeUUID(contextKey);
1401
+ this.SelectedMentionsByContext.get(normKey)?.delete(candidate.Name.trim().toLowerCase());
1402
+ const currentText = contextKey === 'new' ? this.NewThreadMessage : this.GetReplyDraft(contextKey);
1403
+ const escapedName = candidate.Name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1404
+ const cleaned = currentText.replace(new RegExp(`@${escapedName}\\s?`, 'gi'), '').trimStart();
1405
+ if (contextKey === 'new') {
1406
+ this.NewThreadMessage = cleaned;
1407
+ }
1408
+ else {
1409
+ this.ReplyDraftByConversationId.set(normKey, cleaned);
1410
+ }
1411
+ this.cdr.markForCheck();
1412
+ }
1413
+ /**
1414
+ * Converts human-readable `@Name` mentions in a composer draft into canonical
1415
+ * `@{"type":"user"|"agent","id":"...","name":"..."}` wire tokens before saving.
1416
+ */
1417
+ SerializeMentionsForWire(rawText, contextKey) {
1418
+ if (!rawText || !rawText.includes('@')) {
1419
+ return rawText;
1420
+ }
1421
+ const normKey = contextKey === 'new' ? 'new' : NormalizeUUID(contextKey);
1422
+ const candidatesByName = new Map();
1423
+ const contextMap = this.SelectedMentionsByContext.get(normKey);
1424
+ if (contextMap) {
1425
+ for (const [k, v] of contextMap.entries()) {
1426
+ candidatesByName.set(k, v);
1427
+ }
1428
+ }
1429
+ for (const cand of this.MentionCandidates ?? []) {
1430
+ const key = cand.Name.trim().toLowerCase();
1431
+ if (!candidatesByName.has(key)) {
1432
+ candidatesByName.set(key, cand);
1433
+ }
1434
+ }
1435
+ if (candidatesByName.size === 0) {
1436
+ return rawText;
1437
+ }
1438
+ const sortedCandidates = Array.from(candidatesByName.values()).sort((a, b) => b.Name.length - a.Name.length);
1439
+ let serialized = rawText;
1440
+ for (const cand of sortedCandidates) {
1441
+ const escapedName = cand.Name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
1442
+ const pattern = new RegExp(`@${escapedName}(?=$|[\\s.,!?;:)])`, 'gi');
1443
+ const wireToken = `@{"type":"${cand.Type}","id":"${cand.ID}","name":${JSON.stringify(cand.Name)}}`;
1444
+ serialized = serialized.replace(pattern, () => wireToken);
1445
+ }
1446
+ return serialized;
1447
+ }
1448
+ async OnSubmitNewThread() {
1449
+ const rawText = this.NewThreadMessage.trim();
1450
+ if (!rawText || this.IsSubmittingNewThread || !this.Coordinator) {
1451
+ return;
1452
+ }
1453
+ const text = this.SerializeMentionsForWire(rawText, 'new');
1454
+ this.IsSubmittingNewThread = true;
1455
+ this.ErrorBannerMessage = null;
1456
+ this.cdr.markForCheck();
1457
+ try {
1458
+ const target = this.TargetFilter;
1459
+ const anchorType = target?.AnchorType ?? 'Record';
1460
+ const anchorKey = target?.AnchorKey ?? null;
1461
+ const fieldInfo = anchorType === 'Field' && anchorKey
1462
+ ? this.Record?.EntityInfo?.Fields.find((f) => f.Name.toLowerCase() === anchorKey.toLowerCase())
1463
+ : undefined;
1464
+ const isProtectedField = Boolean(fieldInfo?.HasFieldPermissions || fieldInfo?.Encrypt);
1465
+ const metadata = {
1466
+ anchorDisplayName: target?.Label || this.Record?.EntityInfo?.DisplayNameOrName || 'Record Comment',
1467
+ fieldName: anchorType === 'Field' ? (anchorKey ?? undefined) : undefined,
1468
+ sectionKey: target?.SectionKey,
1469
+ sectionDisplayName: target?.SectionDisplayName,
1470
+ groupKey: target?.GroupKey,
1471
+ groupDisplayName: target?.GroupDisplayName,
1472
+ quotedValue: isProtectedField ? undefined : target?.QuotedValue
1473
+ };
1474
+ await this.Coordinator.StartAnchoredThread({
1475
+ AnchorType: anchorType,
1476
+ AnchorKey: anchorKey,
1477
+ AnchorMetadata: metadata,
1478
+ Message: text,
1479
+ Name: target?.Label ? `${target.Label} Comment` : undefined
1480
+ });
1481
+ this.NewThreadMessage = '';
1482
+ this.SelectedMentionsByContext.delete('new');
1483
+ this.ActiveMentionContext = null;
1484
+ }
1485
+ catch (error) {
1486
+ this.ErrorBannerMessage = error instanceof Error ? error.message : String(error);
1487
+ }
1488
+ finally {
1489
+ this.IsSubmittingNewThread = false;
1490
+ this.cdr.markForCheck();
1491
+ }
1492
+ }
1493
+ async OnSubmitReply(conversationId) {
1494
+ const normId = NormalizeUUID(conversationId);
1495
+ const rawText = (this.ReplyDraftByConversationId.get(normId) ?? '').trim();
1496
+ if (!rawText || this.SubmittingReplyConversationId || !this.Coordinator) {
1497
+ return;
1498
+ }
1499
+ const text = this.SerializeMentionsForWire(rawText, normId);
1500
+ this.SubmittingReplyConversationId = conversationId;
1501
+ this.ErrorBannerMessage = null;
1502
+ this.cdr.markForCheck();
1503
+ try {
1504
+ await this.Coordinator.PostReply(conversationId, text);
1505
+ this.ReplyDraftByConversationId.delete(normId);
1506
+ this.SelectedMentionsByContext.delete(normId);
1507
+ this.ActiveMentionContext = null;
1508
+ }
1509
+ catch (error) {
1510
+ this.ErrorBannerMessage = error instanceof Error ? error.message : String(error);
1511
+ }
1512
+ finally {
1513
+ this.SubmittingReplyConversationId = null;
1514
+ this.cdr.markForCheck();
1515
+ }
1516
+ }
1517
+ async OnToggleResolve(thread, event) {
1518
+ event.stopPropagation();
1519
+ if (this.ResolvingConversationId || !this.Coordinator)
1520
+ return;
1521
+ const convId = thread.Conversation.ID;
1522
+ this.ResolvingConversationId = convId;
1523
+ this.ErrorBannerMessage = null;
1524
+ this.cdr.markForCheck();
1525
+ try {
1526
+ await this.Coordinator.ToggleResolved(convId, !thread.Conversation.IsResolved);
1527
+ }
1528
+ catch (error) {
1529
+ this.ErrorBannerMessage = error instanceof Error ? error.message : String(error);
1530
+ }
1531
+ finally {
1532
+ this.ResolvingConversationId = null;
1533
+ this.cdr.markForCheck();
1534
+ }
1535
+ }
1536
+ /**
1537
+ * Relays record navigation events emitted by clickable `@mention` chips (`[mjRecordLink]`)
1538
+ * to the parent `<mj-record-form-container>` and closes the inline popover when active.
1539
+ */
1540
+ OnMentionRecordNavigate(event) {
1541
+ this.Navigate.emit(event);
1542
+ if (this.Mode === 'popover') {
1543
+ this.Coordinator?.ClosePopover();
1544
+ }
1545
+ }
1546
+ /**
1547
+ * Parses a comment message into strongly-typed text and `@mention` segments so the template
1548
+ * can render interactive `[mjRecordLink]` chips for tagged users (`MJ: Users`) and agents (`MJ: AI Agents`).
1549
+ */
1550
+ ParseMessageSegments(rawMessage) {
1551
+ const text = (rawMessage ?? '').trim();
1552
+ if (!text)
1553
+ return [];
1554
+ let lastIndex = 0;
1555
+ const segments = [];
1556
+ for (const match of text.matchAll(JSON_MENTION_REGEX)) {
1557
+ const matchIdx = match.index ?? 0;
1558
+ if (matchIdx > lastIndex) {
1559
+ segments.push({
1560
+ Kind: 'text',
1561
+ Text: text.slice(lastIndex, matchIdx)
1562
+ });
1563
+ }
1564
+ const token = match[0];
1565
+ try {
1566
+ const parsed = JSON.parse(token.slice(1));
1567
+ const name = typeof parsed?.name === 'string' && parsed.name.trim() ? parsed.name.trim() : 'User';
1568
+ const kind = parsed?.type === 'agent' ? 'agent' : 'user';
1569
+ const id = typeof parsed?.id === 'string' && parsed.id.trim() ? parsed.id.trim() : null;
1570
+ segments.push({
1571
+ Kind: 'mention',
1572
+ MentionType: kind,
1573
+ ID: id,
1574
+ Name: name,
1575
+ EntityName: kind === 'agent' ? 'MJ: AI Agents' : 'MJ: Users'
1576
+ });
1577
+ }
1578
+ catch {
1579
+ segments.push({
1580
+ Kind: 'text',
1581
+ Text: token
1582
+ });
1583
+ }
1584
+ lastIndex = matchIdx + token.length;
1585
+ }
1586
+ if (lastIndex < text.length) {
1587
+ segments.push({
1588
+ Kind: 'text',
1589
+ Text: text.slice(lastIndex)
1590
+ });
1591
+ }
1592
+ return segments;
1593
+ }
1594
+ /**
1595
+ * Renders a message body as safe HTML with `@mention` tokens styled as pill badges.
1596
+ */
1597
+ FormatMessageHtml(rawMessage) {
1598
+ const segments = this.ParseMessageSegments(rawMessage);
1599
+ if (segments.length === 0)
1600
+ return '';
1601
+ return segments
1602
+ .map((seg) => {
1603
+ if (seg.Kind === 'mention') {
1604
+ const idAttr = seg.ID ? ` data-mention-id="${EscapeHTML(seg.ID)}"` : '';
1605
+ const entityAttr = ` data-entity-name="${EscapeHTML(seg.EntityName)}"`;
1606
+ return `<span class="mj-record-comments__mention-pill mj-record-comments__mention-pill--${seg.MentionType}"${idAttr}${entityAttr}>@${EscapeHTML(seg.Name)}</span>`;
1607
+ }
1608
+ return EscapeHTML(seg.Text).replace(/\n/g, '<br>');
1609
+ })
1610
+ .join('');
1611
+ }
1612
+ FormatAuthorInitials(detail) {
1613
+ if (detail.Role === 'AI') {
1614
+ return 'AI';
1615
+ }
1616
+ const name = (detail.User || 'User').trim();
1617
+ const words = name.split(/\s+/).filter(Boolean);
1618
+ if (words.length >= 2) {
1619
+ return `${words[0][0]}${words[words.length - 1][0]}`.toUpperCase();
1620
+ }
1621
+ return name.slice(0, 2).toUpperCase();
1622
+ }
1623
+ FormatRelativeTime(value) {
1624
+ if (!value)
1625
+ return '';
1626
+ const date = value instanceof Date ? value : new Date(String(value));
1627
+ if (isNaN(date.getTime()))
1628
+ return '';
1629
+ const diffSec = Math.round((Date.now() - date.getTime()) / 1000);
1630
+ if (diffSec < 45)
1631
+ return 'Just now';
1632
+ if (diffSec < 3600)
1633
+ return `${Math.floor(diffSec / 60)}m ago`;
1634
+ if (diffSec < 86400)
1635
+ return `${Math.floor(diffSec / 3600)}h ago`;
1636
+ return date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
1637
+ }
1638
+ matchesTargetFilter(conv, meta, target) {
1639
+ const targetKeyLower = (target.AnchorKey ?? '').trim().toLowerCase();
1640
+ if (target.AnchorType === 'Field') {
1641
+ if (conv.AnchorType !== 'Field')
1642
+ return false;
1643
+ const convField = (conv.AnchorKey || meta?.fieldName || '').trim().toLowerCase();
1644
+ return convField === targetKeyLower;
1645
+ }
1646
+ if (target.AnchorType === 'Section') {
1647
+ if (conv.AnchorType === 'Section' && (conv.AnchorKey ?? '').trim().toLowerCase() === targetKeyLower) {
1648
+ return true;
1649
+ }
1650
+ return (meta?.sectionKey ?? '').trim().toLowerCase() === targetKeyLower;
1651
+ }
1652
+ if (target.AnchorType === 'Group') {
1653
+ if (conv.AnchorType === 'Group' && (conv.AnchorKey ?? '').trim().toLowerCase() === targetKeyLower) {
1654
+ return true;
1655
+ }
1656
+ return (meta?.groupKey ?? '').trim().toLowerCase() === targetKeyLower;
1657
+ }
1658
+ return conv.AnchorType === target.AnchorType;
1659
+ }
1660
+ buildThreadView(conv, meta, messages) {
1661
+ const anchorType = conv.AnchorType ?? 'Record';
1662
+ const anchorKey = conv.AnchorKey ?? null;
1663
+ const badgeLabel = this.resolveAnchorBadgeLabel(anchorType, anchorKey, meta);
1664
+ const icon = this.resolveAnchorIcon(anchorType);
1665
+ const sectionGroup = this.resolveSectionGroup(anchorType, anchorKey, meta);
1666
+ const quotedValue = meta?.quotedValue ?? null;
1667
+ let currentLiveValue = null;
1668
+ let hasValueChanged = false;
1669
+ if (anchorType === 'Field' && (anchorKey || meta?.fieldName) && this.Record) {
1670
+ const fieldName = (anchorKey || meta?.fieldName || '').trim();
1671
+ const field = this.Record.Fields.find((f) => f.Name.toLowerCase() === fieldName.toLowerCase());
1672
+ if (field) {
1673
+ currentLiveValue = field.Value != null && String(field.Value).trim() !== ''
1674
+ ? String(field.Value).trim()
1675
+ : '(empty)';
1676
+ if (quotedValue != null && quotedValue.trim() !== currentLiveValue) {
1677
+ hasValueChanged = true;
1678
+ }
1679
+ }
1680
+ }
1681
+ return {
1682
+ Conversation: conv,
1683
+ Metadata: meta,
1684
+ AnchorType: anchorType,
1685
+ AnchorKey: anchorKey,
1686
+ AnchorBadgeLabel: badgeLabel,
1687
+ AnchorIcon: icon,
1688
+ SectionGroupKey: sectionGroup.GroupKey,
1689
+ SectionGroupTitle: sectionGroup.GroupTitle,
1690
+ SectionGroupIcon: sectionGroup.GroupIcon,
1691
+ QuotedValue: quotedValue,
1692
+ CurrentLiveValue: currentLiveValue,
1693
+ HasValueChangedSinceComment: hasValueChanged,
1694
+ RestrictedFields: meta?.restrictedFields ?? [],
1695
+ Messages: messages
1696
+ };
1697
+ }
1698
+ resolveSectionGroup(anchorType, anchorKey, meta) {
1699
+ if (meta?.sectionDisplayName || meta?.sectionKey) {
1700
+ const title = (meta.sectionDisplayName ||
1701
+ (anchorType === 'Section' ? meta.anchorDisplayName : undefined) ||
1702
+ meta.sectionKey ||
1703
+ 'Section').trim();
1704
+ const key = (meta.sectionKey || title).trim().toLowerCase().replace(/\s+/g, '');
1705
+ return {
1706
+ GroupKey: `section:${key}`,
1707
+ GroupTitle: title,
1708
+ GroupIcon: key.includes('system') ? 'fa-solid fa-database' : 'fa-solid fa-layer-group'
1709
+ };
1710
+ }
1711
+ if (anchorType === 'Section') {
1712
+ const title = (meta?.anchorDisplayName || meta?.sectionDisplayName || anchorKey || 'Section').trim();
1713
+ const key = (anchorKey || title).toLowerCase().replace(/\s+/g, '');
1714
+ return {
1715
+ GroupKey: `section:${key}`,
1716
+ GroupTitle: title,
1717
+ GroupIcon: key.includes('system') ? 'fa-solid fa-database' : 'fa-solid fa-layer-group'
1718
+ };
1719
+ }
1720
+ if (anchorType === 'Field') {
1721
+ const fName = (anchorKey || meta?.fieldName || '').trim();
1722
+ if (fName.startsWith('__mj_') || fName.toLowerCase() === 'id') {
1723
+ return {
1724
+ GroupKey: 'section:systemmetadata',
1725
+ GroupTitle: 'System Metadata',
1726
+ GroupIcon: 'fa-solid fa-database'
1727
+ };
1728
+ }
1729
+ const fInfo = this.Record?.EntityInfo?.Fields.find((f) => f.Name.toLowerCase() === fName.toLowerCase());
1730
+ const category = fInfo?.Category?.trim();
1731
+ if (category) {
1732
+ return {
1733
+ GroupKey: `section:${category.toLowerCase()}`,
1734
+ GroupTitle: category,
1735
+ GroupIcon: 'fa-solid fa-layer-group'
1736
+ };
1737
+ }
1738
+ return {
1739
+ GroupKey: 'section:details',
1740
+ GroupTitle: 'Details',
1741
+ GroupIcon: 'fa-solid fa-circle-info'
1742
+ };
1743
+ }
1744
+ if (anchorType === 'Group') {
1745
+ const title = (meta?.groupDisplayName || anchorKey || 'Section Group').trim();
1746
+ return {
1747
+ GroupKey: `group:${title.toLowerCase()}`,
1748
+ GroupTitle: title,
1749
+ GroupIcon: 'fa-solid fa-table-columns'
1750
+ };
1751
+ }
1752
+ return {
1753
+ GroupKey: 'record:general',
1754
+ GroupTitle: 'General Record Comments',
1755
+ GroupIcon: 'fa-regular fa-comment-dots'
1756
+ };
1757
+ }
1758
+ resolveAnchorBadgeLabel(anchorType, anchorKey, meta) {
1759
+ if (meta?.anchorDisplayName) {
1760
+ return meta.anchorDisplayName;
1761
+ }
1762
+ if (anchorType === 'Field') {
1763
+ const fName = anchorKey || meta?.fieldName || 'Field';
1764
+ const fInfo = this.Record?.EntityInfo?.Fields.find((f) => f.Name.toLowerCase() === fName.toLowerCase());
1765
+ return fInfo?.DisplayNameOrName || fName;
1766
+ }
1767
+ if (anchorType === 'Section') {
1768
+ return meta?.sectionDisplayName || anchorKey || 'Section';
1769
+ }
1770
+ if (anchorType === 'Group') {
1771
+ return meta?.groupDisplayName || anchorKey || 'Tab';
1772
+ }
1773
+ return 'Record';
1774
+ }
1775
+ resolveAnchorIcon(anchorType) {
1776
+ switch (anchorType) {
1777
+ case 'Field':
1778
+ return 'fa-regular fa-pen-to-square';
1779
+ case 'Section':
1780
+ return 'fa-solid fa-layer-group';
1781
+ case 'Group':
1782
+ return 'fa-solid fa-table-columns';
1783
+ case 'Contribution':
1784
+ return 'fa-solid fa-table-list';
1785
+ case 'DocBlock':
1786
+ return 'fa-solid fa-paragraph';
1787
+ case 'SlideRegion':
1788
+ return 'fa-solid fa-chalkboard';
1789
+ case 'SheetRange':
1790
+ return 'fa-solid fa-table-cells';
1791
+ case 'Record':
1792
+ default:
1793
+ return 'fa-regular fa-comment-dots';
1794
+ }
1795
+ }
1796
+ updateMentionAutocomplete(targetKey, text, cursorPosition) {
1797
+ const upToCursor = text.slice(0, cursorPosition);
1798
+ const match = /(?:^|\s)@([a-zA-Z0-9_.\- ]{0,24})$/.exec(upToCursor);
1799
+ if (!match) {
1800
+ if (this.ActiveMentionContext?.Target === targetKey) {
1801
+ this.ActiveMentionContext = null;
1802
+ this.cdr.markForCheck();
1803
+ }
1804
+ return;
1805
+ }
1806
+ const query = match[1];
1807
+ const triggerIndex = upToCursor.lastIndexOf('@');
1808
+ this.ActiveMentionContext = {
1809
+ Target: targetKey,
1810
+ Query: query,
1811
+ TriggerIndex: triggerIndex,
1812
+ SelectedIndex: 0
1813
+ };
1814
+ if (!this.mentionCandidatesLoaded) {
1815
+ void this.loadMentionCandidates();
1816
+ }
1817
+ else {
1818
+ this.filterMentionCandidates(query);
1819
+ }
1820
+ const trimmedQuery = query.trim();
1821
+ if (trimmedQuery.length >= 1 && trimmedQuery.toLowerCase() !== this.lastSearchedMentionQuery) {
1822
+ if (this.mentionSearchTimer) {
1823
+ clearTimeout(this.mentionSearchTimer);
1824
+ }
1825
+ this.mentionSearchTimer = setTimeout(() => {
1826
+ this.mentionSearchTimer = null;
1827
+ void this.searchMentionCandidatesFromServer(trimmedQuery);
1828
+ }, 180);
1829
+ }
1830
+ }
1831
+ /**
1832
+ * Queries `MJ: Users` and `MJ: AI Agents` dynamically by `Name` / `Email` so organizations
1833
+ * with more than 50 active users can `@mention` any person regardless of alphabetical order.
1834
+ */
1835
+ async searchMentionCandidatesFromServer(query) {
1836
+ const trimmed = query.trim();
1837
+ if (!trimmed)
1838
+ return;
1839
+ const provider = this.ProviderToUse;
1840
+ if (!provider)
1841
+ return;
1842
+ this.lastSearchedMentionQuery = trimmed.toLowerCase();
1843
+ const escaped = EscapeSQLString(trimmed);
1844
+ try {
1845
+ const rv = RunView.FromMetadataProvider(provider);
1846
+ const [usersResult, agentsResult] = await rv.RunViews([
1847
+ {
1848
+ EntityName: 'MJ: Users',
1849
+ ExtraFilter: `IsActive=1 AND (Name LIKE '%${escaped}%' OR Email LIKE '%${escaped}%')`,
1850
+ Fields: ['ID', 'Name', 'Email'],
1851
+ OrderBy: 'Name ASC',
1852
+ MaxRows: 20,
1853
+ ResultType: 'simple'
1854
+ },
1855
+ {
1856
+ EntityName: 'MJ: AI Agents',
1857
+ ExtraFilter: `Status='Active' AND (IsRestricted IS NULL OR IsRestricted=0) AND Name LIKE '%${escaped}%'`,
1858
+ Fields: ['ID', 'Name', 'Description'],
1859
+ OrderBy: 'Name ASC',
1860
+ MaxRows: 10,
1861
+ ResultType: 'simple'
1862
+ }
1863
+ ]);
1864
+ const existingKeys = new Set((this.MentionCandidates ?? []).map((c) => `${c.Type}:${NormalizeUUID(c.ID)}`));
1865
+ const merged = [...(this.MentionCandidates ?? [])];
1866
+ if (usersResult?.Success && Array.isArray(usersResult.Results)) {
1867
+ for (const u of usersResult.Results) {
1868
+ const key = `user:${NormalizeUUID(u.ID || '')}`;
1869
+ if (u.ID && u.Name && !existingKeys.has(key)) {
1870
+ existingKeys.add(key);
1871
+ merged.push({
1872
+ Type: 'user',
1873
+ ID: u.ID,
1874
+ Name: u.Name,
1875
+ Subtitle: u.Email ?? null
1876
+ });
1877
+ }
1878
+ }
1879
+ }
1880
+ if (agentsResult?.Success && Array.isArray(agentsResult.Results)) {
1881
+ for (const a of agentsResult.Results) {
1882
+ const key = `agent:${NormalizeUUID(a.ID || '')}`;
1883
+ if (a.ID && a.Name && !existingKeys.has(key)) {
1884
+ existingKeys.add(key);
1885
+ merged.push({
1886
+ Type: 'agent',
1887
+ ID: a.ID,
1888
+ Name: a.Name,
1889
+ Subtitle: 'AI Agent'
1890
+ });
1891
+ }
1892
+ }
1893
+ }
1894
+ this.MentionCandidates = merged;
1895
+ if (this.ActiveMentionContext) {
1896
+ this.filterMentionCandidates(this.ActiveMentionContext.Query);
1897
+ }
1898
+ this.cdr.markForCheck();
1899
+ }
1900
+ catch (error) {
1901
+ LogError(`MjRecordCommentsComponent.searchMentionCandidatesFromServer failed: ${error instanceof Error ? error.message : String(error)}`);
1902
+ }
1903
+ }
1904
+ async loadMentionCandidates() {
1905
+ this.mentionCandidatesLoaded = true;
1906
+ const provider = this.ProviderToUse;
1907
+ if (!provider)
1908
+ return;
1909
+ try {
1910
+ const rv = RunView.FromMetadataProvider(provider);
1911
+ const [usersResult, agentsResult] = await rv.RunViews([
1912
+ {
1913
+ EntityName: 'MJ: Users',
1914
+ ExtraFilter: `IsActive=1`,
1915
+ Fields: ['ID', 'Name', 'Email'],
1916
+ OrderBy: 'Name ASC',
1917
+ MaxRows: 50,
1918
+ ResultType: 'simple'
1919
+ },
1920
+ {
1921
+ EntityName: 'MJ: AI Agents',
1922
+ ExtraFilter: `Status='Active' AND (IsRestricted IS NULL OR IsRestricted=0)`,
1923
+ Fields: ['ID', 'Name', 'Description'],
1924
+ OrderBy: 'Name ASC',
1925
+ MaxRows: 25,
1926
+ ResultType: 'simple'
1927
+ }
1928
+ ]);
1929
+ const list = [];
1930
+ if (usersResult?.Success && Array.isArray(usersResult.Results)) {
1931
+ for (const u of usersResult.Results) {
1932
+ if (u.ID && u.Name) {
1933
+ list.push({
1934
+ Type: 'user',
1935
+ ID: u.ID,
1936
+ Name: u.Name,
1937
+ Subtitle: u.Email ?? null
1938
+ });
1939
+ }
1940
+ }
1941
+ }
1942
+ if (agentsResult?.Success && Array.isArray(agentsResult.Results)) {
1943
+ for (const a of agentsResult.Results) {
1944
+ if (a.ID && a.Name) {
1945
+ list.push({
1946
+ Type: 'agent',
1947
+ ID: a.ID,
1948
+ Name: a.Name,
1949
+ Subtitle: 'AI Agent'
1950
+ });
1951
+ }
1952
+ }
1953
+ }
1954
+ this.MentionCandidates = list;
1955
+ if (this.ActiveMentionContext) {
1956
+ this.filterMentionCandidates(this.ActiveMentionContext.Query);
1957
+ }
1958
+ this.cdr.markForCheck();
1959
+ }
1960
+ catch (error) {
1961
+ LogError(`MjRecordCommentsComponent.loadMentionCandidates failed: ${error instanceof Error ? error.message : String(error)}`);
1962
+ }
1963
+ }
1964
+ filterMentionCandidates(query) {
1965
+ const q = query.trim().toLowerCase();
1966
+ this.FilteredMentionCandidates = this.MentionCandidates.filter((c) => !q ||
1967
+ c.Name.toLowerCase().includes(q) ||
1968
+ (c.Subtitle?.toLowerCase().includes(q) ?? false)).slice(0, 6);
1969
+ this.cdr.markForCheck();
1970
+ }
1971
+ static ɵfac = /*@__PURE__*/ (() => { let ɵMjRecordCommentsComponent_BaseFactory; return function MjRecordCommentsComponent_Factory(__ngFactoryType__) { return (ɵMjRecordCommentsComponent_BaseFactory || (ɵMjRecordCommentsComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MjRecordCommentsComponent)))(__ngFactoryType__ || MjRecordCommentsComponent); }; })();
1972
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MjRecordCommentsComponent, selectors: [["mj-record-comments"]], viewQuery: function MjRecordCommentsComponent_Query(rf, ctx) { if (rf & 1) {
1973
+ i0.ɵɵviewQuery(_c0, 5);
1974
+ } if (rf & 2) {
1975
+ let _t;
1976
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.newThreadTextarea = _t.first);
1977
+ } }, hostBindings: function MjRecordCommentsComponent_HostBindings(rf, ctx) { if (rf & 1) {
1978
+ i0.ɵɵlistener("keydown.escape", function MjRecordCommentsComponent_keydown_escape_HostBindingHandler($event) { return ctx.OnEscapeKey($event); }, i0.ɵɵresolveDocument);
1979
+ } }, inputs: { Record: "Record", Mode: "Mode", IsOpen: "IsOpen", WidthPx: "WidthPx" }, outputs: { Close: "Close", CommentCountChange: "CommentCountChange", RollupChange: "RollupChange", NavigateToAnchor: "NavigateToAnchor", Navigate: "Navigate", WidthChanged: "WidthChanged" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 2, vars: 2, consts: [["newThreadTextarea", ""], [1, "mj-record-comments-backdrop", 3, "click"], ["role", "complementary", "aria-label", "Record comments", 1, "mj-record-comments-drawer"], ["title", "Drag to resize comments panel", 1, "mj-record-comments-drawer__resize-handle", 3, "mousedown"], [1, "mj-record-comments__header"], [1, "mj-record-comments__title-group"], ["aria-hidden", "true", 1, "fa-regular", "fa-comment-dots", "mj-record-comments__title-icon"], [1, "mj-record-comments__title"], [1, "mj-record-comments__count-badge"], [1, "mj-record-comments__header-actions"], ["type", "button", "title", "Refresh comments", "aria-label", "Refresh comments", 1, "mj-record-comments__icon-btn", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-arrows-rotate"], ["type", "button", "title", "Close comments", "aria-label", "Close comments", 1, "mj-record-comments__icon-btn", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-xmark"], [1, "mj-record-comments__filters"], ["role", "tablist", "aria-label", "Filter comments by status", 1, "mj-record-comments__status-tabs"], ["type", "button", "role", "tab", 1, "mj-record-comments__status-tab", 3, "click"], [1, "mj-record-comments__target-filter-banner"], ["role", "alert", 1, "mj-record-comments__error-banner"], [1, "mj-record-comments__composer", "mj-record-comments__composer--top"], [1, "mj-record-comments__body"], [1, "mj-record-comments__empty"], [1, "mj-record-comments__target-filter-label"], ["aria-hidden", "true", 1, "fa-solid", "fa-crosshairs"], ["type", "button", "title", "Show all record comments", 1, "mj-record-comments__target-filter-clear", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-triangle-exclamation"], ["type", "button", "aria-label", "Dismiss error", 1, "mj-record-comments__icon-btn", 3, "click"], [1, "mj-record-comments__composer", "mj-record-comments__composer--top", 3, "submit"], ["for", "mj-record-comments-new-thread-drawer", 1, "mj-sr-only"], [1, "mj-record-comments__composer-input-wrap"], ["id", "mj-record-comments-new-thread-drawer", "rows", "2", 1, "mj-record-comments__textarea", 3, "input", "compositionend", "keydown", "value", "placeholder"], ["role", "listbox", "aria-label", "Mention suggestions", 1, "mj-record-comments__mention-menu"], ["aria-label", "Tagged in this comment", 1, "mj-record-comments__draft-mentions"], [1, "mj-record-comments__composer-footer"], ["type", "submit", 1, "mj-record-comments__submit-btn", 3, "disabled"], [1, "mj-record-comments__composer-hint"], ["role", "option", 1, "mj-record-comments__mention-option", 3, "mj-record-comments__mention-option--active"], ["role", "option", 1, "mj-record-comments__mention-option", 3, "mousedown"], [1, "mj-record-comments__mention-type-badge"], ["aria-hidden", "true"], [1, "mj-record-comments__mention-name"], [1, "mj-record-comments__mention-sub"], [1, "mj-record-comments__draft-mention-chip", 3, "mj-record-comments__draft-mention-chip--agent"], [1, "mj-record-comments__draft-mention-chip"], ["type", "button", 1, "mj-record-comments__draft-mention-remove", 3, "click", "title"], ["aria-hidden", "true", 1, "fa-solid", "fa-spinner", "fa-spin"], ["aria-hidden", "true", 1, "fa-solid", "fa-paper-plane"], ["aria-hidden", "true", 1, "fa-solid", "fa-spinner", "fa-spin", "mj-record-comments__empty-icon"], ["aria-hidden", "true", 1, "fa-regular", "fa-comments", "mj-record-comments__empty-icon"], [1, "mj-record-comments__empty-title"], [1, "mj-record-comments__empty-sub"], [1, "mj-record-comments__section-group"], [1, "mj-record-comments__section-group-header"], [1, "mj-record-comments__thread", 3, "mj-record-comments__thread--resolved"], [1, "mj-record-comments__section-group-title"], [1, "mj-record-comments__section-group-count"], [1, "mj-record-comments__thread"], [1, "mj-record-comments__thread-header"], ["type", "button", 1, "mj-record-comments__anchor-chip", 3, "click", "title"], ["aria-hidden", "true", 1, "fa-solid", "fa-arrow-up-right-from-square", "mj-record-comments__anchor-jump-icon"], [1, "mj-record-comments__fls-chip", 3, "title"], [1, "mj-record-comments__thread-actions"], [1, "mj-record-comments__quoted-value", 3, "mj-record-comments__quoted-value--changed"], [1, "mj-record-comments__messages"], [1, "mj-record-comments__message", 3, "mj-record-comments__message--ai"], ["aria-hidden", "true", 1, "fa-solid", "fa-shield-halved"], ["type", "button", 1, "mj-record-comments__resolve-btn", 3, "click", "disabled", "title"], [1, "mj-record-comments__quoted-value"], [1, "mj-record-comments__quoted-label"], [1, "mj-record-comments__quoted-code"], ["title", "Field value has changed since this thread started", 1, "mj-record-comments__quoted-diff"], ["aria-hidden", "true", 1, "fa-solid", "fa-arrow-right"], [1, "mj-record-comments__message"], [1, "mj-record-comments__avatar"], [1, "mj-record-comments__message-content"], [1, "mj-record-comments__message-meta"], [1, "mj-record-comments__author"], [1, "mj-record-comments__timestamp"], [1, "mj-record-comments__message-body"], ["type", "button", "mjRecordLink", "", 1, "mj-record-comments__mention-pill", "mj-record-comments__mention-pill--clickable", 3, "mj-record-comments__mention-pill--agent", "mj-record-comments__mention-pill--user", "EntityName", "RecordID", "DisplayName", "title"], [1, "mj-record-comments__mention-pill", 3, "mj-record-comments__mention-pill--agent", "mj-record-comments__mention-pill--user"], [1, "mj-record-comments__message-text"], ["type", "button", "mjRecordLink", "", 1, "mj-record-comments__mention-pill", "mj-record-comments__mention-pill--clickable", 3, "Navigate", "EntityName", "RecordID", "DisplayName", "title"], [1, "mj-record-comments__mention-pill"], ["aria-label", "Tagged in this reply", 1, "mj-record-comments__draft-mentions"], [1, "mj-record-comments__reply-form", 3, "submit"], [1, "mj-sr-only"], ["rows", "1", "placeholder", "Reply... (@ to mention)", 1, "mj-record-comments__reply-textarea", 3, "input", "compositionend", "keydown", "id", "value"], ["type", "submit", "title", "Send reply", "aria-label", "Send reply", 1, "mj-record-comments__reply-btn", 3, "disabled"], [1, "mj-record-comments-popover-backdrop", 3, "click"], ["role", "dialog", 1, "mj-record-comments-popover", 3, "ngStyle"], [1, "mj-record-comments__header", "mj-record-comments__header--popover"], ["type", "button", 1, "mj-record-comments__icon-btn", 3, "click", "title"], ["type", "button", "title", "View all record comments in side rail", "aria-label", "View all record comments in side rail", 1, "mj-record-comments__icon-btn", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-table-columns"], ["type", "button", "title", "Close popover", "aria-label", "Close popover", 1, "mj-record-comments__icon-btn", 3, "click"], [1, "mj-record-comments__body", "mj-record-comments__body--popover"], [1, "mj-record-comments__thread", "mj-record-comments__thread--compact"], [1, "mj-record-comments__composer", "mj-record-comments__composer--popover"], [1, "mj-record-comments__thread-title"], ["type", "button", 1, "mj-record-comments__resolve-btn", 3, "disabled"], ["type", "button", 1, "mj-record-comments__resolve-btn", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-check"], [1, "mj-record-comments__composer", "mj-record-comments__composer--popover", 3, "submit"], ["for", "mj-record-comments-new-thread-popover", 1, "mj-sr-only"], ["id", "mj-record-comments-new-thread-popover", "rows", "2", 1, "mj-record-comments__textarea", 3, "input", "compositionend", "keydown", "value", "placeholder"], ["type", "button", 1, "mj-record-comments__cancel-btn", 3, "click"]], template: function MjRecordCommentsComponent_Template(rf, ctx) { if (rf & 1) {
1980
+ i0.ɵɵconditionalCreate(0, MjRecordCommentsComponent_Conditional_0_Template, 29, 23);
1981
+ i0.ɵɵconditionalCreate(1, MjRecordCommentsComponent_Conditional_1_Template, 19, 11);
1982
+ } if (rf & 2) {
1983
+ i0.ɵɵconditional(ctx.Mode === "drawer" && ctx.IsOpen ? 0 : -1);
1984
+ i0.ɵɵadvance();
1985
+ i0.ɵɵconditional(ctx.Mode === "popover" && ctx.PopoverTarget ? 1 : -1);
1986
+ } }, styles: ["\n\n\n\n\n.mj-sr-only[_ngcontent-%COMP%] {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n.mj-record-comments-backdrop[_ngcontent-%COMP%] {\n position: fixed;\n inset: 0;\n background: var(--mj-bg-overlay, rgba(0, 0, 0, 0.18));\n z-index: 1040;\n}\n\n.mj-record-comments-popover-backdrop[_ngcontent-%COMP%] {\n position: fixed;\n inset: 0;\n background: transparent;\n z-index: 1045;\n}\n\n.mj-record-comments-drawer[_ngcontent-%COMP%] {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1041;\n background: var(--mj-bg-surface);\n border-left: 1px solid var(--mj-border-default);\n box-shadow: var(--mj-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.15));\n display: flex;\n flex-direction: column;\n max-width: 92vw;\n color: var(--mj-text-primary);\n}\n\n.mj-record-comments-drawer--resizing[_ngcontent-%COMP%] {\n user-select: none;\n}\n\n.mj-record-comments-drawer__resize-handle[_ngcontent-%COMP%] {\n position: absolute;\n top: 0;\n bottom: 0;\n left: -3px;\n width: 6px;\n cursor: col-resize;\n z-index: 2;\n transition: background-color 0.15s ease;\n}\n\n.mj-record-comments-drawer__resize-handle[_ngcontent-%COMP%]:hover, \n.mj-record-comments-drawer--resizing[_ngcontent-%COMP%] .mj-record-comments-drawer__resize-handle[_ngcontent-%COMP%] {\n background: var(--mj-brand-primary);\n}\n\n.mj-record-comments-popover[_ngcontent-%COMP%] {\n position: fixed;\n z-index: 1046;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg, 10px);\n box-shadow: var(--mj-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.18));\n display: flex;\n flex-direction: column;\n min-width: 340px;\n min-height: 260px;\n max-width: min(820px, calc(100vw - 32px));\n max-height: min(82vh, 760px);\n resize: both;\n overflow: auto;\n color: var(--mj-text-primary);\n}\n\n.mj-record-comments-popover--expanded[_ngcontent-%COMP%] {\n min-height: 440px;\n max-height: min(85vh, 760px);\n}\n\n\n.mj-record-comments__header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 16px;\n border-bottom: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-card);\n flex-shrink: 0;\n}\n\n.mj-record-comments__header--popover[_ngcontent-%COMP%] {\n padding: 10px 12px;\n}\n\n.mj-record-comments__title-group[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n}\n\n.mj-record-comments__title-icon[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n font-size: 15px;\n}\n\n.mj-record-comments__title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.mj-record-comments__count-badge[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 11px;\n font-weight: 600;\n}\n\n.mj-record-comments__header-actions[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-record-comments__icon-btn[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n border-radius: var(--mj-radius-sm, 6px);\n background: transparent;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: background-color 0.15s ease, color 0.15s ease;\n}\n\n.mj-record-comments__icon-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-primary);\n}\n\n\n.mj-record-comments__filters[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 10px 16px;\n border-bottom: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface);\n flex-shrink: 0;\n}\n\n.mj-record-comments__status-tabs[_ngcontent-%COMP%] {\n display: flex;\n gap: 4px;\n background: var(--mj-bg-surface-sunken);\n padding: 3px;\n border-radius: var(--mj-radius-md, 8px);\n}\n\n.mj-record-comments__status-tab[_ngcontent-%COMP%] {\n flex: 1;\n border: none;\n background: transparent;\n padding: 5px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n font-size: 12px;\n font-weight: 500;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: background-color 0.15s ease, color 0.15s ease;\n}\n\n.mj-record-comments__status-tab--active[_ngcontent-%COMP%] {\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-primary);\n font-weight: 600;\n box-shadow: var(--mj-shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.06));\n}\n\n.mj-record-comments__target-filter-banner[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 6px 10px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface-sunken);\n border: 1px solid var(--mj-border-subtle);\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n\n.mj-record-comments__target-filter-label[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-record-comments__target-filter-clear[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n border: none;\n background: transparent;\n color: var(--mj-text-link);\n font-size: 11px;\n font-weight: 500;\n cursor: pointer;\n padding: 2px 4px;\n}\n\n\n.mj-record-comments__error-banner[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n margin: 8px 12px 0;\n padding: 8px 10px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-status-error-bg);\n border: 1px solid var(--mj-status-error-border);\n color: var(--mj-status-error);\n font-size: 12px;\n}\n\n\n.mj-record-comments__composer[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 12px 16px;\n border-bottom: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-card);\n flex-shrink: 0;\n}\n\n.mj-record-comments__composer--popover[_ngcontent-%COMP%] {\n padding: 10px 12px;\n border-top: 1px solid var(--mj-border-subtle);\n border-bottom: none;\n}\n\n.mj-record-comments__composer-input-wrap[_ngcontent-%COMP%] {\n position: relative;\n display: flex;\n flex: 1;\n}\n\n.mj-record-comments__textarea[_ngcontent-%COMP%], \n.mj-record-comments__reply-textarea[_ngcontent-%COMP%] {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n font-family: inherit;\n font-size: 13px;\n line-height: 1.45;\n padding: 8px 10px;\n resize: vertical;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n\n.mj-record-comments__textarea[_ngcontent-%COMP%]:focus, \n.mj-record-comments__reply-textarea[_ngcontent-%COMP%]:focus {\n outline: none;\n border-color: var(--mj-border-focus);\n box-shadow: 0 0 0 2px var(--mj-focus-ring-color, rgba(59, 130, 246, 0.2));\n}\n\n.mj-record-comments__composer-footer[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.mj-record-comments__submit-btn[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n border: none;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.15s ease;\n}\n\n.mj-record-comments__submit-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n}\n\n.mj-record-comments__submit-btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.mj-record-comments__cancel-btn[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n padding: 6px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.mj-record-comments__composer-hint[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--mj-text-muted);\n}\n\n\n.mj-record-comments__body[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n padding: 12px 16px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n.mj-record-comments__body--popover[_ngcontent-%COMP%] {\n padding: 10px 12px;\n flex: 1;\n min-height: 120px;\n max-height: none;\n overflow-y: auto;\n}\n\n\n.mj-record-comments__section-group[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.mj-record-comments__section-group-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 7px;\n padding: 4px 2px;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-secondary);\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mj-record-comments__section-group-icon[_ngcontent-%COMP%] {\n color: var(--mj-brand-primary);\n font-size: 12px;\n}\n\n.mj-record-comments__section-group-title[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-record-comments__section-group-count[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 18px;\n height: 18px;\n padding: 0 5px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-sunken);\n border: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n font-size: 10px;\n font-weight: 600;\n}\n\n.mj-record-comments__empty[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 36px 20px;\n color: var(--mj-text-muted);\n}\n\n.mj-record-comments__empty-icon[_ngcontent-%COMP%] {\n font-size: 28px;\n margin-bottom: 10px;\n color: var(--mj-text-disabled);\n}\n\n.mj-record-comments__empty-title[_ngcontent-%COMP%] {\n margin: 0 0 4px;\n font-size: 14px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n}\n\n.mj-record-comments__empty-sub[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 12px;\n line-height: 1.45;\n}\n\n\n.mj-record-comments__thread[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 12px;\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n box-shadow: var(--mj-shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.04));\n}\n\n.mj-record-comments__thread--resolved[_ngcontent-%COMP%] {\n opacity: 0.78;\n background: var(--mj-bg-surface-sunken);\n}\n\n.mj-record-comments__thread--compact[_ngcontent-%COMP%] {\n padding: 10px;\n}\n\n.mj-record-comments__thread-header[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.mj-record-comments__anchor-chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n max-width: 220px;\n padding: 3px 8px;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-primary);\n font-size: 11px;\n font-weight: 600;\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n}\n\n.mj-record-comments__anchor-chip[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n}\n\n.mj-record-comments__anchor-jump-icon[_ngcontent-%COMP%] {\n font-size: 9px;\n opacity: 0.65;\n}\n\n.mj-record-comments__fls-chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 6px;\n border-radius: var(--mj-radius-sm, 4px);\n background: var(--mj-status-warning-bg);\n color: var(--mj-status-warning);\n font-size: 10px;\n font-weight: 600;\n}\n\n.mj-record-comments__resolve-btn[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n border: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n font-size: 11px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.mj-record-comments__resolve-btn[_ngcontent-%COMP%]:hover:not(:disabled) {\n border-color: var(--mj-status-success);\n color: var(--mj-status-success);\n}\n\n\n.mj-record-comments__quoted-value[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n padding: 5px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface-sunken);\n border-left: 3px solid var(--mj-border-default);\n font-size: 11px;\n color: var(--mj-text-secondary);\n}\n\n.mj-record-comments__quoted-value--changed[_ngcontent-%COMP%] {\n border-left-color: var(--mj-status-warning);\n background: var(--mj-status-warning-bg);\n}\n\n.mj-record-comments__quoted-code[_ngcontent-%COMP%] {\n font-family: var(--mj-font-mono, monospace);\n font-size: 11px;\n color: var(--mj-text-primary);\n}\n\n\n.mj-record-comments__messages[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.mj-record-comments__message[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n}\n\n.mj-record-comments__avatar[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-sunken);\n border: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n font-size: 10px;\n font-weight: 700;\n flex-shrink: 0;\n}\n\n.mj-record-comments__avatar--ai[_ngcontent-%COMP%] {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n border-color: var(--mj-brand-primary);\n}\n\n.mj-record-comments__message-content[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n}\n\n.mj-record-comments__message-meta[_ngcontent-%COMP%] {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 6px;\n margin-bottom: 2px;\n}\n\n.mj-record-comments__author[_ngcontent-%COMP%] {\n font-size: 12px;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n\n.mj-record-comments__timestamp[_ngcontent-%COMP%] {\n font-size: 11px;\n color: var(--mj-text-muted);\n}\n\n.mj-record-comments__message-body[_ngcontent-%COMP%] {\n font-size: 13px;\n line-height: 1.5;\n color: var(--mj-text-primary);\n word-break: break-word;\n}\n\n.mj-record-comments__message-text[_ngcontent-%COMP%] {\n white-space: pre-wrap;\n}\n\n.mj-record-comments__mention-pill[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 1px 7px;\n margin: 0 1px;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 28%, var(--mj-border-subtle));\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface-sunken));\n color: var(--mj-brand-primary);\n font-family: inherit;\n font-weight: 600;\n font-size: 12px;\n line-height: 1.35;\n vertical-align: baseline;\n transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;\n}\n\n.mj-record-comments__mention-pill[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 10px;\n opacity: 0.85;\n}\n\n.mj-record-comments__mention-pill--clickable[_ngcontent-%COMP%] {\n cursor: pointer;\n}\n\n.mj-record-comments__mention-pill--clickable[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 22%, var(--mj-bg-surface-hover));\n border-color: var(--mj-brand-primary);\n}\n\n.mj-record-comments__draft-mentions[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n}\n\n.mj-record-comments__draft-mention-chip[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 6px 2px 8px;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 30%, var(--mj-border-subtle));\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface-sunken));\n color: var(--mj-brand-primary);\n font-size: 11px;\n font-weight: 600;\n}\n\n.mj-record-comments__draft-mention-chip[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 10px;\n}\n\n.mj-record-comments__draft-mention-remove[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 15px;\n height: 15px;\n padding: 0;\n border: none;\n border-radius: var(--mj-radius-full, 9999px);\n background: transparent;\n color: inherit;\n opacity: 0.7;\n cursor: pointer;\n}\n\n.mj-record-comments__draft-mention-remove[_ngcontent-%COMP%]:hover {\n opacity: 1;\n background: color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n}\n\n\n.mj-record-comments__reply-form[_ngcontent-%COMP%] {\n display: flex;\n align-items: flex-end;\n gap: 6px;\n margin-top: 2px;\n}\n\n.mj-record-comments__reply-btn[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 30px;\n height: 30px;\n border: none;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.mj-record-comments__reply-btn[_ngcontent-%COMP%]:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n\n.mj-record-comments__mention-menu[_ngcontent-%COMP%] {\n position: absolute;\n left: 0;\n right: 0;\n top: calc(100% + 4px);\n z-index: 1055;\n margin: 0;\n padding: 4px;\n list-style: none;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n box-shadow: var(--mj-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.12));\n max-height: 180px;\n overflow-y: auto;\n}\n\n.mj-record-comments__mention-option[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n font-size: 12px;\n color: var(--mj-text-primary);\n cursor: pointer;\n}\n\n.mj-record-comments__mention-option--active[_ngcontent-%COMP%], \n.mj-record-comments__mention-option[_ngcontent-%COMP%]:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.mj-record-comments__mention-type-badge[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-brand-primary);\n font-size: 10px;\n}\n\n.mj-record-comments__mention-name[_ngcontent-%COMP%] {\n font-weight: 600;\n}\n\n.mj-record-comments__mention-sub[_ngcontent-%COMP%] {\n margin-left: auto;\n font-size: 11px;\n color: var(--mj-text-muted);\n}"], changeDetection: 0 });
1987
+ }
1988
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MjRecordCommentsComponent, [{
1989
+ type: Component,
1990
+ args: [{ standalone: false, selector: 'mj-record-comments', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (Mode === 'drawer' && IsOpen) {\n <div class=\"mj-record-comments-backdrop\" (click)=\"OnClose()\"></div>\n <aside\n class=\"mj-record-comments-drawer\"\n [class.mj-record-comments-drawer--resizing]=\"IsResizingDrawer\"\n [style.width.px]=\"EffectiveDrawerWidthPx\"\n role=\"complementary\"\n aria-label=\"Record comments\">\n <div\n class=\"mj-record-comments-drawer__resize-handle\"\n title=\"Drag to resize comments panel\"\n (mousedown)=\"OnDrawerResizeStart($event)\"></div>\n <!-- Header -->\n <header class=\"mj-record-comments__header\">\n <div class=\"mj-record-comments__title-group\">\n <i class=\"fa-regular fa-comment-dots mj-record-comments__title-icon\" aria-hidden=\"true\"></i>\n <h3 class=\"mj-record-comments__title\">Comments</h3>\n @if (OpenCount > 0) {\n <span class=\"mj-record-comments__count-badge\" [attr.aria-label]=\"OpenCount + ' open comment threads'\">\n {{ OpenCount }}\n </span>\n }\n </div>\n <div class=\"mj-record-comments__header-actions\">\n <button\n type=\"button\"\n class=\"mj-record-comments__icon-btn\"\n title=\"Refresh comments\"\n aria-label=\"Refresh comments\"\n [disabled]=\"IsLoading\"\n (click)=\"OnRefresh()\">\n <i class=\"fa-solid fa-arrows-rotate\" [class.fa-spin]=\"IsLoading\" aria-hidden=\"true\"></i>\n </button>\n <button\n type=\"button\"\n class=\"mj-record-comments__icon-btn\"\n title=\"Close comments\"\n aria-label=\"Close comments\"\n (click)=\"OnClose()\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n\n <!-- Filter Bar -->\n <div class=\"mj-record-comments__filters\">\n <div class=\"mj-record-comments__status-tabs\" role=\"tablist\" aria-label=\"Filter comments by status\">\n <button\n type=\"button\"\n role=\"tab\"\n class=\"mj-record-comments__status-tab\"\n [class.mj-record-comments__status-tab--active]=\"StatusFilter === 'open'\"\n [attr.aria-selected]=\"StatusFilter === 'open'\"\n (click)=\"OnStatusFilterChange('open')\">\n Open ({{ OpenCount }})\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n class=\"mj-record-comments__status-tab\"\n [class.mj-record-comments__status-tab--active]=\"StatusFilter === 'resolved'\"\n [attr.aria-selected]=\"StatusFilter === 'resolved'\"\n (click)=\"OnStatusFilterChange('resolved')\">\n Resolved ({{ ResolvedCount }})\n </button>\n <button\n type=\"button\"\n role=\"tab\"\n class=\"mj-record-comments__status-tab\"\n [class.mj-record-comments__status-tab--active]=\"StatusFilter === 'all'\"\n [attr.aria-selected]=\"StatusFilter === 'all'\"\n (click)=\"OnStatusFilterChange('all')\">\n All\n </button>\n </div>\n\n @if (TargetFilter) {\n <div class=\"mj-record-comments__target-filter-banner\">\n <span class=\"mj-record-comments__target-filter-label\">\n <i class=\"fa-solid fa-crosshairs\" aria-hidden=\"true\"></i>\n Anchored to: <strong>{{ TargetFilter.Label }}</strong>\n </span>\n <button\n type=\"button\"\n class=\"mj-record-comments__target-filter-clear\"\n title=\"Show all record comments\"\n (click)=\"OnClearTargetFilter()\">\n Show all\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n </div>\n\n @if (ErrorBannerMessage) {\n <div class=\"mj-record-comments__error-banner\" role=\"alert\">\n <i class=\"fa-solid fa-triangle-exclamation\" aria-hidden=\"true\"></i>\n <span>{{ ErrorBannerMessage }}</span>\n <button\n type=\"button\"\n class=\"mj-record-comments__icon-btn\"\n aria-label=\"Dismiss error\"\n (click)=\"ErrorBannerMessage = null\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n <!-- New Thread Composer -->\n @if (CanUserPostComments) {\n <form\n class=\"mj-record-comments__composer mj-record-comments__composer--top\"\n (submit)=\"$event.preventDefault(); OnSubmitNewThread()\">\n <label class=\"mj-sr-only\" for=\"mj-record-comments-new-thread-drawer\">\n {{ TargetFilter ? 'Comment on ' + TargetFilter.Label : 'Add a comment on this record' }}\n </label>\n <div class=\"mj-record-comments__composer-input-wrap\">\n <textarea\n #newThreadTextarea\n id=\"mj-record-comments-new-thread-drawer\"\n class=\"mj-record-comments__textarea\"\n rows=\"2\"\n [value]=\"NewThreadMessage\"\n [placeholder]=\"TargetFilter ? 'Comment on ' + TargetFilter.Label + '... (use @ to mention)' : 'Comment on this record... (use @ to mention)'\"\n (input)=\"OnNewThreadInput($event)\"\n (compositionend)=\"OnComposerCompositionEnd($event)\"\n (keydown)=\"OnComposerKeydown($event, 'new')\"></textarea>\n\n @if (ActiveMentionContext?.Target === 'new' && FilteredMentionCandidates.length > 0) {\n <ul class=\"mj-record-comments__mention-menu\" role=\"listbox\" aria-label=\"Mention suggestions\">\n @for (cand of FilteredMentionCandidates; track cand.ID; let idx = $index) {\n <li\n role=\"option\"\n class=\"mj-record-comments__mention-option\"\n [class.mj-record-comments__mention-option--active]=\"idx === ActiveMentionContext?.SelectedIndex\"\n [attr.aria-selected]=\"idx === ActiveMentionContext?.SelectedIndex\"\n (mousedown)=\"$event.preventDefault(); InsertMentionCandidate(cand, 'new')\">\n <span class=\"mj-record-comments__mention-type-badge\" [attr.data-type]=\"cand.Type\">\n <i [class]=\"cand.Type === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"mj-record-comments__mention-name\">{{ cand.Name }}</span>\n @if (cand.Subtitle) {\n <span class=\"mj-record-comments__mention-sub\">{{ cand.Subtitle }}</span>\n }\n </li>\n }\n </ul>\n }\n </div>\n @let drawerNewDraftMentions = GetDraftMentions('new');\n @if (drawerNewDraftMentions.length > 0) {\n <div class=\"mj-record-comments__draft-mentions\" aria-label=\"Tagged in this comment\">\n @for (m of drawerNewDraftMentions; track m.ID) {\n <span\n class=\"mj-record-comments__draft-mention-chip\"\n [class.mj-record-comments__draft-mention-chip--agent]=\"m.Type === 'agent'\">\n <i [class]=\"m.Type === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n <span>&#64;{{ m.Name }}</span>\n <button\n type=\"button\"\n class=\"mj-record-comments__draft-mention-remove\"\n [title]=\"'Remove @' + m.Name\"\n [attr.aria-label]=\"'Remove @' + m.Name\"\n (click)=\"RemoveDraftMention(m, 'new')\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </span>\n }\n </div>\n }\n <div class=\"mj-record-comments__composer-footer\">\n <button\n type=\"submit\"\n class=\"mj-record-comments__submit-btn\"\n [disabled]=\"!NewThreadMessage.trim() || IsSubmittingNewThread\">\n @if (IsSubmittingNewThread) {\n <i class=\"fa-solid fa-spinner fa-spin\" aria-hidden=\"true\"></i>\n Posting...\n } @else {\n <i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"></i>\n Comment\n }\n </button>\n <span class=\"mj-record-comments__composer-hint\">Enter to send \u00B7 Shift+Enter for newline \u00B7 &#64; to mention</span>\n </div>\n </form>\n }\n\n <!-- Thread List -->\n <div class=\"mj-record-comments__body\">\n @if (IsLoading && VisibleThreads.length === 0) {\n <div class=\"mj-record-comments__empty\">\n <i class=\"fa-solid fa-spinner fa-spin mj-record-comments__empty-icon\" aria-hidden=\"true\"></i>\n <p>Loading conversations...</p>\n </div>\n } @else if (VisibleThreads.length === 0) {\n <div class=\"mj-record-comments__empty\">\n <i class=\"fa-regular fa-comments mj-record-comments__empty-icon\" aria-hidden=\"true\"></i>\n <p class=\"mj-record-comments__empty-title\">No {{ StatusFilter === 'all' ? '' : StatusFilter }} comments yet</p>\n <p class=\"mj-record-comments__empty-sub\">\n Hover over any field or section header to anchor a discussion directly to that part of the record.\n </p>\n </div>\n } @else {\n @for (group of GroupedVisibleThreads; track group.GroupKey) {\n <section class=\"mj-record-comments__section-group\">\n @if (!TargetFilter) {\n <div class=\"mj-record-comments__section-group-header\">\n <i [class]=\"group.GroupIcon + ' mj-record-comments__section-group-icon'\" aria-hidden=\"true\"></i>\n <span class=\"mj-record-comments__section-group-title\">{{ group.GroupTitle }}</span>\n <span class=\"mj-record-comments__section-group-count\">{{ group.Threads.length }}</span>\n </div>\n }\n @for (thread of group.Threads; track thread.Conversation.ID) {\n <article\n class=\"mj-record-comments__thread\"\n [class.mj-record-comments__thread--resolved]=\"thread.Conversation.IsResolved\">\n <div class=\"mj-record-comments__thread-header\">\n <button\n type=\"button\"\n class=\"mj-record-comments__anchor-chip\"\n [attr.data-anchor-type]=\"thread.AnchorType\"\n title=\"Jump to {{ thread.AnchorBadgeLabel }} on form\"\n (click)=\"OnAnchorBadgeClick(thread)\">\n <i [class]=\"thread.AnchorIcon\" aria-hidden=\"true\"></i>\n <span>{{ thread.AnchorBadgeLabel }}</span>\n <i class=\"fa-solid fa-arrow-up-right-from-square mj-record-comments__anchor-jump-icon\" aria-hidden=\"true\"></i>\n </button>\n\n @if (thread.RestrictedFields.length > 0) {\n <span\n class=\"mj-record-comments__fls-chip\"\n [title]=\"'FLS-protected fields referenced: ' + thread.RestrictedFields.join(', ')\">\n <i class=\"fa-solid fa-shield-halved\" aria-hidden=\"true\"></i>\n FLS\n </span>\n }\n\n @if (CanUserPostComments) {\n <div class=\"mj-record-comments__thread-actions\">\n <button\n type=\"button\"\n class=\"mj-record-comments__resolve-btn\"\n [class.mj-record-comments__resolve-btn--resolved]=\"thread.Conversation.IsResolved\"\n [disabled]=\"ResolvingConversationId === thread.Conversation.ID\"\n [title]=\"thread.Conversation.IsResolved ? 'Reopen thread' : 'Resolve thread'\"\n (click)=\"OnToggleResolve(thread, $event)\">\n <i [class]=\"thread.Conversation.IsResolved ? 'fa-solid fa-rotate-left' : 'fa-solid fa-check'\" aria-hidden=\"true\"></i>\n <span>{{ thread.Conversation.IsResolved ? 'Reopen' : 'Resolve' }}</span>\n </button>\n </div>\n }\n </div>\n\n @if (thread.QuotedValue !== null) {\n <div\n class=\"mj-record-comments__quoted-value\"\n [class.mj-record-comments__quoted-value--changed]=\"thread.HasValueChangedSinceComment\">\n <span class=\"mj-record-comments__quoted-label\">Value when commented:</span>\n <code class=\"mj-record-comments__quoted-code\">{{ thread.QuotedValue }}</code>\n @if (thread.HasValueChangedSinceComment && thread.CurrentLiveValue !== null) {\n <span class=\"mj-record-comments__quoted-diff\" title=\"Field value has changed since this thread started\">\n <i class=\"fa-solid fa-arrow-right\" aria-hidden=\"true\"></i>\n Now: <code>{{ thread.CurrentLiveValue }}</code>\n </span>\n }\n </div>\n }\n\n <div class=\"mj-record-comments__messages\">\n @for (msg of thread.Messages; track msg.ID) {\n <div class=\"mj-record-comments__message\" [class.mj-record-comments__message--ai]=\"msg.Role === 'AI'\">\n <div class=\"mj-record-comments__avatar\" [class.mj-record-comments__avatar--ai]=\"msg.Role === 'AI'\">\n {{ FormatAuthorInitials(msg) }}\n </div>\n <div class=\"mj-record-comments__message-content\">\n <div class=\"mj-record-comments__message-meta\">\n <span class=\"mj-record-comments__author\">\n {{ msg.Role === 'AI' ? 'AI Assistant' : (msg.User || 'User') }}\n </span>\n <span class=\"mj-record-comments__timestamp\">\n {{ FormatRelativeTime(msg.__mj_CreatedAt) }}\n </span>\n </div>\n <div class=\"mj-record-comments__message-body\">\n @for (seg of ParseMessageSegments(msg.Message); track $index) {\n @if (seg.Kind === 'mention' && seg.ID) {\n <button\n type=\"button\"\n class=\"mj-record-comments__mention-pill mj-record-comments__mention-pill--clickable\"\n [class.mj-record-comments__mention-pill--agent]=\"seg.MentionType === 'agent'\"\n [class.mj-record-comments__mention-pill--user]=\"seg.MentionType === 'user'\"\n mjRecordLink\n [EntityName]=\"seg.EntityName\"\n [RecordID]=\"seg.ID\"\n [DisplayName]=\"seg.Name\"\n [title]=\"'Open ' + seg.Name + ' (' + (seg.MentionType === 'agent' ? 'AI Agent' : 'User') + ')'\"\n (Navigate)=\"OnMentionRecordNavigate($event)\">\n <i [class]=\"seg.MentionType === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n <span>&#64;{{ seg.Name }}</span>\n </button>\n } @else if (seg.Kind === 'mention') {\n <span\n class=\"mj-record-comments__mention-pill\"\n [class.mj-record-comments__mention-pill--agent]=\"seg.MentionType === 'agent'\"\n [class.mj-record-comments__mention-pill--user]=\"seg.MentionType === 'user'\">\n <i [class]=\"seg.MentionType === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n <span>&#64;{{ seg.Name }}</span>\n </span>\n } @else {\n <span class=\"mj-record-comments__message-text\">{{ seg.Text }}</span>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n <!-- Reply Composer -->\n @if (CanUserPostComments) {\n @let drawerReplyDraftMentions = GetDraftMentions(thread.Conversation.ID);\n @if (drawerReplyDraftMentions.length > 0) {\n <div class=\"mj-record-comments__draft-mentions\" aria-label=\"Tagged in this reply\">\n @for (m of drawerReplyDraftMentions; track m.ID) {\n <span\n class=\"mj-record-comments__draft-mention-chip\"\n [class.mj-record-comments__draft-mention-chip--agent]=\"m.Type === 'agent'\">\n <i [class]=\"m.Type === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n <span>&#64;{{ m.Name }}</span>\n <button\n type=\"button\"\n class=\"mj-record-comments__draft-mention-remove\"\n [title]=\"'Remove @' + m.Name\"\n [attr.aria-label]=\"'Remove @' + m.Name\"\n (click)=\"RemoveDraftMention(m, thread.Conversation.ID)\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </span>\n }\n </div>\n }\n <form\n class=\"mj-record-comments__reply-form\"\n (submit)=\"$event.preventDefault(); OnSubmitReply(thread.Conversation.ID)\">\n <label class=\"mj-sr-only\" [attr.for]=\"'mj-reply-' + thread.Conversation.ID\">\n Reply to {{ thread.AnchorBadgeLabel }} thread\n </label>\n <div class=\"mj-record-comments__composer-input-wrap\">\n <textarea\n [id]=\"'mj-reply-' + thread.Conversation.ID\"\n class=\"mj-record-comments__reply-textarea\"\n rows=\"1\"\n placeholder=\"Reply... (@ to mention)\"\n [value]=\"GetReplyDraft(thread.Conversation.ID)\"\n (input)=\"OnReplyInput(thread.Conversation.ID, $event)\"\n (compositionend)=\"OnComposerCompositionEnd($event)\"\n (keydown)=\"OnComposerKeydown($event, thread.Conversation.ID)\"></textarea>\n\n @if (ActiveMentionContext?.Target === thread.Conversation.ID && FilteredMentionCandidates.length > 0) {\n <ul class=\"mj-record-comments__mention-menu\" role=\"listbox\" aria-label=\"Mention suggestions\">\n @for (cand of FilteredMentionCandidates; track cand.ID; let idx = $index) {\n <li\n role=\"option\"\n class=\"mj-record-comments__mention-option\"\n [class.mj-record-comments__mention-option--active]=\"idx === ActiveMentionContext?.SelectedIndex\"\n [attr.aria-selected]=\"idx === ActiveMentionContext?.SelectedIndex\"\n (mousedown)=\"$event.preventDefault(); InsertMentionCandidate(cand, thread.Conversation.ID)\">\n <span class=\"mj-record-comments__mention-type-badge\" [attr.data-type]=\"cand.Type\">\n <i [class]=\"cand.Type === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"mj-record-comments__mention-name\">{{ cand.Name }}</span>\n @if (cand.Subtitle) {\n <span class=\"mj-record-comments__mention-sub\">{{ cand.Subtitle }}</span>\n }\n </li>\n }\n </ul>\n }\n </div>\n <button\n type=\"submit\"\n class=\"mj-record-comments__reply-btn\"\n title=\"Send reply\"\n aria-label=\"Send reply\"\n [disabled]=\"!GetReplyDraft(thread.Conversation.ID).trim() || SubmittingReplyConversationId === thread.Conversation.ID\">\n <i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"></i>\n </button>\n </form>\n }\n </article>\n }\n </section>\n }\n }\n </div>\n </aside>\n}\n\n@if (Mode === 'popover' && PopoverTarget) {\n <div class=\"mj-record-comments-popover-backdrop\" (click)=\"OnClose()\"></div>\n <section\n class=\"mj-record-comments-popover\"\n [class.mj-record-comments-popover--expanded]=\"IsPopoverExpanded\"\n [ngStyle]=\"PopoverStyle\"\n role=\"dialog\"\n [attr.aria-label]=\"'Comments on ' + PopoverTarget.Label\">\n <header class=\"mj-record-comments__header mj-record-comments__header--popover\">\n <div class=\"mj-record-comments__title-group\">\n <i class=\"fa-regular fa-comment-dots mj-record-comments__title-icon\" aria-hidden=\"true\"></i>\n <h4 class=\"mj-record-comments__title\">{{ PopoverTarget.Label }}</h4>\n </div>\n <div class=\"mj-record-comments__header-actions\">\n <button\n type=\"button\"\n class=\"mj-record-comments__icon-btn\"\n [title]=\"IsPopoverExpanded ? 'Restore dialog size' : 'Expand dialog'\"\n [attr.aria-label]=\"IsPopoverExpanded ? 'Restore dialog size' : 'Expand dialog'\"\n (click)=\"OnTogglePopoverExpand()\">\n <i [class]=\"IsPopoverExpanded ? 'fa-solid fa-compress' : 'fa-solid fa-expand'\" aria-hidden=\"true\"></i>\n </button>\n <button\n type=\"button\"\n class=\"mj-record-comments__icon-btn\"\n title=\"View all record comments in side rail\"\n aria-label=\"View all record comments in side rail\"\n (click)=\"OnSwitchPopoverToDrawer()\">\n <i class=\"fa-solid fa-table-columns\" aria-hidden=\"true\"></i>\n </button>\n <button\n type=\"button\"\n class=\"mj-record-comments__icon-btn\"\n title=\"Close popover\"\n aria-label=\"Close popover\"\n (click)=\"OnClose()\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </header>\n\n @if (ErrorBannerMessage) {\n <div class=\"mj-record-comments__error-banner\" role=\"alert\">\n <i class=\"fa-solid fa-triangle-exclamation\" aria-hidden=\"true\"></i>\n <span>{{ ErrorBannerMessage }}</span>\n </div>\n }\n\n <div class=\"mj-record-comments__body mj-record-comments__body--popover\">\n @for (thread of VisibleThreads; track thread.Conversation.ID) {\n <article class=\"mj-record-comments__thread mj-record-comments__thread--compact\">\n <div class=\"mj-record-comments__thread-header\">\n <span class=\"mj-record-comments__thread-title\">\n {{ thread.Messages.length }} {{ thread.Messages.length === 1 ? 'comment' : 'comments' }}\n </span>\n @if (CanUserPostComments) {\n <button\n type=\"button\"\n class=\"mj-record-comments__resolve-btn\"\n [disabled]=\"ResolvingConversationId === thread.Conversation.ID\"\n (click)=\"OnToggleResolve(thread, $event)\">\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n <span>Resolve</span>\n </button>\n }\n </div>\n\n <div class=\"mj-record-comments__messages\">\n @for (msg of thread.Messages; track msg.ID) {\n <div class=\"mj-record-comments__message\" [class.mj-record-comments__message--ai]=\"msg.Role === 'AI'\">\n <div class=\"mj-record-comments__avatar\" [class.mj-record-comments__avatar--ai]=\"msg.Role === 'AI'\">\n {{ FormatAuthorInitials(msg) }}\n </div>\n <div class=\"mj-record-comments__message-content\">\n <div class=\"mj-record-comments__message-meta\">\n <span class=\"mj-record-comments__author\">\n {{ msg.Role === 'AI' ? 'AI Assistant' : (msg.User || 'User') }}\n </span>\n <span class=\"mj-record-comments__timestamp\">\n {{ FormatRelativeTime(msg.__mj_CreatedAt) }}\n </span>\n </div>\n <div class=\"mj-record-comments__message-body\">\n @for (seg of ParseMessageSegments(msg.Message); track $index) {\n @if (seg.Kind === 'mention' && seg.ID) {\n <button\n type=\"button\"\n class=\"mj-record-comments__mention-pill mj-record-comments__mention-pill--clickable\"\n [class.mj-record-comments__mention-pill--agent]=\"seg.MentionType === 'agent'\"\n [class.mj-record-comments__mention-pill--user]=\"seg.MentionType === 'user'\"\n mjRecordLink\n [EntityName]=\"seg.EntityName\"\n [RecordID]=\"seg.ID\"\n [DisplayName]=\"seg.Name\"\n [title]=\"'Open ' + seg.Name + ' (' + (seg.MentionType === 'agent' ? 'AI Agent' : 'User') + ')'\"\n (Navigate)=\"OnMentionRecordNavigate($event)\">\n <i [class]=\"seg.MentionType === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n <span>&#64;{{ seg.Name }}</span>\n </button>\n } @else if (seg.Kind === 'mention') {\n <span\n class=\"mj-record-comments__mention-pill\"\n [class.mj-record-comments__mention-pill--agent]=\"seg.MentionType === 'agent'\"\n [class.mj-record-comments__mention-pill--user]=\"seg.MentionType === 'user'\">\n <i [class]=\"seg.MentionType === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n <span>&#64;{{ seg.Name }}</span>\n </span>\n } @else {\n <span class=\"mj-record-comments__message-text\">{{ seg.Text }}</span>\n }\n }\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (CanUserPostComments) {\n @let popoverReplyDraftMentions = GetDraftMentions(thread.Conversation.ID);\n @if (popoverReplyDraftMentions.length > 0) {\n <div class=\"mj-record-comments__draft-mentions\" aria-label=\"Tagged in this reply\">\n @for (m of popoverReplyDraftMentions; track m.ID) {\n <span\n class=\"mj-record-comments__draft-mention-chip\"\n [class.mj-record-comments__draft-mention-chip--agent]=\"m.Type === 'agent'\">\n <i [class]=\"m.Type === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n <span>&#64;{{ m.Name }}</span>\n <button\n type=\"button\"\n class=\"mj-record-comments__draft-mention-remove\"\n [title]=\"'Remove @' + m.Name\"\n [attr.aria-label]=\"'Remove @' + m.Name\"\n (click)=\"RemoveDraftMention(m, thread.Conversation.ID)\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </span>\n }\n </div>\n }\n <form\n class=\"mj-record-comments__reply-form\"\n (submit)=\"$event.preventDefault(); OnSubmitReply(thread.Conversation.ID)\">\n <label class=\"mj-sr-only\" [attr.for]=\"'mj-popover-reply-' + thread.Conversation.ID\">\n Reply to {{ PopoverTarget.Label }}\n </label>\n <div class=\"mj-record-comments__composer-input-wrap\">\n <textarea\n [id]=\"'mj-popover-reply-' + thread.Conversation.ID\"\n class=\"mj-record-comments__reply-textarea\"\n rows=\"1\"\n placeholder=\"Reply... (@ to mention)\"\n [value]=\"GetReplyDraft(thread.Conversation.ID)\"\n (input)=\"OnReplyInput(thread.Conversation.ID, $event)\"\n (compositionend)=\"OnComposerCompositionEnd($event)\"\n (keydown)=\"OnComposerKeydown($event, thread.Conversation.ID)\"></textarea>\n\n @if (ActiveMentionContext?.Target === thread.Conversation.ID && FilteredMentionCandidates.length > 0) {\n <ul class=\"mj-record-comments__mention-menu\" role=\"listbox\" aria-label=\"Mention suggestions\">\n @for (cand of FilteredMentionCandidates; track cand.ID; let idx = $index) {\n <li\n role=\"option\"\n class=\"mj-record-comments__mention-option\"\n [class.mj-record-comments__mention-option--active]=\"idx === ActiveMentionContext?.SelectedIndex\"\n [attr.aria-selected]=\"idx === ActiveMentionContext?.SelectedIndex\"\n (mousedown)=\"$event.preventDefault(); InsertMentionCandidate(cand, thread.Conversation.ID)\">\n <span class=\"mj-record-comments__mention-type-badge\" [attr.data-type]=\"cand.Type\">\n <i [class]=\"cand.Type === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"mj-record-comments__mention-name\">{{ cand.Name }}</span>\n </li>\n }\n </ul>\n }\n </div>\n <button\n type=\"submit\"\n class=\"mj-record-comments__reply-btn\"\n title=\"Send reply\"\n aria-label=\"Send reply\"\n [disabled]=\"!GetReplyDraft(thread.Conversation.ID).trim() || SubmittingReplyConversationId === thread.Conversation.ID\">\n <i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"></i>\n </button>\n </form>\n }\n </article>\n }\n </div>\n\n <!-- Start new thread on this field/section -->\n @if (CanUserPostComments) {\n <form\n class=\"mj-record-comments__composer mj-record-comments__composer--popover\"\n (submit)=\"$event.preventDefault(); OnSubmitNewThread()\">\n <label class=\"mj-sr-only\" for=\"mj-record-comments-new-thread-popover\">\n Start a new comment thread on {{ PopoverTarget.Label }}\n </label>\n <div class=\"mj-record-comments__composer-input-wrap\">\n <textarea\n #newThreadTextarea\n id=\"mj-record-comments-new-thread-popover\"\n class=\"mj-record-comments__textarea\"\n rows=\"2\"\n [value]=\"NewThreadMessage\"\n [placeholder]=\"VisibleThreads.length > 0 ? 'Start another thread on ' + PopoverTarget.Label + '...' : 'Comment on ' + PopoverTarget.Label + '... (@ to mention)'\"\n (input)=\"OnNewThreadInput($event)\"\n (compositionend)=\"OnComposerCompositionEnd($event)\"\n (keydown)=\"OnComposerKeydown($event, 'new')\"></textarea>\n\n @if (ActiveMentionContext?.Target === 'new' && FilteredMentionCandidates.length > 0) {\n <ul class=\"mj-record-comments__mention-menu\" role=\"listbox\" aria-label=\"Mention suggestions\">\n @for (cand of FilteredMentionCandidates; track cand.ID; let idx = $index) {\n <li\n role=\"option\"\n class=\"mj-record-comments__mention-option\"\n [class.mj-record-comments__mention-option--active]=\"idx === ActiveMentionContext?.SelectedIndex\"\n [attr.aria-selected]=\"idx === ActiveMentionContext?.SelectedIndex\"\n (mousedown)=\"$event.preventDefault(); InsertMentionCandidate(cand, 'new')\">\n <span class=\"mj-record-comments__mention-type-badge\" [attr.data-type]=\"cand.Type\">\n <i [class]=\"cand.Type === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"mj-record-comments__mention-name\">{{ cand.Name }}</span>\n </li>\n }\n </ul>\n }\n </div>\n @let popoverNewDraftMentions = GetDraftMentions('new');\n @if (popoverNewDraftMentions.length > 0) {\n <div class=\"mj-record-comments__draft-mentions\" aria-label=\"Tagged in this comment\">\n @for (m of popoverNewDraftMentions; track m.ID) {\n <span\n class=\"mj-record-comments__draft-mention-chip\"\n [class.mj-record-comments__draft-mention-chip--agent]=\"m.Type === 'agent'\">\n <i [class]=\"m.Type === 'agent' ? 'fa-solid fa-robot' : 'fa-solid fa-user'\" aria-hidden=\"true\"></i>\n <span>&#64;{{ m.Name }}</span>\n <button\n type=\"button\"\n class=\"mj-record-comments__draft-mention-remove\"\n [title]=\"'Remove @' + m.Name\"\n [attr.aria-label]=\"'Remove @' + m.Name\"\n (click)=\"RemoveDraftMention(m, 'new')\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </span>\n }\n </div>\n }\n <div class=\"mj-record-comments__composer-footer\">\n <button\n type=\"submit\"\n class=\"mj-record-comments__submit-btn\"\n [disabled]=\"!NewThreadMessage.trim() || IsSubmittingNewThread\">\n <i class=\"fa-solid fa-paper-plane\" aria-hidden=\"true\"></i>\n Comment\n </button>\n <button\n type=\"button\"\n class=\"mj-record-comments__cancel-btn\"\n (click)=\"OnClose()\">\n Cancel\n </button>\n </div>\n </form>\n }\n </section>\n}\n", styles: ["/* ============================================================================\n RECORD COMMENTS DRAWER & INLINE POPOVER\n Uses global --mj-* design tokens exclusively.\n ============================================================================ */\n\n.mj-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n}\n\n.mj-record-comments-backdrop {\n position: fixed;\n inset: 0;\n background: var(--mj-bg-overlay, rgba(0, 0, 0, 0.18));\n z-index: 1040;\n}\n\n.mj-record-comments-popover-backdrop {\n position: fixed;\n inset: 0;\n background: transparent;\n z-index: 1045;\n}\n\n.mj-record-comments-drawer {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1041;\n background: var(--mj-bg-surface);\n border-left: 1px solid var(--mj-border-default);\n box-shadow: var(--mj-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.15));\n display: flex;\n flex-direction: column;\n max-width: 92vw;\n color: var(--mj-text-primary);\n}\n\n.mj-record-comments-drawer--resizing {\n user-select: none;\n}\n\n.mj-record-comments-drawer__resize-handle {\n position: absolute;\n top: 0;\n bottom: 0;\n left: -3px;\n width: 6px;\n cursor: col-resize;\n z-index: 2;\n transition: background-color 0.15s ease;\n}\n\n.mj-record-comments-drawer__resize-handle:hover,\n.mj-record-comments-drawer--resizing .mj-record-comments-drawer__resize-handle {\n background: var(--mj-brand-primary);\n}\n\n.mj-record-comments-popover {\n position: fixed;\n z-index: 1046;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-lg, 10px);\n box-shadow: var(--mj-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.18));\n display: flex;\n flex-direction: column;\n min-width: 340px;\n min-height: 260px;\n max-width: min(820px, calc(100vw - 32px));\n max-height: min(82vh, 760px);\n resize: both;\n overflow: auto;\n color: var(--mj-text-primary);\n}\n\n.mj-record-comments-popover--expanded {\n min-height: 440px;\n max-height: min(85vh, 760px);\n}\n\n/* Header */\n.mj-record-comments__header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 16px;\n border-bottom: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-card);\n flex-shrink: 0;\n}\n\n.mj-record-comments__header--popover {\n padding: 10px 12px;\n}\n\n.mj-record-comments__title-group {\n display: flex;\n align-items: center;\n gap: 8px;\n min-width: 0;\n}\n\n.mj-record-comments__title-icon {\n color: var(--mj-brand-primary);\n font-size: 15px;\n}\n\n.mj-record-comments__title {\n margin: 0;\n font-size: 14px;\n font-weight: 600;\n color: var(--mj-text-primary);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n.mj-record-comments__count-badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 20px;\n height: 20px;\n padding: 0 6px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 11px;\n font-weight: 600;\n}\n\n.mj-record-comments__header-actions {\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.mj-record-comments__icon-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 28px;\n height: 28px;\n border: none;\n border-radius: var(--mj-radius-sm, 6px);\n background: transparent;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: background-color 0.15s ease, color 0.15s ease;\n}\n\n.mj-record-comments__icon-btn:hover:not(:disabled) {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-primary);\n}\n\n/* Filters */\n.mj-record-comments__filters {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 10px 16px;\n border-bottom: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface);\n flex-shrink: 0;\n}\n\n.mj-record-comments__status-tabs {\n display: flex;\n gap: 4px;\n background: var(--mj-bg-surface-sunken);\n padding: 3px;\n border-radius: var(--mj-radius-md, 8px);\n}\n\n.mj-record-comments__status-tab {\n flex: 1;\n border: none;\n background: transparent;\n padding: 5px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n font-size: 12px;\n font-weight: 500;\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: background-color 0.15s ease, color 0.15s ease;\n}\n\n.mj-record-comments__status-tab--active {\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-primary);\n font-weight: 600;\n box-shadow: var(--mj-shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.06));\n}\n\n.mj-record-comments__target-filter-banner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n padding: 6px 10px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface-sunken);\n border: 1px solid var(--mj-border-subtle);\n font-size: 12px;\n color: var(--mj-text-secondary);\n}\n\n.mj-record-comments__target-filter-label {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-record-comments__target-filter-clear {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n border: none;\n background: transparent;\n color: var(--mj-text-link);\n font-size: 11px;\n font-weight: 500;\n cursor: pointer;\n padding: 2px 4px;\n}\n\n/* Error Banner */\n.mj-record-comments__error-banner {\n display: flex;\n align-items: center;\n gap: 8px;\n margin: 8px 12px 0;\n padding: 8px 10px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-status-error-bg);\n border: 1px solid var(--mj-status-error-border);\n color: var(--mj-status-error);\n font-size: 12px;\n}\n\n/* Composer */\n.mj-record-comments__composer {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 12px 16px;\n border-bottom: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-card);\n flex-shrink: 0;\n}\n\n.mj-record-comments__composer--popover {\n padding: 10px 12px;\n border-top: 1px solid var(--mj-border-subtle);\n border-bottom: none;\n}\n\n.mj-record-comments__composer-input-wrap {\n position: relative;\n display: flex;\n flex: 1;\n}\n\n.mj-record-comments__textarea,\n.mj-record-comments__reply-textarea {\n width: 100%;\n box-sizing: border-box;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n font-family: inherit;\n font-size: 13px;\n line-height: 1.45;\n padding: 8px 10px;\n resize: vertical;\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n\n.mj-record-comments__textarea:focus,\n.mj-record-comments__reply-textarea:focus {\n outline: none;\n border-color: var(--mj-border-focus);\n box-shadow: 0 0 0 2px var(--mj-focus-ring-color, rgba(59, 130, 246, 0.2));\n}\n\n.mj-record-comments__composer-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.mj-record-comments__submit-btn {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px;\n border: none;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n transition: background-color 0.15s ease, opacity 0.15s ease;\n}\n\n.mj-record-comments__submit-btn:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n}\n\n.mj-record-comments__submit-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n}\n\n.mj-record-comments__cancel-btn {\n display: inline-flex;\n align-items: center;\n padding: 6px 10px;\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n font-size: 12px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.mj-record-comments__composer-hint {\n font-size: 11px;\n color: var(--mj-text-muted);\n}\n\n/* Thread List Body */\n.mj-record-comments__body {\n flex: 1;\n overflow-y: auto;\n padding: 12px 16px;\n display: flex;\n flex-direction: column;\n gap: 14px;\n}\n\n.mj-record-comments__body--popover {\n padding: 10px 12px;\n flex: 1;\n min-height: 120px;\n max-height: none;\n overflow-y: auto;\n}\n\n/* Section Group Organization (Drawer Mode) */\n.mj-record-comments__section-group {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n\n.mj-record-comments__section-group-header {\n display: flex;\n align-items: center;\n gap: 7px;\n padding: 4px 2px;\n font-size: 11px;\n font-weight: 700;\n letter-spacing: 0.04em;\n text-transform: uppercase;\n color: var(--mj-text-secondary);\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mj-record-comments__section-group-icon {\n color: var(--mj-brand-primary);\n font-size: 12px;\n}\n\n.mj-record-comments__section-group-title {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-record-comments__section-group-count {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 18px;\n height: 18px;\n padding: 0 5px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-sunken);\n border: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n font-size: 10px;\n font-weight: 600;\n}\n\n.mj-record-comments__empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 36px 20px;\n color: var(--mj-text-muted);\n}\n\n.mj-record-comments__empty-icon {\n font-size: 28px;\n margin-bottom: 10px;\n color: var(--mj-text-disabled);\n}\n\n.mj-record-comments__empty-title {\n margin: 0 0 4px;\n font-size: 14px;\n font-weight: 600;\n color: var(--mj-text-secondary);\n}\n\n.mj-record-comments__empty-sub {\n margin: 0;\n font-size: 12px;\n line-height: 1.45;\n}\n\n/* Thread Card */\n.mj-record-comments__thread {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 12px;\n border-radius: var(--mj-radius-md, 8px);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n box-shadow: var(--mj-shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.04));\n}\n\n.mj-record-comments__thread--resolved {\n opacity: 0.78;\n background: var(--mj-bg-surface-sunken);\n}\n\n.mj-record-comments__thread--compact {\n padding: 10px;\n}\n\n.mj-record-comments__thread-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n.mj-record-comments__anchor-chip {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n max-width: 220px;\n padding: 3px 8px;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-text-primary);\n font-size: 11px;\n font-weight: 600;\n cursor: pointer;\n transition: background-color 0.15s ease, border-color 0.15s ease;\n}\n\n.mj-record-comments__anchor-chip:hover {\n background: var(--mj-bg-surface-hover);\n border-color: var(--mj-brand-primary);\n color: var(--mj-brand-primary);\n}\n\n.mj-record-comments__anchor-jump-icon {\n font-size: 9px;\n opacity: 0.65;\n}\n\n.mj-record-comments__fls-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 2px 6px;\n border-radius: var(--mj-radius-sm, 4px);\n background: var(--mj-status-warning-bg);\n color: var(--mj-status-warning);\n font-size: 10px;\n font-weight: 600;\n}\n\n.mj-record-comments__resolve-btn {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n border: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface);\n color: var(--mj-text-secondary);\n font-size: 11px;\n font-weight: 500;\n cursor: pointer;\n}\n\n.mj-record-comments__resolve-btn:hover:not(:disabled) {\n border-color: var(--mj-status-success);\n color: var(--mj-status-success);\n}\n\n/* Quoted Value Diff */\n.mj-record-comments__quoted-value {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n padding: 5px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface-sunken);\n border-left: 3px solid var(--mj-border-default);\n font-size: 11px;\n color: var(--mj-text-secondary);\n}\n\n.mj-record-comments__quoted-value--changed {\n border-left-color: var(--mj-status-warning);\n background: var(--mj-status-warning-bg);\n}\n\n.mj-record-comments__quoted-code {\n font-family: var(--mj-font-mono, monospace);\n font-size: 11px;\n color: var(--mj-text-primary);\n}\n\n/* Messages */\n.mj-record-comments__messages {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.mj-record-comments__message {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n}\n\n.mj-record-comments__avatar {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-sunken);\n border: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n font-size: 10px;\n font-weight: 700;\n flex-shrink: 0;\n}\n\n.mj-record-comments__avatar--ai {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n border-color: var(--mj-brand-primary);\n}\n\n.mj-record-comments__message-content {\n flex: 1;\n min-width: 0;\n}\n\n.mj-record-comments__message-meta {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: 6px;\n margin-bottom: 2px;\n}\n\n.mj-record-comments__author {\n font-size: 12px;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n\n.mj-record-comments__timestamp {\n font-size: 11px;\n color: var(--mj-text-muted);\n}\n\n.mj-record-comments__message-body {\n font-size: 13px;\n line-height: 1.5;\n color: var(--mj-text-primary);\n word-break: break-word;\n}\n\n.mj-record-comments__message-text {\n white-space: pre-wrap;\n}\n\n.mj-record-comments__mention-pill {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 1px 7px;\n margin: 0 1px;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 28%, var(--mj-border-subtle));\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface-sunken));\n color: var(--mj-brand-primary);\n font-family: inherit;\n font-weight: 600;\n font-size: 12px;\n line-height: 1.35;\n vertical-align: baseline;\n transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;\n}\n\n.mj-record-comments__mention-pill i {\n font-size: 10px;\n opacity: 0.85;\n}\n\n.mj-record-comments__mention-pill--clickable {\n cursor: pointer;\n}\n\n.mj-record-comments__mention-pill--clickable:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 22%, var(--mj-bg-surface-hover));\n border-color: var(--mj-brand-primary);\n}\n\n.mj-record-comments__draft-mentions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n}\n\n.mj-record-comments__draft-mention-chip {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n padding: 2px 6px 2px 8px;\n border-radius: var(--mj-radius-full, 9999px);\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 30%, var(--mj-border-subtle));\n background: color-mix(in srgb, var(--mj-brand-primary) 12%, var(--mj-bg-surface-sunken));\n color: var(--mj-brand-primary);\n font-size: 11px;\n font-weight: 600;\n}\n\n.mj-record-comments__draft-mention-chip i {\n font-size: 10px;\n}\n\n.mj-record-comments__draft-mention-remove {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 15px;\n height: 15px;\n padding: 0;\n border: none;\n border-radius: var(--mj-radius-full, 9999px);\n background: transparent;\n color: inherit;\n opacity: 0.7;\n cursor: pointer;\n}\n\n.mj-record-comments__draft-mention-remove:hover {\n opacity: 1;\n background: color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n}\n\n/* Reply Form */\n.mj-record-comments__reply-form {\n display: flex;\n align-items: flex-end;\n gap: 6px;\n margin-top: 2px;\n}\n\n.mj-record-comments__reply-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 30px;\n height: 30px;\n border: none;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n cursor: pointer;\n flex-shrink: 0;\n}\n\n.mj-record-comments__reply-btn:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n/* @Mention Autocomplete Menu */\n.mj-record-comments__mention-menu {\n position: absolute;\n left: 0;\n right: 0;\n top: calc(100% + 4px);\n z-index: 1055;\n margin: 0;\n padding: 4px;\n list-style: none;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: var(--mj-radius-md, 8px);\n box-shadow: var(--mj-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.12));\n max-height: 180px;\n overflow-y: auto;\n}\n\n.mj-record-comments__mention-option {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n font-size: 12px;\n color: var(--mj-text-primary);\n cursor: pointer;\n}\n\n.mj-record-comments__mention-option--active,\n.mj-record-comments__mention-option:hover {\n background: var(--mj-bg-surface-hover);\n}\n\n.mj-record-comments__mention-type-badge {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n width: 20px;\n height: 20px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-sunken);\n color: var(--mj-brand-primary);\n font-size: 10px;\n}\n\n.mj-record-comments__mention-name {\n font-weight: 600;\n}\n\n.mj-record-comments__mention-sub {\n margin-left: auto;\n font-size: 11px;\n color: var(--mj-text-muted);\n}\n"] }]
1991
+ }], null, { Record: [{
1992
+ type: Input
1993
+ }], Mode: [{
1994
+ type: Input
1995
+ }], IsOpen: [{
1996
+ type: Input
1997
+ }], WidthPx: [{
1998
+ type: Input
1999
+ }], Close: [{
2000
+ type: Output
2001
+ }], CommentCountChange: [{
2002
+ type: Output
2003
+ }], RollupChange: [{
2004
+ type: Output
2005
+ }], NavigateToAnchor: [{
2006
+ type: Output
2007
+ }], Navigate: [{
2008
+ type: Output
2009
+ }], WidthChanged: [{
2010
+ type: Output
2011
+ }], newThreadTextarea: [{
2012
+ type: ViewChild,
2013
+ args: ['newThreadTextarea']
2014
+ }], OnEscapeKey: [{
2015
+ type: HostListener,
2016
+ args: ['document:keydown.escape', ['$event']]
2017
+ }] }); })();
2018
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MjRecordCommentsComponent, { className: "MjRecordCommentsComponent", filePath: "src/lib/comments/record-comments.component.ts", lineNumber: 113 }); })();
2019
+ //# sourceMappingURL=record-comments.component.js.map