@memberjunction/ng-base-forms 6.2.0-edge.2 → 6.2.0-edge.4

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 (188) hide show
  1. package/dist/lib/apply/form-placement-dialog.component.d.ts +266 -0
  2. package/dist/lib/apply/form-placement-dialog.component.d.ts.map +1 -0
  3. package/dist/lib/apply/form-placement-dialog.component.js +1522 -0
  4. package/dist/lib/apply/form-placement-dialog.component.js.map +1 -0
  5. package/dist/lib/apply/form-placement-order.d.ts +37 -0
  6. package/dist/lib/apply/form-placement-order.d.ts.map +1 -0
  7. package/dist/lib/apply/form-placement-order.js +111 -0
  8. package/dist/lib/apply/form-placement-order.js.map +1 -0
  9. package/dist/lib/apply/form-placement-preview.component.d.ts +112 -0
  10. package/dist/lib/apply/form-placement-preview.component.d.ts.map +1 -0
  11. package/dist/lib/apply/form-placement-preview.component.js +346 -0
  12. package/dist/lib/apply/form-placement-preview.component.js.map +1 -0
  13. package/dist/lib/apply/form-placement-text.d.ts +61 -0
  14. package/dist/lib/apply/form-placement-text.d.ts.map +1 -0
  15. package/dist/lib/apply/form-placement-text.js +279 -0
  16. package/dist/lib/apply/form-placement-text.js.map +1 -0
  17. package/dist/lib/apply/form-placement.d.ts +320 -0
  18. package/dist/lib/apply/form-placement.d.ts.map +1 -0
  19. package/dist/lib/apply/form-placement.js +432 -0
  20. package/dist/lib/apply/form-placement.js.map +1 -0
  21. package/dist/lib/apply/form-slot-probe.service.d.ts +121 -0
  22. package/dist/lib/apply/form-slot-probe.service.d.ts.map +1 -0
  23. package/dist/lib/apply/form-slot-probe.service.js +264 -0
  24. package/dist/lib/apply/form-slot-probe.service.js.map +1 -0
  25. package/dist/lib/base-form-component-internals.d.ts +11 -0
  26. package/dist/lib/base-form-component-internals.d.ts.map +1 -0
  27. package/dist/lib/base-form-component-internals.js +33 -0
  28. package/dist/lib/base-form-component-internals.js.map +1 -0
  29. package/dist/lib/base-form-component.d.ts +132 -1
  30. package/dist/lib/base-form-component.d.ts.map +1 -1
  31. package/dist/lib/base-form-component.js +228 -19
  32. package/dist/lib/base-form-component.js.map +1 -1
  33. package/dist/lib/chrome/form-chrome.d.ts +90 -0
  34. package/dist/lib/chrome/form-chrome.d.ts.map +1 -1
  35. package/dist/lib/chrome/form-chrome.js +142 -2
  36. package/dist/lib/chrome/form-chrome.js.map +1 -1
  37. package/dist/lib/chrome/form-composition-registry.d.ts +34 -0
  38. package/dist/lib/chrome/form-composition-registry.d.ts.map +1 -0
  39. package/dist/lib/chrome/form-composition-registry.js +56 -0
  40. package/dist/lib/chrome/form-composition-registry.js.map +1 -0
  41. package/dist/lib/chrome/form-composition-snapshot.d.ts +151 -0
  42. package/dist/lib/chrome/form-composition-snapshot.d.ts.map +1 -0
  43. package/dist/lib/chrome/form-composition-snapshot.js +137 -0
  44. package/dist/lib/chrome/form-composition-snapshot.js.map +1 -0
  45. package/dist/lib/chrome/resolve-form-chrome.d.ts +15 -0
  46. package/dist/lib/chrome/resolve-form-chrome.d.ts.map +1 -1
  47. package/dist/lib/chrome/resolve-form-chrome.js +31 -2
  48. package/dist/lib/chrome/resolve-form-chrome.js.map +1 -1
  49. package/dist/lib/container/record-form-container.component.d.ts +241 -5
  50. package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
  51. package/dist/lib/container/record-form-container.component.js +977 -249
  52. package/dist/lib/container/record-form-container.component.js.map +1 -1
  53. package/dist/lib/field/form-field.component.d.ts +17 -0
  54. package/dist/lib/field/form-field.component.d.ts.map +1 -1
  55. package/dist/lib/field/form-field.component.js +41 -5
  56. package/dist/lib/field/form-field.component.js.map +1 -1
  57. package/dist/lib/form-state.service.d.ts +5 -0
  58. package/dist/lib/form-state.service.d.ts.map +1 -1
  59. package/dist/lib/form-state.service.js +6 -1
  60. package/dist/lib/form-state.service.js.map +1 -1
  61. package/dist/lib/host/entity-form-host.component.d.ts +16 -1
  62. package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
  63. package/dist/lib/host/entity-form-host.component.js +27 -6
  64. package/dist/lib/host/entity-form-host.component.js.map +1 -1
  65. package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts +24 -0
  66. package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts.map +1 -0
  67. package/dist/lib/interactive-form/form-panel-host-props.builder.js +99 -0
  68. package/dist/lib/interactive-form/form-panel-host-props.builder.js.map +1 -0
  69. package/dist/lib/interactive-form/interactive-form-panel.component.d.ts +109 -0
  70. package/dist/lib/interactive-form/interactive-form-panel.component.d.ts.map +1 -0
  71. package/dist/lib/interactive-form/interactive-form-panel.component.js +424 -0
  72. package/dist/lib/interactive-form/interactive-form-panel.component.js.map +1 -0
  73. package/dist/lib/interactive-form/interactive-form.component.d.ts +2 -0
  74. package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
  75. package/dist/lib/interactive-form/interactive-form.component.js +4 -5
  76. package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
  77. package/dist/lib/panel/collapsible-panel.component.d.ts +69 -1
  78. package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
  79. package/dist/lib/panel/collapsible-panel.component.js +148 -12
  80. package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
  81. package/dist/lib/panel-manager/form-audience.d.ts +46 -0
  82. package/dist/lib/panel-manager/form-audience.d.ts.map +1 -0
  83. package/dist/lib/panel-manager/form-audience.js +34 -0
  84. package/dist/lib/panel-manager/form-audience.js.map +1 -0
  85. package/dist/lib/panel-manager/form-panel-admin.service.d.ts +150 -0
  86. package/dist/lib/panel-manager/form-panel-admin.service.d.ts.map +1 -0
  87. package/dist/lib/panel-manager/form-panel-admin.service.js +433 -0
  88. package/dist/lib/panel-manager/form-panel-admin.service.js.map +1 -0
  89. package/dist/lib/panel-manager/form-panel-inventory.d.ts +255 -0
  90. package/dist/lib/panel-manager/form-panel-inventory.d.ts.map +1 -0
  91. package/dist/lib/panel-manager/form-panel-inventory.js +293 -0
  92. package/dist/lib/panel-manager/form-panel-inventory.js.map +1 -0
  93. package/dist/lib/panel-manager/panel-manager.component.d.ts +232 -0
  94. package/dist/lib/panel-manager/panel-manager.component.d.ts.map +1 -0
  95. package/dist/lib/panel-manager/panel-manager.component.js +1112 -0
  96. package/dist/lib/panel-manager/panel-manager.component.js.map +1 -0
  97. package/dist/lib/panel-slot/base-contribution-panel.d.ts +40 -0
  98. package/dist/lib/panel-slot/base-contribution-panel.d.ts.map +1 -0
  99. package/dist/lib/panel-slot/base-contribution-panel.js +55 -0
  100. package/dist/lib/panel-slot/base-contribution-panel.js.map +1 -0
  101. package/dist/lib/panel-slot/base-form-panel.d.ts +116 -8
  102. package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
  103. package/dist/lib/panel-slot/base-form-panel.js +76 -5
  104. package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
  105. package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts +29 -0
  106. package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts.map +1 -0
  107. package/dist/lib/panel-slot/collect-form-contribution-registrations.js +214 -0
  108. package/dist/lib/panel-slot/collect-form-contribution-registrations.js.map +1 -0
  109. package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts +6 -3
  110. package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts.map +1 -1
  111. package/dist/lib/panel-slot/collect-form-panel-registrations.js +8 -14
  112. package/dist/lib/panel-slot/collect-form-panel-registrations.js.map +1 -1
  113. package/dist/lib/panel-slot/form-contribution.d.ts +170 -7
  114. package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -1
  115. package/dist/lib/panel-slot/form-contribution.js +245 -71
  116. package/dist/lib/panel-slot/form-contribution.js.map +1 -1
  117. package/dist/lib/panel-slot/form-contributions.component.d.ts +16 -5
  118. package/dist/lib/panel-slot/form-contributions.component.d.ts.map +1 -1
  119. package/dist/lib/panel-slot/form-contributions.component.js +43 -7
  120. package/dist/lib/panel-slot/form-contributions.component.js.map +1 -1
  121. package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts +66 -0
  122. package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts.map +1 -0
  123. package/dist/lib/panel-slot/form-field-panel-slot.component.js +190 -0
  124. package/dist/lib/panel-slot/form-field-panel-slot.component.js.map +1 -0
  125. package/dist/lib/panel-slot/form-panel-slot.component.d.ts +52 -16
  126. package/dist/lib/panel-slot/form-panel-slot.component.d.ts.map +1 -1
  127. package/dist/lib/panel-slot/form-panel-slot.component.js +190 -66
  128. package/dist/lib/panel-slot/form-panel-slot.component.js.map +1 -1
  129. package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts +11 -0
  130. package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts.map +1 -1
  131. package/dist/lib/panel-slot/form-slot-coordinator.service.js +17 -0
  132. package/dist/lib/panel-slot/form-slot-coordinator.service.js.map +1 -1
  133. package/dist/lib/panel-slot/merge-panel-validation.d.ts +7 -0
  134. package/dist/lib/panel-slot/merge-panel-validation.d.ts.map +1 -0
  135. package/dist/lib/panel-slot/merge-panel-validation.js +16 -0
  136. package/dist/lib/panel-slot/merge-panel-validation.js.map +1 -0
  137. package/dist/lib/panel-slot/mount-form-contribution.d.ts +15 -0
  138. package/dist/lib/panel-slot/mount-form-contribution.d.ts.map +1 -0
  139. package/dist/lib/panel-slot/mount-form-contribution.js +37 -0
  140. package/dist/lib/panel-slot/mount-form-contribution.js.map +1 -0
  141. package/dist/lib/panel-slot/panel-hides.d.ts +35 -0
  142. package/dist/lib/panel-slot/panel-hides.d.ts.map +1 -0
  143. package/dist/lib/panel-slot/panel-hides.js +111 -0
  144. package/dist/lib/panel-slot/panel-hides.js.map +1 -0
  145. package/dist/lib/panel-slot/placement-preview-panel.component.d.ts +16 -0
  146. package/dist/lib/panel-slot/placement-preview-panel.component.d.ts.map +1 -0
  147. package/dist/lib/panel-slot/placement-preview-panel.component.js +112 -0
  148. package/dist/lib/panel-slot/placement-preview-panel.component.js.map +1 -0
  149. package/dist/lib/panel-slot/placement-preview.d.ts +57 -0
  150. package/dist/lib/panel-slot/placement-preview.d.ts.map +1 -0
  151. package/dist/lib/panel-slot/placement-preview.js +86 -0
  152. package/dist/lib/panel-slot/placement-preview.js.map +1 -0
  153. package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts +2 -0
  154. package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts.map +1 -1
  155. package/dist/lib/panel-slot/related-entity-grid-panel.component.js +10 -3
  156. package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -1
  157. package/dist/lib/panel-slot/slot-order.d.ts +19 -0
  158. package/dist/lib/panel-slot/slot-order.d.ts.map +1 -0
  159. package/dist/lib/panel-slot/slot-order.js +53 -0
  160. package/dist/lib/panel-slot/slot-order.js.map +1 -0
  161. package/dist/lib/resolver/form-resolver.service.d.ts +4 -2
  162. package/dist/lib/resolver/form-resolver.service.d.ts.map +1 -1
  163. package/dist/lib/resolver/form-resolver.service.js +18 -8
  164. package/dist/lib/resolver/form-resolver.service.js.map +1 -1
  165. package/dist/lib/resolver/form-variants.d.ts +28 -0
  166. package/dist/lib/resolver/form-variants.d.ts.map +1 -0
  167. package/dist/lib/resolver/form-variants.js +40 -0
  168. package/dist/lib/resolver/form-variants.js.map +1 -0
  169. package/dist/lib/section-counts/form-section-counts.d.ts +99 -0
  170. package/dist/lib/section-counts/form-section-counts.d.ts.map +1 -0
  171. package/dist/lib/section-counts/form-section-counts.js +223 -0
  172. package/dist/lib/section-counts/form-section-counts.js.map +1 -0
  173. package/dist/lib/toolbar/form-toolbar.component.d.ts +7 -0
  174. package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
  175. package/dist/lib/toolbar/form-toolbar.component.js +194 -128
  176. package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
  177. package/dist/lib/types/form-types.d.ts +8 -0
  178. package/dist/lib/types/form-types.d.ts.map +1 -1
  179. package/dist/lib/types/form-types.js.map +1 -1
  180. package/dist/module.d.ts +29 -23
  181. package/dist/module.d.ts.map +1 -1
  182. package/dist/module.js +43 -5
  183. package/dist/module.js.map +1 -1
  184. package/dist/public-api.d.ts +20 -0
  185. package/dist/public-api.d.ts.map +1 -1
  186. package/dist/public-api.js +21 -0
  187. package/dist/public-api.js.map +1 -1
  188. package/package.json +20 -20
