@memberjunction/ng-explorer-core 6.2.0-edge.2 → 6.2.0-edge.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +10 -0
  2. package/dist/app-routing.module.d.ts.map +1 -1
  3. package/dist/app-routing.module.js +5 -0
  4. package/dist/app-routing.module.js.map +1 -1
  5. package/dist/generated/lazy-feature-config.d.ts +1 -1
  6. package/dist/generated/lazy-feature-config.d.ts.map +1 -1
  7. package/dist/generated/lazy-feature-config.js +12 -2
  8. package/dist/generated/lazy-feature-config.js.map +1 -1
  9. package/dist/lib/guards/moved-nav-item-redirect.d.ts +15 -0
  10. package/dist/lib/guards/moved-nav-item-redirect.d.ts.map +1 -0
  11. package/dist/lib/guards/moved-nav-item-redirect.js +37 -0
  12. package/dist/lib/guards/moved-nav-item-redirect.js.map +1 -0
  13. package/dist/lib/omnibar/omnibar-dashboard-matches.d.ts +34 -0
  14. package/dist/lib/omnibar/omnibar-dashboard-matches.d.ts.map +1 -0
  15. package/dist/lib/omnibar/omnibar-dashboard-matches.js +70 -0
  16. package/dist/lib/omnibar/omnibar-dashboard-matches.js.map +1 -0
  17. package/dist/lib/omnibar/omnibar-palette.component.d.ts +27 -2
  18. package/dist/lib/omnibar/omnibar-palette.component.d.ts.map +1 -1
  19. package/dist/lib/omnibar/omnibar-palette.component.js +126 -65
  20. package/dist/lib/omnibar/omnibar-palette.component.js.map +1 -1
  21. package/dist/lib/omnibar/omnibar-provider.d.ts +4 -0
  22. package/dist/lib/omnibar/omnibar-provider.d.ts.map +1 -1
  23. package/dist/lib/omnibar/omnibar-provider.js.map +1 -1
  24. package/dist/lib/omnibar/providers/omnibar-record.provider.d.ts +2 -2
  25. package/dist/lib/omnibar/providers/omnibar-record.provider.d.ts.map +1 -1
  26. package/dist/lib/omnibar/providers/omnibar-record.provider.js +3 -7
  27. package/dist/lib/omnibar/providers/omnibar-record.provider.js.map +1 -1
  28. package/dist/lib/omnibar/providers/omnibar-search.provider.d.ts +15 -2
  29. package/dist/lib/omnibar/providers/omnibar-search.provider.d.ts.map +1 -1
  30. package/dist/lib/omnibar/providers/omnibar-search.provider.js +59 -7
  31. package/dist/lib/omnibar/providers/omnibar-search.provider.js.map +1 -1
  32. package/dist/lib/profile/forking-setting.d.ts +8 -0
  33. package/dist/lib/profile/forking-setting.d.ts.map +1 -0
  34. package/dist/lib/profile/forking-setting.js +18 -0
  35. package/dist/lib/profile/forking-setting.js.map +1 -0
  36. package/dist/lib/profile/profile-dialog.component.d.ts +8 -0
  37. package/dist/lib/profile/profile-dialog.component.d.ts.map +1 -1
  38. package/dist/lib/profile/profile-dialog.component.js +182 -92
  39. package/dist/lib/profile/profile-dialog.component.js.map +1 -1
  40. package/dist/lib/resource-wrappers/artifact-resource.component.d.ts +23 -4
  41. package/dist/lib/resource-wrappers/artifact-resource.component.d.ts.map +1 -1
  42. package/dist/lib/resource-wrappers/artifact-resource.component.js +36 -8
  43. package/dist/lib/resource-wrappers/artifact-resource.component.js.map +1 -1
  44. package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts +7 -18
  45. package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts.map +1 -1
  46. package/dist/lib/resource-wrappers/chat-conversations-resource.component.js +20 -41
  47. package/dist/lib/resource-wrappers/chat-conversations-resource.component.js.map +1 -1
  48. package/dist/lib/resource-wrappers/chat-search-routing.d.ts +10 -3
  49. package/dist/lib/resource-wrappers/chat-search-routing.d.ts.map +1 -1
  50. package/dist/lib/resource-wrappers/chat-search-routing.js +11 -4
  51. package/dist/lib/resource-wrappers/chat-search-routing.js.map +1 -1
  52. package/dist/lib/resource-wrappers/dashboard-add-to-menu.component.d.ts +29 -0
  53. package/dist/lib/resource-wrappers/dashboard-add-to-menu.component.d.ts.map +1 -0
  54. package/dist/lib/resource-wrappers/dashboard-add-to-menu.component.js +141 -0
  55. package/dist/lib/resource-wrappers/dashboard-add-to-menu.component.js.map +1 -0
  56. package/dist/lib/resource-wrappers/dashboard-part-config.d.ts +28 -0
  57. package/dist/lib/resource-wrappers/dashboard-part-config.d.ts.map +1 -0
  58. package/dist/lib/resource-wrappers/dashboard-part-config.js +150 -0
  59. package/dist/lib/resource-wrappers/dashboard-part-config.js.map +1 -0
  60. package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts +361 -56
  61. package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts.map +1 -1
  62. package/dist/lib/resource-wrappers/dashboard-resource.component.js +1312 -361
  63. package/dist/lib/resource-wrappers/dashboard-resource.component.js.map +1 -1
  64. package/dist/lib/resource-wrappers/dashboard-source-search.d.ts +86 -0
  65. package/dist/lib/resource-wrappers/dashboard-source-search.d.ts.map +1 -0
  66. package/dist/lib/resource-wrappers/dashboard-source-search.js +136 -0
  67. package/dist/lib/resource-wrappers/dashboard-source-search.js.map +1 -0
  68. package/dist/lib/resource-wrappers/dashboard-studio-pane.d.ts +30 -0
  69. package/dist/lib/resource-wrappers/dashboard-studio-pane.d.ts.map +1 -0
  70. package/dist/lib/resource-wrappers/dashboard-studio-pane.js +55 -0
  71. package/dist/lib/resource-wrappers/dashboard-studio-pane.js.map +1 -0
  72. package/dist/lib/resource-wrappers/dashboard-studio-tools.d.ts +135 -0
  73. package/dist/lib/resource-wrappers/dashboard-studio-tools.d.ts.map +1 -0
  74. package/dist/lib/resource-wrappers/dashboard-studio-tools.js +856 -0
  75. package/dist/lib/resource-wrappers/dashboard-studio-tools.js.map +1 -0
  76. package/dist/lib/resource-wrappers/dashboard-tab-agent.d.ts +87 -0
  77. package/dist/lib/resource-wrappers/dashboard-tab-agent.d.ts.map +1 -0
  78. package/dist/lib/resource-wrappers/dashboard-tab-agent.js +125 -0
  79. package/dist/lib/resource-wrappers/dashboard-tab-agent.js.map +1 -0
  80. package/dist/lib/resource-wrappers/human-handoff-console-resource.component.d.ts +32 -0
  81. package/dist/lib/resource-wrappers/human-handoff-console-resource.component.d.ts.map +1 -0
  82. package/dist/lib/resource-wrappers/human-handoff-console-resource.component.js +114 -0
  83. package/dist/lib/resource-wrappers/human-handoff-console-resource.component.js.map +1 -0
  84. package/dist/lib/resource-wrappers/livekit-room-resource.component.d.ts +40 -6
  85. package/dist/lib/resource-wrappers/livekit-room-resource.component.d.ts.map +1 -1
  86. package/dist/lib/resource-wrappers/livekit-room-resource.component.js +287 -147
  87. package/dist/lib/resource-wrappers/livekit-room-resource.component.js.map +1 -1
  88. package/dist/lib/resource-wrappers/meetings-resource.component.d.ts +42 -0
  89. package/dist/lib/resource-wrappers/meetings-resource.component.d.ts.map +1 -0
  90. package/dist/lib/resource-wrappers/meetings-resource.component.js +225 -0
  91. package/dist/lib/resource-wrappers/meetings-resource.component.js.map +1 -0
  92. package/dist/lib/resource-wrappers/record-resource.component.d.ts +27 -2
  93. package/dist/lib/resource-wrappers/record-resource.component.d.ts.map +1 -1
  94. package/dist/lib/resource-wrappers/record-resource.component.js +58 -6
  95. package/dist/lib/resource-wrappers/record-resource.component.js.map +1 -1
  96. package/dist/lib/resource-wrappers/search-results-resource.component.d.ts.map +1 -1
  97. package/dist/lib/resource-wrappers/search-results-resource.component.js +5 -4
  98. package/dist/lib/resource-wrappers/search-results-resource.component.js.map +1 -1
  99. package/dist/lib/shell/components/tabs/component-cache-manager.d.ts.map +1 -1
  100. package/dist/lib/shell/components/tabs/component-cache-manager.js.map +1 -1
  101. package/dist/lib/shell/components/tabs/tab-container.component.d.ts +38 -0
  102. package/dist/lib/shell/components/tabs/tab-container.component.d.ts.map +1 -1
  103. package/dist/lib/shell/components/tabs/tab-container.component.js +77 -4
  104. package/dist/lib/shell/components/tabs/tab-container.component.js.map +1 -1
  105. package/dist/lib/shell/dashboard-tab-for-url.d.ts +35 -0
  106. package/dist/lib/shell/dashboard-tab-for-url.d.ts.map +1 -0
  107. package/dist/lib/shell/dashboard-tab-for-url.js +39 -0
  108. package/dist/lib/shell/dashboard-tab-for-url.js.map +1 -0
  109. package/dist/lib/shell/shell.component.d.ts +31 -2
  110. package/dist/lib/shell/shell.component.d.ts.map +1 -1
  111. package/dist/lib/shell/shell.component.js +119 -42
  112. package/dist/lib/shell/shell.component.js.map +1 -1
  113. package/dist/lib/shell/shell.module.d.ts +2 -1
  114. package/dist/lib/shell/shell.module.d.ts.map +1 -1
  115. package/dist/lib/shell/shell.module.js +6 -2
  116. package/dist/lib/shell/shell.module.js.map +1 -1
  117. package/dist/lib/single-dashboard/single-dashboard.component.js +1 -1
  118. package/dist/lib/single-dashboard/single-dashboard.component.js.map +1 -1
  119. package/dist/lib/single-record/single-record.component.d.ts +29 -3
  120. package/dist/lib/single-record/single-record.component.d.ts.map +1 -1
  121. package/dist/lib/single-record/single-record.component.js +44 -4
  122. package/dist/lib/single-record/single-record.component.js.map +1 -1
  123. package/dist/lib/template-user/template-user-banner.component.d.ts +20 -0
  124. package/dist/lib/template-user/template-user-banner.component.d.ts.map +1 -0
  125. package/dist/lib/template-user/template-user-banner.component.js +67 -0
  126. package/dist/lib/template-user/template-user-banner.component.js.map +1 -0
  127. package/dist/lib/user-notifications/user-notifications.component.d.ts +13 -0
  128. package/dist/lib/user-notifications/user-notifications.component.d.ts.map +1 -1
  129. package/dist/lib/user-notifications/user-notifications.component.js +67 -0
  130. package/dist/lib/user-notifications/user-notifications.component.js.map +1 -1
  131. package/dist/module.d.ts +61 -56
  132. package/dist/module.d.ts.map +1 -1
  133. package/dist/module.js +32 -4
  134. package/dist/module.js.map +1 -1
  135. package/dist/public-api.d.ts +2 -0
  136. package/dist/public-api.d.ts.map +1 -1
  137. package/dist/public-api.js +2 -0
  138. package/dist/public-api.js.map +1 -1
  139. package/package.json +58 -52
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/dashboard-resource.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAkC,SAAS,EAAyC,MAAM,eAAe,CAAC;AAC5H,OAAO,EAAE,qBAAqB,EAAqB,a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BAAiB,CAouB7B;;iFApuBY,iBAAiB;cA3Y7B,SAAS;6BACI,KAAK,YACL,uBAAuB,YACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAoGT;;kBAiTA,SAAS;mBAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAb/B,iBAAiB","sourcesContent":["import { Component, ViewContainerRef, ComponentRef, ViewChild, ElementRef, ChangeDetectorRef, inject } from '@angular/core';\nimport { BaseResourceComponent, NavigationService, BaseDashboard, DashboardConfig } from '@memberjunction/ng-shared';\nimport { ResourceData, MJDashboardEntity, DashboardEngine, MJDashboardUserStateEntity, MJDashboardCategoryEntity, MJDashboardPartTypeEntity, DashboardUserPermissions } from '@memberjunction/core-entities';\nimport { RegisterClass, MJGlobal, SafeJSONParse , UUIDsEqual } from '@memberjunction/global';\nimport { Metadata, CompositeKey, RunView, LogError } from '@memberjunction/core';\nimport type { DataExplorerFilter } from '@memberjunction/ng-dashboards/data-explorer-dashboards.module';\nimport type { ShareDialogResult } from '@memberjunction/ng-dashboards/core-dashboards.module';\nimport { DashboardViewerComponent, DashboardNavRequestEvent, PanelInteractionEvent, AddPanelResult, DashboardPanel } from '@memberjunction/ng-dashboard-viewer';\n/**\n * Dashboard Resource Wrapper - displays a single dashboard in a tab\n * Extends BaseResourceComponent to work with the resource type system\n * Dynamically routes between code-based and config-based dashboards based on dashboard type\n */\n@RegisterClass(BaseResourceComponent, 'DashboardResource')\n@Component({\n standalone: false,\n selector: 'mj-dashboard-resource',\n template: `\n <div class=\"dashboard-resource-wrapper\">\n <!-- Error State -->\n @if (errorMessage) {\n <div class=\"error-state\">\n <div class=\"error-icon\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </div>\n <h2 class=\"error-title\">Unable to Load Dashboard</h2>\n <p class=\"error-message\">{{ errorMessage }}</p>\n @if (errorDetails) {\n <details class=\"error-details\">\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n }\n\n <!-- View Mode Toolbar -->\n @if (configDashboard && !isEditMode && !errorMessage) {\n <div class=\"viewer-toolbar\">\n <div class=\"toolbar-left\">\n <span class=\"dashboard-title\">\n <i class=\"fa-solid fa-chart-line\"></i>\n {{ configDashboard.Name }}\n </span>\n @if (!dashboardPermissions.IsOwner && dashboardPermissions.PermissionSource !== 'none') {\n <span class=\"shared-indicator\" title=\"Shared with you\">\n <i class=\"fa-solid fa-share-nodes\"></i>\n </span>\n }\n </div>\n <div class=\"toolbar-actions\">\n @if (dashboardPermissions.CanShare) {\n <button\n class=\"btn-icon\"\n title=\"Share Dashboard\"\n (click)=\"openShareDialog()\">\n <i class=\"fa-solid fa-share-nodes\"></i>\n </button>\n }\n @if (dashboardPermissions.CanEdit) {\n <button\n class=\"btn-icon\"\n title=\"Edit Dashboard\"\n (click)=\"toggleEditMode()\">\n <i class=\"fa-solid fa-edit\"></i>\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Edit Mode Toolbar -->\n @if (configDashboard && isEditMode && !errorMessage) {\n <div class=\"viewer-header editing\">\n <div class=\"header-left\">\n <button class=\"btn-add-part\" (click)=\"openAddPartDialog()\">\n <i class=\"fa-solid fa-plus\"></i>\n Add Part\n </button>\n <div class=\"header-separator\"></div>\n <div class=\"dashboard-info-edit\">\n <input\n type=\"text\"\n class=\"dashboard-name-input\"\n [(ngModel)]=\"editingName\"\n placeholder=\"Dashboard name\">\n <input\n type=\"text\"\n class=\"dashboard-description-input\"\n [(ngModel)]=\"editingDescription\"\n placeholder=\"Add a description...\">\n </div>\n </div>\n <div class=\"header-right\">\n <button class=\"btn-primary\" (click)=\"saveDashboard()\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n <button class=\"btn-cancel\" (click)=\"cancelEdit()\">\n Cancel\n </button>\n </div>\n </div>\n }\n\n <!-- Dashboard Content Container -->\n <div #container class=\"dashboard-resource-container\"></div>\n\n <!-- Share Dashboard Dialog -->\n @if (configDashboard) {\n <mj-dashboard-share-dialog\n [Visible]=\"showShareDialog\"\n [Dashboard]=\"configDashboard\"\n (Result)=\"onShareDialogResult($event)\">\n </mj-dashboard-share-dialog>\n }\n </div>\n `,\n styles: [`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .dashboard-resource-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n }\n .dashboard-resource-container {\n flex: 1;\n overflow: hidden;\n min-height: 0;\n }\n\n /* View Mode Toolbar */\n .viewer-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n gap: 16px;\n }\n .viewer-toolbar .toolbar-left {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n .viewer-toolbar .dashboard-title {\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n display: flex;\n align-items: center;\n gap: 8px;\n }\n .viewer-toolbar .dashboard-title i {\n color: var(--mj-brand-primary);\n }\n .shared-indicator {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n font-size: 11px;\n }\n .viewer-toolbar .toolbar-actions {\n display: flex;\n align-items: center;\n gap: 12px;\n }\n\n /* Edit Mode Header */\n .viewer-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 24px;\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n transition: background 0.2s, border-color 0.2s;\n }\n .viewer-header.editing {\n background: linear-gradient(135deg, color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface)) 0%, color-mix(in srgb, var(--mj-brand-primary) 25%, var(--mj-bg-surface)) 100%);\n border-bottom: 2px solid var(--mj-brand-primary);\n }\n .viewer-header .header-left {\n display: flex;\n align-items: center;\n gap: 12px;\n flex: 1;\n }\n .viewer-header .header-right {\n display: flex;\n align-items: center;\n gap: 8px;\n }\n\n /* Add Part button */\n .btn-add-part {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px 16px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s, transform 0.1s;\n box-shadow: 0 2px 4px color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n }\n .btn-add-part:hover {\n background: var(--mj-brand-primary-hover);\n transform: translateY(-1px);\n box-shadow: 0 3px 6px color-mix(in srgb, var(--mj-brand-primary) 40%, transparent);\n }\n .btn-add-part i { font-size: 12px; }\n\n /* Header separator */\n .header-separator {\n width: 1px;\n height: 28px;\n background: color-mix(in srgb, var(--mj-brand-primary) 30%, transparent);\n margin: 0 4px;\n }\n\n /* Buttons */\n .btn-primary {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: none;\n border-radius: 6px;\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n font-size: 14px;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.2s;\n }\n .btn-primary:hover { background: var(--mj-brand-primary-hover); }\n\n .btn-icon {\n width: 36px;\n height: 36px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-icon:hover { background: var(--mj-bg-surface-sunken); }\n\n .btn-cancel {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 10px 18px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-secondary);\n font-size: 14px;\n cursor: pointer;\n transition: all 0.2s;\n }\n .btn-cancel:hover {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n color: var(--mj-text-primary);\n }\n\n /* Dashboard info inputs */\n .dashboard-info-edit {\n display: flex;\n align-items: center;\n gap: 16px;\n flex: 1;\n }\n .dashboard-name-input {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 16px;\n font-weight: 500;\n color: var(--mj-text-primary);\n background: rgba(255, 255, 255, 0.7);\n outline: none;\n min-width: 200px;\n max-width: 300px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-name-input:hover { background: rgba(255, 255, 255, 0.9); }\n .dashboard-name-input:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input {\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 6px 12px;\n font-size: 13px;\n color: var(--mj-text-secondary);\n background: rgba(255, 255, 255, 0.5);\n outline: none;\n flex: 1;\n min-width: 150px;\n max-width: 400px;\n transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;\n }\n .dashboard-description-input:hover { background: rgba(255, 255, 255, 0.8); }\n .dashboard-description-input:focus {\n background: var(--mj-bg-surface-card);\n border-color: var(--mj-brand-primary);\n box-shadow: 0 0 0 2px color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n }\n .dashboard-description-input::placeholder {\n color: var(--mj-text-muted);\n font-style: normal;\n }\n\n /* Error state */\n .error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-secondary);\n }\n .error-icon {\n font-size: 64px;\n color: var(--mj-status-error);\n margin-bottom: 24px;\n opacity: 0.8;\n }\n .error-title {\n font-size: 24px;\n font-weight: 500;\n margin: 0 0 12px 0;\n color: var(--mj-text-primary);\n }\n .error-message {\n font-size: 16px;\n color: var(--mj-text-muted);\n margin: 0 0 24px 0;\n max-width: 500px;\n line-height: 1.5;\n }\n .error-details {\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n padding: 12px 16px;\n max-width: 600px;\n text-align: left;\n font-size: 13px;\n }\n .error-details summary {\n cursor: pointer;\n font-weight: 500;\n color: var(--mj-text-muted);\n margin-bottom: 8px;\n }\n .error-details pre {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--mj-status-error-text);\n font-family: 'Consolas', 'Monaco', monospace;\n font-size: 12px;\n }\n\n /* Responsive */\n @media (max-width: 768px) {\n .viewer-header {\n flex-direction: column;\n gap: 12px;\n align-items: stretch;\n }\n .viewer-header .header-left { flex-wrap: wrap; }\n .dashboard-info-edit {\n flex-direction: column;\n align-items: stretch;\n }\n .dashboard-name-input,\n .dashboard-description-input { max-width: none; }\n }\n `]\n})\nexport class DashboardResource extends BaseResourceComponent {\n private componentRef: ComponentRef<unknown> | null = null;\n\n /**\n * A cache reattach moves this wrapper to another tab without recreating the dashboard inside it,\n * so the child's tab stamp — taken when we created it — has to move too. Without this the\n * dashboard keeps reading and writing the params of the tab it was born in, from inside a tab it\n * no longer belongs to.\n */\n protected override onTabIdRebound(tabId: string): void {\n this.rehomeChildToTab(this.componentRef?.instance as BaseResourceComponent | undefined, tabId);\n }\n private dataLoaded = false;\n @ViewChild('container', { static: true }) ContainerElement!: ElementRef<HTMLDivElement>;\n\n /** @deprecated Use {@link ContainerElement}. */\n get containerElement(): ElementRef<HTMLDivElement> {\n return this.ContainerElement;\n }\n /** @deprecated Use {@link ContainerElement}. */\n set containerElement(value: ElementRef<HTMLDivElement>) {\n this.ContainerElement = value;\n }\n\n /** Error message to display when dashboard fails to load */\n public errorMessage: string | null = null;\n /** Technical error details (shown in expandable section) */\n public ErrorDetails: string | null = null;\n\n /** @deprecated Use {@link ErrorDetails}. */\n public get errorDetails(): string | null {\n return this.ErrorDetails;\n }\n /** @deprecated Use {@link ErrorDetails}. */\n public set errorDetails(value: string | null) {\n this.ErrorDetails = value;\n }\n\n /** Cached dashboard categories for breadcrumb navigation */\n private categories: MJDashboardCategoryEntity[] = [];\n\n /** Reference to the dashboard viewer component (for config-based dashboards) */\n private viewerInstance: DashboardViewerComponent | null = null;\n\n /** The config-based dashboard entity (null for code-based dashboards) */\n public ConfigDashboard: MJDashboardEntity | null = null;\n\n /** @deprecated Use {@link ConfigDashboard}. */\n public get configDashboard(): MJDashboardEntity | null {\n return this.ConfigDashboard;\n }\n /** @deprecated Use {@link ConfigDashboard}. */\n public set configDashboard(value: MJDashboardEntity | null) {\n this.ConfigDashboard = value;\n }\n\n /** Whether we're in edit mode */\n public IsEditMode = false;\n\n /** @deprecated Use {@link IsEditMode}. */\n public get isEditMode() {\n return this.IsEditMode;\n }\n /** @deprecated Use {@link IsEditMode}. */\n public set isEditMode(value) {\n this.IsEditMode = value;\n }\n\n /** Editing fields */\n public EditingName = '';\n\n /** @deprecated Use {@link EditingName}. */\n public get editingName() {\n return this.EditingName;\n }\n /** @deprecated Use {@link EditingName}. */\n public set editingName(value) {\n this.EditingName = value;\n }\n public EditingDescription = '';\n\n /** @deprecated Use {@link EditingDescription}. */\n public get editingDescription() {\n return this.EditingDescription;\n }\n /** @deprecated Use {@link EditingDescription}. */\n public set editingDescription(value) {\n this.EditingDescription = value;\n }\n\n /** Current user's permissions for this dashboard */\n public DashboardPermissions: DashboardUserPermissions = {\n DashboardID: '',\n CanRead: true,\n CanEdit: true,\n CanDelete: true,\n CanShare: true,\n IsOwner: true,\n PermissionSource: 'owner'\n };\n\n /** @deprecated Use {@link DashboardPermissions}. */\n public get dashboardPermissions(): DashboardUserPermissions {\n return this.DashboardPermissions;\n }\n /** @deprecated Use {@link DashboardPermissions}. */\n public set dashboardPermissions(value: DashboardUserPermissions) {\n this.DashboardPermissions = value;\n }\n\n /** Whether the share dialog is visible */\n public ShowShareDialog = false;\n\n /** @deprecated Use {@link ShowShareDialog}. */\n public get showShareDialog() {\n return this.ShowShareDialog;\n }\n /** @deprecated Use {@link ShowShareDialog}. */\n public set showShareDialog(value) {\n this.ShowShareDialog = value;\n }\n\n /**\n * Sets the error state with a user-friendly message and optional technical details\n */\n private setError(message: string, error?: unknown): void {\n this.errorMessage = message;\n if (error instanceof Error) {\n this.ErrorDetails = error.message;\n if (error.stack) {\n this.ErrorDetails += '\\n\\nStack trace:\\n' + error.stack;\n }\n } else if (error) {\n this.ErrorDetails = String(error);\n }\n }\n\n /**\n * Clears any previous error state\n */\n private clearError(): void {\n this.errorMessage = null;\n this.ErrorDetails = null;\n }\n\n constructor(\n private viewContainer: ViewContainerRef,\n private cdr: ChangeDetectorRef\n ) {\n super();\n }\n\n override set Data(value: ResourceData) {\n const previousRecordId = super.Data?.ResourceRecordID;\n super.Data = value;\n\n const newRecordId = value?.ResourceRecordID;\n\n // Load on first set, or when the dashboard has changed\n if (!this.dataLoaded || newRecordId !== previousRecordId) {\n this.dataLoaded = true;\n // Destroy previous component before loading new one\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n this.clearError();\n this.ConfigDashboard = null;\n this.viewerInstance = null;\n this.loadDashboard();\n }\n }\n\n // Need to override the getter too in TS otherwise the override to the setter alone above would break things\n override get Data(): ResourceData {\n return super.Data;\n }\n\n ngOnDestroy(): void {\n super.ngOnDestroy();\n if (this.componentRef) {\n this.componentRef.destroy();\n }\n }\n\n // ========================================\n // Edit Mode Methods\n // ========================================\n\n /**\n * Toggle between view and edit mode\n */\n public ToggleEditMode(): void {\n if (this.IsEditMode) {\n this.CancelEdit();\n } else {\n this.enterEditMode();\n }\n }\n\n /** @deprecated Use {@link ToggleEditMode}. */\n public toggleEditMode(): void {\n return this.ToggleEditMode();\n }\n\n /**\n * Enter edit mode\n */\n private enterEditMode(): void {\n if (!this.ConfigDashboard) return;\n\n this.IsEditMode = true;\n this.EditingName = this.ConfigDashboard.Name;\n this.EditingDescription = this.ConfigDashboard.Description || '';\n\n // Tell the viewer to enter edit mode\n if (this.viewerInstance) {\n this.viewerInstance.isEditing = true;\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Cancel edit mode and discard changes\n */\n public CancelEdit(): void {\n this.IsEditMode = false;\n\n // Tell the viewer to exit edit mode\n if (this.viewerInstance) {\n this.viewerInstance.isEditing = false;\n }\n\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link CancelEdit}. */\n public cancelEdit(): void {\n return this.CancelEdit();\n }\n\n /**\n * Save dashboard changes\n */\n public async SaveDashboard(): Promise<void> {\n if (!this.ConfigDashboard || !this.viewerInstance) return;\n\n try {\n // Update dashboard name and description\n this.ConfigDashboard.Name = this.EditingName;\n this.ConfigDashboard.Description = this.EditingDescription;\n\n // Save via the viewer (which handles layout saving)\n await this.viewerInstance.save();\n\n // Exit edit mode\n this.IsEditMode = false;\n this.viewerInstance.isEditing = false;\n\n this.cdr.detectChanges();\n } catch (error) {\n console.error('Error saving dashboard:', error);\n }\n }\n\n /** @deprecated Use {@link SaveDashboard}. */\n public async saveDashboard(): Promise<void> {\n return this.SaveDashboard();\n }\n\n /**\n * Open the add panel dialog\n */\n public OpenAddPartDialog(): void {\n if (this.viewerInstance) {\n // Trigger the viewer's add panel flow\n this.viewerInstance.onAddPanelClick();\n }\n }\n\n /** @deprecated Use {@link OpenAddPartDialog}. */\n public openAddPartDialog(): void {\n return this.OpenAddPartDialog();\n }\n\n /**\n * Open the share dialog for this dashboard\n */\n public OpenShareDialog(): void {\n this.ShowShareDialog = true;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OpenShareDialog}. */\n public openShareDialog(): void {\n return this.OpenShareDialog();\n }\n\n /**\n * Close the share dialog\n */\n public CloseShareDialog(): void {\n this.ShowShareDialog = false;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link CloseShareDialog}. */\n public closeShareDialog(): void {\n return this.CloseShareDialog();\n }\n\n /**\n * Handle share dialog result\n */\n public OnShareDialogResult(result: ShareDialogResult): void {\n this.ShowShareDialog = false;\n\n if (result.Action === 'save' && this.ConfigDashboard) {\n // Recompute permissions after sharing changes\n const md = this.ProviderToUse;\n this.DashboardPermissions = DashboardEngine.Instance.GetDashboardPermissions(\n this.ConfigDashboard.ID,\n md.CurrentUser.ID\n );\n }\n\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnShareDialogResult}. */\n public onShareDialogResult(result: ShareDialogResult): void {\n return this.OnShareDialogResult(result);\n }\n\n /**\n * Load the appropriate dashboard component based on dashboard type\n * Routes between code-based dashboards (registered classes) and config-based dashboards\n */\n private async loadDashboard(): Promise<void> {\n // Clear any previous error state\n this.clearError();\n\n const data = this.Data;\n\n if (!data?.ResourceRecordID) {\n this.NotifyLoadStarted();\n this.NotifyLoadComplete();\n return;\n }\n\n this.NotifyLoadStarted();\n\n try {\n // Check if this is a special dashboard type (not a database record)\n const config = data.Configuration || {};\n\n if (config['dashboardType'] === 'DataExplorer' || data.ResourceRecordID === 'DataExplorer') {\n // Special case: Data Explorer dashboard with optional entity filter\n await this.loadDataExplorer(\n config['entityFilter'],\n config['appName'] as string | undefined,\n config['appIcon'] as string | undefined\n );\n return;\n }\n\n await DashboardEngine.Instance.Config(false); // make sure it is configured, if already configured does nothing\n const dashboard = DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, data.ResourceRecordID));\n if (!dashboard) {\n throw new Error(`Dashboard with ID ${data.ResourceRecordID} not found.`);\n }\n\n // Determine which dashboard component to load based on dashboard type\n if (dashboard.Type === 'Code') {\n // CODE-BASED DASHBOARD: Use registered class via DriverClass\n await this.loadCodeBasedDashboard(dashboard);\n } else {\n // CONFIG-BASED DASHBOARD: Use the generic metadata-driven renderer\n await this.loadConfigBasedDashboard(dashboard);\n }\n } catch (error) {\n console.error('Error loading dashboard:', error);\n this.setError('The dashboard could not be loaded. This may be due to a missing component or configuration issue.', error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Load the Data Explorer dashboard component with optional entity filter and context info\n * @param entityFilter Optional filter to constrain which entities are shown\n * @param contextName Optional name to display in the header (e.g., \"CRM\", \"Association Demo\")\n * @param contextIcon Optional Font Awesome icon class for the header\n */\n private async loadDataExplorer(\n entityFilter?: DataExplorerFilter,\n contextName?: string,\n contextIcon?: string\n ): Promise<void> {\n try {\n // Lazy-load the Data Explorer component to keep it out of the initial bundle\n const { DataExplorerDashboardComponent } = await import('@memberjunction/ng-dashboards/data-explorer-dashboards.module');\n this.ContainerElement.nativeElement.innerHTML = '';\n const componentRef = this.viewContainer.createComponent(DataExplorerDashboardComponent);\n this.componentRef = componentRef;\n const instance = componentRef.instance;\n\n // Scope the child's query-param reads/writes to THIS tab. A dashboard we instantiate\n // ourselves has no ResourceData and therefore no tab id of its own; without this it\n // cannot update the URL at all (BaseResourceComponent refuses tab-less writes rather\n // than corrupting whichever tab the user is viewing). Set before any await below —\n // Angular can run the child's ngOnInit, which binds its param subscription, while we\n // are suspended.\n instance.ParentTabId = this.getTabId();\n\n // Set the entity filter - ngOnInit will use this when it runs\n if (entityFilter) {\n instance.entityFilter = entityFilter;\n }\n\n // Set context name and icon for customized header display\n if (contextName) {\n instance.contextName = contextName;\n }\n if (contextIcon) {\n instance.contextIcon = contextIcon;\n }\n\n // Manually append the component's native element inside the div\n const nativeElement = (componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.ContainerElement.nativeElement.appendChild(nativeElement);\n\n // Handle open entity record events\n instance.OpenEntityRecord.subscribe((eventData: { EntityName: string; RecordPKey: CompositeKey }) => {\n if (eventData && eventData.EntityName && eventData.RecordPKey) {\n this.navigationService.OpenEntityRecord(eventData.EntityName, eventData.RecordPKey);\n }\n });\n\n // Setup LoadCompleteEvent to know when the dashboard is ready\n instance.LoadCompleteEvent = () => {\n this.NotifyLoadComplete();\n };\n\n // Surface the dashboard's own load failures — but only for the INITIAL load. Wrap the\n // completion hook to learn when the first load has settled, so a later Refresh() that\n // fails does NOT replace an already-rendered Data Explorer with a sticky error card.\n let initialLoadSettled = false;\n const onComplete = instance.LoadCompleteEvent;\n instance.LoadCompleteEvent = () => { initialLoadSettled = true; onComplete?.(); };\n instance.Error.subscribe((err: Error) => {\n if (initialLoadSettled) return; // post-mount refresh failure — already logged by BaseDashboard.runGuardedLoad\n this.setError('The Data Explorer could not be loaded.', err);\n this.cdr.markForCheck();\n });\n\n // Initialize dashboard (no database config needed for DataExplorer)\n const config: DashboardConfig = {\n dashboard: null as unknown as MJDashboardEntity, // No database record\n userState: {}\n };\n instance.Config = config;\n instance.Refresh();\n\n // Trigger change detection to ensure the component updates\n componentRef.changeDetectorRef.detectChanges();\n } catch (error) {\n console.error('Error loading Data Explorer:', error);\n this.setError('The Data Explorer could not be loaded.', error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Load a code-based dashboard by looking up the registered class\n */\n private async loadCodeBasedDashboard(dashboard: MJDashboardEntity): Promise<void> {\n try {\n if (!dashboard.DriverClass) {\n throw new Error(`Dashboard '${dashboard.Name}' is marked as Code type but has no DriverClass specified`);\n }\n\n // Look up the registered class using the DriverClass name (with lazy loading fallback via ClassFactory)\n const classReg = await MJGlobal.Instance.ClassFactory.GetRegistrationAsync(\n BaseDashboard,\n dashboard.DriverClass\n );\n\n if (!classReg?.SubClass) {\n throw new Error(`Dashboard class '${dashboard.DriverClass}' is not registered. Please check the class registration.`);\n }\n\n // Create the component instance\n this.ContainerElement.nativeElement.innerHTML = '';\n this.componentRef = this.viewContainer.createComponent<BaseDashboard>(classReg.SubClass);\n const instance = this.componentRef.instance as BaseDashboard;\n\n // Scope the child's query-param reads/writes to THIS tab. Code dashboards resolved via\n // ClassFactory (every Open App dashboard, MCPDashboard, DataExplorer) get no\n // ResourceData and so have no tab id of their own; without this their UpdateQueryParams\n // calls are refused (and previously — worse — landed in whatever tab the user happened\n // to be looking at). Set before the awaits below: Angular can run the child's ngOnInit,\n // which binds its param subscription, while we are suspended.\n instance.ParentTabId = this.getTabId();\n\n // Setup LoadCompleteEvent() to know when the dashboard is ready\n instance.LoadCompleteEvent = () => {\n this.NotifyLoadComplete();\n };\n\n // Surface the dashboard's own load failures in the host's error card — but only for the\n // INITIAL load. BaseDashboard guarantees the loading screen is released even when\n // initDashboard()/loadData() throws (it emits Error, then NotifyLoadComplete in a\n // finally). Wrap the completion hook to learn when the first load has settled, so a later\n // Refresh() failure keeps the rendered dashboard instead of blanking it to a sticky error\n // card. Wired BEFORE the first await below, so an Error during the instance's own\n // ngOnInit isn't missed.\n let initialLoadSettled = false;\n const onComplete = instance.LoadCompleteEvent;\n instance.LoadCompleteEvent = () => { initialLoadSettled = true; onComplete?.(); };\n instance.Error.subscribe((err: Error) => {\n if (initialLoadSettled) return; // post-mount refresh failure — already logged by BaseDashboard.runGuardedLoad\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded.`, err);\n this.cdr.markForCheck();\n });\n\n // Initialize with dashboard data\n const userStateEntity = await this.loadDashboardUserState(dashboard.ID);\n const config: DashboardConfig = {\n dashboard,\n userState: userStateEntity.UserState ? SafeJSONParse(userStateEntity.UserState) : {}\n };\n\n instance.Config = config;\n\n // Manually append the component's native element inside the div\n const nativeElement = (this.componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.ContainerElement.nativeElement.appendChild(nativeElement);\n\n // handle open entity record events in MJ Explorer with routing\n instance.OpenEntityRecord.subscribe((data: { EntityName: string; RecordPKey: CompositeKey }) => {\n // check to see if the data has entityname/pkey\n if (data && data.EntityName && data.RecordPKey) {\n // Use NavigationService to open entity record in new tab\n this.navigationService.OpenEntityRecord(data.EntityName, data.RecordPKey);\n } else {\n console.warn('DashboardResource - invalid data, missing EntityName or RecordPKey:', data);\n }\n });\n\n instance.UserStateChanged.subscribe(async (userState: any) => {\n if (!userState) {\n // if the user state is null, we need to remove it from the user state\n userState = {};\n }\n // save the user state to the dashboard user state entity\n userStateEntity.UserState = JSON.stringify(userState);\n if (!await userStateEntity.Save()) {\n LogError('Error saving user state', null, userStateEntity.LatestResult?.CompleteMessage);\n }\n });\n\n instance.Refresh();\n } catch (error) {\n console.error('Error loading code-based dashboard:', error);\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded. The dashboard class may not be registered or may have failed to initialize.`, error);\n this.NotifyLoadComplete();\n }\n }\n\n protected async loadDashboardUserState(dashboardId: string): Promise<MJDashboardUserStateEntity> {\n // handle user state changes for the dashboard\n const md = this.ProviderToUse;\n const stateResult = DashboardEngine.Instance.DashboardUserStates.filter(dus => UUIDsEqual(dus.DashboardID, dashboardId) && UUIDsEqual(dus.UserID, md.CurrentUser.ID));\n let stateObject: MJDashboardUserStateEntity;\n if (stateResult && stateResult.length > 0) {\n stateObject = stateResult[0];\n }\n else {\n stateObject = await md.GetEntityObject<MJDashboardUserStateEntity>('MJ: Dashboard User States');\n stateObject.DashboardID = dashboardId;\n stateObject.UserID = md.CurrentUser.ID;\n // don't save becuase we don't care about the state until something changes\n }\n return stateObject;\n }\n\n /**\n * Load a config-based dashboard using the new DashboardViewerComponent (Golden Layout)\n */\n private async loadConfigBasedDashboard(dashboard: MJDashboardEntity): Promise<void> {\n try {\n this.ContainerElement.nativeElement.innerHTML = '';\n const componentRef = this.viewContainer.createComponent(DashboardViewerComponent);\n this.componentRef = componentRef;\n const instance = componentRef.instance;\n\n // Store references for external toolbar control\n this.viewerInstance = instance;\n this.ConfigDashboard = dashboard;\n\n // Compute user permissions for this dashboard\n const md = this.ProviderToUse;\n this.DashboardPermissions = DashboardEngine.Instance.GetDashboardPermissions(\n dashboard.ID,\n md.CurrentUser.ID\n );\n\n // Manually append the component's native element inside the div\n const nativeElement = (this.componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.ContainerElement.nativeElement.appendChild(nativeElement);\n\n // Load categories for breadcrumb navigation (if not already loaded)\n if (this.categories.length === 0) {\n this.categories = DashboardEngine.Instance.DashboardCategories;\n }\n\n // Configure the viewer before assigning the dashboard. The dashboard input\n // starts the layout lifecycle synchronously, so event handlers need to be\n // wired first.\n instance.showToolbar = false; // We provide external toolbar\n instance.showBreadcrumb = false; // Already in its own tab, no breadcrumb needed\n instance.showOpenInTabButton = false; // Already in its own tab\n instance.showEditButton = false; // External toolbar handles edit\n instance.Categories = this.categories;\n\n // Wire up navigation events - handle navigation requests from the dashboard\n instance.navigationRequested.subscribe((event: DashboardNavRequestEvent) => {\n this.handleNavigationRequest(event);\n });\n\n // Wire up \"Open in Tab\" button click\n instance.openInTab.subscribe((event: { dashboardId: string; dashboardName: string }) => {\n this.navigationService.OpenDashboard(event.dashboardId, event.dashboardName);\n });\n\n // Wire up dashboard saved event\n instance.dashboardSaved.subscribe((savedDashboard: MJDashboardEntity) => {\n this.ResourceRecordSaved(savedDashboard);\n });\n\n // Wire up error events\n instance.error.subscribe((errorEvent: { message: string; error?: Error }) => {\n console.error('Dashboard error:', errorEvent.message, errorEvent.error);\n });\n\n // Set the dashboard entity directly on the viewer and wait for Golden Layout\n // to initialize against a real container before clearing the resource loader.\n instance.dashboard = dashboard;\n await instance.waitForLayoutReady();\n this.NotifyLoadComplete();\n this.cdr.detectChanges();\n\n } catch (error) {\n console.error('Error loading config-based dashboard:', error);\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded. There may be an issue with the dashboard configuration.`, error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Handle navigation requests from the dashboard viewer\n */\n private handleNavigationRequest(event: DashboardNavRequestEvent): void {\n const request = event.request;\n\n switch (request.type) {\n case 'OpenEntityRecord': {\n const entityRequest = request as { type: 'OpenEntityRecord'; entityName: string; recordId: string };\n // `recordId` is documented as URL-segment format (see OpenEntityRecordNavRequest in\n // @memberjunction/ng-dashboard-viewer). E.g. a single-PK record is `\"ID|11055\"`; a\n // composite-PK record is `\"Field1|Value1||Field2|Value2\"`. Senders in\n // dashboard-viewer (artifact-part, view-part) intentionally call\n // `compositeKey.ToURLSegment()` to produce this shape.\n //\n // Wrapping that string verbatim into `{ FieldName: 'ID', Value: <segment> }` makes\n // ToURLSegment serialize it a second time as `ID|<segment>` and produces a\n // malformed `Field|Field|Value` URL the host parser silently mis-reads (manifesting\n // downstream as `BaseEntity.Load(... Key: ID=ID)` and `Primary Key value is not a\n // valid number`). Parse the segment with `FromURLSegment` against the entity's PK\n // metadata instead, so single-PK and composite-PK both round-trip correctly (it also\n // owns the last-resort `ID` fallback for an entity name metadata can't resolve).\n const md = this.ProviderToUse;\n const pkey = CompositeKey.FromURLSegment(md.EntityByName(entityRequest.entityName), entityRequest.recordId);\n this.navigationService.OpenEntityRecord(entityRequest.entityName, pkey);\n break;\n }\n case 'OpenDashboard': {\n const dashRequest = request as { type: 'OpenDashboard'; dashboardId: string };\n // Load dashboard name from engine cache\n const targetDashboard = DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, dashRequest.dashboardId));\n const name = targetDashboard?.Name || 'Dashboard';\n this.navigationService.OpenDashboard(dashRequest.dashboardId, name);\n break;\n }\n case 'OpenQuery': {\n const queryRequest = request as { type: 'OpenQuery'; queryId: string };\n this.navigationService.OpenQuery(queryRequest.queryId, 'Query');\n break;\n }\n default:\n console.warn('Unhandled navigation request type:', request.type);\n }\n }\n\n /**\n * Get the display name for a dashboard resource\n * Loads the actual dashboard name from the database if available\n */\n override async GetResourceDisplayName(data: ResourceData): Promise<string> {\n try {\n // Try to load dashboard metadata if we have the record ID\n if (data.ResourceRecordID && data.ResourceRecordID.length > 0) {\n const md = this.ProviderToUse;\n const compositeKey = CompositeKey.FromID(data.ResourceRecordID); // first-pk-ok: ResourceRecordID of a Dashboards resource — core entity keyed by ID\n const name = await md.GetEntityRecordName('Dashboards', compositeKey);\n if (name) {\n return name;\n }\n }\n } catch (error) {\n // Silently fail and use fallback\n }\n\n // Fallback: use provided name or generic label\n return data.Name || 'Dashboard';\n }\n\n /**\n * Get the icon class for dashboard resources\n */\n async GetResourceIconClass(data: ResourceData): Promise<string> {\n return 'fa-solid fa-table-columns';\n }\n}\n"]}
1
+ {"version":3,"file":"dashboard-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/dash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AK,IAAI,IAAI,EAAE,CAAC;QACtD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC","sourcesContent":["import { Component, ViewContainerRef, ComponentRef, ViewChild, ElementRef, ChangeDetectorRef, inject } from '@angular/core';\nimport {\n BaseResourceComponent, NavigationService, BaseDashboard, DashboardConfig, RecentAccessService,\n HomeAppPinService, SafeDetectChanges, CaptureElementJpeg, BuildDashboardPinInput, DASHBOARD_PIN_RESOURCE_TYPE\n} from '@memberjunction/ng-shared';\nimport type { HomeAppPinInput } from '@memberjunction/ng-shared';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { RealtimeSessionService, ArtifactPermissionService } from '@memberjunction/ng-conversations';\nimport {\n ResourceData, MJDashboardEntity, DashboardEngine, MJDashboardUserStateEntity,\n DashboardUserPermissions, UserViewEngine, QueryEngine, ArtifactMetadataEngine, MJEnvironmentEntityExtended, UserInfoEngine\n} from '@memberjunction/core-entities';\nimport type { MJArtifactEntity, MJArtifactVersionEntity, MJConversationEntity } from '@memberjunction/core-entities';\nimport { RegisterClass, MJGlobal, SafeJSONParse , UUIDsEqual, EscapeSQLString, NormalizeUUID } from '@memberjunction/global';\nimport { CompositeKey, RunView, LogError } from '@memberjunction/core';\nimport type { IMetadataProvider, UserInfo } from '@memberjunction/core';\nimport { DefaultAgentResolver } from '@memberjunction/conversations-runtime';\nimport type { NavigationRequest } from '@memberjunction/ng-artifacts';\nimport type { PendingAttachment } from '@memberjunction/ng-composer';\nimport { filter, takeUntil } from 'rxjs';\nimport type { DataExplorerFilter } from '@memberjunction/ng-dashboards/data-explorer-dashboards.module';\nimport type { DashboardEditorComponent, DashboardEditorLoadError, ShareDialogResult } from '@memberjunction/ng-dashboards/core-dashboards.module';\nimport { ExtractPanelsFromLayout } from '@memberjunction/ng-dashboard-viewer';\nimport type { DashboardConfig as DashboardLayoutConfig, DashboardNavRequestEvent, DashboardViewerComponent } from '@memberjunction/ng-dashboard-viewer';\nimport { BuildDashboardTabAgentContext, BuildDashboardTabAgentTools, SummarizeDashboardPanels } from './dashboard-tab-agent';\nimport type { DashboardPanelSummary, DashboardTabAgentHost, DashboardTabDashboard } from './dashboard-tab-agent';\nimport { BuildDashboardStudioTools } from './dashboard-studio-tools';\nimport type { DashboardStudioHost } from './dashboard-studio-tools';\nimport { SearchDashboardSources, SOURCE_KINDS } from './dashboard-source-search';\nimport type { SourceKind, SourceSearchDeps, SourceSearchResult } from './dashboard-source-search';\nimport {\n ParseStudioPanePrefs, PrefsFromSplitSizes, STUDIO_PANE_COPILOT_MAX_PCT, STUDIO_PANE_COPILOT_MIN_PCT, STUDIO_PANE_DEFAULTS, STUDIO_PANE_SETTING_KEY\n} from './dashboard-studio-pane';\nimport type { StudioPanePrefs } from './dashboard-studio-pane';\n\n/** The permissions the tab reports while its editor shows no dashboard: nothing is allowed. */\nconst NO_DASHBOARD_PERMISSIONS: DashboardUserPermissions = {\n DashboardID: '', CanRead: false, CanEdit: false, CanDelete: false, CanShare: false, IsOwner: false, PermissionSource: 'none',\n};\n\n/** Why an agent's request or edit fails while the tab shows no Config dashboard. */\nconst NO_CONFIG_DASHBOARD = 'No Config dashboard is open in this tab.';\n\n/** How long, in milliseconds, an agent's confirm dialog waits for the user's answer before it closes. */\nconst AGENT_CONFIRM_TIMEOUT_MS = 25_000;\n\n/** Why an agent's request failed when the user gave no answer in time. */\nconst AGENT_CONFIRM_TIMED_OUT = `No answer within ${AGENT_CONFIRM_TIMEOUT_MS / 1000} s; the dialog was closed. Ask the user and try again.`;\n\n/** The most artifacts the agent's source search reads. */\nconst SOURCE_SEARCH_MAX_ARTIFACTS = 500;\n\n/** The most artifact IDs one filter of the latest-version lookup lists. */\nconst ARTIFACT_VERSION_FILTER_CHUNK = 200;\n\n/** Why the tab refuses an agent's edit while the editor's Save runs. */\nconst SAVE_IN_PROGRESS = 'A save is in progress. Try again when it finishes.';\n\n/** What an agent's Request* tool asks the user to confirm. */\ntype AgentConfirmKind = Parameters<DashboardStudioHost['Confirm']>[0];\n\n/** The name and description an agent asks a save to apply. */\ntype AgentConfirmDetail = Parameters<DashboardStudioHost['Confirm']>[1];\n\n/** The confirm dialog an agent's request opens: what it asks, and the texts it shows. */\ninterface AgentConfirmDialog {\n Kind: AgentConfirmKind;\n Title: string;\n Message: string;\n ConfirmText: string;\n}\n\n/** The request behind an open agent confirm dialog. It settles once: with the user's answer, or aborted. */\ninterface AgentConfirmRequest {\n answer(confirmed: boolean): void;\n abort(reason: Error): void;\n}\n\n/**\n * The Dashboards application (metadata/applications/.dashboards-application.json). The AI pane's\n * conversations belong to it, and its default agent answers in the pane.\n */\nconst DASHBOARDS_APPLICATION_ID = '4B439111-B492-4936-9E33-A428CB5725B4';\n\n/** What the AI pane shows when the Dashboards application has no default agent of its own. */\nconst NO_DASHBOARD_ASSISTANT = 'No dashboard assistant is configured for the Dashboards app. Ask an administrator to set its default agent.';\n\n/** What the chat area's ConversationCreated output gives: the new conversation and the first message to send in it. */\ninterface ChatConversationCreated {\n conversation: MJConversationEntity;\n pendingMessage?: string;\n pendingAttachments?: PendingAttachment[];\n}\n\n/** An artifact as the agent's source search reads it. */\ntype ArtifactRow = Pick<MJArtifactEntity, 'ID' | 'Name' | 'Description' | 'Type'>;\n\n/** An artifact version as the latest-version lookup reads it. */\ntype ArtifactVersionRow = Pick<MJArtifactVersionEntity, 'ArtifactID' | 'VersionNumber'>;\n\n/**\n * Dashboard Resource Wrapper - displays a single dashboard in a tab\n * Extends BaseResourceComponent to work with the resource type system\n * Dynamically routes between code-based and config-based dashboards based on dashboard type:\n * a Config dashboard shows in the shared dashboard editor (`mj-dashboard-editor`) with the AI pane\n * beside it, and a Code dashboard or the Data Explorer shows in the tab's own container.\n */\n@RegisterClass(BaseResourceComponent, 'DashboardResource')\n@Component({\n standalone: false,\n selector: 'mj-dashboard-resource',\n template: `\n <div class=\"dashboard-resource-wrapper\">\n <!-- Error State -->\n @if (errorMessage) {\n <div class=\"error-state\">\n <div class=\"error-icon\">\n <i class=\"fa-solid fa-triangle-exclamation\"></i>\n </div>\n <h2 class=\"error-title\">Unable to Load Dashboard</h2>\n <p class=\"error-message\">{{ errorMessage }}</p>\n @if (errorDetails) {\n <details class=\"error-details\">\n <summary>Technical Details</summary>\n <pre>{{ errorDetails }}</pre>\n </details>\n }\n </div>\n }\n\n <!-- A Config dashboard: the shared editor, with the AI pane on its right. The editor stays in the template while the pane opens and closes. -->\n @if (ConfigDashboardId && !errorMessage) {\n <as-split direction=\"horizontal\" class=\"studio-copilot-splitter\" unit=\"percent\" [gutterSize]=\"ChatOpen ? 6 : 0\" (dragEnd)=\"OnCopilotSplitDragEnd($event.sizes)\">\n <as-split-area [size]=\"ChatOpen ? (CopilotExpanded ? 100 - CopilotMaxPct : MainSizePct) : 100\" [minSize]=\"100 - CopilotMaxPct\">\n <mj-dashboard-editor\n #editor\n [Provider]=\"Provider\"\n [DashboardId]=\"ConfigDashboardId\"\n (Loaded)=\"OnEditorLoaded($event)\"\n (LoadFailed)=\"OnEditorLoadFailed($event)\"\n (EditingChange)=\"OnEditorEditingChange()\"\n (NameChanged)=\"OnEditorNameChanged($event)\"\n (ConfigChanged)=\"OnEditorConfigChanged()\"\n (ReloadedFromSaved)=\"OnEditorReloaded()\"\n (FavoriteChange)=\"OnEditorFavoriteChange()\"\n (NavigationRequested)=\"OnEditorNavigationRequested($event)\">\n <button\n headerTools\n type=\"button\"\n mjButton\n Variant=\"icon\"\n Size=\"sm\"\n class=\"dashboard-tab-ai-toggle\"\n [class.is-active]=\"ChatOpen\"\n title=\"AI assistant\"\n aria-label=\"AI assistant\"\n [attr.aria-expanded]=\"ChatOpen ? 'true' : 'false'\"\n (click)=\"ToggleChat()\">\n <i class=\"fa-solid fa-robot\" aria-hidden=\"true\"></i>\n </button>\n <span viewActions class=\"dashboard-tab-view-actions\">\n <mj-dashboard-add-to-menu\n [IsPinned]=\"IsPinnedToHome\"\n [CanShare]=\"CanShare\"\n (PinToHome)=\"PinToHome()\"\n (Share)=\"OpenShareDialog()\">\n </mj-dashboard-add-to-menu>\n @if (CanShare) {\n <button\n type=\"button\"\n mjButton\n Variant=\"icon\"\n Size=\"sm\"\n class=\"dashboard-tab-share\"\n title=\"Share dashboard\"\n aria-label=\"Share dashboard\"\n (click)=\"OpenShareDialog()\">\n <i class=\"fa-solid fa-share-nodes\" aria-hidden=\"true\"></i>\n </button>\n }\n </span>\n </mj-dashboard-editor>\n </as-split-area>\n @if (ChatOpen) {\n <as-split-area [size]=\"CopilotExpanded ? CopilotMaxPct : CopilotSizePct\" [minSize]=\"CopilotMinPct\" [maxSize]=\"CopilotMaxPct\">\n <aside class=\"dashboard-copilot\" [class.expanded]=\"CopilotExpanded\" data-testid=\"dashboard-copilot\" aria-label=\"AI assistant\">\n <div class=\"dashboard-copilot-head\">\n <div class=\"dashboard-copilot-title\"><i class=\"fa-solid fa-robot\"></i> {{ ChatAgentName ?? 'AI assistant' }}</div>\n <div class=\"dashboard-copilot-actions\">\n <button\n type=\"button\"\n class=\"dashboard-copilot-btn copilot-expand\"\n [title]=\"CopilotExpanded ? 'Collapse panel' : 'Expand panel'\"\n [attr.aria-label]=\"CopilotExpanded ? 'Collapse panel' : 'Expand panel'\"\n (click)=\"ToggleCopilotExpanded()\">\n <i class=\"fa-solid\" [class.fa-up-right-and-down-left-from-center]=\"!CopilotExpanded\" [class.fa-down-left-and-up-right-to-center]=\"CopilotExpanded\"></i>\n </button>\n <button type=\"button\" class=\"dashboard-copilot-btn copilot-close\" title=\"Close assistant\" aria-label=\"Close assistant\" (click)=\"CloseChat()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n </div>\n <div class=\"dashboard-copilot-body\">\n @if (ChatAgentId && ProviderToUse.CurrentUser) {\n <mj-conversation-chat-area\n [Provider]=\"Provider\" [EnvironmentId]=\"ChatEnvironmentId\" [CurrentUser]=\"ProviderToUse.CurrentUser\"\n [Conversation]=\"ChatConversation\" [ConversationId]=\"ChatConversationId\" [IsNewConversation]=\"ChatIsNewConversation\"\n [PendingMessage]=\"ChatPendingMessage\" [PendingAttachments]=\"ChatPendingAttachments\"\n [SuppressNewConversationEmptyState]=\"true\" [AllowMentions]=\"false\" [OverlayMode]=\"false\"\n [ShowExportButton]=\"false\" [ShowShareButton]=\"false\" [ShowArtifactIndicator]=\"false\"\n [ShowAgentPicker]=\"false\" [ShowAgentModePicker]=\"false\"\n [DefaultAgentId]=\"ChatAgentId\" [AllowedAgentIDs]=\"[ChatAgentId]\"\n ApplicationScope=\"Application\" [ApplicationId]=\"ChatApplicationId\" [AppContext]=\"ChatAppContext\"\n EmptyStateGreeting=\"What should this dashboard show?\"\n (ConversationCreated)=\"OnChatConversationCreated($event)\"\n (RealtimeConversationReady)=\"OnChatRealtimeConversationReady($event)\"\n (PendingMessageConsumed)=\"OnChatPendingMessageConsumed()\"\n (navigationRequest)=\"OnChatNavigationRequest($event)\"\n (OpenEntityRecord)=\"OnChatOpenEntityRecord($event)\">\n </mj-conversation-chat-area>\n } @else if (ChatAgentError) {\n <div class=\"dashboard-copilot-empty\" role=\"status\">{{ ChatAgentError }}</div>\n } @else {\n <div class=\"dashboard-copilot-empty\"><mj-loading Text=\"Connecting…\" Size=\"small\"></mj-loading></div>\n }\n </div>\n </aside>\n </as-split-area>\n }\n </as-split>\n }\n\n <!-- Code dashboards and the Data Explorer render here. It stays in the template, so the tab finds it when it starts. -->\n <div #container class=\"dashboard-resource-container\" [class.is-hidden]=\"!!ConfigDashboardId\"></div>\n\n <!-- Share Dashboard Dialog -->\n @if (ConfigDashboard) {\n <mj-dashboard-share-dialog\n [Visible]=\"ShowShareDialog\"\n [Dashboard]=\"ConfigDashboard\"\n (Result)=\"OnShareDialogResult($event)\">\n </mj-dashboard-share-dialog>\n }\n\n <!-- Confirmation for an agent's Request* tool: the user, not the agent, saves or pins -->\n @if (AgentConfirm) {\n <mj-confirm-dialog\n class=\"agent-confirm\"\n [Visible]=\"true\"\n Type=\"info\"\n [Title]=\"AgentConfirm.Title\"\n [Message]=\"AgentConfirm.Message\"\n [ConfirmText]=\"AgentConfirm.ConfirmText\"\n CancelText=\"Not now\"\n (Confirmed)=\"OnAgentConfirm(true)\"\n (Cancelled)=\"OnAgentConfirm(false)\">\n </mj-confirm-dialog>\n }\n\n <!-- Closing the AI pane ends a voice session, so the user confirms it first -->\n @if (ShowCloseChatConfirm) {\n <mj-confirm-dialog\n class=\"close-chat-confirm\"\n [Visible]=\"true\"\n Type=\"warning\"\n Title=\"End the voice session?\"\n Message=\"Closing the AI assistant ends the voice session.\"\n ConfirmText=\"Close\"\n CancelText=\"Keep open\"\n (Confirmed)=\"OnCloseChatConfirmed()\"\n (Cancelled)=\"OnCloseChatCancelled()\">\n </mj-confirm-dialog>\n }\n </div>\n `,\n styles: [`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .dashboard-resource-wrapper {\n display: flex;\n flex-direction: column;\n height: 100%;\n width: 100%;\n }\n /* The editor and the AI pane share the tab. The global MJ splitter theme styles the gutter. */\n .studio-copilot-splitter {\n flex: 1;\n width: 100%;\n height: 100%;\n min-height: 0;\n min-width: 0;\n }\n /* Holds a Code dashboard or the Data Explorer. Hidden while the editor shows a Config dashboard. */\n .dashboard-resource-container {\n width: 100%;\n height: 100%;\n overflow: hidden;\n }\n .dashboard-resource-container.is-hidden { display: none; }\n\n /* The view actions sit in the editor's header row as if they were its own buttons */\n .dashboard-tab-view-actions { display: contents; }\n /* The colour goes on the icon, never on the button: button.scss owns the button */\n .dashboard-tab-ai-toggle.is-active i { color: var(--mj-brand-primary); }\n\n /* AI pane */\n .dashboard-copilot {\n width: 100%;\n height: 100%;\n border-left: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n display: flex;\n flex-direction: column;\n min-height: 0;\n }\n .dashboard-copilot-head {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 10px 14px;\n border-bottom: 1px solid var(--mj-border-default);\n }\n .dashboard-copilot-title {\n display: flex;\n align-items: center;\n gap: 8px;\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n .dashboard-copilot-title i { color: var(--mj-brand-primary); }\n .dashboard-copilot-actions {\n display: flex;\n align-items: center;\n gap: 4px;\n }\n .dashboard-copilot-btn {\n background: transparent;\n border: none;\n cursor: pointer;\n padding: 6px 8px;\n border-radius: 6px;\n color: var(--mj-text-muted);\n }\n .dashboard-copilot-btn:hover {\n background: var(--mj-bg-surface-hover);\n color: var(--mj-text-secondary);\n }\n .dashboard-copilot-body {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n }\n .dashboard-copilot-body mj-conversation-chat-area {\n flex: 1;\n min-height: 0;\n display: block;\n }\n .dashboard-copilot-empty {\n display: flex;\n align-items: center;\n justify-content: center;\n flex: 1;\n padding: 16px;\n color: var(--mj-text-secondary);\n text-align: center;\n }\n\n /* Error state */\n .error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n padding: 40px;\n text-align: center;\n color: var(--mj-text-secondary);\n }\n .error-icon {\n font-size: 64px;\n color: var(--mj-status-error);\n margin-bottom: 24px;\n opacity: 0.8;\n }\n .error-title {\n font-size: 24px;\n font-weight: 500;\n margin: 0 0 12px 0;\n color: var(--mj-text-primary);\n }\n .error-message {\n font-size: 16px;\n color: var(--mj-text-muted);\n margin: 0 0 24px 0;\n max-width: 500px;\n line-height: 1.5;\n }\n .error-details {\n background: var(--mj-bg-surface-sunken);\n border-radius: 8px;\n padding: 12px 16px;\n max-width: 600px;\n text-align: left;\n font-size: 13px;\n }\n .error-details summary {\n cursor: pointer;\n font-weight: 500;\n color: var(--mj-text-muted);\n margin-bottom: 8px;\n }\n .error-details pre {\n margin: 0;\n white-space: pre-wrap;\n word-break: break-word;\n color: var(--mj-status-error-text);\n font-family: 'Consolas', 'Monaco', monospace;\n font-size: 12px;\n }\n `]\n})\nexport class DashboardResource extends BaseResourceComponent {\n private componentRef: ComponentRef<unknown> | null = null;\n private recentAccess = inject(RecentAccessService);\n private homePins = inject(HomeAppPinService);\n private realtimeSession = inject(RealtimeSessionService);\n private artifactPermissions = inject(ArtifactPermissionService);\n\n /** The editor that shows the Config dashboard. Undefined while the tab shows none. */\n @ViewChild('editor') private editor?: DashboardEditorComponent;\n\n /** The panels last reported to the agent, as JSON. Null until the open dashboard is first reported. */\n private reportedPanelsKey: string | null = null;\n\n /**\n * True once the tab registered the agent tools for the dashboard the editor loaded. Until then the\n * tab reports no context, so the first report comes with the tools.\n */\n private agentStatePublished = false;\n\n /** True once the tab follows edit-mode requests (see watchEditModeRequests). */\n private watchingEditModeRequests = false;\n\n /**\n * A cache reattach moves this wrapper to another tab without recreating the dashboard inside it.\n * A child resource component (a Code dashboard, the Data Explorer) has its own tab stamp, taken\n * when we created it, and it has to move too. Without this the dashboard keeps reading and\n * writing the params of the tab it was born in, from inside a tab it no longer belongs to. The\n * editor has no tab of its own. The new tab can hold an edit-mode request (a card's Edit\n * action reopens a closed tab this way), so the tab takes it here, where no load will.\n */\n protected override onTabIdRebound(tabId: string): void {\n const child = this.componentRef?.instance;\n if (child instanceof BaseResourceComponent) {\n this.rehomeChildToTab(child, tabId);\n }\n this.takeEditModeRequest(tabId);\n }\n private dataLoaded = false;\n /** The element that holds a Code dashboard or the Data Explorer. */\n @ViewChild('container', { static: true }) ContainerElement!: ElementRef<HTMLDivElement>;\n\n /** @deprecated Use {@link ContainerElement}. */\n get containerElement(): ElementRef<HTMLDivElement> {\n return this.ContainerElement;\n }\n /** @deprecated Use {@link ContainerElement}. */\n set containerElement(value: ElementRef<HTMLDivElement>) {\n this.ContainerElement = value;\n }\n\n /** Error message to display when dashboard fails to load */\n public errorMessage: string | null = null;\n /** Technical error details (shown in expandable section) */\n public ErrorDetails: string | null = null;\n\n /** @deprecated Use {@link ErrorDetails}. */\n public get errorDetails(): string | null {\n return this.ErrorDetails;\n }\n /** @deprecated Use {@link ErrorDetails}. */\n public set errorDetails(value: string | null) {\n this.ErrorDetails = value;\n }\n\n /** The Config dashboard the editor shows. Null for a Code dashboard, the Data Explorer, or none. */\n public ConfigDashboardId: string | null = null;\n\n /** The Config dashboard the editor shows, or null (a Code dashboard, the Data Explorer, or none). */\n public get ConfigDashboard(): MJDashboardEntity | null {\n return this.editor?.Dashboard ?? null;\n }\n\n /** @deprecated Use {@link ConfigDashboard}. */\n public get configDashboard(): MJDashboardEntity | null {\n return this.ConfigDashboard;\n }\n\n /** True while the editor is in edit mode. */\n public get IsEditMode(): boolean {\n return this.editor?.IsEditing ?? false;\n }\n\n /** @deprecated Use {@link IsEditMode}. */\n public get isEditMode(): boolean {\n return this.IsEditMode;\n }\n\n /** True when the user may share the dashboard the editor shows. */\n public get CanShare(): boolean {\n return this.editor?.Permissions.CanShare ?? false;\n }\n\n /** The confirm dialog an agent's Request* tool opened, or null. The user, not the agent, saves or pins. */\n public AgentConfirm: AgentConfirmDialog | null = null;\n\n /** The request behind the open agent confirm dialog. Null while none is open. */\n private agentConfirmRequest: AgentConfirmRequest | null = null;\n\n // ── AI pane ──────────────────────────────────────────────────────\n\n /** True while the AI pane shows beside the dashboard. */\n public ChatOpen = false;\n\n /** True while the AI pane takes its largest width (CopilotMaxPct). */\n public CopilotExpanded = false;\n\n /** The dashboard's width while the AI pane is open, in percent of the tab's width. */\n public MainSizePct: number = STUDIO_PANE_DEFAULTS.MainSizePct;\n\n /** The AI pane's width, in percent of the tab's width. */\n public CopilotSizePct: number = STUDIO_PANE_DEFAULTS.CopilotSizePct;\n\n /** The smallest width of the AI pane, in percent of the tab's width. */\n public readonly CopilotMinPct = STUDIO_PANE_COPILOT_MIN_PCT;\n\n /** The largest width of the AI pane, in percent of the tab's width. */\n public readonly CopilotMaxPct = STUDIO_PANE_COPILOT_MAX_PCT;\n\n /** True while the dialog that asks before a voice session ends with the AI pane is open. */\n public ShowCloseChatConfirm = false;\n\n /** The agent the AI pane talks to: the Dashboards application's default agent. Null until it resolves. */\n public ChatAgentId: string | null = null;\n\n /** The name of that agent, which the AI pane shows in its header. */\n public ChatAgentName: string | null = null;\n\n /** Why the AI pane has no agent, or null. The pane then shows this instead of the chat. */\n public ChatAgentError: string | null = null;\n\n /** The AI pane's conversation, from the moment its first message created it. */\n public ChatConversation: MJConversationEntity | null = null;\n\n /** The ID of the AI pane's conversation. */\n public ChatConversationId: string | null = null;\n\n /** True until the first message creates the AI pane's conversation. */\n public ChatIsNewConversation = true;\n\n /** The first message, which the chat area sends once it has created the conversation. Null after it is sent. */\n public ChatPendingMessage: string | null = null;\n\n /** The files attached to the first message, sent with it. */\n public ChatPendingAttachments: PendingAttachment[] | null = null;\n\n /** The shell's app context snapshot, as the chat area's AppContext input takes it. The agent reads it. */\n public ChatAppContext: Record<string, unknown> | null = null;\n\n /** The application the AI pane's conversations belong to, and whose default agent answers in it. */\n public readonly ChatApplicationId = DASHBOARDS_APPLICATION_ID;\n\n /** True while the AI pane resolves its agent. */\n private resolvingChatAgent = false;\n\n /** The environment of the AI pane's conversations and of the artifacts the agent searches: the tab's, else the default. */\n public get ChatEnvironmentId(): string {\n const environmentId = this.Data?.Configuration?.['environmentId'];\n return typeof environmentId === 'string' && environmentId ? environmentId : MJEnvironmentEntityExtended.DefaultEnvironmentID;\n }\n\n // ── Members the editor owns ──────────────────────────────────────\n\n /** @deprecated Use {@link DashboardEditorComponent.EditingName}. */\n public get EditingName(): string { return this.editor?.EditingName ?? ''; }\n /** @deprecated Use {@link DashboardEditorComponent.EditingName}. */\n public set EditingName(value: string) { if (this.editor) this.editor.EditingName = value; }\n\n /** @deprecated Use {@link DashboardEditorComponent.EditingName}. */\n public get editingName(): string { return this.EditingName; }\n /** @deprecated Use {@link DashboardEditorComponent.EditingName}. */\n public set editingName(value: string) { this.EditingName = value; }\n\n /** @deprecated Use {@link DashboardEditorComponent.EditingDescription}. */\n public get EditingDescription(): string { return this.editor?.EditingDescription ?? ''; }\n /** @deprecated Use {@link DashboardEditorComponent.EditingDescription}. */\n public set EditingDescription(value: string) { if (this.editor) this.editor.EditingDescription = value; }\n\n /** @deprecated Use {@link DashboardEditorComponent.EditingDescription}. */\n public get editingDescription(): string { return this.EditingDescription; }\n /** @deprecated Use {@link DashboardEditorComponent.EditingDescription}. */\n public set editingDescription(value: string) { this.EditingDescription = value; }\n\n /** @deprecated Use {@link DashboardEditorComponent.Permissions}. */\n public get DashboardPermissions(): DashboardUserPermissions { return this.editor?.Permissions ?? NO_DASHBOARD_PERMISSIONS; }\n\n /** @deprecated Use {@link DashboardEditorComponent.Permissions}. */\n public get dashboardPermissions(): DashboardUserPermissions { return this.DashboardPermissions; }\n\n /** @deprecated Use {@link DashboardEditorComponent.ToggleEditMode}. */\n public ToggleEditMode(): void { this.editor?.ToggleEditMode(); }\n\n /** @deprecated Use {@link DashboardEditorComponent.ToggleEditMode}. */\n public toggleEditMode(): void { this.ToggleEditMode(); }\n\n /** @deprecated Use {@link DashboardEditorComponent.CancelEdit}. */\n public CancelEdit(): void { this.editor?.CancelEdit(); }\n\n /** @deprecated Use {@link DashboardEditorComponent.CancelEdit}. */\n public cancelEdit(): void { this.CancelEdit(); }\n\n /** @deprecated Use {@link DashboardEditorComponent.SaveDashboard}. */\n public SaveDashboard(): Promise<void> { return this.editor?.SaveDashboard() ?? Promise.resolve(); }\n\n /** @deprecated Use {@link DashboardEditorComponent.SaveDashboard}. */\n public saveDashboard(): Promise<void> { return this.SaveDashboard(); }\n\n /** @deprecated Use {@link DashboardEditorComponent.OpenAddPartDialog}. */\n public OpenAddPartDialog(): void { this.editor?.OpenAddPartDialog(); }\n\n /** @deprecated Use {@link DashboardEditorComponent.OpenAddPartDialog}. */\n public openAddPartDialog(): void { this.OpenAddPartDialog(); }\n\n // ── Share and pin ────────────────────────────────────────────────\n\n /** Whether the share dialog is visible */\n public ShowShareDialog = false;\n\n /** @deprecated Use {@link ShowShareDialog}. */\n public get showShareDialog() {\n return this.ShowShareDialog;\n }\n /** @deprecated Use {@link ShowShareDialog}. */\n public set showShareDialog(value) {\n this.ShowShareDialog = value;\n }\n\n /** True when the open Config dashboard is pinned to Home. */\n public get IsPinnedToHome(): boolean {\n return this.readPlacement(this.ConfigDashboard?.ID, id => this.homePins.IsPinned(DASHBOARD_PIN_RESOURCE_TYPE, { dashboardId: id }));\n }\n\n /**\n * Sets the error state with a user-friendly message and optional technical details\n */\n private setError(message: string, error?: unknown): void {\n this.errorMessage = message;\n if (error instanceof Error) {\n this.ErrorDetails = error.message;\n if (error.stack) {\n this.ErrorDetails += '\\n\\nStack trace:\\n' + error.stack;\n }\n } else if (error) {\n this.ErrorDetails = String(error);\n }\n }\n\n /**\n * Clears any previous error state\n */\n private clearError(): void {\n this.errorMessage = null;\n this.ErrorDetails = null;\n }\n\n constructor(\n private viewContainer: ViewContainerRef,\n private cdr: ChangeDetectorRef\n ) {\n super();\n }\n\n override set Data(value: ResourceData) {\n const previousRecordId = super.Data?.ResourceRecordID;\n super.Data = value;\n\n const newRecordId = value?.ResourceRecordID;\n\n // Load on first set, or when the dashboard has changed\n if (!this.dataLoaded || newRecordId !== previousRecordId) {\n this.dataLoaded = true;\n // Destroy previous component before loading new one\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n this.clearError();\n this.abortAgentConfirm('The tab opened another dashboard before the user answered.');\n this.ConfigDashboardId = null;\n this.agentStatePublished = false;\n this.loadDashboard();\n }\n }\n\n // Need to override the getter too in TS otherwise the override to the setter alone above would break things\n override get Data(): ResourceData {\n return super.Data;\n }\n\n override ngOnInit(): void {\n super.ngOnInit();\n this.watchAppContext();\n }\n\n ngOnDestroy(): void {\n this.abortAgentConfirm('The dashboard tab was closed before the user answered.');\n super.ngOnDestroy();\n if (this.componentRef) {\n this.componentRef.destroy();\n }\n }\n\n // ========================================\n // The Editor\n // ========================================\n\n /**\n * Shows a Config dashboard in the editor, which reads it from DashboardEngine. The editor's Loaded\n * or LoadFailed event finishes the load (OnEditorLoaded, OnEditorLoadFailed).\n */\n private showConfigDashboard(dashboard: MJDashboardEntity): void {\n this.ContainerElement.nativeElement.innerHTML = '';\n this.reportedPanelsKey = null;\n this.ConfigDashboardId = dashboard.ID;\n void this.loadHomePins();\n this.watchEditModeRequests();\n SafeDetectChanges(this.cdr);\n }\n\n /**\n * The editor shows the dashboard and its layout is ready. The loading screen goes, the tab takes an\n * edit-mode request (a new dashboard, or a card's Edit action) when it has one, and the agent gets\n * its tools and the dashboard. NavigationService removes the request when the tab takes it, so a\n * later load of the tab opens for viewing.\n */\n public OnEditorLoaded(dashboard: MJDashboardEntity): void {\n this.NotifyLoadComplete();\n if (this.navigationService.TakeDashboardEditModeRequest(this.getTabId(), dashboard.ID, this.tabApplicationId())) {\n this.editor?.EnterEditMode();\n }\n SafeDetectChanges(this.cdr);\n this.publishAgentState();\n }\n\n /** The editor could not show the dashboard: the tab shows why, and the loading screen goes. */\n public OnEditorLoadFailed(error: DashboardEditorLoadError): void {\n const name = this.cachedDashboardName(error.DashboardId);\n const subject = name ? `The dashboard \"${name}\"` : 'The dashboard';\n this.setError(`${subject} could not be loaded. There may be an issue with the dashboard configuration.`, error.Message);\n this.NotifyLoadComplete();\n SafeDetectChanges(this.cdr);\n }\n\n /**\n * The dashboard's saved name changed, by a save here or elsewhere. The tab takes the name as its\n * title and keeps its dashboard ID: ResourceRecordSaved would rewrite the record ID in a form the\n * tab configuration does not have, and the tab would reload on each Save.\n */\n public OnEditorNameChanged(name: string): void {\n if (name) {\n this.NotifyDisplayNameChanged(name);\n }\n }\n\n /** The editor entered or left edit mode: the tab reports it to the agent. */\n public OnEditorEditingChange(): void {\n this.emitAgentContext();\n }\n\n /** The editor's parts or layout changed: the tab reports the panels to the agent when they changed. */\n public OnEditorConfigChanged(): void {\n this.onViewerConfigChanged();\n }\n\n /** The editor rebuilt the saved layout after a save elsewhere: the rebuild reports nothing to the agent. */\n public OnEditorReloaded(): void {\n this.treatPanelsAsReported();\n }\n\n /** The user starred or unstarred the dashboard in the editor. */\n public OnEditorFavoriteChange(): void {\n this.onPlacementChanged();\n }\n\n /** A part of the dashboard asked to open something: a record, another dashboard, a query. */\n public OnEditorNavigationRequested(event: DashboardNavRequestEvent): void {\n this.handleNavigationRequest(event);\n }\n\n /**\n * Takes the tab's edit-mode request, if it has one for this tab's dashboard, and enters edit mode in\n * the editor. A tab that has not finished loading leaves the request for its load (see\n * OnEditorLoaded). A tab that is already editing keeps its changes. A request for what the tab shows\n * now stays for that tab's component: a cached component can still be bound to a tab ID that OpenTab\n * gave to another dashboard, or to this dashboard in another application.\n */\n private takeEditModeRequest(tabId: string): void {\n const editor = this.editor;\n const dashboard = editor?.Dashboard;\n if (!this.LoadComplete || !editor || !dashboard || !UUIDsEqual(dashboard.ID, this.ConfigDashboardId)) return;\n if (this.navigationService.TakeDashboardEditModeRequest(tabId, dashboard.ID, this.tabApplicationId()) && !editor.IsEditing) {\n editor.EnterEditMode();\n }\n }\n\n /** The application of the tab this component was loaded for, from the resource data the tab container gives it. */\n private tabApplicationId(): string {\n const applicationId = this.Data?.Configuration?.['applicationId'];\n return typeof applicationId === 'string' ? applicationId : '';\n }\n\n /**\n * Enters edit mode when OpenDashboard asks this open tab to (NavigationService.DashboardEditModeRequested$).\n * Starts once per tab, and stops when the tab is destroyed.\n */\n private watchEditModeRequests(): void {\n if (this.watchingEditModeRequests) return;\n this.watchingEditModeRequests = true;\n this.navigationService.DashboardEditModeRequested$.pipe(\n filter(tabId => UUIDsEqual(tabId, this.getTabId())),\n takeUntil(this.destroy$)\n ).subscribe(tabId => this.takeEditModeRequest(tabId));\n }\n\n /**\n * Takes the viewer's current panels as the ones last reported to the agent, so the change events\n * of a reloaded layout report nothing. Does nothing before the first report.\n */\n private treatPanelsAsReported(): void {\n if (this.reportedPanelsKey !== null) {\n this.reportedPanelsKey = JSON.stringify(this.livePanels());\n }\n }\n\n /**\n * Open the share dialog for this dashboard\n */\n public OpenShareDialog(): void {\n this.ShowShareDialog = true;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OpenShareDialog}. */\n public openShareDialog(): void {\n return this.OpenShareDialog();\n }\n\n /**\n * Close the share dialog\n */\n public CloseShareDialog(): void {\n this.ShowShareDialog = false;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link CloseShareDialog}. */\n public closeShareDialog(): void {\n return this.CloseShareDialog();\n }\n\n /**\n * Handle share dialog result. After a save the editor reads the user's permissions again, since\n * sharing can change them.\n */\n public OnShareDialogResult(result: ShareDialogResult): void {\n this.ShowShareDialog = false;\n\n if (result.Action === 'save') {\n this.editor?.RefreshPermissions();\n }\n\n this.cdr.detectChanges();\n if (result.Action === 'save') {\n this.emitAgentContext();\n }\n }\n\n // ========================================\n // Add to menu\n // ========================================\n\n /** Pins the open dashboard to Home as a card, then adds a thumbnail of it in the background. */\n public async PinToHome(): Promise<void> {\n const dashboard = this.ConfigDashboard;\n if (!dashboard) return;\n try {\n await this.homePins.LoadPins();\n if (this.homePins.AddPin(this.homePinFor(dashboard))) {\n MJNotificationService.Instance.CreateSimpleNotification(`Pinned \"${dashboard.Name}\" to Home`, 'success', 2000);\n void this.attachPinThumbnail(dashboard.ID);\n } else {\n MJNotificationService.Instance.CreateSimpleNotification(`\"${dashboard.Name}\" is already pinned to Home`, 'info', 2000);\n }\n } catch (error) {\n LogError(`Dashboard tab: could not pin the dashboard to Home: ${errorMessage(error)}`);\n MJNotificationService.Instance.CreateSimpleNotification('Could not pin the dashboard to Home', 'error', 3000);\n }\n this.onPlacementChanged();\n }\n\n /**\n * Reads one placement flag (the pin) for a dashboard. False without a dashboard,\n * or when the user cannot read that data (the engine throws PermissionConstrainedError).\n */\n private readPlacement(dashboardId: string | undefined, read: (dashboardId: string) => boolean): boolean {\n if (!dashboardId) return false;\n try {\n return read(dashboardId);\n } catch {\n return false;\n }\n }\n\n /** The Home pin for a dashboard, in the shared dashboard pin shape. */\n private homePinFor(dashboard: MJDashboardEntity): HomeAppPinInput {\n return BuildDashboardPinInput(dashboard);\n }\n\n /**\n * Adds a thumbnail of the dashboard (the editor's body) to its pin. Best effort: without one, Home\n * shows the pin's icon. Logs a failure and never rejects, because the caller does not wait for it.\n */\n private async attachPinThumbnail(dashboardId: string): Promise<void> {\n try {\n const element = this.editor?.BodyElement;\n const thumbnail = element ? await this.homePins.CaptureThumbnail(element) : undefined;\n const pin = thumbnail ? this.homePins.FindPin(DASHBOARD_PIN_RESOURCE_TYPE, { dashboardId }) : undefined;\n if (pin && thumbnail) {\n this.homePins.UpdatePin(pin.Id, { Thumbnail: thumbnail });\n }\n } catch (error) {\n LogError(`Dashboard tab: could not add a thumbnail to the Home pin: ${errorMessage(error)}`);\n }\n }\n\n /** Loads the user's Home pins, so the Add to menu can show whether this dashboard is pinned. */\n private async loadHomePins(): Promise<void> {\n try {\n await this.homePins.LoadPins();\n } catch (error) {\n LogError(`Dashboard tab: could not load the Home pins: ${errorMessage(error)}`);\n }\n }\n\n /** Updates the header buttons and reports the new placement to the agent. */\n private onPlacementChanged(): void {\n SafeDetectChanges(this.cdr);\n this.emitAgentContext();\n }\n\n // ========================================\n // AI Pane\n // ========================================\n\n /** Opens the AI pane with the widths the user saved, or closes it as CloseChat does. */\n public ToggleChat(): void {\n if (this.ChatOpen) {\n this.CloseChat();\n return;\n }\n this.applyPanePrefs(this.savedPanePrefs());\n this.ChatOpen = true;\n void this.ensureChatAgentResolved();\n SafeDetectChanges(this.cdr);\n }\n\n /**\n * Closes the AI pane. Its conversation stays, so the pane shows it again when it opens. Closing the pane\n * ends a voice session, so while one runs the user confirms first (OnCloseChatConfirmed).\n */\n public CloseChat(): void {\n if (this.realtimeSession.IsActive) {\n this.ShowCloseChatConfirm = true;\n } else {\n this.closeChatPane();\n }\n SafeDetectChanges(this.cdr);\n }\n\n /** The user confirmed: the AI pane closes, and the voice session ends with it. */\n public OnCloseChatConfirmed(): void {\n this.ShowCloseChatConfirm = false;\n this.closeChatPane();\n SafeDetectChanges(this.cdr);\n }\n\n /** The user keeps the AI pane open, and the voice session with it. */\n public OnCloseChatCancelled(): void {\n this.ShowCloseChatConfirm = false;\n SafeDetectChanges(this.cdr);\n }\n\n /** Gives the AI pane its largest width, or its own width again. */\n public ToggleCopilotExpanded(): void {\n this.CopilotExpanded = !this.CopilotExpanded;\n SafeDetectChanges(this.cdr);\n }\n\n /**\n * Keeps the widths the user dragged the split to, in this tab and in the user's settings. The AI pane then\n * has that width, not its largest one. Sizes that are not two numbers change nothing.\n */\n public OnCopilotSplitDragEnd(sizes: readonly (number | '*')[]): void {\n const prefs = PrefsFromSplitSizes(sizes);\n if (!prefs) return;\n this.applyPanePrefs(prefs);\n this.CopilotExpanded = false;\n UserInfoEngine.Instance.SetSettingDebounced(STUDIO_PANE_SETTING_KEY, JSON.stringify(prefs));\n SafeDetectChanges(this.cdr);\n }\n\n /**\n * The chat area created the AI pane's conversation for the first message. The pane keeps the conversation\n * and gives the message back to the chat area, which then sends it in that conversation.\n */\n public OnChatConversationCreated(event: ChatConversationCreated): void {\n this.ChatConversation = event.conversation;\n this.ChatConversationId = event.conversation.ID;\n this.ChatIsNewConversation = false;\n this.ChatPendingMessage = event.pendingMessage ?? null;\n this.ChatPendingAttachments = event.pendingAttachments ?? null;\n SafeDetectChanges(this.cdr);\n }\n\n /**\n * A voice call started before any message, so the server created the AI pane's conversation. When the\n * call ends, the pane adopts that conversation, so the chat area shows the call's transcript and the\n * next message goes to it. The start of the call reports the same conversation without `select`; the\n * pane leaves the chat area alone until the call ends, as the Conversations app does.\n */\n public async OnChatRealtimeConversationReady(event: { conversationId: string; select: boolean }): Promise<void> {\n if (!event.select || !event.conversationId || this.ChatConversationId) return;\n const conversation = await this.loadChatConversation(event.conversationId);\n if (!conversation || this.ChatConversationId) return;\n this.ChatConversation = conversation;\n this.ChatConversationId = conversation.ID;\n this.ChatIsNewConversation = false;\n SafeDetectChanges(this.cdr);\n }\n\n /** The conversation with `conversationId` that the user can read, or null. */\n private async loadChatConversation(conversationId: string): Promise<MJConversationEntity | null> {\n const result = await RunView.FromMetadataProvider(this.ProviderToUse).RunView<MJConversationEntity>({\n EntityName: 'MJ: Conversations',\n ExtraFilter: `ID='${EscapeSQLString(conversationId)}'`,\n ResultType: 'entity_object',\n });\n if (!result.Success) {\n LogError(`DashboardResource: the AI pane could not load conversation ${conversationId}: ${result.ErrorMessage}`);\n return null;\n }\n return result.Results?.[0] ?? null;\n }\n\n /** The chat area sent the first message. The pane drops it, so the chat area does not send it again. */\n public OnChatPendingMessageConsumed(): void {\n this.ChatPendingMessage = null;\n this.ChatPendingAttachments = null;\n SafeDetectChanges(this.cdr);\n }\n\n /** Opens the app page that an artifact in the chat asks for. An app the metadata does not name opens the page in the current app. */\n public OnChatNavigationRequest(request: NavigationRequest): void {\n const appId = request.appName ? this.applicationIdByName(request.appName) : undefined;\n void this.navigationService.OpenNavItemByName(request.navItemName, undefined, appId, { queryParams: request.queryParams })\n .catch((error: unknown) => LogError(`Dashboard tab: could not open ${request.navItemName}: ${errorMessage(error)}`));\n }\n\n /** Opens a record that the chat links to. */\n public OnChatOpenEntityRecord(event: { entityName: string; compositeKey: CompositeKey }): void {\n this.navigationService.OpenEntityRecord(event.entityName, event.compositeKey);\n }\n\n /** Keeps the shell's latest app context snapshot for the chat, until the tab is destroyed. Renders only while the pane is open. */\n private watchAppContext(): void {\n this.navigationService.AppContextSnapshot$.pipe(takeUntil(this.destroy$)).subscribe(snapshot => {\n this.ChatAppContext = snapshot ? { ...snapshot } : null;\n if (this.ChatOpen) {\n SafeDetectChanges(this.cdr);\n }\n });\n }\n\n /** The AI pane widths in the user's settings, or the defaults when the settings cannot be read. */\n private savedPanePrefs(): StudioPanePrefs {\n try {\n return ParseStudioPanePrefs(UserInfoEngine.Instance.GetSetting(STUDIO_PANE_SETTING_KEY));\n } catch {\n return ParseStudioPanePrefs(null); // the user cannot read their settings\n }\n }\n\n private applyPanePrefs(prefs: StudioPanePrefs): void {\n this.MainSizePct = prefs.MainSizePct;\n this.CopilotSizePct = prefs.CopilotSizePct;\n }\n\n private closeChatPane(): void {\n this.ChatOpen = false;\n this.CopilotExpanded = false;\n }\n\n /** The ID of the application with this name, in any case, or undefined when the metadata has none. */\n private applicationIdByName(appName: string): string | undefined {\n const name = appName.trim().toLowerCase();\n return this.ProviderToUse.Applications.find(app => app.Name.trim().toLowerCase() === name)?.ID;\n }\n\n /**\n * Resolves the agent the AI pane talks to: the Dashboards application's default agent\n * (Application.AgentSettings.DefaultAgentID). When the resolver falls back to Sage, the application has no\n * agent of its own, and the pane says so instead of showing a chat. After a failure the next open tries again.\n */\n private async ensureChatAgentResolved(): Promise<void> {\n if (this.ChatAgentId || this.resolvingChatAgent) return;\n this.resolvingChatAgent = true;\n this.ChatAgentError = null;\n try {\n const provider = this.ProviderToUse;\n const agent = await new DefaultAgentResolver().Resolve({ applicationId: this.ChatApplicationId, contextUser: provider.CurrentUser, provider });\n if (agent.Name === DefaultAgentResolver.FALLBACK_AGENT_NAME) {\n this.ChatAgentError = NO_DASHBOARD_ASSISTANT;\n } else {\n this.ChatAgentId = agent.ID;\n this.ChatAgentName = agent.Name;\n }\n } catch (error) {\n LogError(`Dashboard tab: could not resolve the dashboard assistant: ${errorMessage(error)}`);\n this.ChatAgentError = `The dashboard assistant could not be loaded: ${errorMessage(error)}`;\n } finally {\n this.resolvingChatAgent = false;\n }\n SafeDetectChanges(this.cdr);\n }\n\n // ========================================\n // Agent Context & Client Tools\n //\n // 🔒 BOUNDARY: the tab's agent tools change the open dashboard in memory only. Save, Share,\n // Favorite and Pin stay user actions; the Request* tools in dashboard-studio-tools.ts ask\n // for them through a confirm dialog and never perform them.\n // A Code dashboard is its own resource component and reports its own context and tools, so\n // this tab reports nothing for it.\n // ========================================\n\n /**\n * Registers the tab's tools and reports the open Config dashboard to the agent. The studio tools\n * of one registration share an edit queue, so the tab registers them once for each dashboard load.\n */\n private publishAgentState(): void {\n this.navigationService.SetAgentClientTools(this, [\n ...BuildDashboardTabAgentTools(this.agentHost()),\n ...BuildDashboardStudioTools(this.studioHost()),\n ]);\n this.agentStatePublished = true;\n this.emitAgentContext();\n }\n\n /**\n * Reports the Config dashboard the editor shows to the agent. Does nothing while none is shown, and\n * before the tab registered the tools for it: an edit-mode request taken on the load reports nothing\n * of its own, so the load reports once.\n */\n private emitAgentContext(): void {\n const editor = this.editor;\n const dashboard = editor?.Dashboard;\n if (!this.agentStatePublished || !editor || !dashboard) return;\n const panels = this.livePanels();\n this.reportedPanelsKey = JSON.stringify(panels);\n this.navigationService.SetAgentContext(this, BuildDashboardTabAgentContext({\n Dashboard: dashboard,\n IsEditing: editor.IsEditing,\n CanEdit: editor.CanEdit,\n Panels: panels,\n IsFavorite: editor.IsFavorite,\n IsPinnedToHome: this.IsPinnedToHome,\n }));\n }\n\n /** Reports the dashboard again when its panels change. A layout move or resize reports nothing. */\n private onViewerConfigChanged(): void {\n if (this.reportedPanelsKey !== null && JSON.stringify(this.livePanels()) !== this.reportedPanelsKey) {\n this.emitAgentContext();\n }\n }\n\n /** The reads the agent tools make from this tab. */\n private agentHost(): DashboardTabAgentHost {\n return {\n CurrentDashboard: () => this.ConfigDashboard,\n AccessibleDashboards: () => DashboardEngine.Instance.GetAccessibleDashboards(this.ProviderToUse.CurrentUser.ID),\n Panels: dashboard => this.isOpenDashboard(dashboard) ? this.livePanels() : this.savedPanels(dashboard),\n Permissions: dashboardId => DashboardEngine.Instance.GetDashboardPermissions(dashboardId, this.ProviderToUse.CurrentUser.ID),\n };\n }\n\n private isOpenDashboard(dashboard: DashboardTabDashboard): boolean {\n return !!this.ConfigDashboard && UUIDsEqual(dashboard.ID, this.ConfigDashboard.ID);\n }\n\n /**\n * The open dashboard's panels, read from the editor's viewer and its live layout, so unsaved edits\n * count. Empty while the viewer is not ready. Best effort: a failed read never stops the context report.\n */\n private livePanels(): DashboardPanelSummary[] {\n const viewer = this.editor?.Viewer;\n if (!viewer) return [];\n try {\n return SummarizeDashboardPanels(ExtractPanelsFromLayout(viewer.getConfig()?.layout ?? null), viewer.GetPartTypes());\n } catch {\n return [];\n }\n }\n\n /** The panels saved in a dashboard's layout. Empty when the layout or the part types cannot be read. */\n private savedPanels(dashboard: DashboardTabDashboard): DashboardPanelSummary[] {\n try {\n const config = SafeJSONParse<Pick<DashboardLayoutConfig, 'layout'>>(dashboard.UIConfigDetails);\n return SummarizeDashboardPanels(ExtractPanelsFromLayout(config?.layout ?? null), DashboardEngine.Instance.DashboardPartTypes);\n } catch {\n return [];\n }\n }\n\n // ========================================\n // Studio Tools Host\n // ========================================\n\n /**\n * The reads and edits the studio tools make on this tab, through its editor, and the requests they\n * put to the user. DashboardStudioHost says what each member must do.\n */\n private studioHost(): DashboardStudioHost {\n return {\n Dashboard: () => {\n const dashboard = this.ConfigDashboard;\n return dashboard ? { ID: dashboard.ID, Name: dashboard.Name, Description: dashboard.Description ?? null } : null;\n },\n GetConfig: () => this.editor?.Viewer?.getConfig() ?? null,\n GetPartTypes: () => this.editor?.PartTypes ?? [],\n IsEditing: () => this.editor?.IsEditing ?? false,\n CanEdit: () => this.editor?.CanEdit ?? false,\n HasUnsavedChanges: () => this.editor?.Viewer?.HasUnsavedChanges ?? false,\n IsSaving: () => this.editor?.IsSaving ?? false,\n EnterEditMode: () => this.editor?.EnterEditMode() ?? false,\n ...this.studioEdits(),\n GetPanelPath: panelId => this.editor?.Viewer?.GetPanelPath(panelId) ?? null,\n CaptureScreenshot: maxWidth => this.editor\n ? CaptureElementJpeg(this.editor.BodyElement, { maxWidth })\n : Promise.reject(new Error(NO_CONFIG_DASHBOARD)),\n PanelBounds: () => this.panelBounds(),\n IsVoiceSessionActive: () => this.realtimeSession.IsActive,\n SendVoiceFrame: (base64, mimeType) => this.realtimeSession.SendVideoFrame(base64, mimeType),\n Confirm: (kind, detail) => this.askAgentConfirm(kind, detail),\n SearchSources: (query, kinds, limit) => this.searchSources(query, kinds, limit),\n };\n }\n\n /**\n * The studio host's edits. Each runs through runAgentEdit, so it rejects with the reason when it\n * cannot be made, and an edit the viewer can skip without an error is checked afterwards.\n */\n private studioEdits(): Pick<DashboardStudioHost, 'AddPanel' | 'RemovePanel' | 'UpdatePanelConfig' | 'ApplyLayout'> {\n return {\n AddPanel: (partTypeId, config, title, icon, position) =>\n this.runAgentEdit('The assistant could not add the part', viewer => viewer.AddPanel(partTypeId, config, title, icon, position)),\n RemovePanel: panelId =>\n this.runAgentEdit('The assistant could not remove the part', viewer => {\n viewer.RemovePanel(panelId);\n if (viewer.GetPanel(panelId)) throw new Error('The dashboard did not remove the panel.');\n }),\n UpdatePanelConfig: (panelId, config, title, icon) =>\n this.runAgentEdit('The assistant could not change the part', async viewer => {\n await viewer.UpdatePanelConfig(panelId, config, title, icon);\n if (JSON.stringify(viewer.GetPanel(panelId)?.config) !== JSON.stringify(config)) {\n throw new Error('The dashboard did not change the panel.');\n }\n }),\n ApplyLayout: layout =>\n this.runAgentEdit('The assistant could not change the layout', async viewer => {\n if (!viewer.getConfig()) throw new Error('The dashboard has not loaded its layout yet.');\n await viewer.ApplyLayout(layout);\n }),\n };\n }\n\n /**\n * Makes one agent edit on the editor's viewer, then reports the dashboard's parts to the agent again.\n * The edit waits until the viewer's layout is ready: entering edit mode can reload the saved\n * dashboard. Rejects with an Error that says why when no viewer is open, the editor's Save runs, or\n * the edit fails; the user also sees a failed edit.\n */\n private async runAgentEdit<T>(failureMessage: string, edit: (viewer: DashboardViewerComponent) => T | Promise<T>): Promise<T> {\n const viewer = this.editor?.Viewer;\n if (!viewer) throw new Error(NO_CONFIG_DASHBOARD);\n try {\n await viewer.WaitForLayoutReady();\n if (this.editor?.IsSaving) throw new Error(SAVE_IN_PROGRESS);\n return await edit(viewer);\n } catch (error) {\n LogError(`Dashboard tab: ${failureMessage}: ${errorMessage(error)}`);\n MJNotificationService.Instance.CreateSimpleNotification(failureMessage, 'error', 3000);\n throw error instanceof Error ? error : new Error(errorMessage(error));\n } finally {\n this.onViewerConfigChanged();\n }\n }\n\n /**\n * The box of each panel the tab shows, in CSS pixels from the top left corner of the element that\n * CaptureScreenshot captures (the editor's body). A panel whose content is hidden, such as one in a\n * stack's inactive tab, is left out. html-to-image draws a scrolled container from its top, so each\n * box adds the container's scroll offset. None while the editor shows no dashboard.\n */\n private panelBounds(): ReturnType<DashboardStudioHost['PanelBounds']> {\n const editor = this.editor;\n if (!editor) return [];\n const container = editor.BodyElement;\n const origin = container.getBoundingClientRect();\n const contents = new Map(Array.from(container.querySelectorAll<HTMLElement>('[data-panel-id]'), element => [element.dataset['panelId'], element] as const));\n return ExtractPanelsFromLayout(editor.Viewer?.getConfig()?.layout ?? null).flatMap(panel => {\n const content = contents.get(panel.id);\n if (!content || content.offsetParent === null) return [];\n const box = content.getBoundingClientRect();\n return [{\n panelId: panel.id,\n x: Math.round(box.left - origin.left + container.scrollLeft),\n y: Math.round(box.top - origin.top + container.scrollTop),\n width: Math.round(box.width),\n height: Math.round(box.height),\n }];\n });\n }\n\n // ========================================\n // Source Search for the Agent\n // ========================================\n\n /**\n * Searches the sources the user may show in a panel. First loads the engines that the searched kinds\n * read: the tab starts these loads with the dashboard, and a load that failed then runs again here.\n */\n private async searchSources(query: string, kinds: readonly SourceKind[], limit: number): Promise<SourceSearchResult[]> {\n await this.loadSourceEngines(kinds);\n return SearchDashboardSources(this.sourceSearchDeps(), query, kinds, limit);\n }\n\n /** The lists the source search reads, each limited to what the user may use. */\n private sourceSearchDeps(): SourceSearchDeps {\n const provider = this.ProviderToUse;\n return {\n ListArtifacts: query => this.artifactSources(query),\n ListViews: () => viewSources(),\n ListQueries: () => querySources(provider.CurrentUser),\n ListEntities: () => entitySources(provider),\n };\n }\n\n /**\n * Loads the engines the source search reads for `kinds`: user views for 'view' and queries for\n * 'query'. Artifacts and entities need neither. A loaded engine returns at once.\n */\n private async loadSourceEngines(kinds: readonly SourceKind[]): Promise<void> {\n const provider = this.ProviderToUse;\n const loads: Promise<void>[] = [];\n if (kinds.includes('view')) loads.push(UserViewEngine.Instance.Config(false, provider.CurrentUser, provider));\n if (kinds.includes('query')) loads.push(QueryEngine.Instance.Config(false, provider.CurrentUser, provider));\n await Promise.all(loads);\n }\n\n /**\n * Starts to load the source search engines with a Config dashboard, so that the agent's first search\n * usually finds them loaded. The dashboard does not wait for it. Never rejects: a failure is logged,\n * and the search loads the engines again.\n */\n private async preloadSourceEngines(): Promise<void> {\n try {\n await this.loadSourceEngines(SOURCE_KINDS);\n } catch (error) {\n LogError(`Dashboard tab: could not load the views and queries for the assistant's source search: ${errorMessage(error)}`);\n }\n }\n\n /**\n * The artifacts the user can read in the tab's environment (ChatEnvironmentId) whose name or description\n * contains `query` in any case (all of them for a blank query), the first SOURCE_SEARCH_MAX_ARTIFACTS by\n * name, each with its latest version number. An artifact whose versions cannot be read has none, so\n * its panel shows the latest version. Rejects when the artifacts cannot be read.\n */\n private async artifactSources(query: string): Promise<Awaited<ReturnType<SourceSearchDeps['ListArtifacts']>>> {\n const provider = this.ProviderToUse;\n const user = provider.CurrentUser;\n await ArtifactMetadataEngine.Instance.Config(false, user, provider);\n const readable = await this.artifactPermissions.GetReadableArtifactsFilter(user.ID, user);\n const environmentId = EscapeSQLString(this.ChatEnvironmentId);\n const result = await RunView.FromMetadataProvider(provider).RunView<ArtifactRow>({\n EntityName: 'MJ: Artifacts',\n ExtraFilter: `${readable} AND EnvironmentID='${environmentId}' AND (Visibility IS NULL OR Visibility='Always')${artifactQueryFilter(query)}`,\n Fields: ['ID', 'Name', 'Description', 'Type'],\n OrderBy: 'Name',\n MaxRows: SOURCE_SEARCH_MAX_ARTIFACTS,\n ResultType: 'simple',\n }, user);\n if (!result.Success) throw new Error(`Could not read the artifacts: ${result.ErrorMessage || 'no reason given'}`);\n const artifacts = result.Results ?? [];\n const latest = await this.latestArtifactVersions(artifacts.map(artifact => artifact.ID));\n return artifacts.map(artifact => ({\n ID: artifact.ID,\n Name: artifact.Name,\n Description: artifact.Description,\n Type: artifact.Type,\n LatestVersion: latest.get(NormalizeUUID(artifact.ID)) ?? null,\n }));\n }\n\n /**\n * The highest version number of each artifact, by normalized artifact ID. One RunViews call reads\n * every version of the artifacts, highest first and without the entity's row cap, with at most\n * ARTIFACT_VERSION_FILTER_CHUNK IDs in each filter. The artifacts whose versions cannot be read are\n * not in the map, and the failure is logged.\n */\n private async latestArtifactVersions(artifactIds: readonly string[]): Promise<Map<string, number>> {\n const latest = new Map<string, number>();\n if (artifactIds.length === 0) return latest;\n const provider = this.ProviderToUse;\n try {\n const results = await RunView.FromMetadataProvider(provider).RunViews<ArtifactVersionRow>(\n chunked(artifactIds, ARTIFACT_VERSION_FILTER_CHUNK).map(ids => ({\n EntityName: 'MJ: Artifact Versions',\n ExtraFilter: `ArtifactID IN (${ids.map(id => `'${EscapeSQLString(id)}'`).join(',')})`,\n Fields: ['ArtifactID', 'VersionNumber'],\n OrderBy: 'VersionNumber DESC',\n IgnoreMaxRows: true,\n ResultType: 'simple',\n })),\n provider.CurrentUser,\n );\n for (const result of results) {\n if (result.Success) addLatestVersions(latest, result.Results ?? []);\n else LogError(`Dashboard tab: could not read the artifact versions: ${result.ErrorMessage || 'no reason given'}`);\n }\n } catch (error) {\n LogError(`Dashboard tab: could not read the artifact versions: ${errorMessage(error)}`);\n }\n return latest;\n }\n\n // ========================================\n // Requests from the Agent\n // ========================================\n\n /**\n * Opens the confirm dialog for an agent's request and settles with the user's answer: true once the\n * confirmed action is done, false when the user cancels. Rejects when no Config dashboard is open,\n * when another confirmation is open, when the confirmed action fails, and when no answer comes\n * within AGENT_CONFIRM_TIMEOUT_MS; the dialog closes first.\n */\n private askAgentConfirm(kind: AgentConfirmKind, detail: AgentConfirmDetail): Promise<boolean> {\n const dashboard = this.ConfigDashboard;\n if (!dashboard) return Promise.reject(new Error(NO_CONFIG_DASHBOARD));\n if (this.agentConfirmRequest) {\n return Promise.reject(new Error('Another confirmation is already open. Wait for the user to answer it, then try again.'));\n }\n return new Promise<boolean>((resolve, reject) => {\n const timer = setTimeout(() => {\n this.abortAgentConfirm(AGENT_CONFIRM_TIMED_OUT);\n SafeDetectChanges(this.cdr);\n }, AGENT_CONFIRM_TIMEOUT_MS);\n this.agentConfirmRequest = {\n answer: confirmed => {\n clearTimeout(timer);\n if (!confirmed) {\n resolve(false);\n return;\n }\n this.performAgentRequest(kind, detail).then(() => resolve(true), reject);\n },\n abort: reason => {\n clearTimeout(timer);\n reject(reason);\n },\n };\n this.AgentConfirm = { Kind: kind, ...agentConfirmText(kind, dashboard.Name, detail) };\n SafeDetectChanges(this.cdr);\n });\n }\n\n /** Takes the user's answer to the agent's confirm dialog. Does nothing when no dialog is open. */\n public OnAgentConfirm(confirmed: boolean): void {\n const request = this.closeAgentConfirm();\n SafeDetectChanges(this.cdr);\n request?.answer(confirmed);\n }\n\n /** Closes the agent's confirm dialog, if one is open, and fails its request with `reason`. */\n private abortAgentConfirm(reason: string): void {\n this.closeAgentConfirm()?.abort(new Error(reason));\n }\n\n /** Closes the agent's confirm dialog and returns its request, or null when none is open. */\n private closeAgentConfirm(): AgentConfirmRequest | null {\n const request = this.agentConfirmRequest;\n this.agentConfirmRequest = null;\n this.AgentConfirm = null;\n return request;\n }\n\n /** Does what the user confirmed, as the editor's Save and the Add to menu do it. Rejects when it did not take effect. */\n private async performAgentRequest(kind: AgentConfirmKind, detail: AgentConfirmDetail): Promise<void> {\n switch (kind) {\n case 'save':\n return this.saveForAgent(detail);\n case 'pin':\n return this.pinForAgent();\n default:\n throw new Error(`The tab cannot do the request \"${String(kind)}\".`);\n }\n }\n\n /**\n * Saves the dashboard through the editor, as its Save does, with the new name and description the\n * agent gave. Rejects with the reason the save did not happen. While a Save runs the editor refuses\n * at once and leaves its name and description fields as they are, because that Save reads them.\n */\n private async saveForAgent(detail: AgentConfirmDetail): Promise<void> {\n const editor = this.editor;\n const failure = editor ? await editor.Save({ Name: detail.name, Description: detail.description }) : NO_CONFIG_DASHBOARD;\n if (failure) throw new Error(failure);\n }\n\n /** Pins the dashboard to Home as the Add to menu does. Rejects when it is not pinned afterwards. */\n private async pinForAgent(): Promise<void> {\n await this.PinToHome();\n if (!this.IsPinnedToHome) throw new Error(`Could not pin \"${this.ConfigDashboard?.Name ?? 'the dashboard'}\" to Home.`);\n }\n\n /** @deprecated Use {@link OnShareDialogResult}. */\n public onShareDialogResult(result: ShareDialogResult): void {\n return this.OnShareDialogResult(result);\n }\n\n /**\n * Load the appropriate dashboard component based on dashboard type\n * Routes between code-based dashboards (registered classes) and config-based dashboards\n */\n private async loadDashboard(): Promise<void> {\n // Clear any previous error state\n this.clearError();\n\n const data = this.Data;\n\n if (!data?.ResourceRecordID) {\n this.NotifyLoadStarted();\n this.NotifyLoadComplete();\n return;\n }\n\n this.NotifyLoadStarted();\n\n try {\n // Check if this is a special dashboard type (not a database record)\n const config = data.Configuration || {};\n\n if (this.isDataExplorer(data)) {\n // Special case: Data Explorer dashboard with optional entity filter\n await this.loadDataExplorer(\n config['entityFilter'],\n config['appName'] as string | undefined,\n config['appIcon'] as string | undefined\n );\n return;\n }\n\n await DashboardEngine.Instance.Config(false); // make sure it is configured, if already configured does nothing\n const dashboard = DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, data.ResourceRecordID));\n if (!dashboard) {\n throw new Error(`Dashboard with ID ${data.ResourceRecordID} not found.`);\n }\n\n void this.recentAccess.LogAccess('MJ: Dashboards', dashboard.ID, 'dashboard');\n\n // Determine which dashboard component to load based on dashboard type\n if (dashboard.Type === 'Code') {\n // CODE-BASED DASHBOARD: Use registered class via DriverClass\n await this.loadCodeBasedDashboard(dashboard);\n } else {\n // CONFIG-BASED DASHBOARD: the shared dashboard editor shows it. Its studio tools\n // search views and queries, so their engines start to load now; the dashboard does not wait.\n void this.preloadSourceEngines();\n this.showConfigDashboard(dashboard);\n }\n } catch (error) {\n console.error('Error loading dashboard:', error);\n this.setError('The dashboard could not be loaded. This may be due to a missing component or configuration issue.', error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Load the Data Explorer dashboard component with optional entity filter and context info\n * @param entityFilter Optional filter to constrain which entities are shown\n * @param contextName Optional name to display in the header (e.g., \"CRM\", \"Association Demo\")\n * @param contextIcon Optional Font Awesome icon class for the header\n */\n private async loadDataExplorer(\n entityFilter?: DataExplorerFilter,\n contextName?: string,\n contextIcon?: string\n ): Promise<void> {\n try {\n // Lazy-load the Data Explorer component to keep it out of the initial bundle\n const { DataExplorerDashboardComponent } = await import('@memberjunction/ng-dashboards/data-explorer-dashboards.module');\n this.ContainerElement.nativeElement.innerHTML = '';\n const componentRef = this.viewContainer.createComponent(DataExplorerDashboardComponent);\n this.componentRef = componentRef;\n const instance = componentRef.instance;\n\n // Scope the child's query-param reads/writes to THIS tab. A dashboard we instantiate\n // ourselves has no ResourceData and therefore no tab id of its own; without this it\n // cannot update the URL at all (BaseResourceComponent refuses tab-less writes rather\n // than corrupting whichever tab the user is viewing). Set before any await below —\n // Angular can run the child's ngOnInit, which binds its param subscription, while we\n // are suspended.\n instance.ParentTabId = this.getTabId();\n\n // Set the entity filter - ngOnInit will use this when it runs\n if (entityFilter) {\n instance.entityFilter = entityFilter;\n }\n\n // Set context name and icon for customized header display\n if (contextName) {\n instance.contextName = contextName;\n }\n if (contextIcon) {\n instance.contextIcon = contextIcon;\n }\n\n // Manually append the component's native element inside the div\n const nativeElement = (componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.ContainerElement.nativeElement.appendChild(nativeElement);\n\n // Handle open entity record events\n instance.OpenEntityRecord.subscribe((eventData: { EntityName: string; RecordPKey: CompositeKey }) => {\n if (eventData && eventData.EntityName && eventData.RecordPKey) {\n this.navigationService.OpenEntityRecord(eventData.EntityName, eventData.RecordPKey);\n }\n });\n\n // Setup LoadCompleteEvent to know when the dashboard is ready\n instance.LoadCompleteEvent = () => {\n this.NotifyLoadComplete();\n };\n\n // Surface the dashboard's own load failures — but only for the INITIAL load. Wrap the\n // completion hook to learn when the first load has settled, so a later Refresh() that\n // fails does NOT replace an already-rendered Data Explorer with a sticky error card.\n let initialLoadSettled = false;\n const onComplete = instance.LoadCompleteEvent;\n instance.LoadCompleteEvent = () => { initialLoadSettled = true; onComplete?.(); };\n instance.Error.subscribe((err: Error) => {\n if (initialLoadSettled) return; // post-mount refresh failure — already logged by BaseDashboard.runGuardedLoad\n this.setError('The Data Explorer could not be loaded.', err);\n this.cdr.markForCheck();\n });\n\n // Initialize dashboard (no database config needed for DataExplorer)\n const config: DashboardConfig = {\n dashboard: null as unknown as MJDashboardEntity, // No database record\n userState: {}\n };\n instance.Config = config;\n instance.Refresh();\n\n // Trigger change detection to ensure the component updates\n componentRef.changeDetectorRef.detectChanges();\n } catch (error) {\n console.error('Error loading Data Explorer:', error);\n this.setError('The Data Explorer could not be loaded.', error);\n this.NotifyLoadComplete();\n }\n }\n\n /**\n * Load a code-based dashboard by looking up the registered class\n */\n private async loadCodeBasedDashboard(dashboard: MJDashboardEntity): Promise<void> {\n try {\n if (!dashboard.DriverClass) {\n throw new Error(`Dashboard '${dashboard.Name}' is marked as Code type but has no DriverClass specified`);\n }\n\n // Look up the registered class using the DriverClass name (with lazy loading fallback via ClassFactory)\n const classReg = await MJGlobal.Instance.ClassFactory.GetRegistrationAsync(\n BaseDashboard,\n dashboard.DriverClass\n );\n\n if (!classReg?.SubClass) {\n throw new Error(`Dashboard class '${dashboard.DriverClass}' is not registered. Please check the class registration.`);\n }\n\n // Create the component instance\n this.ContainerElement.nativeElement.innerHTML = '';\n this.componentRef = this.viewContainer.createComponent<BaseDashboard>(classReg.SubClass);\n const instance = this.componentRef.instance as BaseDashboard;\n\n // Scope the child's query-param reads/writes to THIS tab. Code dashboards resolved via\n // ClassFactory (every Open App dashboard, MCPDashboard, DataExplorer) get no\n // ResourceData and so have no tab id of their own; without this their UpdateQueryParams\n // calls are refused (and previously — worse — landed in whatever tab the user happened\n // to be looking at). Set before the awaits below: Angular can run the child's ngOnInit,\n // which binds its param subscription, while we are suspended.\n instance.ParentTabId = this.getTabId();\n\n // Setup LoadCompleteEvent() to know when the dashboard is ready\n instance.LoadCompleteEvent = () => {\n this.NotifyLoadComplete();\n };\n\n // Surface the dashboard's own load failures in the host's error card — but only for the\n // INITIAL load. BaseDashboard guarantees the loading screen is released even when\n // initDashboard()/loadData() throws (it emits Error, then NotifyLoadComplete in a\n // finally). Wrap the completion hook to learn when the first load has settled, so a later\n // Refresh() failure keeps the rendered dashboard instead of blanking it to a sticky error\n // card. Wired BEFORE the first await below, so an Error during the instance's own\n // ngOnInit isn't missed.\n let initialLoadSettled = false;\n const onComplete = instance.LoadCompleteEvent;\n instance.LoadCompleteEvent = () => { initialLoadSettled = true; onComplete?.(); };\n instance.Error.subscribe((err: Error) => {\n if (initialLoadSettled) return; // post-mount refresh failure — already logged by BaseDashboard.runGuardedLoad\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded.`, err);\n this.cdr.markForCheck();\n });\n\n // Initialize with dashboard data\n const userStateEntity = await this.loadDashboardUserState(dashboard.ID);\n const config: DashboardConfig = {\n dashboard,\n userState: userStateEntity.UserState ? SafeJSONParse(userStateEntity.UserState) : {}\n };\n\n instance.Config = config;\n\n // Manually append the component's native element inside the div\n const nativeElement = (this.componentRef.hostView as any).rootNodes[0];\n nativeElement.style.width = '100%';\n nativeElement.style.height = '100%';\n this.ContainerElement.nativeElement.appendChild(nativeElement);\n\n // handle open entity record events in MJ Explorer with routing\n instance.OpenEntityRecord.subscribe((data: { EntityName: string; RecordPKey: CompositeKey }) => {\n // check to see if the data has entityname/pkey\n if (data && data.EntityName && data.RecordPKey) {\n // Use NavigationService to open entity record in new tab\n this.navigationService.OpenEntityRecord(data.EntityName, data.RecordPKey);\n } else {\n console.warn('DashboardResource - invalid data, missing EntityName or RecordPKey:', data);\n }\n });\n\n instance.UserStateChanged.subscribe(async (userState: any) => {\n if (!userState) {\n // if the user state is null, we need to remove it from the user state\n userState = {};\n }\n // save the user state to the dashboard user state entity\n userStateEntity.UserState = JSON.stringify(userState);\n if (!await userStateEntity.Save()) {\n LogError('Error saving user state', null, userStateEntity.LatestResult?.CompleteMessage);\n }\n });\n\n instance.Refresh();\n } catch (error) {\n console.error('Error loading code-based dashboard:', error);\n this.setError(`The dashboard \"${dashboard.Name}\" could not be loaded. The dashboard class may not be registered or may have failed to initialize.`, error);\n this.NotifyLoadComplete();\n }\n }\n\n protected async loadDashboardUserState(dashboardId: string): Promise<MJDashboardUserStateEntity> {\n // handle user state changes for the dashboard\n const md = this.ProviderToUse;\n const stateResult = DashboardEngine.Instance.DashboardUserStates.filter(dus => UUIDsEqual(dus.DashboardID, dashboardId) && UUIDsEqual(dus.UserID, md.CurrentUser.ID));\n let stateObject: MJDashboardUserStateEntity;\n if (stateResult && stateResult.length > 0) {\n stateObject = stateResult[0];\n }\n else {\n stateObject = await md.GetEntityObject<MJDashboardUserStateEntity>('MJ: Dashboard User States');\n stateObject.DashboardID = dashboardId;\n stateObject.UserID = md.CurrentUser.ID;\n // don't save becuase we don't care about the state until something changes\n }\n return stateObject;\n }\n\n /**\n * Handle navigation requests from a part of the dashboard (the editor passes them on)\n */\n private handleNavigationRequest(event: DashboardNavRequestEvent): void {\n const request = event.request;\n\n switch (request.type) {\n case 'OpenEntityRecord': {\n const entityRequest = request as { type: 'OpenEntityRecord'; entityName: string; recordId: string };\n // `recordId` is documented as URL-segment format (see OpenEntityRecordNavRequest in\n // @memberjunction/ng-dashboard-viewer). E.g. a single-PK record is `\"ID|11055\"`; a\n // composite-PK record is `\"Field1|Value1||Field2|Value2\"`. Senders in\n // dashboard-viewer (artifact-part, view-part) intentionally call\n // `compositeKey.ToURLSegment()` to produce this shape.\n //\n // Wrapping that string verbatim into `{ FieldName: 'ID', Value: <segment> }` makes\n // ToURLSegment serialize it a second time as `ID|<segment>` and produces a\n // malformed `Field|Field|Value` URL the host parser silently mis-reads (manifesting\n // downstream as `BaseEntity.Load(... Key: ID=ID)` and `Primary Key value is not a\n // valid number`). Parse the segment with `FromURLSegment` against the entity's PK\n // metadata instead, so single-PK and composite-PK both round-trip correctly (it also\n // owns the last-resort `ID` fallback for an entity name metadata can't resolve).\n const md = this.ProviderToUse;\n const pkey = CompositeKey.FromURLSegment(md.EntityByName(entityRequest.entityName), entityRequest.recordId);\n this.navigationService.OpenEntityRecord(entityRequest.entityName, pkey);\n break;\n }\n case 'OpenDashboard': {\n const dashRequest = request as { type: 'OpenDashboard'; dashboardId: string };\n // Load dashboard name from engine cache\n const targetDashboard = DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, dashRequest.dashboardId));\n const name = targetDashboard?.Name || 'Dashboard';\n this.navigationService.OpenDashboard(dashRequest.dashboardId, name);\n break;\n }\n case 'OpenQuery': {\n const queryRequest = request as { type: 'OpenQuery'; queryId: string };\n this.navigationService.OpenQuery(queryRequest.queryId, 'Query');\n break;\n }\n default:\n console.warn('Unhandled navigation request type:', request.type);\n }\n }\n\n /**\n * The tab title: the dashboard's name from the DashboardEngine cache, else its record name from\n * the server, else the given name. A Data Explorer tab keeps the name of the app it belongs to.\n */\n override async GetResourceDisplayName(data: ResourceData): Promise<string> {\n if (this.isDataExplorer(data)) {\n const config: Record<string, unknown> = data.Configuration ?? {};\n const appName = typeof config['appName'] === 'string' ? config['appName'] : '';\n return data.Name || appName || 'Data Explorer';\n }\n const dashboardId = typeof data.ResourceRecordID === 'string' ? data.ResourceRecordID : '';\n const name = dashboardId ? (this.cachedDashboardName(dashboardId) ?? await this.loadDashboardName(dashboardId)) : null;\n return name || data.Name || 'Dashboard';\n }\n\n /** True for the Data Explorer, which this wrapper hosts but which is not a dashboard record. */\n private isDataExplorer(data: ResourceData): boolean {\n const config: Record<string, unknown> = data.Configuration ?? {};\n return config['dashboardType'] === 'DataExplorer' || data.ResourceRecordID === 'DataExplorer';\n }\n\n /** The dashboard's name from the DashboardEngine cache, or null when the cache does not have it. */\n private cachedDashboardName(dashboardId: string): string | null {\n try {\n return DashboardEngine.Instance.Dashboards.find(d => UUIDsEqual(d.ID, dashboardId))?.Name || null;\n } catch {\n return null; // the user cannot read the dashboards cache\n }\n }\n\n /** The dashboard's record name from the server, or null when it cannot be read. */\n private async loadDashboardName(dashboardId: string): Promise<string | null> {\n try {\n return (await this.ProviderToUse.GetEntityRecordName('MJ: Dashboards', CompositeKey.FromID(dashboardId))) || null;\n } catch {\n return null;\n }\n }\n\n /**\n * Get the icon class for dashboard resources\n */\n async GetResourceIconClass(data: ResourceData): Promise<string> {\n return 'fa-solid fa-table-columns';\n }\n}\n\nfunction errorMessage(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\n/** The title, question and confirm button text of the dialog that asks the user to do what the agent requests. */\nfunction agentConfirmText(kind: AgentConfirmKind, dashboardName: string, detail: AgentConfirmDetail): Omit<AgentConfirmDialog, 'Kind'> {\n const name = `\"${dashboardName}\"`;\n switch (kind) {\n case 'save': {\n const rename = detail.name ? ` Its new name will be \"${detail.name}\".` : '';\n const describe = detail.description ? ` Its new description will be \"${detail.description}\".` : '';\n return { Title: 'Save dashboard?', Message: `The assistant asks to save ${name}.${rename}${describe}`, ConfirmText: 'Save' };\n }\n case 'pin':\n return { Title: 'Pin to Home?', Message: `The assistant asks to pin ${name} to your Home app.`, ConfirmText: 'Pin' };\n }\n}\n\n/** The user's own views and the shared views the user may see. None when the user cannot read views. */\nfunction viewSources(): ReturnType<SourceSearchDeps['ListViews']> {\n const engine = UserViewEngine.Instance;\n if (engine.IsPermissionConstrained) return [];\n const shared = engine.GetSharedViews().filter(view => view.UserCanView);\n return [...engine.GetViewsForCurrentUser(), ...shared].map(view => ({\n ID: view.ID,\n Name: view.Name,\n Description: view.Description,\n Entity: view.Entity,\n EntityID: view.EntityID,\n }));\n}\n\n/** The queries the user can run. None when the user cannot read queries. */\nfunction querySources(user: UserInfo): ReturnType<SourceSearchDeps['ListQueries']> {\n const engine = QueryEngine.Instance;\n if (engine.IsPermissionConstrained) return [];\n return engine.Queries.filter(query => query.UserCanRun(user).canRun).map(query => ({\n ID: query.ID,\n Name: query.Name,\n Description: query.Description,\n Category: query.Category,\n }));\n}\n\n/** The entities the user can read. */\nfunction entitySources(provider: IMetadataProvider): ReturnType<SourceSearchDeps['ListEntities']> {\n const user = provider.CurrentUser;\n return provider.Entities.filter(entity => entity.GetUserPermisions(user).CanRead).map(entity => ({\n ID: entity.ID,\n Name: entity.Name,\n DisplayName: entity.DisplayName,\n Description: entity.Description,\n }));\n}\n\n/**\n * The filter clause that keeps the artifacts whose name or description, in lower case, matches the query\n * as a LIKE pattern (see likeNarrowingPattern), or '' when the query is blank. The clause only narrows\n * the list: RankByQuery makes the exact match in the browser.\n */\nfunction artifactQueryFilter(query: string): string {\n const pattern = likeNarrowingPattern(query);\n return pattern ? ` AND (LOWER(Name) LIKE '%${pattern}%' OR LOWER(Description) LIKE '%${pattern}%')` : '';\n}\n\n/**\n * The query without its outer spaces as a lower-case LIKE pattern that matches the query, and can match\n * more, in the same way on SQL Server and PostgreSQL. It needs no ESCAPE clause, which the server refuses\n * in a client's filter. Each quote, backslash and LIKE wildcard (`%`, `_`, `[`, `]`) becomes `_`, which\n * matches any one character. Each parenthesis becomes `_` too: the PostgreSQL provider rewrites date\n * functions such as `GETDATE()` in the whole filter, string literals included. Each other character that is\n * not ASCII becomes `_`, so the literal needs no `N` prefix, with two exceptions that become `%` (see\n * nonAsciiWildcard). The text is put in lower case last, when it holds only ASCII.\n */\nfunction likeNarrowingPattern(query: string): string {\n const ascii = query\n .trim()\n .replace(/[\\\\%_[\\]'()]/g, '_')\n .replace(/[\\u0080-\\u{10FFFF}]/gu, char => nonAsciiWildcard(char));\n return EscapeSQLString(ascii.toLowerCase());\n}\n\n/**\n * The LIKE wildcard for a character that is not ASCII: `_`, which matches one character, or `%` where one\n * character can be two on some database. SQL Server counts a character outside the BMP as two characters and\n * PostgreSQL as one. `İ` (U+0130) is one character, but ICU collations put it in lower case as `i` and a\n * combining dot.\n */\nfunction nonAsciiWildcard(char: string): '%' | '_' {\n return char.length > 1 || char === '\\u0130' ? '%' : '_';\n}\n\n/** Records in `latest` the highest version number of each artifact in `rows`, by normalized artifact ID. */\nfunction addLatestVersions(latest: Map<string, number>, rows: readonly ArtifactVersionRow[]): void {\n for (const row of rows) {\n const key = NormalizeUUID(row.ArtifactID);\n latest.set(key, Math.max(latest.get(key) ?? 0, row.VersionNumber));\n }\n}\n\n/** The items in consecutive groups of at most `size`. */\nfunction chunked<T>(items: readonly T[], size: number): T[][] {\n const groups: T[][] = [];\n for (let start = 0; start < items.length; start += size) {\n groups.push(items.slice(start, start + size));\n }\n return groups;\n}\n"]}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * @fileoverview Source search for the dashboard studio tools: finds the artifacts, user views, queries and
3
+ * entities that match the agent's query, ranks them, and gives each match a panel config for AddPanel.
4
+ * Pure: the tab passes in the lists through {@link SourceSearchDeps}, already limited to what the user may use.
5
+ */
6
+ /** The kinds of source a dashboard panel can show. */
7
+ export type SourceKind = 'artifact' | 'view' | 'query' | 'entity';
8
+ /** Every {@link SourceKind}, in the order search results list them. */
9
+ export declare const SOURCE_KINDS: readonly SourceKind[];
10
+ /**
11
+ * The artifact types that suit an Artifact panel, by their names in the `MJ: Artifact Types` metadata:
12
+ * interactive components and reports, data (with Data Snapshot and Search Result Set, which use the same
13
+ * viewer), HTML, SVG and Markdown.
14
+ */
15
+ export declare const DASHBOARD_ARTIFACT_TYPE_NAMES: readonly ["Component", "Report", "Data", "Data Snapshot", "Search Result Set", "HTML", "SVG Image", "Markdown Document"];
16
+ /** One source the agent can show in a dashboard panel. The keys are the SearchSources tool result keys. */
17
+ export interface SourceSearchResult {
18
+ /** What the source is. */
19
+ kind: SourceKind;
20
+ /** The ID of the artifact, user view, query or entity. */
21
+ id: string | null;
22
+ /** The source's name. For an entity, its display name when it has one. */
23
+ name: string;
24
+ /** The source's description. */
25
+ description: string | null;
26
+ /** The artifact type, the view's entity, the query's category, or "entity". */
27
+ type: string | null;
28
+ /** False for an artifact whose type does not suit a panel (see DASHBOARD_ARTIFACT_TYPE_NAMES). True for every other source. */
29
+ fitsDashboard: boolean;
30
+ /** A panel config for AddPanel: `type` is the part type (Artifact, View or Query), and the other keys are its config. */
31
+ suggestedConfig: Record<string, unknown>;
32
+ }
33
+ /** The lists the search reads. The tab builds them from the engines with the user's access rules. */
34
+ export interface SourceSearchDeps {
35
+ /**
36
+ * The artifacts the user can read. `query` is the search text without its outer spaces, or '' to list
37
+ * every artifact; the list can leave out the artifacts whose name and description do not contain it.
38
+ * `LatestVersion` is null when the list does not give it.
39
+ */
40
+ ListArtifacts(query: string): Promise<Array<{
41
+ ID: string;
42
+ Name: string;
43
+ Description: string | null;
44
+ Type: string | null;
45
+ LatestVersion: number | null;
46
+ }>>;
47
+ /** The user's own views and the views shared with the user. */
48
+ ListViews(): Array<{
49
+ ID: string;
50
+ Name: string;
51
+ Description: string | null;
52
+ Entity: string;
53
+ EntityID: string;
54
+ }>;
55
+ /** The queries the user can run. */
56
+ ListQueries(): Array<{
57
+ ID: string;
58
+ Name: string;
59
+ Description: string | null;
60
+ Category: string | null;
61
+ }>;
62
+ /** The entities the user can read. */
63
+ ListEntities(): Array<{
64
+ ID: string;
65
+ Name: string;
66
+ DisplayName: string | null;
67
+ Description: string | null;
68
+ }>;
69
+ }
70
+ /**
71
+ * The items that match the query, best first, at most `limit` of them: exact name, then name start, then
72
+ * name contains, then description contains, ignoring case and the query's outer spaces. Items in one tier
73
+ * keep the order they were given in. An empty query gives the first `limit` items by name. The input
74
+ * array is not changed.
75
+ */
76
+ export declare function RankByQuery<T extends {
77
+ name: string;
78
+ description: string | null;
79
+ }>(items: readonly T[], query: string, limit: number): T[];
80
+ /**
81
+ * Searches the sources of the requested kinds and gives up to `limit` results of each kind, ranked with
82
+ * {@link RankByQuery}, in {@link SOURCE_KINDS} order. It reads only the lists of the kinds it searches,
83
+ * and gives the artifact list the query without its outer spaces.
84
+ */
85
+ export declare function SearchDashboardSources(deps: SourceSearchDeps, query: string, kinds: readonly SourceKind[], limit: number): Promise<SourceSearchResult[]>;
86
+ //# sourceMappingURL=dashboard-source-search.d.ts.map