cat-documents-ng 1.0.30 → 1.0.32

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.
@@ -49,7 +49,5 @@ export declare class ERRORS {
49
49
  static ERROR_CALLING_API_WITH_SELECTION: string;
50
50
  static ERROR_FILE_NAME_INVALID_CHARACTERS: string;
51
51
  static ERROR_FILE_NAME_EMPTY: string;
52
- static ERROR_SUMMARY_GENERATION: string;
53
- static ERROR_INSIGHTS_GENERATION: string;
54
52
  static ERROR_QUESTION_GENERATION: string;
55
53
  }
@@ -123,7 +123,5 @@ export declare class URLS {
123
123
  static CONVERT_TO_PDF: string;
124
124
  static BROKER_DOCUMENT_CATAGORIES: string;
125
125
  static BROKER_DOCUMENT_TYPES: string;
126
- static AI_SUMMARY: string;
127
- static AI_INSIGHTS: string;
128
126
  static AI_QUESTION: string;
129
127
  }
@@ -981,8 +981,6 @@ class ERRORS {
981
981
  static ERROR_CALLING_API_WITH_SELECTION = 'Error calling API with selection:';
982
982
  static ERROR_FILE_NAME_INVALID_CHARACTERS = 'File name contains invalid characters (< > : " / \\ | ? *)';
983
983
  static ERROR_FILE_NAME_EMPTY = 'File name cannot be empty';
984
- static ERROR_SUMMARY_GENERATION = 'Summary cannot be generated.';
985
- static ERROR_INSIGHTS_GENERATION = 'Insights cannot be generated.';
986
984
  static ERROR_QUESTION_GENERATION = 'Question cannot be generated.';
987
985
  }
988
986
 
@@ -1111,9 +1109,7 @@ class URLS {
1111
1109
  static CONVERT_TO_PDF = "documents/convert-email-to-pdf";
1112
1110
  static BROKER_DOCUMENT_CATAGORIES = "documentTypes/getAllCategoriesForBrokerBySource/";
1113
1111
  static BROKER_DOCUMENT_TYPES = "documentTypes/getAllDocumentTypesForBrokerByCategoryId/";
1114
- static AI_SUMMARY = "summarize/";
1115
- static AI_INSIGHTS = "getInsights/";
1116
- static AI_QUESTION = "questions/";
1112
+ static AI_QUESTION = "question/";
1117
1113
  }
1118
1114
 
1119
1115
  /**
@@ -1435,34 +1431,9 @@ class DocumentHttpService {
1435
1431
  get documentIntelligenceApiUrl() {
1436
1432
  return this.appConfigService.documentIntelligenceApiUrl;
1437
1433
  }
1438
- /**
1439
- * Calls AI summary endpoint for a document.
1440
- * @param {string} documentId - The document ID to summarize.
1441
- * @returns {Observable<AiSummaryResponse>} AI summary response.
1442
- */
1443
- getAiSummary(documentId) {
1444
- if (!documentId || !this.documentIntelligenceApiUrl) {
1445
- return throwError(() => new Error(ERRORS.ERROR_SUMMARY_GENERATION));
1446
- }
1447
- return this.http.post(`${this.documentIntelligenceApiUrl}${URLS.AI_SUMMARY}${documentId}`, '').pipe(catchError((error) => {
1448
- return throwError(() => new Error(error));
1449
- }));
1450
- }
1451
- /**
1452
- * Calls AI insights endpoint for a document.
1453
- * @param {string} documentId - The document ID to generate insights for.
1454
- * @returns {Observable<AiInsightsResponse>} AI insights response.
1455
- */
1456
- getAiInsights(documentId) {
1457
- if (!documentId || !this.documentIntelligenceApiUrl) {
1458
- return throwError(() => new Error(ERRORS.ERROR_INSIGHTS_GENERATION));
1459
- }
1460
- return this.http.post(`${this.documentIntelligenceApiUrl}${URLS.AI_INSIGHTS}${documentId}`, '').pipe(catchError((error) => {
1461
- return throwError(() => new Error(error));
1462
- }));
1463
- }
1464
1434
  /**
1465
1435
  * Calls AI question endpoint for chat answers.
1436
+ * Uses same HttpClient as getDocumentHistoryByDocumentId; host app interceptor supplies Authorization Bearer.
1466
1437
  * @param {string} documentId - The document ID used for context.
1467
1438
  * @param {string} question - The question asked by the user.
1468
1439
  * @returns {Observable<AiQuestionResponse>} AI question answer response.
@@ -6660,7 +6631,7 @@ class DocumentHistoryAiService {
6660
6631
  state = {
6661
6632
  showAiMenu: false,
6662
6633
  showAiSidebar: false,
6663
- aiSidebarHeader: 'Summary',
6634
+ aiSidebarHeader: 'Query',
6664
6635
  aiContent: '',
6665
6636
  aiContentHtml: '',
6666
6637
  aiLoading: false,
@@ -6689,17 +6660,13 @@ class DocumentHistoryAiService {
6689
6660
  this.state.showAiMenu = false;
6690
6661
  }
6691
6662
  /**
6692
- * Opens AI sidebar and loads selected section data.
6693
- * @param {'Summary' | 'Query' | 'Insights'} section - Selected AI section.
6663
+ * Opens AI sidebar for Query panel.
6664
+ * @param {'Query'} section - AI section (Query only).
6694
6665
  * @param {any} selectedDocument - Selected document object.
6695
6666
  */
6696
6667
  openAiPanel(section, selectedDocument) {
6697
- this.initializePanel(section);
6698
- if (section === 'Query') {
6699
- this.resetQueryState();
6700
- return;
6701
- }
6702
- this.loadAiContent(section, selectedDocument);
6668
+ this.initializePanel();
6669
+ this.resetQueryState();
6703
6670
  }
6704
6671
  /**
6705
6672
  * Sends query using current query text in state.
@@ -6735,33 +6702,6 @@ class DocumentHistoryAiService {
6735
6702
  getCurrentDocumentId(selectedDocument) {
6736
6703
  return selectedDocument?._id;
6737
6704
  }
6738
- /**
6739
- * Fetches AI content for summary or insights.
6740
- * @param {'Summary' | 'Insights'} section - AI section to load.
6741
- * @param {string} documentId - Document identifier.
6742
- * @returns {Observable<string>} Resolved AI content text.
6743
- */
6744
- fetchAiContent(section, documentId) {
6745
- if (!documentId) {
6746
- return throwError(() => new Error('Document ID is missing.'));
6747
- }
6748
- return section === 'Summary'
6749
- ? this.fetchSummary(documentId)
6750
- : this.fetchInsights(documentId);
6751
- }
6752
- /**
6753
- * Fetches section content and returns text + formatted html.
6754
- * @param {'Summary' | 'Insights'} section - AI section to load.
6755
- * @param {any} selectedDocument - Selected document object.
6756
- * @returns {Observable<{ content: string; html: string }>} Content payload.
6757
- */
6758
- getAiContentForSection(section, selectedDocument) {
6759
- const documentId = this.getCurrentDocumentId(selectedDocument);
6760
- if (!documentId) {
6761
- return throwError(() => new Error(ERRORS.NO_VALUE_FOUND));
6762
- }
6763
- return this.fetchAiContent(section, documentId).pipe(map(this.toContentResult.bind(this)), catchError$1(this.handleSectionError(section)));
6764
- }
6765
6705
  /**
6766
6706
  * Sends question against a document.
6767
6707
  * @param {string} documentId - Document identifier.
@@ -6787,16 +6727,6 @@ class DocumentHistoryAiService {
6787
6727
  }
6788
6728
  return this.askQuestion(documentId, question).pipe(map(this.toAnswerResult.bind(this)), catchError$1(this.handleQuestionGenerationError));
6789
6729
  }
6790
- /**
6791
- * Returns section-specific generation error.
6792
- * @param {'Summary' | 'Insights'} section - Section name.
6793
- * @returns {string} Error message.
6794
- */
6795
- getSectionError(section) {
6796
- return section === 'Summary'
6797
- ? ERRORS.ERROR_SUMMARY_GENERATION
6798
- : ERRORS.ERROR_INSIGHTS_GENERATION;
6799
- }
6800
6730
  /**
6801
6731
  * Converts markdown-like output to presentable HTML.
6802
6732
  * @param {string} content - Raw AI response content.
@@ -6806,44 +6736,6 @@ class DocumentHistoryAiService {
6806
6736
  const escaped = this.escapeHtml(content || '');
6807
6737
  return this.renderMarkdownLines(escaped.split('\n'));
6808
6738
  }
6809
- /**
6810
- * Fetches summary text by document id.
6811
- * @param {string} documentId - Document identifier.
6812
- * @returns {Observable<string>} Summary text.
6813
- */
6814
- fetchSummary(documentId) {
6815
- return this.documentHttpService.getAiSummary(documentId).pipe(map(this.extractSummaryContent), catchError$1(this.handleSummaryError));
6816
- }
6817
- /**
6818
- * Fetches insights text by document id.
6819
- * @param {string} documentId - Document identifier.
6820
- * @returns {Observable<string>} Insights text.
6821
- */
6822
- fetchInsights(documentId) {
6823
- return this.documentHttpService.getAiInsights(documentId).pipe(map(this.extractInsightsContent), catchError$1(this.handleInsightsError));
6824
- }
6825
- /**
6826
- * Extracts summary text from API response.
6827
- * @param {any} response - Summary API response.
6828
- * @returns {string} Summary text.
6829
- */
6830
- extractSummaryContent(response) {
6831
- if (!response?.success) {
6832
- throw new Error(ERRORS.ERROR_SUMMARY_GENERATION);
6833
- }
6834
- return response.documentSummary || 'No summary found.';
6835
- }
6836
- /**
6837
- * Extracts insights text from API response.
6838
- * @param {any} response - Insights API response.
6839
- * @returns {string} Insights text.
6840
- */
6841
- extractInsightsContent(response) {
6842
- if (!response?.success) {
6843
- throw new Error(ERRORS.ERROR_INSIGHTS_GENERATION);
6844
- }
6845
- return response.documentInsight || 'No insights found.';
6846
- }
6847
6739
  /**
6848
6740
  * Extracts answer text from question API response.
6849
6741
  * @param {any} response - Question API response.
@@ -6855,14 +6747,6 @@ class DocumentHistoryAiService {
6855
6747
  }
6856
6748
  return response.answer || 'No answer found.';
6857
6749
  }
6858
- /**
6859
- * Maps content text to content payload.
6860
- * @param {string} content - Plain content text.
6861
- * @returns {{ content: string; html: string }} Content payload.
6862
- */
6863
- toContentResult(content) {
6864
- return { content, html: this.formatAiContent(content) };
6865
- }
6866
6750
  /**
6867
6751
  * Maps answer text to answer payload.
6868
6752
  * @param {string} answer - Plain answer text.
@@ -6872,29 +6756,16 @@ class DocumentHistoryAiService {
6872
6756
  return { answer, html: this.formatAiContent(answer) };
6873
6757
  }
6874
6758
  /**
6875
- * Initializes panel state for a selected section.
6876
- * @param {'Summary' | 'Query' | 'Insights'} section - Selected section.
6759
+ * Initializes panel state for Query.
6877
6760
  */