@@ -0,0 +1,1112 @@
1
+ import { Component, Input, Output, EventEmitter, ElementRef, HostListener, ChangeDetectionStrategy, ChangeDetectorRef, inject, } from '@angular/core';
2
+ import { Metadata } from '@memberjunction/core';
3
+ import { UUIDsEqual } from '@memberjunction/global';
4
+ import { FormPanelAdminService } from './form-panel-admin.service';
5
+ import { FormSlotProbeService } from '../apply/form-slot-probe.service';
6
+ import { HiddenPanelKeys } from '../panel-slot/panel-hides';
7
+ import { BuildFormItems, BuildPanelInventory, DescribeAudience, GroupPanelInventory, ParseContributionConfiguration, SummarizeInventory, } from './form-panel-inventory';
8
+ import { KeepEditedRowKey, PlacementStateFromContribution, } from '../apply/form-placement';
9
+ import { DescribeVisibleTo } from '../apply/form-placement-text';
10
+ import * as i0 from "@angular/core";
11
+ import * as i1 from "@angular/forms";
12
+ import * as i2 from "@memberjunction/ng-ui-components";
13
+ import * as i3 from "../apply/form-placement-dialog.component";
14
+ const _c0 = () => ["User", "Role", "Global"];
15
+ const _forTrack0 = ($index, $item) => $item.Key;
16
+ const _forTrack1 = ($index, $item) => $item.ID ?? "generated";
17
+ const _forTrack2 = ($index, $item) => $item.ID;
18
+ function MjPanelManagerComponent_Conditional_0_Conditional_10_Template(rf, ctx) { if (rf & 1) {
19
+ i0.ɵɵelementStart(0, "p", 9);
20
+ i0.ɵɵtext(1, " A full custom form is drawing this entity. It owns the whole body, so everything below is held back until that form is turned off. ");
21
+ i0.ɵɵelementEnd();
22
+ } }
23
+ function MjPanelManagerComponent_Conditional_0_Conditional_11_Template(rf, ctx) { if (rf & 1) {
24
+ i0.ɵɵelementStart(0, "p", 10);
25
+ i0.ɵɵtext(1);
26
+ i0.ɵɵelementEnd();
27
+ } if (rf & 2) {
28
+ const ctx_r1 = i0.ɵɵnextContext(2);
29
+ i0.ɵɵadvance();
30
+ i0.ɵɵtextInterpolate(ctx_r1.Error);
31
+ } }
32
+ function MjPanelManagerComponent_Conditional_0_Conditional_13_For_8_Conditional_8_Template(rf, ctx) { if (rf & 1) {
33
+ i0.ɵɵtext(0, " \u00B7 ");
34
+ i0.ɵɵelementStart(1, "span", 30);
35
+ i0.ɵɵtext(2, "what you see");
36
+ i0.ɵɵelementEnd();
37
+ } }
38
+ function MjPanelManagerComponent_Conditional_0_Conditional_13_For_8_Conditional_9_Template(rf, ctx) { if (rf & 1) {
39
+ const _r5 = i0.ɵɵgetCurrentView();
40
+ i0.ɵɵelementStart(0, "button", 31);
41
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_Conditional_13_For_8_Conditional_9_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r5); const form_r4 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnPublishForm(form_r4)); });
42
+ i0.ɵɵtext(1);
43
+ i0.ɵɵelementEnd();
44
+ } if (rf & 2) {
45
+ const form_r4 = i0.ɵɵnextContext().$implicit;
46
+ const ctx_r1 = i0.ɵɵnextContext(3);
47
+ i0.ɵɵproperty("disabled", ctx_r1.Busy === form_r4.ID);
48
+ i0.ɵɵadvance();
49
+ i0.ɵɵtextInterpolate(form_r4.CanPublish ? "Publish\u2026" : "Audience\u2026");
50
+ } }
51
+ function MjPanelManagerComponent_Conditional_0_Conditional_13_For_8_Template(rf, ctx) { if (rf & 1) {
52
+ const _r3 = i0.ɵɵgetCurrentView();
53
+ i0.ɵɵelementStart(0, "div", 23)(1, "label", 24)(2, "input", 25);
54
+ i0.ɵɵlistener("change", function MjPanelManagerComponent_Conditional_0_Conditional_13_For_8_Template_input_change_2_listener() { const form_r4 = i0.ɵɵrestoreView(_r3).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnUseForm(form_r4)); });
55
+ i0.ɵɵelementEnd();
56
+ i0.ɵɵelementStart(3, "span", 26)(4, "span", 27);
57
+ i0.ɵɵtext(5);
58
+ i0.ɵɵelementEnd();
59
+ i0.ɵɵelementStart(6, "span", 28);
60
+ i0.ɵɵtext(7);
61
+ i0.ɵɵconditionalCreate(8, MjPanelManagerComponent_Conditional_0_Conditional_13_For_8_Conditional_8_Template, 3, 0);
62
+ i0.ɵɵelementEnd()()();
63
+ i0.ɵɵconditionalCreate(9, MjPanelManagerComponent_Conditional_0_Conditional_13_For_8_Conditional_9_Template, 2, 2, "button", 29);
64
+ i0.ɵɵelementEnd();
65
+ } if (rf & 2) {
66
+ const form_r4 = ctx.$implicit;
67
+ i0.ɵɵclassProp("is-current", form_r4.IsCurrent);
68
+ i0.ɵɵadvance(2);
69
+ i0.ɵɵproperty("checked", form_r4.IsCurrent);
70
+ i0.ɵɵadvance(3);
71
+ i0.ɵɵtextInterpolate(form_r4.Title);
72
+ i0.ɵɵadvance(2);
73
+ i0.ɵɵtextInterpolate1(" ", form_r4.AudienceLabel);
74
+ i0.ɵɵadvance();
75
+ i0.ɵɵconditional(form_r4.IsCurrent ? 8 : -1);
76
+ i0.ɵɵadvance();
77
+ i0.ɵɵconditional(form_r4.CanPublish || form_r4.CanChangeAudience ? 9 : -1);
78
+ } }
79
+ function MjPanelManagerComponent_Conditional_0_Conditional_13_Template(rf, ctx) { if (rf & 1) {
80
+ i0.ɵɵelementStart(0, "section", 12)(1, "div", 18)(2, "span", 19);
81
+ i0.ɵɵtext(3, "Form");
82
+ i0.ɵɵelementEnd()();
83
+ i0.ɵɵelementStart(4, "p", 20);
84
+ i0.ɵɵtext(5, "Which form you see for this entity. Switching changes only your view.");
85
+ i0.ɵɵelementEnd();
86
+ i0.ɵɵelementStart(6, "div", 21);
87
+ i0.ɵɵrepeaterCreate(7, MjPanelManagerComponent_Conditional_0_Conditional_13_For_8_Template, 10, 7, "div", 22, _forTrack1);
88
+ i0.ɵɵelementEnd()();
89
+ } if (rf & 2) {
90
+ const ctx_r1 = i0.ɵɵnextContext(2);
91
+ i0.ɵɵadvance(7);
92
+ i0.ɵɵrepeater(ctx_r1.Forms);
93
+ } }
94
+ function MjPanelManagerComponent_Conditional_0_Conditional_14_Template(rf, ctx) { if (rf & 1) {
95
+ i0.ɵɵelementStart(0, "div", 13);
96
+ i0.ɵɵelement(1, "i", 32);
97
+ i0.ɵɵelementStart(2, "p", 33);
98
+ i0.ɵɵtext(3, "Nothing is registered on this form yet");
99
+ i0.ɵɵelementEnd();
100
+ i0.ɵɵelementStart(4, "p", 34);
101
+ i0.ɵɵtext(5, "Panels you add from a conversation show up here.");
102
+ i0.ɵɵelementEnd()();
103
+ } }
104
+ function MjPanelManagerComponent_Conditional_0_For_16_Conditional_6_Template(rf, ctx) { if (rf & 1) {
105
+ i0.ɵɵelementStart(0, "p", 20);
106
+ i0.ɵɵtext(1);
107
+ i0.ɵɵelementEnd();
108
+ } if (rf & 2) {
109
+ const group_r6 = i0.ɵɵnextContext().$implicit;
110
+ i0.ɵɵadvance();
111
+ i0.ɵɵtextInterpolate(group_r6.Note);
112
+ } }
113
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_8_Template(rf, ctx) { if (rf & 1) {
114
+ i0.ɵɵelementStart(0, "span", 42);
115
+ i0.ɵɵtext(1);
116
+ i0.ɵɵelementEnd();
117
+ } if (rf & 2) {
118
+ const item_r7 = i0.ɵɵnextContext().$implicit;
119
+ i0.ɵɵadvance();
120
+ i0.ɵɵtextInterpolate(item_r7.Slot);
121
+ } }
122
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_9_Template(rf, ctx) { if (rf & 1) {
123
+ i0.ɵɵelementStart(0, "span", 43);
124
+ i0.ɵɵtext(1);
125
+ i0.ɵɵelementEnd();
126
+ } if (rf & 2) {
127
+ const item_r7 = i0.ɵɵnextContext().$implicit;
128
+ i0.ɵɵadvance();
129
+ i0.ɵɵtextInterpolate1("stands in for ", item_r7.Replaces);
130
+ } }
131
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_1_Template(rf, ctx) { if (rf & 1) {
132
+ const _r8 = i0.ɵɵgetCurrentView();
133
+ i0.ɵɵelementStart(0, "button", 49);
134
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const item_r7 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnShow(item_r7)); });
135
+ i0.ɵɵtext(1, "Show again");
136
+ i0.ɵɵelementEnd();
137
+ } }
138
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_2_Template(rf, ctx) { if (rf & 1) {
139
+ const _r9 = i0.ɵɵgetCurrentView();
140
+ i0.ɵɵelementStart(0, "button", 50);
141
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r9); const item_r7 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnEdit(item_r7)); });
142
+ i0.ɵɵtext(1, "Change where it goes");
143
+ i0.ɵɵelementEnd();
144
+ } if (rf & 2) {
145
+ const item_r7 = i0.ɵɵnextContext(2).$implicit;
146
+ const ctx_r1 = i0.ɵɵnextContext(3);
147
+ i0.ɵɵproperty("disabled", ctx_r1.Busy === item_r7.ID);
148
+ } }
149
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_3_Template(rf, ctx) { if (rf & 1) {
150
+ const _r10 = i0.ɵɵgetCurrentView();
151
+ i0.ɵɵelementStart(0, "button", 31);
152
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_3_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r10); const item_r7 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnToggle(item_r7)); });
153
+ i0.ɵɵtext(1);
154
+ i0.ɵɵelementEnd();
155
+ } if (rf & 2) {
156
+ const item_r7 = i0.ɵɵnextContext(2).$implicit;
157
+ const ctx_r1 = i0.ɵɵnextContext(3);
158
+ i0.ɵɵproperty("disabled", ctx_r1.Busy === item_r7.ID);
159
+ i0.ɵɵadvance();
160
+ i0.ɵɵtextInterpolate(ctx_r1.ToggleLabel(item_r7));
161
+ } }
162
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_4_Template(rf, ctx) { if (rf & 1) {
163
+ const _r11 = i0.ɵɵgetCurrentView();
164
+ i0.ɵɵelementStart(0, "button", 31);
165
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_4_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r11); const item_r7 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnPublishPanel(item_r7)); });
166
+ i0.ɵɵtext(1);
167
+ i0.ɵɵelementEnd();
168
+ } if (rf & 2) {
169
+ const item_r7 = i0.ɵɵnextContext(2).$implicit;
170
+ const ctx_r1 = i0.ɵɵnextContext(3);
171
+ i0.ɵɵproperty("disabled", ctx_r1.Busy === item_r7.ID);
172
+ i0.ɵɵadvance();
173
+ i0.ɵɵtextInterpolate(item_r7.CanPublish ? "Publish\u2026" : "Audience\u2026");
174
+ } }
175
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_5_Template(rf, ctx) { if (rf & 1) {
176
+ const _r12 = i0.ɵɵgetCurrentView();
177
+ i0.ɵɵelementStart(0, "button", 51);
178
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r12); const item_r7 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnHide(item_r7)); });
179
+ i0.ɵɵtext(1, "Hide for me");
180
+ i0.ɵɵelementEnd();
181
+ } }
182
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_6_Template(rf, ctx) { if (rf & 1) {
183
+ const _r13 = i0.ɵɵgetCurrentView();
184
+ i0.ɵɵelementStart(0, "button", 52);
185
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r13); const item_r7 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.OnRemove(item_r7)); });
186
+ i0.ɵɵtext(1);
187
+ i0.ɵɵelementEnd();
188
+ } if (rf & 2) {
189
+ const item_r7 = i0.ɵɵnextContext(2).$implicit;
190
+ const ctx_r1 = i0.ɵɵnextContext(3);
191
+ i0.ɵɵproperty("Variant", ctx_r1.RemoveVariant(item_r7))("disabled", ctx_r1.Busy === item_r7.ID);
192
+ i0.ɵɵadvance();
193
+ i0.ɵɵtextInterpolate(ctx_r1.RemoveLabel(item_r7));
194
+ } }
195
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Template(rf, ctx) { if (rf & 1) {
196
+ i0.ɵɵelementStart(0, "div", 44);
197
+ i0.ɵɵconditionalCreate(1, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_1_Template, 2, 0, "button", 45);
198
+ i0.ɵɵconditionalCreate(2, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_2_Template, 2, 1, "button", 46);
199
+ i0.ɵɵconditionalCreate(3, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_3_Template, 2, 2, "button", 29);
200
+ i0.ɵɵconditionalCreate(4, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_4_Template, 2, 2, "button", 29);
201
+ i0.ɵɵconditionalCreate(5, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_5_Template, 2, 0, "button", 47);
202
+ i0.ɵɵconditionalCreate(6, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Conditional_6_Template, 2, 3, "button", 48);
203
+ i0.ɵɵelementEnd();
204
+ } if (rf & 2) {
205
+ const item_r7 = i0.ɵɵnextContext().$implicit;
206
+ i0.ɵɵadvance();
207
+ i0.ɵɵconditional(item_r7.CanShow ? 1 : -1);
208
+ i0.ɵɵadvance();
209
+ i0.ɵɵconditional(item_r7.CanEdit ? 2 : -1);
210
+ i0.ɵɵadvance();
211
+ i0.ɵɵconditional(item_r7.CanTurnOn || item_r7.CanTurnOff ? 3 : -1);
212
+ i0.ɵɵadvance();
213
+ i0.ɵɵconditional(item_r7.CanPublish || item_r7.CanChangeAudience ? 4 : -1);
214
+ i0.ɵɵadvance();
215
+ i0.ɵɵconditional(item_r7.CanHide ? 5 : -1);
216
+ i0.ɵɵadvance();
217
+ i0.ɵɵconditional(item_r7.CanRemove ? 6 : -1);
218
+ } }
219
+ function MjPanelManagerComponent_Conditional_0_For_16_For_9_Template(rf, ctx) { if (rf & 1) {
220
+ i0.ɵɵelementStart(0, "div", 38);
221
+ i0.ɵɵelement(1, "i", 39);
222
+ i0.ɵɵelementStart(2, "div", 40)(3, "span", 27);
223
+ i0.ɵɵtext(4);
224
+ i0.ɵɵelementEnd();
225
+ i0.ɵɵelementStart(5, "span", 28);
226
+ i0.ɵɵtext(6);
227
+ i0.ɵɵelementEnd();
228
+ i0.ɵɵelementStart(7, "span", 41);
229
+ i0.ɵɵconditionalCreate(8, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_8_Template, 2, 1, "span", 42);
230
+ i0.ɵɵconditionalCreate(9, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_9_Template, 2, 1, "span", 43);
231
+ i0.ɵɵelementStart(10, "span", 43);
232
+ i0.ɵɵtext(11);
233
+ i0.ɵɵelementEnd();
234
+ i0.ɵɵelementStart(12, "span", 43);
235
+ i0.ɵɵtext(13);
236
+ i0.ɵɵelementEnd()()();
237
+ i0.ɵɵconditionalCreate(14, MjPanelManagerComponent_Conditional_0_For_16_For_9_Conditional_14_Template, 7, 6, "div", 44);
238
+ i0.ɵɵelementEnd();
239
+ } if (rf & 2) {
240
+ const item_r7 = ctx.$implicit;
241
+ i0.ɵɵclassProp("is-quiet", !item_r7.CanEdit);
242
+ i0.ɵɵadvance();
243
+ i0.ɵɵclassMap(item_r7.Icon);
244
+ i0.ɵɵadvance(3);
245
+ i0.ɵɵtextInterpolate(item_r7.Title);
246
+ i0.ɵɵadvance(2);
247
+ i0.ɵɵtextInterpolate(item_r7.Subtitle);
248
+ i0.ɵɵadvance(2);
249
+ i0.ɵɵconditional(item_r7.Slot ? 8 : -1);
250
+ i0.ɵɵadvance();
251
+ i0.ɵɵconditional(item_r7.Replaces ? 9 : -1);
252
+ i0.ɵɵadvance(2);
253
+ i0.ɵɵtextInterpolate(item_r7.AudienceLabel);
254
+ i0.ɵɵadvance();
255
+ i0.ɵɵclassProp("mj-pm-chip--on", item_r7.State === "active");
256
+ i0.ɵɵadvance();
257
+ i0.ɵɵtextInterpolate(item_r7.StateLabel);
258
+ i0.ɵɵadvance();
259
+ i0.ɵɵconditional(item_r7.CanEdit || item_r7.CanTurnOn || item_r7.CanTurnOff || item_r7.CanRemove || item_r7.CanHide || item_r7.CanShow || item_r7.CanPublish || item_r7.CanChangeAudience ? 14 : -1);
260
+ } }
261
+ function MjPanelManagerComponent_Conditional_0_For_16_Template(rf, ctx) { if (rf & 1) {
262
+ i0.ɵɵelementStart(0, "section", 12)(1, "div", 18)(2, "span", 19);
263
+ i0.ɵɵtext(3);
264
+ i0.ɵɵelementEnd();
265
+ i0.ɵɵelementStart(4, "span", 35);
266
+ i0.ɵɵtext(5);
267
+ i0.ɵɵelementEnd()();
268
+ i0.ɵɵconditionalCreate(6, MjPanelManagerComponent_Conditional_0_For_16_Conditional_6_Template, 2, 1, "p", 20);
269
+ i0.ɵɵelementStart(7, "div", 36);
270
+ i0.ɵɵrepeaterCreate(8, MjPanelManagerComponent_Conditional_0_For_16_For_9_Template, 15, 13, "div", 37, _forTrack2);
271
+ i0.ɵɵelementEnd()();
272
+ } if (rf & 2) {
273
+ const group_r6 = ctx.$implicit;
274
+ i0.ɵɵadvance(3);
275
+ i0.ɵɵtextInterpolate(group_r6.Title);
276
+ i0.ɵɵadvance(2);
277
+ i0.ɵɵtextInterpolate(group_r6.Items.length);
278
+ i0.ɵɵadvance();
279
+ i0.ɵɵconditional(group_r6.Note ? 6 : -1);
280
+ i0.ɵɵadvance(2);
281
+ i0.ɵɵrepeater(group_r6.Items);
282
+ } }
283
+ function MjPanelManagerComponent_Conditional_0_Conditional_20_For_7_Template(rf, ctx) { if (rf & 1) {
284
+ const _r15 = i0.ɵɵgetCurrentView();
285
+ i0.ɵɵelementStart(0, "label", 61)(1, "input", 62);
286
+ i0.ɵɵlistener("change", function MjPanelManagerComponent_Conditional_0_Conditional_20_For_7_Template_input_change_1_listener() { const scope_r16 = i0.ɵɵrestoreView(_r15).$implicit; const target_r17 = i0.ɵɵnextContext(); return i0.ɵɵresetView(target_r17.Scope = scope_r16); });
287
+ i0.ɵɵelementEnd();
288
+ i0.ɵɵelementStart(2, "span");
289
+ i0.ɵɵtext(3);
290
+ i0.ɵɵelementEnd()();
291
+ } if (rf & 2) {
292
+ const scope_r16 = ctx.$implicit;
293
+ const target_r17 = i0.ɵɵnextContext();
294
+ const ctx_r1 = i0.ɵɵnextContext(2);
295
+ i0.ɵɵclassProp("is-on", target_r17.Scope === scope_r16);
296
+ i0.ɵɵadvance();
297
+ i0.ɵɵproperty("checked", target_r17.Scope === scope_r16);
298
+ i0.ɵɵadvance(2);
299
+ i0.ɵɵtextInterpolate(ctx_r1.AudienceOption(scope_r16));
300
+ } }
301
+ function MjPanelManagerComponent_Conditional_0_Conditional_20_Conditional_8_For_4_Template(rf, ctx) { if (rf & 1) {
302
+ i0.ɵɵelementStart(0, "option", 65);
303
+ i0.ɵɵtext(1);
304
+ i0.ɵɵelementEnd();
305
+ } if (rf & 2) {
306
+ const role_r19 = ctx.$implicit;
307
+ i0.ɵɵproperty("value", role_r19.ID);
308
+ i0.ɵɵadvance();
309
+ i0.ɵɵtextInterpolate(role_r19.Name);
310
+ } }
311
+ function MjPanelManagerComponent_Conditional_0_Conditional_20_Conditional_8_Template(rf, ctx) { if (rf & 1) {
312
+ const _r18 = i0.ɵɵgetCurrentView();
313
+ i0.ɵɵelementStart(0, "select", 63);
314
+ i0.ɵɵlistener("change", function MjPanelManagerComponent_Conditional_0_Conditional_20_Conditional_8_Template_select_change_0_listener($event) { i0.ɵɵrestoreView(_r18); const target_r17 = i0.ɵɵnextContext(); return i0.ɵɵresetView(target_r17.RoleID = $event.target.value || null); });
315
+ i0.ɵɵelementStart(1, "option", 64);
316
+ i0.ɵɵtext(2, "Choose a role\u2026");
317
+ i0.ɵɵelementEnd();
318
+ i0.ɵɵrepeaterCreate(3, MjPanelManagerComponent_Conditional_0_Conditional_20_Conditional_8_For_4_Template, 2, 2, "option", 65, _forTrack2);
319
+ i0.ɵɵelementEnd();
320
+ } if (rf & 2) {
321
+ const target_r17 = i0.ɵɵnextContext();
322
+ const ctx_r1 = i0.ɵɵnextContext(2);
323
+ i0.ɵɵproperty("value", target_r17.RoleID ?? "");
324
+ i0.ɵɵadvance(3);
325
+ i0.ɵɵrepeater(ctx_r1.RoleOptions);
326
+ } }
327
+ function MjPanelManagerComponent_Conditional_0_Conditional_20_Template(rf, ctx) { if (rf & 1) {
328
+ const _r14 = i0.ɵɵgetCurrentView();
329
+ i0.ɵɵelementStart(0, "div", 16)(1, "div", 5);
330
+ i0.ɵɵtext(2, "Who sees it");
331
+ i0.ɵɵelementEnd();
332
+ i0.ɵɵelementStart(3, "p", 53);
333
+ i0.ɵɵtext(4);
334
+ i0.ɵɵelementEnd();
335
+ i0.ɵɵelementStart(5, "div", 54);
336
+ i0.ɵɵrepeaterCreate(6, MjPanelManagerComponent_Conditional_0_Conditional_20_For_7_Template, 4, 4, "label", 55, i0.ɵɵrepeaterTrackByIdentity);
337
+ i0.ɵɵelementEnd();
338
+ i0.ɵɵconditionalCreate(8, MjPanelManagerComponent_Conditional_0_Conditional_20_Conditional_8_Template, 5, 1, "select", 56);
339
+ i0.ɵɵelementStart(9, "p", 57);
340
+ i0.ɵɵtext(10);
341
+ i0.ɵɵelementEnd();
342
+ i0.ɵɵelementStart(11, "div", 58)(12, "button", 59);
343
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_Conditional_20_Template_button_click_12_listener() { i0.ɵɵrestoreView(_r14); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.ConfirmAudience()); });
344
+ i0.ɵɵtext(13, "Save audience");
345
+ i0.ɵɵelementEnd();
346
+ i0.ɵɵelementStart(14, "button", 60);
347
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_Conditional_20_Template_button_click_14_listener() { i0.ɵɵrestoreView(_r14); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.CancelAudience()); });
348
+ i0.ɵɵtext(15, "Cancel");
349
+ i0.ɵɵelementEnd()()();
350
+ } if (rf & 2) {
351
+ const target_r17 = ctx;
352
+ const ctx_r1 = i0.ɵɵnextContext(2);
353
+ i0.ɵɵadvance(4);
354
+ i0.ɵɵtextInterpolate(target_r17.Title);
355
+ i0.ɵɵadvance(2);
356
+ i0.ɵɵrepeater(i0.ɵɵpureFunction0(4, _c0));
357
+ i0.ɵɵadvance(2);
358
+ i0.ɵɵconditional(target_r17.Scope === "Role" ? 8 : -1);
359
+ i0.ɵɵadvance(2);
360
+ i0.ɵɵtextInterpolate(ctx_r1.AudienceConsequence);
361
+ i0.ɵɵadvance(2);
362
+ i0.ɵɵproperty("disabled", !ctx_r1.CanConfirmAudience);
363
+ } }
364
+ function MjPanelManagerComponent_Conditional_0_Conditional_21_Template(rf, ctx) { if (rf & 1) {
365
+ const _r20 = i0.ɵɵgetCurrentView();
366
+ i0.ɵɵelementStart(0, "div", 66);
367
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_Conditional_21_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnEditScrimClick($event)); });
368
+ i0.ɵɵelementStart(1, "mj-form-placement-dialog", 67);
369
+ i0.ɵɵlistener("Applied", function MjPanelManagerComponent_Conditional_0_Conditional_21_Template_mj_form_placement_dialog_Applied_1_listener($event) { i0.ɵɵrestoreView(_r20); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnEditApplied($event)); })("Cancelled", function MjPanelManagerComponent_Conditional_0_Conditional_21_Template_mj_form_placement_dialog_Cancelled_1_listener() { i0.ɵɵrestoreView(_r20); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.CloseEdit()); });
370
+ i0.ɵɵelementEnd()();
371
+ } if (rf & 2) {
372
+ const ctx_r1 = i0.ɵɵnextContext(2);
373
+ i0.ɵɵadvance();
374
+ i0.ɵɵproperty("Provider", ctx_r1.Provider)("Context", ctx_r1.EditContext)("Proposal", ctx_r1.EditProposal)("ComponentName", ctx_r1.Editing.Title)("SeedState", ctx_r1.SeedEdit)("RecordKey", ctx_r1.RecordKey)("ReplacesRowID", ctx_r1.Editing.ID)("PanelComponentID", ctx_r1.EditComponentID)("VisibleTo", ctx_r1.EditVisibleTo)("OfferKeepOff", ctx_r1.EditStatus === "Inactive");
375
+ } }
376
+ function MjPanelManagerComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
377
+ const _r1 = i0.ɵɵgetCurrentView();
378
+ i0.ɵɵelementStart(0, "div", 1);
379
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnOverlayClick($event)); });
380
+ i0.ɵɵelementStart(1, "div", 2);
381
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_Template_div_click_1_listener($event) { return $event.stopPropagation(); });
382
+ i0.ɵɵelementStart(2, "div", 3)(3, "div", 4)(4, "div", 5);
383
+ i0.ɵɵtext(5, "Manage this form");
384
+ i0.ɵɵelementEnd();
385
+ i0.ɵɵelementStart(6, "h3", 6);
386
+ i0.ɵɵtext(7);
387
+ i0.ɵɵelementEnd()();
388
+ i0.ɵɵelementStart(8, "button", 7);
389
+ i0.ɵɵlistener("click", function MjPanelManagerComponent_Conditional_0_Template_button_click_8_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnClose()); });
390
+ i0.ɵɵelement(9, "i", 8);
391
+ i0.ɵɵelementEnd()();
392
+ i0.ɵɵconditionalCreate(10, MjPanelManagerComponent_Conditional_0_Conditional_10_Template, 2, 0, "p", 9);
393
+ i0.ɵɵconditionalCreate(11, MjPanelManagerComponent_Conditional_0_Conditional_11_Template, 2, 1, "p", 10);
394
+ i0.ɵɵelementStart(12, "div", 11);
395
+ i0.ɵɵconditionalCreate(13, MjPanelManagerComponent_Conditional_0_Conditional_13_Template, 9, 0, "section", 12);
396
+ i0.ɵɵconditionalCreate(14, MjPanelManagerComponent_Conditional_0_Conditional_14_Template, 6, 0, "div", 13);
397
+ i0.ɵɵrepeaterCreate(15, MjPanelManagerComponent_Conditional_0_For_16_Template, 10, 3, "section", 12, _forTrack0);
398
+ i0.ɵɵelementEnd();
399
+ i0.ɵɵelementStart(17, "div", 14)(18, "span", 15);
400
+ i0.ɵɵtext(19);
401
+ i0.ɵɵelementEnd()();
402
+ i0.ɵɵconditionalCreate(20, MjPanelManagerComponent_Conditional_0_Conditional_20_Template, 16, 5, "div", 16);
403
+ i0.ɵɵconditionalCreate(21, MjPanelManagerComponent_Conditional_0_Conditional_21_Template, 2, 10, "div", 17);
404
+ i0.ɵɵelementEnd()();
405
+ } if (rf & 2) {
406
+ let tmp_8_0;
407
+ const ctx_r1 = i0.ɵɵnextContext();
408
+ i0.ɵɵadvance(7);
409
+ i0.ɵɵtextInterpolate(ctx_r1.EntityName);
410
+ i0.ɵɵadvance(3);
411
+ i0.ɵɵconditional(ctx_r1.FullCustomForm ? 10 : -1);
412
+ i0.ɵɵadvance();
413
+ i0.ɵɵconditional(ctx_r1.Error ? 11 : -1);
414
+ i0.ɵɵadvance(2);
415
+ i0.ɵɵconditional(ctx_r1.HasCustomForms ? 13 : -1);
416
+ i0.ɵɵadvance();
417
+ i0.ɵɵconditional(ctx_r1.IsEmpty ? 14 : -1);
418
+ i0.ɵɵadvance();
419
+ i0.ɵɵrepeater(ctx_r1.Groups);
420
+ i0.ɵɵadvance(4);
421
+ i0.ɵɵtextInterpolate(ctx_r1.Summary);
422
+ i0.ɵɵadvance();
423
+ i0.ɵɵconditional((tmp_8_0 = ctx_r1.Publishing) ? 20 : -1, tmp_8_0);
424
+ i0.ɵɵadvance();
425
+ i0.ɵɵconditional(ctx_r1.Editing && ctx_r1.EditContext ? 21 : -1);
426
+ } }
427
+ /**
428
+ * "Manage this form" — the one place to manage what is on an entity's form.
429
+ *
430
+ * Lists the full custom forms available to the user and the panels on the form, grouped by who
431
+ * each belongs to, because that decides what the user may do: anything to their own, hide what
432
+ * is shared with them, nothing to a grid a relationship draws. Holders of the Manage Form
433
+ * Defaults authorization also get Publish and Audience, which change what other people see.
434
+ *
435
+ * Every write goes through the admin service to the server, where the entity subclasses enforce
436
+ * the same rule this drawer uses to decide what to draw.
437
+ */
438
+ export class MjPanelManagerComponent {
439
+ cdr = inject(ChangeDetectorRef);
440
+ admin = inject(FormPanelAdminService);
441
+ probe = inject(FormSlotProbeService);
442
+ host = inject(ElementRef);
443
+ /** What held focus before the drawer opened, and gets it back when the drawer closes. */
444
+ drawerOpener = null;
445
+ /** What held focus before the placement dialog or the audience chooser opened over the list. */
446
+ layerOpener = null;
447
+ /** True while the drawer is open and holds the keyboard. Off before focus goes back out on close. */
448
+ trapping = false;
449
+ Visible = false;
450
+ /** The entity whose form is being managed. */
451
+ Entity = null;
452
+ /** Compiled `BaseFormPanel` registrations on this entity, for the inventory. */
453
+ Compiled = [];
454
+ /** Relationships the container fills a grid in for. */
455
+ StockGrids = [];
456
+ /** Whether a full custom form owns this body, which holds everything else back. */
457
+ FullCustomForm = false;
458
+ /** Section and rail titles by key, so a claim reads as a name. */
459
+ TitleByKey = new Map();
460
+ /** Related grids on this form, so editing can still offer to take one over. */
461
+ Related = [];
462
+ Provider = null;
463
+ /** The full custom forms the toolbar picker offers, in its order. */
464
+ Variants = [];
465
+ /** The form this user sees now; null when it is the generated form. */
466
+ CurrentFormID = null;
467
+ /** The record the form is showing, for the placement dialog's preview. Null for a new record. */
468
+ RecordKey = null;
469
+ /** A row was switched or removed, so the form has to resolve again. */
470
+ Changed = new EventEmitter();
471
+ /** The user chose a different full custom form, or the generated form (null). */
472
+ FormChosen = new EventEmitter();
473
+ Closed = new EventEmitter();
474
+ Items = [];
475
+ /** The full custom forms and the generated form, for the Form group. */
476
+ Forms = [];
477
+ /** Whether this user may publish to a role or to everyone. */
478
+ CanPublish = false;
479
+ /** The item whose audience is being chosen, or null. */
480
+ Publishing = null;
481
+ /** The list, under headings. */
482
+ Groups = [];
483
+ /** The row being re-placed, or null. */
484
+ Editing = null;
485
+ /** What the placement dialog opens on while editing. */
486
+ EditContext = null;
487
+ /** The component the panel being edited renders, for the placement preview. */
488
+ EditComponentID = null;
489
+ EditProposal = null;
490
+ /** Who sees the panel being edited, for the placement dialog to state. */
491
+ EditVisibleTo = DescribeVisibleTo('User');
492
+ /** What the panel being edited is now: on, a draft, or off. */
493
+ EditStatus = 'Active';
494
+ /** ID of the row a write is running on, so only its buttons go quiet. */
495
+ Busy = null;
496
+ /** ID of the row awaiting a second press to confirm removal. */
497
+ Confirming = null;
498
+ Error = '';
499
+ ngOnChanges(changes) {
500
+ if (changes['Visible'] && this.Visible) {
501
+ this.drawerOpener = this.focusedElement();
502
+ this.trapping = true;
503
+ this.Refresh();
504
+ this.focusLater('.mj-pm-close');
505
+ }
506
+ else if (changes['Visible'] && !changes['Visible'].firstChange) {
507
+ this.trapping = false;
508
+ this.restoreFocus('drawer');
509
+ }
510
+ else if (changes['Entity'] || changes['Compiled'] || changes['StockGrids'] || changes['FullCustomForm']
511
+ || changes['Variants'] || changes['CurrentFormID']) {
512
+ this.Refresh();
513
+ }
514
+ }
515
+ get Summary() {
516
+ return SummarizeInventory(this.Items);
517
+ }
518
+ get EntityName() {
519
+ return this.Entity?.Name ?? '';
520
+ }
521
+ get IsEmpty() {
522
+ return this.Items.length === 0;
523
+ }
524
+ /** Whether there is more than the generated form to choose from. */
525
+ get HasCustomForms() {
526
+ return this.Forms.length > 1;
527
+ }
528
+ /** Rebuild the list from the engine's current rows. */
529
+ Refresh() {
530
+ const provider = this.provider;
531
+ const user = provider?.CurrentUser;
532
+ this.CanPublish = this.admin.CanPublish(provider);
533
+ this.rows = this.admin.RowsForEntity(this.Entity);
534
+ this.Items = BuildPanelInventory({
535
+ Contributions: this.rows,
536
+ Compiled: this.Compiled,
537
+ StockGrids: this.StockGrids,
538
+ FullCustomForm: this.FullCustomForm,
539
+ TitleByKey: this.TitleByKey,
540
+ CallerID: user?.ID ?? '',
541
+ CallerRoleIDs: (user?.UserRoles ?? []).map((r) => r.RoleID).filter((id) => !!id),
542
+ CanPublish: this.CanPublish,
543
+ HiddenKeys: this.EntityName ? HiddenPanelKeys(this.EntityName) : [],
544
+ Rendering: this.admin.RenderingFor(this.Entity, provider),
545
+ });
546
+ this.Groups = GroupPanelInventory(this.Items);
547
+ this.Forms = BuildFormItems({
548
+ Variants: this.Variants,
549
+ Overrides: this.admin.OverridesForEntity(this.Entity),
550
+ CurrentFormID: this.CurrentFormID,
551
+ CanPublish: this.CanPublish,
552
+ });
553
+ this.cdr.markForCheck();
554
+ }
555
+ get provider() {
556
+ return this.Provider ?? Metadata.Provider ?? null;
557
+ }
558
+ /** The rows behind the list, so an edit can read the placement back. */
559
+ rows = [];
560
+ /**
561
+ * Open the placement dialog on a row that is already on the form.
562
+ *
563
+ * Editing in place is what "remove it and add it again" was standing in for. The
564
+ * dialog probes the form for itself, so the only context assembled here is what a
565
+ * probe cannot know: the related grids and the other panels already installed.
566
+ */
567
+ OnEdit(item) {
568
+ if (!item.CanEdit)
569
+ return;
570
+ const row = this.rows.find((candidate) => UUIDsEqual(candidate.ID, item.ID));
571
+ if (!row)
572
+ return;
573
+ const spec = proposalFromRow(row);
574
+ const context = {
575
+ EntityName: this.Entity?.Name ?? '',
576
+ Sections: [],
577
+ Related: this.Related,
578
+ // A panel cannot be asked to stand in for itself.
579
+ // Keyed by contribution key, which is what replacing one writes and what the form draws.
580
+ Existing: this.Items
581
+ .filter((other) => other.Origin === 'contribution' && other.ID !== item.ID)
582
+ .map((other) => this.existingFrom(other.ID, other.Slot, other.Title))
583
+ .filter((other) => other.Key.length > 0),
584
+ SlotsPresent: [],
585
+ SlotsVerified: false,
586
+ Layout: 'accordion',
587
+ Rail: [],
588
+ FullCustomForm: this.FullCustomForm,
589
+ TargetsVerified: false,
590
+ };
591
+ this.Editing = item;
592
+ this.EditProposal = spec;
593
+ this.EditContext = context;
594
+ this.EditComponentID = row.ComponentID || null;
595
+ this.EditVisibleTo = DescribeVisibleTo(row.Scope, row.Role);
596
+ this.EditStatus = lifecycleStatus(row.Status);
597
+ this.Error = '';
598
+ this.layerOpener = this.focusedElement();
599
+ this.cdr.markForCheck();
600
+ this.focusLater('.mj-pm-edit');
601
+ }
602
+ /**
603
+ * Seed the dialog with the row's own placement rather than a blank one.
604
+ *
605
+ * Recomputed against the dialog's context each time it asks, not replayed: the dialog
606
+ * probes the form after it opens, so the first seed runs against a context with no
607
+ * sections, slots or rail in it and a stored claim would not match anything yet.
608
+ */
609
+ SeedEdit = (dialog) => {
610
+ if (!this.EditProposal || !this.Editing)
611
+ return;
612
+ dialog.State = PlacementStateFromContribution(this.EditProposal, dialog.Context, this.EditStatus === 'Active', this.EditStatus === 'Inactive');
613
+ };
614
+ async OnEditApplied(decision) {
615
+ const item = this.Editing;
616
+ const existing = this.EditContext?.Existing ?? [];
617
+ this.CloseEdit();
618
+ if (!item)
619
+ return;
620
+ const row = this.rows.find((candidate) => UUIDsEqual(candidate.ID, item.ID));
621
+ const contribution = row ? KeepEditedRowKey(decision.Contribution, row, existing) : decision.Contribution;
622
+ const status = decision.ActivateNow ? 'Active' : decision.KeepOff ? 'Inactive' : 'Pending';
623
+ await this.run(item.ID, () => this.admin.SetPlacement(item.ID, contribution, status, this.Provider));
624
+ }
625
+ /** Clicking the backdrop closes the dialog; clicking the dialog itself does not. */
626
+ OnEditScrimClick(event) {
627
+ if (event.target === event.currentTarget)
628
+ this.CloseEdit();
629
+ }
630
+ /** A contribution row as the placement dialog lists it: its key, position and order. */
631
+ existingFrom(rowID, slot, title) {
632
+ const row = this.rows.find((candidate) => UUIDsEqual(candidate.ID, rowID));
633
+ return {
634
+ Key: this.contributionKeyOf(rowID),
635
+ Slot: slot,
636
+ Title: title,
637
+ SortKey: row?.SortKey ?? 0,
638
+ InSectionKey: row?.InSectionKey ?? null,
639
+ SectionPosition: row?.SectionPosition ?? null,
640
+ FieldNames: row?.ReplacesFieldNames ?? [],
641
+ SectionKeys: row ? (row.ReplacesSectionKeys.length > 0 ? row.ReplacesSectionKeys : [row.ReplacesSectionKey ?? ''].filter(Boolean)) : [],
642
+ ReplacesPlace: !!(row?.ReplacesSectionKey || row?.ReplacesSectionKeys.length || row?.RelatedEntity),
643
+ };
644
+ }
645
+ /** A contribution row's key, or empty when the row has none. */
646
+ contributionKeyOf(rowID) {
647
+ return (this.rows.find((row) => UUIDsEqual(row.ID, rowID))?.ContributionKey ?? '').trim();
648
+ }
649
+ CloseEdit() {
650
+ const wasOpen = this.Editing !== null;
651
+ this.Editing = null;
652
+ this.EditContext = null;
653
+ this.EditProposal = null;
654
+ this.EditComponentID = null;
655
+ this.cdr.markForCheck();
656
+ if (wasOpen)
657
+ this.restoreFocus('layer');
658
+ }
659
+ async OnToggle(item) {
660
+ if (this.Busy || (!item.CanTurnOn && !item.CanTurnOff))
661
+ return;
662
+ await this.run(item.ID, () => this.admin.SetActive(item.ID, item.CanTurnOn, this.Provider));
663
+ }
664
+ /**
665
+ * Removal takes two presses on the same button rather than a second dialog. The drawer
666
+ * is already over the form, and a confirm dialog over a drawer over a form leaves the
667
+ * user two layers from the thing they are changing.
668
+ */
669
+ async OnRemove(item) {
670
+ if (this.Busy || !item.CanRemove)
671
+ return;
672
+ if (!UUIDsEqual(this.Confirming, item.ID)) {
673
+ this.Confirming = item.ID;
674
+ this.cdr.markForCheck();
675
+ return;
676
+ }
677
+ this.Confirming = null;
678
+ await this.run(item.ID, () => this.admin.Remove(item.ID, this.Provider));
679
+ }
680
+ /** Quiet until the first press; solid red while it waits for the second. */
681
+ RemoveVariant(item) {
682
+ return UUIDsEqual(this.Confirming, item.ID) ? 'danger' : 'flat';
683
+ }
684
+ RemoveLabel(item) {
685
+ if (!UUIDsEqual(this.Confirming, item.ID))
686
+ return 'Remove';
687
+ return item.Audience === 'yours' ? 'Really remove?' : 'Remove for everyone?';
688
+ }
689
+ ToggleLabel(item) {
690
+ return item.CanTurnOn ? 'Turn on' : 'Turn off';
691
+ }
692
+ /** Hide a panel for this user. Nobody else is affected. */
693
+ OnHide(item) {
694
+ if (!item.CanHide || !item.HideKey || !this.EntityName)
695
+ return;
696
+ this.admin.Hide(this.EntityName, item.HideKey);
697
+ this.afterChange();
698
+ }
699
+ /** Bring back a panel this user hid. */
700
+ OnShow(item) {
701
+ if (!item.CanShow || !item.HideKey || !this.EntityName)
702
+ return;
703
+ this.admin.Show(this.EntityName, item.HideKey);
704
+ this.afterChange();
705
+ }
706
+ /** Switch to another full custom form, or back to the generated form. */
707
+ OnUseForm(form) {
708
+ if (form.IsCurrent)
709
+ return;
710
+ this.FormChosen.emit(form.ID);
711
+ }
712
+ /** Open the audience chooser on a panel. */
713
+ OnPublishPanel(item) {
714
+ if (!item.CanPublish && !item.CanChangeAudience)
715
+ return;
716
+ const row = this.rows.find((r) => UUIDsEqual(r.ID, item.ID));
717
+ if (!row)
718
+ return;
719
+ this.openAudience({ Kind: 'panel', ID: item.ID, Title: item.Title, Status: row.Status, Scope: row.Scope, RoleID: row.RoleID });
720
+ }
721
+ /** Open the audience chooser on a full custom form. */
722
+ OnPublishForm(form) {
723
+ if (!form.ID || (!form.CanPublish && !form.CanChangeAudience))
724
+ return;
725
+ const row = this.admin.OverridesForEntity(this.Entity).find((r) => UUIDsEqual(r.ID, form.ID));
726
+ this.openAudience({
727
+ Kind: 'form', ID: form.ID, Title: form.Title, Status: row?.Status ?? 'Active',
728
+ Scope: (row?.Scope ?? 'User'), RoleID: row?.RoleID ?? null,
729
+ });
730
+ }
731
+ openAudience(target) {
732
+ this.Publishing = target;
733
+ this.Error = '';
734
+ this.layerOpener = this.focusedElement();
735
+ this.cdr.markForCheck();
736
+ this.focusLater('.mj-pm-audience');
737
+ }
738
+ /** The roles a holder may publish to. */
739
+ get RoleOptions() {
740
+ return (this.provider?.Roles ?? [])
741
+ .map((role) => ({ ID: role.ID, Name: role.Name }))
742
+ .sort((a, b) => a.Name.localeCompare(b.Name));
743
+ }
744
+ /**
745
+ * What publishing will do, stated before it is done.
746
+ *
747
+ * Changing what other people see should never be a surprise, so the consequence is spelled
748
+ * out in the terms the publisher chose — which people, and on which records. Publishing turns
749
+ * the item on, so a draft or an item that is off says it will go live.
750
+ */
751
+ get AudienceConsequence() {
752
+ const target = this.Publishing;
753
+ if (!target)
754
+ return '';
755
+ const role = this.RoleOptions.find((r) => UUIDsEqual(r.ID, target.RoleID))?.Name;
756
+ if (target.Scope === 'Role' && !role)
757
+ return 'Choose a role.';
758
+ const what = target.Kind === 'form' ? 'this form' : 'this panel';
759
+ const records = `every ${this.EntityName} record`;
760
+ const forWhom = target.Scope === 'User' ? 'you only' : target.Scope === 'Global' ? 'everyone' : `everyone in ${role}`;
761
+ if (target.Status === 'Pending')
762
+ return `This draft will go live for ${forWhom}, on ${records}.`;
763
+ if (target.Status === 'Inactive') {
764
+ const state = target.Kind === 'form' ? 'This form is set aside' : 'This panel is off';
765
+ return `${state}. It will go live for ${forWhom}, on ${records}.`;
766
+ }
767
+ if (target.Scope === 'User')
768
+ return `Only you will see ${what}, on ${records}.`;
769
+ if (target.Scope === 'Global')
770
+ return `Everyone will see ${what} on ${records}.`;
771
+ return `Everyone in ${role} will see ${what} on ${records}.`;
772
+ }
773
+ /** Whether the chosen audience is complete enough to publish. */
774
+ get CanConfirmAudience() {
775
+ return !!this.Publishing && (this.Publishing.Scope !== 'Role' || !!this.Publishing.RoleID);
776
+ }
777
+ /**
778
+ * Publishes with the chosen audience. The Publish button that opened the chooser is disabled
779
+ * while the write runs, so focus waits on the drawer and goes back to the button afterwards,
780
+ * when it is still there and enabled.
781
+ */
782
+ async ConfirmAudience() {
783
+ const target = this.Publishing;
784
+ if (!target || !this.CanConfirmAudience)
785
+ return;
786
+ this.Publishing = null;
787
+ const opener = this.layerOpener;
788
+ this.layerOpener = null;
789
+ this.drawerElement()?.focus();
790
+ const audience = { Scope: target.Scope, RoleID: target.RoleID };
791
+ await this.run(target.ID, () => target.Kind === 'form'
792
+ ? this.admin.PublishOverride(target.ID, audience, this.Provider)
793
+ : this.admin.PublishContribution(target.ID, audience, this.Provider), opener);
794
+ }
795
+ CancelAudience() {
796
+ this.Publishing = null;
797
+ this.cdr.markForCheck();
798
+ this.restoreFocus('layer');
799
+ }
800
+ /** The audience label for a scope, as the chooser's options read it. */
801
+ AudienceOption(scope) {
802
+ return scope === 'Role' ? 'A role' : DescribeAudience(scope);
803
+ }
804
+ OnClose() {
805
+ this.Confirming = null;
806
+ this.Publishing = null;
807
+ this.Error = '';
808
+ this.CloseEdit();
809
+ this.layerOpener = null;
810
+ this.trapping = false;
811
+ this.restoreFocus('drawer');
812
+ this.Closed.emit();
813
+ }
814
+ OnOverlayClick(event) {
815
+ if (event.target === event.currentTarget)
816
+ this.OnClose();
817
+ }
818
+ /**
819
+ * Keys pressed anywhere while the drawer is open, so they still reach it when the focused
820
+ * button was removed or disabled and focus fell to the page. Escape closes the top layer: the
821
+ * placement dialog, then the audience chooser, then the drawer. Tab and Shift+Tab wrap at the
822
+ * ends of that layer and bring focus back into it. Keys pressed in another overlay or modal,
823
+ * such as the icon picker's grid, are left to it.
824
+ */
825
+ OnKeydown(event) {
826
+ if (!this.trapping || event.defaultPrevented || !this.drawerShown() || this.belongsElsewhere(event.target))
827
+ return;
828
+ if (event.key === 'Escape') {
829
+ event.preventDefault();
830
+ if (this.Editing)
831
+ this.CloseEdit();
832
+ else if (this.Publishing)
833
+ this.CancelAudience();
834
+ else
835
+ this.OnClose();
836
+ return;
837
+ }
838
+ if (event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey)
839
+ this.keepFocusInside(event);
840
+ }
841
+ /** Focus that moves to the page behind the drawer is brought back into it. */
842
+ OnFocusIn(event) {
843
+ if (!this.trapping || !this.drawerShown() || this.belongsElsewhere(event.target))
844
+ return;
845
+ if (event.target instanceof Node && this.host.nativeElement.contains(event.target))
846
+ return;
847
+ this.focusTopLayer();
848
+ }
849
+ /**
850
+ * True for an element outside the drawer that another overlay or modal owns: a CDK overlay
851
+ * (the icon picker's grid) or a dialog marked `aria-modal`. Those handle their own keys and focus.
852
+ */
853
+ belongsElsewhere(target) {
854
+ if (!(target instanceof Element) || this.host.nativeElement.contains(target))
855
+ return false;
856
+ return !!target.closest('.cdk-overlay-container, [aria-modal="true"]');
857
+ }
858
+ /** Wraps Tab at the first and last stop of the top layer, and brings focus back into it. */
859
+ keepFocusInside(event) {
860
+ const layer = this.topLayer();
861
+ if (!layer)
862
+ return;
863
+ const stops = tabStops(layer);
864
+ const active = this.focusedElement();
865
+ if (stops.length === 0) {
866
+ event.preventDefault();
867
+ layer.focus();
868
+ return;
869
+ }
870
+ const first = stops[0];
871
+ const last = stops[stops.length - 1];
872
+ const current = active ? stopOf(active, stops) : null;
873
+ if (!active || !layer.contains(active)) {
874
+ event.preventDefault();
875
+ (event.shiftKey ? last : first).focus();
876
+ }
877
+ else if (event.shiftKey && (current === first || active === layer)) {
878
+ event.preventDefault();
879
+ last.focus();
880
+ }
881
+ else if (!event.shiftKey && current === last) {
882
+ event.preventDefault();
883
+ first.focus();
884
+ }
885
+ }
886
+ /**
887
+ * Puts focus back inside the drawer when it is not there: on the drawer itself, or on the first
888
+ * stop of the placement dialog or audience chooser when one is open.
889
+ */
890
+ focusTopLayer() {
891
+ const layer = this.topLayer();
892
+ if (!layer)
893
+ return;
894
+ const target = layer.hasAttribute('tabindex') ? layer : tabStops(layer)[0] ?? null;
895
+ target?.focus();
896
+ }
897
+ /**
898
+ * After the list redraws, keeps focus in the drawer. A write or a hide can remove or disable
899
+ * the focused button, which drops focus to the page. `preferred` gets focus back when it is
900
+ * still there and enabled.
901
+ */
902
+ refocusAfterRender(preferred = null) {
903
+ setTimeout(() => {
904
+ if (!this.trapping)
905
+ return;
906
+ if (preferred?.isConnected && !isDisabled(preferred)) {
907
+ preferred.focus();
908
+ return;
909
+ }
910
+ const active = this.focusedElement();
911
+ if (active && this.host.nativeElement.contains(active) && !isDisabled(active))
912
+ return;
913
+ if (this.belongsElsewhere(active))
914
+ return;
915
+ this.focusTopLayer();
916
+ }, 0);
917
+ }
918
+ drawerElement() {
919
+ return this.host.nativeElement.querySelector('.mj-pm-drawer');
920
+ }
921
+ /**
922
+ * Whether the drawer is on screen. A drawer left open on a tab that is now in the background
923
+ * is still in the page, hidden, and must not take keys or focus from the tab in front.
924
+ */
925
+ drawerShown() {
926
+ const drawer = this.drawerElement();
927
+ if (!drawer)
928
+ return false;
929
+ return typeof drawer.checkVisibility === 'function' ? drawer.checkVisibility() : true;
930
+ }
931
+ /** The layer that holds focus: the placement dialog, else the audience chooser, else the drawer. */
932
+ topLayer() {
933
+ const root = this.host.nativeElement;
934
+ return root.querySelector('.mj-pm-edit')
935
+ ?? root.querySelector('.mj-pm-audience')
936
+ ?? root.querySelector('.mj-pm-drawer');
937
+ }
938
+ /** Moves focus to the first stop inside `selector` once the view has drawn it. */
939
+ focusLater(selector) {
940
+ setTimeout(() => {
941
+ const target = this.host.nativeElement.querySelector(selector);
942
+ if (!target)
943
+ return;
944
+ const stop = target.matches(TAB_STOPS) ? target : tabStops(target)[0];
945
+ (stop ?? target).focus();
946
+ }, 0);
947
+ }
948
+ /** Gives focus back to what held it before the drawer, or one of its layers, opened. */
949
+ restoreFocus(which) {
950
+ const opener = which === 'drawer' ? this.drawerOpener : this.layerOpener;
951
+ if (which === 'drawer')
952
+ this.drawerOpener = null;
953
+ else
954
+ this.layerOpener = null;
955
+ if (opener?.isConnected)
956
+ opener.focus();
957
+ }
958
+ focusedElement() {
959
+ const active = this.host.nativeElement.ownerDocument?.activeElement;
960
+ return active instanceof HTMLElement ? active : null;
961
+ }
962
+ /**
963
+ * Runs one write on a row, with only that row's buttons quiet meanwhile, then keeps focus in
964
+ * the drawer, on `focusAfter` when it is still there and enabled.
965
+ */
966
+ async run(id, act, focusAfter = null) {
967
+ this.Busy = id;
968
+ this.Error = '';
969
+ this.cdr.markForCheck();
970
+ try {
971
+ const result = await act();
972
+ if (!result.Success) {
973
+ this.Error = result.Message ?? 'That did not work.';
974
+ }
975
+ else {
976
+ this.afterChange();
977
+ }
978
+ }
979
+ finally {
980
+ this.Busy = null;
981
+ this.cdr.markForCheck();
982
+ this.refocusAfterRender(focusAfter);
983
+ }
984
+ }
985
+ /**
986
+ * After a change to what is on the form: drop the placement dialog's reading of it, rebuild
987
+ * the list, tell the form to resolve again, and keep focus in the drawer.
988
+ */
989
+ afterChange() {
990
+ if (this.EntityName)
991
+ this.probe.Forget(this.EntityName);
992
+ this.Refresh();
993
+ this.Changed.emit();
994
+ this.refocusAfterRender();
995
+ }
996
+ static ɵfac = function MjPanelManagerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || MjPanelManagerComponent)(); };
997
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MjPanelManagerComponent, selectors: [["mj-panel-manager"]], hostBindings: function MjPanelManagerComponent_HostBindings(rf, ctx) { if (rf & 1) {
998
+ i0.ɵɵlistener("keydown", function MjPanelManagerComponent_keydown_HostBindingHandler($event) { return ctx.OnKeydown($event); }, i0.ɵɵresolveDocument)("focusin", function MjPanelManagerComponent_focusin_HostBindingHandler($event) { return ctx.OnFocusIn($event); }, i0.ɵɵresolveDocument);
999
+ } }, inputs: { Visible: "Visible", Entity: "Entity", Compiled: "Compiled", StockGrids: "StockGrids", FullCustomForm: "FullCustomForm", TitleByKey: "TitleByKey", Related: "Related", Provider: "Provider", Variants: "Variants", CurrentFormID: "CurrentFormID", RecordKey: "RecordKey" }, outputs: { Changed: "Changed", FormChosen: "FormChosen", Closed: "Closed" }, standalone: false, features: [i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [[1, "mj-pm-overlay"], [1, "mj-pm-overlay", 3, "click"], ["role", "dialog", "aria-modal", "true", "aria-label", "Manage this form", "tabindex", "-1", 1, "mj-pm-drawer", 3, "click"], [1, "mj-pm-header"], [1, "mj-pm-heading"], [1, "mj-pm-eyebrow"], [1, "mj-pm-title"], ["type", "button", "mjButton", "", "Variant", "icon", "aria-label", "Close", 1, "mj-pm-close", 3, "click"], ["aria-hidden", "true", 1, "fa-solid", "fa-xmark"], [1, "mj-pm-banner"], ["role", "alert", 1, "mj-pm-error"], [1, "mj-pm-list"], [1, "mj-pm-group"], [1, "mj-pm-empty"], [1, "mj-pm-foot"], [1, "mj-pm-summary"], ["role", "dialog", "aria-modal", "true", "aria-label", "Who sees this", 1, "mj-pm-audience"], ["role", "dialog", "aria-modal", "true", "aria-label", "Change where this panel goes", 1, "mj-pm-edit"], [1, "mj-pm-group-head"], [1, "mj-pm-group-title"], [1, "mj-pm-group-note"], ["role", "radiogroup", "aria-label", "Form", 1, "mj-pm-stack"], [1, "mj-pm-form", 3, "is-current"], [1, "mj-pm-form"], [1, "mj-pm-form-pick"], ["type", "radio", "name", "mj-pm-form", 3, "change", "checked"], [1, "mj-pm-form-text"], [1, "mj-pm-row-name"], [1, "mj-pm-row-sub"], ["type", "button", "mjButton", "", "Variant", "flat", "Size", "sm", 1, "mj-pm-action", 3, "disabled"], [1, "mj-pm-on"], ["type", "button", "mjButton", "", "Variant", "flat", "Size", "sm", 1, "mj-pm-action", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-solid", "fa-layer-group"], [1, "mj-pm-empty-title"], [1, "mj-pm-empty-note"], [1, "mj-pm-group-count"], [1, "mj-pm-stack"], [1, "mj-pm-row", 3, "is-quiet"], [1, "mj-pm-row"], ["aria-hidden", "true", 1, "mj-pm-row-icon"], [1, "mj-pm-row-main"], [1, "mj-pm-row-where"], [1, "mj-pm-chip", "mj-pm-mono"], [1, "mj-pm-chip"], [1, "mj-pm-row-actions"], ["type", "button", "mjButton", "", "Variant", "outline", "Size", "sm", 1, "mj-pm-action"], ["type", "button", "mjButton", "", "Variant", "outline", "Size", "sm", 1, "mj-pm-action", 3, "disabled"], ["type", "button", "mjButton", "", "Variant", "flat", "Size", "sm", 1, "mj-pm-action"], ["type", "button", "mjButton", "", "Size", "sm", 1, "mj-pm-action", 3, "Variant", "disabled"], ["type", "button", "mjButton", "", "Variant", "outline", "Size", "sm", 1, "mj-pm-action", 3, "click"], ["type", "button", "mjButton", "", "Variant", "outline", "Size", "sm", 1, "mj-pm-action", 3, "click", "disabled"], ["type", "button", "mjButton", "", "Variant", "flat", "Size", "sm", 1, "mj-pm-action", 3, "click"], ["type", "button", "mjButton", "", "Size", "sm", 1, "mj-pm-action", 3, "click", "Variant", "disabled"], [1, "mj-pm-audience-title"], ["role", "radiogroup", "aria-label", "Audience", 1, "mj-pm-stack"], [1, "mj-pm-choice", 3, "is-on"], ["aria-label", "Which role", 1, "mj-pm-audience-role", 3, "value"], [1, "mj-pm-audience-consequence"], [1, "mj-pm-audience-actions"], ["type", "button", "mjButton", "", "Variant", "primary", "Size", "sm", 3, "click", "disabled"], ["type", "button", "mjButton", "", "Variant", "secondary", "Size", "sm", 3, "click"], [1, "mj-pm-choice"], ["type", "radio", "name", "mj-pm-audience", 3, "change", "checked"], ["aria-label", "Which role", 1, "mj-pm-audience-role", 3, "change", "value"], ["value", ""], [3, "value"], ["role", "dialog", "aria-modal", "true", "aria-label", "Change where this panel goes", 1, "mj-pm-edit", 3, "click"], [3, "Applied", "Cancelled", "Provider", "Context", "Proposal", "ComponentName", "SeedState", "RecordKey", "ReplacesRowID", "PanelComponentID", "VisibleTo", "OfferKeepOff"]], template: function MjPanelManagerComponent_Template(rf, ctx) { if (rf & 1) {
1000
+ i0.ɵɵconditionalCreate(0, MjPanelManagerComponent_Conditional_0_Template, 22, 8, "div", 0);
1001
+ } if (rf & 2) {
1002
+ i0.ɵɵconditional(ctx.Visible ? 0 : -1);
1003
+ } }, dependencies: [i1.NgSelectOption, i1.ɵNgSelectMultipleOption, i2.MJButtonDirective, i3.MjFormPlacementDialogComponent], styles: ["\n\n[_nghost-%COMP%] { display: block; }\n\n.mj-pm-overlay[_ngcontent-%COMP%] {\n position: fixed;\n inset: 0;\n background: var(--mj-bg-overlay);\n z-index: 1000;\n}\n\n\n\n.mj-pm-drawer[_ngcontent-%COMP%] {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n width: 520px;\n max-width: 94vw;\n box-sizing: border-box;\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n box-shadow: var(--mj-shadow-lg);\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n\n\n.mj-pm-header[_ngcontent-%COMP%] {\n flex-shrink: 0;\n display: flex;\n align-items: flex-start;\n gap: var(--mj-space-4);\n padding: var(--mj-space-5) var(--mj-space-6) var(--mj-space-4);\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mj-pm-heading[_ngcontent-%COMP%] { flex: 1 1 auto; min-width: 0; }\n\n.mj-pm-eyebrow[_ngcontent-%COMP%] {\n font-size: var(--mj-text-xs);\n font-weight: var(--mj-font-semibold);\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--mj-text-secondary);\n}\n\n.mj-pm-title[_ngcontent-%COMP%] {\n margin: var(--mj-space-1) 0 0;\n font-size: var(--mj-text-xl);\n font-weight: var(--mj-font-semibold);\n line-height: 1.2;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-pm-close[_ngcontent-%COMP%] { flex-shrink: 0; }\n\n.mj-pm-banner[_ngcontent-%COMP%], \n.mj-pm-error[_ngcontent-%COMP%] {\n flex-shrink: 0;\n margin: 0;\n padding: var(--mj-space-3) var(--mj-space-6);\n font-size: var(--mj-text-sm);\n line-height: 1.45;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mj-pm-banner[_ngcontent-%COMP%] { color: var(--mj-status-warning-text); background: var(--mj-status-warning-bg); }\n.mj-pm-error[_ngcontent-%COMP%] { color: var(--mj-status-error-text); background: var(--mj-status-error-bg); }\n\n\n\n.mj-pm-list[_ngcontent-%COMP%] {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n padding: 0 var(--mj-space-6);\n}\n\n.mj-pm-group[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-2);\n min-width: 0;\n padding: var(--mj-space-5) 0;\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.mj-pm-group[_ngcontent-%COMP%]:first-child { border-top: 0; }\n\n.mj-pm-group-head[_ngcontent-%COMP%] { display: flex; align-items: center; gap: var(--mj-space-2); }\n\n.mj-pm-group-title[_ngcontent-%COMP%] {\n font-size: var(--mj-text-xs);\n font-weight: var(--mj-font-semibold);\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--mj-text-secondary);\n}\n\n.mj-pm-group-count[_ngcontent-%COMP%] {\n min-width: 18px;\n padding: 0 5px;\n border-radius: var(--mj-radius-full);\n background: var(--mj-bg-surface-sunken);\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n text-align: center;\n}\n\n.mj-pm-group-note[_ngcontent-%COMP%] {\n margin: 0 0 var(--mj-space-1);\n font-size: var(--mj-text-sm);\n line-height: 1.45;\n color: var(--mj-text-secondary);\n}\n\n\n.mj-pm-stack[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n border: 1px solid var(--mj-border-subtle);\n border-radius: var(--mj-radius-md);\n overflow: hidden;\n}\n\n.mj-pm-stack[_ngcontent-%COMP%] > *[_ngcontent-%COMP%] + *[_ngcontent-%COMP%] { border-top: 1px solid var(--mj-border-subtle); }\n\n\n\n.mj-pm-empty[_ngcontent-%COMP%] {\n margin: var(--mj-space-8) 0;\n text-align: center;\n color: var(--mj-text-muted);\n}\n\n.mj-pm-empty[_ngcontent-%COMP%] > i[_ngcontent-%COMP%] { font-size: 28px; opacity: 0.4; }\n.mj-pm-empty-title[_ngcontent-%COMP%] { margin: var(--mj-space-3) 0 0; font-size: var(--mj-text-sm); color: var(--mj-text-secondary); }\n.mj-pm-empty-note[_ngcontent-%COMP%] { margin: var(--mj-space-1) 0 0; font-size: var(--mj-text-xs); }\n\n\n\n.mj-pm-form[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-3);\n padding-right: var(--mj-space-3);\n}\n\n.mj-pm-form.is-current[_ngcontent-%COMP%] { background: var(--mj-status-info-bg); }\n\n.mj-pm-form-pick[_ngcontent-%COMP%] {\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: var(--mj-space-3);\n padding: var(--mj-space-3);\n cursor: pointer;\n}\n\n.mj-pm-form-pick[_ngcontent-%COMP%] > input[_ngcontent-%COMP%] { flex-shrink: 0; margin: 0; }\n.mj-pm-form-text[_ngcontent-%COMP%] { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n.mj-pm-on[_ngcontent-%COMP%] { color: var(--mj-status-success-text); }\n\n\n\n.mj-pm-row[_ngcontent-%COMP%] {\n display: grid;\n grid-template-columns: 20px minmax(0, 1fr);\n grid-template-areas: \"icon main\" \". actions\";\n gap: var(--mj-space-2) var(--mj-space-3);\n align-items: start;\n padding: var(--mj-space-3);\n}\n\n.mj-pm-row.is-quiet[_ngcontent-%COMP%] { background: var(--mj-bg-surface-card); }\n\n.mj-pm-row-icon[_ngcontent-%COMP%] {\n grid-area: icon;\n margin-top: 2px;\n text-align: center;\n color: var(--mj-text-muted);\n}\n\n.mj-pm-row-main[_ngcontent-%COMP%] {\n grid-area: main;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.mj-pm-row-name[_ngcontent-%COMP%] {\n font-size: var(--mj-text-sm);\n font-weight: var(--mj-font-semibold);\n color: var(--mj-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-pm-row-sub[_ngcontent-%COMP%] { font-size: var(--mj-text-xs); color: var(--mj-text-secondary); }\n\n.mj-pm-row-where[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-1);\n margin-top: var(--mj-space-1);\n}\n\n.mj-pm-chip[_ngcontent-%COMP%] {\n padding: 1px var(--mj-space-2);\n border-radius: var(--mj-radius-sm);\n background: var(--mj-bg-surface-sunken);\n font-size: var(--mj-text-xs);\n color: var(--mj-text-secondary);\n}\n\n.mj-pm-row.is-quiet[_ngcontent-%COMP%] .mj-pm-chip[_ngcontent-%COMP%] { background: var(--mj-bg-surface); }\n\n.mj-pm-chip--on[_ngcontent-%COMP%] {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mj-pm-mono[_ngcontent-%COMP%] { font-family: var(--mj-font-family-mono); }\n\n.mj-pm-row-actions[_ngcontent-%COMP%] {\n grid-area: actions;\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-1);\n}\n\n\n\n.mj-pm-action[_ngcontent-%COMP%] { flex-shrink: 0; }\n\n\n\n\n\n\n.mj-pm-edit[_ngcontent-%COMP%] {\n position: fixed;\n inset: 0;\n z-index: 1001;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--mj-space-5);\n box-sizing: border-box;\n background: var(--mj-bg-overlay);\n}\n\n.mj-pm-edit[_ngcontent-%COMP%] > *[_ngcontent-%COMP%] {\n display: flex;\n width: min(1320px, 100%);\n height: min(860px, 100%);\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n border-radius: var(--mj-radius-lg);\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-lg);\n}\n\n.mj-pm-foot[_ngcontent-%COMP%] {\n flex-shrink: 0;\n padding: var(--mj-space-3) var(--mj-space-6);\n border-top: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-sunken);\n}\n\n.mj-pm-summary[_ngcontent-%COMP%] { font-size: var(--mj-text-sm); color: var(--mj-text-secondary); }\n\n\n\n.mj-pm-audience[_ngcontent-%COMP%] {\n position: absolute;\n z-index: 2;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-3);\n padding: var(--mj-space-5) var(--mj-space-6);\n border-top: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-lg);\n}\n\n.mj-pm-audience-title[_ngcontent-%COMP%] {\n margin: calc(var(--mj-space-2) * -1) 0 0;\n font-size: var(--mj-text-base);\n font-weight: var(--mj-font-semibold);\n}\n\n.mj-pm-choice[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: var(--mj-space-3);\n padding: var(--mj-space-3);\n font-size: var(--mj-text-sm);\n cursor: pointer;\n}\n\n.mj-pm-choice[_ngcontent-%COMP%] > input[_ngcontent-%COMP%] { margin: 0; }\n.mj-pm-choice.is-on[_ngcontent-%COMP%] { background: var(--mj-status-info-bg); }\n\n.mj-pm-audience-role[_ngcontent-%COMP%] {\n height: 34px;\n padding: 0 var(--mj-space-2);\n border: 1px solid var(--mj-border-subtle);\n border-radius: var(--mj-radius-sm);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n font: inherit;\n font-size: var(--mj-text-sm);\n}\n\n.mj-pm-audience-consequence[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-sm);\n line-height: 1.45;\n color: var(--mj-text-secondary);\n}\n\n.mj-pm-audience-actions[_ngcontent-%COMP%] { display: flex; gap: var(--mj-space-2); }"], changeDetection: 0 });
1004
+ }
1005
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MjPanelManagerComponent, [{
1006
+ type: Component,
1007
+ args: [{ standalone: false, selector: 'mj-panel-manager', changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (Visible) {\n <div class=\"mj-pm-overlay\" (click)=\"OnOverlayClick($event)\">\n <div class=\"mj-pm-drawer\" (click)=\"$event.stopPropagation()\" role=\"dialog\" aria-modal=\"true\"\n aria-label=\"Manage this form\" tabindex=\"-1\">\n\n <div class=\"mj-pm-header\">\n <div class=\"mj-pm-heading\">\n <div class=\"mj-pm-eyebrow\">Manage this form</div>\n <h3 class=\"mj-pm-title\">{{ EntityName }}</h3>\n </div>\n <button type=\"button\" mjButton Variant=\"icon\" class=\"mj-pm-close\" (click)=\"OnClose()\" aria-label=\"Close\">\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n </button>\n </div>\n\n @if (FullCustomForm) {\n <p class=\"mj-pm-banner\">\n A full custom form is drawing this entity. It owns the whole body, so everything\n below is held back until that form is turned off.\n </p>\n }\n\n @if (Error) {\n <p class=\"mj-pm-error\" role=\"alert\">{{ Error }}</p>\n }\n\n <div class=\"mj-pm-list\">\n @if (HasCustomForms) {\n <section class=\"mj-pm-group\">\n <div class=\"mj-pm-group-head\">\n <span class=\"mj-pm-group-title\">Form</span>\n </div>\n <p class=\"mj-pm-group-note\">Which form you see for this entity. Switching changes only your view.</p>\n <div class=\"mj-pm-stack\" role=\"radiogroup\" aria-label=\"Form\">\n @for (form of Forms; track form.ID ?? 'generated') {\n <div class=\"mj-pm-form\" [class.is-current]=\"form.IsCurrent\">\n <label class=\"mj-pm-form-pick\">\n <input type=\"radio\" name=\"mj-pm-form\"\n [checked]=\"form.IsCurrent\"\n (change)=\"OnUseForm(form)\">\n <span class=\"mj-pm-form-text\">\n <span class=\"mj-pm-row-name\">{{ form.Title }}</span>\n <span class=\"mj-pm-row-sub\">\n {{ form.AudienceLabel }}@if (form.IsCurrent) { &middot; <span class=\"mj-pm-on\">what you see</span> }\n </span>\n </span>\n </label>\n @if (form.CanPublish || form.CanChangeAudience) {\n <button type=\"button\" mjButton Variant=\"flat\" Size=\"sm\" class=\"mj-pm-action\"\n [disabled]=\"Busy === form.ID\"\n (click)=\"OnPublishForm(form)\">{{ form.CanPublish ? 'Publish\u2026' : 'Audience\u2026' }}</button>\n }\n </div>\n }\n </div>\n </section>\n }\n\n @if (IsEmpty) {\n <div class=\"mj-pm-empty\">\n <i class=\"fa-solid fa-layer-group\" aria-hidden=\"true\"></i>\n <p class=\"mj-pm-empty-title\">Nothing is registered on this form yet</p>\n <p class=\"mj-pm-empty-note\">Panels you add from a conversation show up here.</p>\n </div>\n }\n\n @for (group of Groups; track group.Key) {\n <section class=\"mj-pm-group\">\n <div class=\"mj-pm-group-head\">\n <span class=\"mj-pm-group-title\">{{ group.Title }}</span>\n <span class=\"mj-pm-group-count\">{{ group.Items.length }}</span>\n </div>\n @if (group.Note) {\n <p class=\"mj-pm-group-note\">{{ group.Note }}</p>\n }\n\n <div class=\"mj-pm-stack\">\n @for (item of group.Items; track item.ID) {\n <div class=\"mj-pm-row\" [class.is-quiet]=\"!item.CanEdit\">\n <i [class]=\"item.Icon\" class=\"mj-pm-row-icon\" aria-hidden=\"true\"></i>\n\n <div class=\"mj-pm-row-main\">\n <span class=\"mj-pm-row-name\">{{ item.Title }}</span>\n <span class=\"mj-pm-row-sub\">{{ item.Subtitle }}</span>\n <span class=\"mj-pm-row-where\">\n @if (item.Slot) {\n <span class=\"mj-pm-chip mj-pm-mono\">{{ item.Slot }}</span>\n }\n @if (item.Replaces) {\n <span class=\"mj-pm-chip\">stands in for {{ item.Replaces }}</span>\n }\n <span class=\"mj-pm-chip\">{{ item.AudienceLabel }}</span>\n <span class=\"mj-pm-chip\" [class.mj-pm-chip--on]=\"item.State === 'active'\">{{ item.StateLabel }}</span>\n </span>\n </div>\n\n @if (item.CanEdit || item.CanTurnOn || item.CanTurnOff || item.CanRemove\n || item.CanHide || item.CanShow || item.CanPublish || item.CanChangeAudience) {\n <div class=\"mj-pm-row-actions\">\n @if (item.CanShow) {\n <button type=\"button\" mjButton Variant=\"outline\" Size=\"sm\" class=\"mj-pm-action\"\n (click)=\"OnShow(item)\">Show again</button>\n }\n @if (item.CanEdit) {\n <button type=\"button\" mjButton Variant=\"outline\" Size=\"sm\" class=\"mj-pm-action\"\n [disabled]=\"Busy === item.ID\"\n (click)=\"OnEdit(item)\">Change where it goes</button>\n }\n @if (item.CanTurnOn || item.CanTurnOff) {\n <button type=\"button\" mjButton Variant=\"flat\" Size=\"sm\" class=\"mj-pm-action\"\n [disabled]=\"Busy === item.ID\"\n (click)=\"OnToggle(item)\">{{ ToggleLabel(item) }}</button>\n }\n @if (item.CanPublish || item.CanChangeAudience) {\n <button type=\"button\" mjButton Variant=\"flat\" Size=\"sm\" class=\"mj-pm-action\"\n [disabled]=\"Busy === item.ID\"\n (click)=\"OnPublishPanel(item)\">{{ item.CanPublish ? 'Publish\u2026' : 'Audience\u2026' }}</button>\n }\n @if (item.CanHide) {\n <button type=\"button\" mjButton Variant=\"flat\" Size=\"sm\" class=\"mj-pm-action\"\n (click)=\"OnHide(item)\">Hide for me</button>\n }\n @if (item.CanRemove) {\n <button type=\"button\" mjButton Size=\"sm\" class=\"mj-pm-action\"\n [Variant]=\"RemoveVariant(item)\"\n [disabled]=\"Busy === item.ID\"\n (click)=\"OnRemove(item)\">{{ RemoveLabel(item) }}</button>\n }\n </div>\n }\n </div>\n }\n </div>\n </section>\n }\n </div>\n\n <div class=\"mj-pm-foot\">\n <span class=\"mj-pm-summary\">{{ Summary }}</span>\n </div>\n\n @if (Publishing; as target) {\n <div class=\"mj-pm-audience\" role=\"dialog\" aria-modal=\"true\" aria-label=\"Who sees this\">\n <div class=\"mj-pm-eyebrow\">Who sees it</div>\n <p class=\"mj-pm-audience-title\">{{ target.Title }}</p>\n <div class=\"mj-pm-stack\" role=\"radiogroup\" aria-label=\"Audience\">\n @for (scope of ['User', 'Role', 'Global']; track scope) {\n <label class=\"mj-pm-choice\" [class.is-on]=\"target.Scope === scope\">\n <input type=\"radio\" name=\"mj-pm-audience\"\n [checked]=\"target.Scope === scope\"\n (change)=\"target.Scope = $any(scope)\">\n <span>{{ AudienceOption($any(scope)) }}</span>\n </label>\n }\n </div>\n @if (target.Scope === 'Role') {\n <select class=\"mj-pm-audience-role\" aria-label=\"Which role\"\n [value]=\"target.RoleID ?? ''\"\n (change)=\"target.RoleID = $any($event.target).value || null\">\n <option value=\"\">Choose a role\u2026</option>\n @for (role of RoleOptions; track role.ID) {\n <option [value]=\"role.ID\">{{ role.Name }}</option>\n }\n </select>\n }\n <p class=\"mj-pm-audience-consequence\">{{ AudienceConsequence }}</p>\n <div class=\"mj-pm-audience-actions\">\n <button type=\"button\" mjButton Variant=\"primary\" Size=\"sm\"\n [disabled]=\"!CanConfirmAudience\"\n (click)=\"ConfirmAudience()\">Save audience</button>\n <button type=\"button\" mjButton Variant=\"secondary\" Size=\"sm\" (click)=\"CancelAudience()\">Cancel</button>\n </div>\n </div>\n }\n\n @if (Editing && EditContext) {\n <div class=\"mj-pm-edit\" role=\"dialog\" aria-modal=\"true\" aria-label=\"Change where this panel goes\"\n (click)=\"OnEditScrimClick($event)\">\n <mj-form-placement-dialog\n [Provider]=\"Provider\"\n [Context]=\"EditContext\"\n [Proposal]=\"EditProposal\"\n [ComponentName]=\"Editing.Title\"\n [SeedState]=\"SeedEdit\"\n [RecordKey]=\"RecordKey\"\n [ReplacesRowID]=\"Editing.ID\"\n [PanelComponentID]=\"EditComponentID\"\n [VisibleTo]=\"EditVisibleTo\"\n [OfferKeepOff]=\"EditStatus === 'Inactive'\"\n (Applied)=\"OnEditApplied($event)\"\n (Cancelled)=\"CloseEdit()\">\n </mj-form-placement-dialog>\n </div>\n }\n\n </div>\n </div>\n}\n", styles: ["/* \"Manage this form\" drawer. Styled like the placement dialog: a small-caps eyebrow over the\n title, sections split by hairlines, and every list drawn as one bordered list. */\n:host { display: block; }\n\n.mj-pm-overlay {\n position: fixed;\n inset: 0;\n background: var(--mj-bg-overlay);\n z-index: 1000;\n}\n\n/* `fixed` also makes this the containing block for the placement dialog, which covers\n the drawer while a panel is being re-placed. */\n.mj-pm-drawer {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n width: 520px;\n max-width: 94vw;\n box-sizing: border-box;\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n box-shadow: var(--mj-shadow-lg);\n display: flex;\n flex-direction: column;\n min-height: 0;\n}\n\n/* ---- header ---- */\n\n.mj-pm-header {\n flex-shrink: 0;\n display: flex;\n align-items: flex-start;\n gap: var(--mj-space-4);\n padding: var(--mj-space-5) var(--mj-space-6) var(--mj-space-4);\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mj-pm-heading { flex: 1 1 auto; min-width: 0; }\n\n.mj-pm-eyebrow {\n font-size: var(--mj-text-xs);\n font-weight: var(--mj-font-semibold);\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--mj-text-secondary);\n}\n\n.mj-pm-title {\n margin: var(--mj-space-1) 0 0;\n font-size: var(--mj-text-xl);\n font-weight: var(--mj-font-semibold);\n line-height: 1.2;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-pm-close { flex-shrink: 0; }\n\n.mj-pm-banner,\n.mj-pm-error {\n flex-shrink: 0;\n margin: 0;\n padding: var(--mj-space-3) var(--mj-space-6);\n font-size: var(--mj-text-sm);\n line-height: 1.45;\n border-bottom: 1px solid var(--mj-border-subtle);\n}\n\n.mj-pm-banner { color: var(--mj-status-warning-text); background: var(--mj-status-warning-bg); }\n.mj-pm-error { color: var(--mj-status-error-text); background: var(--mj-status-error-bg); }\n\n/* ---- body: sections split by hairlines ---- */\n\n.mj-pm-list {\n flex: 1 1 auto;\n min-height: 0;\n overflow-y: auto;\n padding: 0 var(--mj-space-6);\n}\n\n.mj-pm-group {\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-2);\n min-width: 0;\n padding: var(--mj-space-5) 0;\n border-top: 1px solid var(--mj-border-subtle);\n}\n\n.mj-pm-group:first-child { border-top: 0; }\n\n.mj-pm-group-head { display: flex; align-items: center; gap: var(--mj-space-2); }\n\n.mj-pm-group-title {\n font-size: var(--mj-text-xs);\n font-weight: var(--mj-font-semibold);\n letter-spacing: 0.09em;\n text-transform: uppercase;\n color: var(--mj-text-secondary);\n}\n\n.mj-pm-group-count {\n min-width: 18px;\n padding: 0 5px;\n border-radius: var(--mj-radius-full);\n background: var(--mj-bg-surface-sunken);\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n text-align: center;\n}\n\n.mj-pm-group-note {\n margin: 0 0 var(--mj-space-1);\n font-size: var(--mj-text-sm);\n line-height: 1.45;\n color: var(--mj-text-secondary);\n}\n\n/* One bordered list; rows split by hairlines. */\n.mj-pm-stack {\n display: flex;\n flex-direction: column;\n border: 1px solid var(--mj-border-subtle);\n border-radius: var(--mj-radius-md);\n overflow: hidden;\n}\n\n.mj-pm-stack > * + * { border-top: 1px solid var(--mj-border-subtle); }\n\n/* ---- empty ---- */\n\n.mj-pm-empty {\n margin: var(--mj-space-8) 0;\n text-align: center;\n color: var(--mj-text-muted);\n}\n\n.mj-pm-empty > i { font-size: 28px; opacity: 0.4; }\n.mj-pm-empty-title { margin: var(--mj-space-3) 0 0; font-size: var(--mj-text-sm); color: var(--mj-text-secondary); }\n.mj-pm-empty-note { margin: var(--mj-space-1) 0 0; font-size: var(--mj-text-xs); }\n\n/* ---- form choices: the whole row is the radio ---- */\n\n.mj-pm-form {\n display: flex;\n align-items: center;\n gap: var(--mj-space-3);\n padding-right: var(--mj-space-3);\n}\n\n.mj-pm-form.is-current { background: var(--mj-status-info-bg); }\n\n.mj-pm-form-pick {\n flex: 1 1 auto;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: var(--mj-space-3);\n padding: var(--mj-space-3);\n cursor: pointer;\n}\n\n.mj-pm-form-pick > input { flex-shrink: 0; margin: 0; }\n.mj-pm-form-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n.mj-pm-on { color: var(--mj-status-success-text); }\n\n/* ---- panel rows ---- */\n\n.mj-pm-row {\n display: grid;\n grid-template-columns: 20px minmax(0, 1fr);\n grid-template-areas: \"icon main\" \". actions\";\n gap: var(--mj-space-2) var(--mj-space-3);\n align-items: start;\n padding: var(--mj-space-3);\n}\n\n.mj-pm-row.is-quiet { background: var(--mj-bg-surface-card); }\n\n.mj-pm-row-icon {\n grid-area: icon;\n margin-top: 2px;\n text-align: center;\n color: var(--mj-text-muted);\n}\n\n.mj-pm-row-main {\n grid-area: main;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n.mj-pm-row-name {\n font-size: var(--mj-text-sm);\n font-weight: var(--mj-font-semibold);\n color: var(--mj-text-primary);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.mj-pm-row-sub { font-size: var(--mj-text-xs); color: var(--mj-text-secondary); }\n\n.mj-pm-row-where {\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-1);\n margin-top: var(--mj-space-1);\n}\n\n.mj-pm-chip {\n padding: 1px var(--mj-space-2);\n border-radius: var(--mj-radius-sm);\n background: var(--mj-bg-surface-sunken);\n font-size: var(--mj-text-xs);\n color: var(--mj-text-secondary);\n}\n\n.mj-pm-row.is-quiet .mj-pm-chip { background: var(--mj-bg-surface); }\n\n.mj-pm-chip--on {\n background: var(--mj-status-success-bg);\n color: var(--mj-status-success-text);\n}\n\n.mj-pm-mono { font-family: var(--mj-font-family-mono); }\n\n.mj-pm-row-actions {\n grid-area: actions;\n display: flex;\n flex-wrap: wrap;\n gap: var(--mj-space-1);\n}\n\n/* ---- buttons: mjButton, quiet by default, one emphasis per row ---- */\n\n.mj-pm-action { flex-shrink: 0; }\n\n/* ---- the placement dialog, over the drawer ---- */\n\n/* The placement dialog opens over the whole window rather than inside the drawer. It is\n the same dialog the add flow uses, and it needs the width to show the form preview\n beside the answers; confined to the drawer it stacks into a single cramped column. */\n.mj-pm-edit {\n position: fixed;\n inset: 0;\n z-index: 1001;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: var(--mj-space-5);\n box-sizing: border-box;\n background: var(--mj-bg-overlay);\n}\n\n.mj-pm-edit > * {\n display: flex;\n width: min(1320px, 100%);\n height: min(860px, 100%);\n min-width: 0;\n min-height: 0;\n overflow: hidden;\n border-radius: var(--mj-radius-lg);\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-lg);\n}\n\n.mj-pm-foot {\n flex-shrink: 0;\n padding: var(--mj-space-3) var(--mj-space-6);\n border-top: 1px solid var(--mj-border-subtle);\n background: var(--mj-bg-surface-sunken);\n}\n\n.mj-pm-summary { font-size: var(--mj-text-sm); color: var(--mj-text-secondary); }\n\n/* ---- audience chooser: a sheet over the bottom of the drawer ---- */\n\n.mj-pm-audience {\n position: absolute;\n z-index: 2;\n right: 0;\n bottom: 0;\n left: 0;\n display: flex;\n flex-direction: column;\n gap: var(--mj-space-3);\n padding: var(--mj-space-5) var(--mj-space-6);\n border-top: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n box-shadow: var(--mj-shadow-lg);\n}\n\n.mj-pm-audience-title {\n margin: calc(var(--mj-space-2) * -1) 0 0;\n font-size: var(--mj-text-base);\n font-weight: var(--mj-font-semibold);\n}\n\n.mj-pm-choice {\n display: flex;\n align-items: center;\n gap: var(--mj-space-3);\n padding: var(--mj-space-3);\n font-size: var(--mj-text-sm);\n cursor: pointer;\n}\n\n.mj-pm-choice > input { margin: 0; }\n.mj-pm-choice.is-on { background: var(--mj-status-info-bg); }\n\n.mj-pm-audience-role {\n height: 34px;\n padding: 0 var(--mj-space-2);\n border: 1px solid var(--mj-border-subtle);\n border-radius: var(--mj-radius-sm);\n background: var(--mj-bg-surface);\n color: var(--mj-text-primary);\n font: inherit;\n font-size: var(--mj-text-sm);\n}\n\n.mj-pm-audience-consequence {\n margin: 0;\n font-size: var(--mj-text-sm);\n line-height: 1.45;\n color: var(--mj-text-secondary);\n}\n\n.mj-pm-audience-actions { display: flex; gap: var(--mj-space-2); }\n"] }]
1008
+ }], null, { Visible: [{
1009
+ type: Input
1010
+ }], Entity: [{
1011
+ type: Input
1012
+ }], Compiled: [{
1013
+ type: Input
1014
+ }], StockGrids: [{
1015
+ type: Input
1016
+ }], FullCustomForm: [{
1017
+ type: Input
1018
+ }], TitleByKey: [{
1019
+ type: Input
1020
+ }], Related: [{
1021
+ type: Input
1022
+ }], Provider: [{
1023
+ type: Input
1024
+ }], Variants: [{
1025
+ type: Input
1026
+ }], CurrentFormID: [{
1027
+ type: Input
1028
+ }], RecordKey: [{
1029
+ type: Input
1030
+ }], Changed: [{
1031
+ type: Output
1032
+ }], FormChosen: [{
1033
+ type: Output
1034
+ }], Closed: [{
1035
+ type: Output
1036
+ }], OnKeydown: [{
1037
+ type: HostListener,
1038
+ args: ['document:keydown', ['$event']]
1039
+ }], OnFocusIn: [{
1040
+ type: HostListener,
1041
+ args: ['document:focusin', ['$event']]
1042
+ }] }); })();
1043
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MjPanelManagerComponent, { className: "MjPanelManagerComponent", filePath: "src/lib/panel-manager/panel-manager.component.ts", lineNumber: 57 }); })();
1044
+ /** Elements Tab stops on inside the drawer. */
1045
+ const TAB_STOPS = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), '
1046
+ + 'textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
1047
+ /**
1048
+ * The elements Tab stops on inside `root`, in document order. Leaves out anything inside an
1049
+ * `inert` or `hidden` subtree, such as the placement dialog's read-only form preview, which
1050
+ * cannot take focus. A named radio group is one stop: its checked radio, else its first.
1051
+ */
1052
+ function tabStops(root) {
1053
+ const candidates = Array.from(root.querySelectorAll(TAB_STOPS)).filter((el) => !el.closest('[inert], [hidden]'));
1054
+ const groupStops = new Map();
1055
+ for (const el of candidates) {
1056
+ if (!isNamedRadio(el))
1057
+ continue;
1058
+ const kept = groupStops.get(el.name);
1059
+ if (!kept || (!kept.checked && el.checked))
1060
+ groupStops.set(el.name, el);
1061
+ }
1062
+ return candidates.filter((el) => !isNamedRadio(el) || groupStops.get(el.name) === el);
1063
+ }
1064
+ /** The stop that stands for `el`: the group's stop for a radio in a named group, else `el`. */
1065
+ function stopOf(el, stops) {
1066
+ if (!isNamedRadio(el))
1067
+ return el;
1068
+ return stops.find((stop) => isNamedRadio(stop) && stop.name === el.name) ?? el;
1069
+ }
1070
+ function isNamedRadio(el) {
1071
+ return el instanceof HTMLInputElement && el.type === 'radio' && el.name.length > 0;
1072
+ }
1073
+ function isDisabled(el) {
1074
+ return (el instanceof HTMLButtonElement || el instanceof HTMLInputElement
1075
+ || el instanceof HTMLSelectElement || el instanceof HTMLTextAreaElement) && el.disabled;
1076
+ }
1077
+ /** The row's placement, claims and configuration as the proposal the edit dialog opens on. */
1078
+ function proposalFromRow(row) {
1079
+ const spec = {
1080
+ slot: row.Slot,
1081
+ presentation: row.Presentation === 'bare' ? 'bare' : 'panel',
1082
+ title: (row.Title ?? row.Name ?? '').trim(),
1083
+ };
1084
+ if (row.Icon)
1085
+ spec.icon = row.Icon;
1086
+ if (row.ReplacesSectionKey)
1087
+ spec.replacesSectionKey = row.ReplacesSectionKey;
1088
+ if (row.ReplacesSectionKeys.length > 0)
1089
+ spec.replacesSectionKeys = [...row.ReplacesSectionKeys];
1090
+ if (row.ReplacesFieldNames.length > 0)
1091
+ spec.replacesFieldNames = [...row.ReplacesFieldNames];
1092
+ if (row.InSectionKey)
1093
+ spec.inSectionKey = row.InSectionKey;
1094
+ if (row.SectionPosition)
1095
+ spec.sectionPosition = row.SectionPosition;
1096
+ if (row.RelatedEntity)
1097
+ spec.relatedEntity = row.RelatedEntity;
1098
+ if (row.RelatedEntity && row.RelatedJoinField)
1099
+ spec.relatedJoinField = row.RelatedJoinField;
1100
+ if (row.ContributionKey)
1101
+ spec.contributionKey = row.ContributionKey;
1102
+ const configuration = ParseContributionConfiguration(row.Configuration);
1103
+ if (configuration)
1104
+ spec.configuration = configuration;
1105
+ spec.sortKey = row.SortKey;
1106
+ return spec;
1107
+ }
1108
+ /** A row's status as a lifecycle status. Anything unknown reads as off. */
1109
+ function lifecycleStatus(status) {
1110
+ return status === 'Active' || status === 'Pending' ? status : 'Inactive';
1111
+ }
1112
+ //# sourceMappingURL=panel-manager.component.js.map