@memberjunction/ng-conversations 2.107.0 → 2.108.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts +67 -0
  2. package/dist/lib/components/collection/artifact-collection-picker-modal.component.d.ts.map +1 -0
  3. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js +725 -0
  4. package/dist/lib/components/collection/artifact-collection-picker-modal.component.js.map +1 -0
  5. package/dist/lib/components/collection/artifact-create-modal.component.d.ts +39 -0
  6. package/dist/lib/components/collection/artifact-create-modal.component.d.ts.map +1 -0
  7. package/dist/lib/components/collection/artifact-create-modal.component.js +351 -0
  8. package/dist/lib/components/collection/artifact-create-modal.component.js.map +1 -0
  9. package/dist/lib/components/collection/collection-form-modal.component.d.ts +3 -1
  10. package/dist/lib/components/collection/collection-form-modal.component.d.ts.map +1 -1
  11. package/dist/lib/components/collection/collection-form-modal.component.js +60 -10
  12. package/dist/lib/components/collection/collection-form-modal.component.js.map +1 -1
  13. package/dist/lib/components/collection/collection-share-modal.component.d.ts +43 -0
  14. package/dist/lib/components/collection/collection-share-modal.component.d.ts.map +1 -0
  15. package/dist/lib/components/collection/collection-share-modal.component.js +728 -0
  16. package/dist/lib/components/collection/collection-share-modal.component.js.map +1 -0
  17. package/dist/lib/components/collection/collection-tree.component.d.ts +8 -1
  18. package/dist/lib/components/collection/collection-tree.component.d.ts.map +1 -1
  19. package/dist/lib/components/collection/collection-tree.component.js +217 -115
  20. package/dist/lib/components/collection/collection-tree.component.js.map +1 -1
  21. package/dist/lib/components/collection/collection-view.component.d.ts +2 -1
  22. package/dist/lib/components/collection/collection-view.component.d.ts.map +1 -1
  23. package/dist/lib/components/collection/collection-view.component.js +52 -34
  24. package/dist/lib/components/collection/collection-view.component.js.map +1 -1
  25. package/dist/lib/components/collection/collections-full-view.component.d.ts +45 -9
  26. package/dist/lib/components/collection/collections-full-view.component.d.ts.map +1 -1
  27. package/dist/lib/components/collection/collections-full-view.component.js +586 -220
  28. package/dist/lib/components/collection/collections-full-view.component.js.map +1 -1
  29. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts +42 -15
  30. package/dist/lib/components/conversation/conversation-chat-area.component.d.ts.map +1 -1
  31. package/dist/lib/components/conversation/conversation-chat-area.component.js +336 -219
  32. package/dist/lib/components/conversation/conversation-chat-area.component.js.map +1 -1
  33. package/dist/lib/components/message/message-input.component.d.ts +7 -1
  34. package/dist/lib/components/message/message-input.component.d.ts.map +1 -1
  35. package/dist/lib/components/message/message-input.component.js +65 -10
  36. package/dist/lib/components/message/message-input.component.js.map +1 -1
  37. package/dist/lib/components/message/message-item.component.d.ts +39 -5
  38. package/dist/lib/components/message/message-item.component.d.ts.map +1 -1
  39. package/dist/lib/components/message/message-item.component.js +259 -137
  40. package/dist/lib/components/message/message-item.component.js.map +1 -1
  41. package/dist/lib/components/message/message-list.component.d.ts +5 -1
  42. package/dist/lib/components/message/message-list.component.d.ts.map +1 -1
  43. package/dist/lib/components/message/message-list.component.js +26 -12
  44. package/dist/lib/components/message/message-list.component.js.map +1 -1
  45. package/dist/lib/components/message/suggested-responses.component.d.ts +55 -0
  46. package/dist/lib/components/message/suggested-responses.component.d.ts.map +1 -0
  47. package/dist/lib/components/message/suggested-responses.component.js +207 -0
  48. package/dist/lib/components/message/suggested-responses.component.js.map +1 -0
  49. package/dist/lib/components/search/search-panel.component.d.ts.map +1 -1
  50. package/dist/lib/components/search/search-panel.component.js +245 -113
  51. package/dist/lib/components/search/search-panel.component.js.map +1 -1
  52. package/dist/lib/components/shared/user-picker.component.d.ts +29 -0
  53. package/dist/lib/components/shared/user-picker.component.d.ts.map +1 -0
  54. package/dist/lib/components/shared/user-picker.component.js +229 -0
  55. package/dist/lib/components/shared/user-picker.component.js.map +1 -0
  56. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts +7 -1
  57. package/dist/lib/components/tasks/tasks-dropdown.component.d.ts.map +1 -1
  58. package/dist/lib/components/tasks/tasks-dropdown.component.js +36 -6
  59. package/dist/lib/components/tasks/tasks-dropdown.component.js.map +1 -1
  60. package/dist/lib/components/workspace/conversation-workspace.component.d.ts +19 -2
  61. package/dist/lib/components/workspace/conversation-workspace.component.d.ts.map +1 -1
  62. package/dist/lib/components/workspace/conversation-workspace.component.js +167 -58
  63. package/dist/lib/components/workspace/conversation-workspace.component.js.map +1 -1
  64. package/dist/lib/conversations.module.d.ts +52 -47
  65. package/dist/lib/conversations.module.d.ts.map +1 -1
  66. package/dist/lib/conversations.module.js +27 -4
  67. package/dist/lib/conversations.module.js.map +1 -1
  68. package/dist/lib/models/conversation-complete-query.model.d.ts +75 -0
  69. package/dist/lib/models/conversation-complete-query.model.d.ts.map +1 -0
  70. package/dist/lib/models/conversation-complete-query.model.js +19 -0
  71. package/dist/lib/models/conversation-complete-query.model.js.map +1 -0
  72. package/dist/lib/models/conversation-state.model.d.ts +27 -0
  73. package/dist/lib/models/conversation-state.model.d.ts.map +1 -1
  74. package/dist/lib/services/agent-state.service.d.ts.map +1 -1
  75. package/dist/lib/services/agent-state.service.js +5 -0
  76. package/dist/lib/services/agent-state.service.js.map +1 -1
  77. package/dist/lib/services/artifact-state.service.d.ts.map +1 -1
  78. package/dist/lib/services/artifact-state.service.js +14 -9
  79. package/dist/lib/services/artifact-state.service.js.map +1 -1
  80. package/dist/lib/services/collection-permission.service.d.ts +96 -0
  81. package/dist/lib/services/collection-permission.service.d.ts.map +1 -0
  82. package/dist/lib/services/collection-permission.service.js +303 -0
  83. package/dist/lib/services/collection-permission.service.js.map +1 -0
  84. package/dist/lib/services/collection-state.service.d.ts +34 -0
  85. package/dist/lib/services/collection-state.service.d.ts.map +1 -0
  86. package/dist/lib/services/collection-state.service.js +50 -0
  87. package/dist/lib/services/collection-state.service.js.map +1 -0
  88. package/dist/lib/services/conversation-agent.service.d.ts +9 -4
  89. package/dist/lib/services/conversation-agent.service.d.ts.map +1 -1
  90. package/dist/lib/services/conversation-agent.service.js +41 -12
  91. package/dist/lib/services/conversation-agent.service.js.map +1 -1
  92. package/dist/lib/services/data-cache.service.d.ts.map +1 -1
  93. package/dist/lib/services/data-cache.service.js +5 -0
  94. package/dist/lib/services/data-cache.service.js.map +1 -1
  95. package/dist/lib/services/mention-autocomplete.service.js +1 -1
  96. package/dist/lib/services/mention-autocomplete.service.js.map +1 -1
  97. package/dist/lib/services/mention-parser.service.d.ts.map +1 -1
  98. package/dist/lib/services/mention-parser.service.js +0 -5
  99. package/dist/lib/services/mention-parser.service.js.map +1 -1
  100. package/dist/lib/services/search.service.d.ts +26 -3
  101. package/dist/lib/services/search.service.d.ts.map +1 -1
  102. package/dist/lib/services/search.service.js +172 -12
  103. package/dist/lib/services/search.service.js.map +1 -1
  104. package/dist/public-api.d.ts +3 -0
  105. package/dist/public-api.d.ts.map +1 -1
  106. package/dist/public-api.js +3 -0
  107. package/dist/public-api.js.map +1 -1
  108. package/package.json +12 -12