6878
- initializePanel(section) {
6879
- this.state.aiSidebarHeader = section;
6761
+ initializePanel() {
6762
+ this.state.aiSidebarHeader = 'Query';
6880
6763
  this.state.showAiSidebar = true;
6881
6764
  this.state.showAiMenu = false;
6882
6765
  this.state.aiError = '';
6883
6766
  this.state.aiContent = '';
6884
6767
  this.state.aiContentHtml = '';
6885
6768
  }
6886
- /**
6887
- * Loads summary/insights content into UI state.
6888
- * @param {'Summary' | 'Insights'} section - Content section to load.
6889
- * @param {any} selectedDocument - Selected document object.
6890
- */
6891
- loadAiContent(section, selectedDocument) {
6892
- this.state.aiLoading = true;
6893
- this.getAiContentForSection(section, selectedDocument).subscribe({
6894
- next: this.handleAiContentResult.bind(this),
6895
- error: this.handleAiContentRequestError.bind(this)
6896
- });
6897
- }
6898
6769
  /**
6899
6770
  * Resets query-specific UI state.
6900
6771
  */
@@ -6913,25 +6784,6 @@ class DocumentHistoryAiService {
6913
6784
  this.state.queryText = '';
6914
6785
  this.state.queryLoading = true;
6915
6786
  }
6916
- /**
6917
- * Handles successful summary/insights response and updates state.
6918
- * @param {{ content: string; html: string }} result - Formatted content result.
6919
- * @param {string} result.content - Raw AI content text.
6920
- * @param {string} result.html - Formatted AI HTML.
6921
- */
6922
- handleAiContentResult(result) {
6923
- this.state.aiLoading = false;
6924
- this.state.aiContent = result.content;
6925
- this.state.aiContentHtml = result.html;
6926
- }
6927
- /**
6928
- * Handles summary/insights request errors.
6929
- * @param {Error} error - Error object.
6930
- */
6931
- handleAiContentRequestError(error) {
6932
- this.state.aiLoading = false;
6933
- this.state.aiError = error?.message || this.getSectionError(this.state.aiSidebarHeader);
6934
- }
6935
6787
  /**
6936
6788
  * Handles successful question response and updates state.
6937
6789
  * @param {{ answer: string; html: string }} result - Formatted answer result.
@@ -6954,28 +6806,6 @@ class DocumentHistoryAiService {
6954
6806
  this.state.queryLoading = false;
6955
6807
  this.state.aiError = error?.message || ERRORS.ERROR_QUESTION_GENERATION;
6956
6808
  }
6957
- /**
6958
- * Produces section-specific catchError handler.
6959
- * @param {'Summary' | 'Insights'} section - AI section.
6960
- * @returns {(error: any) => Observable<never>} Error handler.
6961
- */
6962
- handleSectionError(section) {
6963
- return () => throwError(() => new Error(this.getSectionError(section)));
6964
- }
6965
- /**
6966
- * Converts summary request errors.
6967
- * @returns {Observable<never>} Error observable.
6968
- */
6969
- handleSummaryError() {
6970
- return throwError(() => new Error(ERRORS.ERROR_SUMMARY_GENERATION));
6971
- }
6972
- /**
6973
- * Converts insights request errors.
6974
- * @returns {Observable<never>} Error observable.
6975
- */
6976
- handleInsightsError() {
6977
- return throwError(() => new Error(ERRORS.ERROR_INSIGHTS_GENERATION));
6978
- }
6979
6809
  /**
6980
6810
  * Converts ask-question request errors.
6981
6811
  * @returns {Observable<never>} Error observable.
@@ -7185,6 +7015,11 @@ class DocumentHistoryComponent {
7185
7015
  * The selected document for actions
7186
7016
  */
7187
7017
  selectedDocument;
7018
+ /**
7019
+ * When true, shows AI dropdown (Summary / Query / Insights) and sidebar.
7020
+ * Set false to hide document intelligence UI (default off until enabled).
7021
+ */
7022
+ isDocumentIntelligence = true;
7188
7023
  /**
7189
7024
  * Event emitted when delete task is requested
7190
7025
  */
@@ -7345,9 +7180,11 @@ class DocumentHistoryComponent {
7345
7180
  }
7346
7181
  /**
7347
7182
  * Open AI sidebar with selected section
7348
- * @param {'Summary' | 'Query' | 'Insights'} section - AI section selected from menu.
7183
+ * @param {'Query'} section - AI section (Query only).
7349
7184
  */
7350
7185
  openAiPanel(section) {
7186
+ if (!this.isDocumentIntelligence)
7187
+ return;
7351
7188
  this.documentHistoryAiService.openAiPanel(section, this.selectedDocument);
7352
7189
  }
7353
7190
  /**
@@ -7520,7 +7357,7 @@ class DocumentHistoryComponent {
7520
7357
  this.closeActionsMenu();
7521
7358
  }
7522
7359
  }
7523
- if (this.documentHistoryAiService.state.showAiMenu) {
7360
+ if (this.isDocumentIntelligence && this.documentHistoryAiService.state.showAiMenu) {
7524
7361
  const aiMenu = target.closest('.ai-menu');
7525
7362
  if (!aiMenu) {
7526
7363
  this.documentHistoryAiService.closeAiMenu();
@@ -7528,11 +7365,11 @@ class DocumentHistoryComponent {
7528
7365
  }
7529
7366
  }
7530
7367
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, deps: [{ token: DocumentHistoryService }, { token: DocumentViewerService }, { token: DocumentActionsService }, { token: i3.ConfirmationService }, { token: DocumentHttpService }, { token: DocumentHistoryAiService }], target: i0.ɵɵFactoryTarget.Component });
7531
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory", contextId: "contextId", selectedDocument: "selectedDocument" }, outputs: { deleteTaskRequested: "deleteTaskRequested", documentSelected: "documentSelected" }, host: { listeners: { "document:click": "onDocumentClickOutside($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-review-container\" *ngIf=\"showHistory && historyData.length > 0\">\n <!-- Header Section -->\n <div class=\"review-header\">\n <div class=\"review-title-section\">\n <h2 class=\"review-title\">Document Review</h2>\n <div class=\"ai-menu\">\n <button class=\"ai-btn\" (click)=\"documentHistoryAiService.toggleAiMenu()\" [class.active]=\"documentHistoryAiService.state.showAiMenu\">\n <i class=\"pi pi-sparkles\"></i>\n <span>AI</span>\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"documentHistoryAiService.state.showAiMenu\"></i>\n </button>\n <div class=\"ai-dropdown\" *ngIf=\"documentHistoryAiService.state.showAiMenu\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"ai-dropdown-item\" (click)=\"openAiPanel('Summary')\">Summary</button>\n <button type=\"button\" class=\"ai-dropdown-item\" (click)=\"openAiPanel('Query')\">Query</button>\n <button type=\"button\" class=\"ai-dropdown-item\" (click)=\"openAiPanel('Insights')\">Insights</button>\n </div>\n </div>\n </div>\n <!-- <div class=\"actions-menu\" *ngIf=\"selectedDocument?.isUploaded || selectedDocument?.status == 'Approved'\"> -->\n <!-- <div class=\"actions-menu\" *ngIf=\"(selectedDocument?.isUploaded || selectedDocument?.status == 'Approved') && !selectedDocument?.isSystemDocument\"> -->\n <div class=\"actions-menu\" *ngIf=\"(selectedDocument?.status !== 'Approved') && (!selectedDocument?.isSystemDocument)\">\n <button class=\"actions-btn\" (click)=\"toggleActionsMenu()\" [class.active]=\"showActionsMenu\">\n Actions\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"showActionsMenu\"></i>\n </button>\n\n <!-- Actions Dropdown Menu -->\n <div class=\"actions-dropdown\" *ngIf=\"showActionsMenu\" (click)=\"$event.stopPropagation()\">\n <div class=\"dropdown-item\" *ngIf=\"selectedDocument?.status == 'Approved' || selectedDocument?.isUploaded || selectedDocument?.status == 'Uploaded'\">\n <ng-content [select]=\"'action-launcher'\"></ng-content>\n </div>\n <div *ngIf=\"selectedDocument?.status == 'Uploaded' || selectedDocument?.status === 'Rejected' || selectedDocument?.status === 'Reviewing' || selectedDocument?.status === 'Pending'\" [permission]=\"'documents-deleteDocumentByDocumentId'\" class=\"dropdown-item\" (click)=\"onDeleteTask()\">\n <span>Delete Document</span>\n </div>\n </div>\n \n </div>\n </div>\n\n <!-- Document Actions Component - Below Header -->\n <div class=\"document-actions-section\">\n <ng-content select=\"[actions-component]\"></ng-content>\n </div>\n\n\n <!-- Alerts Section -->\n <!-- <div class=\"alerts-section\">\n <div class=\"alert-card\">\n <div class=\"alert-header\">\n <i class=\"pi pi-exclamation-triangle alert-icon\"></i>\n <span class=\"alert-text\">Alerts</span>\n <div class=\"alert-badge\">\n <span class=\"alert-count\">{{ getAlertCount() }}</span>\n <i class=\"pi pi-chevron-right\"></i>\n </div>\n </div>\n </div>\n </div> -->\n\n <!-- Timeline Section -->\n <div class=\"timeline-section\">\n <h3 class=\"timeline-title\">Timeline</h3>\n <div class=\"timeline-container\">\n <div class=\"timeline-item\" *ngFor=\"let section of processedHistoryData\">\n <ng-container *ngFor=\"let item of section.list; let i = index\">\n <div class=\"timeline-event mb-2\" *ngIf=\"!item.shouldHide\">\n <div class=\"event-card\" [ngClass]=\"item.eventCardClass\">\n <!-- Event Header -->\n <div class=\"event-header\">\n <div class=\"event-info\">\n <i [class]=\"item.eventIcon\"></i>\n <span class=\"event-label\">{{ item.label }}</span>\n </div>\n <div class=\"event-timestamp\">{{ item.dateTime }}</div>\n </div>\n <!-- User Information -->\n <div class=\"event-user mb-2\">\n <span class=\"user-name\">{{ item.userName }}</span>\n <span class=\"user-role\">({{ item.userRole }})</span>\n </div>\n <!-- Event Description -->\n <div class=\"event-description\" *ngIf=\"item.requestDescription\">\n <ul class=\"event-description-list\" *ngIf=\"item.label.toLowerCase().includes('requested')\">\n <li class=\"event-description-item\">{{ item.requestDescription }}</li>\n </ul>\n <p *ngIf=\"!item.label.toLowerCase().includes('requested')\">{{ item.requestDescription }}</p>\n </div>\n\n <!-- Document Upload Cards -->\n <div class=\"document-uploads\" *ngIf=\"item.documentList && item.documentList.length > 0\">\n <div class=\"uploaded-documents\">\n <div class=\"document-card\" *ngFor=\"let doc of item.documentList\" (click)=\"onDocumentClick(doc)\">\n <div class=\"document-icon\">\n <i class=\"pi pi-file\"></i>\n </div>\n <span class=\"document-name\">{{ doc.docName }}</span>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- <ng-content [select]=\"'actions-component'\"></ng-content> -->\n</div>\n\n<p-sidebar\n [(visible)]=\"documentHistoryAiService.state.showAiSidebar\"\n position=\"right\"\n [style]=\"{ width: '420px' }\"\n [dismissible]=\"true\"\n [showCloseIcon]=\"true\"\n [appendTo]=\"'body'\"\n>\n <ng-template pTemplate=\"header\">\n <h3 class=\"ai-sidebar-title\">{{ documentHistoryAiService.state.aiSidebarHeader }}</h3>\n </ng-template>\n\n <div class=\"ai-sidebar-content\">\n <ng-container *ngIf=\"documentHistoryAiService.state.aiSidebarHeader !== 'Query'\">\n <p class=\"ai-sidebar-text\" *ngIf=\"documentHistoryAiService.state.aiLoading\">Loading {{ documentHistoryAiService.state.aiSidebarHeader.toLowerCase() }}...</p>\n <p class=\"ai-sidebar-error\" *ngIf=\"!documentHistoryAiService.state.aiLoading && documentHistoryAiService.state.aiError\">{{ documentHistoryAiService.state.aiError }}</p>\n <div class=\"ai-sidebar-text ai-markdown\" *ngIf=\"!documentHistoryAiService.state.aiLoading && !documentHistoryAiService.state.aiError\" [innerHTML]=\"documentHistoryAiService.state.aiContentHtml\"></div>\n </ng-container>\n\n <ng-container *ngIf=\"documentHistoryAiService.state.aiSidebarHeader === 'Query'\">\n <p class=\"ai-sidebar-error\" *ngIf=\"documentHistoryAiService.state.aiError\">{{ documentHistoryAiService.state.aiError }}</p>\n\n <div class=\"query-chat-messages\">\n <div class=\"query-chat-empty\" *ngIf=\"documentHistoryAiService.state.queryMessages.length === 0 && !documentHistoryAiService.state.queryLoading\">\n Ask anything about this document.\n </div>\n\n <div *ngFor=\"let message of documentHistoryAiService.state.queryMessages\" class=\"query-chat-message\" [ngClass]=\"message.role\">\n <div class=\"query-chat-bubble\">\n <span *ngIf=\"message.role === 'user'\">{{ message.content }}</span>\n <div *ngIf=\"message.role === 'assistant'\" class=\"ai-markdown\" [innerHTML]=\"message.htmlContent\"></div>\n </div>\n </div>\n\n <div class=\"query-chat-message assistant\" *ngIf=\"documentHistoryAiService.state.queryLoading\">\n <div class=\"query-chat-bubble\">Thinking...</div>\n </div>\n </div>\n\n <div class=\"query-chat-input-wrap\">\n <textarea\n [(ngModel)]=\"documentHistoryAiService.state.queryText\"\n (keydown)=\"onQueryEnter($event)\"\n class=\"query-chat-input\"\n rows=\"3\"\n placeholder=\"Type your question\"\n ></textarea>\n <button type=\"button\" class=\"query-send-btn\" [disabled]=\"documentHistoryAiService.state.queryLoading || !documentHistoryAiService.state.queryText.trim()\" (click)=\"sendQuery()\">\n Send\n </button>\n </div>\n </ng-container>\n </div>\n</p-sidebar>", styles: [".document-review-container{border-radius:8px;max-height:100%;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.document-review-container .review-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.document-review-container .review-header .review-title-section{display:flex;align-items:center;gap:.75rem}.document-review-container .review-header .review-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin:0}.document-review-container .review-header .ai-menu{position:relative}.document-review-container .review-header .ai-menu .ai-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:0 .85rem;color:#374151;font-size:.875rem;height:40px;line-height:1;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .ai-menu .ai-btn:hover{background:#f9fafb}.document-review-container .review-header .ai-menu .ai-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .ai-menu .ai-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .ai-menu .ai-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .ai-menu .ai-dropdown{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:160px;margin-top:.25rem;padding:.25rem 0}.document-review-container .review-header .ai-menu .ai-dropdown .ai-dropdown-item{width:100%;text-align:left;border:none;background:transparent;padding:.625rem .875rem;cursor:pointer;color:#374151;font-size:.875rem}.document-review-container .review-header .ai-menu .ai-dropdown .ai-dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu{position:relative}.document-review-container .review-header .actions-menu .actions-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:0 1rem;height:40px;line-height:1;color:#374151;font-size:.875rem;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .actions-menu .actions-btn:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .actions-menu .actions-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .actions-menu .actions-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .actions-menu .actions-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:180px;margin-top:.25rem}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item{padding:.75rem 1rem;cursor:pointer;color:#374151;font-size:.875rem;border-bottom:1px solid #f3f4f6;transition:background-color .2s}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:last-child{border-bottom:none;border-radius:0 0 8px 8px}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:first-child{border-radius:8px 8px 0 0}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item span{display:block}.document-review-container ::ng-deep document-actions{margin-bottom:1.5rem}.document-review-container ::ng-deep document-actions .actions-card{margin:0;width:100%}.document-review-container .document-actions-section{padding:1rem 0}.document-review-container .alerts-section{margin-bottom:2rem}.document-review-container .alerts-section .alert-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}.document-review-container .alerts-section .alert-card .alert-header{display:flex;align-items:center;gap:.75rem}.document-review-container .alerts-section .alert-card .alert-header .alert-icon{color:#ef4444;font-size:1.25rem}.document-review-container .alerts-section .alert-card .alert-header .alert-text{font-weight:500;color:#1f2937;font-size:1rem}.document-review-container .alerts-section .alert-card .alert-header .alert-badge{margin-left:auto;display:flex;align-items:center;gap:.5rem;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;justify-content:center;position:relative}.document-review-container .alerts-section .alert-card .alert-header .alert-badge .alert-count{font-size:.75rem;font-weight:600}.document-review-container .alerts-section .alert-card .alert-header .alert-badge i{position:absolute;right:-8px;font-size:.75rem;color:#ef4444;background:#fff;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.document-review-container .timeline-section .timeline-title{font-size:1.25rem;font-weight:600;color:#1f2937;margin:0 0 1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item{margin-bottom:1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1.25rem;position:relative}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info{display:flex;align-items:center;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon i{font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-requested{background:#3b82f6}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-accepted{background:#10b981}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-rejected{background:#ef4444}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-default{background:#6b7280}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-label{font-weight:600;color:#1f2937;font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{color:#6b7280;font-size:.875rem;font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description p{color:#374151;line-height:1.5;margin:0;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents{display:flex;flex-direction:column;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.5rem;display:flex;align-items:center;gap:.75rem;cursor:pointer;transition:all .2s ease}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:hover{background:#e2e8f0;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:active{transform:translateY(0);box-shadow:0 1px 2px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-icon{color:#3b82f6;font-size:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-name{color:#1f2937;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user{font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-name{color:rgb(75,85,99,var(--tw-text-opacity, 1));font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-role{color:#6b7280;margin-left:.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-requested{background:#dbeafe;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-accepted{background:#dcfce7;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-rejected{background:#fee2e2;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-default{border-left:4px solid #6b7280}@media (max-width: 768px){.document-review-container{padding:1rem}.document-review-container .review-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-review-container .review-header .actions-menu{align-self:flex-end}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{flex-direction:column;align-items:flex-start;gap:.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{align-self:flex-end}}.ai-sidebar-title{margin:0;font-size:1.1rem;font-weight:600;color:#111827}.ai-sidebar-content{padding:1rem .5rem}.ai-sidebar-text{margin:0;color:#4b5563;font-size:.95rem;line-height:1.5;white-space:pre-wrap}.ai-markdown p{margin:0 0 .5rem}.ai-markdown :last-child{margin-bottom:0}.ai-markdown strong{color:#111827;font-weight:700}.ai-markdown .ai-markdown-list{margin:0 0 .5rem 1.1rem;padding:0}.ai-markdown li{margin-bottom:.35rem}.ai-sidebar-error{margin:0;color:#dc2626;font-size:.9rem}.query-chat-messages{max-height:calc(100vh - 260px);overflow-y:auto;padding:.25rem .1rem .5rem;margin-bottom:.75rem}.query-chat-empty{color:#6b7280;font-size:.9rem;text-align:center;padding:.75rem .5rem}.query-chat-message{display:flex;margin-bottom:.6rem}.query-chat-message.user{justify-content:flex-end}.query-chat-message.assistant{justify-content:flex-start}.query-chat-bubble{max-width:85%;padding:.6rem .75rem;border-radius:12px;font-size:.9rem;line-height:1.45;border:1px solid #e5e7eb;background:#f9fafb;color:#1f2937}.query-chat-message.user .query-chat-bubble{background:#dbeafe;border-color:#bfdbfe}.query-chat-input-wrap{display:flex;flex-direction:column;gap:.5rem}.query-chat-input{width:100%;border:1px solid #d1d5db;border-radius:8px;padding:.6rem .7rem;font-size:.9rem;resize:vertical;min-height:70px}.query-chat-input:focus{outline:none;border-color:#60a5fa;box-shadow:0 0 0 2px #60a5fa33}.query-send-btn{align-self:flex-end;border:1px solid #2563eb;background:#2563eb;color:#fff;border-radius:8px;padding:.45rem .9rem;font-size:.85rem;cursor:pointer}.query-send-btn:hover:not(:disabled){background:#1d4ed8}.query-send-btn:disabled{cursor:not-allowed;opacity:.6}\n"], dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i4.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: i9$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i9$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i9$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }] });
7368
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.14", type: DocumentHistoryComponent, isStandalone: false, selector: "document-history", inputs: { historyData: "historyData", showHistory: "showHistory", contextId: "contextId", selectedDocument: "selectedDocument", isDocumentIntelligence: "isDocumentIntelligence" }, outputs: { deleteTaskRequested: "deleteTaskRequested", documentSelected: "documentSelected" }, host: { listeners: { "document:click": "onDocumentClickOutside($event)" } }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-review-container\" *ngIf=\"showHistory && historyData.length > 0\">\n <!-- Header Section -->\n <div class=\"review-header\">\n <div class=\"review-title-section\">\n <h2 class=\"review-title\">Document Review</h2>\n <div class=\"ai-menu\" *ngIf=\"isDocumentIntelligence\">\n <button class=\"ai-btn\" (click)=\"documentHistoryAiService.toggleAiMenu()\" [class.active]=\"documentHistoryAiService.state.showAiMenu\">\n <i class=\"pi pi-sparkles\"></i>\n <span>AI</span>\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"documentHistoryAiService.state.showAiMenu\"></i>\n </button>\n <div class=\"ai-dropdown\" *ngIf=\"documentHistoryAiService.state.showAiMenu\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"ai-dropdown-item\" (click)=\"openAiPanel('Query')\">Query</button>\n </div>\n </div>\n </div>\n <!-- <div class=\"actions-menu\" *ngIf=\"selectedDocument?.isUploaded || selectedDocument?.status == 'Approved'\"> -->\n <!-- <div class=\"actions-menu\" *ngIf=\"(selectedDocument?.isUploaded || selectedDocument?.status == 'Approved') && !selectedDocument?.isSystemDocument\"> -->\n <div class=\"actions-menu\" *ngIf=\"(selectedDocument?.status !== 'Approved') && (!selectedDocument?.isSystemDocument)\">\n <button class=\"actions-btn\" (click)=\"toggleActionsMenu()\" [class.active]=\"showActionsMenu\">\n Actions\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"showActionsMenu\"></i>\n </button>\n\n <!-- Actions Dropdown Menu -->\n <div class=\"actions-dropdown\" *ngIf=\"showActionsMenu\" (click)=\"$event.stopPropagation()\">\n <div class=\"dropdown-item\" *ngIf=\"selectedDocument?.status == 'Approved' || selectedDocument?.isUploaded || selectedDocument?.status == 'Uploaded'\">\n <ng-content [select]=\"'action-launcher'\"></ng-content>\n </div>\n <div *ngIf=\"selectedDocument?.status == 'Uploaded' || selectedDocument?.status === 'Rejected' || selectedDocument?.status === 'Reviewing' || selectedDocument?.status === 'Pending'\" [permission]=\"'documents-deleteDocumentByDocumentId'\" class=\"dropdown-item\" (click)=\"onDeleteTask()\">\n <span>Delete Document</span>\n </div>\n </div>\n \n </div>\n </div>\n\n <!-- Document Actions Component - Below Header -->\n <div class=\"document-actions-section\">\n <ng-content select=\"[actions-component]\"></ng-content>\n </div>\n\n\n <!-- Alerts Section -->\n <!-- <div class=\"alerts-section\">\n <div class=\"alert-card\">\n <div class=\"alert-header\">\n <i class=\"pi pi-exclamation-triangle alert-icon\"></i>\n <span class=\"alert-text\">Alerts</span>\n <div class=\"alert-badge\">\n <span class=\"alert-count\">{{ getAlertCount() }}</span>\n <i class=\"pi pi-chevron-right\"></i>\n </div>\n </div>\n </div>\n </div> -->\n\n <!-- Timeline Section -->\n <div class=\"timeline-section\">\n <h3 class=\"timeline-title\">Timeline</h3>\n <div class=\"timeline-container\">\n <div class=\"timeline-item\" *ngFor=\"let section of processedHistoryData\">\n <ng-container *ngFor=\"let item of section.list; let i = index\">\n <div class=\"timeline-event mb-2\" *ngIf=\"!item.shouldHide\">\n <div class=\"event-card\" [ngClass]=\"item.eventCardClass\">\n <!-- Event Header -->\n <div class=\"event-header\">\n <div class=\"event-info\">\n <i [class]=\"item.eventIcon\"></i>\n <span class=\"event-label\">{{ item.label }}</span>\n </div>\n <div class=\"event-timestamp\">{{ item.dateTime }}</div>\n </div>\n <!-- User Information -->\n <div class=\"event-user mb-2\">\n <span class=\"user-name\">{{ item.userName }}</span>\n <span class=\"user-role\">({{ item.userRole }})</span>\n </div>\n <!-- Event Description -->\n <div class=\"event-description\" *ngIf=\"item.requestDescription\">\n <ul class=\"event-description-list\" *ngIf=\"item.label.toLowerCase().includes('requested')\">\n <li class=\"event-description-item\">{{ item.requestDescription }}</li>\n </ul>\n <p *ngIf=\"!item.label.toLowerCase().includes('requested')\">{{ item.requestDescription }}</p>\n </div>\n\n <!-- Document Upload Cards -->\n <div class=\"document-uploads\" *ngIf=\"item.documentList && item.documentList.length > 0\">\n <div class=\"uploaded-documents\">\n <div class=\"document-card\" *ngFor=\"let doc of item.documentList\" (click)=\"onDocumentClick(doc)\">\n <div class=\"document-icon\">\n <i class=\"pi pi-file\"></i>\n </div>\n <span class=\"document-name\">{{ doc.docName }}</span>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- <ng-content [select]=\"'actions-component'\"></ng-content> -->\n</div>\n\n<p-sidebar\n *ngIf=\"isDocumentIntelligence\"\n [(visible)]=\"documentHistoryAiService.state.showAiSidebar\"\n position=\"right\"\n [style]=\"{ width: '420px' }\"\n [dismissible]=\"true\"\n [showCloseIcon]=\"true\"\n [appendTo]=\"'body'\"\n>\n <ng-template pTemplate=\"header\">\n <h3 class=\"ai-sidebar-title\">{{ documentHistoryAiService.state.aiSidebarHeader }}</h3>\n </ng-template>\n\n <div class=\"ai-sidebar-content\">\n <ng-container *ngIf=\"documentHistoryAiService.state.aiSidebarHeader === 'Query'\">\n <p class=\"ai-sidebar-error\" *ngIf=\"documentHistoryAiService.state.aiError\">{{ documentHistoryAiService.state.aiError }}</p>\n\n <div class=\"query-chat-messages\">\n <div class=\"query-chat-empty\" *ngIf=\"documentHistoryAiService.state.queryMessages.length === 0 && !documentHistoryAiService.state.queryLoading\">\n Ask anything about this document.\n </div>\n\n <div *ngFor=\"let message of documentHistoryAiService.state.queryMessages\" class=\"query-chat-message\" [ngClass]=\"message.role\">\n <div class=\"query-chat-bubble\">\n <span *ngIf=\"message.role === 'user'\">{{ message.content }}</span>\n <div *ngIf=\"message.role === 'assistant'\" class=\"ai-markdown\" [innerHTML]=\"message.htmlContent\"></div>\n </div>\n </div>\n\n <div class=\"query-chat-message assistant\" *ngIf=\"documentHistoryAiService.state.queryLoading\">\n <div class=\"query-chat-bubble\">Thinking...</div>\n </div>\n </div>\n\n <div class=\"query-chat-input-wrap\">\n <textarea\n [(ngModel)]=\"documentHistoryAiService.state.queryText\"\n (keydown)=\"onQueryEnter($event)\"\n class=\"query-chat-input\"\n rows=\"3\"\n placeholder=\"Type your question\"\n ></textarea>\n <button type=\"button\" class=\"query-send-btn\" [disabled]=\"documentHistoryAiService.state.queryLoading || !documentHistoryAiService.state.queryText.trim()\" (click)=\"sendQuery()\">\n Send\n </button>\n </div>\n </ng-container>\n </div>\n</p-sidebar>", styles: [".document-review-container{border-radius:8px;max-height:100%;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.document-review-container .review-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.document-review-container .review-header .review-title-section{display:flex;align-items:center;gap:.75rem}.document-review-container .review-header .review-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin:0}.document-review-container .review-header .ai-menu{position:relative}.document-review-container .review-header .ai-menu .ai-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:0 .85rem;color:#374151;font-size:.875rem;height:40px;line-height:1;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .ai-menu .ai-btn:hover{background:#f9fafb}.document-review-container .review-header .ai-menu .ai-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .ai-menu .ai-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .ai-menu .ai-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .ai-menu .ai-dropdown{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:160px;margin-top:.25rem;padding:.25rem 0}.document-review-container .review-header .ai-menu .ai-dropdown .ai-dropdown-item{width:100%;text-align:left;border:none;background:transparent;padding:.625rem .875rem;cursor:pointer;color:#374151;font-size:.875rem}.document-review-container .review-header .ai-menu .ai-dropdown .ai-dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu{position:relative}.document-review-container .review-header .actions-menu .actions-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:0 1rem;height:40px;line-height:1;color:#374151;font-size:.875rem;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .actions-menu .actions-btn:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .actions-menu .actions-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .actions-menu .actions-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .actions-menu .actions-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:180px;margin-top:.25rem}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item{padding:.75rem 1rem;cursor:pointer;color:#374151;font-size:.875rem;border-bottom:1px solid #f3f4f6;transition:background-color .2s}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:last-child{border-bottom:none;border-radius:0 0 8px 8px}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:first-child{border-radius:8px 8px 0 0}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item span{display:block}.document-review-container ::ng-deep document-actions{margin-bottom:1.5rem}.document-review-container ::ng-deep document-actions .actions-card{margin:0;width:100%}.document-review-container .document-actions-section{padding:1rem 0}.document-review-container .alerts-section{margin-bottom:2rem}.document-review-container .alerts-section .alert-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}.document-review-container .alerts-section .alert-card .alert-header{display:flex;align-items:center;gap:.75rem}.document-review-container .alerts-section .alert-card .alert-header .alert-icon{color:#ef4444;font-size:1.25rem}.document-review-container .alerts-section .alert-card .alert-header .alert-text{font-weight:500;color:#1f2937;font-size:1rem}.document-review-container .alerts-section .alert-card .alert-header .alert-badge{margin-left:auto;display:flex;align-items:center;gap:.5rem;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;justify-content:center;position:relative}.document-review-container .alerts-section .alert-card .alert-header .alert-badge .alert-count{font-size:.75rem;font-weight:600}.document-review-container .alerts-section .alert-card .alert-header .alert-badge i{position:absolute;right:-8px;font-size:.75rem;color:#ef4444;background:#fff;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.document-review-container .timeline-section .timeline-title{font-size:1.25rem;font-weight:600;color:#1f2937;margin:0 0 1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item{margin-bottom:1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1.25rem;position:relative}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info{display:flex;align-items:center;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon i{font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-requested{background:#3b82f6}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-accepted{background:#10b981}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-rejected{background:#ef4444}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-default{background:#6b7280}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-label{font-weight:600;color:#1f2937;font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{color:#6b7280;font-size:.875rem;font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description p{color:#374151;line-height:1.5;margin:0;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents{display:flex;flex-direction:column;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.5rem;display:flex;align-items:center;gap:.75rem;cursor:pointer;transition:all .2s ease}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:hover{background:#e2e8f0;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:active{transform:translateY(0);box-shadow:0 1px 2px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-icon{color:#3b82f6;font-size:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-name{color:#1f2937;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user{font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-name{color:rgb(75,85,99,var(--tw-text-opacity, 1));font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-role{color:#6b7280;margin-left:.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-requested{background:#dbeafe;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-accepted{background:#dcfce7;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-rejected{background:#fee2e2;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-default{border-left:4px solid #6b7280}@media (max-width: 768px){.document-review-container{padding:1rem}.document-review-container .review-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-review-container .review-header .actions-menu{align-self:flex-end}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{flex-direction:column;align-items:flex-start;gap:.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{align-self:flex-end}}.ai-sidebar-title{margin:0;font-size:1.1rem;font-weight:600;color:#111827}.ai-sidebar-content{padding:1rem .5rem}.ai-sidebar-text{margin:0;color:#4b5563;font-size:.95rem;line-height:1.5;white-space:pre-wrap}.ai-markdown p{margin:0 0 .5rem}.ai-markdown :last-child{margin-bottom:0}.ai-markdown strong{color:#111827;font-weight:700}.ai-markdown .ai-markdown-list{margin:0 0 .5rem 1.1rem;padding:0}.ai-markdown li{margin-bottom:.35rem}.ai-sidebar-error{margin:0;color:#dc2626;font-size:.9rem}.query-chat-messages{max-height:calc(100vh - 260px);overflow-y:auto;padding:.25rem .1rem .5rem;margin-bottom:.75rem}.query-chat-empty{color:#6b7280;font-size:.9rem;text-align:center;padding:.75rem .5rem}.query-chat-message{display:flex;margin-bottom:.6rem}.query-chat-message.user{justify-content:flex-end}.query-chat-message.assistant{justify-content:flex-start}.query-chat-bubble{max-width:85%;padding:.6rem .75rem;border-radius:12px;font-size:.9rem;line-height:1.45;border:1px solid #e5e7eb;background:#f9fafb;color:#1f2937}.query-chat-message.user .query-chat-bubble{background:#dbeafe;border-color:#bfdbfe}.query-chat-input-wrap{display:flex;flex-direction:column;gap:.5rem}.query-chat-input{width:100%;border:1px solid #d1d5db;border-radius:8px;padding:.6rem .7rem;font-size:.9rem;resize:vertical;min-height:70px}.query-chat-input:focus{outline:none;border-color:#60a5fa;box-shadow:0 0 0 2px #60a5fa33}.query-send-btn{align-self:flex-end;border:1px solid #2563eb;background:#2563eb;color:#fff;border-radius:8px;padding:.45rem .9rem;font-size:.85rem;cursor:pointer}.query-send-btn:hover:not(:disabled){background:#1d4ed8}.query-send-btn:disabled{cursor:not-allowed;opacity:.6}\n"], dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.PrimeTemplate, selector: "[pTemplate]", inputs: ["type", "pTemplate"] }, { kind: "component", type: i4.Sidebar, selector: "p-sidebar", inputs: ["appendTo", "blockScroll", "style", "styleClass", "ariaCloseLabel", "autoZIndex", "baseZIndex", "modal", "dismissible", "showCloseIcon", "closeOnEscape", "transitionOptions", "visible", "position", "fullScreen"], outputs: ["onShow", "onHide", "visibleChange"] }, { kind: "directive", type: i9$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i9$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i9$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: HasPermissionDirective, selector: "[permission]", inputs: ["permission"] }] });
7532
7369
  }
7533
7370
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentHistoryComponent, decorators: [{
7534
7371
  type: Component,
7535
- args: [{ selector: 'document-history', standalone: false, template: "<div class=\"document-review-container\" *ngIf=\"showHistory && historyData.length > 0\">\n <!-- Header Section -->\n <div class=\"review-header\">\n <div class=\"review-title-section\">\n <h2 class=\"review-title\">Document Review</h2>\n <div class=\"ai-menu\">\n <button class=\"ai-btn\" (click)=\"documentHistoryAiService.toggleAiMenu()\" [class.active]=\"documentHistoryAiService.state.showAiMenu\">\n <i class=\"pi pi-sparkles\"></i>\n <span>AI</span>\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"documentHistoryAiService.state.showAiMenu\"></i>\n </button>\n <div class=\"ai-dropdown\" *ngIf=\"documentHistoryAiService.state.showAiMenu\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"ai-dropdown-item\" (click)=\"openAiPanel('Summary')\">Summary</button>\n <button type=\"button\" class=\"ai-dropdown-item\" (click)=\"openAiPanel('Query')\">Query</button>\n <button type=\"button\" class=\"ai-dropdown-item\" (click)=\"openAiPanel('Insights')\">Insights</button>\n </div>\n </div>\n </div>\n <!-- <div class=\"actions-menu\" *ngIf=\"selectedDocument?.isUploaded || selectedDocument?.status == 'Approved'\"> -->\n <!-- <div class=\"actions-menu\" *ngIf=\"(selectedDocument?.isUploaded || selectedDocument?.status == 'Approved') && !selectedDocument?.isSystemDocument\"> -->\n <div class=\"actions-menu\" *ngIf=\"(selectedDocument?.status !== 'Approved') && (!selectedDocument?.isSystemDocument)\">\n <button class=\"actions-btn\" (click)=\"toggleActionsMenu()\" [class.active]=\"showActionsMenu\">\n Actions\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"showActionsMenu\"></i>\n </button>\n\n <!-- Actions Dropdown Menu -->\n <div class=\"actions-dropdown\" *ngIf=\"showActionsMenu\" (click)=\"$event.stopPropagation()\">\n <div class=\"dropdown-item\" *ngIf=\"selectedDocument?.status == 'Approved' || selectedDocument?.isUploaded || selectedDocument?.status == 'Uploaded'\">\n <ng-content [select]=\"'action-launcher'\"></ng-content>\n </div>\n <div *ngIf=\"selectedDocument?.status == 'Uploaded' || selectedDocument?.status === 'Rejected' || selectedDocument?.status === 'Reviewing' || selectedDocument?.status === 'Pending'\" [permission]=\"'documents-deleteDocumentByDocumentId'\" class=\"dropdown-item\" (click)=\"onDeleteTask()\">\n <span>Delete Document</span>\n </div>\n </div>\n \n </div>\n </div>\n\n <!-- Document Actions Component - Below Header -->\n <div class=\"document-actions-section\">\n <ng-content select=\"[actions-component]\"></ng-content>\n </div>\n\n\n <!-- Alerts Section -->\n <!-- <div class=\"alerts-section\">\n <div class=\"alert-card\">\n <div class=\"alert-header\">\n <i class=\"pi pi-exclamation-triangle alert-icon\"></i>\n <span class=\"alert-text\">Alerts</span>\n <div class=\"alert-badge\">\n <span class=\"alert-count\">{{ getAlertCount() }}</span>\n <i class=\"pi pi-chevron-right\"></i>\n </div>\n </div>\n </div>\n </div> -->\n\n <!-- Timeline Section -->\n <div class=\"timeline-section\">\n <h3 class=\"timeline-title\">Timeline</h3>\n <div class=\"timeline-container\">\n <div class=\"timeline-item\" *ngFor=\"let section of processedHistoryData\">\n <ng-container *ngFor=\"let item of section.list; let i = index\">\n <div class=\"timeline-event mb-2\" *ngIf=\"!item.shouldHide\">\n <div class=\"event-card\" [ngClass]=\"item.eventCardClass\">\n <!-- Event Header -->\n <div class=\"event-header\">\n <div class=\"event-info\">\n <i [class]=\"item.eventIcon\"></i>\n <span class=\"event-label\">{{ item.label }}</span>\n </div>\n <div class=\"event-timestamp\">{{ item.dateTime }}</div>\n </div>\n <!-- User Information -->\n <div class=\"event-user mb-2\">\n <span class=\"user-name\">{{ item.userName }}</span>\n <span class=\"user-role\">({{ item.userRole }})</span>\n </div>\n <!-- Event Description -->\n <div class=\"event-description\" *ngIf=\"item.requestDescription\">\n <ul class=\"event-description-list\" *ngIf=\"item.label.toLowerCase().includes('requested')\">\n <li class=\"event-description-item\">{{ item.requestDescription }}</li>\n </ul>\n <p *ngIf=\"!item.label.toLowerCase().includes('requested')\">{{ item.requestDescription }}</p>\n </div>\n\n <!-- Document Upload Cards -->\n <div class=\"document-uploads\" *ngIf=\"item.documentList && item.documentList.length > 0\">\n <div class=\"uploaded-documents\">\n <div class=\"document-card\" *ngFor=\"let doc of item.documentList\" (click)=\"onDocumentClick(doc)\">\n <div class=\"document-icon\">\n <i class=\"pi pi-file\"></i>\n </div>\n <span class=\"document-name\">{{ doc.docName }}</span>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- <ng-content [select]=\"'actions-component'\"></ng-content> -->\n</div>\n\n<p-sidebar\n [(visible)]=\"documentHistoryAiService.state.showAiSidebar\"\n position=\"right\"\n [style]=\"{ width: '420px' }\"\n [dismissible]=\"true\"\n [showCloseIcon]=\"true\"\n [appendTo]=\"'body'\"\n>\n <ng-template pTemplate=\"header\">\n <h3 class=\"ai-sidebar-title\">{{ documentHistoryAiService.state.aiSidebarHeader }}</h3>\n </ng-template>\n\n <div class=\"ai-sidebar-content\">\n <ng-container *ngIf=\"documentHistoryAiService.state.aiSidebarHeader !== 'Query'\">\n <p class=\"ai-sidebar-text\" *ngIf=\"documentHistoryAiService.state.aiLoading\">Loading {{ documentHistoryAiService.state.aiSidebarHeader.toLowerCase() }}...</p>\n <p class=\"ai-sidebar-error\" *ngIf=\"!documentHistoryAiService.state.aiLoading && documentHistoryAiService.state.aiError\">{{ documentHistoryAiService.state.aiError }}</p>\n <div class=\"ai-sidebar-text ai-markdown\" *ngIf=\"!documentHistoryAiService.state.aiLoading && !documentHistoryAiService.state.aiError\" [innerHTML]=\"documentHistoryAiService.state.aiContentHtml\"></div>\n </ng-container>\n\n <ng-container *ngIf=\"documentHistoryAiService.state.aiSidebarHeader === 'Query'\">\n <p class=\"ai-sidebar-error\" *ngIf=\"documentHistoryAiService.state.aiError\">{{ documentHistoryAiService.state.aiError }}</p>\n\n <div class=\"query-chat-messages\">\n <div class=\"query-chat-empty\" *ngIf=\"documentHistoryAiService.state.queryMessages.length === 0 && !documentHistoryAiService.state.queryLoading\">\n Ask anything about this document.\n </div>\n\n <div *ngFor=\"let message of documentHistoryAiService.state.queryMessages\" class=\"query-chat-message\" [ngClass]=\"message.role\">\n <div class=\"query-chat-bubble\">\n <span *ngIf=\"message.role === 'user'\">{{ message.content }}</span>\n <div *ngIf=\"message.role === 'assistant'\" class=\"ai-markdown\" [innerHTML]=\"message.htmlContent\"></div>\n </div>\n </div>\n\n <div class=\"query-chat-message assistant\" *ngIf=\"documentHistoryAiService.state.queryLoading\">\n <div class=\"query-chat-bubble\">Thinking...</div>\n </div>\n </div>\n\n <div class=\"query-chat-input-wrap\">\n <textarea\n [(ngModel)]=\"documentHistoryAiService.state.queryText\"\n (keydown)=\"onQueryEnter($event)\"\n class=\"query-chat-input\"\n rows=\"3\"\n placeholder=\"Type your question\"\n ></textarea>\n <button type=\"button\" class=\"query-send-btn\" [disabled]=\"documentHistoryAiService.state.queryLoading || !documentHistoryAiService.state.queryText.trim()\" (click)=\"sendQuery()\">\n Send\n </button>\n </div>\n </ng-container>\n </div>\n</p-sidebar>", styles: [".document-review-container{border-radius:8px;max-height:100%;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.document-review-container .review-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.document-review-container .review-header .review-title-section{display:flex;align-items:center;gap:.75rem}.document-review-container .review-header .review-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin:0}.document-review-container .review-header .ai-menu{position:relative}.document-review-container .review-header .ai-menu .ai-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:0 .85rem;color:#374151;font-size:.875rem;height:40px;line-height:1;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .ai-menu .ai-btn:hover{background:#f9fafb}.document-review-container .review-header .ai-menu .ai-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .ai-menu .ai-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .ai-menu .ai-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .ai-menu .ai-dropdown{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:160px;margin-top:.25rem;padding:.25rem 0}.document-review-container .review-header .ai-menu .ai-dropdown .ai-dropdown-item{width:100%;text-align:left;border:none;background:transparent;padding:.625rem .875rem;cursor:pointer;color:#374151;font-size:.875rem}.document-review-container .review-header .ai-menu .ai-dropdown .ai-dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu{position:relative}.document-review-container .review-header .actions-menu .actions-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:0 1rem;height:40px;line-height:1;color:#374151;font-size:.875rem;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .actions-menu .actions-btn:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .actions-menu .actions-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .actions-menu .actions-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .actions-menu .actions-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:180px;margin-top:.25rem}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item{padding:.75rem 1rem;cursor:pointer;color:#374151;font-size:.875rem;border-bottom:1px solid #f3f4f6;transition:background-color .2s}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:last-child{border-bottom:none;border-radius:0 0 8px 8px}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:first-child{border-radius:8px 8px 0 0}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item span{display:block}.document-review-container ::ng-deep document-actions{margin-bottom:1.5rem}.document-review-container ::ng-deep document-actions .actions-card{margin:0;width:100%}.document-review-container .document-actions-section{padding:1rem 0}.document-review-container .alerts-section{margin-bottom:2rem}.document-review-container .alerts-section .alert-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}.document-review-container .alerts-section .alert-card .alert-header{display:flex;align-items:center;gap:.75rem}.document-review-container .alerts-section .alert-card .alert-header .alert-icon{color:#ef4444;font-size:1.25rem}.document-review-container .alerts-section .alert-card .alert-header .alert-text{font-weight:500;color:#1f2937;font-size:1rem}.document-review-container .alerts-section .alert-card .alert-header .alert-badge{margin-left:auto;display:flex;align-items:center;gap:.5rem;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;justify-content:center;position:relative}.document-review-container .alerts-section .alert-card .alert-header .alert-badge .alert-count{font-size:.75rem;font-weight:600}.document-review-container .alerts-section .alert-card .alert-header .alert-badge i{position:absolute;right:-8px;font-size:.75rem;color:#ef4444;background:#fff;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.document-review-container .timeline-section .timeline-title{font-size:1.25rem;font-weight:600;color:#1f2937;margin:0 0 1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item{margin-bottom:1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1.25rem;position:relative}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info{display:flex;align-items:center;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon i{font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-requested{background:#3b82f6}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-accepted{background:#10b981}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-rejected{background:#ef4444}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-default{background:#6b7280}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-label{font-weight:600;color:#1f2937;font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{color:#6b7280;font-size:.875rem;font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description p{color:#374151;line-height:1.5;margin:0;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents{display:flex;flex-direction:column;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.5rem;display:flex;align-items:center;gap:.75rem;cursor:pointer;transition:all .2s ease}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:hover{background:#e2e8f0;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:active{transform:translateY(0);box-shadow:0 1px 2px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-icon{color:#3b82f6;font-size:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-name{color:#1f2937;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user{font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-name{color:rgb(75,85,99,var(--tw-text-opacity, 1));font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-role{color:#6b7280;margin-left:.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-requested{background:#dbeafe;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-accepted{background:#dcfce7;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-rejected{background:#fee2e2;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-default{border-left:4px solid #6b7280}@media (max-width: 768px){.document-review-container{padding:1rem}.document-review-container .review-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-review-container .review-header .actions-menu{align-self:flex-end}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{flex-direction:column;align-items:flex-start;gap:.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{align-self:flex-end}}.ai-sidebar-title{margin:0;font-size:1.1rem;font-weight:600;color:#111827}.ai-sidebar-content{padding:1rem .5rem}.ai-sidebar-text{margin:0;color:#4b5563;font-size:.95rem;line-height:1.5;white-space:pre-wrap}.ai-markdown p{margin:0 0 .5rem}.ai-markdown :last-child{margin-bottom:0}.ai-markdown strong{color:#111827;font-weight:700}.ai-markdown .ai-markdown-list{margin:0 0 .5rem 1.1rem;padding:0}.ai-markdown li{margin-bottom:.35rem}.ai-sidebar-error{margin:0;color:#dc2626;font-size:.9rem}.query-chat-messages{max-height:calc(100vh - 260px);overflow-y:auto;padding:.25rem .1rem .5rem;margin-bottom:.75rem}.query-chat-empty{color:#6b7280;font-size:.9rem;text-align:center;padding:.75rem .5rem}.query-chat-message{display:flex;margin-bottom:.6rem}.query-chat-message.user{justify-content:flex-end}.query-chat-message.assistant{justify-content:flex-start}.query-chat-bubble{max-width:85%;padding:.6rem .75rem;border-radius:12px;font-size:.9rem;line-height:1.45;border:1px solid #e5e7eb;background:#f9fafb;color:#1f2937}.query-chat-message.user .query-chat-bubble{background:#dbeafe;border-color:#bfdbfe}.query-chat-input-wrap{display:flex;flex-direction:column;gap:.5rem}.query-chat-input{width:100%;border:1px solid #d1d5db;border-radius:8px;padding:.6rem .7rem;font-size:.9rem;resize:vertical;min-height:70px}.query-chat-input:focus{outline:none;border-color:#60a5fa;box-shadow:0 0 0 2px #60a5fa33}.query-send-btn{align-self:flex-end;border:1px solid #2563eb;background:#2563eb;color:#fff;border-radius:8px;padding:.45rem .9rem;font-size:.85rem;cursor:pointer}.query-send-btn:hover:not(:disabled){background:#1d4ed8}.query-send-btn:disabled{cursor:not-allowed;opacity:.6}\n"] }]
7372
+ args: [{ selector: 'document-history', standalone: false, template: "<div class=\"document-review-container\" *ngIf=\"showHistory && historyData.length > 0\">\n <!-- Header Section -->\n <div class=\"review-header\">\n <div class=\"review-title-section\">\n <h2 class=\"review-title\">Document Review</h2>\n <div class=\"ai-menu\" *ngIf=\"isDocumentIntelligence\">\n <button class=\"ai-btn\" (click)=\"documentHistoryAiService.toggleAiMenu()\" [class.active]=\"documentHistoryAiService.state.showAiMenu\">\n <i class=\"pi pi-sparkles\"></i>\n <span>AI</span>\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"documentHistoryAiService.state.showAiMenu\"></i>\n </button>\n <div class=\"ai-dropdown\" *ngIf=\"documentHistoryAiService.state.showAiMenu\" (click)=\"$event.stopPropagation()\">\n <button type=\"button\" class=\"ai-dropdown-item\" (click)=\"openAiPanel('Query')\">Query</button>\n </div>\n </div>\n </div>\n <!-- <div class=\"actions-menu\" *ngIf=\"selectedDocument?.isUploaded || selectedDocument?.status == 'Approved'\"> -->\n <!-- <div class=\"actions-menu\" *ngIf=\"(selectedDocument?.isUploaded || selectedDocument?.status == 'Approved') && !selectedDocument?.isSystemDocument\"> -->\n <div class=\"actions-menu\" *ngIf=\"(selectedDocument?.status !== 'Approved') && (!selectedDocument?.isSystemDocument)\">\n <button class=\"actions-btn\" (click)=\"toggleActionsMenu()\" [class.active]=\"showActionsMenu\">\n Actions\n <i class=\"pi pi-chevron-down\" [class.rotated]=\"showActionsMenu\"></i>\n </button>\n\n <!-- Actions Dropdown Menu -->\n <div class=\"actions-dropdown\" *ngIf=\"showActionsMenu\" (click)=\"$event.stopPropagation()\">\n <div class=\"dropdown-item\" *ngIf=\"selectedDocument?.status == 'Approved' || selectedDocument?.isUploaded || selectedDocument?.status == 'Uploaded'\">\n <ng-content [select]=\"'action-launcher'\"></ng-content>\n </div>\n <div *ngIf=\"selectedDocument?.status == 'Uploaded' || selectedDocument?.status === 'Rejected' || selectedDocument?.status === 'Reviewing' || selectedDocument?.status === 'Pending'\" [permission]=\"'documents-deleteDocumentByDocumentId'\" class=\"dropdown-item\" (click)=\"onDeleteTask()\">\n <span>Delete Document</span>\n </div>\n </div>\n \n </div>\n </div>\n\n <!-- Document Actions Component - Below Header -->\n <div class=\"document-actions-section\">\n <ng-content select=\"[actions-component]\"></ng-content>\n </div>\n\n\n <!-- Alerts Section -->\n <!-- <div class=\"alerts-section\">\n <div class=\"alert-card\">\n <div class=\"alert-header\">\n <i class=\"pi pi-exclamation-triangle alert-icon\"></i>\n <span class=\"alert-text\">Alerts</span>\n <div class=\"alert-badge\">\n <span class=\"alert-count\">{{ getAlertCount() }}</span>\n <i class=\"pi pi-chevron-right\"></i>\n </div>\n </div>\n </div>\n </div> -->\n\n <!-- Timeline Section -->\n <div class=\"timeline-section\">\n <h3 class=\"timeline-title\">Timeline</h3>\n <div class=\"timeline-container\">\n <div class=\"timeline-item\" *ngFor=\"let section of processedHistoryData\">\n <ng-container *ngFor=\"let item of section.list; let i = index\">\n <div class=\"timeline-event mb-2\" *ngIf=\"!item.shouldHide\">\n <div class=\"event-card\" [ngClass]=\"item.eventCardClass\">\n <!-- Event Header -->\n <div class=\"event-header\">\n <div class=\"event-info\">\n <i [class]=\"item.eventIcon\"></i>\n <span class=\"event-label\">{{ item.label }}</span>\n </div>\n <div class=\"event-timestamp\">{{ item.dateTime }}</div>\n </div>\n <!-- User Information -->\n <div class=\"event-user mb-2\">\n <span class=\"user-name\">{{ item.userName }}</span>\n <span class=\"user-role\">({{ item.userRole }})</span>\n </div>\n <!-- Event Description -->\n <div class=\"event-description\" *ngIf=\"item.requestDescription\">\n <ul class=\"event-description-list\" *ngIf=\"item.label.toLowerCase().includes('requested')\">\n <li class=\"event-description-item\">{{ item.requestDescription }}</li>\n </ul>\n <p *ngIf=\"!item.label.toLowerCase().includes('requested')\">{{ item.requestDescription }}</p>\n </div>\n\n <!-- Document Upload Cards -->\n <div class=\"document-uploads\" *ngIf=\"item.documentList && item.documentList.length > 0\">\n <div class=\"uploaded-documents\">\n <div class=\"document-card\" *ngFor=\"let doc of item.documentList\" (click)=\"onDocumentClick(doc)\">\n <div class=\"document-icon\">\n <i class=\"pi pi-file\"></i>\n </div>\n <span class=\"document-name\">{{ doc.docName }}</span>\n </div>\n </div>\n </div>\n\n\n </div>\n </div>\n </ng-container>\n </div>\n </div>\n </div>\n\n <!-- <ng-content [select]=\"'actions-component'\"></ng-content> -->\n</div>\n\n<p-sidebar\n *ngIf=\"isDocumentIntelligence\"\n [(visible)]=\"documentHistoryAiService.state.showAiSidebar\"\n position=\"right\"\n [style]=\"{ width: '420px' }\"\n [dismissible]=\"true\"\n [showCloseIcon]=\"true\"\n [appendTo]=\"'body'\"\n>\n <ng-template pTemplate=\"header\">\n <h3 class=\"ai-sidebar-title\">{{ documentHistoryAiService.state.aiSidebarHeader }}</h3>\n </ng-template>\n\n <div class=\"ai-sidebar-content\">\n <ng-container *ngIf=\"documentHistoryAiService.state.aiSidebarHeader === 'Query'\">\n <p class=\"ai-sidebar-error\" *ngIf=\"documentHistoryAiService.state.aiError\">{{ documentHistoryAiService.state.aiError }}</p>\n\n <div class=\"query-chat-messages\">\n <div class=\"query-chat-empty\" *ngIf=\"documentHistoryAiService.state.queryMessages.length === 0 && !documentHistoryAiService.state.queryLoading\">\n Ask anything about this document.\n </div>\n\n <div *ngFor=\"let message of documentHistoryAiService.state.queryMessages\" class=\"query-chat-message\" [ngClass]=\"message.role\">\n <div class=\"query-chat-bubble\">\n <span *ngIf=\"message.role === 'user'\">{{ message.content }}</span>\n <div *ngIf=\"message.role === 'assistant'\" class=\"ai-markdown\" [innerHTML]=\"message.htmlContent\"></div>\n </div>\n </div>\n\n <div class=\"query-chat-message assistant\" *ngIf=\"documentHistoryAiService.state.queryLoading\">\n <div class=\"query-chat-bubble\">Thinking...</div>\n </div>\n </div>\n\n <div class=\"query-chat-input-wrap\">\n <textarea\n [(ngModel)]=\"documentHistoryAiService.state.queryText\"\n (keydown)=\"onQueryEnter($event)\"\n class=\"query-chat-input\"\n rows=\"3\"\n placeholder=\"Type your question\"\n ></textarea>\n <button type=\"button\" class=\"query-send-btn\" [disabled]=\"documentHistoryAiService.state.queryLoading || !documentHistoryAiService.state.queryText.trim()\" (click)=\"sendQuery()\">\n Send\n </button>\n </div>\n </ng-container>\n </div>\n</p-sidebar>", styles: [".document-review-container{border-radius:8px;max-height:100%;overflow-y:auto;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif}.document-review-container .review-header{display:flex;justify-content:space-between;align-items:center;padding-bottom:1rem;border-bottom:1px solid #e5e7eb}.document-review-container .review-header .review-title-section{display:flex;align-items:center;gap:.75rem}.document-review-container .review-header .review-title{font-size:1.5rem;font-weight:600;color:#1f2937;margin:0}.document-review-container .review-header .ai-menu{position:relative}.document-review-container .review-header .ai-menu .ai-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:0 .85rem;color:#374151;font-size:.875rem;height:40px;line-height:1;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .ai-menu .ai-btn:hover{background:#f9fafb}.document-review-container .review-header .ai-menu .ai-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .ai-menu .ai-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .ai-menu .ai-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .ai-menu .ai-dropdown{position:absolute;top:100%;left:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:160px;margin-top:.25rem;padding:.25rem 0}.document-review-container .review-header .ai-menu .ai-dropdown .ai-dropdown-item{width:100%;text-align:left;border:none;background:transparent;padding:.625rem .875rem;cursor:pointer;color:#374151;font-size:.875rem}.document-review-container .review-header .ai-menu .ai-dropdown .ai-dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu{position:relative}.document-review-container .review-header .actions-menu .actions-btn{background:#fff;border:1px solid #d1d5db;border-radius:6px;padding:0 1rem;height:40px;line-height:1;color:#374151;font-size:.875rem;cursor:pointer;display:flex;align-items:center;gap:.5rem;transition:all .2s}.document-review-container .review-header .actions-menu .actions-btn:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-btn.active{background:#f3f4f6;border-color:#9ca3af}.document-review-container .review-header .actions-menu .actions-btn i{font-size:.75rem;transition:transform .2s}.document-review-container .review-header .actions-menu .actions-btn i.rotated{transform:rotate(180deg)}.document-review-container .review-header .actions-menu .actions-dropdown{position:absolute;top:100%;right:0;background:#fff;border:1px solid #d1d5db;border-radius:8px;box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -1px #0000000f;z-index:1000;min-width:180px;margin-top:.25rem}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item{padding:.75rem 1rem;cursor:pointer;color:#374151;font-size:.875rem;border-bottom:1px solid #f3f4f6;transition:background-color .2s}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:last-child{border-bottom:none;border-radius:0 0 8px 8px}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:first-child{border-radius:8px 8px 0 0}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item:hover{background:#f9fafb}.document-review-container .review-header .actions-menu .actions-dropdown .dropdown-item span{display:block}.document-review-container ::ng-deep document-actions{margin-bottom:1.5rem}.document-review-container ::ng-deep document-actions .actions-card{margin:0;width:100%}.document-review-container .document-actions-section{padding:1rem 0}.document-review-container .alerts-section{margin-bottom:2rem}.document-review-container .alerts-section .alert-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1rem}.document-review-container .alerts-section .alert-card .alert-header{display:flex;align-items:center;gap:.75rem}.document-review-container .alerts-section .alert-card .alert-header .alert-icon{color:#ef4444;font-size:1.25rem}.document-review-container .alerts-section .alert-card .alert-header .alert-text{font-weight:500;color:#1f2937;font-size:1rem}.document-review-container .alerts-section .alert-card .alert-header .alert-badge{margin-left:auto;display:flex;align-items:center;gap:.5rem;background:#ef4444;color:#fff;border-radius:50%;width:24px;height:24px;justify-content:center;position:relative}.document-review-container .alerts-section .alert-card .alert-header .alert-badge .alert-count{font-size:.75rem;font-weight:600}.document-review-container .alerts-section .alert-card .alert-header .alert-badge i{position:absolute;right:-8px;font-size:.75rem;color:#ef4444;background:#fff;border-radius:50%;width:16px;height:16px;display:flex;align-items:center;justify-content:center}.document-review-container .timeline-section .timeline-title{font-size:1.25rem;font-weight:600;color:#1f2937;margin:0 0 1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item{margin-bottom:1.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card{background:#fff;border:1px solid #e5e7eb;border-radius:8px;padding:1.25rem;position:relative}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info{display:flex;align-items:center;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon{width:25px;height:25px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon i{font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-requested{background:#3b82f6}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-accepted{background:#10b981}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-rejected{background:#ef4444}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-icon.icon-default{background:#6b7280}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-info .event-label{font-weight:600;color:#1f2937;font-size:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{color:#6b7280;font-size:.875rem;font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-description p{color:#374151;line-height:1.5;margin:0;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads{margin-bottom:1rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents{display:flex;flex-direction:column;gap:.75rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card{background:#f8fafc;border:1px solid #e2e8f0;border-radius:8px;padding:.5rem;display:flex;align-items:center;gap:.75rem;cursor:pointer;transition:all .2s ease}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:hover{background:#e2e8f0;border-color:#3b82f6;transform:translateY(-1px);box-shadow:0 2px 4px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card:active{transform:translateY(0);box-shadow:0 1px 2px #0000001a}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-icon{color:#3b82f6;font-size:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .document-uploads .uploaded-documents .document-card .document-name{color:#1f2937;font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user{font-size:.875rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-name{color:rgb(75,85,99,var(--tw-text-opacity, 1));font-weight:500}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-user .user-role{color:#6b7280;margin-left:.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-requested{background:#dbeafe;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-accepted{background:#dcfce7;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-rejected{background:#fee2e2;border-radius:16px;font-size:.875rem;line-height:1.25rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card.event-default{border-left:4px solid #6b7280}@media (max-width: 768px){.document-review-container{padding:1rem}.document-review-container .review-header{flex-direction:column;gap:1rem;align-items:flex-start}.document-review-container .review-header .actions-menu{align-self:flex-end}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header{flex-direction:column;align-items:flex-start;gap:.5rem}.document-review-container .timeline-section .timeline-container .timeline-item .timeline-event .event-card .event-header .event-timestamp{align-self:flex-end}}.ai-sidebar-title{margin:0;font-size:1.1rem;font-weight:600;color:#111827}.ai-sidebar-content{padding:1rem .5rem}.ai-sidebar-text{margin:0;color:#4b5563;font-size:.95rem;line-height:1.5;white-space:pre-wrap}.ai-markdown p{margin:0 0 .5rem}.ai-markdown :last-child{margin-bottom:0}.ai-markdown strong{color:#111827;font-weight:700}.ai-markdown .ai-markdown-list{margin:0 0 .5rem 1.1rem;padding:0}.ai-markdown li{margin-bottom:.35rem}.ai-sidebar-error{margin:0;color:#dc2626;font-size:.9rem}.query-chat-messages{max-height:calc(100vh - 260px);overflow-y:auto;padding:.25rem .1rem .5rem;margin-bottom:.75rem}.query-chat-empty{color:#6b7280;font-size:.9rem;text-align:center;padding:.75rem .5rem}.query-chat-message{display:flex;margin-bottom:.6rem}.query-chat-message.user{justify-content:flex-end}.query-chat-message.assistant{justify-content:flex-start}.query-chat-bubble{max-width:85%;padding:.6rem .75rem;border-radius:12px;font-size:.9rem;line-height:1.45;border:1px solid #e5e7eb;background:#f9fafb;color:#1f2937}.query-chat-message.user .query-chat-bubble{background:#dbeafe;border-color:#bfdbfe}.query-chat-input-wrap{display:flex;flex-direction:column;gap:.5rem}.query-chat-input{width:100%;border:1px solid #d1d5db;border-radius:8px;padding:.6rem .7rem;font-size:.9rem;resize:vertical;min-height:70px}.query-chat-input:focus{outline:none;border-color:#60a5fa;box-shadow:0 0 0 2px #60a5fa33}.query-send-btn{align-self:flex-end;border:1px solid #2563eb;background:#2563eb;color:#fff;border-radius:8px;padding:.45rem .9rem;font-size:.85rem;cursor:pointer}.query-send-btn:hover:not(:disabled){background:#1d4ed8}.query-send-btn:disabled{cursor:not-allowed;opacity:.6}\n"] }]
7536
7373
  }], ctorParameters: () => [{ type: DocumentHistoryService }, { type: DocumentViewerService }, { type: DocumentActionsService }, { type: i3.ConfirmationService }, { type: DocumentHttpService }, { type: DocumentHistoryAiService }], propDecorators: { historyData: [{
7537
7374
  type: Input
7538
7375
  }], showHistory: [{
@@ -7541,6 +7378,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImpo
7541
7378
  type: Input
7542
7379
  }], selectedDocument: [{
7543
7380
  type: Input
7381
+ }], isDocumentIntelligence: [{
7382
+ type: Input
7544
7383
  }], deleteTaskRequested: [{
7545
7384
  type: Output
7546
7385
  }], documentSelected: [{
@@ -9484,7 +9323,7 @@ class DocumentViewerComponent {
9484
9323
  this.documentStore.clearDocumentViewerState();
9485
9324
  }
9486
9325
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, deps: [{ token: DocumentHttpService }, { token: DocumentHelperService }, { token: i3.MessageService }, { token: DocumentViewerService }, { token: DocumentStore }], target: i0.ɵɵFactoryTarget.Component });
9487
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument", documentList: "documentList", contextId: "contextId", isFormHide: "isFormHide" }, outputs: { documentStatusUpdated: "documentStatusUpdated", deleteError: "deleteError", deleteSuccess: "deleteSuccess", viewerDestroyed: "viewerDestroyed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-viewer-container grid p-formgrid\">\n <div class=\"main-content col-12 md:col-12\">\n @if(messages.length > 0) {\n <p-messages [(value)]=\"messages\" [enableService]=\"false\"></p-messages>\n }\n \n <div class=\"content-grid col-12 md:col-12\">\n @if(selectedDocument){\n <div class=\"document-preview p-0 col-12 md:col-9\">\n <document-content-viewer\n [documentUrl]=\"selectedDocument?.documentUrl\"\n [contentType]=\"selectedDocument?.contentType\"\n [documentName]=\"selectedDocument?.docName\"\n [selectedDocument]=\"selectedDocument\"\n [contextId]=\"contextId\"\n [isFormHide]=\"isFormHide\"\n (documentNameUpdated)=\"onDocumentNameUpdated()\"\n ></document-content-viewer>\n </div>\n }\n\n <div class=\"sidebar col-12 md:col-3 pt-0\">\n <div class=\"sidebar card\">\n <document-history \n [historyData]=\"currentState.documentHistory\" \n [showHistory]=\"currentState.showDocumentHistory\"\n [contextId]=\"contextId\"\n [selectedDocument]=\"selectedDocument\"\n (deleteTaskRequested)=\"onDeleteTaskRequested()\"\n (documentSelected)=\"onDocumentSelected($event)\">\n \n <!-- Document Actions Component inside the history component -->\n <div actions-component *ngIf=\"selectedDocument?.status !=='Pending' && !selectedDocument?.isUploaded && selectedDocument?.status === 'Reviewing'\">\n <document-actions\n [document]=\"selectedDocument\"\n [documentId]=\"selectedDocument?._id\"\n [currentStatus]=\"currentState.documentStatus\"\n [isLoading]=\"currentState.isActionLoading\"\n [isUploaded]=\"currentState.documentIsUploaded\"\n [statusId]=\"selectedDocument?.statusId\"\n (actionPerformed)=\"handleDocumentAction($event)\">\n </document-actions>\n </div>\n <ng-content [select]=\"'action-launcher'\"></ng-content>\n </document-history>\n \n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;overflow:hidden;position:relative}.document-viewer-container{height:100%;width:100%;position:relative;z-index:1;overflow:hidden;display:flex;flex-direction:column}.document-viewer-container .main-content{height:100%;display:flex;flex-direction:column;overflow:hidden;min-height:0}.document-viewer-container .main-content .p-messages{margin-bottom:.5rem;flex-shrink:0}.document-viewer-container .main-content .content-grid{display:grid;grid-template-columns:1fr 400px;gap:1rem;height:0;min-height:0;overflow:hidden;flex:1}.document-viewer-container .main-content .content-grid .document-preview{background:transparent;height:100%;width:100%;min-width:0;overflow:auto;border-radius:10px;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .document-preview::-webkit-scrollbar{display:none}.document-viewer-container .main-content .content-grid .sidebar{display:flex;flex-direction:column;gap:.75rem;height:100%;overflow-y:auto;min-width:0;width:100%;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .sidebar::-webkit-scrollbar{display:none}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-actions-container{margin:0}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-history-container{padding:.75rem;max-height:none;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-history-container::-webkit-scrollbar{display:none}::ng-deep .p-dialog-content{overflow:hidden!important;height:100%!important}::ng-deep .p-dialog{overflow:hidden!important}@media (max-width: 1200px){.document-viewer-container .main-content .content-grid{grid-template-columns:1fr 380px;gap:.75rem}}@media (max-width: 768px){.document-viewer-container .main-content .content-grid{grid-template-columns:1fr;gap:.5rem}.document-viewer-container .main-content .content-grid .sidebar{order:-1}}.alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer{position:relative;z-index:1}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important;z-index:9999!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header{background-color:#fff;border-radius:0;padding:.5rem}.document-viewer .p-dialog-content{background-color:#fff;border-radius:0;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "component", type: DocumentHistoryComponent, selector: "document-history", inputs: ["historyData", "showHistory", "contextId", "selectedDocument"], outputs: ["deleteTaskRequested", "documentSelected"] }, { kind: "component", type: DocumentContentViewerComponent, selector: "document-content-viewer", inputs: ["documentUrl", "contentType", "documentName", "selectedDocument", "contextId", "isFormHide"] }, { kind: "component", type: DocumentActionsComponent, selector: "document-actions", inputs: ["document", "documentId", "currentStatus", "isLoading", "isUploaded", "statusId"], outputs: ["actionPerformed"] }], encapsulation: i0.ViewEncapsulation.None });
9326
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: DocumentViewerComponent, isStandalone: false, selector: "document-viewer", inputs: { selectedDocument: "selectedDocument", documentList: "documentList", contextId: "contextId", isFormHide: "isFormHide" }, outputs: { documentStatusUpdated: "documentStatusUpdated", deleteError: "deleteError", deleteSuccess: "deleteSuccess", viewerDestroyed: "viewerDestroyed" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"document-viewer-container grid p-formgrid\">\n <div class=\"main-content col-12 md:col-12\">\n @if(messages.length > 0) {\n <p-messages [(value)]=\"messages\" [enableService]=\"false\"></p-messages>\n }\n \n <div class=\"content-grid col-12 md:col-12\">\n @if(selectedDocument){\n <div class=\"document-preview p-0 col-12 md:col-9\">\n <document-content-viewer\n [documentUrl]=\"selectedDocument?.documentUrl\"\n [contentType]=\"selectedDocument?.contentType\"\n [documentName]=\"selectedDocument?.docName\"\n [selectedDocument]=\"selectedDocument\"\n [contextId]=\"contextId\"\n [isFormHide]=\"isFormHide\"\n (documentNameUpdated)=\"onDocumentNameUpdated()\"\n ></document-content-viewer>\n </div>\n }\n\n <div class=\"sidebar col-12 md:col-3 pt-0\">\n <div class=\"sidebar card\">\n <document-history \n [historyData]=\"currentState.documentHistory\" \n [showHistory]=\"currentState.showDocumentHistory\"\n [contextId]=\"contextId\"\n [selectedDocument]=\"selectedDocument\"\n (deleteTaskRequested)=\"onDeleteTaskRequested()\"\n (documentSelected)=\"onDocumentSelected($event)\">\n \n <!-- Document Actions Component inside the history component -->\n <div actions-component *ngIf=\"selectedDocument?.status !=='Pending' && !selectedDocument?.isUploaded && selectedDocument?.status === 'Reviewing'\">\n <document-actions\n [document]=\"selectedDocument\"\n [documentId]=\"selectedDocument?._id\"\n [currentStatus]=\"currentState.documentStatus\"\n [isLoading]=\"currentState.isActionLoading\"\n [isUploaded]=\"currentState.documentIsUploaded\"\n [statusId]=\"selectedDocument?.statusId\"\n (actionPerformed)=\"handleDocumentAction($event)\">\n </document-actions>\n </div>\n <ng-content [select]=\"'action-launcher'\"></ng-content>\n </document-history>\n \n </div>\n </div>\n </div>\n</div>\n", styles: [":host{display:block;height:100%;width:100%;overflow:hidden;position:relative}.document-viewer-container{height:100%;width:100%;position:relative;z-index:1;overflow:hidden;display:flex;flex-direction:column}.document-viewer-container .main-content{height:100%;display:flex;flex-direction:column;overflow:hidden;min-height:0}.document-viewer-container .main-content .p-messages{margin-bottom:.5rem;flex-shrink:0}.document-viewer-container .main-content .content-grid{display:grid;grid-template-columns:1fr 400px;gap:1rem;height:0;min-height:0;overflow:hidden;flex:1}.document-viewer-container .main-content .content-grid .document-preview{background:transparent;height:100%;width:100%;min-width:0;overflow:auto;border-radius:10px;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .document-preview::-webkit-scrollbar{display:none}.document-viewer-container .main-content .content-grid .sidebar{display:flex;flex-direction:column;gap:.75rem;height:100%;overflow-y:auto;min-width:0;width:100%;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .sidebar::-webkit-scrollbar{display:none}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-actions-container{margin:0}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-history-container{padding:.75rem;max-height:none;scrollbar-width:none;-ms-overflow-style:none}.document-viewer-container .main-content .content-grid .sidebar ::ng-deep .document-history-container::-webkit-scrollbar{display:none}::ng-deep .p-dialog-content{overflow:hidden!important;height:100%!important}::ng-deep .p-dialog{overflow:hidden!important}@media (max-width: 1200px){.document-viewer-container .main-content .content-grid{grid-template-columns:1fr 380px;gap:.75rem}}@media (max-width: 768px){.document-viewer-container .main-content .content-grid{grid-template-columns:1fr;gap:.5rem}.document-viewer-container .main-content .content-grid .sidebar{order:-1}}.alert-card{background-color:#fb392d1a}.success-alert{border-radius:10px;border:1px solid rgba(251,57,45,.1);background:linear-gradient(0deg,#dedede 0% 100%),#fff}.p-timeline-event-opposite{display:none}.decription{color:#676b89}.textAreaControl textarea{width:100%;resize:vertical;max-width:100%}.document-btn-wrapper .p-button-outlined{color:#f57c00}.document-viewer{position:relative;z-index:1}.document-viewer .p-dialog{width:100%;height:100%;max-height:100%!important;box-shadow:none!important;z-index:9999!important}.document-viewer .p-dialog-header-close-icon{height:20px;width:20px}.document-viewer .p-dialog-header{background-color:#fff;border-radius:0;padding:.5rem}.document-viewer .p-dialog-content{background-color:#fff;border-radius:0;overflow:hidden}\n"], dependencies: [{ kind: "directive", type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.Messages, selector: "p-messages", inputs: ["value", "closable", "style", "styleClass", "enableService", "key", "escape", "severity", "showTransitionOptions", "hideTransitionOptions"], outputs: ["valueChange", "onClose"] }, { kind: "component", type: DocumentHistoryComponent, selector: "document-history", inputs: ["historyData", "showHistory", "contextId", "selectedDocument", "isDocumentIntelligence"], outputs: ["deleteTaskRequested", "documentSelected"] }, { kind: "component", type: DocumentContentViewerComponent, selector: "document-content-viewer", inputs: ["documentUrl", "contentType", "documentName", "selectedDocument", "contextId", "isFormHide"] }, { kind: "component", type: DocumentActionsComponent, selector: "document-actions", inputs: ["document", "documentId", "currentStatus", "isLoading", "isUploaded", "statusId"], outputs: ["actionPerformed"] }], encapsulation: i0.ViewEncapsulation.None });
9488
9327
  }
9489
9328
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: DocumentViewerComponent, decorators: [{
9490
9329
  type: Component,