@@ -0,0 +1,725 @@
1
+ import { Component, Input, Output, EventEmitter } from '@angular/core';
2
+ import { CommonModule } from '@angular/common';
3
+ import { FormsModule } from '@angular/forms';
4
+ import { RunView, Metadata } from '@memberjunction/core';
5
+ import { DialogModule } from '@progress/kendo-angular-dialog';
6
+ import { ButtonsModule } from '@progress/kendo-angular-buttons';
7
+ import { InputsModule } from '@progress/kendo-angular-inputs';
8
+ import * as i0 from "@angular/core";
9
+ import * as i1 from "../../services/toast.service";
10
+ import * as i2 from "../../services/collection-permission.service";
11
+ import * as i3 from "@angular/common";
12
+ import * as i4 from "@angular/forms";
13
+ import * as i5 from "@progress/kendo-angular-dialog";
14
+ import * as i6 from "@progress/kendo-angular-buttons";
15
+ const _forTrack0 = ($index, $item) => $item.collection.ID;
16
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_2_For_5_Template(rf, ctx) { if (rf & 1) {
17
+ const _r4 = i0.ɵɵgetCurrentView();
18
+ i0.ɵɵelement(0, "i", 20);
19
+ i0.ɵɵelementStart(1, "button", 18);
20
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_2_For_5_Template_button_click_1_listener() { const item_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.navigateToCollection(item_r5.collection)); });
21
+ i0.ɵɵtext(2);
22
+ i0.ɵɵelementEnd();
23
+ } if (rf & 2) {
24
+ const item_r5 = ctx.$implicit;
25
+ i0.ɵɵadvance(2);
26
+ i0.ɵɵtextInterpolate1(" ", item_r5.collection.Name, " ");
27
+ } }
28
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
29
+ const _r3 = i0.ɵɵgetCurrentView();
30
+ i0.ɵɵelementStart(0, "div", 4)(1, "button", 18);
31
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_2_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.navigateToRoot()); });
32
+ i0.ɵɵelement(2, "i", 19);
33
+ i0.ɵɵtext(3, " Root ");
34
+ i0.ɵɵelementEnd();
35
+ i0.ɵɵrepeaterCreate(4, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_2_For_5_Template, 3, 1, null, null, _forTrack0);
36
+ i0.ɵɵelementEnd();
37
+ } if (rf & 2) {
38
+ const ctx_r1 = i0.ɵɵnextContext(2);
39
+ i0.ɵɵadvance(4);
40
+ i0.ɵɵrepeater(ctx_r1.navigationPath);
41
+ } }
42
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_1_Conditional_1_Template(rf, ctx) { if (rf & 1) {
43
+ i0.ɵɵelement(0, "i", 23);
44
+ i0.ɵɵelementStart(1, "p");
45
+ i0.ɵɵtext(2);
46
+ i0.ɵɵelementEnd();
47
+ } if (rf & 2) {
48
+ const ctx_r1 = i0.ɵɵnextContext(4);
49
+ i0.ɵɵadvance(2);
50
+ i0.ɵɵtextInterpolate1("No collections found matching \"", ctx_r1.searchQuery, "\"");
51
+ } }
52
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_1_Conditional_2_Template(rf, ctx) { if (rf & 1) {
53
+ i0.ɵɵelement(0, "i", 24);
54
+ i0.ɵɵelementStart(1, "p");
55
+ i0.ɵɵtext(2, "No sub-collections available");
56
+ i0.ɵɵelementEnd();
57
+ } }
58
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_1_Conditional_3_Template(rf, ctx) { if (rf & 1) {
59
+ i0.ɵɵelement(0, "i", 25);
60
+ i0.ɵɵelementStart(1, "p");
61
+ i0.ɵɵtext(2, "No collections available");
62
+ i0.ɵɵelementEnd();
63
+ i0.ɵɵelementStart(3, "p", 26);
64
+ i0.ɵɵtext(4, "Create a new collection to get started");
65
+ i0.ɵɵelementEnd();
66
+ } }
67
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_1_Template(rf, ctx) { if (rf & 1) {
68
+ i0.ɵɵelementStart(0, "div", 22);
69
+ i0.ɵɵtemplate(1, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_1_Conditional_1_Template, 3, 1)(2, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_1_Conditional_2_Template, 3, 0)(3, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_1_Conditional_3_Template, 5, 0);
70
+ i0.ɵɵelementEnd();
71
+ } if (rf & 2) {
72
+ const ctx_r1 = i0.ɵɵnextContext(3);
73
+ i0.ɵɵadvance();
74
+ i0.ɵɵconditional(ctx_r1.searchQuery ? 1 : ctx_r1.currentParentId ? 2 : 3);
75
+ } }
76
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Conditional_6_Template(rf, ctx) { if (rf & 1) {
77
+ i0.ɵɵelementStart(0, "span", 33);
78
+ i0.ɵɵelement(1, "i", 35);
79
+ i0.ɵɵtext(2, " Already added ");
80
+ i0.ɵɵelementEnd();
81
+ } }
82
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Conditional_7_Template(rf, ctx) { if (rf & 1) {
83
+ const _r8 = i0.ɵɵgetCurrentView();
84
+ i0.ɵɵelementStart(0, "button", 36);
85
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Conditional_7_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r8); const node_r7 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(4); $event.stopPropagation(); return i0.ɵɵresetView(ctx_r1.drillIntoCollection(node_r7.collection)); });
86
+ i0.ɵɵelement(1, "i", 37);
87
+ i0.ɵɵelementEnd();
88
+ } }
89
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Template(rf, ctx) { if (rf & 1) {
90
+ const _r6 = i0.ɵɵgetCurrentView();
91
+ i0.ɵɵelementStart(0, "div", 28);
92
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Template_div_click_0_listener() { const node_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.toggleSelection(node_r7)); });
93
+ i0.ɵɵelementStart(1, "div", 29)(2, "input", 30);
94
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Template_input_click_2_listener($event) { const node_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); $event.stopPropagation(); return i0.ɵɵresetView(ctx_r1.toggleSelection(node_r7)); });
95
+ i0.ɵɵelementEnd()();
96
+ i0.ɵɵelement(3, "i", 31);
97
+ i0.ɵɵelementStart(4, "span", 32);
98
+ i0.ɵɵtext(5);
99
+ i0.ɵɵelementEnd();
100
+ i0.ɵɵtemplate(6, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Conditional_6_Template, 3, 0, "span", 33)(7, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Conditional_7_Template, 2, 0, "button", 34);
101
+ i0.ɵɵelementEnd();
102
+ } if (rf & 2) {
103
+ const node_r7 = ctx.$implicit;
104
+ i0.ɵɵclassProp("already-added", node_r7.alreadyContainsArtifact);
105
+ i0.ɵɵadvance(2);
106
+ i0.ɵɵproperty("checked", node_r7.selected)("disabled", node_r7.alreadyContainsArtifact);
107
+ i0.ɵɵadvance();
108
+ i0.ɵɵstyleProp("color", node_r7.collection.Color || "#0076B6");
109
+ i0.ɵɵadvance(2);
110
+ i0.ɵɵtextInterpolate(node_r7.collection.Name);
111
+ i0.ɵɵadvance();
112
+ i0.ɵɵconditional(node_r7.alreadyContainsArtifact ? 6 : -1);
113
+ i0.ɵɵadvance();
114
+ i0.ɵɵconditional(node_r7.hasChildren ? 7 : -1);
115
+ } }
116
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_Template(rf, ctx) { if (rf & 1) {
117
+ i0.ɵɵrepeaterCreate(0, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_For_1_Template, 8, 9, "div", 27, _forTrack0);
118
+ } if (rf & 2) {
119
+ const ctx_r1 = i0.ɵɵnextContext(3);
120
+ i0.ɵɵrepeater(ctx_r1.displayedCollections);
121
+ } }
122
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Template(rf, ctx) { if (rf & 1) {
123
+ i0.ɵɵelementStart(0, "div", 21);
124
+ i0.ɵɵtemplate(1, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_1_Template, 4, 1, "div", 22)(2, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Conditional_2_Template, 2, 0);
125
+ i0.ɵɵelementEnd();
126
+ } if (rf & 2) {
127
+ const ctx_r1 = i0.ɵɵnextContext(2);
128
+ i0.ɵɵadvance();
129
+ i0.ɵɵconditional(ctx_r1.displayedCollections.length === 0 ? 1 : 2);
130
+ } }
131
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_7_Template(rf, ctx) { if (rf & 1) {
132
+ i0.ɵɵelementStart(0, "div", 9);
133
+ i0.ɵɵelement(1, "i", 38);
134
+ i0.ɵɵelementStart(2, "span");
135
+ i0.ɵɵtext(3, "Loading collections...");
136
+ i0.ɵɵelementEnd()();
137
+ } }
138
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_8_Template(rf, ctx) { if (rf & 1) {
139
+ i0.ɵɵelementStart(0, "div", 10);
140
+ i0.ɵɵelement(1, "i", 39);
141
+ i0.ɵɵelementStart(2, "span");
142
+ i0.ɵɵtext(3);
143
+ i0.ɵɵelementEnd()();
144
+ } if (rf & 2) {
145
+ const ctx_r1 = i0.ɵɵnextContext(2);
146
+ i0.ɵɵadvance(3);
147
+ i0.ɵɵtextInterpolate(ctx_r1.errorMessage);
148
+ } }
149
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_9_Template(rf, ctx) { if (rf & 1) {
150
+ i0.ɵɵelementStart(0, "div", 11);
151
+ i0.ɵɵelement(1, "i", 35);
152
+ i0.ɵɵelementStart(2, "span");
153
+ i0.ɵɵtext(3);
154
+ i0.ɵɵelementEnd()();
155
+ } if (rf & 2) {
156
+ const ctx_r1 = i0.ɵɵnextContext(2);
157
+ i0.ɵɵadvance(3);
158
+ i0.ɵɵtextInterpolate1("", ctx_r1.selectedCollections.length, " collection(s) selected");
159
+ } }
160
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_14_Template(rf, ctx) { if (rf & 1) {
161
+ const _r9 = i0.ɵɵgetCurrentView();
162
+ i0.ɵɵelementStart(0, "button", 40);
163
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_14_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r9); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.showCreateForm = true); });
164
+ i0.ɵɵelement(1, "i", 41);
165
+ i0.ɵɵtext(2, " Create New Collection ");
166
+ i0.ɵɵelementEnd();
167
+ } }
168
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Conditional_5_Template(rf, ctx) { if (rf & 1) {
169
+ i0.ɵɵelement(0, "i", 38);
170
+ } }
171
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Conditional_6_Template(rf, ctx) { if (rf & 1) {
172
+ i0.ɵɵtext(0, " Create ");
173
+ } }
174
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Template(rf, ctx) { if (rf & 1) {
175
+ const _r10 = i0.ɵɵgetCurrentView();
176
+ i0.ɵɵelementStart(0, "div", 15)(1, "input", 42, 0);
177
+ i0.ɵɵtwoWayListener("ngModelChange", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Template_input_ngModelChange_1_listener($event) { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.newCollectionName, $event) || (ctx_r1.newCollectionName = $event); return i0.ɵɵresetView($event); });
178
+ i0.ɵɵlistener("keydown.enter", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Template_input_keydown_enter_1_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.createCollection()); });
179
+ i0.ɵɵelementEnd();
180
+ i0.ɵɵelementStart(3, "div", 43)(4, "button", 44);
181
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.createCollection()); });
182
+ i0.ɵɵtemplate(5, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Conditional_5_Template, 1, 0, "i", 38)(6, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Conditional_6_Template, 1, 0);
183
+ i0.ɵɵelementEnd();
184
+ i0.ɵɵelementStart(7, "button", 45);
185
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Template_button_click_7_listener() { i0.ɵɵrestoreView(_r10); const ctx_r1 = i0.ɵɵnextContext(2); ctx_r1.showCreateForm = false; return i0.ɵɵresetView(ctx_r1.newCollectionName = ""); });
186
+ i0.ɵɵtext(8, " Cancel ");
187
+ i0.ɵɵelementEnd()()();
188
+ } if (rf & 2) {
189
+ const ctx_r1 = i0.ɵɵnextContext(2);
190
+ i0.ɵɵadvance();
191
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.newCollectionName);
192
+ i0.ɵɵadvance(3);
193
+ i0.ɵɵproperty("disabled", ctx_r1.isCreatingCollection || !ctx_r1.newCollectionName.trim());
194
+ i0.ɵɵadvance();
195
+ i0.ɵɵconditional(ctx_r1.isCreatingCollection ? 5 : 6);
196
+ } }
197
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_20_Template(rf, ctx) { if (rf & 1) {
198
+ i0.ɵɵelement(0, "i", 38);
199
+ i0.ɵɵtext(1, " Saving... ");
200
+ } }
201
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_21_Template(rf, ctx) { if (rf & 1) {
202
+ i0.ɵɵelement(0, "i", 46);
203
+ i0.ɵɵtext(1);
204
+ } if (rf & 2) {
205
+ const ctx_r1 = i0.ɵɵnextContext(2);
206
+ i0.ɵɵadvance();
207
+ i0.ɵɵtextInterpolate1(" Save to ", ctx_r1.selectedCollections.length, " Collection(s) ");
208
+ } }
209
+ function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Template(rf, ctx) { if (rf & 1) {
210
+ const _r1 = i0.ɵɵgetCurrentView();
211
+ i0.ɵɵelementStart(0, "kendo-dialog", 2);
212
+ i0.ɵɵlistener("close", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Template_kendo_dialog_close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCancel()); });
213
+ i0.ɵɵelementStart(1, "div", 3);
214
+ i0.ɵɵtemplate(2, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_2_Template, 6, 0, "div", 4);
215
+ i0.ɵɵelementStart(3, "div", 5);
216
+ i0.ɵɵelement(4, "i", 6);
217
+ i0.ɵɵelementStart(5, "input", 7);
218
+ i0.ɵɵtwoWayListener("ngModelChange", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Template_input_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.searchQuery, $event) || (ctx_r1.searchQuery = $event); return i0.ɵɵresetView($event); });
219
+ i0.ɵɵlistener("input", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Template_input_input_5_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSearchChange()); });
220
+ i0.ɵɵelementEnd()();
221
+ i0.ɵɵtemplate(6, ArtifactCollectionPickerModalComponent_kendo_dialog_0_div_6_Template, 3, 1, "div", 8)(7, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_7_Template, 4, 0, "div", 9)(8, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_8_Template, 4, 1, "div", 10)(9, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_9_Template, 4, 1, "div", 11);
222
+ i0.ɵɵelementStart(10, "div", 12)(11, "div", 13)(12, "span");
223
+ i0.ɵɵtext(13, "OR CREATE NEW");
224
+ i0.ɵɵelementEnd()();
225
+ i0.ɵɵtemplate(14, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_14_Template, 3, 0, "button", 14)(15, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_15_Template, 9, 3, "div", 15);
226
+ i0.ɵɵelementEnd()();
227
+ i0.ɵɵelementStart(16, "kendo-dialog-actions")(17, "button", 16);
228
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Template_button_click_17_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onCancel()); });
229
+ i0.ɵɵtext(18, " Cancel ");
230
+ i0.ɵɵelementEnd();
231
+ i0.ɵɵelementStart(19, "button", 17);
232
+ i0.ɵɵlistener("click", function ArtifactCollectionPickerModalComponent_kendo_dialog_0_Template_button_click_19_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onSave()); });
233
+ i0.ɵɵtemplate(20, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_20_Template, 2, 0)(21, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Conditional_21_Template, 2, 1);
234
+ i0.ɵɵelementEnd()()();
235
+ } if (rf & 2) {
236
+ const ctx_r1 = i0.ɵɵnextContext();
237
+ i0.ɵɵproperty("width", 700)("minWidth", 500);
238
+ i0.ɵɵadvance(2);
239
+ i0.ɵɵconditional(ctx_r1.navigationPath.length > 0 ? 2 : -1);
240
+ i0.ɵɵadvance(3);
241
+ i0.ɵɵtwoWayProperty("ngModel", ctx_r1.searchQuery);
242
+ i0.ɵɵproperty("disabled", ctx_r1.isLoading);
243
+ i0.ɵɵadvance();
244
+ i0.ɵɵproperty("ngIf", !ctx_r1.isLoading && !ctx_r1.errorMessage);
245
+ i0.ɵɵadvance();
246
+ i0.ɵɵconditional(ctx_r1.isLoading ? 7 : -1);
247
+ i0.ɵɵadvance();
248
+ i0.ɵɵconditional(ctx_r1.errorMessage ? 8 : -1);
249
+ i0.ɵɵadvance();
250
+ i0.ɵɵconditional(ctx_r1.selectedCollections.length > 0 ? 9 : -1);
251
+ i0.ɵɵadvance(5);
252
+ i0.ɵɵconditional(!ctx_r1.showCreateForm ? 14 : 15);
253
+ i0.ɵɵadvance(5);
254
+ i0.ɵɵproperty("primary", true)("disabled", ctx_r1.selectedCollections.length === 0 || ctx_r1.isSaving);
255
+ i0.ɵɵadvance();
256
+ i0.ɵɵconditional(ctx_r1.isSaving ? 20 : 21);
257
+ } }
258
+ /**
259
+ * Modal for selecting collections to save artifacts to.
260
+ * Features:
261
+ * - Permission-aware: only shows collections where user has Edit permission
262
+ * - Hierarchical navigation: start with root collections, drill down as needed
263
+ * - Search by name
264
+ * - Multi-selection support
265
+ * - Create new collection with proper permission logic
266
+ */
267
+ export class ArtifactCollectionPickerModalComponent {
268
+ toastService;
269
+ permissionService;
270
+ isOpen = false;
271
+ environmentId;
272
+ currentUser;
273
+ excludeCollectionIds = []; // Collections to exclude (e.g., already contains artifact)
274
+ saved = new EventEmitter(); // Emits selected collection IDs
275
+ cancelled = new EventEmitter();
276
+ allCollections = [];
277
+ displayedCollections = [];
278
+ selectedCollections = [];
279
+ userPermissions = new Map();
280
+ navigationPath = []; // Breadcrumb trail
281
+ currentParentId = null;
282
+ currentParentCollection = undefined;
283
+ searchQuery = '';
284
+ isLoading = false;
285
+ isSaving = false;
286
+ errorMessage = '';
287
+ // Create collection form state
288
+ showCreateForm = false;
289
+ newCollectionName = '';
290
+ isCreatingCollection = false;
291
+ constructor(toastService, permissionService) {
292
+ this.toastService = toastService;
293
+ this.permissionService = permissionService;
294
+ }
295
+ async ngOnInit() {
296
+ if (this.isOpen) {
297
+ await this.loadCollections();
298
+ }
299
+ }
300
+ async ngOnChanges(changes) {
301
+ if (changes['isOpen'] && this.isOpen) {
302
+ this.reset();
303
+ await this.loadCollections();
304
+ }
305
+ }
306
+ reset() {
307
+ this.allCollections = [];
308
+ this.displayedCollections = [];
309
+ this.selectedCollections = [];
310
+ this.userPermissions.clear();
311
+ this.navigationPath = [];
312
+ this.currentParentId = null;
313
+ this.currentParentCollection = undefined;
314
+ this.searchQuery = '';
315
+ this.errorMessage = '';
316
+ }
317
+ async loadCollections() {
318
+ try {
319
+ this.isLoading = true;
320
+ this.errorMessage = '';
321
+ // Load all collections in environment
322
+ const rv = new RunView();
323
+ const result = await rv.RunView({
324
+ EntityName: 'MJ: Collections',
325
+ ExtraFilter: `EnvironmentID='${this.environmentId}'`,
326
+ OrderBy: 'Name ASC',
327
+ ResultType: 'entity_object'
328
+ }, this.currentUser);
329
+ if (!result.Success) {
330
+ this.errorMessage = result.ErrorMessage || 'Failed to load collections';
331
+ return;
332
+ }
333
+ this.allCollections = result.Results || [];
334
+ // Load user permissions for all collections
335
+ await this.loadUserPermissions();
336
+ // Filter to collections with Edit permission
337
+ // Include collections that already contain the artifact (will be shown as disabled)
338
+ const editableCollections = this.allCollections.filter(c => {
339
+ return this.canEdit(c);
340
+ });
341
+ // Show root collections initially
342
+ this.displayRootCollections(editableCollections);
343
+ }
344
+ catch (error) {
345
+ console.error('Error loading collections:', error);
346
+ this.errorMessage = 'An error occurred while loading collections';
347
+ }
348
+ finally {
349
+ this.isLoading = false;
350
+ }
351
+ }
352
+ async loadUserPermissions() {
353
+ // Load permissions for collections not owned by current user
354
+ const nonOwnedCollections = this.allCollections.filter(c => c.OwnerID && c.OwnerID !== this.currentUser.ID);
355
+ if (nonOwnedCollections.length === 0) {
356
+ return;
357
+ }
358
+ const collectionIds = nonOwnedCollections.map(c => c.ID);
359
+ const permissions = await this.permissionService.checkBulkPermissions(collectionIds, this.currentUser.ID, this.currentUser);
360
+ permissions.forEach((permission, collectionId) => {
361
+ this.userPermissions.set(collectionId, permission);
362
+ });
363
+ }
364
+ displayRootCollections(editableCollections) {
365
+ const rootCollections = editableCollections.filter(c => !c.ParentID);
366
+ this.displayedCollections = rootCollections.map(c => this.createNode(c, editableCollections));
367
+ }
368
+ displayChildCollections(parentId, editableCollections) {
369
+ const childCollections = editableCollections.filter(c => c.ParentID === parentId);
370
+ this.displayedCollections = childCollections.map(c => this.createNode(c, editableCollections));
371
+ }
372
+ createNode(collection, allEditableCollections) {
373
+ const hasChildren = allEditableCollections.some(c => c.ParentID === collection.ID);
374
+ const alreadyContainsArtifact = this.excludeCollectionIds.includes(collection.ID);
375
+ return {
376
+ collection,
377
+ selected: this.selectedCollections.some(sc => sc.ID === collection.ID),
378
+ hasChildren,
379
+ alreadyContainsArtifact
380
+ };
381
+ }
382
+ canEdit(collection) {
383
+ // Backwards compatibility: treat null OwnerID as owned by current user
384
+ if (!collection.OwnerID || collection.OwnerID === this.currentUser.ID) {
385
+ return true;
386
+ }
387
+ // Check permission record
388
+ const permission = this.userPermissions.get(collection.ID);
389
+ return permission?.canEdit || false;
390
+ }
391
+ toggleSelection(node) {
392
+ // Don't allow selection of collections that already contain the artifact
393
+ if (node.alreadyContainsArtifact) {
394
+ return;
395
+ }
396
+ const index = this.selectedCollections.findIndex(c => c.ID === node.collection.ID);
397
+ if (index >= 0) {
398
+ this.selectedCollections.splice(index, 1);
399
+ node.selected = false;
400
+ }
401
+ else {
402
+ this.selectedCollections.push(node.collection);
403
+ node.selected = true;
404
+ }
405
+ }
406
+ drillIntoCollection(collection) {
407
+ // Add current location to navigation path
408
+ const editableCollections = this.allCollections.filter(c => {
409
+ return this.canEdit(c);
410
+ });
411
+ const node = this.createNode(collection, editableCollections);
412
+ this.navigationPath.push(node);
413
+ this.currentParentId = collection.ID;
414
+ this.currentParentCollection = collection;
415
+ // Display child collections
416
+ this.displayChildCollections(collection.ID, editableCollections);
417
+ // Clear search when drilling down
418
+ this.searchQuery = '';
419
+ }
420
+ navigateToRoot() {
421
+ this.navigationPath = [];
422
+ this.currentParentId = null;
423
+ this.currentParentCollection = undefined;
424
+ const editableCollections = this.allCollections.filter(c => {
425
+ return this.canEdit(c);
426
+ });
427
+ this.displayRootCollections(editableCollections);
428
+ this.searchQuery = '';
429
+ }
430
+ navigateToCollection(collection) {
431
+ // Find the index of this collection in the navigation path
432
+ const index = this.navigationPath.findIndex(n => n.collection.ID === collection.ID);
433
+ if (index >= 0) {
434
+ // Trim navigation path to this level
435
+ this.navigationPath = this.navigationPath.slice(0, index + 1);
436
+ this.currentParentId = collection.ID;
437
+ this.currentParentCollection = collection;
438
+ const editableCollections = this.allCollections.filter(c => {
439
+ return this.canEdit(c);
440
+ });
441
+ this.displayChildCollections(collection.ID, editableCollections);
442
+ this.searchQuery = '';
443
+ }
444
+ }
445
+ onSearchChange() {
446
+ if (!this.searchQuery.trim()) {
447
+ // Reset to current navigation context
448
+ if (this.currentParentId) {
449
+ const editableCollections = this.allCollections.filter(c => {
450
+ return this.canEdit(c);
451
+ });
452
+ this.displayChildCollections(this.currentParentId, editableCollections);
453
+ }
454
+ else {
455
+ const editableCollections = this.allCollections.filter(c => {
456
+ return this.canEdit(c);
457
+ });
458
+ this.displayRootCollections(editableCollections);
459
+ }
460
+ return;
461
+ }
462
+ // Search across all editable collections
463
+ const query = this.searchQuery.toLowerCase();
464
+ const editableCollections = this.allCollections.filter(c => {
465
+ return this.canEdit(c) && c.Name.toLowerCase().includes(query);
466
+ });
467
+ this.displayedCollections = editableCollections.map(c => this.createNode(c, editableCollections));
468
+ }
469
+ async createCollection() {
470
+ if (!this.newCollectionName.trim()) {
471
+ this.toastService.warning('Please enter a collection name');
472
+ return;
473
+ }
474
+ try {
475
+ this.isCreatingCollection = true;
476
+ const md = new Metadata();
477
+ const collection = await md.GetEntityObject('MJ: Collections', this.currentUser);
478
+ collection.Name = this.newCollectionName.trim();
479
+ collection.EnvironmentID = this.environmentId;
480
+ // Set parent and owner based on current navigation context
481
+ if (this.currentParentCollection) {
482
+ // Creating sub-collection - inherit parent's owner
483
+ collection.ParentID = this.currentParentCollection.ID;
484
+ collection.OwnerID = this.currentParentCollection.OwnerID || this.currentUser.ID;
485
+ }
486
+ else {
487
+ // Creating root collection - current user becomes owner
488
+ collection.OwnerID = this.currentUser.ID;
489
+ }
490
+ const saved = await collection.Save();
491
+ if (saved) {
492
+ // Create owner permission or copy parent permissions
493
+ if (this.currentParentCollection) {
494
+ // Copy permissions from parent
495
+ await this.permissionService.copyParentPermissions(this.currentParentCollection.ID, collection.ID, this.currentUser);
496
+ }
497
+ else {
498
+ // Create owner permission
499
+ await this.permissionService.createOwnerPermission(collection.ID, this.currentUser.ID, this.currentUser);
500
+ }
501
+ this.toastService.success('Collection created successfully');
502
+ // Reset form
503
+ this.showCreateForm = false;
504
+ this.newCollectionName = '';
505
+ // Reload collections to include the new one
506
+ await this.loadCollections();
507
+ // Auto-select the newly created collection
508
+ this.selectedCollections.push(collection);
509
+ }
510
+ else {
511
+ this.toastService.error(collection.LatestResult?.Message || 'Failed to create collection');
512
+ }
513
+ }
514
+ catch (error) {
515
+ console.error('Error creating collection:', error);
516
+ this.toastService.error('An error occurred while creating the collection');
517
+ }
518
+ finally {
519
+ this.isCreatingCollection = false;
520
+ }
521
+ }
522
+ async onSave() {
523
+ if (this.selectedCollections.length === 0) {
524
+ this.toastService.warning('Please select at least one collection');
525
+ return;
526
+ }
527
+ this.isSaving = true;
528
+ // Emit the selected collection IDs
529
+ const collectionIds = this.selectedCollections.map(c => c.ID);
530
+ this.saved.emit(collectionIds);
531
+ // Note: Parent component will handle the actual saving and close the modal
532
+ }
533
+ onCancel() {
534
+ this.cancelled.emit();
535
+ }
536
+ static ɵfac = function ArtifactCollectionPickerModalComponent_Factory(t) { return new (t || ArtifactCollectionPickerModalComponent)(i0.ɵɵdirectiveInject(i1.ToastService), i0.ɵɵdirectiveInject(i2.CollectionPermissionService)); };
537
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ArtifactCollectionPickerModalComponent, selectors: [["mj-artifact-collection-picker-modal"]], inputs: { isOpen: "isOpen", environmentId: "environmentId", currentUser: "currentUser", excludeCollectionIds: "excludeCollectionIds" }, outputs: { saved: "saved", cancelled: "cancelled" }, standalone: true, features: [i0.ɵɵNgOnChangesFeature, i0.ɵɵStandaloneFeature], decls: 1, vars: 1, consts: [["newCollectionInput", ""], ["title", "Save to Collection", 3, "width", "minWidth", "close", 4, "ngIf"], ["title", "Save to Collection", 3, "close", "width", "minWidth"], [1, "picker-modal"], [1, "breadcrumb-nav"], [1, "search-bar"], [1, "fas", "fa-search", "search-icon"], ["type", "text", "placeholder", "Search collections...", 1, "k-textbox", "search-input", 3, "ngModelChange", "input", "ngModel", "disabled"], ["class", "collections-list", 4, "ngIf"], [1, "loading-state"], [1, "error-state"], [1, "selected-summary"], [1, "create-section"], [1, "divider"], [1, "btn-create-collection"], [1, "create-form"], ["kendoButton", "", 3, "click"], ["kendoButton", "", 3, "click", "primary", "disabled"], [1, "breadcrumb-btn", 3, "click"], [1, "fas", "fa-home"], [1, "fas", "fa-chevron-right", "breadcrumb-separator"], [1, "collections-list"], [1, "empty-state"], [1, "fas", "fa-search"], [1, "fas", "fa-folder-open"], [1, "fas", "fa-folder"], [1, "hint"], [1, "collection-item", 3, "already-added"], [1, "collection-item", 3, "click"], [1, "collection-checkbox"], ["type", "checkbox", 3, "click", "checked", "disabled"], [1, "fas", "fa-folder", "collection-icon"], [1, "collection-name"], [1, "already-added-badge"], ["title", "View sub-collections", 1, "drill-down-btn"], [1, "fas", "fa-check-circle"], ["title", "View sub-collections", 1, "drill-down-btn", 3, "click"], [1, "fas", "fa-chevron-right"], [1, "fas", "fa-spinner", "fa-spin"], [1, "fas", "fa-exclamation-triangle"], [1, "btn-create-collection", 3, "click"], [1, "fas", "fa-plus"], ["type", "text", "placeholder", "Enter collection name", 1, "k-textbox", "create-input", 3, "ngModelChange", "keydown.enter", "ngModel"], [1, "create-actions"], ["kendoButton", "", 1, "btn-create", 3, "click", "disabled"], ["kendoButton", "", 1, "btn-cancel", 3, "click"], [1, "fas", "fa-save"]], template: function ArtifactCollectionPickerModalComponent_Template(rf, ctx) { if (rf & 1) {
538
+ i0.ɵɵtemplate(0, ArtifactCollectionPickerModalComponent_kendo_dialog_0_Template, 22, 13, "kendo-dialog", 1);
539
+ } if (rf & 2) {
540
+ i0.ɵɵproperty("ngIf", ctx.isOpen);
541
+ } }, dependencies: [CommonModule, i3.NgIf, FormsModule, i4.DefaultValueAccessor, i4.NgControlStatus, i4.NgModel, DialogModule, i5.DialogComponent, i5.DialogActionsComponent, ButtonsModule, i6.ButtonComponent, InputsModule], styles: [".picker-modal[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 20px 0;\n min-height: 400px;\n max-height: 600px;\n }\n\n .breadcrumb-nav[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px;\n background: #F9FAFB;\n border: 1px solid #E5E7EB;\n border-radius: 6px;\n overflow-x: auto;\n }\n\n .breadcrumb-btn[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 8px;\n background: transparent;\n border: none;\n border-radius: 4px;\n color: #0076B6;\n cursor: pointer;\n white-space: nowrap;\n font-size: 14px;\n }\n\n .breadcrumb-btn[_ngcontent-%COMP%]:hover {\n background: #E5E7EB;\n }\n\n .breadcrumb-separator[_ngcontent-%COMP%] {\n color: #9CA3AF;\n font-size: 12px;\n }\n\n .search-bar[_ngcontent-%COMP%] {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n .search-icon[_ngcontent-%COMP%] {\n position: absolute;\n left: 12px;\n color: #9CA3AF;\n pointer-events: none;\n }\n\n .search-input[_ngcontent-%COMP%] {\n width: 100%;\n padding-left: 36px;\n }\n\n .collections-list[_ngcontent-%COMP%] {\n flex: 1;\n overflow-y: auto;\n border: 1px solid #E5E7EB;\n border-radius: 6px;\n min-height: 250px;\n max-height: 350px;\n }\n\n .collection-item[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px 16px;\n border-bottom: 1px solid #F3F4F6;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .collection-item[_ngcontent-%COMP%]:hover {\n background: #F9FAFB;\n }\n\n .collection-item[_ngcontent-%COMP%]:last-child {\n border-bottom: none;\n }\n\n .collection-item.already-added[_ngcontent-%COMP%] {\n background: #F9FAFB;\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n .collection-item.already-added[_ngcontent-%COMP%]:hover {\n background: #F9FAFB;\n }\n\n .collection-checkbox[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n }\n\n .collection-checkbox[_ngcontent-%COMP%] input[type=\"checkbox\"][_ngcontent-%COMP%] {\n width: 18px;\n height: 18px;\n cursor: pointer;\n }\n\n .collection-icon[_ngcontent-%COMP%] {\n font-size: 18px;\n flex-shrink: 0;\n }\n\n .collection-name[_ngcontent-%COMP%] {\n flex: 1;\n font-size: 14px;\n color: #1F2937;\n }\n\n .already-added-badge[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px 8px;\n background: #DBEAFE;\n border: 1px solid #93C5FD;\n border-radius: 12px;\n color: #1E40AF;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n }\n\n .already-added-badge[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 12px;\n color: #2563EB;\n }\n\n .drill-down-btn[_ngcontent-%COMP%] {\n padding: 6px 10px;\n background: transparent;\n border: 1px solid #D1D5DB;\n border-radius: 4px;\n color: #6B7280;\n cursor: pointer;\n transition: all 0.2s;\n }\n\n .drill-down-btn[_ngcontent-%COMP%]:hover {\n background: #F3F4F6;\n border-color: #9CA3AF;\n color: #374151;\n }\n\n .empty-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 48px 24px;\n color: #6B7280;\n text-align: center;\n }\n\n .empty-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 48px;\n margin-bottom: 16px;\n opacity: 0.4;\n }\n\n .empty-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 4px 0;\n font-size: 14px;\n }\n\n .empty-state[_ngcontent-%COMP%] .hint[_ngcontent-%COMP%] {\n font-size: 13px;\n color: #9CA3AF;\n }\n\n .loading-state[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 48px 24px;\n gap: 12px;\n color: #6B7280;\n }\n\n .loading-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%], .error-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 32px;\n }\n\n .error-state[_ngcontent-%COMP%] {\n color: #DC2626;\n }\n\n .selected-summary[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px;\n background: #DBEAFE;\n border: 1px solid #93C5FD;\n border-radius: 6px;\n color: #1E40AF;\n font-size: 14px;\n font-weight: 500;\n }\n\n .selected-summary[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n color: #2563EB;\n }\n\n .create-section[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .divider[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n text-align: center;\n color: #9CA3AF;\n font-size: 12px;\n font-weight: 500;\n }\n\n .divider[_ngcontent-%COMP%]::before, \n .divider[_ngcontent-%COMP%]::after {\n content: '';\n flex: 1;\n border-bottom: 1px solid #E5E7EB;\n }\n\n .divider[_ngcontent-%COMP%] span[_ngcontent-%COMP%] {\n padding: 0 12px;\n }\n\n .btn-create-collection[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 10px 16px;\n background: #F9FAFB;\n border: 2px dashed #D1D5DB;\n border-radius: 6px;\n color: #0076B6;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n }\n\n .btn-create-collection[_ngcontent-%COMP%]:hover {\n background: #F3F4F6;\n border-color: #0076B6;\n }\n\n .btn-create-collection[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 16px;\n }\n\n .create-form[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n background: #F9FAFB;\n border: 1px solid #E5E7EB;\n border-radius: 6px;\n }\n\n .create-input[_ngcontent-%COMP%] {\n width: 100%;\n }\n\n .create-actions[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n }\n\n .btn-create[_ngcontent-%COMP%], .btn-cancel[_ngcontent-%COMP%] {\n padding: 8px 16px;\n font-size: 14px;\n }"] });
542
+ }
543
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ArtifactCollectionPickerModalComponent, [{
544
+ type: Component,
545
+ args: [{ selector: 'mj-artifact-collection-picker-modal', standalone: true, imports: [
546
+ CommonModule,
547
+ FormsModule,
548
+ DialogModule,
549
+ ButtonsModule,
550
+ InputsModule
551
+ ], template: `
552
+ <kendo-dialog
553
+ *ngIf="isOpen"
554
+ title="Save to Collection"
555
+ (close)="onCancel()"
556
+ [width]="700"
557
+ [minWidth]="500">
558
+ <div class="picker-modal">
559
+ <!-- Breadcrumb Navigation -->
560
+ @if (navigationPath.length > 0) {
561
+ <div class="breadcrumb-nav">
562
+ <button class="breadcrumb-btn" (click)="navigateToRoot()">
563
+ <i class="fas fa-home"></i> Root
564
+ </button>
565
+ @for (item of navigationPath; track item.collection.ID) {
566
+ <i class="fas fa-chevron-right breadcrumb-separator"></i>
567
+ <button class="breadcrumb-btn" (click)="navigateToCollection(item.collection)">
568
+ {{ item.collection.Name }}
569
+ </button>
570
+ }
571
+ </div>
572
+ }
573
+
574
+ <!-- Search Bar -->
575
+ <div class="search-bar">
576
+ <i class="fas fa-search search-icon"></i>
577
+ <input
578
+ type="text"
579
+ class="k-textbox search-input"
580
+ [(ngModel)]="searchQuery"
581
+ (input)="onSearchChange()"
582
+ placeholder="Search collections..."
583
+ [disabled]="isLoading">
584
+ </div>
585
+
586
+ <!-- Collections List -->
587
+ <div class="collections-list" *ngIf="!isLoading && !errorMessage">
588
+ @if (displayedCollections.length === 0) {
589
+ <div class="empty-state">
590
+ @if (searchQuery) {
591
+ <i class="fas fa-search"></i>
592
+ <p>No collections found matching "{{ searchQuery }}"</p>
593
+ } @else if (currentParentId) {
594
+ <i class="fas fa-folder-open"></i>
595
+ <p>No sub-collections available</p>
596
+ } @else {
597
+ <i class="fas fa-folder"></i>
598
+ <p>No collections available</p>
599
+ <p class="hint">Create a new collection to get started</p>
600
+ }
601
+ </div>
602
+ } @else {
603
+ @for (node of displayedCollections; track node.collection.ID) {
604
+ <div class="collection-item"
605
+ [class.already-added]="node.alreadyContainsArtifact"
606
+ (click)="toggleSelection(node)">
607
+ <div class="collection-checkbox">
608
+ <input
609
+ type="checkbox"
610
+ [checked]="node.selected"
611
+ [disabled]="node.alreadyContainsArtifact"
612
+ (click)="$event.stopPropagation(); toggleSelection(node)">
613
+ </div>
614
+ <i class="fas fa-folder collection-icon" [style.color]="node.collection.Color || '#0076B6'"></i>
615
+ <span class="collection-name">{{ node.collection.Name }}</span>
616
+ @if (node.alreadyContainsArtifact) {
617
+ <span class="already-added-badge">
618
+ <i class="fas fa-check-circle"></i> Already added
619
+ </span>
620
+ }
621
+ @if (node.hasChildren) {
622
+ <button
623
+ class="drill-down-btn"
624
+ (click)="$event.stopPropagation(); drillIntoCollection(node.collection)"
625
+ title="View sub-collections">
626
+ <i class="fas fa-chevron-right"></i>
627
+ </button>
628
+ }
629
+ </div>
630
+ }
631
+ }
632
+ </div>
633
+
634
+ <!-- Loading State -->
635
+ @if (isLoading) {
636
+ <div class="loading-state">
637
+ <i class="fas fa-spinner fa-spin"></i>
638
+ <span>Loading collections...</span>
639
+ </div>
640
+ }
641
+
642
+ <!-- Error State -->
643
+ @if (errorMessage) {
644
+ <div class="error-state">
645
+ <i class="fas fa-exclamation-triangle"></i>
646
+ <span>{{ errorMessage }}</span>
647
+ </div>
648
+ }
649
+
650
+ <!-- Selected Collections Summary -->
651
+ @if (selectedCollections.length > 0) {
652
+ <div class="selected-summary">
653
+ <i class="fas fa-check-circle"></i>
654
+ <span>{{ selectedCollections.length }} collection(s) selected</span>
655
+ </div>
656
+ }
657
+
658
+ <!-- Create New Collection Section -->
659
+ <div class="create-section">
660
+ <div class="divider">
661
+ <span>OR CREATE NEW</span>
662
+ </div>
663
+ @if (!showCreateForm) {
664
+ <button class="btn-create-collection" (click)="showCreateForm = true">
665
+ <i class="fas fa-plus"></i>
666
+ Create New Collection
667
+ </button>
668
+ } @else {
669
+ <div class="create-form">
670
+ <input
671
+ type="text"
672
+ class="k-textbox create-input"
673
+ [(ngModel)]="newCollectionName"
674
+ placeholder="Enter collection name"
675
+ (keydown.enter)="createCollection()"
676
+ #newCollectionInput>
677
+ <div class="create-actions">
678
+ <button class="btn-create" kendoButton (click)="createCollection()" [disabled]="isCreatingCollection || !newCollectionName.trim()">
679
+ @if (isCreatingCollection) {
680
+ <i class="fas fa-spinner fa-spin"></i>
681
+ } @else {
682
+ Create
683
+ }
684
+ </button>
685
+ <button class="btn-cancel" kendoButton (click)="showCreateForm = false; newCollectionName = ''">
686
+ Cancel
687
+ </button>
688
+ </div>
689
+ </div>
690
+ }
691
+ </div>
692
+ </div>
693
+
694
+ <kendo-dialog-actions>
695
+ <button kendoButton (click)="onCancel()">
696
+ Cancel
697
+ </button>
698
+ <button kendoButton
699
+ [primary]="true"
700
+ (click)="onSave()"
701
+ [disabled]="selectedCollections.length === 0 || isSaving">
702
+ @if (isSaving) {
703
+ <i class="fas fa-spinner fa-spin"></i> Saving...
704
+ } @else {
705
+ <i class="fas fa-save"></i> Save to {{ selectedCollections.length }} Collection(s)
706
+ }
707
+ </button>
708
+ </kendo-dialog-actions>
709
+ </kendo-dialog>
710
+ `, styles: ["\n .picker-modal {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: 20px 0;\n min-height: 400px;\n max-height: 600px;\n }\n\n .breadcrumb-nav {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px;\n background: #F9FAFB;\n border: 1px solid #E5E7EB;\n border-radius: 6px;\n overflow-x: auto;\n }\n\n .breadcrumb-btn {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 4px 8px;\n background: transparent;\n border: none;\n border-radius: 4px;\n color: #0076B6;\n cursor: pointer;\n white-space: nowrap;\n font-size: 14px;\n }\n\n .breadcrumb-btn:hover {\n background: #E5E7EB;\n }\n\n .breadcrumb-separator {\n color: #9CA3AF;\n font-size: 12px;\n }\n\n .search-bar {\n position: relative;\n display: flex;\n align-items: center;\n }\n\n .search-icon {\n position: absolute;\n left: 12px;\n color: #9CA3AF;\n pointer-events: none;\n }\n\n .search-input {\n width: 100%;\n padding-left: 36px;\n }\n\n .collections-list {\n flex: 1;\n overflow-y: auto;\n border: 1px solid #E5E7EB;\n border-radius: 6px;\n min-height: 250px;\n max-height: 350px;\n }\n\n .collection-item {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 12px 16px;\n border-bottom: 1px solid #F3F4F6;\n cursor: pointer;\n transition: background 0.2s;\n }\n\n .collection-item:hover {\n background: #F9FAFB;\n }\n\n .collection-item:last-child {\n border-bottom: none;\n }\n\n .collection-item.already-added {\n background: #F9FAFB;\n opacity: 0.7;\n cursor: not-allowed;\n }\n\n .collection-item.already-added:hover {\n background: #F9FAFB;\n }\n\n .collection-checkbox {\n display: flex;\n align-items: center;\n }\n\n .collection-checkbox input[type=\"checkbox\"] {\n width: 18px;\n height: 18px;\n cursor: pointer;\n }\n\n .collection-icon {\n font-size: 18px;\n flex-shrink: 0;\n }\n\n .collection-name {\n flex: 1;\n font-size: 14px;\n color: #1F2937;\n }\n\n .already-added-badge {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 4px 8px;\n background: #DBEAFE;\n border: 1px solid #93C5FD;\n border-radius: 12px;\n color: #1E40AF;\n font-size: 12px;\n font-weight: 500;\n white-space: nowrap;\n }\n\n .already-added-badge i {\n font-size: 12px;\n color: #2563EB;\n }\n\n .drill-down-btn {\n padding: 6px 10px;\n background: transparent;\n border: 1px solid #D1D5DB;\n border-radius: 4px;\n color: #6B7280;\n cursor: pointer;\n transition: all 0.2s;\n }\n\n .drill-down-btn:hover {\n background: #F3F4F6;\n border-color: #9CA3AF;\n color: #374151;\n }\n\n .empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 48px 24px;\n color: #6B7280;\n text-align: center;\n }\n\n .empty-state i {\n font-size: 48px;\n margin-bottom: 16px;\n opacity: 0.4;\n }\n\n .empty-state p {\n margin: 4px 0;\n font-size: 14px;\n }\n\n .empty-state .hint {\n font-size: 13px;\n color: #9CA3AF;\n }\n\n .loading-state, .error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n padding: 48px 24px;\n gap: 12px;\n color: #6B7280;\n }\n\n .loading-state i, .error-state i {\n font-size: 32px;\n }\n\n .error-state {\n color: #DC2626;\n }\n\n .selected-summary {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 12px 16px;\n background: #DBEAFE;\n border: 1px solid #93C5FD;\n border-radius: 6px;\n color: #1E40AF;\n font-size: 14px;\n font-weight: 500;\n }\n\n .selected-summary i {\n color: #2563EB;\n }\n\n .create-section {\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .divider {\n display: flex;\n align-items: center;\n text-align: center;\n color: #9CA3AF;\n font-size: 12px;\n font-weight: 500;\n }\n\n .divider::before,\n .divider::after {\n content: '';\n flex: 1;\n border-bottom: 1px solid #E5E7EB;\n }\n\n .divider span {\n padding: 0 12px;\n }\n\n .btn-create-collection {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 10px 16px;\n background: #F9FAFB;\n border: 2px dashed #D1D5DB;\n border-radius: 6px;\n color: #0076B6;\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n }\n\n .btn-create-collection:hover {\n background: #F3F4F6;\n border-color: #0076B6;\n }\n\n .btn-create-collection i {\n font-size: 16px;\n }\n\n .create-form {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n background: #F9FAFB;\n border: 1px solid #E5E7EB;\n border-radius: 6px;\n }\n\n .create-input {\n width: 100%;\n }\n\n .create-actions {\n display: flex;\n gap: 8px;\n justify-content: flex-end;\n }\n\n .btn-create, .btn-cancel {\n padding: 8px 16px;\n font-size: 14px;\n }\n "] }]
711
+ }], () => [{ type: i1.ToastService }, { type: i2.CollectionPermissionService }], { isOpen: [{
712
+ type: Input
713
+ }], environmentId: [{
714
+ type: Input
715
+ }], currentUser: [{
716
+ type: Input
717
+ }], excludeCollectionIds: [{
718
+ type: Input
719
+ }], saved: [{
720
+ type: Output
721
+ }], cancelled: [{
722
+ type: Output
723
+ }] }); })();
724
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ArtifactCollectionPickerModalComponent, { className: "ArtifactCollectionPickerModalComponent", filePath: "src/lib/components/collection/artifact-collection-picker-modal.component.ts", lineNumber: 492 }); })();
725
+ //# sourceMappingURL=artifact-collection-picker-modal.component.js.map