@posiwise/shared-components 0.0.234 → 0.0.235

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.
@@ -1 +1 @@
1
- {"version":3,"file":"posiwise-shared-components.mjs","names":["i1","i2","i1","i1","i1","i1","i2.ConfirmDialogService","i3","i4","i6","i7","i9","i12","i13.NoDataComponent","i14.RecordsSummaryComponent","i1","takeUntil","VOICE_ERROR_MESSAGES","i1","i1","i2","i1","i2","i1","i1","i2","i1","i2","i3","i4.DynamicPageContextService","i5","i6","i7","i8","i9.PwBrainChatThreadDirective","i10.PwBrainChatConfirmComponent","i11.PwBrainChatQuickComponent","i12.PwBrainChatWelcomeComponent","i13.PwBrainChatVoiceOverlayComponent","i14.SafeMarkdownPipe","i2","i1.CollapsibleSidebarService","i1.CollapsibleSidebarService","i2","i3.CollapsibleSidebarKeyboardShortcutDirective","i4","i1.CollapsibleSidebarService","i1.CommandPaletteService","i2","i3.CollapsibleSidebarService","i4","i5","i6","i7","i1","i1","i1","i1","i1","i2.CollapsibleSidebarService","i3","i4","i1","i2","i3","i1","i2","i3","i4","i5","i6","i7","i8","i10.NoDataComponent","i11","i1","i2","i3","i5","i1","i2","i3.ConfirmDialogService","i4.PwStickyActionsComponent","i5","i7","i8.InputContainerComponent","i9.NoDataComponent","i10","i11","i1","i2","i3.ConfirmDialogService","i4.PwStickyActionsComponent","i5","i6","i8","i9","i10.InputContainerComponent","i11.NoDataComponent","i12","i1","i2","i3","i4","i1","i2","i3","i1","i2","i3","i1","i2","i3","i4","i1","i2","i3","i4","i5.HeaderComponent","i6","i7","i1","i2","i1","i1","i2","i1","i2","i4","i5","i6.NoDataComponent","i7","i1","i1","i1","i1","isIncrease"],"sources":["../../../../libs/shared-components/src/lib/confirm-dialog/confirm-dialog.component.ts","../../../../libs/shared-components/src/lib/confirm-dialog/confirm-dialog.component.html","../../../../libs/shared-components/src/lib/confirm-dialog/confirm-dialog.service.ts","../../../../libs/shared-components/src/lib/ai-knowledge/ai-knowledge.helpers.ts","../../../../libs/shared-components/src/lib/no-data/no-data.component.ts","../../../../libs/shared-components/src/lib/records-summary/records-summary.component.ts","../../../../libs/shared-components/src/lib/ai-knowledge/ai-knowledge.component.ts","../../../../libs/shared-components/src/lib/ai-knowledge/ai-knowledge.component.html","../../../../libs/shared-components/src/lib/authenticator/authenticator.component.ts","../../../../libs/shared-components/src/lib/authenticator/authenticator.component.html","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-brand.helpers.ts","../../../../libs/shared-components/src/lib/dynamic-page/dynamic-page-context.service.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.view.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.choice.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.drag.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.transfer.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.controller.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-confirmation.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-context.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-dictation.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-diff.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-url-safety.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-navigation.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-storage.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-persistence.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-prompts.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-scroll.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-upload.token.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-voice-copy.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-voice-chat.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-thread.directive.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-confirm.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-confirm.component.html","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-product-prompts.token.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-quick.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-welcome.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-welcome.component.html","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-sonar.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-sonar-scenes.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-sonar-render.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-voice-overlay.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-voice-overlay.component.html","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-link-resolve.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-markdown.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-safe-markdown.pipe.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat.component.html","../../../../libs/shared-components/src/lib/clearbit-icon/clearbit-icon.component.ts","../../../../libs/shared-components/src/lib/clearbit-icon/clearbit-icon.component.html","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar.service.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-keyboard-shortcut.directive.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-navbar-offset.helpers.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-panel.helpers.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar.component.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar.component.html","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-trigger.directive.ts","../../../../libs/shared-components/src/lib/coming-soon/coming-soon.component.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette.service.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-activate.helpers.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-brand.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-sources.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-actions.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-switch.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-compose.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-cursor.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-dialog.helpers.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-keyboard.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-people.helpers.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette.component.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette.component.html","../../../../libs/shared-components/src/lib/cookie-banner/pw-cookie-banner.component.ts","../../../../libs/shared-components/src/lib/cookie-banner/pw-cookie-banner.component.html","../../../../libs/shared-components/src/lib/dynamic-page/blocks/chart-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/blocks/data-table-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/blocks/divider-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/blocks/section-heading-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/blocks/stat-card-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/component-registry.ts","../../../../libs/shared-components/src/lib/dynamic-page/ui-config-validator.ts","../../../../libs/shared-components/src/lib/dynamic-page/pw-dynamic-page.component.ts","../../../../libs/shared-components/src/lib/header/header.component.ts","../../../../libs/shared-components/src/lib/header/header.component.html","../../../../libs/shared-components/src/lib/label-management/entity-group/entity-group.component.ts","../../../../libs/shared-components/src/lib/label-management/entity-group/entity-group.component.html","../../../../libs/shared-components/src/lib/sticky-actions/pw-sticky-actions.component.ts","../../../../libs/shared-components/src/lib/sticky-actions/pw-sticky-actions.component.html","../../../../libs/shared-components/src/lib/input-container/input-container.component.ts","../../../../libs/shared-components/src/lib/input-container/input-container.component.html","../../../../libs/shared-components/src/lib/label-management/group-definition/group-definition.component.ts","../../../../libs/shared-components/src/lib/label-management/group-definition/group-definition.component.html","../../../../libs/shared-components/src/lib/label-management/groups/groups.component.ts","../../../../libs/shared-components/src/lib/label-management/groups/groups.component.html","../../../../libs/shared-components/src/lib/landing-page-footer-b/landing-page-footer-b.component.ts","../../../../libs/shared-components/src/lib/landing-page-footer-b/landing-page-footer-b.component.html","../../../../libs/shared-components/src/lib/number-picker/number-picker.component.ts","../../../../libs/shared-components/src/lib/number-picker/number-picker.component.html","../../../../libs/shared-components/src/lib/online-indicator/online-indicator.component.ts","../../../../libs/shared-components/src/lib/online-indicator/online-indicator.component.html","../../../../libs/shared-components/src/lib/password-validation/password-validation.component.ts","../../../../libs/shared-components/src/lib/password-validation/password-validation.component.html","../../../../libs/shared-components/src/lib/permission-tree/permission-tree.component.ts","../../../../libs/shared-components/src/lib/privacy-and-tos/quill-lists.ts","../../../../libs/shared-components/src/lib/privacy-and-tos/privacy-and-tos.component.ts","../../../../libs/shared-components/src/lib/privacy-and-tos/privacy-and-tos.component.html","../../../../libs/shared-components/src/lib/pw-tabs/pw-tabs.component.ts","../../../../libs/shared-components/src/lib/pw-tabs/pw-tabs.component.html","../../../../libs/shared-components/src/lib/range-date-picker/date-range-picker.component.ts","../../../../libs/shared-components/src/lib/range-date-picker/date-range-picker.component.html","../../../../libs/shared-components/src/lib/completion-bar/completion-bar.component.ts","../../../../libs/shared-components/src/lib/onboarding-checklist/onboarding-checklist.storage.ts","../../../../libs/shared-components/src/lib/onboarding-checklist/onboarding-checklist.component.ts","../../../../libs/shared-components/src/lib/onboarding-checklist/onboarding-checklist.component.html","../../../../libs/shared-components/src/lib/resource-shared-components.module.ts","../../../../libs/shared-components/src/lib/splash/splash.component.ts","../../../../libs/shared-components/src/lib/splash/splash.component.html","../../../../libs/shared-components/src/lib/shared-components.module.ts","../../../../libs/shared-components/src/lib/privacy-and-tos/legal-page.routes.ts","../../../../libs/shared-components/src/lib/onboarding-checklist/onboarding-checklist.types.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-super-admin.guard.ts","../../../../libs/shared-components/src/lib/dynamic-page/ui-layout.service.ts","../../../../libs/shared-components/src/lib/notice/pw-notice.component.ts","../../../../libs/shared-components/src/lib/notice/pw-notice.component.html","../../../../libs/shared-components/src/lib/edit-card/pw-edit-card.component.ts","../../../../libs/shared-components/src/lib/edit-card/pw-edit-card.component.html"],"sourcesContent":["import { Component, Input } from '@angular/core';\n\nimport { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ConfirmDialogConfig, ConfirmDialogTone } from './confirm-dialog.types';\n\n@Component({\n selector: 'pw-confirm-dialog',\n templateUrl: './confirm-dialog.component.html',\n styleUrls: ['./confirm-dialog.component.scss'],\n standalone: false\n})\nexport class ConfirmDialogComponent {\n @Input() config: ConfirmDialogConfig = {};\n\n constructor(public readonly modal: NgbActiveModal) {}\n\n get tone(): ConfirmDialogTone {\n if (this.config.tone) {\n return this.config.tone;\n }\n if (this.config.destructive) {\n return 'destructive';\n }\n if (this.config.confirmOnly) {\n return 'info';\n }\n return 'neutral';\n }\n\n get iconClass(): string {\n if (this.config.icon) {\n return this.config.icon;\n }\n switch (this.tone) {\n case 'destructive':\n // Hollow-circle X — reads as \"this will delete\" stronger than a\n // warning triangle. Matches the SweetAlert2 destructive idiom\n // users find more imposing for irreversible actions.\n return 'pi pi-times';\n case 'info':\n return 'pi pi-info-circle';\n default:\n return 'pi pi-question-circle';\n }\n }\n\n get titleKey(): string | null {\n return this.config.titleKey ?? null;\n }\n\n get titleRaw(): string {\n return this.config.title ?? '';\n }\n\n get titleParams(): Record<string, unknown> {\n return this.config.titleParams ?? {};\n }\n\n get textKey(): string | null {\n return this.config.textKey ?? null;\n }\n\n get textRaw(): string {\n return this.config.text ?? '';\n }\n\n get textParams(): Record<string, unknown> {\n return this.config.textParams ?? {};\n }\n\n get confirmLabelKey(): string {\n if (this.config.confirmLabelKey) {\n return this.config.confirmLabelKey;\n }\n if (this.config.confirmOnly) {\n return 'Button.OK';\n }\n // Destructive confirms default to \"OK\" to match the swal idiom; a\n // shorter, more decisive label feels right after the centered \"stop\n // and read\" treatment. Callers can still override via confirmLabelKey.\n if (this.tone === 'destructive') {\n return 'Button.OK';\n }\n return 'Button.Confirm';\n }\n\n get confirmLabel(): string {\n return this.config.confirmLabel ?? '';\n }\n\n get cancelLabelKey(): string {\n return this.config.cancelLabelKey ?? 'Button.Cancel';\n }\n\n get cancelLabel(): string {\n return this.config.cancelLabel ?? '';\n }\n\n get confirmButtonClass(): string {\n return this.tone === 'destructive' ? 'btn btn-danger' : 'btn btn-primary';\n }\n\n confirm(): void {\n this.modal.close(true);\n }\n\n cancel(): void {\n this.modal.dismiss(false);\n }\n}\n","<div class=\"pw-confirm\"\n [class.pw-confirm--destructive]=\"tone === 'destructive'\"\n [class.pw-confirm--info]=\"tone === 'info'\"\n [class.pw-confirm--neutral]=\"tone === 'neutral'\">\n <div class=\"pw-confirm__header\">\n <span class=\"pw-confirm__icon\"\n aria-hidden=\"true\">\n <i [class]=\"iconClass\"></i>\n </span>\n <h5 class=\"pw-confirm__title\">\n @if (titleKey) {\n {{ titleKey | transloco: titleParams }}\n } @else {\n {{ titleRaw }}\n }\n </h5>\n <button type=\"button\"\n class=\"btn-close pw-confirm__close\"\n [attr.aria-label]=\"cancelLabelKey | transloco\"\n (click)=\"cancel()\">\n </button>\n </div>\n\n <div class=\"pw-confirm__body\">\n @if (textKey) {\n <p class=\"pw-confirm__message\"\n [innerHTML]=\"textKey | transloco: textParams\"></p>\n } @else {\n <p class=\"pw-confirm__message\"\n [innerHTML]=\"textRaw\"></p>\n }\n </div>\n\n <div class=\"pw-confirm__footer\">\n @if (!config.confirmOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"cancel()\">\n @if (cancelLabel) {\n {{ cancelLabel }}\n } @else {\n {{ cancelLabelKey | transloco }}\n }\n </button>\n }\n <button type=\"button\"\n [class]=\"confirmButtonClass\"\n (click)=\"confirm()\">\n @if (confirmLabel) {\n {{ confirmLabel }}\n } @else {\n {{ confirmLabelKey | transloco }}\n }\n </button>\n </div>\n</div>\n","import { Injectable } from '@angular/core';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ConfirmDialogComponent } from './confirm-dialog.component';\nimport { ConfirmDialogConfig } from './confirm-dialog.types';\n\n/**\n * Convenience overrides for `confirmDelete`. Any field of `ConfirmDialogConfig`\n * may be passed; the defaults are `{ title: 'Delete', text: 'Are you sure you\n * want to delete?', destructive: true }`.\n */\nexport type ConfirmDeleteOptions = Partial<ConfirmDialogConfig>;\n\n@Injectable({ providedIn: 'root' })\nexport class ConfirmDialogService {\n constructor(private readonly modal: NgbModal) {}\n\n open(config: ConfirmDialogConfig = {}): Promise<boolean> {\n const ref = this.modal.open(ConfirmDialogComponent, {\n centered: true,\n size: 'md',\n windowClass: 'pw-confirm-modal',\n backdrop: 'static',\n keyboard: true\n });\n (ref.componentInstance as ConfirmDialogComponent).config = config;\n return ref.result.then(\n (value: boolean) => value === true,\n () => false\n );\n }\n\n /**\n * Opens a generic destructive \"Delete — Are you sure you want to delete?\"\n * confirmation dialog. Pass overrides for any field (e.g. `text` with a\n * bold entity name, or `textKey` for an i18n key).\n */\n confirmDelete(overrides: ConfirmDeleteOptions = {}): Promise<boolean> {\n return this.open({\n title: 'Delete',\n text: 'Are you sure you want to delete?',\n destructive: true,\n ...overrides\n });\n }\n}\n","import {\n KNOWLEDGE_EXTENSIONS,\n KNOWLEDGE_MAX_BYTES,\n KnowledgeFile\n} from '@posiwise/common-services';\n\n/** `docmost/Onboarding/a.md` → `docmost/Onboarding`; a top-level file → ''. */\nexport function folderOf(file: KnowledgeFile): string {\n const slash = file.path.lastIndexOf('/');\n return slash > 0 ? file.path.slice(0, slash) : '';\n}\n\n/** Colour key for the folder badge: `docmost/Onboarding` shares `docmost`'s tint. */\nexport function topFolderOf(file: KnowledgeFile): string {\n return folderOf(file).split('/')[0];\n}\n\nexport function formatSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\n/**\n * One distinct soft tint per top-level folder, from core-styles' 24-hue ramp\n * (`.badge.bg-cyan-1` … `-24`). Folders are sorted so the same set always gets\n * the same colours, and successive folders step 7 places round the ramp (105°;\n * 7 is coprime with 24, so all 24 hues are used before any repeats).\n * `appDynamicBadge`'s 9-bucket hash collided here and kept to a narrow green\n * band, so two folders could not be told apart.\n */\nexport function folderBadgeClasses(files: KnowledgeFile[]): Map<string, string> {\n const folders = [...new Set(files.map(topFolderOf).filter(Boolean))].sort((a, b) =>\n a.localeCompare(b)\n );\n return new Map(folders.map((folder, i) => [folder, `bg-cyan-${((i * 7) % 24) + 1}`]));\n}\n\n/** i18n key for why `file` can't be uploaded, or null. brain-api re-checks all of it. */\nexport function uploadProblem(file: File): string | null {\n const dot = file.name.lastIndexOf('.');\n const ext = dot >= 0 ? file.name.slice(dot).toLowerCase() : '';\n if (!KNOWLEDGE_EXTENSIONS.includes(ext)) return 'AiKnowledge.UnsupportedType';\n if (file.size === 0) return 'AiKnowledge.EmptyFile';\n if (file.size > KNOWLEDGE_MAX_BYTES) return 'AiKnowledge.TooLarge';\n return null;\n}\n\n/**\n * Footer counts. This table pages and searches in the browser, so unlike a lazy\n * table `dt.value` is every file: count the current page of the current search,\n * or the footer reads \"Showing 60 of 60\" on a 50-row page.\n */\nexport function matchingCount(\n filtered: unknown[] | null | undefined,\n files: KnowledgeFile[]\n): number {\n return (filtered ?? files).length;\n}\n\nexport function shownOnPage(first: number, pageSize: number, matching: number): number {\n return Math.max(0, Math.min(pageSize, matching - first));\n}\n\n/** Hands a downloaded file to the browser under its own name. */\nexport function saveBlob(blob: Blob, name: string): void {\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = name;\n link.click();\n URL.revokeObjectURL(url);\n}\n","import { AfterContentInit, Component, ContentChild, Input } from '@angular/core';\n\n@Component({\n selector: 'pw-no-data',\n template: `\n <div class=\"no-data\" [ngClass]=\"{ 'has-content': !this.isContentEmpty }\">\n @if (withImage) {\n <i class=\"pi pi-inbox no-data-icon\" aria-hidden=\"true\"></i>\n }\n <span\n class=\"h5 message\"\n [ngClass]=\"{\n 'mt-2': description || !this.isContentEmpty,\n 'my-3': !description && this.isContentEmpty\n }\"\n >\n {{ message || 'Nothing found' }}\n </span>\n @if (description) {\n <span class=\"pb-4\">{{ description }}</span>\n }\n <ng-content></ng-content>\n </div>\n `,\n styleUrls: ['./no-data.component.scss'],\n standalone: false\n})\nexport class NoDataComponent implements AfterContentInit {\n @ContentChild('content', { static: false }) content: { nativeElement: { innerHTML: string } };\n @Input() message: string | null = null;\n @Input() description: string | null = null;\n @Input() withImage = false;\n\n isContentEmpty = false;\n\n ngAfterContentInit() {\n this.isContentEmpty = !this.content?.nativeElement.innerHTML.trim();\n }\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * Shared table-footer \"Showing X of Y items\" summary.\n *\n * Replaces the hand-rolled `<span class=\"total-records-count\">{{ 'Label.RecordsSummary' | transloco: {…} }}</span>`\n * that was previously copy-pasted into every list across main-frontend and the\n * spinout frontends. The `total-records-count` class is owned globally by\n * `@posiwise/core-styles`, so it is applied to the host here and renders\n * identically wherever core-styles is loaded.\n *\n * Usage:\n * <pw-records-summary [showing]=\"dt?.value?.length ?? 0\" [total]=\"totalRecords\" />\n */\n@Component({\n selector: 'pw-records-summary',\n template: `{{\n 'Label.RecordsSummary' | transloco: { showing: showing ?? 0, total: total ?? 0 }\n }}`,\n host: { class: 'total-records-count' },\n standalone: false\n})\nexport class RecordsSummaryComponent {\n /** Number of rows currently rendered (e.g. `dt?.value?.length`). */\n @Input() showing: number | null = 0;\n /** Total number of records across all pages. */\n @Input() total: number | null = 0;\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnChanges,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\n\nimport {\n CustomToastService,\n KNOWLEDGE_EXTENSIONS,\n KnowledgeFile,\n KnowledgeFilesService,\n KnowledgeScope\n} from '@posiwise/common-services';\nimport { PAGE_SIZE } from '@posiwise/common-utilities';\n\nimport { Table } from 'primeng/table';\nimport { finalize } from 'rxjs/operators';\n\nimport { TranslocoService } from '@jsverse/transloco';\n\nimport { ConfirmDialogService } from '../confirm-dialog/confirm-dialog.service';\n\nimport {\n folderBadgeClasses,\n folderOf,\n formatSize,\n matchingCount,\n saveBlob,\n shownOnPage,\n topFolderOf,\n uploadProblem\n} from './ai-knowledge.helpers';\n\n/**\n * Documents the Brain reads for one subscription — the tenant's folder\n * (`scope=\"subscription\"`, admins) or the caller's own (`scope=\"personal\"`).\n * brain-api validates every upload; the checks here only spare a round trip.\n */\n@Component({\n selector: 'pw-ai-knowledge',\n templateUrl: './ai-knowledge.component.html',\n styleUrls: ['./ai-knowledge.component.scss'],\n standalone: false\n})\nexport class AiKnowledgeComponent implements OnChanges {\n @Input({ required: true }) scope: KnowledgeScope = 'subscription';\n @Input() subscriptionId: number | null = null;\n @Input() subscriptionName = '';\n /** \"Use my data\" off: no uploads and the Brain ignores these files; they can still be removed. */\n @Input() useOwnData = true;\n\n @ViewChild('fileInput') fileInput: ElementRef<HTMLInputElement>;\n\n readonly accept = KNOWLEDGE_EXTENSIONS.join(',');\n readonly pageSize = PAGE_SIZE;\n files: KnowledgeFile[] = [];\n searchText = '';\n /** More files exist than one load fetches (see `KnowledgeFilesService.listAllFiles`). */\n truncated = false;\n loading = false;\n loadFailed = false;\n /** brain-api's own reason when storage isn't set up (`storage_unavailable`) — \"try again\" won't help. */\n unavailableReason: string | null = null;\n uploading = false;\n private folderClasses = new Map<string, string>();\n\n constructor(\n private readonly knowledge: KnowledgeFilesService,\n private readonly confirmDialog: ConfirmDialogService,\n private readonly toast: CustomToastService,\n private readonly translation: TranslocoService,\n private readonly cdr: ChangeDetectorRef\n ) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if ((changes['subscriptionId'] || changes['scope']) && this.subscriptionId) {\n this.load();\n }\n }\n\n load(): void {\n this.loading = true;\n this.loadFailed = false;\n this.unavailableReason = null;\n this.knowledge\n .listAllFiles(this.subscriptionId, this.scope)\n .pipe(finalize(() => this.done(() => (this.loading = false))))\n .subscribe({\n next: ({ files, truncated }) => {\n this.files = files;\n this.truncated = truncated;\n this.recolourFolders();\n },\n // A failed list is not an empty folder — never show \"No documents yet\".\n error: (error: HttpErrorResponse) => {\n this.files = [];\n this.loadFailed = true;\n this.unavailableReason =\n error?.error?.status_code === 'storage_unavailable'\n ? (error.error?.message ?? null)\n : null;\n }\n });\n }\n\n chooseFile(): void {\n this.fileInput?.nativeElement.click();\n }\n\n onFileSelected(event: Event): void {\n const input = event.target as HTMLInputElement;\n const file = input.files?.[0];\n input.value = '';\n if (!file) return;\n\n const problem = uploadProblem(file);\n if (problem) {\n this.toast.error(this.translation.translate(problem));\n return;\n }\n\n this.uploading = true;\n this.knowledge\n .uploadFile(this.subscriptionId, this.scope, file)\n .pipe(finalize(() => this.done(() => (this.uploading = false))))\n .subscribe(added => {\n this.files = [added, ...this.files.filter(f => f.path !== added.path)];\n this.recolourFolders();\n this.toast.success(\n this.translation.translate('AiKnowledge.Uploaded', { name: added.name })\n );\n });\n }\n\n download(file: KnowledgeFile): void {\n this.knowledge\n .downloadFile(this.subscriptionId, this.scope, file.path)\n .subscribe(blob => saveBlob(blob, file.name));\n }\n\n remove(file: KnowledgeFile): void {\n this.confirmDialog\n .confirmDelete({\n textKey: 'AiKnowledge.ConfirmDelete',\n textParams: { name: file.name }\n })\n .then(ok => {\n if (!ok) return;\n this.knowledge\n .deleteFile(this.subscriptionId, this.scope, file.path)\n .subscribe(() => {\n this.files = this.files.filter(f => f.path !== file.path);\n this.recolourFolders();\n this.toast.success(\n this.translation.translate('AiKnowledge.Deleted', { name: file.name })\n );\n this.cdr.markForCheck();\n });\n });\n }\n\n /** Personal files always sit at the top of the member's own folder. */\n get showFolder(): boolean {\n return this.scope === 'subscription';\n }\n\n folderOf = folderOf;\n sizeOf = formatSize;\n\n /** First row of the current page; PrimeNG returns to page 1 on a search. */\n pageFirst = 0;\n\n matchingCount = (dt: Table): number => matchingCount(dt.filteredValue, this.files);\n shownOnPage = (dt: Table): number =>\n shownOnPage(this.pageFirst, this.pageSize, this.matchingCount(dt));\n\n folderBadgeClass(file: KnowledgeFile): string {\n return this.folderClasses.get(topFolderOf(file)) ?? 'bg-cyan';\n }\n\n private recolourFolders(): void {\n this.folderClasses = folderBadgeClasses(this.files);\n }\n\n private done(reset: () => void): void {\n reset();\n this.cdr.markForCheck();\n }\n}\n","<section class=\"ai-knowledge\">\n <div class=\"title\">\n <h2>{{ (scope === 'personal' ? 'AiKnowledge.PersonalTitle' : 'AiKnowledge.Title') | transloco: { name: subscriptionName } }}</h2>\n </div>\n <p>{{ (scope === 'personal' ? 'AiKnowledge.PersonalIntro' : 'AiKnowledge.Intro') | transloco: { name: subscriptionName } }}</p>\n\n @if (!useOwnData) {\n <output class=\"alert alert-warning ai-knowledge-off\">\n <i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i>\n <span>\n {{ (scope === 'personal' ? 'AiKnowledge.PersonalUseOwnDataOff' : 'AiKnowledge.UseOwnDataOff') | transloco: { name: subscriptionName } }}\n @if (scope === 'subscription' && subscriptionId) {\n <a [routerLink]=\"['/account/subscriptions', subscriptionId]\">{{ 'AiKnowledge.OpenSubscriptionSettings' | transloco }}</a>\n }\n </span>\n </output>\n }\n\n @if (useOwnData) {\n <div class=\"ai-knowledge-toolbar\">\n <span class=\"ai-knowledge-hint\">{{ 'AiKnowledge.Accepted' | transloco }}</span>\n <input #fileInput type=\"file\" class=\"d-none\" id=\"ai-knowledge-file-{{ scope }}\"\n [accept]=\"accept\" (change)=\"onFileSelected($event)\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"uploading || !subscriptionId\" (click)=\"chooseFile()\">\n <i class=\"fa\" [class.fa-upload]=\"!uploading\" [class.fa-spinner]=\"uploading\" [class.fa-spin]=\"uploading\"\n aria-hidden=\"true\"></i>\n {{ (uploading ? 'AiKnowledge.Uploading' : 'AiKnowledge.UploadFile') | transloco }}\n </button>\n </div>\n }\n\n @if (loading) {\n <pw-skeleton-table [rows]=\"8\" [columns]=\"showFolder ? 5 : 4\" [showCaption]=\"true\" />\n }\n\n @if (!loading) {\n @if (files.length) {\n <div class=\"primeng-datatable-container actions-collapsed table-responsive\">\n <p-table #dt [value]=\"files\" dataKey=\"path\"\n [paginator]=\"files.length !== 0\"\n [rows]=\"pageSize\"\n [globalFilterFields]=\"['name', 'path']\"\n (onPage)=\"pageFirst = $event.first\"\n (onFilter)=\"pageFirst = 0\"\n stateKey=\"pw-table.ai-knowledge\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #caption>\n <div class=\"text-end\">\n <label for=\"ai-knowledge-search-{{ scope }}\" class=\"visually-hidden\">{{ 'AiKnowledge.SearchPlaceholder' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><i class=\"fa fa-search\" aria-hidden=\"true\"></i></p-inputicon>\n <input type=\"text\"\n id=\"ai-knowledge-search-{{ scope }}\"\n name=\"ai-knowledge-search-{{ scope }}\"\n [(ngModel)]=\"searchText\"\n pInputText\n [placeholder]=\"'AiKnowledge.SearchPlaceholder' | transloco\"\n (input)=\"dt.filterGlobal(searchText, 'contains')\"\n [attr.aria-label]=\"'AiKnowledge.SearchPlaceholder' | transloco\" />\n </p-iconfield>\n </div>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"showFolder ? 5 : 4\">\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\"\n [description]=\"'Search.NoDataDescription' | transloco\"></pw-no-data>\n </td>\n </tr>\n </ng-template>\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"col\">{{ 'Label.Name' | transloco }}</th>\n @if (showFolder) {\n <th pResizableColumn scope=\"col\">{{ 'AiKnowledge.Folder' | transloco }}</th>\n }\n <th pResizableColumn scope=\"col\">{{ 'AiKnowledge.Size' | transloco }}</th>\n <th pResizableColumn scope=\"col\">{{ 'AiKnowledge.Modified' | transloco }}</th>\n <th class=\"actions-list-two\" scope=\"col\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n <ng-template #body let-file>\n <tr>\n <td data-head=\"Name\">\n <a href=\"\" [pTooltip]=\"'AiKnowledge.DownloadFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n (click)=\"$event.preventDefault(); download(file)\">{{ file.name }}</a>\n </td>\n @if (showFolder) {\n <td data-head=\"Folder\">\n @if (folderOf(file); as folder) {\n <span class=\"badge\" [ngClass]=\"folderBadgeClass(file)\">{{ folder }}</span>\n }\n </td>\n }\n <td data-head=\"Size\">{{ sizeOf(file.size) }}</td>\n <td data-head=\"Modified\">{{ file.last_modified | dateFormat: 'datetime' }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline list-action\">\n <li [pTooltip]=\"'AiKnowledge.DownloadFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'AiKnowledge.DownloadFile' | transloco\"\n (click)=\"download(file)\" (keydown.enter)=\"download(file)\">\n <i class=\"fa fa-download edit-icon\" aria-hidden=\"true\"></i>\n </li>\n <li [pTooltip]=\"'AiKnowledge.DeleteFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'AiKnowledge.DeleteFile' | transloco\"\n (click)=\"remove(file)\" (keydown.enter)=\"remove(file)\">\n <i class=\"fa fa-trash delete-icon\" aria-hidden=\"true\"></i>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n <pw-records-summary [showing]=\"shownOnPage(dt)\" [total]=\"matchingCount(dt)\" />\n </div>\n @if (truncated) {\n <p class=\"ai-knowledge-hint mt-2\">{{ 'AiKnowledge.Truncated' | transloco: { count: files.length } }}</p>\n }\n } @else if (loadFailed) {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.LoadFailed' | transloco\"\n [description]=\"unavailableReason || ('AiKnowledge.LoadFailedDescription' | transloco)\">\n <div #content>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary\" (click)=\"load()\">\n <i class=\"fa fa-rotate-right\" aria-hidden=\"true\"></i>\n {{ 'AiKnowledge.TryAgain' | transloco }}\n </button>\n </div>\n </pw-no-data>\n } @else if (useOwnData) {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NoFiles' | transloco\"\n [description]=\"'AiKnowledge.NoFilesDescription' | transloco\"></pw-no-data>\n }\n }\n</section>\n","import { ChangeDetectorRef, Component, Injector, OnInit } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AuthService } from '@posiwise/common-services';\n\n@Component({\n selector: 'pw-authenticator',\n templateUrl: './authenticator.component.html',\n\n standalone: false\n})\nexport class AuthenticatorComponent extends AppBaseComponent implements OnInit {\n token = '';\n\n constructor(\n private readonly authService: AuthService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n ngOnInit() {\n this.route.queryParams.subscribe(params => {\n if (!params['token']) {\n window.location.href = '/login';\n } else {\n this.authService.storePlatform('app').subscribe(() => {\n this.authService.setHeaderKey();\n this.authService.storeToken(params['token']).subscribe({\n next: () => {\n this.router.navigate(['home']);\n this.cdr.markForCheck();\n },\n error: () => {\n window.location.href = '/login';\n this.cdr.markForCheck();\n }\n });\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n}\n","<!--Auth Page Starts-->\n<section>\n <div class=\"container-fluid\">\n <div class=\"row full-height-vh\">\n <div class=\"col-12 d-flex align-items-center justify-content-center\">\n <h2>Logging...</h2>\n </div>\n </div>\n </div>\n</section>\n<!--Auth Page Ends-->\n","/**\n * White-label brand resolution for the Brain panel header.\n *\n * The domain's company name (app config `company.name`) brands the panel\n * title — falling back to \"PosiWise\" before config resolves or when unset.\n * Mirrors the pw-dynamic-page `brandName` pattern. Kept as a pure function\n * (no Angular deps) so it is unit-testable in isolation and so the host\n * component stays within the C1 size budget.\n */\nexport const DEFAULT_BRAND = 'PosiWise';\n\nexport function resolveBrandName(config: unknown): string {\n const name = (config as { company?: { name?: string } })?.company?.name;\n return name && name.trim() ? name : DEFAULT_BRAND;\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * Identity of the Conversational UI Builder dynamic page the user is\n * currently viewing (#933 — page-aware Brain). The dynamic-page host sets\n * this on load and clears it on destroy; the PosiWise Brain chat widget\n * reads it so Bedrock knows which page \"this page\" / \"the current page\"\n * refers to and can target `ui_update_layout` with the exact page_key +\n * subscription_id instead of guessing the landing-page tools.\n *\n * `null` whenever no dynamic page is mounted.\n */\nexport interface DynamicPageContext {\n pageKey: string;\n subscriptionId: number;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DynamicPageContextService {\n private _current: DynamicPageContext | null = null;\n\n set(ctx: DynamicPageContext): void {\n this._current = ctx;\n }\n\n clear(): void {\n this._current = null;\n }\n\n get current(): DynamicPageContext | null {\n return this._current;\n }\n}\n","import { MCPUploadCapability } from '@posiwise/common-services';\n\nimport { ChatAttachment } from './pw-brain-chat.types';\n\n/**\n * File-attachment rules for the chat composer. Split out of the component so\n * the validation is unit-testable without a TestBed, matching the existing\n * `pw-brain-chat-*.helpers.ts` convention.\n *\n * The limits come from the capability the owning tool advertises, which is a\n * projection of that service's upload registry. Client-side checks are a\n * courtesy so the user gets an instant answer — the server re-checks every one\n * of them and remains the authority.\n */\nexport function fileExtension(name: string): string {\n const dot = name.lastIndexOf('.');\n return dot === -1 ? '' : name.slice(dot + 1).toLowerCase();\n}\n\n/** @returns a human-readable reason to reject, or null when the file is fine. */\nexport function validateChatFile(file: File, capability: MCPUploadCapability): string | null {\n if (file.size === 0) {\n return 'That file is empty.';\n }\n if (file.size > capability.max_bytes) {\n return `That file is ${formatFileSize(file.size)} — the limit is ${formatFileSize(\n capability.max_bytes\n )}.`;\n }\n return null;\n}\n\n/** Every extension any available capability accepts, de-duplicated. */\nexport function acceptedExtensions(capabilities: MCPUploadCapability[]): string[] {\n return [...new Set(capabilities.flatMap(c => c.allowed_extensions))];\n}\n\nexport function formatFileSize(bytes: number): string {\n if (bytes < 1024) {\n return `${bytes} B`;\n }\n const kb = bytes / 1024;\n if (kb < 1024) {\n return `${Math.round(kb)} KB`;\n }\n const mb = kb / 1024;\n // One decimal below 10 MB, whole numbers above — \"1.4 MB\" is useful,\n // \"23.7 MB\" is noise at that scale.\n return mb < 10 ? `${mb.toFixed(1)} MB` : `${Math.round(mb)} MB`;\n}\n\n/** Pulls the single file out of a drop, ignoring directories and extra files. */\nexport function fileFromDrop(event: DragEvent): File | null {\n const items = event.dataTransfer?.files;\n return items && items.length > 0 ? items[0] : null;\n}\n\n/** True when the drag carries files (not text, a link, or an in-page element). */\nexport function dragCarriesFile(event: DragEvent): boolean {\n const types = event.dataTransfer?.types;\n return !!types && Array.from(types).includes('Files');\n}\n\n/**\n * What the attachment contributes to `workspace_context`.\n *\n * Only the KEY and the filename travel — never the bytes, and never anything\n * read out of the file. The planner decides which tool to call from this plus\n * the user's sentence; the server re-derives everything else from the key.\n *\n * The `note` mirrors the `active_page` convention in\n * `pw-brain-chat-context.helpers.ts`: a short instruction telling the model\n * what the context means and which tool consumes it.\n */\nexport function attachmentContext(\n attachment: ChatAttachment | null\n): Record<string, unknown> | null {\n if (attachment?.status !== 'ready' || !attachment?.key) {\n return null;\n }\n return {\n attachment: {\n filename: attachment.name,\n staged_key: attachment.key,\n size_bytes: attachment.size,\n // Named so the planner doesn't have to infer which tool consumes\n // the file — the capability already told us.\n tool: attachment.tool,\n note:\n 'The user attached this file to the chat. It is already uploaded. ' +\n `To act on it, call ${attachment.tool} with this staged_key. Ask ` +\n 'the user for any details that tool needs and they have not said — ' +\n 'never invent them.'\n }\n };\n}\n","import { MCPUploadCapability } from '@posiwise/common-services';\n\nimport { ChatAttachment } from './pw-brain-chat.types';\nimport {\n acceptedExtensions,\n fileExtension,\n formatFileSize\n} from './pw-brain-chat-attachment.helpers';\n\n/**\n * How the attachment presents itself. Pure functions of (capabilities,\n * attachment) so the copy is unit-testable without constructing a controller,\n * and so the controller stays inside the 200-line cap.\n */\n\nconst IMAGE_EXTENSIONS = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg']);\nconst SHEET_EXTENSIONS = new Set(['csv', 'xls', 'xlsx']);\n\n/**\n * Named after the KIND of file accepted, not the tool.\n *\n * A descriptor `title` is an action (\"Set Your Profile Picture\"), so framing\n * it as \"Drop your {title}\" produces \"Drop your set your profile picture\".\n * The extension set is the honest signal for what to call the thing, and it\n * degrades to a generic label whenever the types are mixed.\n */\nexport function dropzoneLabel(capabilities: MCPUploadCapability[]): string {\n const extensions = acceptedExtensions(capabilities);\n if (extensions.length === 0) {\n return 'Drop a file';\n }\n if (extensions.every(e => IMAGE_EXTENSIONS.has(e))) {\n return 'Drop an image';\n }\n if (extensions.every(e => SHEET_EXTENSIONS.has(e))) {\n return 'Drop a spreadsheet';\n }\n return 'Drop a file';\n}\n\nexport function dropzoneHint(capabilities: MCPUploadCapability[]): string {\n const exts = acceptedExtensions(capabilities)\n .map(e => e.toUpperCase())\n .join(', ');\n const cap = Math.max(0, ...capabilities.map(c => c.max_bytes));\n return `${exts} · up to ${formatFileSize(cap)}`;\n}\n\nexport function acceptAttribute(capabilities: MCPUploadCapability[]): string {\n return acceptedExtensions(capabilities)\n .map(e => `.${e}`)\n .join(',');\n}\n\nexport function attachmentMeta(attachment: ChatAttachment | null): string {\n if (!attachment) {\n return '';\n }\n if (attachment.status === 'error') {\n return attachment.error ?? 'Upload failed.';\n }\n const size = formatFileSize(attachment.size);\n if (attachment.status === 'choosing') {\n return `Not uploaded yet · ${size}`;\n }\n // Name the action the file is for, so a wrong pick is visible before sending.\n // No \"Ready\" once the chip sits INSIDE the composer: its position already\n // says it travels with the message, and a status word there read as an\n // instruction people then went looking to carry out.\n const action = attachment.title ? `${attachment.title} · ` : '';\n return attachment.status === 'uploading'\n ? `Uploading… ${attachment.percent}% · ${action}${size}`\n : `${action}${size}`;\n}\n\n/** Fontawesome glyph matching the file type (AI62: FA only). */\nexport function attachmentIcon(attachment: ChatAttachment | null): string {\n if (!attachment) {\n return 'fa-file';\n }\n if (attachment.status === 'error') {\n return 'fa-triangle-exclamation';\n }\n const ext = fileExtension(attachment.name);\n if (ext === 'csv') return 'fa-file-csv';\n if (['xls', 'xlsx'].includes(ext)) return 'fa-file-excel';\n if (['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg'].includes(ext)) return 'fa-file-image';\n return 'fa-file';\n}\n\n/** Names what WAS dropped and what would be accepted, not just \"invalid\". */\nexport function unsupportedFileMessage(file: File, capabilities: MCPUploadCapability[]): string {\n const ext = fileExtension(file.name);\n const accepted = acceptedExtensions(capabilities).join(', ');\n return ext\n ? `.${ext} files aren't accepted here — try ${accepted}.`\n : `That file type isn't accepted here — try ${accepted}.`;\n}\n","import { MCPUploadCapability } from '@posiwise/common-services';\n\nimport { fileExtension, validateChatFile } from './pw-brain-chat-attachment.helpers';\nimport { unsupportedFileMessage } from './pw-brain-chat-attachment.view';\n\n/**\n * Which upload tool gets a dropped file.\n *\n * The extension only NARROWS the candidates — it never decides between two.\n * A PNG might be a profile picture or a receipt; picking the first advertised\n * tool silently sent a user's screenshot to `avatar_upload` and replaced their\n * profile picture. So when more than one tool fits, the user chooses, and the\n * file is not uploaded anywhere until they do.\n */\nexport type UploadRoute =\n | { kind: 'rejected'; message: string }\n | { kind: 'single'; capability: MCPUploadCapability }\n | { kind: 'choose'; options: MCPUploadCapability[] };\n\nexport function routeUpload(file: File, capabilities: MCPUploadCapability[]): UploadRoute {\n const ext = fileExtension(file.name);\n const matching = capabilities.filter(c => c.allowed_extensions.includes(ext));\n if (!matching.length) {\n return { kind: 'rejected', message: unsupportedFileMessage(file, capabilities) };\n }\n // A tool whose size cap the file breaks is not a real option.\n const fitting = matching.filter(c => !validateChatFile(file, c));\n if (!fitting.length) {\n return { kind: 'rejected', message: validateChatFile(file, matching[0]) as string };\n }\n return fitting.length === 1\n ? { kind: 'single', capability: fitting[0] }\n : { kind: 'choose', options: fitting };\n}\n\n/** Button text: the tool's advertised title is an action (\"Set Your Profile Picture\"). */\nexport function choiceLabel(capability: MCPUploadCapability): string {\n return capability.title?.trim() || capability.tool;\n}\n\n/** The file held back while the user picks, and what they may pick from. */\nexport class BrainChatUploadChoice {\n private file: File | null = null;\n options: MCPUploadCapability[] = [];\n\n offer(file: File, options: MCPUploadCapability[]): void {\n this.file = file;\n this.options = options;\n }\n\n /** The held file, if `capability` is one of the offered options. */\n take(capability: MCPUploadCapability): File | null {\n const file = this.options.includes(capability) ? this.file : null;\n if (file) {\n this.clear();\n }\n return file;\n }\n\n clear(): void {\n this.file = null;\n this.options = [];\n }\n}\n","import { dragCarriesFile, fileFromDrop } from './pw-brain-chat-attachment.helpers';\n\n/**\n * Drag state for the panel-wide drop target.\n *\n * Separate from the attachment controller because it is purely about pointer\n * events — no upload, no capabilities — and because keeping it here leaves the\n * controller inside the 200-line cap.\n */\nexport class BrainChatDragTracker {\n active = false;\n\n constructor(\n private readonly enabled: () => boolean,\n private readonly onChange: () => void\n ) {}\n\n enter(event: DragEvent): void {\n if (!this.enabled() || !dragCarriesFile(event)) {\n return;\n }\n event.preventDefault();\n this.active = true;\n this.onChange();\n }\n\n /** Must preventDefault or the browser navigates away to the file. */\n over(event: DragEvent): void {\n if (!this.enabled() || !dragCarriesFile(event)) {\n return;\n }\n event.preventDefault();\n }\n\n leave(event: DragEvent): void {\n // dragleave fires for every child crossed, so only the pointer\n // genuinely exiting the panel should clear the overlay.\n if (\n event.relatedTarget &&\n (event.currentTarget as Node).contains(event.relatedTarget as Node)\n ) {\n return;\n }\n this.active = false;\n this.onChange();\n }\n\n /** @returns the dropped file, or null when the drop carried none. */\n drop(event: DragEvent): File | null {\n if (!this.enabled()) {\n return null;\n }\n event.preventDefault();\n this.active = false;\n return fileFromDrop(event);\n }\n\n reset(): void {\n this.active = false;\n }\n}\n","import {\n BaseHttpService,\n DirectUploadService,\n MCPUploadCapability\n} from '@posiwise/common-services';\n\nimport { Observable, Subject, takeUntil } from 'rxjs';\n\nimport { ChatAttachment } from './pw-brain-chat.types';\n\n/**\n * The two network concerns of an attachment — discovering what may be\n * attached, and sending the bytes — kept out of the controller so it stays\n * inside the 200-line cap and remains readable as pure state.\n */\n\n/**\n * Discovery is best-effort: a failure yields an EMPTY capability list, so the\n * panel shows no upload affordance rather than a broken one, and the chat\n * still works. Only capabilities whose service the host app can actually reach\n * are kept — one we have no client for would advertise an upload with nowhere\n * to go.\n */\nexport function discoverCapabilities(opts: {\n source: Observable<{ uploads: MCPUploadCapability[] }>;\n destroy$: Subject<void>;\n apis: Record<string, BaseHttpService>;\n onResolved: (capabilities: MCPUploadCapability[]) => void;\n}): void {\n opts.source.pipe(takeUntil(opts.destroy$)).subscribe({\n next: response =>\n opts.onResolved((response.uploads ?? []).filter(c => !!opts.apis[c.service])),\n error: () => opts.onResolved([])\n });\n}\n\n/**\n * Sends the bytes straight to the owning service — never through brain-api,\n * which advertises the capability but must not carry files. Size-routed by\n * DirectUploadService: small files through the API, large ones direct to S3.\n */\nexport function sendUpload(opts: {\n uploads: DirectUploadService;\n api: BaseHttpService;\n capability: MCPUploadCapability;\n file: File;\n subscriptionId: number;\n onProgress: (percent: number) => void;\n onStaged: (key: string) => void;\n onError: () => void;\n}): void {\n opts.uploads\n .uploadBySize(opts.api, {\n purpose: opts.capability.purpose,\n file: opts.file,\n subscriptionId: opts.subscriptionId\n })\n .subscribe({\n next: event =>\n event.kind === 'progress'\n ? opts.onProgress(event.percent)\n : opts.onStaged(event.key),\n error: () => opts.onError()\n });\n}\n\n/**\n * Upload ``file`` for ``capability`` and reflect progress on the attachment\n * ``current()`` returns. Guarded on every callback: the chip may have been\n * removed mid-flight.\n */\nexport function stageInto(p: {\n uploads: DirectUploadService | null;\n api: BaseHttpService | undefined;\n subscriptionId: number | null;\n capability: MCPUploadCapability;\n file: File;\n current: () => ChatAttachment | null;\n changed: () => void;\n}): void {\n const update = (patch: Partial<ChatAttachment>) => {\n const attachment = p.current();\n if (attachment) {\n Object.assign(attachment, patch);\n p.changed();\n }\n };\n if (!p.uploads || !p.api || p.subscriptionId == null) {\n update({\n status: 'error',\n error: 'We could not work out which subscription to upload this to.'\n });\n return;\n }\n sendUpload({\n uploads: p.uploads,\n api: p.api,\n capability: p.capability,\n file: p.file,\n subscriptionId: p.subscriptionId,\n onProgress: percent => update({ percent }),\n onStaged: key => update({ percent: 100, status: 'ready', key }),\n onError: () =>\n update({\n status: 'error',\n error: 'That upload did not complete. Try attaching it again.'\n })\n });\n}\n","import {\n BaseHttpService,\n DirectUploadService,\n MCPUploadCapability\n} from '@posiwise/common-services';\n\nimport { Observable, Subject } from 'rxjs';\n\nimport { ChatAttachment } from './pw-brain-chat.types';\nimport { BrainChatUploadChoice, choiceLabel, routeUpload } from './pw-brain-chat-attachment.choice';\nimport { BrainChatDragTracker } from './pw-brain-chat-attachment.drag';\nimport { attachmentContext } from './pw-brain-chat-attachment.helpers';\nimport { discoverCapabilities, stageInto } from './pw-brain-chat-attachment.transfer';\nimport {\n acceptAttribute,\n attachmentIcon,\n attachmentMeta,\n dropzoneHint,\n dropzoneLabel\n} from './pw-brain-chat-attachment.view';\n\n/**\n * Owns the composer's file attachment: drag state, the upload, and the single\n * staged file. Split out of the component the same way BrainChatDictation and\n * BrainChatVoiceChat are, so the panel stays composable and this is testable\n * without a TestBed.\n *\n * What it may accept is DISCOVERED, not configured: brain-api reports the\n * upload-capable tools this caller can reach, each carrying its own purpose,\n * extensions and size cap. So a product gains a drop affordance by shipping a\n * tool that advertises one — with no change here and none in the host app\n * beyond naming its API.\n */\nexport class BrainChatAttachment {\n current: ChatAttachment | null = null;\n\n private readonly drag = new BrainChatDragTracker(\n () => this.enabled,\n () => this.onChange()\n );\n\n private capabilities: MCPUploadCapability[] = [];\n private readonly choice = new BrainChatUploadChoice();\n\n constructor(\n private readonly uploads: DirectUploadService | null,\n private readonly apis: Record<string, BaseHttpService> | null,\n private readonly subscriptionId: () => number | null,\n private readonly onChange: () => void\n ) {}\n\n discover(\n source: Observable<{ uploads: MCPUploadCapability[] }>,\n destroy$: Subject<void>\n ): void {\n if (!this.uploads || !this.apis) {\n return;\n }\n discoverCapabilities({\n source,\n destroy$,\n apis: this.apis,\n onResolved: capabilities => {\n this.capabilities = capabilities;\n this.onChange();\n }\n });\n }\n\n get enabled(): boolean {\n return this.capabilities.length > 0;\n }\n\n get busy(): boolean {\n return this.current?.status === 'uploading';\n }\n\n /** Several tools accept the file; nothing is uploaded until one is picked. */\n get choosing(): boolean {\n return this.current?.status === 'choosing';\n }\n\n get choices(): MCPUploadCapability[] {\n return this.choice.options;\n }\n\n choiceLabel(capability: MCPUploadCapability): string {\n return choiceLabel(capability);\n }\n\n get ready(): boolean {\n return this.current?.status === 'ready';\n }\n\n get context(): Record<string, unknown> | null {\n return attachmentContext(this.current);\n }\n\n get label(): string {\n return dropzoneLabel(this.capabilities);\n }\n\n get hint(): string {\n return dropzoneHint(this.capabilities);\n }\n\n get acceptAttr(): string {\n return acceptAttribute(this.capabilities);\n }\n\n get dragActive(): boolean {\n return this.drag.active;\n }\n\n dragEnter(event: DragEvent): void {\n this.drag.enter(event);\n }\n\n dragOver(event: DragEvent): void {\n this.drag.over(event);\n }\n\n dragLeave(event: DragEvent): void {\n this.drag.leave(event);\n }\n\n drop(event: DragEvent): void {\n const file = this.drag.drop(event);\n if (file) {\n this.accept(file);\n } else {\n this.onChange();\n }\n }\n\n /** Shared by the drop target and the paperclip file input. */\n accept(file: File): void {\n const route = routeUpload(file, this.capabilities);\n this.choice.clear();\n this.current = { name: file.name, size: file.size, percent: 0, status: 'choosing' };\n if (route.kind === 'rejected') {\n Object.assign(this.current, { status: 'error', error: route.message });\n } else if (route.kind === 'choose') {\n this.choice.offer(file, route.options);\n } else {\n this.upload(file, route.capability);\n }\n this.onChange();\n }\n\n /** The user picked which tool this file is for — only now is it uploaded. */\n choose(capability: MCPUploadCapability): void {\n const file = this.choice.take(capability);\n if (file) {\n this.upload(file, capability);\n this.onChange();\n }\n }\n\n remove(): void {\n this.choice.clear();\n this.current = null;\n this.drag.reset();\n this.onChange();\n }\n\n /** Cleared once a planned call used `sent`; a reply asking for details keeps it. */\n clearIfConsumed(sent: ChatAttachment | null): void {\n if (sent?.status === 'ready' && this.current === sent) {\n this.current = null;\n }\n }\n\n meta(): string {\n return attachmentMeta(this.current);\n }\n\n icon(): string {\n return attachmentIcon(this.current);\n }\n\n private upload(file: File, capability: MCPUploadCapability): void {\n if (this.current) {\n const chosen: Partial<ChatAttachment> = {\n status: 'uploading',\n tool: capability.tool,\n title: choiceLabel(capability)\n };\n Object.assign(this.current, chosen);\n }\n stageInto({\n uploads: this.uploads,\n api: this.apis?.[capability.service],\n subscriptionId: this.subscriptionId(),\n capability,\n file,\n current: () => this.current,\n changed: () => this.onChange()\n });\n }\n}\n","import { MCPExecuteResponse } from '@posiwise/common-services';\n\nimport { ChatMessage } from './pw-brain-chat.types';\n\n/**\n * Builds the assistant bubble that carries a pending-confirmation card\n * from a `needs_confirmation` orchestrator envelope. Extracted from\n * `pw-brain-chat.component.ts` (pure mapping — keeps the component lean\n * under C1 and independently testable). `token` is passed explicitly so\n * the function doesn't depend on the caller's type-narrowing.\n */\nexport function buildConfirmationMessage(response: MCPExecuteResponse, token: string): ChatMessage {\n return {\n role: 'assistant',\n text: response.summary ?? 'Please review and approve this action.',\n pending: {\n confirmation_token: token,\n risk_level: response.risk_level,\n summary: response.summary,\n target_service: response.target_service,\n target_tool: response.target_tool,\n diff: response.diff\n }\n };\n}\n","import { Router } from '@angular/router';\n\nimport { DynamicPageContext } from '../dynamic-page/dynamic-page-context.service';\n\n/**\n * Builds the `workspace_context` blob sent to brain-api on every Brain chat\n * message (#933 — page-aware orchestration). Bedrock reads this verbatim\n * from its system prompt to resolve \"this page\" / \"the current page\" and to\n * pick the right tool with the right arguments instead of guessing.\n *\n * General awareness: route + route_pattern + product + human page label +\n * active subscription are sent on EVERY page. When the user is on a\n * Conversational UI Builder dynamic page, an `active_page` descriptor is added\n * carrying the exact page_key + subscription_id so `ui_update_layout` can\n * target it.\n *\n * `route_pattern` is the instance-id-free join key for page-scoped\n * documentation grounding: the concrete `route` is `/admin/subscriptions/27`,\n * but docs are indexed against the Angular pattern `/admin/subscriptions/:id`.\n * brain-api boosts documentation whose declared `ui_paths` contain this value,\n * so answers about \"this page\" surface the right help.\n */\n\n// Mirrors AppTitleService — the canonical \"label for the current route\" is\n// the chain of `routeConfig.data.title` segments down the active tree.\nexport function pageLabelFromRouter(router: Router): string {\n let route = router.routerState?.root?.firstChild ?? null;\n const parts: string[] = [];\n while (route) {\n const title = route.snapshot?.routeConfig?.data?.['title'];\n if (typeof title === 'string' && title.trim()) {\n parts.push(title.trim());\n }\n route = route.firstChild;\n }\n return parts.join(' | ');\n}\n\n// Reconstructs the matched Angular route pattern by joining each activated\n// route's `routeConfig.path` down the active tree — e.g.\n// `/admin/subscriptions/:id/agent_details/:agentId`. This is the stable join\n// key for page-scoped documentation (the concrete `router.url` carries\n// instance ids that could never match a doc's declared pattern). Pathless /\n// componentless wrapper routes (empty `path`) are skipped. Returns '' when the\n// tree yields no path segments.\nexport function routePatternFromRouter(router: Router): string {\n let route = router.routerState?.root?.firstChild ?? null;\n const segments: string[] = [];\n while (route) {\n const path = route.snapshot?.routeConfig?.path;\n if (typeof path === 'string' && path.length) {\n segments.push(path);\n }\n route = route.firstChild;\n }\n return segments.length ? '/' + segments.join('/') : '';\n}\n\n// `/posiwise/hyperdashboard/conversational-ui-builder` → `hyperdashboard`.\n// Best-effort hint only; null when the URL has no product segment.\nfunction productFromUrl(url: string): string | null {\n const segs = url.split(/[?#]/)[0].split('/').filter(Boolean);\n return segs.length >= 2 ? segs[1] : null;\n}\n\nexport function buildWorkspaceContext(\n router: Router,\n dynamicPage: DynamicPageContext | null,\n subscriptionId: number | null\n): Record<string, unknown> {\n const url = router.url ?? '';\n const label = pageLabelFromRouter(router);\n const routePattern = routePatternFromRouter(router);\n const ctx: Record<string, unknown> = {\n route: url,\n route_pattern: routePattern || null,\n product: productFromUrl(url),\n page_label: label || null,\n subscription_id: subscriptionId\n };\n if (dynamicPage) {\n ctx['active_page'] = {\n kind: 'conversational_ui_builder',\n page_key: dynamicPage.pageKey,\n subscription_id: dynamicPage.subscriptionId,\n note:\n 'The user is viewing this Conversational UI Builder dynamic ' +\n 'page. \"this page\" / \"the current page\" / \"this dashboard\" / ' +\n '\"the demo page\" all refer to it. To change its layout, call ' +\n 'ui_update_layout with this subscription_id and page_key.'\n };\n }\n return ctx;\n}\n","import { BrainVoiceService, VoiceTranscript } from '@posiwise/common-services';\n\nimport { Subscription } from 'rxjs';\n\n/**\n * Drives mic dictation for the Brain chat composer (#22).\n *\n * Toggles recording, folds the partial/final transcripts brain-api relays from\n * Amazon Transcribe into the chat draft — preserving any text the user already\n * typed — and surfaces a friendly status (listening / processing / error) so\n * the user always knows what's happening. Lives outside the component to\n * respect the helper-delegation pattern the chat component already uses\n * (persistence, navigation, diff, etc.) and to keep that component small.\n */\nexport type DictationPhase = 'idle' | 'listening' | 'processing';\n\nconst VOICE_ERROR_MESSAGES: Record<string, string> = {\n mic: 'Microphone access was denied or is unavailable.',\n unauthorized: 'Could not authenticate the voice session.',\n disabled: 'Voice input is not enabled here yet.',\n failed: 'Voice input failed — please try again.'\n};\n\nexport class BrainChatDictation {\n phase: DictationPhase = 'idle';\n error: string | null = null;\n private sub?: Subscription;\n /** Draft text captured at record-start + each finalized phrase, so live\n * partials update without clobbering what the user already typed. */\n private base = '';\n\n constructor(\n private readonly voice: BrainVoiceService | undefined,\n private readonly getDraft: () => string,\n private readonly setDraft: (text: string) => void,\n private readonly changed: () => void\n ) {}\n\n /** Convenience for the template — kept for the pulsing-button class. */\n get isRecording(): boolean {\n return this.phase === 'listening';\n }\n\n /** Status text shown next to the mic; `null` when nothing to say. */\n get statusMessage(): string | null {\n if (this.error) return this.error;\n if (this.phase === 'listening') return 'Listening — speak now';\n if (this.phase === 'processing') return 'Processing your speech…';\n return null;\n }\n\n /** Mic button handler: start if idle, stop if recording. While\n * \"processing\" we ignore clicks until the server's final transcript\n * lands. */\n toggle(loading: boolean): void {\n if (this.phase === 'listening') {\n this.stop();\n } else if (this.phase === 'idle') {\n this.start(loading);\n }\n }\n\n stop(): void {\n if (this.phase !== 'listening') return;\n this.voice?.stop();\n this.phase = 'processing';\n this.changed();\n }\n\n /** Unconditionally cancel recording and clear any error, from ANY phase —\n * the overlay's End/Close (stop() only finalizes from 'listening', so it\n * can't dismiss the 'processing' or 'error' states). */\n dismiss(): void {\n this.sub?.unsubscribe();\n this.sub = undefined;\n this.voice?.stop();\n this.phase = 'idle';\n this.error = null;\n this.changed();\n }\n\n /** Tear down with the host component (called from ngOnDestroy). */\n dispose(): void {\n this.sub?.unsubscribe();\n this.sub = undefined;\n if (this.phase !== 'idle') {\n this.voice?.stop();\n this.phase = 'idle';\n }\n }\n\n private start(loading: boolean): void {\n if (loading || !this.voice) return;\n this.error = null;\n const current = this.getDraft().trimEnd();\n this.base = current ? `${current} ` : '';\n this.phase = 'listening';\n this.changed();\n this.sub = this.voice.start().subscribe({\n next: transcript => this.apply(transcript),\n error: reason => this.fail(reason),\n complete: () => {\n this.phase = 'idle';\n this.setDraft(this.getDraft().trim());\n this.changed();\n }\n });\n }\n\n private apply(transcript: VoiceTranscript): void {\n if (transcript.type === 'final') {\n this.base = `${(this.base + transcript.text).trimEnd()} `;\n this.setDraft(this.base);\n } else {\n this.setDraft(this.base + transcript.text);\n }\n this.changed();\n }\n\n private fail(reason: unknown): void {\n this.phase = 'idle';\n const key = typeof reason === 'string' ? reason : 'failed';\n this.error = VOICE_ERROR_MESSAGES[key] ?? VOICE_ERROR_MESSAGES['failed'];\n this.changed();\n }\n}\n","import { MCPFieldDiff } from '@posiwise/common-services';\n\nexport interface DiffRow {\n field: string;\n before: string;\n after: string;\n}\n\nexport function diffRowsFrom(diff?: MCPFieldDiff | null): DiffRow[] {\n if (!diff) {\n return [];\n }\n return Object.keys(diff).map(field => ({\n field,\n before: formatDiffValue(diff[field].before),\n after: formatDiffValue(diff[field].after)\n }));\n}\n\nfunction formatDiffValue(value: unknown): string {\n if (value === null || value === undefined) {\n return '∅';\n }\n if (typeof value === 'string') {\n return value;\n }\n return JSON.stringify(value);\n}\n","/**\n * Open-redirect and pseudo-scheme mitigations for the navigation\n * fall-through branch in pw-brain-chat. Pure functions, extracted from\n * the component for C1 conformance.\n */\n\nexport function isAllowedExternalNavigationUrl(url: string, currentOrigin: string): boolean {\n if (!(url.startsWith('http://') || url.startsWith('https://'))) {\n return false;\n }\n try {\n return new URL(url).origin === currentOrigin;\n } catch {\n return false;\n }\n}\n\nexport function isSafeAppRelativePath(path: string): boolean {\n if (!path.startsWith('/') || path.startsWith('//')) {\n return false;\n }\n const decoded = decodeURIComponent(path);\n if (decoded.startsWith('//')) {\n // Block percent-encoded protocol-relative paths (e.g. /%2f%2fevil.com).\n return false;\n }\n // NOSONAR typescript:S1523 — these literals are defensive blocklist entries used to reject javascript:/data: pseudo-schemes, not to execute them.\n return (\n !decoded.toLowerCase().includes('javascript:') && !decoded.toLowerCase().includes('data:') // NOSONAR\n );\n}\n","import {\n isAllowedExternalNavigationUrl,\n isSafeAppRelativePath\n} from './pw-brain-chat-url-safety.helpers';\n\nexport type NavigationDecision =\n | { kind: 'external'; url: string }\n | { kind: 'internal'; url: string }\n | { kind: 'rejected' };\n\n/**\n * Decide what navigation (if any) a `tool_result.navigate_to` implies.\n * Pure — the component performs the side-effect + user messaging from the\n * returned decision. Reuses the same url-safety guards as before, so the\n * external/internal/reject policy is unchanged; this only moves the branch\n * logic out of the (oversized) chat component.\n *\n * Returns `null` when the tool result carries no navigation intent.\n */\nexport function resolveNavigation(toolResult: unknown): NavigationDecision | null {\n const tool = toolResult as { navigate_to?: unknown } | null | undefined;\n if (!tool || typeof tool.navigate_to !== 'string') {\n return null;\n }\n const url = tool.navigate_to.trim();\n if (isAllowedExternalNavigationUrl(url, window.location.origin)) {\n return { kind: 'external', url };\n }\n if (isSafeAppRelativePath(url)) {\n return { kind: 'internal', url };\n }\n return { kind: 'rejected' };\n}\n\n/** Side-effect hooks the component supplies so this stays free of Angular deps. */\nexport interface NavigationSideEffects {\n pushAssistant: (text: string, markdownEnabled?: boolean) => void;\n navigateByUrl: (url: string) => Promise<boolean>;\n assignExternal: (url: string) => void;\n}\n\n/**\n * Perform the side-effect implied by a NavigationDecision. Returns `true` when\n * the decision consumed the response (caller should stop), `false` when there\n * was no actionable navigation and the caller should render the tool result.\n * Behaviour is identical to the inline branches it replaced — only the location\n * changed, to keep the oversized chat component within the C1 line budget.\n */\nexport function dispatchNavigation(\n nav: NavigationDecision | null,\n fx: NavigationSideEffects\n): boolean {\n if (nav?.kind === 'external') {\n fx.pushAssistant(`Navigating to: ${nav.url}`);\n fx.assignExternal(nav.url);\n return true;\n }\n if (nav?.kind === 'internal') {\n fx.pushAssistant(`Navigating to: ${nav.url}`);\n fx.navigateByUrl(nav.url).catch(() => fx.pushAssistant('Navigation failed.'));\n return true;\n }\n if (nav?.kind === 'rejected') {\n fx.pushAssistant(\n 'Navigation was not performed: use a single-root path (e.g. /admin/users), not //, javascript:, or data: URLs.',\n false\n );\n return true;\n }\n return false;\n}\n","/**\n * Per-user localStorage persistence for the PosiWise Brain chat panel.\n *\n * Why per-user keys: a shared browser session would leak history from\n * user A to user B if keys were global. The pre-ticket #4167 code used\n * a single global `pw-brain.conversation_id` key; this file owns both\n * the new per-user shape AND a one-time migration from the legacy key.\n *\n * Why strip `pending`: server-side confirmation tokens are TTL-bound.\n * Replaying a stale token after hydrate produces a 4xx. Cleaner UX:\n * drop the inline-approve card on reload; the user re-asks if still\n * wanted.\n */\n\nexport type ChatMessageRole = 'user' | 'assistant';\n\nexport interface StoredChatMessage {\n role: ChatMessageRole;\n text: string;\n markdownEnabled?: boolean;\n /** Epoch ms — optional; absent on pre-timestamp payloads. */\n at?: number;\n}\n\ninterface StoredPayload {\n v: 1;\n messages: StoredChatMessage[];\n}\n\nexport const STORAGE_PREFIX = 'pw-brain.';\nexport const LEGACY_CONVERSATION_KEY = 'pw-brain.conversation_id';\nexport const MAX_STORED_MESSAGES = 100;\n\nexport function messagesKeyFor(userId: string | null | undefined): string {\n return userId ? `${STORAGE_PREFIX}messages.${userId}` : `${STORAGE_PREFIX}messages.anonymous`;\n}\n\nexport function conversationKeyFor(userId: string | null | undefined): string {\n return userId\n ? `${STORAGE_PREFIX}conversation_id.${userId}`\n : `${STORAGE_PREFIX}conversation_id.anonymous`;\n}\n\nexport function serializeMessages(\n messages: ReadonlyArray<{\n role: ChatMessageRole;\n text: string;\n markdownEnabled?: boolean;\n at?: number;\n }>\n): string {\n const stripped: StoredChatMessage[] = messages.slice(-MAX_STORED_MESSAGES).map(m => {\n const stored: StoredChatMessage = { role: m.role, text: m.text };\n if (m.markdownEnabled) stored.markdownEnabled = true;\n if (m.at) stored.at = m.at;\n return stored;\n });\n const payload: StoredPayload = { v: 1, messages: stripped };\n return JSON.stringify(payload);\n}\n\nexport function hydrateMessages(raw: string | null): StoredChatMessage[] {\n if (!raw) {\n return [];\n }\n try {\n const parsed = JSON.parse(raw) as Partial<StoredPayload>;\n if (parsed?.v !== 1 || !Array.isArray(parsed.messages)) {\n return [];\n }\n return parsed.messages\n .filter(\n m =>\n !!m &&\n (m.role === 'user' || m.role === 'assistant') &&\n typeof m.text === 'string'\n )\n .slice(-MAX_STORED_MESSAGES);\n } catch {\n return [];\n }\n}\n","import { LocalStorage } from '@posiwise/common-services';\n\nimport {\n conversationKeyFor,\n hydrateMessages,\n LEGACY_CONVERSATION_KEY,\n messagesKeyFor,\n serializeMessages,\n StoredChatMessage\n} from './pw-brain-chat-storage.helpers';\n\n/**\n * Thin coordinator that pairs the `LocalStorage` wrapper with the\n * current user's `api_user_id`. Owns the per-user keys and the one-time\n * migration from the legacy global `pw-brain.conversation_id` slot.\n */\nexport class BrainChatPersistence {\n constructor(\n private readonly localStorage: LocalStorage,\n private readonly userId: string | null\n ) {}\n\n readMessages(): StoredChatMessage[] {\n try {\n return hydrateMessages(this.localStorage.getItem(messagesKeyFor(this.userId)));\n } catch {\n return [];\n }\n }\n\n persistMessages(messages: ReadonlyArray<{ role: 'user' | 'assistant'; text: string }>): void {\n try {\n this.localStorage\n .setItem$(messagesKeyFor(this.userId), serializeMessages(messages))\n .subscribe();\n } catch {\n // private browsing / quota exhausted — best-effort, never break the chat\n }\n }\n\n /**\n * Read the per-user conversation_id. If absent but the legacy global\n * key still exists (pre-ticket #4167), adopt it into the user-scoped\n * slot and clear the global so the next user on this browser doesn't\n * inherit it.\n */\n adoptConversationId(): string | null {\n const scoped = conversationKeyFor(this.userId);\n const existing = this.localStorage.getItem(scoped);\n if (existing) {\n return existing;\n }\n const legacy = this.localStorage.getItem(LEGACY_CONVERSATION_KEY);\n if (!legacy) {\n return null;\n }\n this.localStorage.setItem$(scoped, legacy).subscribe();\n this.localStorage.removeItem$(LEGACY_CONVERSATION_KEY).subscribe();\n return legacy;\n }\n\n setConversationId(id: string): void {\n this.localStorage.setItem$(conversationKeyFor(this.userId), id).subscribe();\n }\n}\n","// Suggested prompts (welcome state) + quick-action chips (above composer) for\n// the Brain chat \"Canvas\" redesign (posiwise-frontend#51). Kept out of the\n// component so pw-brain-chat.component.ts stays within the C1 line budget.\n\nexport interface BrainChatPrompt {\n text: string;\n icon: string; // Fontawesome free-solid glyph (fa-*)\n}\n\nexport interface BrainChatQuickAction extends BrainChatPrompt {\n label: string;\n}\n\nexport const SUGGESTED_PROMPTS: readonly BrainChatPrompt[] = [\n { text: 'Show my subscription usage this month', icon: 'fa-chart-line' },\n { text: 'Which tools are available to me?', icon: 'fa-toolbox' },\n { text: 'Is everything running smoothly?', icon: 'fa-heart-pulse' }\n];\n\nexport const QUICK_ACTIONS: readonly BrainChatQuickAction[] = [\n { label: 'Usage', text: 'Show my subscription usage this month', icon: 'fa-chart-line' },\n { label: 'Tools', text: 'Which tools are available to me?', icon: 'fa-toolbox' },\n { label: 'Status', text: 'Is everything running smoothly?', icon: 'fa-heart-pulse' }\n];\n\n/** Seed assistant greeting for a fresh conversation (also used by New chat). */\nexport const GREETING =\n 'Hi — I can answer questions about your account and run approved actions. Try “show my API stats”.';\n","/**\n * Keeps the PosiWise Brain chat thread pinned to its newest message.\n *\n * The component never managed scroll, so the thread stayed at\n * `scrollTop = 0` (the top) after hydrate/send/reply and the latest\n * message rendered below the fold (ticket: chat scroll-to-top bug).\n *\n * Call `stickThreadToBottom` synchronously right after a message is\n * pushed — before the OnPush re-render. `getEl` is resolved twice:\n * 1. now, to read the PRE-render scroll position and decide whether\n * the user was already near the bottom; and\n * 2. inside the deferred tick, after Angular has laid out the new\n * row, to actually move the scrollbar.\n *\n * `force` (the user's own send / initial hydrate) always re-pins.\n * Otherwise we only follow when the user was already near the bottom,\n * so scrolling up to read history isn't yanked away by an incoming\n * assistant reply.\n */\nconst STICK_THRESHOLD_PX = 80;\n\nexport function isNearBottom(el: HTMLElement | null | undefined): boolean {\n if (!el) {\n return false;\n }\n return el.scrollHeight - el.scrollTop - el.clientHeight < STICK_THRESHOLD_PX;\n}\n\nexport function stickThreadToBottom(\n getEl: () => HTMLElement | null | undefined,\n force: boolean\n): void {\n if (!force && !isNearBottom(getEl())) {\n return;\n }\n // Defer past the OnPush re-render so the just-pushed row is laid\n // out before we read scrollHeight. getEl() is re-resolved here so\n // a call made from ngOnInit (ViewChild not yet bound) still works.\n setTimeout(() => {\n const el = getEl();\n if (el) {\n el.scrollTop = el.scrollHeight;\n }\n }, 0);\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { BaseHttpService } from '@posiwise/common-services';\n\n/**\n * Which product API to POST bytes to, keyed by the service name the tool\n * catalog reports (e.g. `'cloudolive-api'`, `'main-api'`).\n *\n * This is the ONE thing discovery cannot supply. Everything else about an\n * upload — the purpose, the accepted extensions, the size cap, which tool\n * consumes it — is advertised by the tool itself via `posiwise.upload` and\n * fetched from brain-api, so no frontend restates limits the owning service\n * already enforces. But the file goes STRAIGHT to the owning service rather\n * than through brain-api (bytes must never transit the chat pipeline), and\n * only the host app knows how to reach its own APIs.\n *\n * A service the map doesn't cover is simply not offered: the affordance is\n * hidden rather than advertised-then-broken.\n */\nexport const BRAIN_CHAT_UPLOAD_APIS = new InjectionToken<Record<string, BaseHttpService>>(\n 'BRAIN_CHAT_UPLOAD_APIS'\n);\n","// Voice Chat state vocabulary + status copy + visual mapping — extracted from\n// the BrainChatVoiceChat controller so it stays under the C1 line cap. The\n// controller re-exports the types, so external import sites are unchanged.\n\nexport type VoiceChatState =\n | 'idle'\n | 'listening'\n | 'processingSpeech'\n | 'thinking'\n | 'fetchingData'\n | 'speaking'\n | 'completed'\n | 'error';\n\n/** Visual treatment hint for the template — keeps animation choice out of HTML. */\nexport type VoiceChatVisual = 'idle' | 'pulse' | 'loader' | 'wave' | 'error';\n\nexport const VOICE_ERROR_MESSAGES: Record<string, string> = {\n mic: 'Microphone access was denied or is unavailable.',\n unauthorized: 'Could not authenticate the voice session.',\n disabled: 'Voice chat is not enabled here yet.',\n failed: 'Voice chat failed — please try again.'\n};\n\n/** Status copy per state — reassuring, conversational, and never silent. */\nexport const STATE_COPY: Record<VoiceChatState, string> = {\n idle: '',\n listening: 'Listening…',\n processingSpeech: 'Got that — one moment…',\n thinking: 'Understanding your question…',\n fetchingData: 'Checking your data…',\n speaking: 'Here’s what I found…',\n completed: 'Listening…',\n error: ''\n};\n\nexport const STATE_VISUAL: Record<VoiceChatState, VoiceChatVisual> = {\n idle: 'idle',\n listening: 'pulse',\n processingSpeech: 'loader',\n thinking: 'loader',\n fetchingData: 'loader',\n speaking: 'wave',\n completed: 'pulse',\n error: 'error'\n};\n","import { VoiceChatEvent, VoiceChatService } from '@posiwise/common-services';\n\nimport { Subscription } from 'rxjs';\n\nimport {\n STATE_COPY,\n STATE_VISUAL,\n VOICE_ERROR_MESSAGES,\n VoiceChatState,\n VoiceChatVisual\n} from './pw-brain-chat-voice-copy';\n\nexport type { VoiceChatState, VoiceChatVisual };\n\n/**\n * Voice Chat controller for the Brain chat composer (#58) — explicit state\n * machine over the WS relay: listening (start) → thinking (`text` role=user)\n * → fetchingData (`tool_use`) → speaking (`speaking_changed`) → listening.\n * Copy/visual vocab lives in pw-brain-chat-voice-copy.ts (C1 line budget).\n */\nexport class BrainChatVoiceChat {\n state: VoiceChatState = 'idle';\n error: string | null = null;\n available = false;\n /** Latest user transcript (Sonic ASR) — enriches the `fetchingData` copy. */\n transcript = '';\n /** Assistant reply text for the current turn — streams in alongside the audio. */\n reply = '';\n private sub?: Subscription;\n\n constructor(\n private readonly voice: VoiceChatService | undefined,\n private readonly changed: () => void,\n /** Called once per completed spoken exchange so the host can record it. */\n private readonly onTurn?: (userText: string, replyText: string) => void\n ) {}\n\n get isActive(): boolean {\n return this.state !== 'idle' && this.state !== 'error';\n }\n\n /** Back-compat for callers that only care whether audio is playing. */\n get speaking(): boolean {\n return this.state === 'speaking';\n }\n\n /** Animation family the template renders for the current state. */\n get visual(): VoiceChatVisual {\n return this.error ? 'error' : STATE_VISUAL[this.state];\n }\n\n /** Status text next to the button; `null` when there's nothing to say. */\n get statusMessage(): string | null {\n if (this.error) return this.error;\n if (this.state === 'fetchingData' && this.transcript) {\n return `Checking: “${this.transcript}”…`;\n }\n return STATE_COPY[this.state] || null;\n }\n\n /** Resolve once on init so the button shows only when voice-api is reachable. */\n async resolveAvailability(): Promise<void> {\n if (!this.voice) {\n this.available = false;\n return;\n }\n try {\n this.available = await this.voice.isAvailable();\n } catch {\n this.available = false;\n }\n this.changed();\n }\n\n /** Voice Chat button handler: start if idle, stop if active. */\n toggle(loading: boolean): void {\n if (this.isActive) {\n this.stop();\n } else {\n this.start(loading);\n }\n }\n\n stop(): void {\n if (this.state === 'idle') return; // 'error' also dismisses — setState('idle') clears it\n this.flushTurn(); // record any in-flight exchange before tearing down\n this.voice?.stop();\n this.setState('idle');\n }\n\n /** Tear down with the host component (called from ngOnDestroy). */\n dispose(): void {\n this.sub?.unsubscribe();\n this.sub = undefined;\n if (this.state !== 'idle') {\n this.flushTurn(); // persist any in-flight exchange before teardown\n this.voice?.stop();\n this.setState('idle');\n }\n }\n\n private start(loading: boolean): void {\n if (loading || !this.voice || !this.available) return;\n this.error = null;\n this.transcript = '';\n this.reply = '';\n this.setState('listening');\n this.sub = this.voice.start().subscribe({\n next: event => this.apply(event),\n error: reason => this.fail(reason),\n complete: () => this.setState('idle')\n });\n }\n\n private apply(event: VoiceChatEvent): void {\n switch (event.kind) {\n case 'text':\n this.onText(event.role, event.text);\n break;\n case 'tool_use':\n this.advanceTo('fetchingData');\n break;\n case 'speaking_changed':\n if (event.speaking) {\n this.onSpeakingStarted();\n } else {\n this.onSpeakingStopped();\n }\n break;\n case 'error':\n // Non-fatal in-session error: surface it without ending the chat.\n this.error = event.detail;\n this.changed();\n break;\n }\n }\n\n private onText(role: string | undefined, text: string): void {\n // Nova Sonic sends roles UPPERCASE on the wire ('USER'/'ASSISTANT') —\n // match case-insensitively or these branches never fire.\n const r = (role ?? '').toLowerCase();\n const t = text.trim();\n if (r === 'user' && t) {\n // ASR transcript = \"heard you, now understanding\". A new question\n // also closes any prior turn (barge-in while the reply was playing).\n this.flushTurn();\n this.transcript = t;\n this.advanceTo('thinking');\n } else if (r === 'assistant' && t) {\n // The reply's text — stream it live under the Sonar dial.\n this.reply = this.reply ? `${this.reply} ${t}` : t;\n this.changed();\n }\n }\n\n private onSpeakingStarted(): void {\n this.advanceTo('speaking');\n }\n\n private onSpeakingStopped(): void {\n // Turn finished — record the exchange, then listen for the next utterance.\n if (this.state === 'speaking') {\n this.flushTurn();\n this.advanceTo('listening');\n }\n }\n\n /** Hand the completed spoken exchange to the host (thread recording), then\n * reset the per-turn buffers. Safe to call with nothing buffered. */\n private flushTurn(): void {\n if (this.transcript || this.reply) {\n this.onTurn?.(this.transcript, this.reply);\n }\n this.transcript = '';\n this.reply = '';\n }\n\n /** Move forward only while a session is live (ignore stray events post-stop). */\n private advanceTo(next: VoiceChatState): void {\n if (!this.isActive) return;\n this.setState(next);\n }\n\n private fail(reason: unknown): void {\n const key = typeof reason === 'string' ? reason : 'failed';\n this.error = VOICE_ERROR_MESSAGES[key] ?? VOICE_ERROR_MESSAGES['failed'];\n this.state = 'error';\n this.changed();\n }\n\n private setState(next: VoiceChatState): void {\n this.state = next;\n if (next === 'idle') {\n this.error = null;\n this.transcript = '';\n this.reply = '';\n }\n this.changed();\n }\n}\n","import { Directive, HostListener } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { isSafeAppRelativePath } from './pw-brain-chat-url-safety.helpers';\n\n/**\n * Intercepts clicks on `<a>` elements rendered inside assistant markdown\n * bubbles. Internal paths (e.g. /account/details) are routed via Angular's\n * Router so the SPA does not do a full-page reload. External URLs fall\n * through to the browser's default behaviour (target=_blank already set by\n * SafeMarkdownPipe / renderMarkdown for external links).\n *\n * Applied via the `pwBrainChatThread` attribute on the chat thread div.\n */\n@Directive({ selector: '[pwBrainChatThread]' })\nexport class PwBrainChatThreadDirective {\n constructor(private readonly router: Router) {}\n\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n const anchor = (event.target as HTMLElement | null)?.closest('a');\n if (!anchor) {\n return;\n }\n const href = anchor.getAttribute('href');\n if (!href || !isSafeAppRelativePath(href)) {\n return;\n }\n event.preventDefault();\n this.router.navigateByUrl(href).catch(() => undefined);\n }\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\n\nimport { PendingConfirmation } from './pw-brain-chat.types';\nimport { diffRowsFrom } from './pw-brain-chat-diff.helpers';\n\n/**\n * Pending-action confirmation panel for the Brain chat bubble — risk badge,\n * target tool, field-level diff, and Approve/Cancel controls. Extracted from\n * the parent component template so `pw-brain-chat.component.html` stays under\n * the C1 200-line cap. Emits back to the parent, which owns the /confirm call\n * and message mutation (approve/cancel).\n */\n@Component({\n selector: 'pw-brain-chat-confirm',\n templateUrl: './pw-brain-chat-confirm.component.html',\n styleUrls: ['./pw-brain-chat-confirm.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class PwBrainChatConfirmComponent {\n @Input({ required: true }) pending!: PendingConfirmation;\n @Input() loading = false;\n @Output() approveEvent = new EventEmitter<void>();\n @Output() cancelEvent = new EventEmitter<void>();\n\n readonly diffRows = diffRowsFrom;\n}\n","<div class=\"pw-brain-chat__confirm\" aria-label=\"Approve action\">\n <div class=\"pw-brain-chat__confirm-meta\">\n @if (pending.risk_level) {\n <span\n class=\"pw-brain-chat__risk\"\n [class.pw-brain-chat__risk--critical]=\"pending.risk_level === 'critical'\"\n [class.pw-brain-chat__risk--high]=\"pending.risk_level === 'high'\"\n [class.pw-brain-chat__risk--medium]=\"pending.risk_level === 'medium'\"\n [class.pw-brain-chat__risk--low]=\"pending.risk_level === 'low'\"\n >Risk: {{ pending.risk_level }}</span>\n }\n @if (pending.target_service && pending.target_tool) {\n <span class=\"pw-brain-chat__target\"\n >{{ pending.target_service }}.{{ pending.target_tool }}</span\n >\n }\n </div>\n @if (diffRows(pending.diff).length) {\n <table class=\"pw-brain-chat__diff\" aria-label=\"Field-level diff\">\n <thead>\n <tr>\n <th scope=\"col\">Field</th>\n <th scope=\"col\">Before</th>\n <th scope=\"col\">After</th>\n </tr>\n </thead>\n <tbody>\n @for (row of diffRows(pending.diff); track row.field) {\n <tr>\n <th scope=\"row\" class=\"pw-brain-chat__diff-field\">{{ row.field }}</th>\n <td class=\"pw-brain-chat__diff-before\">{{ row.before }}</td>\n <td class=\"pw-brain-chat__diff-after\">{{ row.after }}</td>\n </tr>\n }\n </tbody>\n </table>\n }\n <div class=\"pw-brain-chat__confirm-actions\">\n <button\n type=\"button\"\n class=\"btn btn-success btn-sm pw-brain-chat__approve\"\n [disabled]=\"loading\"\n (click)=\"approveEvent.emit()\"\n >Approve</button>\n <button\n type=\"button\"\n class=\"btn btn-outline-secondary btn-sm pw-brain-chat__cancel\"\n [disabled]=\"loading\"\n (click)=\"cancelEvent.emit()\"\n >Cancel</button>\n </div>\n</div>\n","import { InjectionToken } from '@angular/core';\n\nimport { BrainChatPrompt } from './pw-brain-chat-prompts';\n\n/** A suggested prompt a product adds to the Brain chat welcome, optionally behind a permission. */\nexport interface BrainChatProductPrompt extends BrainChatPrompt {\n /** Permission expression (PermissionService.evaluatePermissions); omitted = shown to everyone. */\n permission?: string;\n /** Short chip label above the composer (like \"Usage\"); omitted = shown on the welcome only. */\n label?: string;\n}\n\n/**\n * Product-specific suggested prompts, shown before the shared ones (cloudolive-api#441).\n *\n * The shared list is the same for every product, so a prompt only one product can answer — \"Check my\n * setup\" needs that product's `onboarding_status` tool — would show elsewhere and get a dead-end reply.\n * The product app provides it here instead, like HOME_PRODUCT_SECTIONS on /home.\n */\nexport const BRAIN_CHAT_PRODUCT_PROMPTS = new InjectionToken<BrainChatProductPrompt[]>(\n 'BRAIN_CHAT_PRODUCT_PROMPTS'\n);\n\n/** The product prompts the viewer may see; `canSee` evaluates a permission expression. */\nexport function visibleProductPrompts(\n prompts: readonly BrainChatProductPrompt[] | null | undefined,\n canSee: (permission: string) => boolean\n): BrainChatProductPrompt[] {\n return (prompts ?? []).filter(prompt => !prompt.permission || canSee(prompt.permission));\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Inject,\n Optional,\n Output\n} from '@angular/core';\n\nimport { PermissionService } from '@posiwise/common-services';\n\nimport {\n BRAIN_CHAT_PRODUCT_PROMPTS,\n BrainChatProductPrompt,\n visibleProductPrompts\n} from './pw-brain-chat-product-prompts.token';\nimport { BrainChatQuickAction, QUICK_ACTIONS } from './pw-brain-chat-prompts';\n\n/**\n * Quick-action chips above the composer: the product's own chips (e.g. \"Setup\", cloudolive-api#441)\n * the viewer may see, then the shared Usage / Tools / Status. Emits the prompt text; the parent sends it.\n */\n@Component({\n selector: 'pw-brain-chat-quick',\n template: `\n <div class=\"pw-brain-chat__quick\">\n @for (q of actions; track q.text) {\n <button type=\"button\" class=\"pw-brain-chat__chip\" (click)=\"pick.emit(q.text)\">\n <i class=\"fas\" [ngClass]=\"q.icon\" aria-hidden=\"true\"></i>{{ q.label }}\n </button>\n }\n </div>\n `,\n styleUrls: ['./pw-brain-chat-canvas.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class PwBrainChatQuickComponent {\n @Output() pick = new EventEmitter<string>();\n readonly actions: readonly BrainChatQuickAction[];\n\n constructor(\n permission: PermissionService,\n @Optional()\n @Inject(BRAIN_CHAT_PRODUCT_PROMPTS)\n productPrompts?: BrainChatProductPrompt[] | null\n ) {\n const own = visibleProductPrompts(productPrompts, p => permission.evaluatePermissions(p))\n .filter(prompt => prompt.label)\n .map(({ label, text, icon }) => ({ label: label as string, text, icon }));\n this.actions = [...own, ...QUICK_ACTIONS];\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Inject,\n Input,\n Optional,\n Output\n} from '@angular/core';\n\nimport { PermissionService } from '@posiwise/common-services';\n\nimport {\n BRAIN_CHAT_PRODUCT_PROMPTS,\n BrainChatProductPrompt,\n visibleProductPrompts\n} from './pw-brain-chat-product-prompts.token';\nimport { BrainChatPrompt } from './pw-brain-chat-prompts';\n\n/**\n * First-open welcome state for the Brain chat — greeting + suggested-prompt\n * rows. Extracted from the parent template so `pw-brain-chat.component.html`\n * stays under the C1 200-line cap. Emits the picked prompt text; the parent\n * owns send().\n */\n@Component({\n selector: 'pw-brain-chat-welcome',\n templateUrl: './pw-brain-chat-welcome.component.html',\n styleUrls: ['./pw-brain-chat-canvas.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class PwBrainChatWelcomeComponent {\n /** Signed-in user's first name; when set the greeting reads \"Hi {name},\". */\n @Input() userFirstName?: string;\n @Input() prompts: readonly BrainChatPrompt[] = [];\n @Output() pick = new EventEmitter<string>();\n\n constructor(\n private readonly permission: PermissionService,\n @Optional()\n @Inject(BRAIN_CHAT_PRODUCT_PROMPTS)\n private readonly productPrompts?: BrainChatProductPrompt[] | null\n ) {}\n\n /** The product's own prompts the viewer may see, then the shared ones. */\n get visiblePrompts(): readonly BrainChatPrompt[] {\n const own = visibleProductPrompts(this.productPrompts, p =>\n this.permission.evaluatePermissions(p)\n );\n return [...own.map(({ text, icon }) => ({ text, icon })), ...this.prompts];\n }\n}\n","<div class=\"pw-brain-chat__welcome\">\n <span class=\"pw-brain-chat__hero\" aria-hidden=\"true\"><i class=\"fas fa-brain\"></i></span>\n <div>\n <div class=\"pw-brain-chat__greet-h\">Hi{{ userFirstName ? ' ' + userFirstName : '' }}, how can I help?</div>\n <p class=\"pw-brain-chat__greet-sub\">Ask about your subscriptions, data, and integrations — tell me what to do, or something to remember.</p>\n </div>\n <div class=\"pw-brain-chat__suggest-lab\">Try one</div>\n <div class=\"pw-brain-chat__prompts\">\n @for (p of visiblePrompts; track p.text) {\n <button type=\"button\" class=\"pw-brain-chat__prompt\" (click)=\"pick.emit(p.text)\">\n <span class=\"pw-brain-chat__pic\"><i class=\"fas\" [ngClass]=\"p.icon\" aria-hidden=\"true\"></i></span>\n <span class=\"pw-brain-chat__prompt-text\">{{ p.text }}</span>\n <span class=\"pw-brain-chat__arw\"><i class=\"fas fa-chevron-right\" aria-hidden=\"true\"></i></span>\n </button>\n }\n </div>\n</div>\n","// Sonar voice-overlay — shared primitives (posiwise-frontend#51). Types +\n// geometry + the theme-neutral dial chrome / mono readout. The stateful\n// per-state renderers + rAF orchestration live in the SonarRenderer class\n// (pw-brain-chat-sonar-render.helpers.ts) to keep each file under C1.\n\nexport type SonarState =\n | 'listening'\n | 'processingSpeech'\n | 'thinking'\n | 'fetchingData'\n | 'speaking'\n | 'error';\n\nexport interface SonarColors {\n first: string;\n ink3: string;\n tick: string;\n tickMaj: string;\n idle: string;\n line: string;\n err: string;\n n500: string;\n}\n\nexport const SIZE = 280;\nexport const CX = SIZE / 2;\nexport const CY = SIZE / 2;\nexport const R_TICK = 118;\nexport const R_OUTER = 128;\nexport const R_CORE = 32;\nexport const R_MAX = 112;\n\n// ── transient animation state (owned by SonarRenderer, mutated by the scenes)\nexport interface Ring {\n r: number;\n life: number;\n amp: number;\n}\nexport interface SonarNode {\n a: number;\n r: number;\n lit: number;\n}\nexport interface SonarAnim {\n micLevel: number;\n ringPhase: number;\n rings: Ring[];\n radar: number;\n nodes: SonarNode[];\n}\n\nexport const SONAR_LABELS: Record<SonarState, string> = {\n listening: 'LISTENING',\n processingSpeech: 'CAPTURE',\n thinking: 'ANALYZING',\n fetchingData: 'SCANNING',\n speaking: 'OUTPUT',\n error: 'NO SIGNAL'\n};\n\nexport function makeAnim(): SonarAnim {\n return {\n micLevel: 0.45,\n ringPhase: 0,\n rings: [],\n radar: 0,\n nodes: [\n { a: -1.15, r: 70, lit: 0 },\n { a: 0.35, r: 96, lit: 0 },\n { a: 1.7, r: 60, lit: 0 },\n { a: 2.75, r: 88, lit: 0 },\n { a: -2.5, r: 82, lit: 0 }\n ]\n };\n}\n\n// Accepts #RRGGBB or an rgb()/rgba() string (getComputedStyle resolves CSS vars\n// to rgb) and returns rgba() at the given alpha.\nexport function alpha(color: string, a: number): string {\n const s = (color || '').trim();\n if (s.startsWith('#') && s.length === 7) {\n const r = Number.parseInt(s.slice(1, 3), 16);\n const g = Number.parseInt(s.slice(3, 5), 16);\n const b = Number.parseInt(s.slice(5, 7), 16);\n return `rgba(${r},${g},${b},${a})`;\n }\n const m = /rgba?\\(([^)]+)\\)/.exec(s);\n if (m) {\n const p = m[1].split(',');\n return `rgba(${p[0].trim()},${p[1].trim()},${p[2].trim()},${a})`;\n }\n return s;\n}\n\nexport function ring(ctx: CanvasRenderingContext2D, r: number, stroke: string, w: number): void {\n ctx.beginPath();\n ctx.arc(CX, CY, r, 0, Math.PI * 2);\n ctx.lineWidth = w;\n ctx.strokeStyle = stroke;\n ctx.stroke();\n}\n\n/** The persistent instrument bezel: outer boundary, 72 ticks, guide rings. */\nexport function chrome(ctx: CanvasRenderingContext2D, c: SonarColors): void {\n ring(ctx, R_OUTER, alpha(c.line, 0.9), 1);\n for (let i = 0; i < 72; i++) {\n const ang = (i / 72) * Math.PI * 2 - Math.PI / 2;\n const major = i % 6 === 0;\n const r2 = R_TICK - (major ? 9 : 4.5);\n ctx.beginPath();\n ctx.moveTo(CX + Math.cos(ang) * R_TICK, CY + Math.sin(ang) * R_TICK);\n ctx.lineTo(CX + Math.cos(ang) * r2, CY + Math.sin(ang) * r2);\n ctx.lineWidth = major ? 1.4 : 1;\n ctx.strokeStyle = major ? alpha(c.tickMaj, 0.75) : alpha(c.tick, 0.9);\n ctx.stroke();\n }\n [56, 84].forEach(r => {\n ctx.setLineDash([2, 5]);\n ring(ctx, r, alpha(c.tick, 0.5), 1);\n ctx.setLineDash([]);\n });\n}\n\n/** Centred JetBrains-Mono telemetry line (letter-spaced) below the dial core. */\nexport function readout(ctx: CanvasRenderingContext2D, text: string, col: string): void {\n ctx.font = \"600 10px 'JetBrains Mono',monospace\";\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.fillStyle = alpha(col, 0.9);\n const gap = 1.5;\n let total = 0;\n for (const ch of text) total += ctx.measureText(ch).width + gap;\n let x = CX - total / 2;\n const y = CY + R_TICK - 8;\n for (const ch of text) {\n const w = ctx.measureText(ch).width;\n ctx.fillText(ch, x + w / 2, y);\n x += w + gap;\n }\n ctx.textAlign = 'start';\n}\n","// Sonar voice-overlay — per-state scene renderers (posiwise-frontend#51).\n// Free functions over a mutable SonarAnim so the SonarRenderer class stays a\n// thin dispatcher (C1). Primitives live in pw-brain-chat-sonar.helpers.\n\nimport {\n alpha,\n CX,\n CY,\n R_CORE,\n R_MAX,\n R_TICK,\n readout,\n ring,\n SonarAnim,\n SonarColors\n} from './pw-brain-chat-sonar.helpers';\n\nexport function sceneListening(\n ctx: CanvasRenderingContext2D,\n a: SonarAnim,\n c: SonarColors,\n t: number,\n dt: number\n): void {\n const target =\n 0.5 + 0.42 * Math.sin(t * 2.1) * (0.5 + 0.5 * Math.sin(t * 0.7)) + 0.12 * Math.sin(t * 8.3);\n a.micLevel += (target - a.micLevel) * Math.min(1, dt * 6);\n const lvl = Math.max(0.08, Math.min(1, ((a.micLevel + 1) / 2) * 0.9 + 0.1));\n a.ringPhase += dt * (0.7 + lvl * 2.6);\n if (a.ringPhase >= 1) {\n a.ringPhase -= 1;\n a.rings.push({ r: R_CORE + 4, life: 1, amp: lvl });\n }\n for (let i = a.rings.length - 1; i >= 0; i--) {\n const g = a.rings[i];\n g.r += dt * (60 + g.amp * 70);\n g.life = 1 - (g.r - R_CORE) / (R_MAX - R_CORE);\n if (g.life <= 0 || g.r > R_MAX) {\n a.rings.splice(i, 1);\n continue;\n }\n ring(ctx, g.r, alpha(c.first, g.life * 0.55), 1.5 + g.amp * 1.6);\n }\n ctx.beginPath();\n ctx.arc(CX, CY, R_CORE + 9, -Math.PI / 2, -Math.PI / 2 + Math.PI * 2 * lvl);\n ctx.lineWidth = 3;\n ctx.lineCap = 'round';\n ctx.strokeStyle = alpha(c.first, 0.9);\n ctx.stroke();\n ctx.lineCap = 'butt';\n ring(ctx, R_CORE + 9, alpha(c.idle, 0.4), 3);\n readout(ctx, 'LVL ' + lvl.toFixed(2), c.first);\n}\n\nexport function sceneProcessing(\n ctx: CanvasRenderingContext2D,\n a: SonarAnim,\n c: SonarColors,\n t: number,\n dt: number\n): void {\n a.ringPhase += dt * 2.2;\n if (a.ringPhase >= 1) {\n a.ringPhase -= 1;\n a.rings.push({ r: R_MAX, life: 1, amp: 0.6 });\n }\n for (let i = a.rings.length - 1; i >= 0; i--) {\n const g = a.rings[i];\n g.r -= dt * 70;\n if (g.r <= R_CORE + 4) {\n a.rings.splice(i, 1);\n continue;\n }\n ring(ctx, g.r, alpha(c.first, (1 - (g.r - R_CORE) / (R_MAX - R_CORE)) * 0.5), 1.6);\n }\n const p = 0.5 + 0.5 * Math.sin(t * 6);\n ring(ctx, R_CORE + 7 + p * 3, alpha(c.first, 0.35 + p * 0.35), 2);\n readout(ctx, 'CAPTURE', c.first);\n}\n\nexport function sceneThinking(\n ctx: CanvasRenderingContext2D,\n a: SonarAnim,\n c: SonarColors,\n t: number,\n dt: number\n): void {\n a.radar += dt * 2.2;\n for (let i = 0; i < 44; i++) {\n const a0 = a.radar - (i / 44) * Math.PI * 0.62;\n const a1 = a.radar - ((i + 1) / 44) * Math.PI * 0.62;\n ctx.beginPath();\n ctx.arc(CX, CY, 84, a1, a0);\n ctx.lineWidth = 4;\n ctx.strokeStyle = alpha(c.first, (1 - i / 44) * 0.5);\n ctx.stroke();\n }\n for (let k = 0; k < 3; k++) {\n const ang = t * 1.6 + (k * Math.PI * 2) / 3;\n ctx.beginPath();\n ctx.arc(CX + Math.cos(ang) * 52, CY + Math.sin(ang) * 52, 2.6, 0, Math.PI * 2);\n ctx.fillStyle = alpha(c.first, 0.85);\n ctx.fill();\n }\n readout(ctx, 'ANALYZING', c.first);\n}\n\nexport function sceneFetching(\n ctx: CanvasRenderingContext2D,\n a: SonarAnim,\n c: SonarColors,\n dt: number\n): void {\n a.radar += dt * 1.9;\n const sweep = a.radar % (Math.PI * 2);\n for (let i = 0; i < 40; i++) {\n const a0 = sweep - (i / 40) * Math.PI * 0.5;\n const a1 = sweep - ((i + 1) / 40) * Math.PI * 0.5;\n ctx.beginPath();\n ctx.moveTo(CX, CY);\n ctx.arc(CX, CY, R_TICK, a1, a0);\n ctx.closePath();\n ctx.fillStyle = alpha(c.first, (1 - i / 40) * 0.14);\n ctx.fill();\n }\n let found = 0;\n a.nodes.forEach(nd => {\n let na = nd.a;\n if (na < 0) na += Math.PI * 2;\n const diff = Math.abs(((sweep - na + Math.PI * 3) % (Math.PI * 2)) - Math.PI);\n nd.lit = diff < 0.12 ? 1 : Math.max(0, nd.lit - dt * 0.7);\n const x = CX + Math.cos(nd.a) * nd.r;\n const y = CY + Math.sin(nd.a) * nd.r;\n if (nd.lit > 0.02) {\n ctx.beginPath();\n ctx.moveTo(CX, CY);\n ctx.lineTo(x, y);\n ctx.strokeStyle = alpha(c.first, nd.lit * 0.4);\n ctx.lineWidth = 1;\n ctx.stroke();\n found++;\n }\n ctx.strokeStyle = alpha(nd.lit > 0.3 ? c.first : c.tickMaj, nd.lit > 0.3 ? 0.95 : 0.5);\n ctx.lineWidth = 1.5;\n ctx.strokeRect(x - 3, y - 3, 6, 6);\n });\n readout(ctx, 'SCAN ' + found + '/' + a.nodes.length, c.first);\n}\n\nexport function sceneSpeaking(ctx: CanvasRenderingContext2D, c: SonarColors, t: number): void {\n for (let i = 0; i < 4; i++) {\n const osc = Math.sin(t * 3.2 - i * 0.6);\n ring(ctx, 44 + i * 20 + osc * 7, alpha(c.first, 0.28 + 0.35 * (0.5 + 0.5 * osc)), 2.4);\n }\n ctx.lineCap = 'round';\n for (let i = 0; i < 36; i++) {\n const ang = (i / 36) * Math.PI * 2 - Math.PI / 2;\n const h =\n 8 + (0.5 + 0.5 * Math.sin(t * 5 + i * 0.55)) * 14 * (0.5 + 0.5 * Math.sin(t * 2 + i));\n const r1 = R_CORE + 12;\n ctx.beginPath();\n ctx.moveTo(CX + Math.cos(ang) * r1, CY + Math.sin(ang) * r1);\n ctx.lineTo(CX + Math.cos(ang) * (r1 + h), CY + Math.sin(ang) * (r1 + h));\n ctx.lineWidth = 2;\n ctx.strokeStyle = alpha(c.first, 0.55);\n ctx.stroke();\n }\n ctx.lineCap = 'butt';\n readout(ctx, 'OUTPUT', c.first);\n}\n\nexport function sceneError(ctx: CanvasRenderingContext2D, c: SonarColors, t: number): void {\n const jitter = t ? Math.sin(t * 30) * 0.6 : 0;\n ctx.save();\n ctx.translate(jitter, 0);\n ctx.beginPath();\n ctx.arc(CX, CY, 72, -Math.PI * 0.35, Math.PI * 1.15);\n ctx.lineWidth = 3;\n ctx.strokeStyle = alpha(c.err, 0.85);\n ctx.stroke();\n ctx.setLineDash([4, 6]);\n ring(ctx, 50, alpha(c.n500, 0.6), 1.5);\n ctx.setLineDash([]);\n ctx.restore();\n readout(ctx, 'NO SIGNAL', c.err);\n}\n","// Sonar voice-overlay — stateful renderer (posiwise-frontend#51). Holds the\n// transient animation state (mic level, rings, radar sweep, data nodes) and\n// dispatches one structurally-distinct motion per voice state to the scene\n// renderers in pw-brain-chat-sonar-scenes. Primitives (chrome/readout/ring/\n// geometry) live in pw-brain-chat-sonar.helpers.\n\nimport {\n alpha,\n chrome,\n makeAnim,\n readout,\n ring,\n SIZE,\n SONAR_LABELS,\n SonarAnim,\n SonarColors,\n SonarState\n} from './pw-brain-chat-sonar.helpers';\nimport {\n sceneError,\n sceneFetching,\n sceneListening,\n sceneProcessing,\n sceneSpeaking,\n sceneThinking\n} from './pw-brain-chat-sonar-scenes.helpers';\n\nfunction staticRingRadii(state: SonarState): readonly number[] {\n if (state === 'processingSpeech') return [46, 66, 86];\n if (state === 'speaking') return [44, 64, 84];\n return [52, 74, 96];\n}\n\nexport class SonarRenderer {\n private readonly anim: SonarAnim = makeAnim();\n\n onStateChange(state: SonarState): void {\n this.anim.rings = [];\n if (state === 'fetchingData') this.anim.nodes.forEach(n => (n.lit = 0));\n }\n\n draw(\n ctx: CanvasRenderingContext2D,\n state: SonarState,\n c: SonarColors,\n t: number,\n dt: number\n ): void {\n ctx.clearRect(0, 0, SIZE, SIZE);\n chrome(ctx, c);\n if (state === 'listening') sceneListening(ctx, this.anim, c, t, dt);\n else if (state === 'processingSpeech') sceneProcessing(ctx, this.anim, c, t, dt);\n else if (state === 'thinking') sceneThinking(ctx, this.anim, c, t, dt);\n else if (state === 'fetchingData') sceneFetching(ctx, this.anim, c, dt);\n else if (state === 'speaking') sceneSpeaking(ctx, c, t);\n else if (state === 'error') sceneError(ctx, c, t);\n }\n\n /** Reduced-motion: one representative still frame per state. */\n drawStatic(ctx: CanvasRenderingContext2D, state: SonarState, c: SonarColors): void {\n ctx.clearRect(0, 0, SIZE, SIZE);\n chrome(ctx, c);\n if (state === 'error') {\n sceneError(ctx, c, 0);\n return;\n }\n const a = c.first;\n const rr = staticRingRadii(state);\n rr.forEach((r, i) => ring(ctx, r, alpha(a, 0.5 - i * 0.13), 2));\n readout(ctx, SONAR_LABELS[state], a);\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n ViewChild\n} from '@angular/core';\n\nimport { BrainChatDictation } from './pw-brain-chat-dictation.helpers';\nimport { SonarColors, SonarState } from './pw-brain-chat-sonar.helpers';\nimport { SonarRenderer } from './pw-brain-chat-sonar-render.helpers';\nimport { BrainChatVoiceChat } from './pw-brain-chat-voice-chat.helpers';\n\nconst LOOP: SonarState[] = [\n 'listening',\n 'processingSpeech',\n 'thinking',\n 'fetchingData',\n 'speaking'\n];\nconst STEP_CAP: Record<SonarState, string> = {\n listening: 'Turn · Hear',\n processingSpeech: 'Turn · Capture',\n thinking: 'Turn · Reason',\n fetchingData: 'Turn · Retrieve',\n speaking: 'Turn · Answer',\n error: 'Session interrupted'\n};\n\n/**\n * Sonar voice-session overlay (#51) — a focused takeover over the chat panel\n * that animates the real voice/dictation state machine on an instrument dial.\n * Default change detection: the voice/dictation controllers mutate in place, so\n * the template must re-read them on every parent CD tick. The canvas is driven\n * by its own rAF loop and never needs CD.\n */\n@Component({\n selector: 'pw-brain-chat-voice-overlay',\n templateUrl: './pw-brain-chat-voice-overlay.component.html',\n styleUrls: [\n './pw-brain-chat-voice-overlay.component.scss',\n './pw-brain-chat-voice-overlay-steps.scss'\n ],\n standalone: false\n})\nexport class PwBrainChatVoiceOverlayComponent implements AfterViewInit, OnDestroy {\n @Input() voice: BrainChatVoiceChat | null = null;\n @Input() dictation: BrainChatDictation | null = null;\n @Output() readonly end = new EventEmitter<void>();\n @ViewChild('dial') private readonly dialRef?: ElementRef<HTMLCanvasElement>;\n @ViewChild('endBtn') private readonly endBtnRef?: ElementRef<HTMLButtonElement>;\n\n private ctx: CanvasRenderingContext2D | null = null;\n private raf = 0;\n private last = 0;\n private prevState: SonarState | null = null;\n private colors: SonarColors | null = null;\n private readonly renderer = new SonarRenderer();\n private readonly reduce =\n typeof matchMedia !== 'undefined' && matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n constructor(private readonly host: ElementRef<HTMLElement>) {}\n\n // ── unified state derived from the two controllers ──\n /** The voice controller iff a voice session is live (active or errored). */\n private get activeVoice(): BrainChatVoiceChat | null {\n return this.voice && (this.voice.isActive || !!this.voice.error) ? this.voice : null;\n }\n get isVoice(): boolean {\n return !!this.activeVoice;\n }\n get state(): SonarState {\n const v = this.activeVoice;\n if (v) {\n if (v.error) return 'error';\n const s = v.state;\n return s === 'idle' || s === 'completed' ? 'listening' : (s as SonarState);\n }\n if (this.dictation?.error) return 'error';\n return this.dictation?.phase === 'processing' ? 'processingSpeech' : 'listening';\n }\n get isError(): boolean {\n return this.state === 'error';\n }\n get label(): string {\n const v = this.activeVoice;\n return (v ? v.statusMessage : this.dictation?.statusMessage) || 'Listening…';\n }\n get modeTag(): string {\n if (this.isError) return 'Session interrupted';\n return this.isVoice ? 'Voice session' : 'Dictation';\n }\n get transcript(): string {\n const v = this.activeVoice;\n return v ? v.transcript || '' : '';\n }\n get showTranscript(): boolean {\n const s = this.state;\n return (s === 'thinking' || s === 'fetchingData') && !!this.transcript;\n }\n /** Assistant reply text, streamed live while the audio answer plays. */\n get reply(): string {\n const v = this.activeVoice;\n return v ? v.reply || '' : '';\n }\n get showReply(): boolean {\n return this.state === 'speaking' && !!this.reply;\n }\n get showSteps(): boolean {\n return this.isVoice && !this.isError;\n }\n get stepIndex(): number {\n return LOOP.indexOf(this.state);\n }\n get stepCaption(): string {\n return STEP_CAP[this.state];\n }\n get coreIcon(): string {\n const s = this.state;\n if (s === 'error') return 'fa-microphone-slash';\n if (s === 'thinking' || s === 'fetchingData') return 'fa-brain';\n if (s === 'speaking') return 'fa-volume-high';\n return 'fa-microphone';\n }\n get hint(): string {\n return this.isError\n ? 'Check your browser mic permissions, then retry.'\n : 'Speak naturally — I’m listening.';\n }\n\n ngAfterViewInit(): void {\n const canvas = this.dialRef?.nativeElement;\n if (!canvas) return;\n const dpr = Math.min(2, window.devicePixelRatio || 1);\n canvas.width = 280 * dpr;\n canvas.height = 280 * dpr;\n this.ctx = canvas.getContext('2d');\n if (!this.ctx) return; // no 2d context (e.g. jsdom) — nothing to animate\n this.ctx.scale(dpr, dpr);\n this.colors = this.readColors();\n this.last = performance.now();\n this.raf = requestAnimationFrame(this.frame);\n // Full-panel takeover: move focus to the sole exit so keyboard/AT users\n // aren't stranded on the now-inert composer behind the scrim.\n this.endBtnRef?.nativeElement.focus();\n }\n\n ngOnDestroy(): void {\n cancelAnimationFrame(this.raf);\n }\n\n onEnd(): void {\n this.end.emit();\n }\n\n private readonly frame = (now: number): void => {\n const dt = Math.min(0.05, (now - this.last) / 1000);\n this.last = now;\n const state = this.state;\n const changed = state !== this.prevState;\n if (changed) {\n this.renderer.onStateChange(state);\n this.prevState = state;\n this.colors = this.readColors();\n }\n if (this.ctx && this.colors) {\n if (this.reduce) {\n if (changed) this.renderer.drawStatic(this.ctx, state, this.colors);\n } else {\n this.renderer.draw(this.ctx, state, this.colors, now / 1000, dt);\n }\n }\n this.raf = requestAnimationFrame(this.frame);\n };\n\n /** Read theme-aware colours (the --bc-* tokens inherit from .pw-brain-chat). */\n private readColors(): SonarColors {\n const s = getComputedStyle(this.host.nativeElement);\n const v = (n: string, d: string): string => s.getPropertyValue(n).trim() || d;\n return {\n first: v('--bc-accent', '#1769e1'),\n ink3: v('--bc-ink-3', '#7c8696'),\n tick: v('--bc-line-strong', '#cfd4dc'),\n tickMaj: v('--bc-ink-3', '#7c8696'),\n idle: v('--bc-line-strong', '#cfd4dc'),\n line: v('--bc-line', '#e2e5ea'),\n err: v('--bc-error', '#c0392b'),\n n500: v('--bc-ink-3', '#7c8696')\n };\n }\n}\n","<div\n class=\"pw-vo\"\n [class.pw-vo--err]=\"isError\"\n [attr.aria-live]=\"isError ? 'assertive' : 'polite'\"\n [attr.aria-label]=\"label\"\n>\n <div class=\"pw-vo__panel\">\n <div class=\"pw-vo__head\">\n <span class=\"pw-vo__kicker\">\n <span class=\"pw-vo__live\" [class.pw-vo__live--err]=\"isError\" aria-hidden=\"true\"></span>{{ modeTag }}\n </span>\n </div>\n\n <div class=\"pw-vo__sonar\">\n <canvas #dial class=\"pw-vo__dial\"></canvas>\n <div class=\"pw-vo__core\" aria-hidden=\"true\">\n <i class=\"fas\" [ngClass]=\"coreIcon\" [class.pw-vo__core-i--err]=\"isError\"></i>\n </div>\n </div>\n\n <div class=\"pw-vo__label\" [class.pw-vo__label--err]=\"isError\">{{ label }}</div>\n @if (showTranscript) {\n <div class=\"pw-vo__transcript\">“{{ transcript }}”</div>\n }\n @if (showReply) {\n <div class=\"pw-vo__reply\" aria-live=\"off\">{{ reply }}</div>\n }\n\n @if (showSteps) {\n <div class=\"pw-vo__steps\">\n @for (i of [0, 1, 2, 3, 4]; track i) {\n <div class=\"pw-vo__step\" [class.is-done]=\"i < stepIndex\" [class.is-active]=\"i === stepIndex\">\n <span class=\"pw-vo__dot\"></span>\n @if (i < 4) {\n <span class=\"pw-vo__seg\" [class.is-done]=\"i < stepIndex\"></span>\n }\n </div>\n }\n </div>\n <div class=\"pw-vo__step-cap\">{{ stepCaption }}</div>\n }\n\n <div class=\"pw-vo__actions\">\n <button #endBtn type=\"button\" class=\"pw-vo__end\" [class.pw-vo__end--err]=\"isError\" (click)=\"onEnd()\">\n <i class=\"fas\" [ngClass]=\"isError ? 'fa-xmark' : 'fa-stop'\" aria-hidden=\"true\"></i>\n {{ isError ? 'Close' : 'End session' }}\n </button>\n <span class=\"pw-vo__hint\">{{ hint }}</span>\n </div>\n </div>\n</div>\n","/**\n * Resolve the app-relative paths Brain answers carry into URLs a browser can follow.\n *\n * brain-api publishes documentation with relative `ui_paths` (`/settings/communication`),\n * and deliberately so: the corpus is shared across subscriptions and surfaces, so it\n * cannot bake in a host. The FRONTEND is what knows the host — main-api returns it in\n * the domain metadata every client already fetches, as `links.frontend_link`\n * (`Settings.endpoints.front_end_base_url`; see `domain_metadata_json_helpers#api_links`),\n * which is the same value `auth.service` and `linkedin-confirmation` build URLs from.\n *\n * Passing no `baseUrl` leaves paths relative, which is what the in-app widget needs\n * when it is already served from that origin.\n */\n\n/** A path that addresses a page in this app: leading slash, then a letter. */\nconst APP_PATH_RE = /^\\/[a-zA-Z][a-zA-Z0-9\\-_/]*$/;\n\n/**\n * First path segments that live UNDER the subscription slug in the router\n * (`:slug/faq/:id`, `:slug/crm`, … — dashboard-routing.module.ts). brain-api\n * publishes `/faq/x` because the corpus is shared across subscriptions and\n * cannot know the caller's slug; the frontend holds it, so it is spliced in\n * here. Without this the path is one segment short and matches NO route at all.\n *\n * `message` is deliberately ABSENT: both `/message` and `:slug/message` exist,\n * so prefixing would break the valid unscoped route.\n *\n * This mirrors the router by hand and can drift — the spec pins the list.\n */\nconst SUBSCRIPTION_SCOPED_SEGMENTS: ReadonlySet<string> = new Set([\n 'build',\n 'hyperdashboard',\n 'paas',\n 'crm',\n // CloudOlive's product pages (cloudolive-frontend dashboard-routing.module.ts `:slug/cloudolive`);\n // no unscoped `/cloudolive` route exists, so prefixing cannot break a valid path.\n 'cloudolive',\n 'enterprise',\n 'faq',\n 'documentation'\n]);\n\n/** A bare app path wrapped in a single-backtick code span. */\nconst CODE_SPANNED_PATH_RE = /`(\\/[a-zA-Z][a-zA-Z0-9\\-_/]*)`/g;\n\n/**\n * Drop any trailing slashes from `baseUrl` so joining never yields `host//path`.\n *\n * Deliberately NOT a regex: the obvious `/\\/+$/` has no left anchor, so the\n * engine retries at every offset and backtracks over the run of slashes — O(n^2)\n * on a pathological host string. Walking back from the end is linear.\n */\nfunction trimTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value[end - 1] === '/') {\n end -= 1;\n }\n\n return value.slice(0, end);\n}\n\n/**\n * Join `baseUrl` to an app-relative path. Anything that is not an app path (an\n * absolute URL, a mailto:, a fragment) is returned untouched, and an empty\n * `baseUrl` leaves the path relative rather than producing a `//`-prefixed URL.\n */\nexport function absolutiseAppPath(path: string, baseUrl = ''): string {\n if (!baseUrl || !APP_PATH_RE.test(path)) return path;\n\n return `${trimTrailingSlashes(baseUrl)}${path}`;\n}\n\n/**\n * Splice the caller's subscription slug into a path the router scopes under it.\n * A no-op for unscoped paths (`/account/details`, `/settings/communication`)\n * and when no slug is known.\n */\nexport function scopeAppPath(path: string, subscriptionSlug = ''): string {\n if (!subscriptionSlug || !APP_PATH_RE.test(path)) return path;\n const first = path.split('/')[1];\n return SUBSCRIPTION_SCOPED_SEGMENTS.has(first) ? `/${subscriptionSlug}${path}` : path;\n}\n\n/**\n * Full resolution: correct against the index, scope under the subscription,\n * then make absolute. Correction runs FIRST — the index holds unscoped paths,\n * so matching after scoping would never hit.\n */\nexport function resolveAppPath(\n path: string,\n baseUrl = '',\n subscriptionSlug = '',\n known: readonly string[] = []\n): string {\n const corrected = correctKnownPath(path, known);\n\n return absolutiseAppPath(scopeAppPath(corrected, subscriptionSlug), baseUrl);\n}\n\n/**\n * Unwrap a path the model emitted as inline code — `` `/settings/communication` ``.\n *\n * The renderer supports no code spans, so those backticks were rendered literally\n * and, worse, the bare-path linkifier's preceding-character class (`[\\s(,;:]`)\n * excludes a backtick, so the path was never linked at all: the user saw grey\n * code text where a link belonged. Stripping the backticks first lets the normal\n * linkifier see an ordinary bare path.\n */\nexport function unwrapCodeSpannedPaths(raw: string): string {\n return raw.replace(CODE_SPANNED_PATH_RE, '$1');\n}\n\n/**\n * Correct a path the model got *nearly* right, using the navigation index.\n *\n * The summariser writes prose and sometimes authors a plausible-but-wrong URL:\n * `/subscriptions` for a page that actually lives at `/account/subscriptions`\n * (PROD, 2026-09-24 — a 404 presented to the user as a working link).\n *\n * The correction is deliberately narrow. It fires only when EXACTLY ONE known\n * path ends with the candidate, so `/subscriptions` -> `/account/subscriptions`\n * resolves while anything ambiguous is left untouched. An unmatched path is\n * also left untouched rather than suppressed: the index holds MENU entries, so\n * a legitimate deep link (`/faq/can-i-stop-...`) is absent from it, and\n * treating absence as invalid would strip links that work.\n */\nexport function correctKnownPath(path: string, known: readonly string[] = []): string {\n if (!known.length || !APP_PATH_RE.test(path) || known.includes(path)) {\n return path;\n }\n const matches = known.filter(candidate => candidate.endsWith(path));\n\n return matches.length === 1 ? matches[0] : path;\n}\n","/**\n * Minimal markdown-to-HTML renderer for Brain chat assistant bubbles.\n * Handles inline links, bold, italic, newlines, and bare app-relative path\n * auto-linking. All user-supplied text is HTML-escaped before insertion so\n * the output is injection-safe when consumed by DomSanitizer.bypassSecurityTrustHtml.\n *\n * Intentionally small: no full CommonMark parser, no headings, no code\n * fences — only the subset that makes AI responses navigable.\n */\n\nimport { resolveAppPath, unwrapCodeSpannedPaths } from './pw-brain-chat-link-resolve.helpers';\n\n/** Escape the five HTML special characters in a plain-text fragment. */\nfunction escapeHtml(s: string): string {\n return s\n .replaceAll('&', '&amp;')\n .replaceAll('<', '&lt;')\n .replaceAll('>', '&gt;')\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", '&#39;');\n}\n\n/** Inline-link regex shared by linkifyBareAppPaths (matchAll) and renderMarkdownCore (LINK_ANCHORED_RE exec). */\nconst LINK_PATTERN = /\\[([^\\]\\n]+)\\]\\(([^()\\n]*(?:\\([^()\\n]*\\)[^()\\n]*)*)\\)/g; // NOSONAR S5852\nconst LINK_ANCHORED_RE = new RegExp('^' + LINK_PATTERN.source);\n\n/** Deny-list of pseudo-schemes blocked in markdown hrefs. Pinned at module scope\n * so the literal strings live on a non-reformatable line — the inline NOSONAR\n * stays put against the SonarQube false-positive flag (defensive use, not eval). */\nconst DENIED_HREF_SCHEMES: readonly string[] = ['javascript:', 'data:']; // NOSONAR S1523\n\n/**\n * Validate and return a safe href, or null to discard a dangerous URL.\n * Allows app-relative paths (/foo/bar) and http/https absolute URLs.\n * Blocks javascript:, data:, protocol-relative (//) and anything else.\n */\nexport function sanitizeMarkdownHref(url: string): string | null {\n const trimmed = url.trim();\n // Decode once so percent-encoded schemes (%6A = j, %2F%2F = //) are caught.\n let decoded: string;\n try {\n decoded = decodeURIComponent(trimmed);\n } catch {\n return null;\n }\n const lower = decoded.toLowerCase();\n if (DENIED_HREF_SCHEMES.some(scheme => lower.startsWith(scheme))) {\n return null;\n }\n if (decoded.startsWith('//') || trimmed.startsWith('//')) {\n return null;\n }\n if (trimmed.startsWith('/') || /^https?:\\/\\//i.test(trimmed)) {\n return trimmed;\n }\n return null;\n}\n\n/**\n * Pre-process a segment of raw text (outside any existing markdown link) and\n * convert bare app-relative paths like /account/details into markdown link\n * syntax [/account/details](/account/details) so the main render loop picks\n * them up as clickable anchors.\n *\n * Matches paths that are preceded by whitespace, certain punctuation, or the\n * start of the string, and that begin with /letter to avoid matching lone\n * slashes, protocol-relative URLs (//), or numeric fractions (1/2).\n */\nfunction substituteBarePaths(\n segment: string,\n baseUrl: string,\n subSlug: string,\n known: readonly string[]\n): string {\n return segment.replace(/(^|[\\s(,;:])\\/([a-zA-Z][a-zA-Z0-9\\-_/]*)/g, (_, pre, rest) => {\n // Hoisted out of the template literal: nesting one inside another is\n // unreadable, and the path is needed twice anyway (label + href).\n const path = `/${rest}`;\n\n return `${pre}[${path}](${resolveAppPath(path, baseUrl, subSlug, known)})`;\n });\n}\n\n/**\n * Auto-link bare app-relative paths in raw markdown text while leaving paths\n * that are already inside a markdown link's URL segment ([text](url)) untouched.\n */\nexport function linkifyBareAppPaths(\n raw: string,\n baseUrl = '',\n subSlug = '',\n known: readonly string[] = []\n): string {\n const src = unwrapCodeSpannedPaths(raw);\n let result = '';\n let lastIndex = 0;\n\n for (const match of src.matchAll(LINK_PATTERN)) {\n result += substituteBarePaths(src.slice(lastIndex, match.index), baseUrl, subSlug, known);\n // An href the model already wrote as a markdown link still needs the host.\n result += `[${match[1]}](${resolveAppPath(match[2], baseUrl, subSlug, known)})`;\n lastIndex = (match.index ?? 0) + match[0].length;\n }\n\n result += substituteBarePaths(src.slice(lastIndex), baseUrl, subSlug, known);\n return result;\n}\n\n/**\n * Convert a subset of Markdown to an HTML string safe for innerHTML.\n * Processes characters sequentially so patterns never interfere with\n * each other and unmatched delimiters fall through as literal text.\n *\n * Supported:\n * [text](url) → <a href=\"url\">text</a> (external: target=_blank)\n * **text** → <strong>text</strong>\n * *text* → <em>text</em>\n * \\n → <br>\n * /path → <a href=\"/path\">/path</a> (bare app-relative paths)\n */\nexport function renderMarkdown(\n raw: string,\n baseUrl = '',\n subSlug = '',\n known: readonly string[] = []\n): string {\n return renderMarkdownCore(linkifyBareAppPaths(raw, baseUrl, subSlug, known));\n}\n\ntype TokenMatch = { html: string; consumed: number } | null;\n\nfunction tryLink(raw: string, i: number): TokenMatch {\n if (raw[i] !== '[') return null;\n const m = LINK_ANCHORED_RE.exec(raw.slice(i));\n if (!m) return null;\n const text = escapeHtml(m[1]);\n const href = sanitizeMarkdownHref(m[2]);\n if (href === null) return { html: text, consumed: m[0].length };\n const external = /^https?:\\/\\//i.test(href);\n const attrs = external ? ' target=\"_blank\" rel=\"noopener noreferrer\"' : '';\n return { html: `<a href=\"${escapeHtml(href)}\"${attrs}>${text}</a>`, consumed: m[0].length };\n}\n\nfunction tryBold(raw: string, i: number): TokenMatch {\n if (raw[i] !== '*' || raw[i + 1] !== '*') return null;\n const m = /^\\*\\*([^*\\n]+)\\*\\*/.exec(raw.slice(i));\n return m ? { html: `<strong>${escapeHtml(m[1])}</strong>`, consumed: m[0].length } : null;\n}\n\nfunction tryItalic(raw: string, i: number): TokenMatch {\n if (raw[i] !== '*' || raw[i + 1] === '*') return null;\n const m = /^\\*([^*\\n]+)\\*/.exec(raw.slice(i));\n return m ? { html: `<em>${escapeHtml(m[1])}</em>`, consumed: m[0].length } : null;\n}\n\nconst TOKEN_HANDLERS = [tryLink, tryBold, tryItalic];\n\nfunction matchToken(raw: string, i: number): TokenMatch {\n for (const handler of TOKEN_HANDLERS) {\n const result = handler(raw, i);\n if (result) return result;\n }\n return null;\n}\n\nfunction renderMarkdownCore(raw: string): string {\n let out = '';\n let buf = '';\n let i = 0;\n const flushBuf = (): void => {\n if (buf) {\n out += escapeHtml(buf);\n buf = '';\n }\n };\n while (i < raw.length) {\n const ch = raw[i];\n if (ch === '\\r') {\n i++;\n continue;\n }\n if (ch === '\\n') {\n flushBuf();\n out += '<br>';\n i++;\n continue;\n }\n const match = matchToken(raw, i);\n if (match) {\n flushBuf();\n out += match.html;\n i += match.consumed;\n } else {\n buf += ch;\n i++;\n }\n }\n flushBuf();\n return out;\n}\n","import { OnDestroy, Pipe, PipeTransform } from '@angular/core';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport { NavigationIndexService, PermissionService } from '@posiwise/common-services';\n\nimport { Subscription } from 'rxjs';\n\nimport { renderMarkdown } from './pw-brain-chat-markdown.helpers';\n\n/**\n * Converts a Brain assistant message string (containing a safe subset of\n * Markdown) into an HTML string suitable for `[innerHTML]` binding.\n *\n * Deliberately returns a plain `string`, NOT a `SafeHtml`: Angular sanitizes any\n * string bound to `[innerHTML]`, so the output passes through DomSanitizer on\n * the way to the DOM. `renderMarkdown` already HTML-escapes every user-sourced\n * fragment and allow-lists hrefs, which makes this defence in depth rather than\n * a substitute — two independent passes, neither trusting the other.\n *\n * Nothing is lost by it. The renderer only emits `<a href target rel>`,\n * `<strong>`, `<em>` and `<br>`; Angular's own allow-lists carry `href`\n * (URI_ATTRS) and `rel`/`target` (HTML_ATTRS), so sanitized output is\n * byte-identical to the rendered input. An earlier revision reached for\n * `bypassSecurityTrustHtml` here, which bought nothing and disabled the\n * platform's last line of defence if the renderer ever regressed.\n *\n * Applied only to assistant bubbles; user bubbles keep plain-text rendering.\n *\n * The app-relative paths Brain answers carry (`/settings/communication`) are\n * resolved against `links.frontend_link` from the domain metadata — the same\n * host `auth.service` and `linkedin-confirmation` build their URLs from.\n * `links` lives on the CONFIG object, not on the service, and the service's\n * only public accessor is `appConfig$`, so the latest value is cached here;\n * config resolves at app boot, long before a chat bubble renders.\n */\n@Pipe({ name: 'safeMarkdown' })\nexport class SafeMarkdownPipe implements PipeTransform, OnDestroy {\n private baseUrl = '';\n\n private readonly configSub: Subscription;\n\n constructor(\n private readonly navigationIndex: NavigationIndexService,\n appConfigService: AppConfigService\n ) {\n this.configSub = appConfigService.appConfig$.subscribe(config => {\n this.baseUrl = config?.links?.frontend_link ?? '';\n });\n }\n\n ngOnDestroy(): void {\n this.configSub.unsubscribe();\n }\n\n transform(text: string): string {\n return renderMarkdown(text ?? '', this.baseUrl, this.subscriptionSlug(), this.knownPaths());\n }\n\n /**\n * Every page the palette can reach, used to correct a path the model got\n * nearly right. An unknown path is left alone, never suppressed.\n */\n private knownPaths(): string[] {\n try {\n return this.navigationIndex.entries().map(entry => entry.path);\n } catch {\n return [];\n }\n }\n\n /**\n * Slug the router scopes dashboard pages under (`:slug/faq/:id`). Read per\n * call rather than cached: the user can switch subscription mid-session.\n */\n private subscriptionSlug(): string {\n return PermissionService.selectedSubscription?.slug ?? '';\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Inject,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport { AppState } from '@posiwise/app-store';\nimport {\n BaseHttpService,\n BrainSocketService,\n BrainVoiceService,\n DirectUploadService,\n LocalStorage,\n MCPExecuteResponse,\n MCPOrchestratorService,\n MCPStreamEvent,\n PermissionService,\n VoiceChatService\n} from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\n\nimport { Subject, Subscription } from 'rxjs';\nimport { filter, map, take, takeUntil } from 'rxjs/operators';\n\nimport { Store } from '@ngrx/store';\n\nimport { resolveBrandName } from '../collapsible-sidebar/collapsible-sidebar-brand.helpers';\nimport { DynamicPageContextService } from '../dynamic-page/dynamic-page-context.service';\n\nimport { ChatAttachment, ChatMessage } from './pw-brain-chat.types';\nimport { BrainChatAttachment } from './pw-brain-chat-attachment.controller';\nimport { buildConfirmationMessage } from './pw-brain-chat-confirmation.helpers';\nimport { buildWorkspaceContext } from './pw-brain-chat-context.helpers';\nimport { BrainChatDictation } from './pw-brain-chat-dictation.helpers';\nimport { diffRowsFrom } from './pw-brain-chat-diff.helpers';\nimport { dispatchNavigation, resolveNavigation } from './pw-brain-chat-navigation.helpers';\nimport { BrainChatPersistence } from './pw-brain-chat-persistence.helpers';\nimport { GREETING, SUGGESTED_PROMPTS } from './pw-brain-chat-prompts';\nimport { stickThreadToBottom } from './pw-brain-chat-scroll.helpers';\nimport { BRAIN_CHAT_UPLOAD_APIS } from './pw-brain-chat-upload.token';\nimport { BrainChatVoiceChat } from './pw-brain-chat-voice-chat.helpers';\n\nexport type { ChatMessage, ChatMessageRole, PendingConfirmation } from './pw-brain-chat.types';\n\n// Brain chat panel — posts to brain-api's MCP orchestrator; thread +\n// conversation_id persist per-user in localStorage (#4167).\n@Component({\n selector: 'pw-brain-chat',\n templateUrl: './pw-brain-chat.component.html',\n styleUrls: [\n './pw-brain-chat.component.scss',\n './pw-brain-chat-canvas.scss',\n './pw-brain-chat-content.scss',\n './pw-brain-chat-compose.scss',\n './pw-brain-chat-attachment.scss',\n './pw-brain-chat-voice.scss'\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class PwBrainChatComponent implements OnInit, OnDestroy {\n messages: ChatMessage[] = [];\n draft = '';\n loading = false;\n streamingStage: string | null = null;\n // Live SSE prose accumulator (#51) — partial bubble + caret (ChatGPT-style).\n streamingProse: string | null = null;\n brandName = 'PosiWise';\n userFirstName?: string;\n readonly suggestedPrompts = SUGGESTED_PROMPTS;\n private conversationId: string | null = null;\n private storage: BrainChatPersistence | null = null;\n private streamSub?: Subscription; // held so cancelRequest() can abort the in-flight stream\n private readonly destroy$ = new Subject<void>();\n readonly diffRows = diffRowsFrom;\n readonly dictation: BrainChatDictation; // mic-to-text (#22)\n readonly voiceChat: BrainChatVoiceChat; // full-duplex voice (#58)\n readonly attachment: BrainChatAttachment; // composer file drop\n private sentAttachment: ChatAttachment | null = null; // file on the in-flight send\n @ViewChild('thread') private readonly threadRef?: ElementRef<HTMLElement>;\n\n constructor(\n private readonly orchestrator: MCPOrchestratorService,\n private readonly localStorage: LocalStorage,\n private readonly router: Router,\n private readonly cdr: ChangeDetectorRef,\n private readonly store: Store<AppState>,\n private readonly dynamicPageCtx: DynamicPageContextService,\n @Optional() private readonly appConfigService?: AppConfigService,\n @Optional() private readonly brainSocket?: BrainSocketService,\n @Optional() private readonly brainVoice?: BrainVoiceService,\n @Optional() private readonly voiceChatService?: VoiceChatService,\n @Optional() private readonly directUpload?: DirectUploadService,\n @Optional()\n @Inject(BRAIN_CHAT_UPLOAD_APIS)\n private readonly uploadApis?: Record<string, BaseHttpService>\n ) {\n this.dictation = new BrainChatDictation(\n this.brainVoice,\n () => this.draft,\n text => {\n this.draft = text;\n },\n () => this.cdr.markForCheck()\n );\n this.voiceChat = new BrainChatVoiceChat(\n this.voiceChatService,\n () => this.cdr.markForCheck(),\n (userText, replyText) => this.recordVoiceTurn(userText, replyText)\n );\n this.attachment = new BrainChatAttachment(\n this.directUpload ?? null,\n this.uploadApis ?? null,\n () => PermissionService.selectedSubscription?.id ?? null,\n () => this.cdr.markForCheck()\n );\n }\n\n ngOnInit(): void {\n // What may be attached is discovered from the federated tool catalog,\n // not configured here — see BRAIN_CHAT_UPLOAD_APIS. Best-effort: a\n // failure simply leaves the panel with no upload affordance.\n this.attachment.discover(this.orchestrator.capabilities(), this.destroy$);\n\n // Personalise the welcome greeting with the signed-in user's first name\n // (AuthService persists it to native localStorage 'name' at login);\n // absent/blank → the greeting stays the plain \"Hi, I'm your … Brain\".\n this.userFirstName = localStorage.getItem('name')?.trim() || undefined;\n\n // White-label brand for placeholder + error text (domain company.name).\n this.appConfigService?.appConfig$.pipe(take(1), takeUntil(this.destroy$)).subscribe(c => {\n this.brandName = resolveBrandName(c);\n this.cdr.markForCheck();\n });\n\n // Probe voice-api reachability once — hides the Voice Chat button in\n // envs that haven't onboarded (Phase 5 wires the Vault key + ingress).\n void this.voiceChat.resolveAvailability();\n\n // Wait for the authenticated user before hydrating — a bare take(1)\n // races currentUser=null and orphans the thread (#4167).\n this.store\n .pipe(\n map(app => app?.user?.currentUser ?? null),\n filter((user): user is User => !!user && user.id != null),\n take(1),\n takeUntil(this.destroy$)\n )\n .subscribe(user => {\n this.storage = new BrainChatPersistence(this.localStorage, String(user.id));\n const hydrated = this.storage.readMessages();\n this.messages = hydrated.length\n ? hydrated.map(m => ({\n role: m.role,\n text: m.text,\n markdownEnabled: m.markdownEnabled,\n at: m.at\n }))\n : [];\n if (!hydrated.length) {\n this.pushAssistant(GREETING);\n }\n this.conversationId = this.storage.adoptConversationId();\n this.cdr.markForCheck();\n this.stick(true);\n this.subscribeToServerPush();\n });\n }\n\n // Server→client push (#45): render each pushed message as an assistant bubble.\n private subscribeToServerPush(): void {\n this.brainSocket\n ?.messages$()\n .pipe(takeUntil(this.destroy$))\n .subscribe(message => {\n this.pushAssistant(message.text, true);\n this.cdr.markForCheck();\n });\n }\n\n ngOnDestroy(): void {\n this.dictation.dispose();\n this.voiceChat.dispose();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * Paperclip path. The input is reset after every pick so choosing the same\n * file twice in a row still fires `change` (the browser suppresses it\n * otherwise, and \"nothing happened\" is a maddening bug to hit).\n */\n pickFile(input: HTMLInputElement): void {\n const file = input.files?.[0];\n input.value = '';\n if (file) {\n this.attachment.accept(file);\n }\n }\n\n /**\n * The composer teaches the affordance: with a file staged, the next thing\n * to do is send it, with or without a message. Leaving the generic prompt\n * there left people looking for an upload button that does not exist.\n */\n get composerPlaceholder(): string {\n if (this.attachment.busy) {\n return 'Uploading your file…';\n }\n if (this.attachment.choosing) {\n return 'Pick an action for the file';\n }\n return this.attachment.ready\n ? 'Add a message, or just send'\n : 'Ask a question or tell me what to do…';\n }\n\n send(): void {\n // A dropped file is a message on its own — the user should not have to\n // type something to send it. An upload still in flight blocks the send\n // rather than racing it, so the staged key is always present. A file\n // still waiting for \"which tool?\" blocks it too — sending would drop it.\n const typed = this.draft.trim();\n const staged = this.attachment.current;\n const held = this.attachment.busy || this.attachment.choosing;\n if ((!typed && !this.attachment.ready) || this.loading || held) {\n return;\n }\n const text = typed || `${staged?.title ?? 'Use this file'}: ${staged?.name ?? ''}`;\n this.draft = '';\n this.messages.push({ role: 'user', text, at: Date.now() });\n this.storage?.persistMessages(this.messages);\n this.loading = true;\n this.cdr.markForCheck();\n this.stick(true);\n\n const workspace_context = {\n ...buildWorkspaceContext(\n this.router,\n this.dynamicPageCtx.current,\n PermissionService.selectedSubscription?.id ?? null\n ),\n // Only the staging key and filename — never the bytes, and nothing\n // read out of the file. Null when nothing is attached.\n ...this.attachment.context\n };\n // The file stays attached until a planned call uses it, so a reply that\n // asks for missing details (vendor, due date…) still carries it.\n this.sentAttachment = staged;\n this.streamSub = this.orchestrator\n .executeStream({\n message: text,\n workspace_context,\n conversation_id: this.conversationId ?? undefined\n })\n .pipe(takeUntil(this.destroy$))\n .subscribe({\n next: (event: MCPStreamEvent) => {\n if (event.type === 'stage') {\n this.streamingStage = event.message ?? event.stage ?? null;\n this.cdr.markForCheck();\n } else if (event.type === 'prose' && event.text) {\n // First chunk clears the stage label; chunks append.\n this.streamingStage = null;\n this.streamingProse = (this.streamingProse ?? '') + event.text;\n this.cdr.markForCheck();\n } else if (event.type === 'result' && event.response) {\n this.handleExecuteResponse(event.response);\n } else if (event.type === 'error') {\n this.handleError(event);\n }\n },\n error: err => this.handleError(err),\n // Safety net (AI54): completed with no terminal frame → fail.\n complete: () => {\n if (this.loading) {\n this.handleError(\n new Error(`${this.brandName} Assistant did not return a response.`)\n );\n }\n }\n });\n }\n\n approve(message: ChatMessage): void {\n if (!message.pending || this.loading) {\n return;\n }\n this.loading = true;\n this.cdr.markForCheck();\n const token = message.pending.confirmation_token;\n // Strip pending up front to block double-click; /confirm repopulates it.\n message.pending = undefined;\n message.text = 'Approved — running…';\n this.storage?.persistMessages(this.messages);\n\n this.orchestrator\n .confirm({\n confirmation_token: token,\n conversation_id: this.conversationId ?? undefined\n })\n .pipe(takeUntil(this.destroy$))\n .subscribe({\n next: response => this.handleExecuteResponse(response),\n error: err => this.handleError(err)\n });\n }\n\n cancel(message: ChatMessage): void {\n message.pending = undefined;\n message.text = 'Cancelled — no action was taken.';\n this.storage?.persistMessages(this.messages);\n this.cdr.markForCheck();\n }\n\n // Abort the in-flight request (unsubscribe aborts the fetch) + reset composer.\n cancelRequest(): void {\n if (!this.loading) {\n return;\n }\n this.streamSub?.unsubscribe();\n this.streamSub = undefined;\n this.streamingStage = null;\n this.streamingProse = null;\n this.loading = false;\n this.pushAssistant('Request cancelled.', false);\n this.cdr.markForCheck();\n }\n\n trackByIndex(index: number, _item: ChatMessage): number {\n return index;\n }\n\n // Welcome-prompt / quick-action chip → prefill the draft and send.\n usePrompt(text: string): void {\n if (this.loading) {\n return;\n }\n this.draft = text;\n this.send();\n }\n\n // Start a fresh thread — clears messages + conversation, re-greets.\n newChat(): void {\n if (this.loading) {\n return;\n }\n this.messages = [];\n this.conversationId = null;\n this.storage?.setConversationId('');\n this.pushAssistant(GREETING);\n this.cdr.markForCheck();\n this.stick(true);\n }\n\n private handleExecuteResponse(response: MCPExecuteResponse): void {\n this.streamingStage = null;\n this.streamingProse = null;\n this.persistConversationId(response.conversation_id);\n // ONLY on a real success. A confirmation card means the tool has not run\n // yet: clearing there lost the file the moment you approved, so a call\n // that then failed (wrong vendor, say) left your follow-up answer with\n // no file attached -- and the planner, seeing no upload context, routed\n // the reply to an unrelated tool.\n if (response.result_status === 'success') {\n this.attachment.clearIfConsumed(this.sentAttachment);\n }\n if (response.needs_confirmation && response.confirmation_token) {\n this.messages.push(buildConfirmationMessage(response, response.confirmation_token));\n this.stick(false);\n } else if (response.result_status === 'success') {\n this.applySuccessResult(response);\n } else {\n this.pushAssistant(response.reason ?? 'I could not complete that request.');\n }\n this.storage?.persistMessages(this.messages);\n this.loading = false;\n this.cdr.markForCheck();\n }\n\n private applySuccessResult(response: MCPExecuteResponse): void {\n const handled = dispatchNavigation(resolveNavigation(response.tool_result), {\n pushAssistant: (text, markdownEnabled) => this.pushAssistant(text, markdownEnabled),\n navigateByUrl: url => this.router.navigateByUrl(url),\n assignExternal: url => window.location.assign(url)\n });\n if (handled) {\n return;\n }\n this.pushAssistant(\n response.response ?? JSON.stringify(response.tool_result ?? {}, null, 2)\n );\n // Page-aware grounding: when the answer came from this page's docs, tag\n // the just-pushed bubble so it renders a \"Documented on:\" provenance chip.\n const sourcePage = response.grounded_source_page?.trim();\n const lastMessage = this.messages.at(-1);\n if (sourcePage && lastMessage) {\n lastMessage.sourcePage = sourcePage;\n this.storage?.persistMessages(this.messages);\n }\n }\n\n private handleError(err: unknown): void {\n this.streamingStage = null;\n this.streamingProse = null;\n const e = (err ?? {}) as {\n error?: { detail?: string; message?: string };\n message?: string;\n };\n const message =\n e.error?.message ??\n e.error?.detail ??\n e.message ??\n `${this.brandName} Assistant request failed.`;\n this.pushAssistant(message, false);\n this.loading = false;\n this.cdr.markForCheck();\n }\n\n private persistConversationId(id?: string | null): void {\n if (!id || id === this.conversationId) {\n return;\n }\n this.conversationId = id;\n this.storage?.setConversationId(id);\n }\n\n private pushAssistant(text: string, markdownEnabled = true): void {\n this.messages.push({ role: 'assistant', text, markdownEnabled, at: Date.now() });\n this.storage?.persistMessages(this.messages);\n this.stick(false);\n }\n\n /** Voice session turn completed — record the spoken exchange in the thread\n * so the conversation survives the overlay (plain text: it was speech). */\n private recordVoiceTurn(userText: string, replyText: string): void {\n if (userText) this.messages.push({ role: 'user', text: userText, at: Date.now() });\n if (replyText) this.pushAssistant(replyText, false);\n else this.storage?.persistMessages(this.messages);\n this.cdr.markForCheck();\n }\n\n private stick(force: boolean): void {\n stickThreadToBottom(() => this.threadRef?.nativeElement, force);\n }\n}\n","<div\n class=\"pw-brain-chat\"\n (dragenter)=\"attachment.dragEnter($event)\"\n (dragover)=\"attachment.dragOver($event)\"\n (dragleave)=\"attachment.dragLeave($event)\"\n (drop)=\"attachment.drop($event)\"\n>\n @if (attachment.dragActive) {\n <div class=\"pw-brain-chat__dropzone\" aria-hidden=\"true\">\n <div class=\"pw-brain-chat__dropzone-frame\">\n <i class=\"fas fa-file-arrow-up pw-brain-chat__dropzone-icon\" aria-hidden=\"true\"></i>\n <span class=\"pw-brain-chat__dropzone-title\">{{ attachment.label }}</span>\n <span class=\"pw-brain-chat__dropzone-hint\">{{ attachment.hint }}</span>\n </div>\n </div>\n }\n <!-- The sidebar host header owns title + close + live status + New chat\n (SidebarContent.status / headerActions) — so the panel body starts at\n the thread, no duplicate status strip. newChat() is invoked from the\n host header action. -->\n <div #thread pwBrainChatThread class=\"pw-brain-chat__thread\" role=\"log\" aria-live=\"polite\">\n @if (messages.length <= 1 && !loading && !streamingProse) {\n <pw-brain-chat-welcome\n [userFirstName]=\"userFirstName\"\n [prompts]=\"suggestedPrompts\"\n (pick)=\"usePrompt($event)\"\n ></pw-brain-chat-welcome>\n } @else {\n @for (m of messages; track trackByIndex($index, m)) {\n @if (m.role === 'user') {\n <div class=\"pw-brain-chat__turn pw-brain-chat__turn--user\">\n <div class=\"pw-brain-chat__user-bubble\"><pre class=\"pw-brain-chat__user-text\">{{ m.text }}</pre></div>\n @if (m.at) {\n <span class=\"pw-brain-chat__time\">{{ m.at | date: 'shortTime' }}</span>\n }\n </div>\n } @else {\n <div class=\"pw-brain-chat__turn pw-brain-chat__turn--bot\">\n <div class=\"pw-brain-chat__spine\" aria-hidden=\"true\">\n <span class=\"pw-brain-chat__node\"><i class=\"fas fa-brain\"></i></span>\n <span class=\"pw-brain-chat__line\"></span>\n </div>\n <div class=\"pw-brain-chat__artifacts\">\n <span class=\"pw-brain-chat__who\">\n {{ brandName }} Brain\n @if (m.at) {\n <span class=\"pw-brain-chat__time\">· {{ m.at | date: 'shortTime' }}</span>\n }\n </span>\n <div class=\"pw-brain-chat__bubble\">\n @if (m.markdownEnabled) {\n <div class=\"pw-brain-chat__text\" [innerHTML]=\"m.text | safeMarkdown\"></div>\n } @else {\n <pre class=\"pw-brain-chat__text\">{{ m.text }}</pre>\n }\n </div>\n @if (m.sourcePage) {\n <div class=\"pw-brain-chat__source\" role=\"note\">\n <i class=\"fas fa-file-lines pw-brain-chat__source-icon\" aria-hidden=\"true\"></i>\n <span class=\"pw-brain-chat__source-text\">Documented on: {{ m.sourcePage }}</span>\n </div>\n }\n @if (m.pending) {\n <pw-brain-chat-confirm\n [pending]=\"m.pending\"\n [loading]=\"loading\"\n (approveEvent)=\"approve(m)\"\n (cancelEvent)=\"cancel(m)\"\n ></pw-brain-chat-confirm>\n }\n </div>\n </div>\n }\n }\n }\n\n @if (loading && streamingProse) {\n <!-- prose streams token-by-token into a partial bot turn; caret = writing (#51) -->\n <div class=\"pw-brain-chat__turn pw-brain-chat__turn--bot\">\n <div class=\"pw-brain-chat__spine\" aria-hidden=\"true\">\n <span class=\"pw-brain-chat__node\"><i class=\"fas fa-brain\"></i></span>\n <span class=\"pw-brain-chat__line\"></span>\n </div>\n <div class=\"pw-brain-chat__artifacts\">\n <span class=\"pw-brain-chat__who\">{{ brandName }} Brain</span>\n <div class=\"pw-brain-chat__bubble\">\n <pre class=\"pw-brain-chat__text\"\n >{{ streamingProse }}<span class=\"pw-brain-chat__caret\" aria-hidden=\"true\"></span></pre>\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (loading && !streamingProse) {\n <div class=\"pw-brain-chat__loading\">\n <i class=\"fas fa-circle-notch fa-spin pw-brain-chat__loading-spinner\" aria-hidden=\"true\"></i>\n <span aria-live=\"polite\">{{ streamingStage || 'Working…' }}</span>\n <button type=\"button\" class=\"pw-brain-chat__iconbtn pw-brain-chat__stop\" (click)=\"cancelRequest()\"\n [ngbTooltip]=\"'Stop request'\" container=\"body\" aria-label=\"Stop request\">\n <i class=\"fas fa-stop\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n <!-- Voice session / dictation → animated Sonar overlay (#51) -->\n @if (voiceChat.isActive || voiceChat.error || dictation.phase === 'listening' || dictation.phase === 'processing' || dictation.error) {\n <pw-brain-chat-voice-overlay\n [voice]=\"voiceChat\"\n [dictation]=\"dictation\"\n (end)=\"voiceChat.isActive || voiceChat.error ? voiceChat.stop() : dictation.dismiss()\"\n ></pw-brain-chat-voice-overlay>\n }\n\n <div class=\"pw-brain-chat__compose\">\n @if (messages.length > 1) {\n <pw-brain-chat-quick (pick)=\"usePrompt($event)\"></pw-brain-chat-quick>\n }\n <label class=\"visually-hidden\" for=\"pw-brain-chat-input\">Message {{ brandName }} Brain</label>\n <div class=\"pw-brain-chat__field\">\n @if (attachment.current; as file) {\n <div\n class=\"pw-brain-chat__attachment\"\n [class.pw-brain-chat__attachment--error]=\"file.status === 'error'\"\n [style.--pw-upload-progress]=\"file.percent + '%'\"\n >\n <span class=\"pw-brain-chat__attachment-icon\">\n <i class=\"fas\" [ngClass]=\"attachment.icon()\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"pw-brain-chat__attachment-body\">\n <span class=\"pw-brain-chat__attachment-name\" [title]=\"file.name\">{{ file.name }}</span>\n <output class=\"pw-brain-chat__attachment-meta\" aria-live=\"polite\">{{ attachment.meta() }}</output>\n </span>\n <button\n type=\"button\"\n class=\"pw-brain-chat__iconbtn\"\n (click)=\"attachment.remove()\"\n ngbTooltip=\"Remove file\"\n container=\"body\"\n aria-label=\"Remove attached file\"\n ><i class=\"fas fa-xmark\" aria-hidden=\"true\"></i></button>\n @if (file.status === 'uploading') {\n <span class=\"pw-brain-chat__attachment-progress\"></span>\n }\n </div>\n @if (attachment.choosing) {\n <fieldset class=\"pw-brain-chat__choice\" aria-label=\"What should I do with this file?\">\n <span class=\"pw-brain-chat__choice-prompt\">What should I do with this file?</span>\n <div class=\"pw-brain-chat__choice-options\">\n @for (option of attachment.choices; track option.tool) {\n <button\n type=\"button\"\n class=\"pw-brain-chat__chip\"\n (click)=\"attachment.choose(option)\"\n >{{ attachment.choiceLabel(option) }}</button>\n }\n </div>\n </fieldset>\n }\n }\n <div class=\"pw-brain-chat__field-row\">\n <textarea\n id=\"pw-brain-chat-input\"\n class=\"pw-brain-chat__input\"\n rows=\"1\"\n [(ngModel)]=\"draft\"\n [placeholder]=\"composerPlaceholder\"\n (keydown.enter)=\"$event.preventDefault(); send()\"\n [attr.aria-label]=\"composerPlaceholder\"\n ></textarea>\n <div class=\"pw-brain-chat__tools\">\n @if (attachment.enabled) {\n <label for=\"pw-brain-chat-file-input\" class=\"visually-hidden\">Attach file</label>\n <input\n #fileInput\n id=\"pw-brain-chat-file-input\"\n type=\"file\"\n class=\"visually-hidden\"\n [accept]=\"attachment.acceptAttr\"\n (change)=\"pickFile(fileInput)\"\n />\n <button\n type=\"button\"\n class=\"pw-brain-chat__iconbtn\"\n [disabled]=\"loading || attachment.busy\"\n (click)=\"fileInput.click()\"\n ngbTooltip=\"Attach a file\"\n container=\"body\"\n aria-label=\"Attach a file\"\n ><i class=\"fas fa-paperclip\" aria-hidden=\"true\"></i></button>\n }\n <button\n type=\"button\"\n class=\"pw-brain-chat__iconbtn pw-brain-chat__mic\"\n [class.pw-brain-chat__mic--recording]=\"dictation.isRecording\"\n [disabled]=\"loading || dictation.phase === 'processing'\"\n (click)=\"dictation.toggle(loading)\"\n [ngbTooltip]=\"dictation.phase === 'listening' ? 'Stop dictation' : (dictation.phase === 'processing' ? 'Processing…' : 'Dictate')\"\n container=\"body\"\n [attr.aria-label]=\"dictation.phase === 'listening' ? 'Stop dictation' : 'Dictate with your voice'\"\n [attr.aria-pressed]=\"dictation.isRecording\"\n ><i class=\"fas fa-microphone\" aria-hidden=\"true\"></i></button>\n @if (voiceChat.available) {\n <button\n type=\"button\"\n class=\"pw-brain-chat__iconbtn\"\n [disabled]=\"loading || dictation.isRecording\"\n (click)=\"voiceChat.toggle(loading)\"\n [ngbTooltip]=\"voiceChat.isActive ? 'End voice chat' : 'Voice chat'\"\n container=\"body\"\n [attr.aria-label]=\"voiceChat.isActive ? 'End voice chat' : 'Start voice chat'\"\n [attr.aria-pressed]=\"voiceChat.isActive\"\n >\n @switch (voiceChat.visual) {\n @case ('loader') { <i class=\"fas fa-circle-notch fa-spin\" aria-hidden=\"true\"></i> }\n @case ('wave') { <i class=\"fas fa-volume-high\" aria-hidden=\"true\"></i> }\n <!-- fa-waveform-lines (FA Pro, shipped in assets/fontawesome) — the\n canonical \"voice mode\" glyph; fa-comment-dots read as a second\n text-chat button. -->\n @default { <i class=\"fas fa-waveform-lines\" aria-hidden=\"true\"></i> }\n }\n </button>\n }\n <button\n type=\"button\"\n class=\"pw-brain-chat__send\"\n [class.pw-brain-chat__send--stop]=\"loading\"\n [disabled]=\"!loading && ((!draft.trim() && !attachment.ready) || attachment.busy || attachment.choosing)\"\n (click)=\"loading ? cancelRequest() : send()\"\n [ngbTooltip]=\"loading ? 'Stop request' : 'Send message'\"\n container=\"body\"\n [attr.aria-label]=\"loading ? 'Stop request' : 'Send message'\"\n >\n <i class=\"fas\" [ngClass]=\"loading ? 'fa-stop' : 'fa-paper-plane'\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n <div class=\"pw-brain-chat__disclaimer\" role=\"note\">\n <i class=\"fas fa-triangle-exclamation\" aria-hidden=\"true\"></i>\n AI may be inaccurate — verify before acting.\n </div>\n </div>\n</div>\n","import { Component, Input, OnChanges } from '@angular/core';\n\nimport { HelperService } from '@posiwise/helper-service';\n\ninterface MonogramTint {\n bg: string;\n fg: string;\n}\n\n/**\n * Soft, muted tints for the initials-monogram fallback. Deliberately NOT the\n * tenant accent (`--first`) — per the design-system EUREKA constraint the accent\n * is a stateful spotlight only and must never be used to establish identity.\n * A company is mapped to one tint deterministically by name hash, so the same\n * company always renders the same colour.\n */\nconst MONOGRAM_TINTS: MonogramTint[] = [\n { bg: '#E8ECFB', fg: '#3B4FB0' }, // indigo\n { bg: '#E5F3EE', fg: '#1F7A57' }, // teal\n { bg: '#FBEEE0', fg: '#A35B12' }, // amber\n { bg: '#F6E7EE', fg: '#A03A6B' }, // rose\n { bg: '#E6F0F6', fg: '#2A6F90' }, // sky\n { bg: '#EFEAF7', fg: '#6A3FA0' }, // violet\n { bg: '#EDEFE6', fg: '#5A6A2E' }, // olive\n { bg: '#F7EBE6', fg: '#9A4A2E' } // terracotta\n];\n\n@Component({\n selector: 'pw-clearbit-icon',\n templateUrl: './clearbit-icon.component.html',\n styleUrls: ['./clearbit-icon.component.scss'],\n\n standalone: false\n})\nexport class ClearBitIconComponent implements OnChanges {\n @Input() src: string | null = null;\n @Input() altText = 'Logo';\n /** Company name — drives the initials shown when no real logo resolves. */\n @Input() name = '';\n /** Square edge length in px — applied to both the logo image and the monogram tile. */\n @Input() size = 25;\n /** Layout/margin classes for the rendered icon — override for centred contexts. */\n @Input() iconClass = 'me-2 mt-1';\n\n logoSrc: string | null = null;\n showFallback = true;\n initials = '#';\n tint: MonogramTint = MONOGRAM_TINTS[0];\n\n get tileRadius(): number {\n return Math.max(4, Math.round(this.size * 0.24));\n }\n\n get tileFontSize(): number {\n return Math.max(10, Math.round(this.size * 0.42));\n }\n\n ngOnChanges() {\n this.logoSrc = this.src ? (HelperService.getLogoByUrl(this.src) ?? null) : null;\n this.showFallback = !this.logoSrc;\n this.buildMonogram();\n }\n\n /** Called when a resolved logo URL fails to load — degrade to the monogram. */\n onLogoError() {\n this.showFallback = true;\n }\n\n private buildMonogram() {\n // Initials derive ONLY from `name` — never from `altText`. `altText` is the\n // image alt / aria-label (e.g. \"Logo\"), and folding it in here made an\n // unbound `name` masquerade as real initials (\"Logo\" → \"LO\"). With no name,\n // deriveInitials('') returns the '#' unknown-sigil, so a missing binding\n // fails visibly instead of silently wrong.\n const label = (this.name || '').trim();\n this.initials = ClearBitIconComponent.deriveInitials(label);\n this.tint = MONOGRAM_TINTS[ClearBitIconComponent.hash(label) % MONOGRAM_TINTS.length];\n }\n\n private static deriveInitials(label: string): string {\n const words = label.match(/[a-z0-9]+/gi) || [];\n if (words.length === 0) {\n return '#';\n }\n if (words.length === 1) {\n return words[0].substring(0, 2).toUpperCase();\n }\n return (words[0][0] + words[1][0]).toUpperCase();\n }\n\n private static hash(value: string): number {\n let hash = 0;\n for (let i = 0; i < value.length; i++) {\n hash = (hash * 31 + value.charCodeAt(i)) >>> 0; // NOSONAR: charCodeAt is intentional — hashes per UTF-16 code unit for stable per-name fallback icon color; swapping to codePointAt would change existing color assignments for non-ASCII names.\n }\n return hash;\n }\n}\n","@if (showFallback) {\n <span class=\"company-monogram\"\n [ngClass]=\"iconClass\"\n [attr.aria-label]=\"altText\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n [style.borderRadius.px]=\"tileRadius\"\n [style.fontSize.px]=\"tileFontSize\"\n [style.background-color]=\"tint.bg\"\n [style.color]=\"tint.fg\">{{ initials }}</span>\n} @else {\n <img [src]=\"logoSrc\"\n [alt]=\"altText\"\n (error)=\"onLogoError()\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n class=\"img-fluid company-logo\"\n [ngClass]=\"iconClass\" />\n}\n","import { Injectable } from '@angular/core';\n\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport { SidebarContent } from './collapsible-sidebar.types';\n\n// Re-exported so existing consumers keep importing these from the service path.\nexport * from './collapsible-sidebar.types';\n\n/**\n * CollapsibleSidebarService manages dynamic sidebar content\n *\n * This service allows any module to register, update, or remove sidebar content.\n * It uses observables to notify components of state changes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CollapsibleSidebarService {\n private readonly sidebarContentMap = new Map<string, SidebarContent>();\n private readonly sidebarExpandedSubject = new BehaviorSubject<boolean>(false);\n private readonly sidebarContentSubject = new BehaviorSubject<SidebarContent | null>(null);\n private readonly activeContentIdSubject = new BehaviorSubject<string | null>(null);\n\n /**\n * Observable for sidebar expanded/collapsed state\n */\n sidebarExpanded$: Observable<boolean> = this.sidebarExpandedSubject.asObservable();\n\n /**\n * Observable for current sidebar content\n */\n sidebarContent$: Observable<SidebarContent | null> = this.sidebarContentSubject.asObservable();\n\n /**\n * Observable for currently active content ID\n */\n activeContentId$: Observable<string | null> = this.activeContentIdSubject.asObservable();\n\n /**\n * Register sidebar content that can be triggered by a module\n * @param content - The sidebar content configuration\n */\n registerContent(content: SidebarContent): void {\n this.sidebarContentMap.set(content.id, content);\n }\n\n /**\n * Unregister sidebar content\n * @param contentId - The ID of the content to remove\n */\n unregisterContent(contentId: string): void {\n this.sidebarContentMap.delete(contentId);\n\n // If the removed content was active, clear it\n if (this.activeContentIdSubject.value === contentId) {\n this.activeContentIdSubject.next(null);\n this.sidebarContentSubject.next(null);\n }\n }\n\n /**\n * Load and display sidebar content by ID\n * @param contentId - The ID of the content to load\n */\n loadContent(contentId: string): void {\n const content = this.sidebarContentMap.get(contentId);\n\n if (!content) {\n return;\n }\n\n this.activeContentIdSubject.next(contentId);\n this.sidebarContentSubject.next(content);\n this.sidebarExpandedSubject.next(true);\n }\n\n /**\n * Load a panel and seed it with one-shot inputs.\n *\n * The host re-mounts the panel component on every load and `Object.assign`s\n * `content.data` onto the fresh instance, so this is how a caller opens a\n * panel in a particular starting state — e.g. the command palette opening\n * the Brain panel with the user's typed query already in the composer.\n *\n * @param contentId - The ID of the content to load\n * @param data - Fields copied onto the newly mounted panel instance\n */\n loadContentWithData(contentId: string, data: Record<string, unknown>): void {\n const content = this.sidebarContentMap.get(contentId);\n\n if (!content) {\n return;\n }\n\n this.sidebarContentMap.set(contentId, { ...content, data: { ...content.data, ...data } });\n this.loadContent(contentId);\n }\n\n /**\n * Toggle sidebar expanded/collapsed state\n */\n toggleSidebar(): void {\n this.sidebarExpandedSubject.next(!this.sidebarExpandedSubject.value);\n }\n\n /**\n * Expand the sidebar\n */\n expandSidebar(): void {\n this.sidebarExpandedSubject.next(true);\n }\n\n /**\n * Collapse the sidebar\n */\n collapseSidebar(): void {\n this.sidebarExpandedSubject.next(false);\n }\n\n /**\n * Get current expanded state synchronously\n */\n isExpanded(): boolean {\n return this.sidebarExpandedSubject.value;\n }\n\n /**\n * Get currently active content ID synchronously\n */\n getActiveContentId(): string | null {\n return this.activeContentIdSubject.value;\n }\n\n /**\n * Get all registered content IDs\n */\n getRegisteredContentIds(): string[] {\n return Array.from(this.sidebarContentMap.keys());\n }\n\n /**\n * Clear all sidebar content and collapse\n */\n clearAll(): void {\n this.sidebarContentMap.clear();\n this.activeContentIdSubject.next(null);\n this.sidebarContentSubject.next(null);\n this.sidebarExpandedSubject.next(false);\n }\n}\n","import { Directive, HostListener } from '@angular/core';\n\nimport { CollapsibleSidebarService } from './collapsible-sidebar.service';\n\n/**\n * Listens for Ctrl+Shift+A globally and toggles the PosiWise Assistant chat panel.\n * Applied via hostDirectives on CollapsibleSidebarComponent.\n */\n@Directive({\n selector: '[pwCollapsibleSidebarKeyboardShortcut]',\n standalone: true\n})\nexport class CollapsibleSidebarKeyboardShortcutDirective {\n constructor(private readonly sidebarService: CollapsibleSidebarService) {}\n\n @HostListener('document:keydown', ['$event'])\n onKeydown(event: KeyboardEvent): void {\n if (event.ctrlKey && event.shiftKey && event.key.toLowerCase() === 'a') {\n event.preventDefault();\n if (\n this.sidebarService.isExpanded() &&\n this.sidebarService.getActiveContentId() === 'posiwise-brain'\n ) {\n this.sidebarService.collapseSidebar();\n } else {\n this.sidebarService.loadContent('posiwise-brain');\n }\n }\n }\n}\n","/**\n * Track the live `nav.navbar.fixed-top` height and publish it as the\n * `--pw-collapsible-sidebar-top` CSS custom property on `<html>`, so the\n * drawer always docks flush under the navbar in every consumer frontend\n * (main, cloudolive, products, future spinouts) without each app needing\n * its own ResizeObserver in its layout shell.\n */\nexport interface NavbarOffsetTracker {\n detach(): void;\n}\n\nexport function attachNavbarOffsetTracker(doc: Document): NavbarOffsetTracker {\n let resizeObserver: ResizeObserver | null = null;\n let retryHandle: number | null = null;\n let detached = false;\n\n const sync = (nav: HTMLElement): void => {\n const height = Math.round(nav.getBoundingClientRect().height);\n if (height > 0) {\n doc.documentElement.style.setProperty('--pw-collapsible-sidebar-top', `${height}px`);\n }\n };\n\n const tryAttach = (): void => {\n if (detached) return;\n const nav = doc.querySelector<HTMLElement>('nav.navbar.fixed-top');\n if (!nav) {\n // Navbar not mounted yet (auth gate, lazy layout) — retry until detach.\n retryHandle = window.setTimeout(() => {\n retryHandle = null;\n tryAttach();\n }, 100);\n return;\n }\n sync(nav);\n if (typeof ResizeObserver !== 'undefined') {\n resizeObserver = new ResizeObserver(() => sync(nav));\n resizeObserver.observe(nav);\n }\n };\n\n tryAttach();\n\n return {\n detach(): void {\n detached = true;\n if (resizeObserver) {\n resizeObserver.disconnect();\n resizeObserver = null;\n }\n if (retryHandle !== null) {\n clearTimeout(retryHandle);\n retryHandle = null;\n }\n }\n };\n}\n","/**\n * Pure helpers for the collapsible-sidebar host — extracted so the host\n * component stays within the C1 size budget. Kept Angular-runtime-free\n * (only the `Type` type is imported) so they are unit-testable in isolation.\n */\nimport { Type } from '@angular/core';\n\nimport { SidebarContent } from './collapsible-sidebar.service';\n\n/**\n * Build the Assistant panel's SidebarContent descriptor — title + inline status\n * (rendered next to the title, costing no extra vertical space) + the New-chat\n * header action. `component` is passed in so this stays a pure function.\n */\nexport function buildBrainPanelContent(brand: string, component: Type<unknown>): SidebarContent {\n return {\n id: 'posiwise-brain',\n title: `${brand} Assistant`,\n titleKey: 'BrainChat.Panel.Title',\n titleParams: { brand },\n component,\n status: 'Connected · long-term memory on',\n beta: true,\n headerActions: [{ id: 'newChat', icon: 'fas fa-plus', ariaLabel: 'New chat' }]\n };\n}\n\n/**\n * Invoke a header action by calling the same-named public method on the mounted\n * panel instance (e.g. Brain's `newChat`). No-op if the method is absent so a\n * misconfigured descriptor fails silently rather than throwing.\n */\nexport function invokePanelMethod(instance: unknown, methodId: string): void {\n const handler = (instance as Record<string, unknown> | undefined)?.[methodId];\n if (typeof handler === 'function') {\n handler.call(instance);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ComponentRef,\n Inject,\n Injector,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\n\nimport { Subject } from 'rxjs';\nimport { take, takeUntil } from 'rxjs/operators';\n\nimport { PwBrainChatComponent } from '../brain-chat/pw-brain-chat.component';\n\nimport {\n CollapsibleSidebarService,\n SidebarContent,\n SidebarHeaderAction\n} from './collapsible-sidebar.service';\nimport { DEFAULT_BRAND, resolveBrandName } from './collapsible-sidebar-brand.helpers';\nimport { CollapsibleSidebarKeyboardShortcutDirective } from './collapsible-sidebar-keyboard-shortcut.directive';\nimport {\n attachNavbarOffsetTracker,\n NavbarOffsetTracker\n} from './collapsible-sidebar-navbar-offset.helpers';\nimport { buildBrainPanelContent, invokePanelMethod } from './collapsible-sidebar-panel.helpers';\n\n@Component({\n selector: 'pw-collapsible-sidebar',\n templateUrl: './collapsible-sidebar.component.html',\n styleUrls: [\n './collapsible-sidebar.component.scss',\n './collapsible-sidebar-header.scss',\n './collapsible-sidebar-content.scss'\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n hostDirectives: [CollapsibleSidebarKeyboardShortcutDirective]\n})\nexport class CollapsibleSidebarComponent implements OnInit, AfterViewInit, OnDestroy {\n @ViewChild('contentContainer', { read: ViewContainerRef }) contentContainer!: ViewContainerRef;\n\n /**\n * When true, the drawer is a flex sibling of the page: main content shrinks (GitLab issue-board style).\n * When false, the drawer is fixed over the viewport with a backdrop.\n */\n @Input({ transform: booleanAttribute }) embedInLayout = false;\n\n /**\n * When false, width/transform transitions are off so the first paint after\n * a full page load does not briefly animate or show border/shadow flash.\n */\n transitionReady = false;\n\n isExpanded = false;\n currentContent: SidebarContent | null = null;\n private componentRef: ComponentRef<unknown> | null = null;\n private navbarOffsetTracker: NavbarOffsetTracker | null = null;\n private readonly destroy$ = new Subject<void>();\n\n constructor(\n private readonly sidebarService: CollapsibleSidebarService,\n private readonly injector: Injector,\n private readonly cdr: ChangeDetectorRef,\n @Inject(DOCUMENT) private readonly document: Document,\n @Optional() private readonly appConfigService?: AppConfigService\n ) {}\n\n ngOnInit(): void {\n // Self-register the Brain (MCP) panel so every consumer frontend\n // works by rendering <pw-collapsible-sidebar>; registerContent is\n // idempotent, slot NOT unregistered on destroy (#4167). appConfig$\n // is a BehaviorSubject so the branded title resolves synchronously,\n // before the navbar can trigger loadContent().\n this.registerBrainPanel(DEFAULT_BRAND);\n this.appConfigService?.appConfig$\n .pipe(take(1))\n .subscribe(config => this.registerBrainPanel(resolveBrandName(config)));\n\n // Subscribe to expanded state\n this.sidebarService.sidebarExpanded$\n .pipe(takeUntil(this.destroy$))\n .subscribe(isExpanded => {\n this.isExpanded = isExpanded;\n this.cdr.markForCheck();\n });\n }\n\n ngAfterViewInit(): void {\n // `sidebarContent$` is a BehaviorSubject — it emits synchronously on\n // subscribe. Subscribing in ngOnInit would fire before `contentContainer`\n // (@ViewChild) is bound, so `loadComponent()` bails with \"Content\n // container not found\". #4167 (open-on-navigate-back) keeps the slot\n // populated, so subscribe AFTER the view init so the first emission lands\n // with `contentContainer` wired up.\n this.sidebarService.sidebarContent$.pipe(takeUntil(this.destroy$)).subscribe(content => {\n this.currentContent = content;\n\n if (content) {\n this.loadComponent(content);\n } else {\n this.clearComponent();\n }\n\n this.cdr.markForCheck();\n });\n\n // Double rAF: wait until after layout so we do not trigger transitions from mount → closed.\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n this.transitionReady = true;\n this.cdr.markForCheck();\n });\n });\n\n // Track the live navbar height so the drawer always docks flush\n // under it across every consumer frontend (main, cloudolive,\n // products, future spinouts) — without each app needing its own\n // ResizeObserver in its layout shell.\n this.navbarOffsetTracker = attachNavbarOffsetTracker(this.document);\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.clearComponent();\n this.navbarOffsetTracker?.detach();\n this.navbarOffsetTracker = null;\n }\n\n /** Register (idempotently) the Assistant panel under the given brand. */\n private registerBrainPanel(brand: string): void {\n this.sidebarService.registerContent(buildBrainPanelContent(brand, PwBrainChatComponent));\n }\n\n /** Delegate a header action to the same-named method on the mounted panel. */\n invokeHeaderAction(action: SidebarHeaderAction): void {\n invokePanelMethod(this.componentRef?.instance, action.id);\n }\n\n /**\n * Load and render dynamic component based on sidebar content\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private loadComponent(content: SidebarContent): void {\n this.clearComponent();\n\n if (!this.contentContainer) {\n console.warn('Content container not found');\n return;\n }\n\n // Check if component is null or undefined\n if (!content.component) {\n console.warn('No component provided for sidebar content:', content.id);\n return;\n }\n\n // Create component dynamically\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const componentRef = this.contentContainer.createComponent(content.component as any, {\n injector: this.injector\n });\n\n // Set inputs if data provided\n if (content.data) {\n Object.assign(componentRef.instance, content.data);\n }\n\n this.componentRef = componentRef;\n }\n\n private clearComponent(): void {\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n if (this.contentContainer) {\n this.contentContainer.clear();\n }\n }\n\n closeSidebar(): void {\n this.sidebarService.collapseSidebar();\n }\n\n toggleSidebar(): void {\n this.sidebarService.toggleSidebar();\n }\n}\n","<div\n class=\"pw-collapsible-sidebar-host\"\n [class.pw-collapsible-sidebar-host--embedded]=\"embedInLayout\"\n [class.pw-collapsible-sidebar-host--transition-ready]=\"transitionReady\"\n>\n @if (isExpanded && !embedInLayout) {\n <button\n type=\"button\"\n class=\"pw-collapsible-sidebar-backdrop\"\n aria-label=\"Close side panel\"\n (click)=\"closeSidebar()\"\n ></button>\n }\n\n <aside\n class=\"pw-collapsible-sidebar\"\n [class.expanded]=\"isExpanded\"\n [attr.aria-hidden]=\"!isExpanded\"\n [style.--pw-drawer-width]=\"currentContent?.width\"\n >\n <div class=\"sidebar-header\">\n <div class=\"sidebar-header__lead\">\n <div class=\"sidebar-title-group\">\n <h2 class=\"sidebar-title\">\n @if (currentContent?.titleKey) {\n {{ currentContent!.titleKey! | transloco: currentContent?.titleParams }}\n } @else {\n {{ currentContent?.title ?? 'Details' }}\n }\n </h2>\n @if (currentContent?.beta) {\n <span class=\"sidebar-badge\">{{ 'BrainChat.Badge.Beta' | transloco }}</span>\n }\n </div>\n @if (currentContent?.status) {\n <span class=\"sidebar-status\" [attr.title]=\"currentContent?.status\">\n <span class=\"sidebar-status__dot\" aria-hidden=\"true\"></span>\n <span class=\"sidebar-status__text\">{{ currentContent?.status }}</span>\n </span>\n }\n </div>\n <div class=\"sidebar-header__actions\">\n @for (action of currentContent?.headerActions ?? []; track action.id) {\n <button\n type=\"button\"\n class=\"sidebar-action\"\n [attr.aria-label]=\"action.ariaLabel\"\n [attr.title]=\"action.ariaLabel\"\n (click)=\"invokeHeaderAction(action)\"\n >\n <i class=\"{{ action.icon }}\" aria-hidden=\"true\"></i>\n </button>\n }\n <button\n type=\"button\"\n class=\"close-btn\"\n aria-label=\"Close sidebar\"\n (click)=\"closeSidebar()\"\n >\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n\n <div class=\"sidebar-content\">\n <div #contentContainer></div>\n </div>\n </aside>\n</div>\n","import { Directive, HostListener, Input, isDevMode } from '@angular/core';\n\nimport { CollapsibleSidebarService } from './collapsible-sidebar.service';\n\n/**\n * pwCollapsibleSidebarTrigger\n *\n * Directive that makes an element a trigger for the collapsible sidebar.\n * Useful for cog icons or buttons that should expand the sidebar when clicked.\n *\n * Usage:\n * ```html\n * <button pwCollapsibleSidebarTrigger [contentId]=\"'posiwise-brain'\">\n * <i class=\"pi pi-cog\"></i>\n * </button>\n * ```\n */\n@Directive({\n selector: '[pwCollapsibleSidebarTrigger]',\n standalone: true\n})\nexport class CollapsibleSidebarTriggerDirective {\n /**\n * The ID of the sidebar content to load when this trigger is clicked\n */\n @Input() contentId = '';\n\n /**\n * Optional tooltip text shown on hover\n */\n @Input() tooltipText = '';\n\n constructor(private readonly sidebarService: CollapsibleSidebarService) {}\n\n /**\n * Handle click event to load sidebar content\n */\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.contentId) {\n const alreadyOpen =\n this.sidebarService.isExpanded() &&\n this.sidebarService.getActiveContentId() === this.contentId;\n\n if (alreadyOpen) {\n this.sidebarService.collapseSidebar();\n } else {\n this.sidebarService.loadContent(this.contentId);\n }\n } else if (isDevMode()) {\n console.warn(\n 'pwCollapsibleSidebarTrigger: contentId is required when using this directive.'\n );\n }\n }\n}\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'pw-coming-soon',\n template: `\n <div class=\"coming-soon\">\n <h2 class=\"card-title\">{{ message }}</h2>\n <p>... this section is under construction.</p>\n </div>\n `,\n standalone: false\n})\nexport class ComingSoonComponent {\n @Input()\n message = 'Coming soon';\n}\n","import { Injectable } from '@angular/core';\n\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/**\n * Open/close state for the global command palette.\n *\n * Kept in a root service (rather than inside the component) so any surface can\n * summon the palette — the navbar button, the ⌘K shortcut, an empty-state\n * \"find a page\" link — without reaching for a component reference.\n */\n@Injectable({ providedIn: 'root' })\nexport class CommandPaletteService {\n private readonly openSubject = new BehaviorSubject<boolean>(false);\n\n isOpen$: Observable<boolean> = this.openSubject.asObservable();\n\n open(): void {\n this.openSubject.next(true);\n }\n\n close(): void {\n this.openSubject.next(false);\n }\n\n toggle(): void {\n this.openSubject.next(!this.openSubject.value);\n }\n\n isOpen(): boolean {\n return this.openSubject.value;\n }\n}\n","import { PaletteItem } from './command-palette.model';\n\n/**\n * Everything activation needs, passed in rather than injected, so the dispatch\n * stays a pure function the component can hand its own collaborators to.\n */\nexport interface ActivateDeps {\n /** Hand the query to the Brain composer — seeded, not sent. */\n askAi: (query: string) => void;\n /** Returns true when the nav index took over via a subscription switch. */\n openEntry: (item: PaletteItem) => boolean;\n navigate: (path: string) => void;\n copyLink: () => void;\n logOut: () => void;\n}\n\n/**\n * Run a row.\n *\n * Returns whether the palette should close. Everything closes today; the return\n * value exists so a future row that reports back in place (a copy confirmation,\n * a toggle) can keep the panel open without rewriting every caller.\n */\nexport const activateItem = (item: PaletteItem | undefined, deps: ActivateDeps): boolean => {\n if (!item) {\n return false;\n }\n\n if (item.kind === 'ask-ai') {\n deps.askAi(item.label);\n\n return true;\n }\n\n if (item.kind === 'action') {\n runAction(item, deps);\n\n return true;\n }\n\n // A page in another product: the index hands it to the sidebar's context\n // switch, which navigates once that subscription is active.\n if (item.entry && deps.openEntry(item)) {\n return true;\n }\n\n if (item.path) {\n deps.navigate(item.path);\n }\n\n return true;\n};\n\nconst runAction = (item: PaletteItem, deps: ActivateDeps): void => {\n if (item.action === 'copy-link') {\n deps.copyLink();\n\n return;\n }\n if (item.action === 'log-out') {\n deps.logOut();\n }\n};\n\n/**\n * The collaborators `buildActivateDeps` wires together, as structural slices of\n * the real services so a test can pass plain objects.\n */\nexport interface ActivateCollaborators {\n sidebar: { loadContentWithData: (contentId: string, data: Record<string, unknown>) => void };\n navIndex: { open: (entry: NonNullable<PaletteItem['entry']>) => boolean };\n router: { navigateByUrl: (path: string) => unknown };\n translate: (key: string) => string;\n notify?: { success: (message: string) => void; error: (message: string) => void };\n /** Overridable so the clipboard and location can be faked in a test. */\n clipboard?: { writeText: (value: string) => Promise<void> };\n href?: () => string;\n}\n\n/**\n * Build the dispatch table from a component's collaborators.\n *\n * Lives here rather than inline in the component so the component stays inside\n * C1 and so the copy-link branch — the only one with a promise and user-visible\n * feedback — is reachable from a unit test.\n */\nexport const buildActivateDeps = (deps: ActivateCollaborators): ActivateDeps => ({\n // Seed the Brain composer rather than auto-sending, so the user can still\n // edit the question before committing to it.\n askAi: query => deps.sidebar.loadContentWithData('posiwise-brain', { draft: query }),\n openEntry: item => !!item.entry && deps.navIndex.open(item.entry),\n navigate: path => {\n deps.router.navigateByUrl(path);\n },\n copyLink: () => {\n const clipboard = deps.clipboard ?? globalThis.navigator?.clipboard;\n\n if (!clipboard) {\n deps.notify?.error(deps.translate('CommandPalette.Action.CopyFailed'));\n\n return;\n }\n\n clipboard\n .writeText(deps.href ? deps.href() : globalThis.location?.href)\n .then(() => deps.notify?.success(deps.translate('CommandPalette.Action.Copied')))\n .catch(() => deps.notify?.error(deps.translate('CommandPalette.Action.CopyFailed')));\n },\n // The same route the profile menu uses; it owns the whole teardown.\n logOut: () => {\n deps.router.navigateByUrl('/logout');\n }\n});\n","import { AppConfigService } from '@posiwise/app-config-service';\n\nimport { Observable, of } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n DEFAULT_BRAND,\n resolveBrandName\n} from '../collapsible-sidebar/collapsible-sidebar-brand.helpers';\n\nexport { DEFAULT_BRAND };\n\n/**\n * The white-label brand for the Ask row.\n *\n * `AppConfigService` is optional in this library — a consumer that does not\n * provide it falls back to the default brand rather than failing to construct\n * the palette at all.\n */\nexport const brandName$ = (appConfig?: AppConfigService): Observable<string> =>\n appConfig ? appConfig.appConfig$.pipe(map(resolveBrandName)) : of(DEFAULT_BRAND);\n","import { NavEntry, PaletteGroup, PaletteItem, PalettePerson } from './command-palette.model';\n\n/** Cap per group so one noisy group can never bury the others. */\nconst MAX_PER_GROUP = 6;\n\nconst normalise = (value: string): string => (value ?? '').trim().toLowerCase();\n\n/**\n * Small, predictable ranking — prefix beats word-start beats substring.\n * Deliberately not fuzzy: a palette that reorders unpredictably as you type\n * costs more trust than it buys in recall.\n */\nexport const scoreEntry = (title: string, section: string, query: string): number => {\n const haystack = normalise(title);\n const needle = normalise(query);\n\n if (!needle) {\n return 0;\n }\n if (haystack.startsWith(needle)) {\n return 3;\n }\n if (haystack.includes(` ${needle}`)) {\n return 2;\n }\n if (haystack.includes(needle)) {\n return 1;\n }\n if (normalise(section).includes(needle)) {\n return 1;\n }\n\n return -1;\n};\n\n/** The entry's i18n keys, when it carries them, so the row renders translated. */\nconst translatedText = (entry: NavEntry): Pick<PaletteItem, 'labelKey' | 'detailKey'> => ({\n ...(entry.titleKey ? { labelKey: entry.titleKey } : {}),\n ...(entry.sectionKey ? { detailKey: entry.sectionKey } : {})\n});\n\n/**\n * Score what the row shows as well as the English it was built from, so a user\n * finds a page by the translated name they read and by its English name.\n */\nconst entryScore = (entry: NavEntry, query: string, translate?: (key: string) => string): number => {\n const english = scoreEntry(entry.title, entry.section, query);\n if (!translate || (!entry.titleKey && !entry.sectionKey)) {\n return english;\n }\n // A missing translation comes back as the key itself; never search key text.\n const shown = (key: string | undefined, fallback: string): string => {\n const text = key ? translate(key) : fallback;\n return text === key ? fallback : text;\n };\n const title = shown(entry.titleKey, entry.title);\n const section = shown(entry.sectionKey, entry.section);\n\n return Math.max(english, scoreEntry(title, section, query));\n};\n\nexport const pageItems = (\n entries: NavEntry[],\n query: string,\n translate?: (key: string) => string\n): PaletteItem[] =>\n entries\n .map(entry => ({ entry, score: entryScore(entry, query, translate) }))\n .filter(scored => scored.score >= 0)\n .sort((a, b) => b.score - a.score || a.entry.title.localeCompare(b.entry.title))\n .slice(0, MAX_PER_GROUP)\n .map(({ entry }) => ({\n id: `page:${entry.path}`,\n kind: 'page' as const,\n label: entry.title,\n detail: entry.section,\n ...translatedText(entry),\n icon: entry.icon || 'ft-file',\n path: entry.path,\n entry\n }));\n\nconst personName = (person: PalettePerson): string =>\n [person.first_name, person.last_name].filter(Boolean).join(' ').trim();\n\n/** `/members/:slug` — the same destination the legacy search results page used. */\nexport const personItems = (people: PalettePerson[]): PaletteItem[] =>\n (people ?? [])\n .filter(person => person?.slug && (personName(person) || person.email))\n .slice(0, MAX_PER_GROUP)\n .map(person => ({\n id: `person:${person.slug}`,\n kind: 'person' as const,\n label: personName(person) || person.email,\n detail: person.email ?? '',\n icon: 'ft-user',\n path: `/members/${person.slug}`\n }));\n\n/**\n * The jump-back list. Unscored and unsorted: `RecentPagesService` already returns\n * them newest-first, and re-ranking recency by name would defeat the point.\n */\nexport const recentItems = (entries: NavEntry[]): PaletteItem[] =>\n (entries ?? []).slice(0, MAX_PER_GROUP).map(entry => ({\n id: `recent:${entry.path}`,\n kind: 'page' as const,\n label: entry.title,\n detail: entry.section,\n ...translatedText(entry),\n icon: entry.icon || 'fas fa-clock-rotate-left',\n path: entry.path,\n entry\n }));\n\nexport const askAiItem = (query: string): PaletteItem => ({\n id: 'ask-ai',\n kind: 'ask-ai',\n label: query,\n detail: '',\n icon: 'fas fa-wand-magic-sparkles'\n});\n\n/**\n * Assemble the rendered groups.\n *\n * `Recent` leads when it has anything, because on an empty query it is a far\n * better first row than the alphabetical head of the full page list.\n *\n * `ask-ai` is pinned last and ALWAYS present, including on the empty-query\n * shortlist — it is the standing escape hatch when the palette (a known-item\n * finder) is the wrong tool for the question, so it must be discoverable before\n * the user has typed anything.\n */\nexport const buildGroups = (sources: {\n recents?: PaletteItem[];\n pages: PaletteItem[];\n people: PaletteItem[];\n switches?: PaletteItem[];\n actions?: PaletteItem[];\n query: string;\n}): PaletteGroup[] => {\n const groups: PaletteGroup[] = [];\n\n if (sources.recents?.length) {\n groups.push({ labelKey: 'CommandPalette.Group.Recent', items: sources.recents });\n }\n if (sources.pages.length) {\n groups.push({ labelKey: 'CommandPalette.Group.Pages', items: sources.pages });\n }\n if (sources.people.length) {\n groups.push({ labelKey: 'CommandPalette.Group.People', items: sources.people });\n }\n if (sources.switches?.length) {\n groups.push({ labelKey: 'CommandPalette.Group.Switch', items: sources.switches });\n }\n if (sources.actions?.length) {\n groups.push({ labelKey: 'CommandPalette.Group.Actions', items: sources.actions });\n }\n groups.push({\n labelKey: 'CommandPalette.Group.Ask',\n items: [askAiItem(sources.query.trim())]\n });\n\n return groups;\n};\n\n/** Flatten groups back to a single ordered list for keyboard traversal. */\nexport const flattenItems = (groups: PaletteGroup[]): PaletteItem[] =>\n groups.flatMap(group => group.items);\n","import { PaletteActionId, PaletteItem } from './command-palette.model';\nimport { scoreEntry } from './command-palette-sources';\n\nexport interface PaletteActionDef {\n id: PaletteActionId;\n labelKey: string;\n icon: string;\n}\n\n/**\n * The palette's own commands.\n *\n * Deliberately short. Anything that is really a destination belongs in the\n * navigation index, where it arrives with the permission gating already applied —\n * an action row carries no such gate, so every entry here must be safe for any\n * signed-in user.\n */\nexport const PALETTE_ACTIONS: PaletteActionDef[] = [\n {\n id: 'copy-link',\n labelKey: 'CommandPalette.Action.CopyLink',\n icon: 'fas fa-link'\n },\n {\n id: 'log-out',\n labelKey: 'CommandPalette.Action.LogOut',\n icon: 'fas fa-arrow-right-from-bracket'\n }\n];\n\n/** Below this, a query is too weak to be a deliberate command request. */\nconst MIN_QUERY = 2;\n\n/**\n * Actions matching the typed query, ranked with the same scorer as pages.\n *\n * Requires a real query on purpose: `log-out` must never sit on the empty-query\n * shortlist, where the keyboard's default row is one Enter away.\n */\nexport const actionItems = (\n query: string,\n translate: (key: string) => string,\n defs: PaletteActionDef[] = PALETTE_ACTIONS\n): PaletteItem[] => {\n const needle = (query ?? '').trim();\n\n if (needle.length < MIN_QUERY) {\n return [];\n }\n\n return defs\n .map(def => ({ def, label: translate(def.labelKey) }))\n .map(({ def, label }) => ({ def, label, score: scoreEntry(label, '', needle) }))\n .filter(scored => scored.score >= 0)\n .sort((a, b) => b.score - a.score || a.label.localeCompare(b.label))\n .map(({ def, label }) => ({\n id: `action:${def.id}`,\n kind: 'action' as const,\n label,\n labelKey: def.labelKey,\n detail: '',\n icon: def.icon,\n action: def.id\n }));\n};\n","import { ProductMenuSource } from '@posiwise/common-services';\n\nimport { PaletteItem } from './command-palette.model';\nimport { scoreEntry } from './command-palette-sources';\n\n/** Shown without a query too, so switching is discoverable — but kept short there. */\nconst BROWSE_LIMIT = 3;\n\nconst MATCH_LIMIT = 6;\n\nexport interface SwitchContext {\n /** The product the app is currently in; excluded from the rows. */\n currentPath?: string;\n currentSubscriptionId?: number;\n}\n\n/**\n * Switching only means something across subscriptions. A user in one subscription\n * — however many products it carries — has nowhere to switch to, so the whole\n * group is withheld rather than offering the product they are already in.\n */\nconst spansSubscriptions = (products: ProductMenuSource[]): boolean =>\n new Set(products.map(product => product.subscriptionId)).size > 1;\n\nconst isCurrent = (product: ProductMenuSource, context: SwitchContext): boolean =>\n !!context.currentSubscriptionId &&\n product.subscriptionId === context.currentSubscriptionId &&\n product.path === context.currentPath;\n\n/**\n * \"Switch to\" rows — one per product the user belongs to, in another subscription\n * or another product of the same one.\n *\n * These are `page` rows carrying a `product`, not a new item kind, so activation\n * goes through `NavigationIndexService.open()` — the same verified path a deep\n * page in a foreign product already uses. The entry's `path` is empty on purpose:\n * the sidebar's switcher reads a falsy target as \"this product's own dashboard\"\n * and resolves the subscription slug itself, which is the one place that mapping\n * is known to be correct.\n *\n * The row is named for the **organisation**, because that is what a user switching\n * context is actually choosing; the product name is the detail line.\n */\nexport const switchItems = (\n products: ProductMenuSource[],\n query: string,\n context: SwitchContext = {}\n): PaletteItem[] => {\n const needle = (query ?? '').trim();\n const switchable = (products ?? []).filter(product => !!product?.subscriptionId);\n\n if (!spansSubscriptions(switchable)) {\n return [];\n }\n\n const candidates = switchable.filter(product => !isCurrent(product, context));\n\n const scored = needle\n ? candidates\n .map(product => ({\n product,\n score: scoreEntry(product.organisation ?? '', product.title ?? '', needle)\n }))\n .filter(entry => entry.score >= 0)\n .sort((a, b) => b.score - a.score)\n .slice(0, MATCH_LIMIT)\n .map(entry => entry.product)\n : candidates.slice(0, BROWSE_LIMIT);\n\n return scored.map(product => {\n const label = product.organisation ?? product.title ?? '';\n const detail = product.organisation ? (product.title ?? '') : '';\n\n return {\n id: `switch:${product.subscriptionId}:${product.path}`,\n kind: 'page' as const,\n label,\n detail,\n icon: 'fas fa-building',\n entry: {\n title: label,\n path: '',\n icon: 'fas fa-building',\n section: detail,\n product\n }\n };\n });\n};\n","import { NavEntry, ProductMenuSource } from '@posiwise/common-services';\n\nimport { PaletteGroup, PaletteItem } from './command-palette.model';\nimport { actionItems } from './command-palette-actions';\nimport { buildGroups, pageItems, recentItems } from './command-palette-sources';\nimport { switchItems } from './command-palette-switch';\n\n/** Structural slices of the two services, so a test can pass plain objects. */\nexport interface NavIndexLike {\n entries: () => NavEntry[];\n canSwitch: () => boolean;\n switchTargets: () => ProductMenuSource[];\n}\n\nexport interface RecentsLike {\n resolve: (entries: NavEntry[], currentPath: string) => NavEntry[];\n}\n\nexport interface ComposeSources {\n navIndex: NavIndexLike;\n recents: RecentsLike;\n /** Router URL of the page in view; excluded from the recents list. */\n currentUrl: string;\n /** Debounced people results; relevance is decided here, not by the caller. */\n people: PaletteItem[];\n query: string;\n translate: (key: string) => string;\n current?: { path?: string; subscriptionId?: number };\n}\n\n/**\n * Turn the raw sources into rendered groups.\n *\n * Pure so the two precedence rules that shape the panel are testable without a\n * TestBed:\n *\n * 1. On an EMPTY query, recents replace the page list rather than sitting above\n * it. With no query every page scores 0, so `pageItems` falls back to\n * alphabetical order — six arbitrary names. Recent history is strictly more\n * useful, and showing both buries it.\n * 2. People only appear once something is typed. The list is a remote search;\n * there is nothing to show for an empty query.\n */\nexport const composeGroups = (sources: ComposeSources): PaletteGroup[] => {\n const typed = sources.query.trim();\n const entries = sources.navIndex.entries();\n const recents = typed ? [] : recentItems(sources.recents.resolve(entries, sources.currentUrl));\n const pages = typed || !recents.length ? pageItems(entries, sources.query, sources.translate) : [];\n\n return buildGroups({\n recents,\n pages,\n people: typed ? sources.people : [],\n switches: sources.navIndex.canSwitch()\n ? switchItems(sources.navIndex.switchTargets(), sources.query, {\n currentPath: sources.current?.path,\n currentSubscriptionId: sources.current?.subscriptionId\n })\n : [],\n actions: actionItems(sources.query, sources.translate),\n query: sources.query\n });\n};\n","import { PaletteItem } from './command-palette.model';\n\n/**\n * Keyboard position within the flattened row list.\n *\n * Extracted from the component so the component stays inside C1 while gaining\n * the recents/actions sources; it is also the only piece of palette state with\n * wrap-around arithmetic worth testing on its own.\n */\nexport class PaletteCursor {\n private index = 0;\n\n get position(): number {\n return this.index;\n }\n\n reset(): void {\n this.index = 0;\n }\n\n /** Wraps at both ends; a no-op while there is nothing to move through. */\n move(delta: number, length: number): void {\n if (length <= 0) {\n this.index = 0;\n\n return;\n }\n this.index = (this.index + delta + length) % length;\n }\n\n /** The row the keyboard is on, or undefined once the list has emptied. */\n current(items: PaletteItem[]): PaletteItem | undefined {\n return items[this.index];\n }\n\n isActive(items: PaletteItem[], item: PaletteItem): boolean {\n return this.current(items)?.id === item.id;\n }\n}\n","/**\n * Native <dialog> plumbing for the command palette.\n *\n * Split out of the component so `command-palette.component.ts` stays inside the\n * 200-line ceiling, and so the DOM-level behaviour can be exercised directly.\n *\n * Feature detection is NOT defensive padding: jsdom 26 ships `HTMLDialogElement`\n * with a working `open` property but no `showModal()` / `close()` methods, so a\n * bare call throws `showModal is not a function` under Jest. Falling back to the\n * `open` attribute keeps specs meaningful — `open` is what `showModal()` sets in\n * a real browser anyway, so both paths leave the element in the same state.\n */\n\n/** Drive the <dialog> to match the palette's open state. Idempotent. */\nexport function syncPaletteDialog(dialog: HTMLDialogElement | undefined, isOpen: boolean): void {\n if (!dialog) {\n return;\n }\n\n if (isOpen && !dialog.open) {\n openDialog(dialog);\n } else if (!isOpen && dialog.open) {\n closeDialog(dialog);\n }\n}\n\n/**\n * Close the palette when a click lands on the ::backdrop.\n *\n * A modal <dialog>'s backdrop is a pseudo-element with no node of its own, so\n * the click surfaces with the dialog box itself as `target` — something a click\n * on any content never produces. Bound imperatively rather than declared in the\n * template on purpose: the markup then carries no mouse-only close affordance,\n * and Escape remains the documented keyboard equivalent.\n *\n * Returns a teardown for ngOnDestroy.\n */\nexport function bindBackdropDismiss(\n dialog: HTMLDialogElement | undefined,\n onDismiss: () => void\n): () => void {\n if (!dialog) {\n return () => undefined;\n }\n\n const handler = (event: MouseEvent): void => {\n if (event.target === dialog) {\n onDismiss();\n }\n };\n\n dialog.addEventListener('click', handler);\n\n return () => dialog.removeEventListener('click', handler);\n}\n\nfunction openDialog(dialog: HTMLDialogElement): void {\n if (typeof dialog.showModal === 'function') {\n dialog.showModal();\n } else {\n dialog.setAttribute('open', '');\n }\n}\n\nfunction closeDialog(dialog: HTMLDialogElement): void {\n if (typeof dialog.close === 'function') {\n dialog.close();\n } else {\n dialog.removeAttribute('open');\n }\n}\n\n/**\n * Bind the native <dialog> once the view exists, and apply any open state that\n * raced the view's arrival (the palette can be opened from ⌘K before\n * `ngAfterViewInit` runs).\n *\n * Returns the backdrop-listener release function.\n */\nexport const attachDialog = (\n dialog: HTMLDialogElement | undefined,\n onDismiss: () => void,\n isOpen: boolean\n): (() => void) => {\n const release = bindBackdropDismiss(dialog, onDismiss);\n\n syncPaletteDialog(dialog, isOpen);\n\n return release;\n};\n","/** What a keypress inside the results list means; null when it means nothing. */\nexport type PaletteListAction = 'down' | 'up' | 'enter';\n\n/** The global open/close chord. Ctrl on Windows and Linux, ⌘ on a Mac. */\nexport const isToggleShortcut = (event: KeyboardEvent): boolean =>\n (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'k';\n\nexport const listAction = (event: KeyboardEvent): PaletteListAction | null => {\n if (event.key === 'ArrowDown') {\n return 'down';\n }\n if (event.key === 'ArrowUp') {\n return 'up';\n }\n\n return event.key === 'Enter' ? 'enter' : null;\n};\n\n/**\n * The chord as a user should read it. `navigator.platform` is deprecated but is\n * still the only synchronous signal here; a wrong guess costs a wrong hint, not\n * a broken shortcut, since the handler accepts either modifier.\n */\nexport const shortcutHint = (): string =>\n /Mac|iPhone|iPad/i.test(navigator?.platform ?? '') ? '⌘K' : 'Ctrl K';\n","import { DashboardService, PermissionService } from '@posiwise/common-services';\n\nimport { Observable, of } from 'rxjs';\nimport { catchError, debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators';\n\nimport { PaletteItem, PalettePerson } from './command-palette.model';\nimport { personItems } from './command-palette-sources';\n\n/** Only hit the people endpoint once typing settles, and not for one letter. */\nconst PEOPLE_DEBOUNCE_MS = 250;\nconst PEOPLE_MIN_CHARS = 2;\n\n/**\n * Debounced people lookup, mapped straight to palette rows.\n *\n * Lifted out of the component so `command-palette.component.ts` keeps to the\n * 200-line ceiling once the native-dialog plumbing lands beside it.\n */\nexport function peopleSearch(\n queryChanges: Observable<string>,\n dashboard: DashboardService\n): Observable<PaletteItem[]> {\n return queryChanges.pipe(\n debounceTime(PEOPLE_DEBOUNCE_MS),\n distinctUntilChanged(),\n switchMap(term => fetchPeople(dashboard, term)),\n map(people => personItems(people))\n );\n}\n\nfunction fetchPeople(dashboard: DashboardService, term: string): Observable<PalettePerson[]> {\n const subscriptionId = PermissionService.selectedSubscription?.id;\n\n if (term.length < PEOPLE_MIN_CHARS || !subscriptionId) {\n return of([]);\n }\n\n // A failed lookup must not blank the palette — pages still render. The catch\n // sits INSIDE the inner observable so it never tears down the outer stream.\n return dashboard.search(term, subscriptionId).pipe(\n map(response => response?.users ?? []),\n catchError(() => of([] as PalettePerson[]))\n );\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostListener,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport {\n CustomToastService,\n DashboardService,\n NavigationIndexService,\n PermissionService,\n RecentPagesService\n} from '@posiwise/common-services';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { TranslocoService } from '@jsverse/transloco';\n\nimport { CollapsibleSidebarService } from '../collapsible-sidebar/collapsible-sidebar.service';\n\nimport { PaletteGroup, PaletteItem } from './command-palette.model';\nimport { CommandPaletteService } from './command-palette.service';\nimport { activateItem, buildActivateDeps } from './command-palette-activate.helpers';\nimport { brandName$, DEFAULT_BRAND } from './command-palette-brand';\nimport { composeGroups } from './command-palette-compose';\nimport { PaletteCursor } from './command-palette-cursor';\nimport { attachDialog, syncPaletteDialog } from './command-palette-dialog.helpers';\nimport { isToggleShortcut, listAction, shortcutHint } from './command-palette-keyboard';\nimport { peopleSearch } from './command-palette-people.helpers';\nimport { flattenItems } from './command-palette-sources';\n\n@Component({\n selector: 'pw-command-palette',\n templateUrl: './command-palette.component.html',\n styleUrls: ['./command-palette.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class CommandPaletteComponent implements OnInit, AfterViewInit, OnDestroy {\n @ViewChild('queryInput') queryInput?: { nativeElement: HTMLInputElement };\n /** The native <dialog>; always in the DOM, so this handle stays valid. */\n @ViewChild('paletteDialog') paletteDialog?: { nativeElement: HTMLDialogElement };\n\n isOpen = false;\n query = '';\n groups: PaletteGroup[] = [];\n\n brandName = DEFAULT_BRAND;\n readonly shortcutHint = shortcutHint();\n\n private readonly cursor = new PaletteCursor();\n private flat: PaletteItem[] = [];\n private readonly queryChanges = new Subject<string>();\n private readonly destroy$ = new Subject<void>();\n private people: PaletteItem[] = [];\n private releaseBackdrop: () => void = () => undefined;\n\n constructor(\n public readonly palette: CommandPaletteService,\n private readonly navIndex: NavigationIndexService,\n private readonly dashboard: DashboardService,\n private readonly recents: RecentPagesService,\n private readonly sidebar: CollapsibleSidebarService,\n private readonly router: Router,\n private readonly transloco: TranslocoService,\n private readonly cdr: ChangeDetectorRef,\n @Optional() private readonly appConfigService?: AppConfigService,\n @Optional() private readonly toast?: CustomToastService\n ) {}\n\n ngOnInit(): void {\n brandName$(this.appConfigService)\n .pipe(takeUntil(this.destroy$))\n .subscribe(name => {\n this.brandName = name;\n this.cdr.markForCheck();\n });\n\n this.palette.isOpen$.pipe(takeUntil(this.destroy$)).subscribe(isOpen => {\n this.isOpen = isOpen;\n if (isOpen) {\n this.reset();\n }\n this.cdr.markForCheck();\n syncPaletteDialog(this.paletteDialog?.nativeElement, isOpen);\n });\n\n peopleSearch(this.queryChanges, this.dashboard)\n .pipe(takeUntil(this.destroy$))\n .subscribe(people => {\n this.people = people;\n this.rebuild();\n });\n }\n\n ngAfterViewInit(): void {\n this.releaseBackdrop = attachDialog(\n this.paletteDialog?.nativeElement,\n () => this.palette.close(),\n this.isOpen\n );\n }\n\n ngOnDestroy(): void {\n this.releaseBackdrop();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /** A native close (Escape, or our own close()) mirrored back onto the service. */\n onDialogClose(): void {\n if (this.isOpen) {\n this.palette.close();\n }\n }\n\n /** ⌘K / Ctrl-K opens from anywhere; Escape closes. */\n @HostListener('document:keydown', ['$event'])\n onDocumentKeydown(event: KeyboardEvent): void {\n if (isToggleShortcut(event)) {\n event.preventDefault();\n this.palette.toggle();\n } else if (event.key === 'Escape' && this.isOpen) {\n this.palette.close();\n }\n }\n\n onQueryInput(value: string): void {\n this.query = value;\n this.queryChanges.next(value.trim());\n this.rebuild();\n }\n\n onKeydown(event: KeyboardEvent): void {\n const action = listAction(event);\n\n if (!action) {\n return;\n }\n event.preventDefault();\n\n if (action === 'enter') {\n this.activate(this.cursor.current(this.flat));\n } else {\n this.cursor.move(action === 'down' ? 1 : -1, this.flat.length);\n this.cdr.markForCheck();\n }\n }\n\n activate(item?: PaletteItem): void {\n if (activateItem(item, this.activateDeps())) {\n this.palette.close();\n }\n }\n\n isActive(item: PaletteItem): boolean {\n return this.cursor.isActive(this.flat, item);\n }\n\n private activateDeps() {\n return buildActivateDeps({\n sidebar: this.sidebar,\n navIndex: this.navIndex,\n router: this.router,\n translate: key => this.transloco.translate(key),\n notify: this.toast\n });\n }\n\n private rebuild(): void {\n this.groups = composeGroups({\n navIndex: this.navIndex,\n recents: this.recents,\n currentUrl: this.router.url,\n people: this.people,\n query: this.query,\n translate: key => this.transloco.translate(key),\n current: PermissionService.selectedProduct\n });\n this.flat = flattenItems(this.groups);\n this.cursor.reset();\n this.cdr.markForCheck();\n }\n\n private reset(): void {\n this.query = '';\n this.people = [];\n this.rebuild();\n setTimeout(() => this.queryInput?.nativeElement?.focus());\n }\n}\n","<!-- Navbar trigger — keeps the familiar search affordance, states the shortcut. -->\n<button type=\"button\"\n class=\"pw-palette-trigger\"\n (click)=\"palette.open()\"\n [attr.aria-label]=\"'CommandPalette.Trigger.Label' | transloco\">\n <i class=\"fas fa-magnifying-glass pw-palette-trigger-icon\" aria-hidden=\"true\"></i>\n <span class=\"pw-palette-trigger-text\">{{ 'CommandPalette.Trigger.Text' | transloco }}</span>\n <kbd class=\"pw-palette-kbd pw-palette-trigger-kbd\">{{ shortcutHint }}</kbd>\n</button>\n\n<!--\n Native <dialog> opened with showModal(): the platform supplies the modal\n semantics this used to hand-roll — the implicit dialog role and modal flag, a real\n focus trap, inert background content, Escape-to-close, and a ::backdrop we\n style instead of painting our own overlay <div>.\n\n The element is always in the DOM (a closed <dialog> is display:none) so the\n component holds one stable handle to call showModal()/close() on; only the\n contents are gated on isOpen so the results list costs nothing while closed.\n-->\n<dialog #paletteDialog\n class=\"pw-palette\"\n [attr.aria-label]=\"'CommandPalette.Aria.Dialog' | transloco\"\n (close)=\"onDialogClose()\">\n @if (isOpen) {\n <div class=\"pw-palette-search\">\n <i class=\"fas fa-magnifying-glass pw-palette-search-icon\" aria-hidden=\"true\"></i>\n <input #queryInput\n type=\"text\"\n class=\"pw-palette-field\"\n autocomplete=\"off\"\n [value]=\"query\"\n (input)=\"onQueryInput($any($event.target).value)\"\n (keydown)=\"onKeydown($event)\"\n [attr.placeholder]=\"'CommandPalette.Placeholder' | transloco\"\n [attr.aria-label]=\"'CommandPalette.Placeholder' | transloco\" />\n <kbd class=\"pw-palette-kbd\">esc</kbd>\n </div>\n\n <div class=\"pw-palette-results\">\n @for (group of groups; track group.labelKey) {\n <div class=\"pw-palette-group\">\n <p class=\"pw-palette-group-label\">{{ group.labelKey | transloco }}</p>\n @for (item of group.items; track item.id) {\n <button type=\"button\"\n class=\"pw-palette-row\"\n [class.is-active]=\"isActive(item)\"\n (click)=\"activate(item)\">\n <i class=\"pw-palette-row-icon\" [ngClass]=\"item.icon\" aria-hidden=\"true\"></i>\n <span class=\"pw-palette-row-label\">\n @if (item.kind === 'ask-ai') {\n {{ 'CommandPalette.Ask.Label' | transloco: { company: brandName } }}\n @if (item.label) {\n <span class=\"pw-palette-row-prefix\">— {{ item.label }}</span>\n }\n } @else if (item.labelKey) {\n <!-- Action rows are chrome, so they translate (C17), as do page\n rows that carry a key; person rows render the data's own text. -->\n {{ item.labelKey | transloco }}\n } @else {\n {{ item.label }}\n }\n </span>\n @if (item.detail) {\n <span class=\"pw-palette-row-detail\">{{ item.detailKey ? (item.detailKey | transloco) : item.detail }}</span>\n }\n </button>\n }\n </div>\n } @empty {\n <div class=\"pw-palette-empty\">\n <p class=\"pw-palette-empty-title\">{{ 'CommandPalette.Empty.Title' | transloco }}</p>\n <p class=\"pw-palette-empty-hint\">{{ 'CommandPalette.Empty.Hint' | transloco }}</p>\n </div>\n }\n </div>\n\n <div class=\"pw-palette-footer\">\n <span class=\"pw-palette-hint\"><kbd class=\"pw-palette-kbd\">↑↓</kbd>{{ 'CommandPalette.Hint.Navigate' | transloco }}</span>\n <span class=\"pw-palette-hint\"><kbd class=\"pw-palette-kbd\">↵</kbd>{{ 'CommandPalette.Hint.Open' | transloco }}</span>\n <span class=\"pw-palette-hint\"><kbd class=\"pw-palette-kbd\">esc</kbd>{{ 'CommandPalette.Hint.Close' | transloco }}</span>\n </div>\n }\n</dialog>\n","import { CommonModule, DOCUMENT } from '@angular/common';\nimport { Component, HostBinding, Inject, Input, OnInit, signal } from '@angular/core';\n\nimport { CoreTranslocoModule } from '@posiwise/core-transloco';\n\nimport { TranslocoService } from '@jsverse/transloco';\n\nconst DEFAULT_COOKIE_KEY = 'cookieconsent_status';\nconst DEFAULT_COOKIE_VALUE = 'dismiss';\n// 365 days: this is a notice banner (GA runs unconditionally), not a consent gate,\n// so there's no compliance reason to re-prompt sooner. Revisit if we ever add a\n// real consent gate (e.g. GDPR opt-in for EU users).\nconst DEFAULT_COOKIE_TTL_DAYS = 365;\n\n@Component({\n selector: 'pw-cookie-banner',\n templateUrl: './pw-cookie-banner.component.html',\n styleUrls: ['./pw-cookie-banner.component.scss'],\n standalone: true,\n imports: [CommonModule, CoreTranslocoModule]\n})\nexport class PwCookieBannerComponent implements OnInit {\n // Copy inputs default to null so the template falls back to the translated text;\n // a caller that passes its own string still wins.\n @Input() title: string | null = null;\n @Input() message: string | null = null;\n @Input() acceptLabel: string | null = null;\n @Input() privacyLinkLabel: string | null = null;\n @Input() privacyLinkUrl: string | null = null;\n @Input() privacyFallbackUrl = '/privacy-policy';\n @Input() cookieKey = DEFAULT_COOKIE_KEY;\n @Input() cookieTtlDays = DEFAULT_COOKIE_TTL_DAYS;\n\n // Signals, not plain fields: the app is zoneless, so the post-fade removal in a\n // setTimeout would otherwise never re-render and the invisible banner keeps\n // swallowing clicks.\n readonly visible = signal(false);\n readonly leaving = signal(false);\n\n @HostBinding('attr.role') readonly role = 'region';\n @HostBinding('attr.aria-label') get ariaLabel(): string {\n return this.translation.translate('CookieBanner.AriaLabel');\n }\n\n constructor(\n @Inject(DOCUMENT) private readonly document: Document,\n private readonly translation: TranslocoService\n ) {}\n\n ngOnInit(): void {\n this.visible.set(!this.hasConsentCookie());\n }\n\n get resolvedPrivacyUrl(): string {\n if (this.privacyLinkUrl) return this.privacyLinkUrl;\n return this.privacyFallbackUrl ?? '/privacy-policy';\n }\n\n accept(): void {\n this.setConsentCookie();\n this.animateOut();\n }\n\n private animateOut(): void {\n this.leaving.set(true);\n setTimeout(() => {\n this.visible.set(false);\n this.leaving.set(false);\n }, 220);\n }\n\n private hasConsentCookie(): boolean {\n const cookies = this.document.cookie?.split(';') ?? [];\n return cookies.map(c => c.trim()).some(c => c.startsWith(`${this.cookieKey}=`));\n }\n\n private setConsentCookie(): void {\n const expires = new Date();\n expires.setDate(expires.getDate() + this.cookieTtlDays);\n const parts = [\n `${this.cookieKey}=${DEFAULT_COOKIE_VALUE}`,\n `expires=${expires.toUTCString()}`,\n 'path=/',\n 'SameSite=Lax'\n ];\n if (this.document.location?.protocol === 'https:') {\n parts.push('Secure');\n }\n this.document.cookie = parts.join('; ');\n }\n}\n","@if (visible()) {\n <div\n class=\"pw-cookie-banner\"\n [class.pw-cookie-banner--leaving]=\"leaving()\">\n <div class=\"pw-cookie-banner__icon\" aria-hidden=\"true\">\n <i class=\"fas fa-cookie-bite\"></i>\n </div>\n <div class=\"pw-cookie-banner__body\">\n <h3 class=\"pw-cookie-banner__title\">{{ title ?? ('CookieBanner.Title' | transloco) }}</h3>\n <p class=\"pw-cookie-banner__message\">\n {{ message ?? ('CookieBanner.Message' | transloco) }}\n <a\n class=\"pw-cookie-banner__link\"\n [href]=\"resolvedPrivacyUrl\"\n target=\"_blank\"\n rel=\"noopener\">\n {{ privacyLinkLabel ?? ('CookieBanner.PrivacyLink' | transloco) }}\n </a>\n </p>\n </div>\n <div class=\"pw-cookie-banner__actions\">\n <button\n type=\"button\"\n class=\"pw-cookie-banner__accept\"\n (click)=\"accept()\">\n {{ acceptLabel ?? ('CookieBanner.Accept' | transloco) }}\n </button>\n </div>\n </div>\n}\n","import { Component, Input } from '@angular/core';\n\nimport { ResolvedBinding } from '../ui-config.model';\n\n// chart block. Phase 1 renders the titled frame + binding state only — real\n// charting is a Phase 3 registry expansion (ticket #933 §7). Kept minimal and\n// neutral; no charting library or bespoke look introduced here (doctrine:\n// build spec'd structure with existing patterns, do not invent a look).\n@Component({\n selector: 'pw-chart-block',\n standalone: false,\n template: `\n <div class=\"dyn-chart\">\n <div class=\"dyn-chart__label\">{{ title }}</div>\n <div class=\"dyn-chart__state\">\n {{ 'DynamicPage.State.' + (binding?.state || 'unavailable') | transloco }}\n </div>\n </div>\n `,\n styles: [\n `\n .dyn-chart {\n border: 1px solid var(--line, #e2e5ea);\n border-radius: 8px;\n padding: 16px;\n min-height: 96px;\n background: var(--surface, #fff);\n }\n .dyn-chart__label {\n color: var(--ink-2, #5a6473);\n font-size: 12px;\n font-weight: 500;\n margin-bottom: 8px;\n }\n .dyn-chart__state {\n color: var(--ink-3, #7c8696);\n font-size: 12px;\n }\n `\n ]\n})\nexport class ChartBlockComponent {\n @Input() props: Record<string, unknown> = {};\n @Input() binding: ResolvedBinding | null = null;\n\n get title(): string {\n const value = this.props?.['title'];\n return typeof value === 'string' ? value : '';\n }\n}\n","import { Component, Input } from '@angular/core';\n\nimport { ResolvedBinding } from '../ui-config.model';\n\n// data-table block. Renders bound rows as a lean, dense, hairline table\n// (App/Dashboard surface profile). Cells use interpolation only — never\n// innerHTML (#933 §6.1). Non-ok / empty bindings degrade to a state label.\n@Component({\n selector: 'pw-data-table-block',\n standalone: false,\n template: `\n @if (binding?.state === 'ok' && rows.length) {\n <table class=\"dyn-table\">\n <thead>\n <tr>\n @for (col of columns; track col) {\n <th>{{ col }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of rows; track $index) {\n <tr>\n @for (col of columns; track col) {\n <td>{{ cell(row, col) }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n } @else {\n <div class=\"dyn-table__state\">\n {{ 'DynamicPage.State.' + stateKey | transloco }}\n </div>\n }\n `,\n styles: [\n `\n .dyn-table {\n width: 100%;\n border-collapse: collapse;\n font-variant-numeric: tabular-nums;\n }\n .dyn-table th,\n .dyn-table td {\n border-bottom: 1px solid var(--line, #e2e5ea);\n padding: 8px 12px;\n text-align: left;\n font-size: 14px;\n }\n .dyn-table th {\n color: var(--ink-2, #5a6473);\n font-weight: 500;\n }\n .dyn-table__state {\n color: var(--ink-3, #7c8696);\n font-size: 12px;\n padding: 12px;\n }\n `\n ]\n})\nexport class DataTableBlockComponent {\n @Input() props: Record<string, unknown> = {};\n @Input() binding: ResolvedBinding | null = null;\n\n get columns(): string[] {\n const cols = this.props?.['columns'];\n return Array.isArray(cols) ? cols.map(String) : [];\n }\n\n get rows(): Array<Record<string, unknown>> {\n const value = this.binding?.value as unknown;\n if (Array.isArray(value)) {\n return value.filter(\n (row): row is Record<string, unknown> => typeof row === 'object' && row !== null\n );\n }\n return [];\n }\n\n get stateKey(): string {\n if (this.binding?.state === 'ok') {\n return 'empty';\n }\n return this.binding?.state || 'unavailable';\n }\n\n cell(row: Record<string, unknown>, col: string): string {\n const value = row?.[col];\n return value === undefined || value === null ? '' : String(value);\n }\n}\n","import { Component, Input } from '@angular/core';\n\n// divider block — pure structural separator. Hairline neutral rule per the\n// design system (Refined Utilitarian, accent-agnostic — no --first).\n@Component({\n selector: 'pw-divider-block',\n standalone: false,\n template: `<hr class=\"dyn-divider\" [style.margin]=\"spacing + 'px 0'\" />`,\n styles: [\n `\n .dyn-divider {\n border: 0;\n border-top: 1px solid var(--line, #e2e5ea);\n opacity: 1;\n }\n `\n ]\n})\nexport class DividerBlockComponent {\n @Input() props: Record<string, unknown> = {};\n\n get spacing(): number {\n const value = Number(this.props?.['spacing']);\n return Number.isFinite(value) && value >= 0 && value <= 64 ? value : 16;\n }\n}\n","import { Component, Input } from '@angular/core';\n\n// section-heading block. Maps the config's semantic `level` to a real\n// heading element ONLY — no Bootstrap size utility, no bespoke class, no\n// component styles. The platform's global heading styling applies (same as\n// every sibling tab page's bare <hN>), so spacing/typography stay consistent\n// by construction (design-doctrine §2 #3: rely on the shared layer, never a\n// component-local override). Text via interpolation — never innerHTML (§6.1).\n@Component({\n selector: 'pw-section-heading-block',\n standalone: false,\n template: `\n @switch (level) {\n @case (1) {\n <h1>{{ text }}</h1>\n }\n @case (2) {\n <h2>{{ text }}</h2>\n }\n @case (3) {\n <h3>{{ text }}</h3>\n }\n @default {\n <h4>{{ text }}</h4>\n }\n }\n `\n})\nexport class SectionHeadingBlockComponent {\n @Input() props: Record<string, unknown> = {};\n\n get text(): string {\n const value = this.props?.['text'];\n return typeof value === 'string' ? value : '';\n }\n\n get level(): number {\n const value = Number(this.props?.['level']);\n return value >= 1 && value <= 4 ? value : 2;\n }\n}\n","import { Component, Input } from '@angular/core';\n\nimport { ResolvedBinding } from '../ui-config.model';\n\n// stat-card block. Title + a single bound metric. Neutral hairline card per\n// the design system (App/Dashboard surface — dense, tabular-nums, no --first\n// for hierarchy). Non-ok bindings degrade to a quiet state label (C17 i18n).\n@Component({\n selector: 'pw-stat-card-block',\n standalone: false,\n template: `\n <div class=\"dyn-card\">\n <div class=\"dyn-card__label\">{{ title }}</div>\n @if (binding?.state === 'ok') {\n <div class=\"dyn-card__value\">{{ metricValue }}</div>\n } @else {\n <div class=\"dyn-card__state\">\n {{ 'DynamicPage.State.' + (binding?.state || 'unavailable') | transloco }}\n </div>\n }\n </div>\n `,\n styles: [\n `\n .dyn-card {\n border: 1px solid var(--line, #e2e5ea);\n border-radius: 8px;\n padding: 16px;\n background: var(--surface, #fff);\n }\n .dyn-card__label {\n color: var(--ink-2, #5a6473);\n font-size: 12px;\n font-weight: 500;\n }\n .dyn-card__value {\n color: var(--ink, #1a1d21);\n font-size: 24px;\n font-weight: 700;\n font-variant-numeric: tabular-nums;\n }\n .dyn-card__state {\n color: var(--ink-3, #7c8696);\n font-size: 12px;\n }\n `\n ]\n})\nexport class StatCardBlockComponent {\n @Input() props: Record<string, unknown> = {};\n @Input() binding: ResolvedBinding | null = null;\n\n get title(): string {\n const value = this.props?.['title'];\n return typeof value === 'string' ? value : '';\n }\n\n get metricValue(): string {\n const key = String(this.props?.['metric_label'] ?? 'member_count');\n const raw = this.binding?.value?.[key];\n return raw === undefined || raw === null ? '—' : String(raw);\n }\n}\n","import { Type } from '@angular/core';\n\nimport { ChartBlockComponent } from './blocks/chart-block.component';\nimport { DataTableBlockComponent } from './blocks/data-table-block.component';\nimport { DividerBlockComponent } from './blocks/divider-block.component';\nimport { SectionHeadingBlockComponent } from './blocks/section-heading-block.component';\nimport { StatCardBlockComponent } from './blocks/stat-card-block.component';\n\n// Code-defined registry — structurally mirrors main-api\n// UiConfig::ComponentRegistry. The renderer instantiates ONLY these classes\n// (never a string, never ngComponentOutlet from server data) — ticket #933\n// §5.2/§6.1. New block types ship with releases only.\nexport const COMPONENT_REGISTRY: Readonly<Record<string, Type<unknown>>> = Object.freeze({\n 'section-heading': SectionHeadingBlockComponent,\n divider: DividerBlockComponent,\n 'stat-card': StatCardBlockComponent,\n 'data-table': DataTableBlockComponent,\n chart: ChartBlockComponent\n});\n\nexport function registeredType(type: string): Type<unknown> | null {\n return Object.prototype.hasOwnProperty.call(COMPONENT_REGISTRY, type)\n ? COMPONENT_REGISTRY[type]\n : null;\n}\n\nexport function registeredTypeNames(): string[] {\n return Object.keys(COMPONENT_REGISTRY);\n}\n","import { registeredType } from './component-registry';\nimport { UiBlock, UiLayoutConfig } from './ui-config.model';\n\n// Defensive client-side mirror of main-api UiConfig::SchemaValidator. The\n// SERVER is the authority (#933 §5.1/§6.4) — this exists only so the renderer\n// never attempts to instantiate an unregistered type if a malformed config\n// ever reaches the client. It validates structure, not authorization.\nexport interface UiConfigValidation {\n valid: boolean;\n errors: string[];\n}\n\nexport function validateUiConfig(config: unknown): UiConfigValidation {\n if (!config || typeof config !== 'object') {\n return { valid: false, errors: ['config must be an object'] };\n }\n const doc = config as Partial<UiLayoutConfig>;\n if (!Array.isArray(doc.blocks)) {\n return { valid: false, errors: ['blocks must be an array'] };\n }\n const errors: string[] = [];\n doc.blocks.forEach((block, index) => collectBlockErrors(block, index, errors));\n return { valid: errors.length === 0, errors };\n}\n\nfunction collectBlockErrors(block: unknown, index: number, errors: string[]): void {\n const path = `blocks[${index}]`;\n if (!block || typeof block !== 'object') {\n errors.push(`${path} must be an object`);\n return;\n }\n const candidate = block as UiBlock;\n if (typeof candidate.id !== 'string' || !candidate.id.trim()) {\n errors.push(`${path}.id must be a non-empty string`);\n }\n if (!registeredType(candidate.type)) {\n errors.push(`${path}.type not registered: ${String(candidate.type)}`);\n }\n if (!candidate.grid || typeof candidate.grid !== 'object') {\n errors.push(`${path}.grid must be an object`);\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ComponentRef,\n Injector,\n Input,\n OnDestroy,\n Optional,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport { FeatureFlagService, UserService } from '@posiwise/common-services';\n\nimport { take } from 'rxjs/operators';\n\nimport { CollapsibleSidebarService } from '../collapsible-sidebar/collapsible-sidebar.service';\n\nimport { registeredType } from './component-registry';\nimport { UiBlock, UiLayoutConfig } from './ui-config.model';\nimport { validateUiConfig } from './ui-config-validator';\n\nexport const UI_BUILDER_FLAG = 'conversational_ui_builder';\n\n// Conversational UI Builder renderer (#933 §5.2/§5.6/§6.1). Instantiates ONLY\n// registered component classes via createComponent(Type) — never innerHTML /\n// bypassSecurityTrust* / ngComponentOutlet. Feature-flag gated.\n@Component({\n selector: 'pw-dynamic-page',\n standalone: false,\n template: `\n @if (enabled) {\n <div class=\"dyn-page\"><ng-container #host></ng-container></div>\n @if (showEmpty) {\n <div class=\"dyn-empty\">\n <div class=\"dyn-empty__title\">{{ 'DynamicPage.Empty.Title' | transloco }}</div>\n <p class=\"dyn-empty__hint\">\n {{ 'DynamicPage.Empty.Hint' | transloco: { brand: brandName } }}\n </p>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"openBuilder()\">\n {{ 'DynamicPage.Empty.Cta' | transloco: { brand: brandName } }}\n </button>\n </div>\n }\n }\n `,\n styles: [\n `\n .dyn-page {\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n gap: 16px;\n }\n :host ::ng-deep .dyn-page > * {\n grid-column: span 12;\n }\n .dyn-empty {\n border: 1px solid var(--line, #e2e5ea);\n border-radius: 8px;\n background: var(--surface, #fff);\n padding: 48px 24px;\n text-align: center;\n }\n .dyn-empty__title {\n color: var(--ink, #1a1d21);\n font-size: 17px;\n font-weight: 700;\n margin-bottom: 4px;\n }\n .dyn-empty__hint {\n color: var(--ink-3, #7c8696);\n font-size: 14px;\n margin: 0 auto 16px;\n max-width: 420px;\n }\n `\n ]\n})\nexport class PwDynamicPageComponent implements AfterViewInit, OnDestroy {\n @ViewChild('host', { read: ViewContainerRef }) host!: ViewContainerRef;\n\n // config arrives async (after ngAfterViewInit) — re-render on change.\n private _config: UiLayoutConfig | null = null;\n private viewReady = false;\n // True once a fetch resolved (even to empty) — drives the empty state.\n private configResolved = false;\n\n @Input()\n set config(value: UiLayoutConfig | null) {\n this._config = value;\n this.configResolved = true;\n if (this.viewReady) {\n this.render();\n this.cdr.detectChanges();\n }\n }\n\n get config(): UiLayoutConfig | null {\n return this._config;\n }\n\n private refs: ComponentRef<unknown>[] = [];\n\n // Self-hydrate FeatureFlagService.user (guards set it normally — see module-guard.service.ts:22).\n private userResolved = false;\n private resolving = false;\n\n constructor(\n private readonly injector: Injector,\n private readonly cdr: ChangeDetectorRef,\n private readonly featureFlags: FeatureFlagService,\n @Optional() private readonly userService?: UserService,\n @Optional() private readonly sidebarService?: CollapsibleSidebarService,\n @Optional() private readonly appConfigService?: AppConfigService\n ) {}\n\n // White-label brand = domain_metadata company.name (NOT .title placeholder).\n brandName = 'PosiWise';\n\n get enabled(): boolean {\n return this.featureFlags.isEnabled(UI_BUILDER_FLAG);\n }\n\n // Enabled + fetch resolved + nothing rendered → \"no layout yet\" (design-doctrine §2 #1).\n get showEmpty(): boolean {\n return this.enabled && this.configResolved && this.refs.length === 0;\n }\n\n openBuilder(): void {\n // Opens the Brain chat panel (Phase-1 creation path; persist = Phase 2).\n this.sidebarService?.loadContent('posiwise-brain');\n }\n\n ngAfterViewInit(): void {\n this.viewReady = true;\n this.appConfigService?.appConfig$.pipe(take(1)).subscribe(config => {\n const name = (config as { company?: { name?: string } })?.company?.name;\n if (name) {\n this.brandName = name;\n }\n this.cdr.detectChanges();\n });\n this.render();\n this.cdr.detectChanges();\n }\n\n ngOnDestroy(): void {\n this.clear();\n }\n\n private render(): void {\n this.ensureUser(() => this.doRender());\n }\n\n // Resolve the current user once if FeatureFlagService.user is unset.\n private ensureUser(done: () => void): void {\n if (this.userResolved || this.featureFlags.user || !this.userService) {\n done();\n return;\n }\n if (this.resolving) {\n return;\n }\n this.resolving = true;\n this.userService\n .getUserInfo()\n .pipe(take(1))\n .subscribe({\n next: user => {\n if (!this.featureFlags.user) {\n this.featureFlags.user = user;\n }\n this.userResolved = true;\n this.resolving = false;\n done();\n this.cdr.detectChanges();\n },\n error: () => {\n this.userResolved = true;\n this.resolving = false;\n done();\n }\n });\n }\n\n private doRender(): void {\n this.clear();\n if (!this.enabled || !this.host || !this.config) {\n return;\n }\n if (!validateUiConfig(this.config).valid) {\n return;\n }\n this.config.blocks.forEach(block => this.mount(block));\n }\n\n private mount(block: UiBlock): void {\n const type = registeredType(block.type);\n if (!type) {\n return; // unknown type → skip; never inject markup or a string\n }\n const ref = this.host.createComponent(type, { injector: this.injector });\n Object.assign(ref.instance as object, {\n props: block.props ?? {},\n binding: block.binding ?? null\n });\n ref.changeDetectorRef.markForCheck();\n this.refs.push(ref);\n }\n\n private clear(): void {\n this.refs.forEach(ref => ref.destroy());\n this.refs = [];\n this.host?.clear();\n }\n}\n","import { ChangeDetectorRef, Component, Injector, Input } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AuthService } from '@posiwise/common-services';\n\n@Component({\n selector: 'pw-header',\n templateUrl: './header.component.html',\n styleUrls: ['./header.component.scss'],\n\n standalone: false\n})\nexport class HeaderComponent extends AppBaseComponent {\n loggedIn: boolean;\n isMenuCollapsed = true;\n\n constructor(\n injector: Injector,\n private readonly authService: AuthService,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n this.authService\n .getToken$()\n .pipe()\n .subscribe(res => {\n this.loggedIn = !!res;\n this.cdr.markForCheck();\n });\n }\n\n @Input() landing = false;\n\n navigateToLogin() {\n window.location.href = '/login';\n }\n\n toggleMenu() {\n this.isMenuCollapsed = !this.isMenuCollapsed;\n }\n\n private logoFailed = false;\n\n get logo(): string | null {\n if (this.logoFailed) return null;\n return (\n this.appConfig?.company?.logos?.main_dark?.url ||\n this.appConfig?.company?.logos?.main?.url ||\n this.appConfig?.company?.logos?.main_contrast?.url ||\n null\n );\n }\n\n onLogoError() {\n this.logoFailed = true;\n this.cdr.markForCheck();\n }\n}\n","<header class=\"pw-bar\" [class.pw-bar--solid]=\"!landing\">\n <div class=\"pw-bar__inner\">\n <a class=\"pw-bar__brand\" href=\"/\">\n @if (logo) {\n <img class=\"pw-bar__brand-logo\" [src]=\"logo\" alt=\"\" (error)=\"onLogoError()\" />\n }\n <span class=\"visually-hidden\">Home</span>\n </a>\n\n <div class=\"pw-bar__actions\">\n @if (!loggedIn) {\n <button type=\"button\" class=\"pw-bar__login\" (click)=\"navigateToLogin()\">\n {{ 'Button.Login' | transloco }}\n </button>\n }\n <a class=\"pw-bar__cta\" href=\"/\">\n {{ 'Button.Home' | transloco }}\n </a>\n <button type=\"button\"\n class=\"pw-bar__toggle\"\n [class.pw-bar__toggle--open]=\"!isMenuCollapsed\"\n [attr.aria-expanded]=\"!isMenuCollapsed\"\n aria-label=\"Toggle menu\"\n (click)=\"toggleMenu()\">\n <span></span><span></span><span></span>\n </button>\n </div>\n </div>\n</header>\n","import {\n ChangeDetectorRef,\n Component,\n Injector,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild\n} from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { GroupService, PermissionService, SubscriptionService } from '@posiwise/common-services';\nimport { Subscription, TAG_ENTITY, User } from '@posiwise/common-utilities';\nimport { HelperService } from '@posiwise/helper-service';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { EnrolledUser, SharedModalContext } from '../../shared/shared-component.interface';\n\n@Component({\n selector: 'pw-entity-group',\n templateUrl: './entity-group.component.html',\n styleUrls: ['./entity-group.component.scss'],\n\n standalone: false\n})\nexport class EntityGroupComponent extends AppBaseComponent implements OnInit, OnDestroy {\n @ViewChild('content', { static: true }) content: TemplateRef<SharedModalContext>;\n\n subscription: Subscription;\n subscriptionId: number;\n\n user: User;\n userId: number;\n\n entityId: number;\n selectedGroup: { name: string };\n\n subscriptionMembers = []; // Holds all the members\n subscribedMembers = []; // Holds all the members\n filteredMembers = []; // Populates in the autocomplete\n selectedMembers = []; // Selected in the autocomplete\n\n enrolledUsers: EnrolledUser[];\n\n admins = [];\n subscriptionInfo = [];\n subscriptionOwner: number;\n\n /** Chat permission for the selected product, read at render time (#4228). */\n get chatPermission(): string | null {\n return PermissionService.productPermission('Chat');\n }\n\n isLoaded = false;\n\n hasAccess: boolean;\n\n constructor(\n private readonly groupService: GroupService,\n private readonly subscriptionService: SubscriptionService,\n private readonly modalService: NgbModal,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n ngOnInit() {\n this.getUserSubscription().subscribe(response => {\n this.subscription = response;\n if (this.subscription?.id) {\n this.getSubscribedUsers();\n }\n this.cdr.markForCheck();\n });\n this.route.params.subscribe(params => {\n this.entityId = Number(params['groupId']);\n this.getEntity();\n this.cdr.markForCheck();\n });\n this.userStore().subscribe(user => {\n this.user = user;\n if (this.user) {\n this.userId = this.user.id;\n }\n this.cdr.markForCheck();\n });\n }\n\n search(event) {\n let data = [];\n if (event.query) {\n data = this.subscriptionMembers.filter((x: { displayName: string }) => {\n return x.displayName.toLowerCase().includes(event.query.toLowerCase());\n });\n } else {\n this.subscriptionMembers.forEach(element => {\n data.push(element);\n });\n }\n this.filteredMembers = data;\n }\n\n open() {\n this.groupService.getSubscriptionMembers(this.subscription?.id).subscribe(response => {\n response.members.forEach(member => {\n member.displayName = `${member.first_name ?? ''} ${member.last_name ?? ''} ${\n member.email\n }`.trim();\n });\n this.subscriptionMembers = response.members;\n this.cdr.markForCheck();\n });\n\n this.modalService.open(this.content, { centered: true, windowClass: 'modal-holder' });\n }\n\n closeModal(modal) {\n modal.close();\n this.filteredMembers = [];\n }\n\n getEntity() {\n this.groupService\n .getEntityGroup(this.entityId)\n .subscribe(response => {\n response.members.forEach(member => {\n member.displayName = `${member.first_name ?? ''} ${member.last_name ?? ''} ${\n member.email\n }`.trim();\n });\n this.subscribedMembers = response.members;\n this.selectedGroup = response;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n onSave() {\n const data = {\n entity_groups: [\n {\n related_entity_id: this.selectedMembers.map(x => x.id),\n related_entity_type: TAG_ENTITY.USER\n }\n ]\n };\n\n this.groupService.addEntityGroup(this.entityId, data).subscribe(() => {\n this.modalService.dismissAll();\n this.toast.success(this.translation.translate('Admin.Shared.Entity.AddedMessage'));\n\n this.getEntity();\n this.cdr.markForCheck();\n });\n }\n\n private getSubscribedUsers() {\n this.subscriptionService\n .getEnrolledSubscription(this.subscription?.id)\n .subscribe(response => {\n this.subscriptionOwner = response.owner_id;\n this.admins = response.admins;\n this.enrolledUsers = response.members;\n this.enrolledUsers.forEach(element => {\n element.is_owner = element?.id === this.user?.id;\n });\n this.hasAccess =\n this.admins.includes(this.user?.id) ||\n this.user?.id === this.subscriptionOwner ||\n this.permissionService.isSuperAdmin();\n this.cdr.markForCheck();\n });\n }\n\n onDelete(memberId) {\n HelperService.raiseDeletePopup()\n .then(resp => {\n if (resp.value) {\n const data = JSON.stringify([memberId]);\n this.groupService\n .deleteEntityGroup(this.entityId, data, 'User')\n .subscribe(() => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Entity.DeletedMessage')\n );\n this.getEntity();\n this.cdr.markForCheck();\n });\n }\n })\n .catch(error => this.toast.showToast(error));\n }\n\n navigateToCommunications() {\n this.router.navigate([`/${this.subscription?.slug}/enterprise/communications`], {\n queryParams: { entity_id: this.entityId }\n });\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","<div>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Team View</h2>\n\n <p>\n In this section, based on your permissions, you can add/remove members from your\n teams.\n <br />\n Then, you'll be able to see powerful insight on the activities performed by your\n team's members.\n </p>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-md-6 col-xs-12 d-flex align-items-sm-center align-items-top text-start pe-0\">\n <a aria-label=\"Navigate to Target\"\n (click)=\"back()\"\n class=\"previous\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n <h3 class=\"ms-sm-2 d-inline mt-0 card-title mb-3 mb-sm-0\">\n Team view: {{ selectedGroup?.name }}\n </h3>\n </div>\n <div class=\"col-md-6 col-xs-12 text-end justify-content-end\">\n @if (hasAccess) {\n <button\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"open()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Add Members\n </button>\n }\n @if (hasAccess) {\n <button\n class=\"btn btn-sm btn-outline-primary ms-2\"\n (click)=\"navigateToCommunications()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> See Communications\n </button>\n }\n </div>\n </div>\n\n @if (!isLoaded) {\n <div class=\"w-100 mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"4\" [showCaption]=\"false\" />\n </div>\n }\n\n <div class=\"primeng-datatable-container actions-collapsed table-responsive\"\n [class.d-none]=\"!isLoaded\"\n [class.hideTable]=\"subscribedMembers?.length === 0\">\n <p-table #dt\n [value]=\"subscribedMembers\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n stateKey=\"pw-table.entity-group\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"true\">{{ 'Label.FirstName' | transloco }}</th>\n <th pResizableColumn scope=\"true\">{{ 'Label.LastName' | transloco }}</th>\n <th pResizableColumn scope=\"true\">{{ 'Label.Email' | transloco }}</th>\n <th scope=\"true\" class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n <ng-template #body\n let-member>\n <tr class=\"table-row\">\n <td data-head=\"First Name\">\n <a [routerLink]=\"['/members', member.slug]\">{{ member.first_name || null }}\n </a>\n </td>\n <td data-head=\"Last Name\">{{ member.last_name || null }}</td>\n <td data-head=\"Email\">{{ member.email }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline list-action\">\n @if (member.id !== userId) {\n <li pTooltip=\"Message\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n class=\"me-2 me-sm-3\"\n [routerLink]=\"['/message']\"\n [fragment]=\"member.slug\">\n <i\n class=\"fa fa-comments cta1-icon\"\n *rbacAllow=\"chatPermission\"\n aria-hidden=\"true\"\n ></i>\n </li>\n }\n @if (hasAccess) {\n <li pTooltip=\"Remove\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n class=\"me-2 me-sm-3\"\n (click)=\"onDelete(member.id)\"\n (keydown.enter)=\"onDelete(member.id)\"\n (keydown.space)=\"onDelete(member.id)\"\n >\n <i class=\"fa fa-trash delete-icon\" aria-hidden=\"true\"></i>\n </li>\n }\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n @if (subscribedMembers?.length === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"There are no members in this team yet.\"\n >\n </pw-no-data>\n }\n </div>\n\n <ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">Add Members</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Please start typing to select the members to add to this team.</p>\n <div class=\"ui-fluid skills-modal\">\n <p-auto-complete class=\"w-100\" appendTo=\"body\" [suggestions]=\"filteredMembers\"\n [(ngModel)]=\"selectedMembers\"\n dataKey=\"id\"\n optionLabel=\"displayName\"\n (completeMethod)=\"search($event)\"\n placeholder=\"Member\"\n [multiple]=\"true\">\n </p-auto-complete>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"closeModal(modal)\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"onSave()\">\n {{ 'Button.Save' | transloco }}\n </button>\n </div>\n </ng-template>\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n inject,\n signal\n} from '@angular/core';\n\n/**\n * A form's Cancel / Submit row that stays on screen while a long form scrolls. Put the buttons inside\n * it. Pages that hold it rely on the `@posiwise/core-styles` rule that stops the shell's\n * `.overflow-hidden` containers from trapping a sticky element.\n */\n@Component({\n selector: 'pw-sticky-actions',\n standalone: true,\n templateUrl: './pw-sticky-actions.component.html',\n styleUrls: ['./pw-sticky-actions.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.is-floating]': 'floating()' }\n})\nexport class PwStickyActionsComponent implements AfterViewInit {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n /** True while the bar is pinned over the form rather than resting below it. */\n readonly floating = signal(false);\n\n /**\n * The bar sits at `bottom: -1px`, so while it is pinned one pixel is off the bottom of the screen.\n * A bar cut off at the top is scrolling away under the header, not pinned.\n */\n ngAfterViewInit(): void {\n if (typeof IntersectionObserver === 'undefined') return;\n const observer = new IntersectionObserver(\n ([entry]) =>\n this.floating.set(\n entry.intersectionRatio < 1 &&\n entry.boundingClientRect.bottom > (entry.rootBounds?.bottom ?? innerHeight)\n ),\n { threshold: [1] }\n );\n observer.observe(this.el.nativeElement);\n this.destroyRef.onDestroy(() => observer.disconnect());\n }\n}\n","<div class=\"pw-sticky-actions\">\n <ng-content />\n</div>\n","import {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n Host,\n inject,\n Input,\n OnInit,\n Optional,\n SkipSelf\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { AbstractControl, ControlContainer, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'pw-input-container',\n templateUrl: './input-container.component.html',\n styleUrls: ['./input-container.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n useExisting: InputContainerComponent,\n multi: true\n }\n ],\n standalone: false\n})\nexport class InputContainerComponent implements OnInit {\n control: AbstractControl;\n\n @Input()\n name: string;\n\n /** Id of the form control; used as the label's `for` attribute for accessibility. When not set, falls back to `name`. */\n @Input()\n controlId: string;\n\n /** When true, label gets id=\"{{ controlId }}-label\" but no `for`; use with aria-labelledby on the control (e.g. quill-editor). */\n @Input()\n useAriaLabelledbyOnly = false;\n\n @Input()\n label: string;\n\n @Input()\n labelClass: string;\n\n @Input()\n tooltipPosition: string;\n\n @Input()\n required = false;\n\n @Input()\n errorMsg = 'An error occurred';\n\n @Input()\n isReadOnly = false;\n\n @Input()\n showTooltip: boolean;\n\n @Input()\n tooltipText: string;\n\n @Input()\n showTriangle = false;\n\n @Input()\n afterLabel: string;\n\n @Input()\n showAfterLabel: boolean;\n\n @Input()\n showTriangleText: string;\n\n @Input()\n isLeftTooltip = false;\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor(\n @Optional()\n @Host()\n @SkipSelf()\n private readonly controlContainer: ControlContainer\n ) {}\n\n ngOnInit() {\n if (this.controlContainer) {\n if (this.name) {\n this.control = this.controlContainer.control.get(this.name);\n if (this.control?.validator) {\n const validator = this.control.validator({} as AbstractControl);\n if (validator?.['required']) {\n this.required = true;\n }\n }\n this.refreshOnControlEvents();\n }\n }\n }\n\n /**\n * Angular 22 makes components OnPush unless they opt out, and this one's inputs\n * never change when the control does. Without this, `markAllAsTouched()` on a\n * failed submit leaves every error message hidden and the button looks dead.\n */\n private refreshOnControlEvents(): void {\n this.control?.events\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.cdr.markForCheck());\n }\n}\n","@if (useAriaLabelledbyOnly) {\n <span class=\"pw-input-container-label mb-2 d-block\" [attr.id]=\"controlId ? (controlId + '-label') : null\">\n <span [class]=\"labelClass\"\n [ngClass]=\"{ mandatory: required && !control?.disabled }\">\n {{ label }}\n </span>\n @if (showTooltip && tooltipText) {\n <span class=\"info-circle tooltip-wrap ms-1\"\n [pTooltip]=\"tooltipText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n </span>\n }\n @if (showTriangle) {\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'Last month this value was set to ' + showTriangleText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n <i class=\"fas fa-exclamation-triangle text-warning\"></i>\n </span>\n }\n <!-- after label -->\n @if (afterLabel && showAfterLabel) {\n <span\n [innerHTML]=\"afterLabel\"></span>\n }\n <!-- after label end -->\n </span>\n}\n@if (!useAriaLabelledbyOnly) {\n <label class=\"pw-input-container-label mb-2\" [attr.for]=\"controlId || name\">\n <span [class]=\"labelClass\"\n [ngClass]=\"{ mandatory: required && !control?.disabled }\">\n {{ label }}\n </span>\n @if (showTooltip && tooltipText) {\n <span class=\"info-circle tooltip-wrap ms-1\"\n [pTooltip]=\"tooltipText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n </span>\n }\n @if (showTriangle) {\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'Last month this value was set to ' + showTriangleText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n <i class=\"fas fa-exclamation-triangle text-warning\"></i>\n </span>\n }\n <!-- after label -->\n @if (afterLabel && showAfterLabel) {\n <span\n [innerHTML]=\"afterLabel\"></span>\n }\n <!-- after label end -->\n </label>\n}\n\n<div class=\"mb-3\">\n <ng-content></ng-content>\n @if (control?.errors) {\n <pw-field-error-display [displayError]=\"control?.invalid && control?.touched\"\n [errorMsg]=\"errorMsg | transloco\">\n </pw-field-error-display>\n }\n</div>\n","import { ChangeDetectorRef, Component, Injector, OnDestroy, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { DataService, GroupService, SubscriptionService } from '@posiwise/common-services';\nimport { TAG_ENTITY, User } from '@posiwise/common-utilities';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { ConfirmDialogService } from '../../confirm-dialog/confirm-dialog.service';\nimport { EnrolledUser, GroupDefinition } from '../../shared/shared-component.interface';\n\n@Component({\n selector: 'pw-group-definition',\n templateUrl: './group-definition.component.html',\n styleUrls: ['./group-definition.component.scss'],\n\n standalone: false\n})\nexport class GroupDefinitionComponent extends AppBaseComponent implements OnInit, OnDestroy {\n subscriptions = [];\n\n message: number;\n\n groupDefinition: object[];\n\n form: UntypedFormGroup;\n\n id: number;\n\n viewDefinition: boolean;\n\n viewEdit: boolean;\n\n private groupDefId: number;\n\n private groupDefinitionDetails: GroupDefinition;\n\n hasAccess: boolean;\n\n admins = [];\n\n subscriptionInfo = [];\n\n subscriptionOwner: number;\n\n enrolledUsers: EnrolledUser[];\n\n user: User;\n\n isLoaded = false;\n categoryBusyButton = false;\n\n constructor(\n private readonly groupService: GroupService,\n private readonly fb: UntypedFormBuilder,\n private readonly subscriptionService: SubscriptionService,\n private readonly data: DataService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef,\n private readonly confirmDialog: ConfirmDialogService\n ) {\n super(injector);\n this.form = this.fb.group({\n name: new UntypedFormControl('', [Validators.required]),\n description: new UntypedFormControl(''),\n is_private: [true]\n });\n }\n\n ngOnInit() {\n this.getUserSubscriptionId().subscribe(id => {\n this.id = id;\n this.cdr.markForCheck();\n });\n this.getAllGroupDefinition();\n this.getSubscribedUsers();\n this.userStore().subscribe(user => {\n this.user = user;\n this.cdr.markForCheck();\n });\n this.data.currentMessage.subscribe(message => {\n this.message = message;\n this.cdr.markForCheck();\n });\n }\n\n private getAllGroupDefinition() {\n this.groupService\n .groupDefinitionGetAll(this.id, 'Subscription')\n .subscribe(response => {\n if (response.group_definitions.length > 0) {\n this.groupDefinition = response.group_definitions;\n } else {\n this.groupDefinition = [];\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n private getSubscribedUsers() {\n this.subscriptionService.getEnrolledSubscription(this.id).subscribe(response => {\n this.subscriptionOwner = response.owner_id;\n this.admins = response.admins;\n this.enrolledUsers = response.members;\n this.enrolledUsers.forEach(element => {\n element.is_owner = element?.id === this.user?.id;\n });\n this.hasAccess =\n this.admins.includes(this.user?.id) ||\n this.user?.id === this.subscriptionOwner ||\n this.permissionService.isSuperAdmin();\n this.cdr.markForCheck();\n });\n }\n\n updateDetails() {\n this.categoryBusyButton = true;\n const formValue = this.form.value;\n const data = {\n name: formValue.name,\n description: formValue.description,\n is_private: formValue.is_private\n };\n this.groupService\n .groupDefinitionsUpdate(this.groupDefId, data)\n .subscribe(() => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Definition.UpdatedMessage')\n );\n\n this.form.reset();\n this.viewDefinition = false;\n this.getAllGroupDefinition();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.categoryBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n onGroupDefinitionEdit(id: number) {\n this.viewEdit = true;\n this.viewDefinition = true;\n this.groupDefId = id;\n this.getSubscriptionDetails();\n }\n\n getSubscriptionDetails() {\n this.groupService.getGroupDefinitionById(this.groupDefId).subscribe(response => {\n this.groupDefinitionDetails = response;\n this.form.patchValue({\n description: this.groupDefinitionDetails.description,\n name: this.groupDefinitionDetails.name\n });\n this.cdr.markForCheck();\n });\n }\n\n @ValidateForm('form')\n saveGroupDefinition() {\n this.categoryBusyButton = true;\n const data = {\n name: this.form.value.name,\n description: this.form.value.description,\n related_entity_id: this.id,\n related_entity_type: TAG_ENTITY.SUBSCRIPTION,\n is_private: this.form.value.is_private\n };\n this.groupService\n .groupDefinitions(data)\n .subscribe(() => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Definition.AddedMessage')\n );\n this.form.reset();\n this.getAllGroupDefinition();\n this.viewDefinition = false;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.categoryBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n onDelete(id: number) {\n this.confirmDialog\n .open({\n title: 'Delete',\n text: 'Are you sure you want to delete this label?',\n destructive: true\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n this.groupService.groupDefinitionsDelete(id).subscribe(_ => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Definition.DeletedMessage')\n );\n this.getAllGroupDefinition();\n this.cdr.markForCheck();\n });\n });\n }\n\n viewDefinitions() {\n this.viewDefinition = true;\n this.viewEdit = false;\n }\n\n previous() {\n this.location.back();\n this.data.changeMessage(1);\n }\n\n onCancel() {\n this.form.reset();\n this.viewDefinition = !this.viewDefinition;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","<section>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Enterprise Teams Categories</h2>\n\n <p>\n Here you can define the categories for your enterprise's groups. For example \"Sales\n Department\", \"Development Department\", etc.\n <br />\n Once the category created, you'll be able to add teams to them and see useful\n insight based on the members activity in the corresponding team.\n </p>\n </div>\n </div>\n\n @if (!viewDefinition) {\n <div class=\"row\"\n >\n <div class=\"col-6 d-flex align-items-center text-start mb-sm-3 mb-lg-0\">\n <a aria-label=\"Navigate to Target\"\n (click)=\"previous()\"\n class=\"previous\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n </div>\n @if (hasAccess) {\n <div class=\"col-6\"\n >\n <button class=\"float-end btn btn-sm btn-outline-primary me-2\"\n (click)=\"viewDefinitions()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Create Team Category\n </button>\n </div>\n }\n </div>\n }\n\n @if (viewDefinition) {\n <div>\n <h4 class=\"card-title d-inline mb-5\">\n {{ viewEdit ? 'Update the' : 'Create a new' }} category\n </h4>\n @if (!viewEdit) {\n <div class=\"mt-4\"\n >\n <form [formGroup]=\"form\"\n (ngSubmit)=\"saveGroupDefinition()\">\n <div class=\"row\">\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Label.Name' | transloco\" name=\"name\" controlId=\"group-definition-name\">\n <input type=\"text\"\n id=\"group-definition-name\"\n class=\"form-control\"\n formControlName=\"name\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Name' | transloco\"\n [attr.aria-label]=\"'Label.Name' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.Description' | transloco\" name=\"description\" controlId=\"group-definition-description\">\n <input type=\"text\"\n id=\"group-definition-description\"\n class=\"form-control\"\n formControlName=\"description\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Description' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.Description' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.IsPrivate' | transloco\" name=\"is_private\" controlId=\"group-definition-is_private\" [useAriaLabelledbyOnly]=\"true\">\n <ui-switch\n [attr.aria-labelledby]=\"'group-definition-is_private-label'\"\n formControlName=\"is_private\">\n </ui-switch>\n </pw-input-container>\n </div>\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCancel()\"\n (keydown.enter)=\"onCancel()\" >\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"categoryBusyButton\"\n class=\"btn btn-primary\">Add Category</button>\n </pw-sticky-actions>\n </form>\n </div>\n }\n @if (viewEdit) {\n <div class=\"mt-4\"\n >\n <form [formGroup]=\"form\"\n (ngSubmit)=\"updateDetails()\">\n <div class=\"row\">\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Label.Name' | transloco\" name=\"name\" controlId=\"group-definition-edit-name\">\n <input type=\"text\"\n id=\"group-definition-edit-name\"\n class=\"form-control\"\n formControlName=\"name\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Name' | transloco\"\n [attr.aria-label]=\"'Label.Name' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.Description' | transloco\" name=\"description\" controlId=\"group-definition-edit-description\">\n <input type=\"text\"\n id=\"group-definition-edit-description\"\n class=\"form-control\"\n formControlName=\"description\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Description' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.Description' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.IsPrivate' | transloco\" name=\"is_private\" controlId=\"group-definition-edit-is_private\" [useAriaLabelledbyOnly]=\"true\">\n <ui-switch\n [attr.aria-labelledby]=\"'group-definition-edit-is_private-label'\"\n formControlName=\"is_private\">\n </ui-switch>\n </pw-input-container>\n </div>\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCancel()\"\n (keydown.enter)=\"onCancel()\" >\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"categoryBusyButton\"\n class=\"btn btn-primary\">\n {{ 'Button.Update' | transloco }}\n </button>\n </pw-sticky-actions>\n </form>\n </div>\n }\n </div>\n }\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n\n @if (groupDefinition?.length !== 0) {\n @if (!viewDefinition) {\n <div class=\"row mb-last-3 group-definitions-wrapper\"\n >\n @for (group of groupDefinition; track group) {\n <div class=\"col-12 col-md-6 col-xl-4 mt-3\"\n >\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h5 class=\"mb-3\">{{ group.name }}</h5>\n <p>{{ group.description | slice: 0:200 }}</p>\n </div>\n <div class=\"card-footer\">\n <div class=\"float-end px-2\">\n @if (hasAccess) {\n <a class=\"btn btn-sm btn-outline-danger me-2\"\n (click)=\"onDelete(group.id)\">{{ 'Button.Delete' | transloco }}</a>\n }\n @if (hasAccess) {\n <a class=\"btn btn-sm btn-outline-primary me-2\"\n (click)=\"onGroupDefinitionEdit(group.id)\">{{ 'Button.Edit' | transloco }}</a>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @if (groupDefinition?.length === 0 && hasAccess && !viewDefinition && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Enterprise.Teams.NoLabelsMessage' | transloco\"> </pw-no-data>\n </div>\n }\n @if (groupDefinition?.length === 0 && !hasAccess && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Enterprise.Teams.NoLabelsUserMessage' | transloco\"> </pw-no-data>\n </div>\n }\n </section>\n","import { ChangeDetectorRef, Component, Injector, OnDestroy, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { DataService, GroupService, SubscriptionService } from '@posiwise/common-services';\nimport { Subscription, User } from '@posiwise/common-utilities';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { ConfirmDialogService } from '../../confirm-dialog/confirm-dialog.service';\nimport { Group } from '../../shared/shared-component.interface';\n\n@Component({\n selector: 'pw-groups',\n templateUrl: './groups.component.html',\n styleUrls: ['./groups.component.scss'],\n\n standalone: false\n})\nexport class GroupsComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private groupsData: Group[] = [];\n\n subscription: Subscription;\n\n message: number;\n id: number;\n group_id: number;\n\n form: UntypedFormGroup;\n\n description: string;\n name: string;\n\n allGroups: Group[] = [];\n groupDefinition: {\n name: string;\n groups: IterableIterator<object>;\n }[] = [];\n\n domainGroupDefinition = [];\n\n admins = [];\n subscriptionInfo = [];\n subscriptionOwner: number;\n enrolledUsers: { is_owner: boolean; id: number }[];\n\n user: User;\n\n submitted = false;\n viewEdit = false;\n buttonBusy = false;\n isGroupOperations = false;\n isGroupEdit = false;\n hasAccess = false;\n isLoaded = false;\n\n constructor(\n private readonly fb: UntypedFormBuilder,\n private readonly groupService: GroupService,\n private readonly subscriptionService: SubscriptionService,\n private readonly dataService: DataService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef,\n private readonly confirmDialog: ConfirmDialogService\n ) {\n super(injector);\n this.getUserSubscription().subscribe(response => {\n this.subscription = response;\n if (this.subscription?.id) {\n this.id = this.subscription?.id;\n }\n this.cdr.markForCheck();\n });\n\n this.form = this.fb.group({\n name: new UntypedFormControl('', [Validators.required]),\n description: new UntypedFormControl(''),\n group_definition_id: new UntypedFormControl('', [Validators.required])\n });\n }\n\n ngOnInit() {\n this.dataService.currentMessage.subscribe(message => {\n this.message = message;\n this.cdr.markForCheck();\n });\n this.userStore().subscribe(user => {\n if (user) {\n this.user = user;\n this.getSubscribedUsers();\n }\n this.cdr.markForCheck();\n });\n this.getAllGroupDefinition();\n }\n\n /** Function to save group */\n @ValidateForm('form')\n saveGroup() {\n this.buttonBusy = true;\n this.submitted = true;\n const formValue = this.form.value;\n const data = {\n name: formValue.name,\n description: formValue.description,\n group_definition_id: formValue.group_definition_id\n };\n this.groupService\n .postGroup(data)\n .subscribe(() => {\n this.toast.success('Saved Successfully', '', {\n extendedTimeOut: 1000000\n });\n this.form.reset();\n this.getAllGroupDefinition();\n this.isGroupOperations = false;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.submitted = false;\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n\n private getAllGroupDefinition() {\n this.isLoaded = false;\n this.allGroups = [];\n this.groupService.groupDefinitionGetAll(this.id, 'Subscription').subscribe(response => {\n this.isLoaded = true;\n if (response.group_definitions.length > 0) {\n this.groupDefinition = response.group_definitions;\n this.domainGroupDefinition = [\n { id: '0', name: 'All Team Categories', groups: [] },\n ...response.group_definitions\n ];\n this.groupDefinition.forEach(data => {\n const groups = [...data.groups];\n groups.forEach(group => {\n this.allGroups.push({ ...group, group_definition_name: data?.name });\n this.groupsData = this.allGroups;\n });\n });\n } else {\n this.groupDefinition = [];\n }\n this.cdr.markForCheck();\n });\n }\n\n private getSubscribedUsers() {\n this.getUserSubscription().subscribe(sub => {\n this.subscription = sub;\n if (this.subscription?.id) {\n this.subscriptionService.getEnrolledSubscription(sub?.id).subscribe(response => {\n this.subscriptionOwner = response.owner_id;\n this.admins = response.admins;\n this.enrolledUsers = response.members;\n this.enrolledUsers.forEach(element => {\n element.is_owner = element?.id === this.user?.id;\n });\n this.hasAccess =\n this.admins.includes(this.user?.id) ||\n this.user?.id === this.subscriptionOwner ||\n this.permissionService.isSuperAdmin();\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n groupOperation() {\n this.form.reset();\n this.viewEdit = false;\n this.isGroupOperations = true;\n this.isGroupEdit = false;\n }\n\n cancelUpdate() {\n this.isGroupOperations = false;\n this.form.reset();\n }\n\n editGroup(group_id: number) {\n this.form.reset();\n this.viewEdit = true;\n this.isGroupOperations = true;\n this.isGroupEdit = true;\n this.group_id = group_id;\n this.getGroupDetails(group_id);\n }\n\n private getGroupDetails(id: number) {\n this.groupService.getGroup(id).subscribe(response => {\n this.form.patchValue({\n name: response.name,\n description: response.description,\n group_definition_id: response.group_definition_id\n });\n this.cdr.markForCheck();\n });\n }\n\n updateDetails() {\n this.buttonBusy = true;\n const formValue = this.form.value;\n const data = {\n name: formValue.name,\n description: formValue.description,\n group_definition_id: formValue.group_definition_id\n };\n this.groupService\n .updateGroup(this.group_id, data)\n .subscribe(() => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Groups.UpdatedMessage')\n );\n this.form.reset();\n this.getAllGroupDefinition();\n this.isGroupOperations = false;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n\n onDelete(id: number) {\n this.confirmDialog\n .open({\n title: 'Delete',\n text: 'Are you sure you want to delete this team?',\n destructive: true\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n this.groupService.deleteGroup(id).subscribe(_ => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Groups.DeletedMessage')\n );\n this.isGroupOperations = false;\n this.getAllGroupDefinition();\n this.cdr.markForCheck();\n });\n });\n }\n\n filterDomainsList(event) {\n if (event !== '0') {\n const searchedList = this.groupsData.filter(\n group => group.group_definition_id === Number(event)\n );\n this.allGroups = searchedList;\n } else {\n this.allGroups = this.groupsData;\n }\n }\n\n previous() {\n this.location.back();\n this.dataService.changeMessage(1);\n }\n\n navigateToCommunications(id: number) {\n this.router.navigate([`/${this.subscription?.slug}/enterprise/communications`], {\n queryParams: { entity_id: id }\n });\n }\n\n navigateToDocumentations(id: number) {\n this.router.navigate([`/${this.subscription?.slug}/enterprise/wiki`], {\n queryParams: { entity_id: id }\n });\n }\n\n trackByGroup(_index: number, item: { id: number }) {\n return item.id;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","<div>\n <section>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Enterprise Teams</h2>\n\n <p>\n Here you can define the teams for your Enterprise members. For example\n \"Corporate Sales Team\", \"Frontend Dev Team\" etc.\n <br />\n Once the teams created, you'll be able to add members to them and see useful\n insight based on the members activity in the corresponding team.\n </p>\n </div>\n </div>\n\n @if (!isGroupOperations) {\n <div class=\"row\"\n >\n <div class=\"col-12 d-flex justify-content-end align-items-center text-end mb-3\">\n @if (hasAccess) {\n <button\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"groupOperation()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Add Team\n </button>\n }\n @if (hasAccess) {\n <button\n class=\"btn btn-sm btn-outline-primary ms-1\"\n [routerLink]=\"['/' + subscription?.slug + '/enterprise', 'groups', 'labels']\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Manage Team Categories\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Add Group Template -->\n @if (isGroupOperations) {\n <div\n class=\"mb-4\">\n <h4 class=\"card-title d-inline\">{{ viewEdit ? 'Update the' : 'Create a new' }} team</h4>\n @if (!isGroupEdit) {\n <div class=\"mt-4\"\n >\n <form [formGroup]=\"form\"\n (ngSubmit)=\"saveGroup()\">\n <div class=\"row\">\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamName' | transloco\" name=\"name\" controlId=\"groups-teamName\">\n <input type=\"text\"\n id=\"groups-teamName\"\n class=\"form-control\"\n formControlName=\"name\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.TeamName' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.TeamName' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.Description' | transloco\" name=\"description\" controlId=\"groups-description\">\n <input type=\"text\"\n id=\"groups-description\"\n class=\"form-control\"\n formControlName=\"description\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Description' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.Description' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamCategory' | transloco\" name=\"group_definition_id\" controlId=\"groups-teamCategory\">\n <p-select\n inputId=\"groups-teamCategory\"\n [options]=\"groupDefinition\"\n formControlName=\"group_definition_id\"\n [ngClass]=\"{'is-invalid': submitted && form.controls['group_definition_id'].errors}\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.TeamCategory' | transloco\"\n optionValue=\"id\"\n optionLabel=\"name\">\n </p-select>\n </pw-input-container>\n </div>\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n (click)=\"isGroupOperations = !isGroupOperations\"\n class=\"btn btn-outline-default me-2\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\">Add</button>\n </pw-sticky-actions>\n </form>\n </div>\n }\n <!-- Edit Group Template -->\n @if (isGroupEdit) {\n <div class=\"mt-4\"\n >\n <form [formGroup]=\"form\"\n (ngSubmit)=\"updateDetails()\">\n <div class=\"row\">\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamName' | transloco\" name=\"name\" controlId=\"groups-edit-teamName\">\n <input type=\"text\"\n id=\"groups-edit-teamName\"\n class=\"form-control\"\n formControlName=\"name\"\n required=\"true\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.TeamName' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.TeamName' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamDescription' | transloco\" name=\"description\" controlId=\"groups-edit-description\">\n <input type=\"text\"\n id=\"groups-edit-description\"\n value=\"{{ description }}\"\n class=\"form-control\"\n formControlName=\"description\"\n required=\"true\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Description' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.TeamDescription' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamCategory' | transloco\" name=\"group_definition_id\" controlId=\"groups-edit-teamCategory\">\n <p-select\n inputId=\"groups-edit-teamCategory\"\n [options]=\"groupDefinition\"\n formControlName=\"group_definition_id\"\n [ngClass]=\"{'is-invalid': submitted && form.controls['group_definition_id'].errors}\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.TeamCategory' | transloco\"\n optionValue=\"id\"\n optionLabel=\"name\">\n </p-select>\n </pw-input-container>\n </div>\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancelUpdate()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\">\n {{ 'Button.Update' | transloco }}\n </button>\n </pw-sticky-actions>\n </form>\n </div>\n }\n </div>\n }\n\n @if (!isGroupOperations) {\n <div class=\"row\"\n >\n <div class=\"col-4 mt-2 filter\">\n <p-select class=\"pw-filter-select\"\n [options]=\"domainGroupDefinition\"\n optionLabel=\"name\"\n optionValue=\"id\"\n [ngModel]=\"'0'\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.FilterTeamCategory' | transloco\"\n (onChange)=\"filterDomainsList($event.value)\">\n </p-select>\n </div>\n </div>\n }\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (!isGroupOperations) {\n <div class=\"row group_list my-4\"\n >\n @for (group of allGroups; track trackByGroup($index, group)) {\n <div class=\"col-12 col-md-6 col-xl-4 mt-3\"\n >\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h5 class=\"mb-3\">{{ group.name }}</h5>\n <p>{{ group.description | slice: 0:200 }}</p>\n <span><a class=\"badge bg-primary\">{{\n group?.group_definition_name\n }}</a></span>\n </div>\n <div class=\"card-footer\">\n <div class=\"float-end px-2\">\n @if (hasAccess) {\n <a class=\"me-2 my-1\"\n aria-label=\"Delete\"\n (click)=\"onDelete(group.id)\">\n <i class=\"fa fa-trash delete-icon\" aria-hidden=\"true\"></i></a>\n }\n @if (hasAccess) {\n <a class=\"me-2 my-1\"\n aria-label=\"Edit Group\"\n (click)=\"editGroup(group.id)\"><i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i></a>\n }\n <a class=\"me-2 my-1\"\n aria-label=\"Members\"\n [routerLink]=\"[group.id, 'members']\"><i class=\"fa fa-tasks cta1-icon\" aria-hidden=\"true\"></i>\n </a>\n <a class=\"communications me-2 my-1\"\n aria-label=\"Communications\"\n (click)=\"navigateToCommunications(group.id)\"><i class=\"fa fa-comments cta2-icon\" aria-hidden=\"true\"></i></a>\n <a class=\"communications my-1\"\n aria-label=\"Documents\"\n (click)=\"navigateToDocumentations(group.id)\"><i class=\"fab fa-wikipedia-w cta1-icon\" aria-hidden=\"true\"></i></a>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n </section>\n </div>\n @if (allGroups?.length === 0 && hasAccess && !isGroupOperations && isLoaded) {\n <div\n class=\"clear-both\">\n <pw-no-data [withImage]=\"true\" [message]=\"'Enterprise.Teams.NoTeamMessage' | transloco\"> </pw-no-data>\n </div>\n }\n @if (allGroups?.length === 0 && !hasAccess && !isGroupOperations && isLoaded) {\n <div\n class=\"clear-both\">\n <pw-no-data [withImage]=\"true\" [message]=\"'Enterprise.Teams.NoTeamMessageIfUser' | transloco\"> </pw-no-data>\n </div>\n }\n","import { ChangeDetectorRef, Component, Injector, OnInit } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AuthService } from '@posiwise/common-services';\n\n@Component({\n selector: 'pw-landing-page-footer-b',\n templateUrl: './landing-page-footer-b.component.html',\n styleUrls: ['./landing-page-footer-b.component.scss'],\n\n standalone: false\n})\nexport class LandingPageFooterBComponent extends AppBaseComponent implements OnInit {\n isBrowserAccess: boolean;\n\n currentDate: Date = new Date();\n\n get companyName(): string {\n return this.appConfig?.company?.name || 'PosiWise';\n }\n\n get companyEmail(): string {\n return this.appConfig?.company?.email || 'info@posiwise.com';\n }\n\n get companyTagline(): string | null {\n return this.appConfig?.company?.description || null;\n }\n\n get logoUrl(): string {\n return (\n this.appConfig?.company?.logos?.main_dark?.url ||\n this.appConfig?.company?.logos?.main?.url ||\n '/assets/img/logos/logo_text_big_dark.png'\n );\n }\n\n get socialLinkedin(): string | null {\n return this.appConfig?.social?.linkedin_url || null;\n }\n\n get socialFacebook(): string | null {\n return this.appConfig?.social?.facebook_url || null;\n }\n\n get socialTwitter(): string | null {\n return this.appConfig?.social?.twitter_url || null;\n }\n\n constructor(\n private readonly authService: AuthService,\n private readonly cdr: ChangeDetectorRef,\n injector: Injector\n ) {\n super(injector);\n }\n\n ngOnInit() {\n this.authService.platform$.subscribe(platform => {\n if (platform === 'browser') {\n this.isBrowserAccess = true;\n }\n this.cdr.markForCheck();\n });\n }\n\n public scrollToTop(event: Event): void {\n event.preventDefault();\n if (!this.isBrowserAccess) return;\n window.scrollTo({ top: 0, behavior: 'smooth' });\n }\n}\n","<footer class=\"lp-foot\">\n <div class=\"lp-foot__inner\">\n <div class=\"lp-foot__brand-col\">\n <a href=\"/\" [attr.aria-label]=\"companyName\" class=\"lp-foot__brand\">\n <img [src]=\"logoUrl\"\n [alt]=\"companyName\"\n height=\"28\"\n width=\"140\"\n decoding=\"async\" />\n </a>\n @if (companyTagline) {\n <p class=\"lp-foot__line\">{{ companyTagline }}</p>\n }\n </div>\n\n <div class=\"lp-foot__cols\">\n <div class=\"lp-foot__col\">\n <p class=\"lp-foot__col-label\">Get in touch</p>\n <a [href]=\"'mailto:' + companyEmail\" class=\"lp-foot__link\">{{ companyEmail }}</a>\n <a href=\"#contact-b\" class=\"lp-foot__link\">Request access</a>\n </div>\n\n @if (socialLinkedin || socialFacebook || socialTwitter) {\n <div class=\"lp-foot__col\">\n <p class=\"lp-foot__col-label\">Elsewhere</p>\n @if (socialLinkedin) {\n <a [href]=\"socialLinkedin\" target=\"_blank\" rel=\"noopener\" class=\"lp-foot__link\">LinkedIn</a>\n }\n @if (socialFacebook) {\n <a [href]=\"socialFacebook\" target=\"_blank\" rel=\"noopener\" class=\"lp-foot__link\">Facebook</a>\n }\n @if (socialTwitter) {\n <a [href]=\"socialTwitter\" target=\"_blank\" rel=\"noopener\" class=\"lp-foot__link\">Twitter</a>\n }\n </div>\n }\n\n @if (isBrowserAccess) {\n <div class=\"lp-foot__col\">\n <p class=\"lp-foot__col-label\">Company</p>\n <a routerLink=\"/privacy-policy\" class=\"lp-foot__link\">Privacy Policy</a>\n <a routerLink=\"/terms-conditions\" class=\"lp-foot__link\">Terms &amp; Conditions</a>\n <a routerLink=\"/resources\" class=\"lp-foot__link\">Resources</a>\n <a routerLink=\"/status\" class=\"lp-foot__link\">Status</a>\n </div>\n }\n </div>\n </div>\n\n <div class=\"lp-foot__rule\" aria-hidden=\"true\"></div>\n\n <div class=\"lp-foot__base\">\n <p class=\"lp-foot__copy\">\n &copy; {{ currentDate | date: 'yyyy' }} {{ companyName }}. All rights reserved.\n </p>\n <span class=\"lp-foot__trust\" aria-label=\"SOC 2 compliant\">\n <span class=\"lp-foot__trust-dot\" aria-hidden=\"true\"></span>\n SOC&nbsp;2\n </span>\n <a href=\"#\"\n [attr.aria-label]=\"'Back to top'\"\n class=\"lp-foot__top\"\n (click)=\"scrollToTop($event)\">\n Back to top <span aria-hidden=\"true\">↑</span>\n </a>\n </div>\n</footer>\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\n\nimport { NumberPickerService } from '@posiwise/common-services';\n\nimport { buttonsOrientationType, CustomClasses, sizeType } from './number-picker.config';\n\n@Component({\n selector: 'pw-number-picker',\n templateUrl: './number-picker.component.html',\n styleUrls: ['./number-picker.component.scss'],\n\n standalone: false\n})\nexport class NumberPickerComponent implements OnInit {\n private precision: number;\n\n private eventHolder = null;\n\n private countInterval = null;\n\n private isInputFocused = false;\n\n @Input() min: number;\n\n @Input() showTooltip: boolean;\n\n @Input() tooltipText: string;\n\n @Input() max: number;\n\n @Input() step: number;\n\n @Input() value: number;\n\n @Input() pickStartAfter: number;\n\n @Input() pickTimer: number;\n\n @Input() prefix: string;\n\n @Input() postfix: string;\n\n @Input() placeholder: string;\n\n @Input() buttonsOrientation: buttonsOrientationType;\n\n @Input() size: sizeType = 'md';\n\n @Input() customClass: CustomClasses = {};\n\n @Input() mouseWheel = false;\n\n @Input() arrowKeys = true;\n\n @Input() inputReadOnly = false;\n\n @Input() showUpButton = true;\n\n @Input() showDownButton = true;\n\n /** Optional id for the number input (for accessibility/label association). */\n @Input() inputId: string;\n\n @Output() valueChange: EventEmitter<number> = new EventEmitter();\n\n @Output() minReached: EventEmitter<boolean> = new EventEmitter();\n\n @Output() maxReached: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickStarted: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickStopped: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickUpStarted: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickUpStopped: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickDownStarted: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickDownStopped: EventEmitter<boolean> = new EventEmitter();\n\n constructor(private readonly numberPickerService: NumberPickerService) {}\n\n ngOnInit() {\n this.initPicker();\n }\n\n isHorizontal(): boolean {\n return this.buttonsOrientation !== 'v' && this.buttonsOrientation !== 'vertical';\n }\n\n onFocus(event: FocusEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isInputFocused = true;\n }\n\n onBlur(event: Event) {\n event.preventDefault();\n event.stopPropagation();\n this.isInputFocused = false;\n }\n\n onMouseWheel(event: WheelEvent) {\n if (this.isInputFocused) {\n event.preventDefault();\n let wheelUp = null;\n let delta = null;\n\n if (event.deltaY) {\n delta = event.deltaY / 60;\n }\n if (event.detail) {\n delta = -event.detail / 2;\n }\n if (delta !== null) {\n wheelUp = delta > 0;\n }\n\n this.afterMouseWheels(wheelUp, event);\n event.stopPropagation();\n }\n }\n\n private afterMouseWheels(wheelUp: boolean, event: WheelEvent) {\n this.onPickStarted(wheelUp);\n if (wheelUp) {\n this.onIncrease(event);\n } else {\n this.onDecrease(event);\n }\n this.onPickStopped(wheelUp);\n }\n\n onValueChange(_event: Event) {\n if (this.value > this.max) {\n this.value = this.max;\n } else if (this.value < this.min) {\n this.value = this.min;\n }\n if (this.parseVal(this.value) === 0 || this.parseVal(this.value)) {\n this.valueChange.emit(this.value);\n }\n }\n\n onDecrease(event: MouseEvent | WheelEvent | KeyboardEvent) {\n event.preventDefault();\n if (this.canDecrease()) {\n this.value = this.round(this.value > this.min ? this.value - this.step : this.value);\n this.valueChange.emit(this.value);\n } else {\n this.minReached.emit(true);\n }\n event.stopPropagation();\n }\n\n onIncrease(event: MouseEvent | WheelEvent | KeyboardEvent) {\n event.preventDefault();\n if (this.canIncrease()) {\n this.value = this.round(this.value < this.max ? this.value + this.step : this.value);\n this.valueChange.emit(this.value);\n } else {\n this.maxReached.emit(true);\n }\n event.stopPropagation();\n }\n\n onMouseDown(event: MouseEvent, increase = true) {\n this.afterMouseDown(increase, event);\n }\n\n private isArrowUpDown(key: string): boolean {\n return key === 'ArrowUp' || key === 'ArrowDown';\n }\n\n private isArrowUp(key: string): boolean {\n return key === 'ArrowUp';\n }\n\n private loopPick(increase: boolean, event: MouseEvent | KeyboardEvent) {\n this.onPickStarted(increase);\n this.eventHolder = setTimeout(() => {\n this.countInterval = setInterval(() => {\n if (increase) {\n this.onIncrease(event);\n } else {\n this.onDecrease(event);\n }\n }, this.pickTimer);\n }, this.pickStartAfter);\n }\n\n onMouseUp(event: MouseEvent, increase = true) {\n this.afterMouseUp(increase, event);\n }\n\n onKeyDown(event: KeyboardEvent) {\n if (this.isArrowUpDown(event.key)) {\n event.preventDefault();\n if (!this.eventHolder) {\n this.loopPick(this.isArrowUp(event.key), event);\n }\n }\n event.stopPropagation();\n }\n\n onKeyUp(event: KeyboardEvent) {\n if (this.isArrowUpDown(event.key)) {\n event.preventDefault();\n this.afterPick(this.isArrowUp(event.key));\n }\n event.stopPropagation();\n }\n\n private afterMouseDown(up: boolean, event: MouseEvent) {\n event.preventDefault();\n if (this.isLeftClick(event)) {\n this.loopPick(up, event);\n }\n event.stopPropagation();\n }\n\n private afterMouseUp(up: boolean, event: MouseEvent) {\n event.preventDefault();\n this.afterPick(up);\n event.stopPropagation();\n }\n\n private afterPick(up: boolean) {\n this.onPickStopped(up);\n this.clearTimers();\n }\n\n private clearTimers() {\n clearTimeout(this.eventHolder);\n clearInterval(this.countInterval);\n this.eventHolder = null;\n this.countInterval = null;\n }\n\n private parseVal(value: string | number) {\n if (typeof value === 'number') {\n return value;\n }\n\n return Number.parseFloat(value);\n }\n\n private getPrecision(step: number): number {\n return /^\\d*$/.exec(String(step))[0].length;\n }\n\n private round(value: number): number {\n // eslint-disable-next-line no-restricted-properties\n return Math.round(value * 10 ** this.precision) / 10 ** this.precision;\n }\n\n private canIncrease(): boolean {\n const canIncrease = this.value <= this.max - this.step;\n if (!canIncrease) {\n this.value = this.max;\n }\n\n return canIncrease;\n }\n\n private canDecrease(): boolean {\n const canDecrease = this.value >= this.min + this.step;\n if (!canDecrease) {\n this.value = this.min;\n }\n\n return canDecrease;\n }\n\n private onPickStarted(increase: boolean) {\n const isIncrease = increase;\n if (isIncrease) {\n // NOSONAR\n if (this.canIncrease()) {\n this.pickStarted.emit(true);\n this.pickUpStarted.emit(true);\n }\n } else if (this.canDecrease()) {\n this.pickStarted.emit(true);\n this.pickDownStarted.emit(true);\n }\n }\n\n private onPickStopped(increase: boolean) {\n const isIncrease = increase;\n if (isIncrease) {\n // NOSONAR\n if (this.canIncrease()) {\n this.pickUpStopped.emit(true);\n this.pickStopped.emit(true);\n }\n } else if (this.canDecrease()) {\n this.pickDownStopped.emit(true);\n this.pickStopped.emit(true);\n }\n }\n\n private isLeftClick(event): boolean {\n return event.button === 0;\n }\n\n private initPicker(): void {\n this.min = this.parseVal(this.min) || this.numberPickerService.min;\n this.max = this.parseVal(this.max) || this.numberPickerService.max;\n this.step = this.parseVal(this.step) || this.numberPickerService.step;\n this.value = this.parseVal(this.value) || this.numberPickerService.value;\n this.pickStartAfter =\n this.parseVal(this.pickStartAfter) || this.numberPickerService.pickStartAfter;\n this.pickTimer = this.parseVal(this.pickTimer) || this.numberPickerService.pickTimer;\n this.precision = this.getPrecision(this.step) || this.numberPickerService.precision;\n this.value = this.round(this.value);\n this.placeholder = this.placeholder ?? '';\n }\n}\n","<div class=\"input-group mb-3 input-{{ size }} {{ customClass.container }}\">\n <!-- Horizontal decrease button orientation -->\n @if (isHorizontal() && showDownButton) {\n <span\n class=\"input-group-text decrease {{ customClass.down }}\"\n (click)=\"onDecrease($event)\"\n (keydown.enter)=\"onDecrease($event)\"\n (mouseup)=\"onMouseUp($event, false)\"\n (mousedown)=\"onMouseDown($event, false)\">-</span>\n }\n <!-- Input prefix -->\n @if (prefix) {\n <span\n class=\"input-group-text {{ customClass.prefix }}\">{{ prefix }}\n </span>\n }\n <input type=\"number\"\n class=\"form-control\"\n [attr.id]=\"inputId\"\n name=\"input-spin-val\"\n [(ngModel)]=\"value\"\n [readOnly]=\"inputReadOnly\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (wheel)=\"mouseWheel && onMouseWheel($event)\"\n (keyup)=\"arrowKeys && onKeyUp($event)\"\n (keydown.enter)=\"arrowKeys && onKeyDown($event)\"\n (keydown.arrowup)=\"arrowKeys && onIncrease($event)\"\n (keydown.arrowdown)=\"arrowKeys && onDecrease($event)\"\n (change)=\"onValueChange($event)\"\n [placeholder]=\"placeholder\"\n aria-label=\"Input Spin Val\" />\n <!-- Input postfix -->\n\n @if (postfix) {\n <span\n class=\"input-group-text {{ customClass.postfix }}\"\n [style.borderLeft]=\"'0'\">{{postfix}}\n @if (showTooltip && tooltipText) {\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"tooltipText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n }\n </span>\n }\n\n <!-- Horizontal increase button orientation -->\n @if (isHorizontal() && showUpButton) {\n <span\n class=\"input-group-text increase {{ customClass.up }}\"\n [style.borderLeft]=\"!postfix ? '0' : ''\"\n (click)=\"onIncrease($event)\"\n (keydown.enter)=\"onIncrease($event)\"\n (mouseup)=\"onMouseUp($event)\"\n (mousedown)=\"onMouseDown($event)\">+</span>\n }\n <!-- Vertical buttons orientation -->\n @if (!isHorizontal()) {\n <span\n class=\"input-group-text vertical p-0\">\n @if (showUpButton) {\n <span\n class=\"{{ customClass.up }}\"\n (click)=\"onIncrease($event)\"\n (keydown.enter)=\"onIncrease($event)\"\n (mouseup)=\"onMouseUp($event)\"\n (mousedown)=\"onMouseDown($event)\">+</span>\n }\n @if (showDownButton) {\n <span\n class=\"{{ customClass.down }}\"\n (keydown.enter)=\"onDecrease($event)\"\n (click)=\"onDecrease($event)\"\n (mouseup)=\"onMouseUp($event, false)\"\n (mousedown)=\"onMouseDown($event, false)\">-</span>\n }\n </span>\n }\n</div>\n","import { Component, Input } from '@angular/core';\n\n/**\n * Green presence indicator shown beside a member's name.\n *\n * Feed it `current_sign_in_at` and nothing else. Do NOT pass `last_sign_in_at`, nor the\n * `current_sign_in_at || last_sign_in_at` fallback the surrounding cells use for the date:\n * an explicit logout nulls `current_sign_in_at` and rolls its value into `last_sign_in_at`,\n * so the fallback would light the dot for someone who has just signed out.\n *\n * The online window itself lives in the `isOnline` pipe, which is paired with main-api's\n * activity-refresh interval -- see ONLINE_THRESHOLD_MINUTES.\n */\n@Component({\n selector: 'pw-online-indicator',\n templateUrl: './online-indicator.component.html',\n styleUrls: ['./online-indicator.component.scss'],\n standalone: false\n})\nexport class OnlineIndicatorComponent {\n /** The member's `current_sign_in_at` stamp. Never `last_sign_in_at`. */\n @Input() lastSeen: string | Date | null = null;\n}\n","@if (lastSeen | isOnline) {\n <span\n class=\"online-indicator\"\n [pTooltip]=\"'Label.OnlineNow' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n >{{ 'Label.Now' | transloco\n }}<span class=\"online-indicator__beacon text-success-muted\" aria-hidden=\"true\"></span\n ></span>\n}\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Injector,\n Input,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';\n\nimport { SharedModalContext } from '../shared/shared-component.interface';\n\n@Component({\n selector: 'pw-password-validation',\n templateUrl: './password-validation.component.html',\n styleUrls: ['./password-validation.component.scss'],\n standalone: false\n})\nexport class PasswordValidationComponent extends AppBaseComponent {\n @ViewChild('content', { static: true }) content: TemplateRef<SharedModalContext>;\n @ViewChild('passwordRef') passwordRef: ElementRef<HTMLInputElement>;\n\n @Input() confirmMessage: string;\n @Input() destructive = false;\n\n @Output()\n successEvent: EventEmitter<boolean> = new EventEmitter();\n\n password: string;\n passwordVisible = false;\n buttonBusy: boolean;\n\n private modalRef: NgbModalRef;\n\n constructor(\n injector: Injector,\n private readonly modal: NgbModal,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n get bodyMessage(): string {\n if (this.confirmMessage) {\n return this.confirmMessage;\n }\n return this.destructive\n ? 'Common.Confirm.PasswordValidation.BodyDestructive'\n : 'Common.Confirm.PasswordValidation.Body';\n }\n\n open() {\n this.passwordVisible = false;\n this.password = null;\n this.modalRef = this.modal.open(this.content, {\n centered: true,\n size: 'md',\n windowClass: 'pw-password-confirm-modal',\n backdrop: 'static',\n keyboard: true\n });\n setTimeout(() => this.passwordRef?.nativeElement?.focus(), 0);\n }\n\n validatePassword() {\n if (this.password) {\n this.buttonBusy = true;\n this.userService\n .checkPassword({ password: this.password })\n .subscribe(data => {\n if (data && data?.status === StatusCodes.OK) {\n this.successEvent.emit(true);\n this.modal.dismissAll();\n this.password = null;\n this.passwordVisible = false;\n } else {\n this.successEvent.emit(false);\n this.password = null;\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"pw-password-confirm\"\n [class.pw-password-confirm--destructive]=\"destructive\">\n <div class=\"pw-password-confirm__header\">\n <span class=\"pw-password-confirm__icon\"\n aria-hidden=\"true\">\n <i [class]=\"destructive ? 'pi pi-exclamation-triangle' : 'pi pi-shield'\"></i>\n </span>\n <h5 class=\"pw-password-confirm__title\">\n {{ (destructive\n ? 'Common.Confirm.PasswordValidation.TitleDestructive'\n : 'Common.Confirm.PasswordValidation.Title') | transloco }}\n </h5>\n <button type=\"button\"\n class=\"btn-close pw-password-confirm__close\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n\n <div class=\"pw-password-confirm__body\">\n <p class=\"pw-password-confirm__message\">\n {{ bodyMessage | transloco }}\n </p>\n\n <ng-content></ng-content>\n\n <div class=\"pw-password-confirm__field\">\n <label class=\"pw-password-confirm__label\"\n for=\"pw-password-confirm-input\">\n {{ 'Common.Confirm.PasswordValidation.PasswordLabel' | transloco }}\n </label>\n <div class=\"pw-password-confirm__input-wrap\">\n <input #passwordRef\n [type]=\"passwordVisible ? 'text' : 'password'\"\n [(ngModel)]=\"password\"\n (keyup.enter)=\"validatePassword()\"\n class=\"form-control pw-password-confirm__input\"\n id=\"pw-password-confirm-input\"\n name=\"pw-password-confirm-input\"\n autocomplete=\"current-password\"\n [placeholder]=\"'Common.Confirm.PasswordValidation.PasswordPlaceholder' | transloco\"\n aria-label=\"Pw Password Confirm Input\" />\n <button type=\"button\"\n class=\"pw-password-confirm__reveal\"\n [attr.aria-label]=\"(passwordVisible\n ? 'Common.Confirm.PasswordValidation.HidePassword'\n : 'Common.Confirm.PasswordValidation.ShowPassword') | transloco\"\n [attr.aria-pressed]=\"passwordVisible\"\n (click)=\"passwordVisible = !passwordVisible\">\n <i [class]=\"passwordVisible ? 'pi pi-eye-slash' : 'pi pi-eye'\"\n aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"pw-password-confirm__footer\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"modal.dismiss()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n [buttonBusy]=\"buttonBusy\"\n [disabled]=\"!password\"\n [class]=\"destructive ? 'btn btn-danger' : 'btn btn-primary'\"\n (click)=\"validatePassword()\">\n {{ 'Button.Confirm' | transloco }}\n </button>\n </div>\n </div>\n</ng-template>\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n Input,\n OnChanges,\n type SimpleChanges\n} from '@angular/core';\n\nimport { PermissionTreeData } from '../shared/shared-component.interface';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'permission-tree',\n template: ` <div class=\"permission-tree\"></div> `,\n\n standalone: false\n})\nexport class PermissionTreeComponent implements AfterViewInit, OnChanges {\n @Input() data: PermissionTreeData;\n\n private _$tree;\n private _createdTreeBefore: boolean;\n constructor(private readonly _element: ElementRef) {}\n\n ngOnChanges(simple: SimpleChanges) {\n if (simple['data']?.currentValue?.grantedPermissionNames) {\n this.refreshTree();\n }\n }\n\n ngAfterViewInit(): void {\n this._$tree = $(this._element.nativeElement);\n\n this.refreshTree();\n }\n\n getGrantedPermissionNames(): string[] {\n if (!this._$tree || !this._createdTreeBefore) {\n return [];\n }\n\n const permissionNames = [];\n\n const selectedPermissions = this._$tree.jstree('get_selected', true);\n for (const permission of selectedPermissions) {\n permissionNames.push(permission.original.id);\n }\n\n return permissionNames;\n }\n\n private refreshTree(): void {\n if (this._createdTreeBefore) {\n this._$tree.jstree('destroy');\n }\n\n this._createdTreeBefore = false;\n\n if (!this.data || !this._$tree) {\n return;\n }\n\n const treeData = this.data.permissions.map(item => {\n return {\n id: item.name,\n parent: item.parentName ?? '#',\n text: item.displayName,\n state: {\n opened: true,\n selected: this.data.grantedPermissionNames.includes(item.name)\n }\n };\n });\n\n this._$tree.jstree({\n core: {\n data: treeData\n },\n types: {\n default: {\n icon: 'fa fa-folder-open tree-item-icon-color icon-lg'\n },\n file: {\n icon: 'fa fa-file tree-item-icon-color icon-lg'\n }\n },\n checkbox: {\n keep_selected_style: false,\n three_state: false,\n cascade: ''\n },\n plugins: ['checkbox', 'types']\n });\n\n this._createdTreeBefore = true;\n\n let inTreeChangeEvent = false;\n\n const selectNodeAndAllParents = node => {\n this._$tree.jstree('select_node', node, true);\n const parent = this._$tree.jstree('get_parent', node);\n if (parent) {\n selectNodeAndAllParents(parent);\n }\n };\n\n this._$tree.on('changed.jstree', (_e, data) => {\n if (!data.node) {\n return;\n }\n\n const wasInTreeChangeEvent = inTreeChangeEvent;\n if (!wasInTreeChangeEvent) {\n inTreeChangeEvent = true;\n }\n\n let childrenNodes;\n\n if (data.node.state.selected) {\n selectNodeAndAllParents(this._$tree.jstree('get_parent', data.node));\n\n childrenNodes = $.makeArray(this._$tree.jstree('get_children_dom', data.node));\n this._$tree.jstree('select_node', childrenNodes);\n } else {\n childrenNodes = $.makeArray(this._$tree.jstree('get_children_dom', data.node));\n this._$tree.jstree('deselect_node', childrenNodes);\n }\n\n if (!wasInTreeChangeEvent) {\n inTreeChangeEvent = false;\n }\n });\n }\n}\n","interface OpenList {\n level: number;\n type: 'ol' | 'ul';\n el: HTMLElement;\n}\n\n/**\n * Quill 2 saves every list as `<ol><li data-list=\"bullet|ordered\">`, nests by `ql-indent-N`, and\n * draws the marker from `data-list`. Angular's `[innerHTML]` sanitizer drops `data-*` attributes,\n * so the markers vanish. Rebuilding plain nested `<ul>`/`<ol>` keeps them without trusting the HTML.\n */\nexport function toSemanticLists(doc: Document): void {\n doc.querySelectorAll('ol').forEach(list => {\n const items = Array.from(list.children).filter(\n (child): child is HTMLElement => child.tagName === 'LI'\n );\n if (!items.some(item => 'list' in item.dataset)) return;\n\n const root = doc.createDocumentFragment();\n const open: OpenList[] = [];\n const top = (): OpenList | undefined => open.at(-1);\n items.forEach(item => {\n const level = Number(/ql-indent-(\\d+)/.exec(item.className)?.[1] ?? 0);\n const type = item.dataset.list === 'ordered' ? 'ol' : 'ul';\n while ((top()?.level ?? -1) > level) open.pop();\n if (top()?.level === level && top()?.type !== type) open.pop();\n let current = top();\n if (current?.level !== level) {\n const el = doc.createElement(type);\n (current?.el.lastElementChild ?? current?.el ?? root).appendChild(el);\n current = { level, type, el };\n open.push(current);\n }\n item.querySelectorAll(':scope > .ql-ui').forEach(marker => marker.remove());\n delete item.dataset.list;\n item.classList.remove(`ql-indent-${level}`);\n if (!item.classList.length) item.removeAttribute('class');\n current.el.appendChild(item);\n });\n list.replaceWith(root);\n });\n}\n","import {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n inject,\n Injector,\n Input,\n OnInit\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n LegalPagesService,\n LegalPolicy,\n LegalTab,\n PermissionService\n} from '@posiwise/common-services';\nimport { ADMIN_ROUTERS } from '@posiwise/common-utilities';\n\nimport { Observable, of } from 'rxjs';\nimport { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\n\nimport { toSemanticLists } from './quill-lists';\n\nconst TABS = new Set<LegalTab>(['privacy-policy', 'terms-of-service']);\n\ninterface SubscribedProduct {\n id: number;\n product_privacy_service_id?: number;\n}\n\n/**\n * Public routes (`data.public`) show the policy at `/privacy-policy[/:slug]`; without a slug, the\n * visitor's domain default. Signed-in pages and the embedded `[productId]` use show the policy of\n * that product, resolved to a slug so the id never reaches a URL; with no signed-in user they fall\n * back to the domain default rather than waiting forever.\n */\n@Component({\n selector: 'pw-privacy-and-tos',\n templateUrl: './privacy-and-tos.component.html',\n styleUrls: ['./privacy-and-tos.component.scss', './privacy-and-tos-lists.scss'],\n\n standalone: false\n})\nexport class PrivacyAndTosComponent extends AppBaseComponent implements OnInit {\n @Input() productId: number;\n\n // Plain strings: Angular's sanitizer runs on [innerHTML]. The policy is readable without\n // signing in, so its HTML must never be marked trusted (rulebook OUT6).\n data: { privacy?: string; tos?: string; tos_updated_at?: string };\n\n privacyServiceId: number;\n\n readonly routers = ADMIN_ROUTERS;\n\n tabId: LegalTab = 'privacy-policy';\n\n isPublic: boolean;\n\n isLoaded: boolean;\n\n tocPrivacy: { id: string; text: string }[] = [];\n tocTos: { id: string; text: string }[] = [];\n\n private readonly destroyRef = inject(DestroyRef);\n\n get companyName(): string {\n return this.appConfig?.company?.name ?? '';\n }\n get companyEmail(): string {\n return this.appConfig?.company?.email ?? '';\n }\n\n constructor(\n private readonly legalPages: LegalPagesService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n /** Edit affordance is restricted to (Master) Subscription Admins who can reach /admin/tos. */\n get canEditPolicy(): boolean {\n return !!this.privacyServiceId && this.permissionService.isUserSubscriptionSuperAdmin();\n }\n\n ngOnInit() {\n const snapshot = this.route.snapshot;\n const tab = (snapshot.queryParamMap.get('tab') ?? snapshot.data?.['tab']) as LegalTab;\n this.tabId = TABS.has(tab) ? tab : 'privacy-policy';\n this.isPublic = !!snapshot.data?.['public'];\n\n const slug$ =\n this.productId || !this.isPublic\n ? this.productSlug(this.productId ?? PermissionService.selectedProduct?.id)\n : this.route.params.pipe(map(params => (params['slug'] as string) ?? null));\n\n slug$\n .pipe(\n tap(() => (this.isLoaded = false)),\n // switchMap: a newer slug (route change, user change) cancels an older request.\n switchMap(slug => this.legalPages.getPolicy(slug).pipe(catchError(() => of(null)))),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(policy => {\n this.show(policy);\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n private productSlug(productId?: number): Observable<string | null> {\n return this.userStore().pipe(\n map(user => user?.id ?? null),\n distinctUntilChanged(),\n switchMap(userId =>\n userId\n ? this.userService.getUserSubscriptions(userId).pipe(\n map(response => this.policyIdOf(response?.subscriptions, productId)),\n catchError(() => of(null))\n )\n : of(null)\n ),\n switchMap(policyId => this.legalPages.slugFor(policyId))\n );\n }\n\n private policyIdOf(\n subscriptions: { products: SubscribedProduct[] }[] | undefined,\n productId?: number\n ): number | null {\n const product = (subscriptions ?? [])\n .flatMap(subscription => subscription?.products ?? [])\n .find(item => item?.id === productId);\n return product?.product_privacy_service_id ?? null;\n }\n\n private show(policy: LegalPolicy | null) {\n this.privacyServiceId = policy?.id;\n const privacy = this.parse(policy?.privacy, 'pp');\n const tos = this.parse(policy?.tos, 'tos');\n this.tocPrivacy = privacy.toc;\n this.tocTos = tos.toc;\n this.data = policy\n ? { tos_updated_at: policy.tos_updated_at, privacy: privacy.html, tos: tos.html }\n : {};\n }\n\n private parse(html: string | undefined, prefix: string) {\n if (!html || typeof DOMParser === 'undefined') return { html, toc: [] };\n\n const doc = new DOMParser().parseFromString(html, 'text/html');\n doc.querySelectorAll('button').forEach(b => b.remove());\n toSemanticLists(doc);\n const toc = this.buildToc(doc, prefix);\n return { html: doc.body.innerHTML, toc };\n }\n\n private buildToc(doc: Document, prefix: string): { id: string; text: string }[] {\n const items: { id: string; text: string }[] = [];\n doc.querySelectorAll('h2').forEach((h, i) => {\n const id = `${prefix}-${i}`;\n h.id = id;\n items.push({ id, text: h.textContent?.trim() ?? '' });\n });\n return items;\n }\n}\n","@if (isPublic) {\n <pw-header [landing]=\"false\"></pw-header>\n}\n\n<div class=\"legal-page\" [class.legal-page--public]=\"isPublic\">\n\n <section class=\"legal-hero\">\n <div class=\"legal-hero__container\">\n @if (!isPublic) {\n <a class=\"legal-hero__back\" (click)=\"back()\" (keydown.enter)=\"back()\" role=\"button\" tabindex=\"0\" aria-label=\"Back\">\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\n <span>Back</span>\n </a>\n }\n <span class=\"legal-hero__eyebrow\">Legal</span>\n <h1 class=\"legal-hero__title\">Privacy &amp; terms</h1>\n <p class=\"legal-hero__subtitle\">\n @if (companyName) {\n Read how {{ companyName }} handles your data and what governs your use of the product.\n } @else {\n Read how we handle your data and what governs your use of the product.\n }\n </p>\n <div class=\"legal-hero__meta\">\n @if (data?.tos_updated_at) {\n <span class=\"legal-hero__pill\">\n <i class=\"fa fa-clock\" aria-hidden=\"true\"></i>\n Last updated {{ data.tos_updated_at | date: 'MMM d, y' }}\n </span>\n }\n @if (!isPublic && canEditPolicy) {\n <a class=\"legal-hero__edit\"\n [routerLink]=\"[routers.tosAndPrivacyDetails + privacyServiceId]\"\n [attr.aria-label]=\"'Button.Edit' | transloco\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n <span>{{ 'Button.Edit' | transloco }}</span>\n </a>\n }\n </div>\n </div>\n </section>\n\n <div class=\"legal-tabs-band\">\n <div class=\"legal-tabs-band__container\">\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"tabId\" class=\"legal-tabs\">\n <li [ngbNavItem]=\"'privacy-policy'\" class=\"legal-tabs__item\">\n <a ngbNavLink class=\"legal-tabs__link\">Privacy policy</a>\n <ng-template ngbNavContent>\n <article class=\"legal-page__card\">\n @if (data?.privacy) {\n <div class=\"ql-container ql-snow legal-page__body\">\n <div class=\"ql-editor\" [innerHTML]=\"data?.privacy\"></div>\n </div>\n } @else {\n <div class=\"legal-page__empty\">\n <i class=\"fa fa-file-lines\" aria-hidden=\"true\"></i>\n <h2>Privacy policy isn't published yet</h2>\n <p>The policy for this product hasn't been written. Check back later.</p>\n </div>\n }\n </article>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"'terms-of-service'\" class=\"legal-tabs__item\">\n <a ngbNavLink class=\"legal-tabs__link\">Terms of service</a>\n <ng-template ngbNavContent>\n <article class=\"legal-page__card\">\n @if (data?.tos) {\n <div class=\"ql-container ql-snow legal-page__body\">\n <div class=\"ql-editor\" [innerHTML]=\"data?.tos\"></div>\n </div>\n } @else {\n <div class=\"legal-page__empty\">\n <i class=\"fa fa-file-lines\" aria-hidden=\"true\"></i>\n <h2>Terms of service aren't published yet</h2>\n <p>The terms for this product haven't been written. Check back later.</p>\n </div>\n }\n </article>\n </ng-template>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"legal-body\" [class.legal-body--no-toc]=\"\n (tabId === 'privacy-policy' && !tocPrivacy.length) ||\n (tabId === 'terms-of-service' && !tocTos.length)\n \">\n <div class=\"legal-body__container\">\n\n @if ((tabId === 'privacy-policy' && tocPrivacy.length) || (tabId === 'terms-of-service' && tocTos.length)) {\n <aside class=\"legal-sidebar\" aria-label=\"On this page\">\n <p class=\"legal-sidebar__label\">On this page</p>\n <nav class=\"legal-sidebar__nav\">\n @if (tabId === 'privacy-policy') {\n @for (item of tocPrivacy; track item.id) {\n <a class=\"legal-sidebar__link\" [href]=\"'#' + item.id\">{{ item.text }}</a>\n }\n } @else {\n @for (item of tocTos; track item.id) {\n <a class=\"legal-sidebar__link\" [href]=\"'#' + item.id\">{{ item.text }}</a>\n }\n }\n </nav>\n </aside>\n }\n\n <main class=\"legal-main\">\n <pw-loader [isVisible]=\"!isLoaded\"></pw-loader>\n @if (isLoaded) {\n <div [ngbNavOutlet]=\"nav\"></div>\n }\n\n @if (isLoaded && companyEmail) {\n <section class=\"legal-contact\">\n <span class=\"legal-contact__label\">Questions?</span>\n <h2 class=\"legal-contact__title\">Talk to us about your data.</h2>\n <p class=\"legal-contact__body\">\n If anything here is unclear, or you want to exercise a right under these\n policies, reach out and we'll get back to you.\n </p>\n <a class=\"legal-contact__cta\" [href]=\"'mailto:' + companyEmail\">\n <i class=\"fa fa-envelope\" aria-hidden=\"true\"></i>\n <span>{{ companyEmail }}</span>\n </a>\n </section>\n }\n </main>\n\n </div>\n </div>\n\n</div>\n","import { ChangeDetectorRef, Component, Injector, Input, OnDestroy, OnInit } from '@angular/core';\nimport { NavigationEnd } from '@angular/router';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { PermissionService } from '@posiwise/common-services';\nimport { Subscription } from '@posiwise/common-utilities';\n\nimport { MenuItem } from 'primeng/api';\nimport { Subscription as RxSubscription } from 'rxjs';\n\n@Component({\n selector: 'pw-tabs',\n templateUrl: './pw-tabs.component.html',\n\n standalone: false\n})\nexport class PwTabsComponent extends AppBaseComponent implements OnInit, OnDestroy {\n @Input()\n items: MenuItem[] = [];\n\n @Input()\n withSubscription = false;\n\n /** Current tab value (route path) for p-tabs */\n activeTabValue: string | number;\n\n private routeEventSubscription: RxSubscription;\n\n constructor(\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n ngOnInit() {\n if (this.withSubscription) {\n this.getUserSubscription().subscribe((subscription: Subscription) => {\n this.items.forEach(item => {\n // prepends the subscription slug to the route while keeping routerLink as an array\n if (Array.isArray(item.routerLink) && item.routerLink.length > 0) {\n const originalRoute = item.routerLink[0];\n item.routerLink = [`/${subscription?.slug}${originalRoute}`];\n }\n item.visible = item?.state\n ? this.permissionService.evaluatePermissions(\n item.state['permission'],\n PermissionService.selectedProduct?.feature_key,\n PermissionService.selectedProduct?.permission_key\n )\n : item.visible;\n });\n this.updateActiveTab();\n });\n } else {\n // For non-subscription tabs, update active tab after view init\n setTimeout(() => this.updateActiveTab(), 0);\n }\n\n this.routeEventSubscription = this.router.events.subscribe(e => {\n if (e instanceof NavigationEnd) {\n this.updateActiveTab();\n }\n });\n }\n\n /** Arrow function so trackBy is called with correct `this` from template */\n trackByItem = (_index: number, item: MenuItem): string => {\n return this.getItemValue(item);\n };\n\n getItemValue(item: MenuItem): string {\n if (!item.routerLink) {\n return (item as MenuItem & { id?: string }).id ?? item.label ?? '';\n }\n const routePath = Array.isArray(item.routerLink) ? item.routerLink[0] : item.routerLink;\n return String(routePath);\n }\n\n onTabChange(value: string | number): void {\n const item = this.items.find(i => this.getItemValue(i) === value);\n if (item?.routerLink) {\n const routePath = Array.isArray(item.routerLink) ? item.routerLink : [item.routerLink];\n this.router.navigate(routePath);\n }\n }\n\n private updateActiveTab(): void {\n if (!this.items.length) {\n return;\n }\n\n const currentUrl = this.router.url.split('?')[0];\n const matchedItem = this.items.find(item => {\n if (!item.routerLink || item.visible === false) {\n return false;\n }\n const routePath = Array.isArray(item.routerLink) ? item.routerLink[0] : item.routerLink;\n const pathStr = String(routePath);\n return currentUrl === pathStr || currentUrl.startsWith(pathStr + '/');\n });\n\n this.activeTabValue = matchedItem ? this.getItemValue(matchedItem) : undefined;\n this.cdr.markForCheck();\n }\n\n override ngOnDestroy() {\n this.routeEventSubscription.unsubscribe();\n }\n}\n","<div class=\"container-fluid pw-tab overflow-hidden\">\n <p-tabs [value]=\"activeTabValue\" (valueChange)=\"onTabChange($event)\">\n <p-tablist>\n @for (item of items; track trackByItem($index, item)) {\n @if (item.visible !== false) {\n <p-tab [value]=\"getItemValue(item)\">\n @if (item.icon) {\n <i [class]=\"item.icon\" aria-hidden=\"true\"></i>\n }\n <span>{{ item.label }}</span>\n </p-tab>\n }\n }\n </p-tablist>\n </p-tabs>\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <router-outlet></router-outlet>\n </div>\n </div>\n</div>\n","import { AfterViewInit, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';\n\nimport moment from 'moment';\nimport { DaterangepickerDirective } from 'ngx-daterangepicker-material';\n\n@Component({\n selector: 'app-date-picker',\n templateUrl: './date-range-picker.component.html',\n styleUrls: ['./date-range-picker.component.scss'],\n\n standalone: false\n})\nexport class DateRangePickerComponent implements AfterViewInit {\n @ViewChild(DaterangepickerDirective, { static: false })\n pickerDirective: DaterangepickerDirective;\n\n private initialized = false;\n\n @Input() selectedDateRange: { startDate: moment.Moment; endDate: moment.Moment };\n @Input() dateRanges;\n /** Optional unique id for the input (for accessibility). Defaults to 'date-range-picker-input'. */\n @Input() inputId = 'date-range-picker-input';\n @Output() dateRangeChange = new EventEmitter<{\n startDate: moment.Moment;\n endDate: moment.Moment;\n }>();\n\n onDateRangeSelect(event: { startDate: moment.Moment; endDate: moment.Moment }) {\n if (event.startDate && event.endDate) {\n this.dateRangeChange.emit(event);\n }\n }\n ngAfterViewInit() {\n setTimeout(() => {\n this.initialized = true;\n });\n }\n onClearDate() {\n if (!this.initialized) {\n return;\n }\n this.dateRangeChange.emit({ startDate: null, endDate: null });\n }\n openDatepicker() {\n setTimeout(() => {\n this.pickerDirective.open();\n this.refreshPicker();\n }, 50);\n }\n // The app runs zoneless (Angular 21+ default), but ngx-daterangepicker-material\n // relies on zone.js to re-render after `show()` sets `isShown`. Without this the\n // picker's state flips to open while its DOM keeps the `hidden` class. Only the\n // picker's own ChangeDetectorRef reaches its dynamically created view.\n refreshPicker() {\n setTimeout(() => this.pickerDirective?.picker?.['ref']?.detectChanges());\n }\n}\n","<div class=\"my-3\">\n <div class=\"row\">\n <!-- start date -->\n <div class=\"col-6 col-sm-3\">\n <div class=\"\">\n <label [attr.for]=\"inputId\" class=\"visually-hidden\">Select a date range (optional)</label>\n <input [id]=\"inputId\"\n [name]=\"inputId\"\n ngxDaterangepickerMd\n class=\"form-control\"\n [(ngModel)]=\"selectedDateRange\"\n [ranges]=\"dateRanges\"\n [alwaysShowCalendars]=\"true\"\n [locale]=\"{ format: 'DD-MMM-YYYY' }\"\n [showCustomRangeLabel]=\"true\"\n [linkedCalendars]=\"true\"\n [showClearButton]=\"true\"\n (clearClicked)=\"onClearDate()\"\n (click)=\"refreshPicker()\"\n placeholder=\"Select a date range (optional)\"\n opens=\"center\"\n (ngModelChange)=\"onDateRangeSelect($event)\"\n id=\"input_selectedDateRange_2368\" name=\"input_selectedDateRange_2368\"\n aria-label=\"Select a date range (optional)\" />\n </div>\n </div>\n <div class=\"col-6 col-sm-3 pop\">\n\n <div class=\"daterange-trigger\">\n <button class=\"btn btn-primary ngx-daterangepicker-action\"\n (click)=\"openDatepicker()\"\n type=\"button\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\nexport type CompletionTier = 'low' | 'mid' | 'high';\n\n/**\n * Generic, presentational segmented completion/progress bar.\n *\n * Renders a row of discrete segments; the first `round(value/100 * segments)`\n * are filled. The fill colour shifts by tier (low/mid/high) using the shared\n * semantic token maps — never the tenant accent (design-system: accent-agnostic).\n * Reusable anywhere via `@posiwise/shared-components`.\n */\n@Component({\n selector: 'pw-completion-bar',\n template: `\n <div\n class=\"pw-completion-bar\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"clampedValue\"\n [attr.aria-label]=\"ariaLabel || tooltip || displayLabel\"\n [ngbTooltip]=\"tooltip\"\n container=\"body\"\n >\n <span class=\"pw-completion-bar__track\" [ngClass]=\"'tier-' + tier\">\n @for (i of segmentIndexes; track i) {\n <span class=\"pw-completion-bar__seg\" [class.is-filled]=\"i < filledCount\"></span>\n }\n </span>\n @if (showLabel) {\n <span class=\"pw-completion-bar__label\">{{ displayLabel }}</span>\n }\n </div>\n `,\n styleUrls: ['./completion-bar.component.scss'],\n standalone: false,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CompletionBarComponent {\n @Input() segments = 10;\n @Input() showLabel = true;\n /** Optional label override; defaults to the rounded percentage. */\n @Input() label: string | null = null;\n /** Optional aria-label override; defaults to the visible label. */\n @Input() ariaLabel: string | null = null;\n /**\n * Optional explanatory tooltip (e.g. \"what's missing to reach 100%\").\n * Rendered as a body-level portal (C18); no tooltip when null/empty.\n */\n @Input() tooltip: string | null = null;\n /** `value` below this is the low tier. */\n @Input() lowThreshold = 34;\n /** `value` at/above this is the high tier. */\n @Input() highThreshold = 67;\n\n private internalValue = 0;\n\n /** Completion as a 0–100 percentage. Out-of-range inputs are clamped. */\n @Input()\n set value(v: number) {\n this.internalValue = Number.isFinite(v) ? Math.min(100, Math.max(0, v)) : 0;\n }\n get value(): number {\n return this.internalValue;\n }\n\n get clampedValue(): number {\n return Math.round(this.internalValue);\n }\n\n get filledCount(): number {\n return Math.round((this.internalValue / 100) * this.segments);\n }\n\n get segmentIndexes(): number[] {\n return Array.from({ length: this.segments }, (_, i) => i);\n }\n\n get tier(): CompletionTier {\n if (this.internalValue < this.lowThreshold) {\n return 'low';\n }\n return this.internalValue >= this.highThreshold ? 'high' : 'mid';\n }\n\n get displayLabel(): string {\n return this.label ?? `${this.clampedValue}%`;\n }\n}\n","/**\n * Whether a subscription's onboarding checklist is collapsed, remembered in this browser (cloudolive-api#441).\n * Kept out of the component for its line budget.\n */\nfunction storageKey(subscriptionId: number | null): string {\n return `pw-onboarding-collapsed-${subscriptionId ?? 'none'}`;\n}\n\n/** true / false once the user has toggled; null when they never did or storage is unavailable. */\nexport function readCollapsed(subscriptionId: number | null): boolean | null {\n try {\n const value = localStorage.getItem(storageKey(subscriptionId));\n return value === null ? null : value === 'true';\n } catch {\n return null;\n }\n}\n\nexport function writeCollapsed(subscriptionId: number | null, collapsed: boolean): void {\n try {\n localStorage.setItem(storageKey(subscriptionId), String(collapsed));\n } catch {\n // Not remembered; the toggle still works for this visit.\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n faChevronDown,\n faChevronUp,\n faCircle,\n faCircleCheck,\n faCircleExclamation,\n faCircleHalfStroke,\n faCircleQuestion,\n faHourglassHalf,\n IconDefinition\n} from '@fortawesome/free-solid-svg-icons';\n\nimport { readCollapsed, writeCollapsed } from './onboarding-checklist.storage';\nimport {\n OnboardingStatus,\n OnboardingStep,\n OnboardingStepState\n} from './onboarding-checklist.types';\n\nconst STATE_ICONS: Record<OnboardingStepState, IconDefinition> = {\n done: faCircleCheck,\n next: faCircleHalfStroke,\n ready: faCircleHalfStroke,\n blocked: faCircleExclamation,\n waiting: faHourglassHalf,\n todo: faCircle,\n optional: faCircle,\n unknown: faCircleQuestion\n};\n\n/**\n * Presentational onboarding checklist (cloudolive-api#441). Product-agnostic: the host fetches the\n * status from its own product API and passes it in, plus the route placeholders' values.\n *\n * Gating (AI54) is the host's: pass `loading` until the request resolves and `loadFailed` on error.\n * Renders nothing for `not_applicable` / `unavailable` — \"no onboarding\" and \"can't tell right now\"\n * both hide the card rather than show an empty or broken one.\n */\n@Component({\n selector: 'pw-onboarding-checklist',\n templateUrl: './onboarding-checklist.component.html',\n styleUrls: ['./onboarding-checklist.component.scss'],\n standalone: false,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class OnboardingChecklistComponent implements OnChanges {\n @Input() status: OnboardingStatus | null = null;\n @Input() loading = false;\n @Input() loadFailed = false;\n /** Values for the `{slug}` / `{subscription_id}` placeholders in step routes. */\n @Input() slug = '';\n @Input() subscriptionId: number | null = null;\n\n /** The host is saving a manual tick: the tick controls are disabled meanwhile. */\n @Input() busy = false;\n\n @Output() readonly retry = new EventEmitter<void>();\n /** A manual step was ticked (completed: true) or unticked; the host saves it and passes the new status. */\n @Output() readonly markDone = new EventEmitter<{ key: string; completed: boolean }>();\n\n readonly doneIcon = faCircleCheck;\n readonly helpIcon = faCircleQuestion;\n readonly expandIcon = faChevronDown;\n readonly collapseIcon = faChevronUp;\n\n /**\n * Whether the steps below the progress line are shown. Collapsed by default, so the card stays a\n * one-line progress summary on /home until someone opens it; their choice is remembered per\n * subscription in this browser.\n */\n expanded = false;\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['subscriptionId']) {\n this.expanded = readCollapsed(this.subscriptionId) === false;\n }\n }\n\n toggle(): void {\n this.expanded = !this.expanded;\n writeCollapsed(this.subscriptionId, !this.expanded);\n }\n\n get visible(): boolean {\n return this.loading || this.loadFailed || this.status?.status === 'ok';\n }\n\n /** Recommended steps, done and total, shown next to the mandatory progress (\"+ 1 of 3 recommended\"). */\n get recommended(): { done: number; total: number } {\n const optional = (this.status?.steps ?? []).filter(step => step.kind === 'optional');\n return {\n done: optional.filter(step => step.state === 'done').length,\n total: optional.length\n };\n }\n\n /** One segment per mandatory step, so the bar reads as \"steps done\", not an abstract percentage. */\n get progressSegments(): number[] {\n return Array.from({ length: this.status?.progress?.total ?? 0 }, (_, index) => index);\n }\n\n /**\n * Every required step is done. Deliberately NOT `status.activated`: activation is the product's\n * milestone (e.g. a first finalised reconciliation) and can be reached with required steps still\n * open, which made \"You're all set\" sit above \"5 of 8 steps done\".\n */\n get allDone(): boolean {\n const progress = this.status?.progress;\n return !!progress?.total && progress.done >= progress.total;\n }\n\n /**\n * Mandatory steps (they count towards progress) and recommended ones (`kind: 'optional'`), listed\n * under their own headings instead of a label repeated on every row.\n */\n get groups(): { key: string; labelKey: string; steps: OnboardingStep[] }[] {\n const steps = this.status?.steps ?? [];\n return [\n {\n key: 'mandatory',\n labelKey: 'OnboardingChecklist.Group.Mandatory',\n steps: steps.filter(step => step.kind !== 'optional')\n },\n {\n key: 'recommended',\n labelKey: 'OnboardingChecklist.Group.Recommended',\n steps: steps.filter(step => step.kind === 'optional')\n }\n ];\n }\n\n /** The group heading already says \"Recommended\", so an open optional step reads \"To do\". */\n stateLabelKey(step: OnboardingStep): string {\n const state = step.state === 'optional' ? 'todo' : step.state;\n return `OnboardingChecklist.State.${state}`;\n }\n\n get currentStep(): OnboardingStep | null {\n return this.status?.steps.find(step => step.current) ?? null;\n }\n\n icon(step: OnboardingStep): IconDefinition {\n return STATE_ICONS[step.state] ?? faCircle;\n }\n\n routeFor(step: OnboardingStep): string | null {\n if (!step.route) {\n return null;\n }\n return step.route\n .replace('{slug}', this.slug ?? '')\n .replace('{subscription_id}', String(this.subscriptionId ?? ''));\n }\n\n /** /{subscription slug}/faq/{faq slug} (the app's `:slug/faq/:id` route); null when there is no FAQ. */\n faqHref(step: OnboardingStep): string | null {\n return step.faq_slug && this.slug ? `/${this.slug}/faq/${step.faq_slug}` : null;\n }\n\n /** A step's call to action; null when there is nothing for this viewer to click. */\n actionKey(step: OnboardingStep): string | null {\n if (\n step.can_act === false ||\n ['done', 'waiting', 'unknown'].includes(step.state) ||\n !this.routeFor(step)\n ) {\n return null;\n }\n if (step.state === 'blocked') {\n return 'OnboardingChecklist.Action.Fix';\n }\n return step.state === 'ready'\n ? 'OnboardingChecklist.Action.Finish'\n : 'OnboardingChecklist.Action.Start';\n }\n\n /**\n * A manual step the viewer can tick: no check decides it (check_key null), its state is known, and the\n * viewer may act on it (an admin-only step needs an admin).\n */\n canTick(step: OnboardingStep): boolean {\n return step.check_key === null && step.state !== 'unknown' && step.can_act !== false;\n }\n\n tick(step: OnboardingStep): void {\n this.markDone.emit({ key: step.key, completed: step.state !== 'done' });\n }\n}\n","@if (visible) {\n <div class=\"card pw-onboarding\">\n <div class=\"card-content p-0\">\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-no-data [withImage]=\"true\" [message]=\"'OnboardingChecklist.LoadFailed' | transloco\">\n <div #content>\n <button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" (click)=\"retry.emit()\">\n {{ 'OnboardingChecklist.Action.Retry' | transloco }}\n </button>\n </div>\n </pw-no-data>\n } @else if (status) {\n <div class=\"card-header mt-0\">\n <h3 class=\"mb-2\">{{ 'OnboardingChecklist.Title' | transloco }}</h3>\n @if (allDone) {\n <p class=\"pw-onboarding__all-set\">\n <fa-icon [icon]=\"doneIcon\" aria-hidden=\"true\"></fa-icon>\n {{ 'OnboardingChecklist.AllSet' | transloco }}\n </p>\n } @else {\n <p>{{ 'OnboardingChecklist.Intro' | transloco }}</p>\n }\n @if (status.progress.total) {\n <div class=\"pw-onboarding__progress\">\n <progress class=\"pw-onboarding__progress-value\" [max]=\"status.progress.total\" [value]=\"status.progress.done\"\n [attr.aria-label]=\"'OnboardingChecklist.Progress' | transloco: { done: status.progress.done, total: status.progress.total }\"></progress>\n <span class=\"pw-onboarding__progress-label\">\n {{ 'OnboardingChecklist.Progress' | transloco: { done: status.progress.done, total: status.progress.total } }}\n @if (recommended.total) {\n <span class=\"pw-onboarding__progress-extra\">\n {{ 'OnboardingChecklist.ProgressRecommended' | transloco: { done: recommended.done, total: recommended.total } }}\n </span>\n }\n </span>\n <span class=\"pw-onboarding__progress-track\" [class.is-complete]=\"allDone\" aria-hidden=\"true\">\n @for (segment of progressSegments; track segment) {\n <span class=\"pw-onboarding__progress-seg\" [class.is-filled]=\"segment < status.progress.done\"></span>\n }\n </span>\n </div>\n }\n <button type=\"button\" class=\"btn btn-outline-primary pw-onboarding__toggle\" (click)=\"toggle()\"\n [attr.aria-expanded]=\"expanded\" aria-controls=\"pw-onboarding-steps\">\n <fa-icon [icon]=\"expanded ? collapseIcon : expandIcon\" aria-hidden=\"true\"></fa-icon>\n {{ (expanded ? 'OnboardingChecklist.Toggle.Hide' : 'OnboardingChecklist.Toggle.Show') | transloco }}\n </button>\n </div>\n\n @if (expanded) {\n <div id=\"pw-onboarding-steps\">\n @if (currentStep; as step) {\n <div class=\"pw-onboarding__current\" [class.is-blocked]=\"step.state === 'blocked'\">\n <div class=\"pw-onboarding__current-text\">\n <span class=\"pw-onboarding__current-title\">\n <strong class=\"pw-onboarding__current-name\">{{ step.title ?? (step.title_key | transloco) }}</strong>\n <ng-container *ngTemplateOutlet=\"faqLink; context: { $implicit: step }\"></ng-container>\n </span>\n @if (step.state === 'blocked' && step.reason_key) {\n <span class=\"pw-onboarding__reason\">\n <fa-icon [icon]=\"icon(step)\" aria-hidden=\"true\"></fa-icon>\n {{ step.reason_key | transloco }}\n </span>\n @if (step.detail) {\n <span class=\"pw-onboarding__detail\">{{ step.detail }}</span>\n }\n } @else if (step.state === 'waiting') {\n <span class=\"pw-onboarding__muted\">{{ 'OnboardingChecklist.Waiting' | transloco }}</span>\n } @else if (step.description || step.description_key) {\n <span class=\"pw-onboarding__muted\">{{ step.description ?? (step.description_key | transloco) }}</span>\n }\n @if (step.can_act === false) {\n <span class=\"pw-onboarding__muted\">{{ 'OnboardingChecklist.AskAdmin' | transloco }}</span>\n }\n </div>\n <div class=\"pw-onboarding__current-actions\">\n @if (actionKey(step); as action) {\n <a class=\"btn btn-primary pw-onboarding__main-action\" [routerLink]=\"routeFor(step)\">{{ action | transloco }}</a>\n }\n @if (canTick(step)) {\n <button type=\"button\" class=\"btn pw-onboarding__main-action\" [class.btn-primary]=\"!actionKey(step)\"\n [class.btn-outline-primary]=\"actionKey(step)\" [disabled]=\"busy\" (click)=\"tick(step)\">\n {{ 'OnboardingChecklist.Action.MarkDone' | transloco }}\n </button>\n }\n </div>\n </div>\n }\n\n @for (group of groups; track group.key) {\n @if (group.steps.length) {\n <p class=\"pw-onboarding__group\">{{ group.labelKey | transloco }}</p>\n <ol class=\"pw-onboarding__steps\">\n @for (item of group.steps; track item.key) {\n <li class=\"pw-onboarding__step\" [ngClass]=\"'is-' + item.state\" [class.is-current]=\"item.current\">\n <fa-icon class=\"pw-onboarding__marker\" [icon]=\"icon(item)\" aria-hidden=\"true\"></fa-icon>\n <span class=\"pw-onboarding__step-title\">\n {{ item.title ?? (item.title_key | transloco) }}\n <ng-container *ngTemplateOutlet=\"faqLink; context: { $implicit: item }\"></ng-container>\n </span>\n @if (actionKey(item); as action) {\n <a class=\"btn btn-outline-primary btn-sm pw-onboarding__row-action\" [routerLink]=\"routeFor(item)\"\n [attr.aria-label]=\"(action | transloco) + ' ' + (item.title ?? (item.title_key | transloco))\">{{ action | transloco }}</a>\n }\n @if (canTick(item)) {\n <button type=\"button\" class=\"btn btn-outline-primary btn-sm pw-onboarding__row-action\" [disabled]=\"busy\"\n (click)=\"tick(item)\"\n [attr.aria-label]=\"((item.state === 'done' ? 'OnboardingChecklist.Action.Undo' : 'OnboardingChecklist.Action.MarkDone') | transloco) + ' ' + item.title\">\n {{ (item.state === 'done' ? 'OnboardingChecklist.Action.Undo' : 'OnboardingChecklist.Action.MarkDone') | transloco }}\n </button>\n }\n <span class=\"pw-onboarding__state\">{{ stateLabelKey(item) | transloco }}</span>\n </li>\n }\n </ol>\n }\n }\n </div>\n }\n }\n }\n </div>\n </div>\n}\n\n<ng-template #faqLink let-step>\n @if (faqHref(step); as href) {\n <a class=\"pw-onboarding__help\" [href]=\"href\" target=\"_blank\" rel=\"noopener\"\n [attr.aria-label]=\"('OnboardingChecklist.Help' | transloco) + ' ' + (step.title ?? (step.title_key | transloco))\"\n [pTooltip]=\"'OnboardingChecklist.Help' | transloco\" tooltipPosition=\"top\" appendTo=\"body\">\n <fa-icon [icon]=\"helpIcon\" aria-hidden=\"true\"></fa-icon>\n </a>\n }\n</ng-template>\n","import { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\n\nimport { AppLoaderModule } from '@posiwise/app-loader';\nimport { CoreTranslocoModule } from '@posiwise/core-transloco';\nimport { DirectivesModule } from '@posiwise/directives';\nimport {\n FieldErrorDisplayModule,\n ProfileImageCropperModule,\n ResourceHeaderModule\n} from '@posiwise/utils';\n\nimport { AutoCompleteModule } from 'primeng/autocomplete';\nimport { ButtonModule } from 'primeng/button';\nimport { ProgressSpinnerModule } from 'primeng/progressspinner';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';\n\nimport { CompletionBarComponent } from './completion-bar/completion-bar.component';\nimport { InputContainerComponent } from './input-container/input-container.component';\nimport { NoDataComponent } from './no-data/no-data.component';\nimport { OnboardingChecklistComponent } from './onboarding-checklist/onboarding-checklist.component';\nimport { RecordsSummaryComponent } from './records-summary/records-summary.component';\n\n@NgModule({\n declarations: [\n NoDataComponent,\n InputContainerComponent,\n CompletionBarComponent,\n RecordsSummaryComponent,\n OnboardingChecklistComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n RouterModule,\n FontAwesomeModule,\n AppLoaderModule,\n CoreTranslocoModule,\n DirectivesModule,\n ButtonModule,\n NgbTooltipModule,\n TooltipModule,\n ProgressSpinnerModule,\n AutoCompleteModule,\n DragDropModule,\n FieldErrorDisplayModule,\n ProfileImageCropperModule, // ✅ Import the separate module\n ResourceHeaderModule // ✅ Import the separate module\n ],\n exports: [\n ProfileImageCropperModule, // ✅ Re-export module for backward compatibility\n ResourceHeaderModule, // ✅ Re-export module for backward compatibility\n InputContainerComponent,\n NoDataComponent,\n CompletionBarComponent,\n RecordsSummaryComponent,\n OnboardingChecklistComponent,\n ButtonModule,\n DragDropModule,\n ProgressSpinnerModule,\n AutoCompleteModule,\n TooltipModule,\n FieldErrorDisplayModule\n ]\n})\nexport class ResourceSharedComponentsModule {}\n","import { Component } from '@angular/core';\n\n@Component({\n templateUrl: './splash.component.html',\n\n standalone: false\n})\nexport class SplashComponent {}\n","<pw-loader [isVisible]=\"true\"></pw-loader>\n","import { CommonModule, NgIf } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\n\nimport { AppLoaderModule } from '@posiwise/app-loader';\nimport { CoreTranslocoModule } from '@posiwise/core-transloco';\nimport { DirectivesModule } from '@posiwise/directives';\nimport { PipesModule } from '@posiwise/pipes';\nimport { FieldErrorDisplayModule } from '@posiwise/utils';\n\nimport { NgxDaterangepickerMd } from 'ngx-daterangepicker-material';\nimport { ImageCropperComponent } from 'ngx-image-cropper';\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { AutoCompleteModule } from 'primeng/autocomplete';\nimport { ButtonModule } from 'primeng/button';\nimport { IconFieldModule } from 'primeng/iconfield';\nimport { InputIconModule } from 'primeng/inputicon';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MultiSelectModule } from 'primeng/multiselect';\nimport { ProgressSpinnerModule } from 'primeng/progressspinner';\nimport { SelectModule } from 'primeng/select';\nimport { TableModule } from 'primeng/table';\nimport { TabsModule } from 'primeng/tabs';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { NgbModalModule, NgbNavModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';\n\nimport { AiKnowledgeComponent } from './ai-knowledge/ai-knowledge.component';\nimport { AuthenticatorComponent } from './authenticator/authenticator.component';\nimport { PwBrainChatComponent } from './brain-chat/pw-brain-chat.component';\nimport { PwBrainChatConfirmComponent } from './brain-chat/pw-brain-chat-confirm.component';\nimport { PwBrainChatQuickComponent } from './brain-chat/pw-brain-chat-quick.component';\nimport { SafeMarkdownPipe } from './brain-chat/pw-brain-chat-safe-markdown.pipe';\nimport { PwBrainChatThreadDirective } from './brain-chat/pw-brain-chat-thread.directive';\nimport { PwBrainChatVoiceOverlayComponent } from './brain-chat/pw-brain-chat-voice-overlay.component';\nimport { PwBrainChatWelcomeComponent } from './brain-chat/pw-brain-chat-welcome.component';\nimport { ClearBitIconComponent } from './clearbit-icon/clearbit-icon.component';\nimport { CollapsibleSidebarComponent } from './collapsible-sidebar/collapsible-sidebar.component';\nimport { CollapsibleSidebarTriggerDirective } from './collapsible-sidebar/collapsible-sidebar-trigger.directive';\nimport { ComingSoonComponent } from './coming-soon/coming-soon.component';\nimport { CommandPaletteComponent } from './command-palette/command-palette.component';\nimport { ConfirmDialogComponent } from './confirm-dialog/confirm-dialog.component';\nimport { PwCookieBannerComponent } from './cookie-banner/pw-cookie-banner.component';\nimport { ChartBlockComponent } from './dynamic-page/blocks/chart-block.component';\nimport { DataTableBlockComponent } from './dynamic-page/blocks/data-table-block.component';\nimport { DividerBlockComponent } from './dynamic-page/blocks/divider-block.component';\nimport { SectionHeadingBlockComponent } from './dynamic-page/blocks/section-heading-block.component';\nimport { StatCardBlockComponent } from './dynamic-page/blocks/stat-card-block.component';\nimport { PwDynamicPageComponent } from './dynamic-page/pw-dynamic-page.component';\nimport { HeaderComponent } from './header/header.component';\nimport { EntityGroupComponent } from './label-management/entity-group/entity-group.component';\nimport { GroupDefinitionComponent } from './label-management/group-definition/group-definition.component';\nimport { GroupsComponent } from './label-management/groups/groups.component';\nimport { LandingPageFooterBComponent } from './landing-page-footer-b/landing-page-footer-b.component';\nimport { NumberPickerComponent } from './number-picker/number-picker.component';\nimport { OnlineIndicatorComponent } from './online-indicator/online-indicator.component';\nimport { PasswordValidationComponent } from './password-validation/password-validation.component';\nimport { PermissionTreeComponent } from './permission-tree/permission-tree.component';\nimport { PrivacyAndTosComponent } from './privacy-and-tos/privacy-and-tos.component';\nimport { PwTabsComponent } from './pw-tabs/pw-tabs.component';\nimport { DateRangePickerComponent } from './range-date-picker/date-range-picker.component';\nimport { ResourceSharedComponentsModule } from './resource-shared-components.module';\nimport { SplashComponent } from './splash/splash.component';\nimport { PwStickyActionsComponent } from './sticky-actions/pw-sticky-actions.component';\n\n// All modules needed for both landing page and dashboard\nconst allModules = [\n NgbTooltipModule,\n TooltipModule,\n NgbNavModule,\n NgbModalModule,\n TableModule,\n TabsModule,\n ButtonModule,\n SelectModule,\n MultiSelectModule,\n ProgressSpinnerModule,\n AutoCompleteModule,\n ImageCropperComponent,\n UiSwitchModule,\n NgxDaterangepickerMd.forRoot()\n];\n\n@NgModule({\n declarations: [\n AiKnowledgeComponent,\n CommandPaletteComponent,\n ConfirmDialogComponent,\n PasswordValidationComponent,\n PwTabsComponent,\n DateRangePickerComponent,\n PermissionTreeComponent,\n PrivacyAndTosComponent,\n SplashComponent,\n AuthenticatorComponent,\n ClearBitIconComponent,\n ComingSoonComponent,\n CollapsibleSidebarComponent,\n PwBrainChatComponent,\n PwBrainChatConfirmComponent,\n PwBrainChatQuickComponent,\n PwBrainChatWelcomeComponent,\n PwBrainChatVoiceOverlayComponent,\n\n EntityGroupComponent,\n GroupsComponent,\n GroupDefinitionComponent,\n NumberPickerComponent,\n OnlineIndicatorComponent,\n HeaderComponent,\n LandingPageFooterBComponent,\n\n PwDynamicPageComponent,\n SectionHeadingBlockComponent,\n DividerBlockComponent,\n StatCardBlockComponent,\n DataTableBlockComponent,\n ChartBlockComponent\n ],\n imports: [\n PwStickyActionsComponent,\n FormsModule,\n IconFieldModule,\n InputIconModule,\n InputTextModule,\n AppLoaderModule,\n ReactiveFormsModule,\n DirectivesModule,\n CoreTranslocoModule,\n RouterModule,\n allModules,\n PipesModule,\n CommonModule,\n NgIf,\n FieldErrorDisplayModule,\n ResourceSharedComponentsModule,\n CollapsibleSidebarTriggerDirective,\n PwCookieBannerComponent,\n SafeMarkdownPipe,\n PwBrainChatThreadDirective\n ],\n exports: [\n AiKnowledgeComponent,\n CommandPaletteComponent,\n ConfirmDialogComponent,\n PwCookieBannerComponent,\n PasswordValidationComponent,\n PwTabsComponent,\n DateRangePickerComponent,\n allModules,\n PermissionTreeComponent,\n PrivacyAndTosComponent,\n SplashComponent,\n AuthenticatorComponent,\n ClearBitIconComponent,\n ComingSoonComponent,\n CollapsibleSidebarComponent,\n CollapsibleSidebarTriggerDirective,\n PwBrainChatComponent,\n EntityGroupComponent,\n GroupsComponent,\n GroupDefinitionComponent,\n NumberPickerComponent,\n OnlineIndicatorComponent,\n HeaderComponent,\n LandingPageFooterBComponent,\n PwDynamicPageComponent,\n FieldErrorDisplayModule,\n ResourceSharedComponentsModule\n ]\n})\nexport class SharedComponentsModule {}\n","import { Route, Routes } from '@angular/router';\n\nimport { LegalTab } from '@posiwise/common-services';\n\nimport { PrivacyAndTosComponent } from './privacy-and-tos.component';\n\nexport interface LegalPageRouteOptions {\n /** Overrides the per-tab page title, e.g. for a product's SEO title. */\n title?: string;\n description?: string;\n canActivate?: Route['canActivate'];\n}\n\nconst TITLES: Record<LegalTab, string> = {\n 'privacy-policy': 'Privacy Policy',\n 'terms-of-service': 'Terms & conditions'\n};\n\n/** `/privacy-policy[/:slug]` and `/terms-conditions[/:slug]`, readable without signing in. */\nexport function publicLegalPageRoutes(options: LegalPageRouteOptions = {}): Routes {\n const page = (path: string, tab: LegalTab): Route => ({\n path,\n component: PrivacyAndTosComponent,\n data: {\n title: options.title ?? TITLES[tab],\n ...(options.description ? { description: options.description } : {}),\n public: true,\n tab\n },\n ...(options.canActivate ? { canActivate: options.canActivate } : {})\n });\n\n return [\n page('privacy-policy', 'privacy-policy'),\n page('privacy-policy/:slug', 'privacy-policy'),\n page('terms-conditions', 'terms-of-service'),\n page('terms-conditions/:slug', 'terms-of-service'),\n // Links published while policies were addressed by id: the id is ignored and the\n // visitor's domain default is shown, since an id is no longer accepted publicly.\n // `full`: a prefix match would carry the old id along as a slug (/privacy-policy/2).\n { path: 'privacy-and-tos', redirectTo: 'privacy-policy', pathMatch: 'full' },\n { path: 'privacy-and-tos/:Id', redirectTo: 'privacy-policy', pathMatch: 'full' }\n ];\n}\n\n/** Inside the signed-in app: the policy of the selected product. */\nexport function dashboardLegalPageRoutes(): Routes {\n const page = (path: string, tab: LegalTab): Route => ({\n path,\n component: PrivacyAndTosComponent,\n data: { title: TITLES[tab], tab }\n });\n\n // No 'privacy-and-tos' here: the dashboard is matched before the public routes, so its auth guard\n // would send a visitor who is not signed in to /login instead of the public redirect.\n return [\n page('privacy-policies', 'privacy-policy'),\n page('terms-of-service', 'terms-of-service')\n ];\n}\n","/**\n * The onboarding status every product API returns from its `onboarding_status` tool and\n * `GET onboarding/:subscription_id/status` endpoint (cloudolive-api#441). Product-agnostic: step titles and\n * descriptions are the text the product's master subscription admin wrote; blocked reasons and states arrive\n * as Transloco keys owned by the product.\n */\nexport type OnboardingStepState =\n 'done' | 'next' | 'ready' | 'blocked' | 'waiting' | 'todo' | 'optional' | 'unknown';\n\nexport interface OnboardingStep {\n key: string;\n position: number;\n kind: 'required' | 'optional' | 'system';\n /** The step's title as the admin wrote it. */\n title?: string;\n description?: string | null;\n /** The product's check that decides the step; null = manual, the customer ticks it. */\n check_key?: string | null;\n /** @deprecated Transloco key from before steps became editable; use `title`. */\n title_key?: string;\n /** @deprecated Use `description`. */\n description_key?: string | null;\n route?: string | null;\n /** Slug of the FAQ that explains the step; null when the product API found no FAQ the viewer can open. */\n faq_slug?: string | null;\n activation: boolean;\n admin_only: boolean;\n depends_on: string[];\n state: OnboardingStepState;\n /** True for the one step the customer should act on now. */\n current: boolean;\n reason_key?: string;\n /** The customer's own system's message (e.g. their PSA's error), already truncated. */\n detail?: string;\n meta?: Record<string, unknown>;\n /** False when the step needs an admin and the viewer is not one; null when unknown. */\n can_act: boolean | null;\n}\n\nexport interface OnboardingStatus {\n subscription_id: number;\n feature_key: string | null;\n status: 'ok' | 'not_applicable' | 'unavailable';\n activated: boolean;\n next_step: string | null;\n progress: { done: number; total: number };\n steps: OnboardingStep[];\n}\n\n/**\n * The subscription has a checklist with mandatory steps still to do. Products use it to hold a user on /home\n * at login (common-services ONBOARDING_STATUS_SOURCES).\n */\nexport function hasOpenMandatorySteps(status: OnboardingStatus | null | undefined): boolean {\n const progress = status?.progress;\n return status?.status === 'ok' && !!progress?.total && progress.done < progress.total;\n}\n","import { Injectable } from '@angular/core';\n\nimport { PermissionService, UserService } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\n\nimport { distinctUntilChanged, map } from 'rxjs/operators';\n\n/**\n * CollapsibleSidebarSuperAdminGuard\n *\n * RBAC guard to ensure only SuperAdmin users can access/trigger the collapsible sidebar.\n *\n * Usage in templates:\n * ```html\n * <button\n * *ngIf=\"(superAdminGuard.canAccessSidebar$ | async)\"\n * pwCollapsibleSidebarTrigger\n * [contentId]=\"'posiwise-brain'\"\n * >\n * <i class=\"pi pi-cog\"></i>\n * </button>\n * ```\n *\n * Usage in components:\n * ```typescript\n * canAccessSidebar$ = this.guard.canAccessSidebar$;\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CollapsibleSidebarSuperAdminGuard {\n /**\n * Emits true when the signed-in user has {@link PermissionService.isSuperAdmin}.\n * UX-only; backend must still enforce permissions.\n */\n readonly canAccessSidebar$ = this.userService.getUserState().pipe(\n map(state => CollapsibleSidebarSuperAdminGuard.userIsSuperAdmin(state?.currentUser)),\n distinctUntilChanged()\n );\n\n constructor(\n private readonly userService: UserService,\n private readonly permissionService: PermissionService\n ) {}\n\n /**\n * Same rule as {@link PermissionService#isSuperAdmin}, safe when user is not loaded.\n */\n canAccessSidebar(): boolean {\n return this.permissionService.user ? this.permissionService.isSuperAdmin() : false;\n }\n\n private static userIsSuperAdmin(user: User | null): boolean {\n return !!user?.auth?.granted?.['Pages.SuperAdmin'];\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { MainApiHttpService } from '@posiwise/common-services';\n\nimport { Observable } from 'rxjs';\n\nimport { UiLayoutResponse } from './ui-config.model';\n\n// Reads the caller's layout for a page from main-api. Server resolves all\n// bindings + RBAC; the client only renders what it is given (#933 §6.4).\n@Injectable({ providedIn: 'root' })\nexport class UiLayoutService {\n constructor(private readonly api: MainApiHttpService) {}\n\n getLayout(subscriptionId: number, pageKey: string): Observable<UiLayoutResponse> {\n const subscription = encodeURIComponent(String(subscriptionId));\n const page = encodeURIComponent(pageKey);\n return this.api.get<UiLayoutResponse>(\n `/ui_layouts?subscription_id=${subscription}&page_key=${page}`\n );\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation\n} from '@angular/core';\n\nexport type PwNoticeTone = 'warning' | 'error' | 'info';\n\nconst ICONS: Record<PwNoticeTone, string> = {\n warning: 'fa-triangle-exclamation',\n error: 'fa-circle-exclamation',\n info: 'fa-circle-info'\n};\n\n/**\n * The notice banner a page shows above its content: a failed sync, a pinned note, a failed run.\n * The message is projected, so a caller can bind rich-text HTML into it. Tone colours come from\n * --pw-notice-warning / --pw-notice-error / --pw-notice-info, so a product can set its own.\n */\n@Component({\n selector: 'pw-notice',\n standalone: true,\n templateUrl: './pw-notice.component.html',\n styleUrls: ['./pw-notice.component.scss'],\n // Unscoped so .pw-notice__list reaches projected markup; every selector is prefixed .pw-notice.\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'pw-notice',\n '[class.pw-notice--warning]': \"tone() === 'warning'\",\n '[class.pw-notice--error]': \"tone() === 'error'\",\n '[class.pw-notice--info]': \"tone() === 'info'\",\n '[attr.role]': \"tone() === 'error' ? 'alert' : 'status'\"\n }\n})\nexport class PwNoticeComponent {\n readonly tone = input<PwNoticeTone>('warning');\n readonly heading = input<string | null | undefined>(null);\n\n readonly icon = computed(() => ICONS[this.tone()]);\n}\n","<i class=\"fas pw-notice__icon\"\n [class]=\"icon()\"\n aria-hidden=\"true\"></i>\n<div class=\"pw-notice__body\">\n @if (heading()) {\n <div class=\"pw-notice__heading\">{{ heading() }}</div>\n }\n <div class=\"pw-notice__text\">\n <ng-content />\n </div>\n</div>\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n * The card an Add/Edit page groups its fields in: a tinted icon chip, a title, then the projected\n * fields. Dense, hairline-bordered, brand tint on the icon as the only colour.\n */\n@Component({\n selector: 'pw-edit-card',\n standalone: true,\n templateUrl: './pw-edit-card.component.html',\n styleUrls: ['./pw-edit-card.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PwEditCardComponent {\n /** A Font Awesome icon name, e.g. `fa-layer-group`. */\n readonly icon = input.required<string>();\n readonly title = input.required<string>();\n}\n","<div class=\"card pw-edit-card\">\n <div class=\"card-body\">\n <div class=\"pw-edit-card__head\">\n <span class=\"pw-edit-card__icon\"\n aria-hidden=\"true\"><i class=\"fa-regular {{ icon() }}\"></i></span>\n <h3>{{ title() }}</h3>\n </div>\n <ng-content />\n </div>\n</div>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAa,yBAAb,MAAa,uBAAsB;CAG/B,YAA4B,OAAqB;EAArB,KAAA,QAAA;EAFnB,KAAA,SAA8B,CAAA;CAEa;CAEpD,IAAI,OAAI;EACJ,IAAI,KAAK,OAAO,MACZ,OAAO,KAAK,OAAO;EAEvB,IAAI,KAAK,OAAO,aACZ,OAAO;EAEX,IAAI,KAAK,OAAO,aACZ,OAAO;EAEX,OAAO;CACX;CAEA,IAAI,YAAS;EACT,IAAI,KAAK,OAAO,MACZ,OAAO,KAAK,OAAO;EAEvB,QAAQ,KAAK,MAAb;GACI,KAAK,eAID,OAAO;GACX,KAAK,QACD,OAAO;GACX,SACI,OAAO;EACf;CACJ;CAEA,IAAI,WAAQ;EACR,OAAO,KAAK,OAAO,YAAY;CACnC;CAEA,IAAI,WAAQ;EACR,OAAO,KAAK,OAAO,SAAS;CAChC;CAEA,IAAI,cAAW;EACX,OAAO,KAAK,OAAO,eAAe,CAAA;CACtC;CAEA,IAAI,UAAO;EACP,OAAO,KAAK,OAAO,WAAW;CAClC;CAEA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DJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAAcC,GAAA;IAoDV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GAA0B;GAAA,SAAA;IAG1B;IACA;IACA;IACA;IACA;IACA;IACA;IAjFJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAAcA,GAAA;IAuEV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GAA8B;EAAA,CAAA;CAAA;CAGzB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,SAAA;IAlD3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IAEA;IAtEJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IAAcA,GAAA;IAwFV;IACA;GAA8B;EAAA,CAAA;CAAA;;AAGzB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EAxFlC,MAAA;EAAS,MAAA,CAAA;GACN,cAAc;IACV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;GACH;GACD,SAAS;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACH;GACD,SAAS;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACH;EACJ,CAAA;;;AC9J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","i6","i7","i9","i12","i13.NoDataComponent","i14.RecordsSummaryComponent","i1","takeUntil","VOICE_ERROR_MESSAGES","i1","i1","i2","i1","i2","i1","i1","i2","i1","i2","i3","i4.DynamicPageContextService","i5","i6","i7","i8","i9.PwBrainChatThreadDirective","i10.PwBrainChatConfirmComponent","i11.PwBrainChatQuickComponent","i12.PwBrainChatWelcomeComponent","i13.PwBrainChatVoiceOverlayComponent","i14.SafeMarkdownPipe","i2","i1.CollapsibleSidebarService","i1.CollapsibleSidebarService","i2","i3.CollapsibleSidebarKeyboardShortcutDirective","i4","i1.CollapsibleSidebarService","i1.CommandPaletteService","i2","i3.CollapsibleSidebarService","i4","i5","i6","i7","i1","i1","i1","i1","i1","i2.CollapsibleSidebarService","i3","i4","i1","i2","i3","i1","i2","i3","i4","i5","i6","i7","i8","i10.NoDataComponent","i11","i1","i2","i3","i5","i1","i2","i3.ConfirmDialogService","i4.PwStickyActionsComponent","i5","i7","i8.InputContainerComponent","i9.NoDataComponent","i10","i11","i1","i2","i3.ConfirmDialogService","i4.PwStickyActionsComponent","i5","i6","i8","i9","i10.InputContainerComponent","i11.NoDataComponent","i12","i1","i2","i3","i4","i1","i2","i3","i1","i2","i3","i1","i2","i3","i4","i1","i2","i3","i4","i5.HeaderComponent","i6","i7","i1","i2","i1","i1","i2","i1","i2","i4","i5","i6.NoDataComponent","i7","i1","i1","i1","i1","isIncrease"],"sources":["../../../../libs/shared-components/src/lib/confirm-dialog/confirm-dialog.component.ts","../../../../libs/shared-components/src/lib/confirm-dialog/confirm-dialog.component.html","../../../../libs/shared-components/src/lib/confirm-dialog/confirm-dialog.service.ts","../../../../libs/shared-components/src/lib/ai-knowledge/ai-knowledge.helpers.ts","../../../../libs/shared-components/src/lib/no-data/no-data.component.ts","../../../../libs/shared-components/src/lib/records-summary/records-summary.component.ts","../../../../libs/shared-components/src/lib/ai-knowledge/ai-knowledge.component.ts","../../../../libs/shared-components/src/lib/ai-knowledge/ai-knowledge.component.html","../../../../libs/shared-components/src/lib/authenticator/authenticator.component.ts","../../../../libs/shared-components/src/lib/authenticator/authenticator.component.html","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-brand.helpers.ts","../../../../libs/shared-components/src/lib/dynamic-page/dynamic-page-context.service.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.view.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.choice.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.drag.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.transfer.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-attachment.controller.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-confirmation.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-context.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-dictation.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-diff.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-url-safety.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-navigation.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-storage.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-persistence.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-prompts.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-scroll.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-upload.token.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-voice-copy.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-voice-chat.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-thread.directive.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-confirm.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-confirm.component.html","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-product-prompts.token.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-quick.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-welcome.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-welcome.component.html","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-sonar.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-sonar-scenes.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-sonar-render.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-voice-overlay.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-voice-overlay.component.html","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-link-resolve.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-markdown.helpers.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat-safe-markdown.pipe.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat.component.ts","../../../../libs/shared-components/src/lib/brain-chat/pw-brain-chat.component.html","../../../../libs/shared-components/src/lib/clearbit-icon/clearbit-icon.component.ts","../../../../libs/shared-components/src/lib/clearbit-icon/clearbit-icon.component.html","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar.service.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-keyboard-shortcut.directive.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-navbar-offset.helpers.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-panel.helpers.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar.component.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar.component.html","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-trigger.directive.ts","../../../../libs/shared-components/src/lib/coming-soon/coming-soon.component.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette.service.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-activate.helpers.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-brand.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-sources.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-actions.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-switch.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-compose.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-cursor.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-dialog.helpers.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-keyboard.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette-people.helpers.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette.component.ts","../../../../libs/shared-components/src/lib/command-palette/command-palette.component.html","../../../../libs/shared-components/src/lib/cookie-banner/pw-cookie-banner.component.ts","../../../../libs/shared-components/src/lib/cookie-banner/pw-cookie-banner.component.html","../../../../libs/shared-components/src/lib/dynamic-page/blocks/chart-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/blocks/data-table-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/blocks/divider-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/blocks/section-heading-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/blocks/stat-card-block.component.ts","../../../../libs/shared-components/src/lib/dynamic-page/component-registry.ts","../../../../libs/shared-components/src/lib/dynamic-page/ui-config-validator.ts","../../../../libs/shared-components/src/lib/dynamic-page/pw-dynamic-page.component.ts","../../../../libs/shared-components/src/lib/header/header.component.ts","../../../../libs/shared-components/src/lib/header/header.component.html","../../../../libs/shared-components/src/lib/label-management/entity-group/entity-group.component.ts","../../../../libs/shared-components/src/lib/label-management/entity-group/entity-group.component.html","../../../../libs/shared-components/src/lib/sticky-actions/pw-sticky-actions.component.ts","../../../../libs/shared-components/src/lib/sticky-actions/pw-sticky-actions.component.html","../../../../libs/shared-components/src/lib/input-container/input-container.component.ts","../../../../libs/shared-components/src/lib/input-container/input-container.component.html","../../../../libs/shared-components/src/lib/label-management/group-definition/group-definition.component.ts","../../../../libs/shared-components/src/lib/label-management/group-definition/group-definition.component.html","../../../../libs/shared-components/src/lib/label-management/groups/groups.component.ts","../../../../libs/shared-components/src/lib/label-management/groups/groups.component.html","../../../../libs/shared-components/src/lib/landing-page-footer-b/landing-page-footer-b.component.ts","../../../../libs/shared-components/src/lib/landing-page-footer-b/landing-page-footer-b.component.html","../../../../libs/shared-components/src/lib/number-picker/number-picker.component.ts","../../../../libs/shared-components/src/lib/number-picker/number-picker.component.html","../../../../libs/shared-components/src/lib/online-indicator/online-indicator.component.ts","../../../../libs/shared-components/src/lib/online-indicator/online-indicator.component.html","../../../../libs/shared-components/src/lib/password-validation/password-validation.component.ts","../../../../libs/shared-components/src/lib/password-validation/password-validation.component.html","../../../../libs/shared-components/src/lib/permission-tree/permission-tree.component.ts","../../../../libs/shared-components/src/lib/privacy-and-tos/quill-lists.ts","../../../../libs/shared-components/src/lib/privacy-and-tos/privacy-and-tos.component.ts","../../../../libs/shared-components/src/lib/privacy-and-tos/privacy-and-tos.component.html","../../../../libs/shared-components/src/lib/pw-tabs/pw-tabs.component.ts","../../../../libs/shared-components/src/lib/pw-tabs/pw-tabs.component.html","../../../../libs/shared-components/src/lib/range-date-picker/date-range-picker.component.ts","../../../../libs/shared-components/src/lib/range-date-picker/date-range-picker.component.html","../../../../libs/shared-components/src/lib/completion-bar/completion-bar.component.ts","../../../../libs/shared-components/src/lib/onboarding-checklist/onboarding-checklist.storage.ts","../../../../libs/shared-components/src/lib/onboarding-checklist/onboarding-checklist.component.ts","../../../../libs/shared-components/src/lib/onboarding-checklist/onboarding-checklist.component.html","../../../../libs/shared-components/src/lib/resource-shared-components.module.ts","../../../../libs/shared-components/src/lib/splash/splash.component.ts","../../../../libs/shared-components/src/lib/splash/splash.component.html","../../../../libs/shared-components/src/lib/shared-components.module.ts","../../../../libs/shared-components/src/lib/privacy-and-tos/legal-page.routes.ts","../../../../libs/shared-components/src/lib/onboarding-checklist/onboarding-checklist.types.ts","../../../../libs/shared-components/src/lib/collapsible-sidebar/collapsible-sidebar-super-admin.guard.ts","../../../../libs/shared-components/src/lib/dynamic-page/ui-layout.service.ts","../../../../libs/shared-components/src/lib/notice/pw-notice.component.ts","../../../../libs/shared-components/src/lib/notice/pw-notice.component.html","../../../../libs/shared-components/src/lib/edit-card/pw-edit-card.component.ts","../../../../libs/shared-components/src/lib/edit-card/pw-edit-card.component.html"],"sourcesContent":["import { Component, Input } from '@angular/core';\n\nimport { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ConfirmDialogConfig, ConfirmDialogTone } from './confirm-dialog.types';\n\n@Component({\n selector: 'pw-confirm-dialog',\n templateUrl: './confirm-dialog.component.html',\n styleUrls: ['./confirm-dialog.component.scss'],\n standalone: false\n})\nexport class ConfirmDialogComponent {\n @Input() config: ConfirmDialogConfig = {};\n\n constructor(public readonly modal: NgbActiveModal) {}\n\n get tone(): ConfirmDialogTone {\n if (this.config.tone) {\n return this.config.tone;\n }\n if (this.config.destructive) {\n return 'destructive';\n }\n if (this.config.confirmOnly) {\n return 'info';\n }\n return 'neutral';\n }\n\n get iconClass(): string {\n if (this.config.icon) {\n return this.config.icon;\n }\n switch (this.tone) {\n case 'destructive':\n // Hollow-circle X — reads as \"this will delete\" stronger than a\n // warning triangle. Matches the SweetAlert2 destructive idiom\n // users find more imposing for irreversible actions.\n return 'pi pi-times';\n case 'info':\n return 'pi pi-info-circle';\n default:\n return 'pi pi-question-circle';\n }\n }\n\n get titleKey(): string | null {\n return this.config.titleKey ?? null;\n }\n\n get titleRaw(): string {\n return this.config.title ?? '';\n }\n\n get titleParams(): Record<string, unknown> {\n return this.config.titleParams ?? {};\n }\n\n get textKey(): string | null {\n return this.config.textKey ?? null;\n }\n\n get textRaw(): string {\n return this.config.text ?? '';\n }\n\n get textParams(): Record<string, unknown> {\n return this.config.textParams ?? {};\n }\n\n get confirmLabelKey(): string {\n if (this.config.confirmLabelKey) {\n return this.config.confirmLabelKey;\n }\n if (this.config.confirmOnly) {\n return 'Button.OK';\n }\n // Destructive confirms default to \"OK\" to match the swal idiom; a\n // shorter, more decisive label feels right after the centered \"stop\n // and read\" treatment. Callers can still override via confirmLabelKey.\n if (this.tone === 'destructive') {\n return 'Button.OK';\n }\n return 'Button.Confirm';\n }\n\n get confirmLabel(): string {\n return this.config.confirmLabel ?? '';\n }\n\n get cancelLabelKey(): string {\n return this.config.cancelLabelKey ?? 'Button.Cancel';\n }\n\n get cancelLabel(): string {\n return this.config.cancelLabel ?? '';\n }\n\n get confirmButtonClass(): string {\n return this.tone === 'destructive' ? 'btn btn-danger' : 'btn btn-primary';\n }\n\n confirm(): void {\n this.modal.close(true);\n }\n\n cancel(): void {\n this.modal.dismiss(false);\n }\n}\n","<div class=\"pw-confirm\"\n [class.pw-confirm--destructive]=\"tone === 'destructive'\"\n [class.pw-confirm--info]=\"tone === 'info'\"\n [class.pw-confirm--neutral]=\"tone === 'neutral'\">\n <div class=\"pw-confirm__header\">\n <span class=\"pw-confirm__icon\"\n aria-hidden=\"true\">\n <i [class]=\"iconClass\"></i>\n </span>\n <h5 class=\"pw-confirm__title\">\n @if (titleKey) {\n {{ titleKey | transloco: titleParams }}\n } @else {\n {{ titleRaw }}\n }\n </h5>\n <button type=\"button\"\n class=\"btn-close pw-confirm__close\"\n [attr.aria-label]=\"cancelLabelKey | transloco\"\n (click)=\"cancel()\">\n </button>\n </div>\n\n <div class=\"pw-confirm__body\">\n @if (textKey) {\n <p class=\"pw-confirm__message\"\n [innerHTML]=\"textKey | transloco: textParams\"></p>\n } @else {\n <p class=\"pw-confirm__message\"\n [innerHTML]=\"textRaw\"></p>\n }\n </div>\n\n <div class=\"pw-confirm__footer\">\n @if (!config.confirmOnly) {\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"cancel()\">\n @if (cancelLabel) {\n {{ cancelLabel }}\n } @else {\n {{ cancelLabelKey | transloco }}\n }\n </button>\n }\n <button type=\"button\"\n [class]=\"confirmButtonClass\"\n (click)=\"confirm()\">\n @if (confirmLabel) {\n {{ confirmLabel }}\n } @else {\n {{ confirmLabelKey | transloco }}\n }\n </button>\n </div>\n</div>\n","import { Injectable } from '@angular/core';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { ConfirmDialogComponent } from './confirm-dialog.component';\nimport { ConfirmDialogConfig } from './confirm-dialog.types';\n\n/**\n * Convenience overrides for `confirmDelete`. Any field of `ConfirmDialogConfig`\n * may be passed; the defaults are `{ title: 'Delete', text: 'Are you sure you\n * want to delete?', destructive: true }`.\n */\nexport type ConfirmDeleteOptions = Partial<ConfirmDialogConfig>;\n\n@Injectable({ providedIn: 'root' })\nexport class ConfirmDialogService {\n constructor(private readonly modal: NgbModal) {}\n\n open(config: ConfirmDialogConfig = {}): Promise<boolean> {\n const ref = this.modal.open(ConfirmDialogComponent, {\n centered: true,\n size: 'md',\n windowClass: 'pw-confirm-modal',\n backdrop: 'static',\n keyboard: true\n });\n (ref.componentInstance as ConfirmDialogComponent).config = config;\n return ref.result.then(\n (value: boolean) => value === true,\n () => false\n );\n }\n\n /**\n * Opens a generic destructive \"Delete — Are you sure you want to delete?\"\n * confirmation dialog. Pass overrides for any field (e.g. `text` with a\n * bold entity name, or `textKey` for an i18n key).\n */\n confirmDelete(overrides: ConfirmDeleteOptions = {}): Promise<boolean> {\n return this.open({\n title: 'Delete',\n text: 'Are you sure you want to delete?',\n destructive: true,\n ...overrides\n });\n }\n}\n","import {\n KNOWLEDGE_EXTENSIONS,\n KNOWLEDGE_MAX_BYTES,\n KnowledgeFile\n} from '@posiwise/common-services';\n\n/** `docmost/Onboarding/a.md` → `docmost/Onboarding`; a top-level file → ''. */\nexport function folderOf(file: KnowledgeFile): string {\n const slash = file.path.lastIndexOf('/');\n return slash > 0 ? file.path.slice(0, slash) : '';\n}\n\n/** Colour key for the folder badge: `docmost/Onboarding` shares `docmost`'s tint. */\nexport function topFolderOf(file: KnowledgeFile): string {\n return folderOf(file).split('/')[0];\n}\n\nexport function formatSize(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n}\n\n/**\n * One distinct soft tint per top-level folder, from core-styles' 24-hue ramp\n * (`.badge.bg-cyan-1` … `-24`). Folders are sorted so the same set always gets\n * the same colours, and successive folders step 7 places round the ramp (105°;\n * 7 is coprime with 24, so all 24 hues are used before any repeats).\n * `appDynamicBadge`'s 9-bucket hash collided here and kept to a narrow green\n * band, so two folders could not be told apart.\n */\nexport function folderBadgeClasses(files: KnowledgeFile[]): Map<string, string> {\n const folders = [...new Set(files.map(topFolderOf).filter(Boolean))].sort((a, b) =>\n a.localeCompare(b)\n );\n return new Map(folders.map((folder, i) => [folder, `bg-cyan-${((i * 7) % 24) + 1}`]));\n}\n\n/** i18n key for why `file` can't be uploaded, or null. brain-api re-checks all of it. */\nexport function uploadProblem(file: File): string | null {\n const dot = file.name.lastIndexOf('.');\n const ext = dot >= 0 ? file.name.slice(dot).toLowerCase() : '';\n if (!KNOWLEDGE_EXTENSIONS.includes(ext)) return 'AiKnowledge.UnsupportedType';\n if (file.size === 0) return 'AiKnowledge.EmptyFile';\n if (file.size > KNOWLEDGE_MAX_BYTES) return 'AiKnowledge.TooLarge';\n return null;\n}\n\n/**\n * Footer counts. This table pages and searches in the browser, so unlike a lazy\n * table `dt.value` is every file: count the current page of the current search,\n * or the footer reads \"Showing 60 of 60\" on a 50-row page.\n */\nexport function matchingCount(\n filtered: unknown[] | null | undefined,\n files: KnowledgeFile[]\n): number {\n return (filtered ?? files).length;\n}\n\nexport function shownOnPage(first: number, pageSize: number, matching: number): number {\n return Math.max(0, Math.min(pageSize, matching - first));\n}\n\n/** Hands a downloaded file to the browser under its own name. */\nexport function saveBlob(blob: Blob, name: string): void {\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = name;\n link.click();\n URL.revokeObjectURL(url);\n}\n","import { AfterContentInit, Component, ContentChild, Input } from '@angular/core';\n\n@Component({\n selector: 'pw-no-data',\n template: `\n <div class=\"no-data\" [ngClass]=\"{ 'has-content': !this.isContentEmpty }\">\n @if (withImage) {\n <i class=\"pi pi-inbox no-data-icon\" aria-hidden=\"true\"></i>\n }\n <span\n class=\"h5 message\"\n [ngClass]=\"{\n 'mt-2': description || !this.isContentEmpty,\n 'my-3': !description && this.isContentEmpty\n }\"\n >\n {{ message || 'Nothing found' }}\n </span>\n @if (description) {\n <span class=\"pb-4\">{{ description }}</span>\n }\n <ng-content></ng-content>\n </div>\n `,\n styleUrls: ['./no-data.component.scss'],\n standalone: false\n})\nexport class NoDataComponent implements AfterContentInit {\n @ContentChild('content', { static: false }) content: { nativeElement: { innerHTML: string } };\n @Input() message: string | null = null;\n @Input() description: string | null = null;\n @Input() withImage = false;\n\n isContentEmpty = false;\n\n ngAfterContentInit() {\n this.isContentEmpty = !this.content?.nativeElement.innerHTML.trim();\n }\n}\n","import { Component, Input } from '@angular/core';\n\n/**\n * Shared table-footer \"Showing X of Y items\" summary.\n *\n * Replaces the hand-rolled `<span class=\"total-records-count\">{{ 'Label.RecordsSummary' | transloco: {…} }}</span>`\n * that was previously copy-pasted into every list across main-frontend and the\n * spinout frontends. The `total-records-count` class is owned globally by\n * `@posiwise/core-styles`, so it is applied to the host here and renders\n * identically wherever core-styles is loaded.\n *\n * Usage:\n * <pw-records-summary [showing]=\"dt?.value?.length ?? 0\" [total]=\"totalRecords\" />\n */\n@Component({\n selector: 'pw-records-summary',\n template: `{{\n 'Label.RecordsSummary' | transloco: { showing: showing ?? 0, total: total ?? 0 }\n }}`,\n host: { class: 'total-records-count' },\n standalone: false\n})\nexport class RecordsSummaryComponent {\n /** Number of rows currently rendered (e.g. `dt?.value?.length`). */\n @Input() showing: number | null = 0;\n /** Total number of records across all pages. */\n @Input() total: number | null = 0;\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport {\n ChangeDetectorRef,\n Component,\n ElementRef,\n Input,\n OnChanges,\n SimpleChanges,\n ViewChild\n} from '@angular/core';\n\nimport {\n CustomToastService,\n KNOWLEDGE_EXTENSIONS,\n KnowledgeFile,\n KnowledgeFilesService,\n KnowledgeScope\n} from '@posiwise/common-services';\nimport { PAGE_SIZE } from '@posiwise/common-utilities';\n\nimport { Table } from 'primeng/table';\nimport { finalize } from 'rxjs/operators';\n\nimport { TranslocoService } from '@jsverse/transloco';\n\nimport { ConfirmDialogService } from '../confirm-dialog/confirm-dialog.service';\n\nimport {\n folderBadgeClasses,\n folderOf,\n formatSize,\n matchingCount,\n saveBlob,\n shownOnPage,\n topFolderOf,\n uploadProblem\n} from './ai-knowledge.helpers';\n\n/**\n * Documents the Brain reads for one subscription — the tenant's folder\n * (`scope=\"subscription\"`, admins) or the caller's own (`scope=\"personal\"`).\n * brain-api validates every upload; the checks here only spare a round trip.\n */\n@Component({\n selector: 'pw-ai-knowledge',\n templateUrl: './ai-knowledge.component.html',\n styleUrls: ['./ai-knowledge.component.scss'],\n standalone: false\n})\nexport class AiKnowledgeComponent implements OnChanges {\n @Input({ required: true }) scope: KnowledgeScope = 'subscription';\n @Input() subscriptionId: number | null = null;\n @Input() subscriptionName = '';\n /** \"Use my data\" off: no uploads and the Brain ignores these files; they can still be removed. */\n @Input() useOwnData = true;\n\n @ViewChild('fileInput') fileInput: ElementRef<HTMLInputElement>;\n\n readonly accept = KNOWLEDGE_EXTENSIONS.join(',');\n readonly pageSize = PAGE_SIZE;\n files: KnowledgeFile[] = [];\n searchText = '';\n /** More files exist than one load fetches (see `KnowledgeFilesService.listAllFiles`). */\n truncated = false;\n loading = false;\n loadFailed = false;\n /** brain-api's own reason when storage isn't set up (`storage_unavailable`) — \"try again\" won't help. */\n unavailableReason: string | null = null;\n uploading = false;\n private folderClasses = new Map<string, string>();\n\n constructor(\n private readonly knowledge: KnowledgeFilesService,\n private readonly confirmDialog: ConfirmDialogService,\n private readonly toast: CustomToastService,\n private readonly translation: TranslocoService,\n private readonly cdr: ChangeDetectorRef\n ) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n if ((changes['subscriptionId'] || changes['scope']) && this.subscriptionId) {\n this.load();\n }\n }\n\n load(): void {\n this.loading = true;\n this.loadFailed = false;\n this.unavailableReason = null;\n this.knowledge\n .listAllFiles(this.subscriptionId, this.scope)\n .pipe(finalize(() => this.done(() => (this.loading = false))))\n .subscribe({\n next: ({ files, truncated }) => {\n this.files = files;\n this.truncated = truncated;\n this.recolourFolders();\n },\n // A failed list is not an empty folder — never show \"No documents yet\".\n error: (error: HttpErrorResponse) => {\n this.files = [];\n this.loadFailed = true;\n this.unavailableReason =\n error?.error?.status_code === 'storage_unavailable'\n ? (error.error?.message ?? null)\n : null;\n }\n });\n }\n\n chooseFile(): void {\n this.fileInput?.nativeElement.click();\n }\n\n onFileSelected(event: Event): void {\n const input = event.target as HTMLInputElement;\n const file = input.files?.[0];\n input.value = '';\n if (!file) return;\n\n const problem = uploadProblem(file);\n if (problem) {\n this.toast.error(this.translation.translate(problem));\n return;\n }\n\n this.uploading = true;\n this.knowledge\n .uploadFile(this.subscriptionId, this.scope, file)\n .pipe(finalize(() => this.done(() => (this.uploading = false))))\n .subscribe(added => {\n this.files = [added, ...this.files.filter(f => f.path !== added.path)];\n this.recolourFolders();\n this.toast.success(\n this.translation.translate('AiKnowledge.Uploaded', { name: added.name })\n );\n });\n }\n\n download(file: KnowledgeFile): void {\n this.knowledge\n .downloadFile(this.subscriptionId, this.scope, file.path)\n .subscribe(blob => saveBlob(blob, file.name));\n }\n\n remove(file: KnowledgeFile): void {\n this.confirmDialog\n .confirmDelete({\n textKey: 'AiKnowledge.ConfirmDelete',\n textParams: { name: file.name }\n })\n .then(ok => {\n if (!ok) return;\n this.knowledge\n .deleteFile(this.subscriptionId, this.scope, file.path)\n .subscribe(() => {\n this.files = this.files.filter(f => f.path !== file.path);\n this.recolourFolders();\n this.toast.success(\n this.translation.translate('AiKnowledge.Deleted', { name: file.name })\n );\n this.cdr.markForCheck();\n });\n });\n }\n\n /** Personal files always sit at the top of the member's own folder. */\n get showFolder(): boolean {\n return this.scope === 'subscription';\n }\n\n folderOf = folderOf;\n sizeOf = formatSize;\n\n /** First row of the current page; PrimeNG returns to page 1 on a search. */\n pageFirst = 0;\n\n matchingCount = (dt: Table): number => matchingCount(dt.filteredValue, this.files);\n shownOnPage = (dt: Table): number =>\n shownOnPage(this.pageFirst, this.pageSize, this.matchingCount(dt));\n\n folderBadgeClass(file: KnowledgeFile): string {\n return this.folderClasses.get(topFolderOf(file)) ?? 'bg-cyan';\n }\n\n private recolourFolders(): void {\n this.folderClasses = folderBadgeClasses(this.files);\n }\n\n private done(reset: () => void): void {\n reset();\n this.cdr.markForCheck();\n }\n}\n","<section class=\"ai-knowledge\">\n <div class=\"title\">\n <h2>{{ (scope === 'personal' ? 'AiKnowledge.PersonalTitle' : 'AiKnowledge.Title') | transloco: { name: subscriptionName } }}</h2>\n </div>\n <p>{{ (scope === 'personal' ? 'AiKnowledge.PersonalIntro' : 'AiKnowledge.Intro') | transloco: { name: subscriptionName } }}</p>\n\n @if (!useOwnData) {\n <output class=\"alert alert-warning ai-knowledge-off\">\n <i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i>\n <span>\n {{ (scope === 'personal' ? 'AiKnowledge.PersonalUseOwnDataOff' : 'AiKnowledge.UseOwnDataOff') | transloco: { name: subscriptionName } }}\n @if (scope === 'subscription' && subscriptionId) {\n <a [routerLink]=\"['/account/subscriptions', subscriptionId]\">{{ 'AiKnowledge.OpenSubscriptionSettings' | transloco }}</a>\n }\n </span>\n </output>\n }\n\n @if (useOwnData) {\n <div class=\"ai-knowledge-toolbar\">\n <span class=\"ai-knowledge-hint\">{{ 'AiKnowledge.Accepted' | transloco }}</span>\n <input #fileInput type=\"file\" class=\"d-none\" id=\"ai-knowledge-file-{{ scope }}\"\n [accept]=\"accept\" (change)=\"onFileSelected($event)\" />\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"uploading || !subscriptionId\" (click)=\"chooseFile()\">\n <i class=\"fa\" [class.fa-upload]=\"!uploading\" [class.fa-spinner]=\"uploading\" [class.fa-spin]=\"uploading\"\n aria-hidden=\"true\"></i>\n {{ (uploading ? 'AiKnowledge.Uploading' : 'AiKnowledge.UploadFile') | transloco }}\n </button>\n </div>\n }\n\n @if (loading) {\n <pw-skeleton-table [rows]=\"8\" [columns]=\"showFolder ? 5 : 4\" [showCaption]=\"true\" />\n }\n\n @if (!loading) {\n @if (files.length) {\n <div class=\"primeng-datatable-container actions-collapsed table-responsive\">\n <p-table #dt [value]=\"files\" dataKey=\"path\"\n [paginator]=\"files.length !== 0\"\n [rows]=\"pageSize\"\n [globalFilterFields]=\"['name', 'path']\"\n (onPage)=\"pageFirst = $event.first\"\n (onFilter)=\"pageFirst = 0\"\n stateKey=\"pw-table.ai-knowledge\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #caption>\n <div class=\"text-end\">\n <label for=\"ai-knowledge-search-{{ scope }}\" class=\"visually-hidden\">{{ 'AiKnowledge.SearchPlaceholder' | transloco }}</label>\n <p-iconfield iconPosition=\"left\">\n <p-inputicon><i class=\"fa fa-search\" aria-hidden=\"true\"></i></p-inputicon>\n <input type=\"text\"\n id=\"ai-knowledge-search-{{ scope }}\"\n name=\"ai-knowledge-search-{{ scope }}\"\n [(ngModel)]=\"searchText\"\n pInputText\n [placeholder]=\"'AiKnowledge.SearchPlaceholder' | transloco\"\n (input)=\"dt.filterGlobal(searchText, 'contains')\"\n [attr.aria-label]=\"'AiKnowledge.SearchPlaceholder' | transloco\" />\n </p-iconfield>\n </div>\n </ng-template>\n <ng-template #emptymessage>\n <tr>\n <td [attr.colspan]=\"showFolder ? 5 : 4\">\n <pw-no-data [withImage]=\"true\" [message]=\"'Search.NoDataMessage' | transloco\"\n [description]=\"'Search.NoDataDescription' | transloco\"></pw-no-data>\n </td>\n </tr>\n </ng-template>\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"col\">{{ 'Label.Name' | transloco }}</th>\n @if (showFolder) {\n <th pResizableColumn scope=\"col\">{{ 'AiKnowledge.Folder' | transloco }}</th>\n }\n <th pResizableColumn scope=\"col\">{{ 'AiKnowledge.Size' | transloco }}</th>\n <th pResizableColumn scope=\"col\">{{ 'AiKnowledge.Modified' | transloco }}</th>\n <th class=\"actions-list-two\" scope=\"col\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n <ng-template #body let-file>\n <tr>\n <td data-head=\"Name\">\n <a href=\"\" [pTooltip]=\"'AiKnowledge.DownloadFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n (click)=\"$event.preventDefault(); download(file)\">{{ file.name }}</a>\n </td>\n @if (showFolder) {\n <td data-head=\"Folder\">\n @if (folderOf(file); as folder) {\n <span class=\"badge\" [ngClass]=\"folderBadgeClass(file)\">{{ folder }}</span>\n }\n </td>\n }\n <td data-head=\"Size\">{{ sizeOf(file.size) }}</td>\n <td data-head=\"Modified\">{{ file.last_modified | dateFormat: 'datetime' }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline list-action\">\n <li [pTooltip]=\"'AiKnowledge.DownloadFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'AiKnowledge.DownloadFile' | transloco\"\n (click)=\"download(file)\" (keydown.enter)=\"download(file)\">\n <i class=\"fa fa-download edit-icon\" aria-hidden=\"true\"></i>\n </li>\n <li [pTooltip]=\"'AiKnowledge.DeleteFile' | transloco\" tooltipPosition=\"top\" appendTo=\"body\"\n [attr.aria-label]=\"'AiKnowledge.DeleteFile' | transloco\"\n (click)=\"remove(file)\" (keydown.enter)=\"remove(file)\">\n <i class=\"fa fa-trash delete-icon\" aria-hidden=\"true\"></i>\n </li>\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n <pw-records-summary [showing]=\"shownOnPage(dt)\" [total]=\"matchingCount(dt)\" />\n </div>\n @if (truncated) {\n <p class=\"ai-knowledge-hint mt-2\">{{ 'AiKnowledge.Truncated' | transloco: { count: files.length } }}</p>\n }\n } @else if (loadFailed) {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.LoadFailed' | transloco\"\n [description]=\"unavailableReason || ('AiKnowledge.LoadFailedDescription' | transloco)\">\n <div #content>\n <button type=\"button\" class=\"btn btn-sm btn-outline-primary\" (click)=\"load()\">\n <i class=\"fa fa-rotate-right\" aria-hidden=\"true\"></i>\n {{ 'AiKnowledge.TryAgain' | transloco }}\n </button>\n </div>\n </pw-no-data>\n } @else if (useOwnData) {\n <pw-no-data [withImage]=\"true\" [message]=\"'AiKnowledge.NoFiles' | transloco\"\n [description]=\"'AiKnowledge.NoFilesDescription' | transloco\"></pw-no-data>\n }\n }\n</section>\n","import { ChangeDetectorRef, Component, Injector, OnInit } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AuthService } from '@posiwise/common-services';\n\n@Component({\n selector: 'pw-authenticator',\n templateUrl: './authenticator.component.html',\n\n standalone: false\n})\nexport class AuthenticatorComponent extends AppBaseComponent implements OnInit {\n token = '';\n\n constructor(\n private readonly authService: AuthService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n ngOnInit() {\n this.route.queryParams.subscribe(params => {\n if (!params['token']) {\n window.location.href = '/login';\n } else {\n this.authService.storePlatform('app').subscribe(() => {\n this.authService.setHeaderKey();\n this.authService.storeToken(params['token']).subscribe({\n next: () => {\n this.router.navigate(['home']);\n this.cdr.markForCheck();\n },\n error: () => {\n window.location.href = '/login';\n this.cdr.markForCheck();\n }\n });\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n}\n","<!--Auth Page Starts-->\n<section>\n <div class=\"container-fluid\">\n <div class=\"row full-height-vh\">\n <div class=\"col-12 d-flex align-items-center justify-content-center\">\n <h2>Logging...</h2>\n </div>\n </div>\n </div>\n</section>\n<!--Auth Page Ends-->\n","/**\n * White-label brand resolution for the Brain panel header.\n *\n * The domain's company name (app config `company.name`) brands the panel\n * title — falling back to \"PosiWise\" before config resolves or when unset.\n * Mirrors the pw-dynamic-page `brandName` pattern. Kept as a pure function\n * (no Angular deps) so it is unit-testable in isolation and so the host\n * component stays within the C1 size budget.\n */\nexport const DEFAULT_BRAND = 'PosiWise';\n\nexport function resolveBrandName(config: unknown): string {\n const name = (config as { company?: { name?: string } })?.company?.name;\n return name && name.trim() ? name : DEFAULT_BRAND;\n}\n","import { Injectable } from '@angular/core';\n\n/**\n * Identity of the Conversational UI Builder dynamic page the user is\n * currently viewing (#933 — page-aware Brain). The dynamic-page host sets\n * this on load and clears it on destroy; the PosiWise Brain chat widget\n * reads it so Bedrock knows which page \"this page\" / \"the current page\"\n * refers to and can target `ui_update_layout` with the exact page_key +\n * subscription_id instead of guessing the landing-page tools.\n *\n * `null` whenever no dynamic page is mounted.\n */\nexport interface DynamicPageContext {\n pageKey: string;\n subscriptionId: number;\n}\n\n@Injectable({ providedIn: 'root' })\nexport class DynamicPageContextService {\n private _current: DynamicPageContext | null = null;\n\n set(ctx: DynamicPageContext): void {\n this._current = ctx;\n }\n\n clear(): void {\n this._current = null;\n }\n\n get current(): DynamicPageContext | null {\n return this._current;\n }\n}\n","import { MCPUploadCapability } from '@posiwise/common-services';\n\nimport { ChatAttachment } from './pw-brain-chat.types';\n\n/**\n * File-attachment rules for the chat composer. Split out of the component so\n * the validation is unit-testable without a TestBed, matching the existing\n * `pw-brain-chat-*.helpers.ts` convention.\n *\n * The limits come from the capability the owning tool advertises, which is a\n * projection of that service's upload registry. Client-side checks are a\n * courtesy so the user gets an instant answer — the server re-checks every one\n * of them and remains the authority.\n */\nexport function fileExtension(name: string): string {\n const dot = name.lastIndexOf('.');\n return dot === -1 ? '' : name.slice(dot + 1).toLowerCase();\n}\n\n/** @returns a human-readable reason to reject, or null when the file is fine. */\nexport function validateChatFile(file: File, capability: MCPUploadCapability): string | null {\n if (file.size === 0) {\n return 'That file is empty.';\n }\n if (file.size > capability.max_bytes) {\n return `That file is ${formatFileSize(file.size)} — the limit is ${formatFileSize(\n capability.max_bytes\n )}.`;\n }\n return null;\n}\n\n/** Every extension any available capability accepts, de-duplicated. */\nexport function acceptedExtensions(capabilities: MCPUploadCapability[]): string[] {\n return [...new Set(capabilities.flatMap(c => c.allowed_extensions))];\n}\n\nexport function formatFileSize(bytes: number): string {\n if (bytes < 1024) {\n return `${bytes} B`;\n }\n const kb = bytes / 1024;\n if (kb < 1024) {\n return `${Math.round(kb)} KB`;\n }\n const mb = kb / 1024;\n // One decimal below 10 MB, whole numbers above — \"1.4 MB\" is useful,\n // \"23.7 MB\" is noise at that scale.\n return mb < 10 ? `${mb.toFixed(1)} MB` : `${Math.round(mb)} MB`;\n}\n\n/** Pulls the single file out of a drop, ignoring directories and extra files. */\nexport function fileFromDrop(event: DragEvent): File | null {\n const items = event.dataTransfer?.files;\n return items && items.length > 0 ? items[0] : null;\n}\n\n/** True when the drag carries files (not text, a link, or an in-page element). */\nexport function dragCarriesFile(event: DragEvent): boolean {\n const types = event.dataTransfer?.types;\n return !!types && Array.from(types).includes('Files');\n}\n\n/**\n * What the attachment contributes to `workspace_context`.\n *\n * Only the KEY and the filename travel — never the bytes, and never anything\n * read out of the file. The planner decides which tool to call from this plus\n * the user's sentence; the server re-derives everything else from the key.\n *\n * The `note` mirrors the `active_page` convention in\n * `pw-brain-chat-context.helpers.ts`: a short instruction telling the model\n * what the context means and which tool consumes it.\n */\nexport function attachmentContext(\n attachment: ChatAttachment | null\n): Record<string, unknown> | null {\n if (attachment?.status !== 'ready' || !attachment?.key) {\n return null;\n }\n return {\n attachment: {\n filename: attachment.name,\n staged_key: attachment.key,\n size_bytes: attachment.size,\n // Named so the planner doesn't have to infer which tool consumes\n // the file — the capability already told us.\n tool: attachment.tool,\n note:\n 'The user attached this file to the chat. It is already uploaded. ' +\n `To act on it, call ${attachment.tool} with this staged_key. Ask ` +\n 'the user for any details that tool needs and they have not said — ' +\n 'never invent them.'\n }\n };\n}\n","import { MCPUploadCapability } from '@posiwise/common-services';\n\nimport { ChatAttachment } from './pw-brain-chat.types';\nimport {\n acceptedExtensions,\n fileExtension,\n formatFileSize\n} from './pw-brain-chat-attachment.helpers';\n\n/**\n * How the attachment presents itself. Pure functions of (capabilities,\n * attachment) so the copy is unit-testable without constructing a controller,\n * and so the controller stays inside the 200-line cap.\n */\n\nconst IMAGE_EXTENSIONS = new Set(['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg']);\nconst SHEET_EXTENSIONS = new Set(['csv', 'xls', 'xlsx']);\n\n/**\n * Named after the KIND of file accepted, not the tool.\n *\n * A descriptor `title` is an action (\"Set Your Profile Picture\"), so framing\n * it as \"Drop your {title}\" produces \"Drop your set your profile picture\".\n * The extension set is the honest signal for what to call the thing, and it\n * degrades to a generic label whenever the types are mixed.\n */\nexport function dropzoneLabel(capabilities: MCPUploadCapability[]): string {\n const extensions = acceptedExtensions(capabilities);\n if (extensions.length === 0) {\n return 'Drop a file';\n }\n if (extensions.every(e => IMAGE_EXTENSIONS.has(e))) {\n return 'Drop an image';\n }\n if (extensions.every(e => SHEET_EXTENSIONS.has(e))) {\n return 'Drop a spreadsheet';\n }\n return 'Drop a file';\n}\n\nexport function dropzoneHint(capabilities: MCPUploadCapability[]): string {\n const exts = acceptedExtensions(capabilities)\n .map(e => e.toUpperCase())\n .join(', ');\n const cap = Math.max(0, ...capabilities.map(c => c.max_bytes));\n return `${exts} · up to ${formatFileSize(cap)}`;\n}\n\nexport function acceptAttribute(capabilities: MCPUploadCapability[]): string {\n return acceptedExtensions(capabilities)\n .map(e => `.${e}`)\n .join(',');\n}\n\nexport function attachmentMeta(attachment: ChatAttachment | null): string {\n if (!attachment) {\n return '';\n }\n if (attachment.status === 'error') {\n return attachment.error ?? 'Upload failed.';\n }\n const size = formatFileSize(attachment.size);\n if (attachment.status === 'choosing') {\n return `Not uploaded yet · ${size}`;\n }\n // Name the action the file is for, so a wrong pick is visible before sending.\n // No \"Ready\" once the chip sits INSIDE the composer: its position already\n // says it travels with the message, and a status word there read as an\n // instruction people then went looking to carry out.\n const action = attachment.title ? `${attachment.title} · ` : '';\n return attachment.status === 'uploading'\n ? `Uploading… ${attachment.percent}% · ${action}${size}`\n : `${action}${size}`;\n}\n\n/** Fontawesome glyph matching the file type (AI62: FA only). */\nexport function attachmentIcon(attachment: ChatAttachment | null): string {\n if (!attachment) {\n return 'fa-file';\n }\n if (attachment.status === 'error') {\n return 'fa-triangle-exclamation';\n }\n const ext = fileExtension(attachment.name);\n if (ext === 'csv') return 'fa-file-csv';\n if (['xls', 'xlsx'].includes(ext)) return 'fa-file-excel';\n if (['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg'].includes(ext)) return 'fa-file-image';\n return 'fa-file';\n}\n\n/** Names what WAS dropped and what would be accepted, not just \"invalid\". */\nexport function unsupportedFileMessage(file: File, capabilities: MCPUploadCapability[]): string {\n const ext = fileExtension(file.name);\n const accepted = acceptedExtensions(capabilities).join(', ');\n return ext\n ? `.${ext} files aren't accepted here — try ${accepted}.`\n : `That file type isn't accepted here — try ${accepted}.`;\n}\n","import { MCPUploadCapability } from '@posiwise/common-services';\n\nimport { fileExtension, validateChatFile } from './pw-brain-chat-attachment.helpers';\nimport { unsupportedFileMessage } from './pw-brain-chat-attachment.view';\n\n/**\n * Which upload tool gets a dropped file.\n *\n * The extension only NARROWS the candidates — it never decides between two.\n * A PNG might be a profile picture or a receipt; picking the first advertised\n * tool silently sent a user's screenshot to `avatar_upload` and replaced their\n * profile picture. So when more than one tool fits, the user chooses, and the\n * file is not uploaded anywhere until they do.\n */\nexport type UploadRoute =\n | { kind: 'rejected'; message: string }\n | { kind: 'single'; capability: MCPUploadCapability }\n | { kind: 'choose'; options: MCPUploadCapability[] };\n\nexport function routeUpload(file: File, capabilities: MCPUploadCapability[]): UploadRoute {\n const ext = fileExtension(file.name);\n const matching = capabilities.filter(c => c.allowed_extensions.includes(ext));\n if (!matching.length) {\n return { kind: 'rejected', message: unsupportedFileMessage(file, capabilities) };\n }\n // A tool whose size cap the file breaks is not a real option.\n const fitting = matching.filter(c => !validateChatFile(file, c));\n if (!fitting.length) {\n return { kind: 'rejected', message: validateChatFile(file, matching[0]) as string };\n }\n return fitting.length === 1\n ? { kind: 'single', capability: fitting[0] }\n : { kind: 'choose', options: fitting };\n}\n\n/** Button text: the tool's advertised title is an action (\"Set Your Profile Picture\"). */\nexport function choiceLabel(capability: MCPUploadCapability): string {\n return capability.title?.trim() || capability.tool;\n}\n\n/** The file held back while the user picks, and what they may pick from. */\nexport class BrainChatUploadChoice {\n private file: File | null = null;\n options: MCPUploadCapability[] = [];\n\n offer(file: File, options: MCPUploadCapability[]): void {\n this.file = file;\n this.options = options;\n }\n\n /** The held file, if `capability` is one of the offered options. */\n take(capability: MCPUploadCapability): File | null {\n const file = this.options.includes(capability) ? this.file : null;\n if (file) {\n this.clear();\n }\n return file;\n }\n\n clear(): void {\n this.file = null;\n this.options = [];\n }\n}\n","import { dragCarriesFile, fileFromDrop } from './pw-brain-chat-attachment.helpers';\n\n/**\n * Drag state for the panel-wide drop target.\n *\n * Separate from the attachment controller because it is purely about pointer\n * events — no upload, no capabilities — and because keeping it here leaves the\n * controller inside the 200-line cap.\n */\nexport class BrainChatDragTracker {\n active = false;\n\n constructor(\n private readonly enabled: () => boolean,\n private readonly onChange: () => void\n ) {}\n\n enter(event: DragEvent): void {\n if (!this.enabled() || !dragCarriesFile(event)) {\n return;\n }\n event.preventDefault();\n this.active = true;\n this.onChange();\n }\n\n /** Must preventDefault or the browser navigates away to the file. */\n over(event: DragEvent): void {\n if (!this.enabled() || !dragCarriesFile(event)) {\n return;\n }\n event.preventDefault();\n }\n\n leave(event: DragEvent): void {\n // dragleave fires for every child crossed, so only the pointer\n // genuinely exiting the panel should clear the overlay.\n if (\n event.relatedTarget &&\n (event.currentTarget as Node).contains(event.relatedTarget as Node)\n ) {\n return;\n }\n this.active = false;\n this.onChange();\n }\n\n /** @returns the dropped file, or null when the drop carried none. */\n drop(event: DragEvent): File | null {\n if (!this.enabled()) {\n return null;\n }\n event.preventDefault();\n this.active = false;\n return fileFromDrop(event);\n }\n\n reset(): void {\n this.active = false;\n }\n}\n","import {\n BaseHttpService,\n DirectUploadService,\n MCPUploadCapability\n} from '@posiwise/common-services';\n\nimport { Observable, Subject, takeUntil } from 'rxjs';\n\nimport { ChatAttachment } from './pw-brain-chat.types';\n\n/**\n * The two network concerns of an attachment — discovering what may be\n * attached, and sending the bytes — kept out of the controller so it stays\n * inside the 200-line cap and remains readable as pure state.\n */\n\n/**\n * Discovery is best-effort: a failure yields an EMPTY capability list, so the\n * panel shows no upload affordance rather than a broken one, and the chat\n * still works. Only capabilities whose service the host app can actually reach\n * are kept — one we have no client for would advertise an upload with nowhere\n * to go.\n */\nexport function discoverCapabilities(opts: {\n source: Observable<{ uploads: MCPUploadCapability[] }>;\n destroy$: Subject<void>;\n apis: Record<string, BaseHttpService>;\n onResolved: (capabilities: MCPUploadCapability[]) => void;\n}): void {\n opts.source.pipe(takeUntil(opts.destroy$)).subscribe({\n next: response =>\n opts.onResolved((response.uploads ?? []).filter(c => !!opts.apis[c.service])),\n error: () => opts.onResolved([])\n });\n}\n\n/**\n * Sends the bytes straight to the owning service — never through brain-api,\n * which advertises the capability but must not carry files. Size-routed by\n * DirectUploadService: small files through the API, large ones direct to S3.\n */\nexport function sendUpload(opts: {\n uploads: DirectUploadService;\n api: BaseHttpService;\n capability: MCPUploadCapability;\n file: File;\n subscriptionId: number;\n onProgress: (percent: number) => void;\n onStaged: (key: string) => void;\n onError: () => void;\n}): void {\n opts.uploads\n .uploadBySize(opts.api, {\n purpose: opts.capability.purpose,\n file: opts.file,\n subscriptionId: opts.subscriptionId\n })\n .subscribe({\n next: event =>\n event.kind === 'progress'\n ? opts.onProgress(event.percent)\n : opts.onStaged(event.key),\n error: () => opts.onError()\n });\n}\n\n/**\n * Upload ``file`` for ``capability`` and reflect progress on the attachment\n * ``current()`` returns. Guarded on every callback: the chip may have been\n * removed mid-flight.\n */\nexport function stageInto(p: {\n uploads: DirectUploadService | null;\n api: BaseHttpService | undefined;\n subscriptionId: number | null;\n capability: MCPUploadCapability;\n file: File;\n current: () => ChatAttachment | null;\n changed: () => void;\n}): void {\n const update = (patch: Partial<ChatAttachment>) => {\n const attachment = p.current();\n if (attachment) {\n Object.assign(attachment, patch);\n p.changed();\n }\n };\n if (!p.uploads || !p.api || p.subscriptionId == null) {\n update({\n status: 'error',\n error: 'We could not work out which subscription to upload this to.'\n });\n return;\n }\n sendUpload({\n uploads: p.uploads,\n api: p.api,\n capability: p.capability,\n file: p.file,\n subscriptionId: p.subscriptionId,\n onProgress: percent => update({ percent }),\n onStaged: key => update({ percent: 100, status: 'ready', key }),\n onError: () =>\n update({\n status: 'error',\n error: 'That upload did not complete. Try attaching it again.'\n })\n });\n}\n","import {\n BaseHttpService,\n DirectUploadService,\n MCPUploadCapability\n} from '@posiwise/common-services';\n\nimport { Observable, Subject } from 'rxjs';\n\nimport { ChatAttachment } from './pw-brain-chat.types';\nimport { BrainChatUploadChoice, choiceLabel, routeUpload } from './pw-brain-chat-attachment.choice';\nimport { BrainChatDragTracker } from './pw-brain-chat-attachment.drag';\nimport { attachmentContext } from './pw-brain-chat-attachment.helpers';\nimport { discoverCapabilities, stageInto } from './pw-brain-chat-attachment.transfer';\nimport {\n acceptAttribute,\n attachmentIcon,\n attachmentMeta,\n dropzoneHint,\n dropzoneLabel\n} from './pw-brain-chat-attachment.view';\n\n/**\n * Owns the composer's file attachment: drag state, the upload, and the single\n * staged file. Split out of the component the same way BrainChatDictation and\n * BrainChatVoiceChat are, so the panel stays composable and this is testable\n * without a TestBed.\n *\n * What it may accept is DISCOVERED, not configured: brain-api reports the\n * upload-capable tools this caller can reach, each carrying its own purpose,\n * extensions and size cap. So a product gains a drop affordance by shipping a\n * tool that advertises one — with no change here and none in the host app\n * beyond naming its API.\n */\nexport class BrainChatAttachment {\n current: ChatAttachment | null = null;\n\n private readonly drag = new BrainChatDragTracker(\n () => this.enabled,\n () => this.onChange()\n );\n\n private capabilities: MCPUploadCapability[] = [];\n private readonly choice = new BrainChatUploadChoice();\n\n constructor(\n private readonly uploads: DirectUploadService | null,\n private readonly apis: Record<string, BaseHttpService> | null,\n private readonly subscriptionId: () => number | null,\n private readonly onChange: () => void\n ) {}\n\n discover(\n source: Observable<{ uploads: MCPUploadCapability[] }>,\n destroy$: Subject<void>\n ): void {\n if (!this.uploads || !this.apis) {\n return;\n }\n discoverCapabilities({\n source,\n destroy$,\n apis: this.apis,\n onResolved: capabilities => {\n this.capabilities = capabilities;\n this.onChange();\n }\n });\n }\n\n get enabled(): boolean {\n return this.capabilities.length > 0;\n }\n\n get busy(): boolean {\n return this.current?.status === 'uploading';\n }\n\n /** Several tools accept the file; nothing is uploaded until one is picked. */\n get choosing(): boolean {\n return this.current?.status === 'choosing';\n }\n\n get choices(): MCPUploadCapability[] {\n return this.choice.options;\n }\n\n choiceLabel(capability: MCPUploadCapability): string {\n return choiceLabel(capability);\n }\n\n get ready(): boolean {\n return this.current?.status === 'ready';\n }\n\n get context(): Record<string, unknown> | null {\n return attachmentContext(this.current);\n }\n\n get label(): string {\n return dropzoneLabel(this.capabilities);\n }\n\n get hint(): string {\n return dropzoneHint(this.capabilities);\n }\n\n get acceptAttr(): string {\n return acceptAttribute(this.capabilities);\n }\n\n get dragActive(): boolean {\n return this.drag.active;\n }\n\n dragEnter(event: DragEvent): void {\n this.drag.enter(event);\n }\n\n dragOver(event: DragEvent): void {\n this.drag.over(event);\n }\n\n dragLeave(event: DragEvent): void {\n this.drag.leave(event);\n }\n\n drop(event: DragEvent): void {\n const file = this.drag.drop(event);\n if (file) {\n this.accept(file);\n } else {\n this.onChange();\n }\n }\n\n /** Shared by the drop target and the paperclip file input. */\n accept(file: File): void {\n const route = routeUpload(file, this.capabilities);\n this.choice.clear();\n this.current = { name: file.name, size: file.size, percent: 0, status: 'choosing' };\n if (route.kind === 'rejected') {\n Object.assign(this.current, { status: 'error', error: route.message });\n } else if (route.kind === 'choose') {\n this.choice.offer(file, route.options);\n } else {\n this.upload(file, route.capability);\n }\n this.onChange();\n }\n\n /** The user picked which tool this file is for — only now is it uploaded. */\n choose(capability: MCPUploadCapability): void {\n const file = this.choice.take(capability);\n if (file) {\n this.upload(file, capability);\n this.onChange();\n }\n }\n\n remove(): void {\n this.choice.clear();\n this.current = null;\n this.drag.reset();\n this.onChange();\n }\n\n /** Cleared once a planned call used `sent`; a reply asking for details keeps it. */\n clearIfConsumed(sent: ChatAttachment | null): void {\n if (sent?.status === 'ready' && this.current === sent) {\n this.current = null;\n }\n }\n\n meta(): string {\n return attachmentMeta(this.current);\n }\n\n icon(): string {\n return attachmentIcon(this.current);\n }\n\n private upload(file: File, capability: MCPUploadCapability): void {\n if (this.current) {\n const chosen: Partial<ChatAttachment> = {\n status: 'uploading',\n tool: capability.tool,\n title: choiceLabel(capability)\n };\n Object.assign(this.current, chosen);\n }\n stageInto({\n uploads: this.uploads,\n api: this.apis?.[capability.service],\n subscriptionId: this.subscriptionId(),\n capability,\n file,\n current: () => this.current,\n changed: () => this.onChange()\n });\n }\n}\n","import { MCPExecuteResponse } from '@posiwise/common-services';\n\nimport { ChatMessage } from './pw-brain-chat.types';\n\n/**\n * Builds the assistant bubble that carries a pending-confirmation card\n * from a `needs_confirmation` orchestrator envelope. Extracted from\n * `pw-brain-chat.component.ts` (pure mapping — keeps the component lean\n * under C1 and independently testable). `token` is passed explicitly so\n * the function doesn't depend on the caller's type-narrowing.\n */\nexport function buildConfirmationMessage(response: MCPExecuteResponse, token: string): ChatMessage {\n return {\n role: 'assistant',\n text: response.summary ?? 'Please review and approve this action.',\n pending: {\n confirmation_token: token,\n risk_level: response.risk_level,\n summary: response.summary,\n target_service: response.target_service,\n target_tool: response.target_tool,\n diff: response.diff\n }\n };\n}\n","import { Router } from '@angular/router';\n\nimport { DynamicPageContext } from '../dynamic-page/dynamic-page-context.service';\n\n/**\n * Builds the `workspace_context` blob sent to brain-api on every Brain chat\n * message (#933 — page-aware orchestration). Bedrock reads this verbatim\n * from its system prompt to resolve \"this page\" / \"the current page\" and to\n * pick the right tool with the right arguments instead of guessing.\n *\n * General awareness: route + route_pattern + product + human page label +\n * active subscription are sent on EVERY page. When the user is on a\n * Conversational UI Builder dynamic page, an `active_page` descriptor is added\n * carrying the exact page_key + subscription_id so `ui_update_layout` can\n * target it.\n *\n * `route_pattern` is the instance-id-free join key for page-scoped\n * documentation grounding: the concrete `route` is `/admin/subscriptions/27`,\n * but docs are indexed against the Angular pattern `/admin/subscriptions/:id`.\n * brain-api boosts documentation whose declared `ui_paths` contain this value,\n * so answers about \"this page\" surface the right help.\n */\n\n// Mirrors AppTitleService — the canonical \"label for the current route\" is\n// the chain of `routeConfig.data.title` segments down the active tree.\nexport function pageLabelFromRouter(router: Router): string {\n let route = router.routerState?.root?.firstChild ?? null;\n const parts: string[] = [];\n while (route) {\n const title = route.snapshot?.routeConfig?.data?.['title'];\n if (typeof title === 'string' && title.trim()) {\n parts.push(title.trim());\n }\n route = route.firstChild;\n }\n return parts.join(' | ');\n}\n\n// Reconstructs the matched Angular route pattern by joining each activated\n// route's `routeConfig.path` down the active tree — e.g.\n// `/admin/subscriptions/:id/agent_details/:agentId`. This is the stable join\n// key for page-scoped documentation (the concrete `router.url` carries\n// instance ids that could never match a doc's declared pattern). Pathless /\n// componentless wrapper routes (empty `path`) are skipped. Returns '' when the\n// tree yields no path segments.\nexport function routePatternFromRouter(router: Router): string {\n let route = router.routerState?.root?.firstChild ?? null;\n const segments: string[] = [];\n while (route) {\n const path = route.snapshot?.routeConfig?.path;\n if (typeof path === 'string' && path.length) {\n segments.push(path);\n }\n route = route.firstChild;\n }\n return segments.length ? '/' + segments.join('/') : '';\n}\n\n// `/posiwise/hyperdashboard/conversational-ui-builder` → `hyperdashboard`.\n// Best-effort hint only; null when the URL has no product segment.\nfunction productFromUrl(url: string): string | null {\n const segs = url.split(/[?#]/)[0].split('/').filter(Boolean);\n return segs.length >= 2 ? segs[1] : null;\n}\n\nexport function buildWorkspaceContext(\n router: Router,\n dynamicPage: DynamicPageContext | null,\n subscriptionId: number | null\n): Record<string, unknown> {\n const url = router.url ?? '';\n const label = pageLabelFromRouter(router);\n const routePattern = routePatternFromRouter(router);\n const ctx: Record<string, unknown> = {\n route: url,\n route_pattern: routePattern || null,\n product: productFromUrl(url),\n page_label: label || null,\n subscription_id: subscriptionId\n };\n if (dynamicPage) {\n ctx['active_page'] = {\n kind: 'conversational_ui_builder',\n page_key: dynamicPage.pageKey,\n subscription_id: dynamicPage.subscriptionId,\n note:\n 'The user is viewing this Conversational UI Builder dynamic ' +\n 'page. \"this page\" / \"the current page\" / \"this dashboard\" / ' +\n '\"the demo page\" all refer to it. To change its layout, call ' +\n 'ui_update_layout with this subscription_id and page_key.'\n };\n }\n return ctx;\n}\n","import { BrainVoiceService, VoiceTranscript } from '@posiwise/common-services';\n\nimport { Subscription } from 'rxjs';\n\n/**\n * Drives mic dictation for the Brain chat composer (#22).\n *\n * Toggles recording, folds the partial/final transcripts brain-api relays from\n * Amazon Transcribe into the chat draft — preserving any text the user already\n * typed — and surfaces a friendly status (listening / processing / error) so\n * the user always knows what's happening. Lives outside the component to\n * respect the helper-delegation pattern the chat component already uses\n * (persistence, navigation, diff, etc.) and to keep that component small.\n */\nexport type DictationPhase = 'idle' | 'listening' | 'processing';\n\nconst VOICE_ERROR_MESSAGES: Record<string, string> = {\n mic: 'Microphone access was denied or is unavailable.',\n unauthorized: 'Could not authenticate the voice session.',\n disabled: 'Voice input is not enabled here yet.',\n failed: 'Voice input failed — please try again.'\n};\n\nexport class BrainChatDictation {\n phase: DictationPhase = 'idle';\n error: string | null = null;\n private sub?: Subscription;\n /** Draft text captured at record-start + each finalized phrase, so live\n * partials update without clobbering what the user already typed. */\n private base = '';\n\n constructor(\n private readonly voice: BrainVoiceService | undefined,\n private readonly getDraft: () => string,\n private readonly setDraft: (text: string) => void,\n private readonly changed: () => void\n ) {}\n\n /** Convenience for the template — kept for the pulsing-button class. */\n get isRecording(): boolean {\n return this.phase === 'listening';\n }\n\n /** Status text shown next to the mic; `null` when nothing to say. */\n get statusMessage(): string | null {\n if (this.error) return this.error;\n if (this.phase === 'listening') return 'Listening — speak now';\n if (this.phase === 'processing') return 'Processing your speech…';\n return null;\n }\n\n /** Mic button handler: start if idle, stop if recording. While\n * \"processing\" we ignore clicks until the server's final transcript\n * lands. */\n toggle(loading: boolean): void {\n if (this.phase === 'listening') {\n this.stop();\n } else if (this.phase === 'idle') {\n this.start(loading);\n }\n }\n\n stop(): void {\n if (this.phase !== 'listening') return;\n this.voice?.stop();\n this.phase = 'processing';\n this.changed();\n }\n\n /** Unconditionally cancel recording and clear any error, from ANY phase —\n * the overlay's End/Close (stop() only finalizes from 'listening', so it\n * can't dismiss the 'processing' or 'error' states). */\n dismiss(): void {\n this.sub?.unsubscribe();\n this.sub = undefined;\n this.voice?.stop();\n this.phase = 'idle';\n this.error = null;\n this.changed();\n }\n\n /** Tear down with the host component (called from ngOnDestroy). */\n dispose(): void {\n this.sub?.unsubscribe();\n this.sub = undefined;\n if (this.phase !== 'idle') {\n this.voice?.stop();\n this.phase = 'idle';\n }\n }\n\n private start(loading: boolean): void {\n if (loading || !this.voice) return;\n this.error = null;\n const current = this.getDraft().trimEnd();\n this.base = current ? `${current} ` : '';\n this.phase = 'listening';\n this.changed();\n this.sub = this.voice.start().subscribe({\n next: transcript => this.apply(transcript),\n error: reason => this.fail(reason),\n complete: () => {\n this.phase = 'idle';\n this.setDraft(this.getDraft().trim());\n this.changed();\n }\n });\n }\n\n private apply(transcript: VoiceTranscript): void {\n if (transcript.type === 'final') {\n this.base = `${(this.base + transcript.text).trimEnd()} `;\n this.setDraft(this.base);\n } else {\n this.setDraft(this.base + transcript.text);\n }\n this.changed();\n }\n\n private fail(reason: unknown): void {\n this.phase = 'idle';\n const key = typeof reason === 'string' ? reason : 'failed';\n this.error = VOICE_ERROR_MESSAGES[key] ?? VOICE_ERROR_MESSAGES['failed'];\n this.changed();\n }\n}\n","import { MCPFieldDiff } from '@posiwise/common-services';\n\nexport interface DiffRow {\n field: string;\n before: string;\n after: string;\n}\n\nexport function diffRowsFrom(diff?: MCPFieldDiff | null): DiffRow[] {\n if (!diff) {\n return [];\n }\n return Object.keys(diff).map(field => ({\n field,\n before: formatDiffValue(diff[field].before),\n after: formatDiffValue(diff[field].after)\n }));\n}\n\nfunction formatDiffValue(value: unknown): string {\n if (value === null || value === undefined) {\n return '∅';\n }\n if (typeof value === 'string') {\n return value;\n }\n return JSON.stringify(value);\n}\n","/**\n * Open-redirect and pseudo-scheme mitigations for the navigation\n * fall-through branch in pw-brain-chat. Pure functions, extracted from\n * the component for C1 conformance.\n */\n\nexport function isAllowedExternalNavigationUrl(url: string, currentOrigin: string): boolean {\n if (!(url.startsWith('http://') || url.startsWith('https://'))) {\n return false;\n }\n try {\n return new URL(url).origin === currentOrigin;\n } catch {\n return false;\n }\n}\n\nexport function isSafeAppRelativePath(path: string): boolean {\n if (!path.startsWith('/') || path.startsWith('//')) {\n return false;\n }\n const decoded = decodeURIComponent(path);\n if (decoded.startsWith('//')) {\n // Block percent-encoded protocol-relative paths (e.g. /%2f%2fevil.com).\n return false;\n }\n // NOSONAR typescript:S1523 — these literals are defensive blocklist entries used to reject javascript:/data: pseudo-schemes, not to execute them.\n return (\n !decoded.toLowerCase().includes('javascript:') && !decoded.toLowerCase().includes('data:') // NOSONAR\n );\n}\n","import {\n isAllowedExternalNavigationUrl,\n isSafeAppRelativePath\n} from './pw-brain-chat-url-safety.helpers';\n\nexport type NavigationDecision =\n | { kind: 'external'; url: string }\n | { kind: 'internal'; url: string }\n | { kind: 'rejected' };\n\n/**\n * Decide what navigation (if any) a `tool_result.navigate_to` implies.\n * Pure — the component performs the side-effect + user messaging from the\n * returned decision. Reuses the same url-safety guards as before, so the\n * external/internal/reject policy is unchanged; this only moves the branch\n * logic out of the (oversized) chat component.\n *\n * Returns `null` when the tool result carries no navigation intent.\n */\nexport function resolveNavigation(toolResult: unknown): NavigationDecision | null {\n const tool = toolResult as { navigate_to?: unknown } | null | undefined;\n if (!tool || typeof tool.navigate_to !== 'string') {\n return null;\n }\n const url = tool.navigate_to.trim();\n if (isAllowedExternalNavigationUrl(url, window.location.origin)) {\n return { kind: 'external', url };\n }\n if (isSafeAppRelativePath(url)) {\n return { kind: 'internal', url };\n }\n return { kind: 'rejected' };\n}\n\n/** Side-effect hooks the component supplies so this stays free of Angular deps. */\nexport interface NavigationSideEffects {\n pushAssistant: (text: string, markdownEnabled?: boolean) => void;\n navigateByUrl: (url: string) => Promise<boolean>;\n assignExternal: (url: string) => void;\n}\n\n/**\n * Perform the side-effect implied by a NavigationDecision. Returns `true` when\n * the decision consumed the response (caller should stop), `false` when there\n * was no actionable navigation and the caller should render the tool result.\n * Behaviour is identical to the inline branches it replaced — only the location\n * changed, to keep the oversized chat component within the C1 line budget.\n */\nexport function dispatchNavigation(\n nav: NavigationDecision | null,\n fx: NavigationSideEffects\n): boolean {\n if (nav?.kind === 'external') {\n fx.pushAssistant(`Navigating to: ${nav.url}`);\n fx.assignExternal(nav.url);\n return true;\n }\n if (nav?.kind === 'internal') {\n fx.pushAssistant(`Navigating to: ${nav.url}`);\n fx.navigateByUrl(nav.url).catch(() => fx.pushAssistant('Navigation failed.'));\n return true;\n }\n if (nav?.kind === 'rejected') {\n fx.pushAssistant(\n 'Navigation was not performed: use a single-root path (e.g. /admin/users), not //, javascript:, or data: URLs.',\n false\n );\n return true;\n }\n return false;\n}\n","/**\n * Per-user localStorage persistence for the PosiWise Brain chat panel.\n *\n * Why per-user keys: a shared browser session would leak history from\n * user A to user B if keys were global. The pre-ticket #4167 code used\n * a single global `pw-brain.conversation_id` key; this file owns both\n * the new per-user shape AND a one-time migration from the legacy key.\n *\n * Why strip `pending`: server-side confirmation tokens are TTL-bound.\n * Replaying a stale token after hydrate produces a 4xx. Cleaner UX:\n * drop the inline-approve card on reload; the user re-asks if still\n * wanted.\n */\n\nexport type ChatMessageRole = 'user' | 'assistant';\n\nexport interface StoredChatMessage {\n role: ChatMessageRole;\n text: string;\n markdownEnabled?: boolean;\n /** Epoch ms — optional; absent on pre-timestamp payloads. */\n at?: number;\n}\n\ninterface StoredPayload {\n v: 1;\n messages: StoredChatMessage[];\n}\n\nexport const STORAGE_PREFIX = 'pw-brain.';\nexport const LEGACY_CONVERSATION_KEY = 'pw-brain.conversation_id';\nexport const MAX_STORED_MESSAGES = 100;\n\nexport function messagesKeyFor(userId: string | null | undefined): string {\n return userId ? `${STORAGE_PREFIX}messages.${userId}` : `${STORAGE_PREFIX}messages.anonymous`;\n}\n\nexport function conversationKeyFor(userId: string | null | undefined): string {\n return userId\n ? `${STORAGE_PREFIX}conversation_id.${userId}`\n : `${STORAGE_PREFIX}conversation_id.anonymous`;\n}\n\nexport function serializeMessages(\n messages: ReadonlyArray<{\n role: ChatMessageRole;\n text: string;\n markdownEnabled?: boolean;\n at?: number;\n }>\n): string {\n const stripped: StoredChatMessage[] = messages.slice(-MAX_STORED_MESSAGES).map(m => {\n const stored: StoredChatMessage = { role: m.role, text: m.text };\n if (m.markdownEnabled) stored.markdownEnabled = true;\n if (m.at) stored.at = m.at;\n return stored;\n });\n const payload: StoredPayload = { v: 1, messages: stripped };\n return JSON.stringify(payload);\n}\n\nexport function hydrateMessages(raw: string | null): StoredChatMessage[] {\n if (!raw) {\n return [];\n }\n try {\n const parsed = JSON.parse(raw) as Partial<StoredPayload>;\n if (parsed?.v !== 1 || !Array.isArray(parsed.messages)) {\n return [];\n }\n return parsed.messages\n .filter(\n m =>\n !!m &&\n (m.role === 'user' || m.role === 'assistant') &&\n typeof m.text === 'string'\n )\n .slice(-MAX_STORED_MESSAGES);\n } catch {\n return [];\n }\n}\n","import { LocalStorage } from '@posiwise/common-services';\n\nimport {\n conversationKeyFor,\n hydrateMessages,\n LEGACY_CONVERSATION_KEY,\n messagesKeyFor,\n serializeMessages,\n StoredChatMessage\n} from './pw-brain-chat-storage.helpers';\n\n/**\n * Thin coordinator that pairs the `LocalStorage` wrapper with the\n * current user's `api_user_id`. Owns the per-user keys and the one-time\n * migration from the legacy global `pw-brain.conversation_id` slot.\n */\nexport class BrainChatPersistence {\n constructor(\n private readonly localStorage: LocalStorage,\n private readonly userId: string | null\n ) {}\n\n readMessages(): StoredChatMessage[] {\n try {\n return hydrateMessages(this.localStorage.getItem(messagesKeyFor(this.userId)));\n } catch {\n return [];\n }\n }\n\n persistMessages(messages: ReadonlyArray<{ role: 'user' | 'assistant'; text: string }>): void {\n try {\n this.localStorage\n .setItem$(messagesKeyFor(this.userId), serializeMessages(messages))\n .subscribe();\n } catch {\n // private browsing / quota exhausted — best-effort, never break the chat\n }\n }\n\n /**\n * Read the per-user conversation_id. If absent but the legacy global\n * key still exists (pre-ticket #4167), adopt it into the user-scoped\n * slot and clear the global so the next user on this browser doesn't\n * inherit it.\n */\n adoptConversationId(): string | null {\n const scoped = conversationKeyFor(this.userId);\n const existing = this.localStorage.getItem(scoped);\n if (existing) {\n return existing;\n }\n const legacy = this.localStorage.getItem(LEGACY_CONVERSATION_KEY);\n if (!legacy) {\n return null;\n }\n this.localStorage.setItem$(scoped, legacy).subscribe();\n this.localStorage.removeItem$(LEGACY_CONVERSATION_KEY).subscribe();\n return legacy;\n }\n\n setConversationId(id: string): void {\n this.localStorage.setItem$(conversationKeyFor(this.userId), id).subscribe();\n }\n}\n","// Suggested prompts (welcome state) + quick-action chips (above composer) for\n// the Brain chat \"Canvas\" redesign (posiwise-frontend#51). Kept out of the\n// component so pw-brain-chat.component.ts stays within the C1 line budget.\n\nexport interface BrainChatPrompt {\n text: string;\n icon: string; // Fontawesome free-solid glyph (fa-*)\n}\n\nexport interface BrainChatQuickAction extends BrainChatPrompt {\n label: string;\n}\n\nexport const SUGGESTED_PROMPTS: readonly BrainChatPrompt[] = [\n { text: 'Show my subscription usage this month', icon: 'fa-chart-line' },\n { text: 'Which tools are available to me?', icon: 'fa-toolbox' },\n { text: 'Is everything running smoothly?', icon: 'fa-heart-pulse' }\n];\n\nexport const QUICK_ACTIONS: readonly BrainChatQuickAction[] = [\n { label: 'Usage', text: 'Show my subscription usage this month', icon: 'fa-chart-line' },\n { label: 'Tools', text: 'Which tools are available to me?', icon: 'fa-toolbox' },\n { label: 'Status', text: 'Is everything running smoothly?', icon: 'fa-heart-pulse' }\n];\n\n/** Seed assistant greeting for a fresh conversation (also used by New chat). */\nexport const GREETING =\n 'Hi — I can answer questions about your account and run approved actions. Try “show my API stats”.';\n","/**\n * Keeps the PosiWise Brain chat thread pinned to its newest message.\n *\n * The component never managed scroll, so the thread stayed at\n * `scrollTop = 0` (the top) after hydrate/send/reply and the latest\n * message rendered below the fold (ticket: chat scroll-to-top bug).\n *\n * Call `stickThreadToBottom` synchronously right after a message is\n * pushed — before the OnPush re-render. `getEl` is resolved twice:\n * 1. now, to read the PRE-render scroll position and decide whether\n * the user was already near the bottom; and\n * 2. inside the deferred tick, after Angular has laid out the new\n * row, to actually move the scrollbar.\n *\n * `force` (the user's own send / initial hydrate) always re-pins.\n * Otherwise we only follow when the user was already near the bottom,\n * so scrolling up to read history isn't yanked away by an incoming\n * assistant reply.\n */\nconst STICK_THRESHOLD_PX = 80;\n\nexport function isNearBottom(el: HTMLElement | null | undefined): boolean {\n if (!el) {\n return false;\n }\n return el.scrollHeight - el.scrollTop - el.clientHeight < STICK_THRESHOLD_PX;\n}\n\nexport function stickThreadToBottom(\n getEl: () => HTMLElement | null | undefined,\n force: boolean\n): void {\n if (!force && !isNearBottom(getEl())) {\n return;\n }\n // Defer past the OnPush re-render so the just-pushed row is laid\n // out before we read scrollHeight. getEl() is re-resolved here so\n // a call made from ngOnInit (ViewChild not yet bound) still works.\n setTimeout(() => {\n const el = getEl();\n if (el) {\n el.scrollTop = el.scrollHeight;\n }\n }, 0);\n}\n","import { InjectionToken } from '@angular/core';\n\nimport { BaseHttpService } from '@posiwise/common-services';\n\n/**\n * Which product API to POST bytes to, keyed by the service name the tool\n * catalog reports (e.g. `'cloudolive-api'`, `'main-api'`).\n *\n * This is the ONE thing discovery cannot supply. Everything else about an\n * upload — the purpose, the accepted extensions, the size cap, which tool\n * consumes it — is advertised by the tool itself via `posiwise.upload` and\n * fetched from brain-api, so no frontend restates limits the owning service\n * already enforces. But the file goes STRAIGHT to the owning service rather\n * than through brain-api (bytes must never transit the chat pipeline), and\n * only the host app knows how to reach its own APIs.\n *\n * A service the map doesn't cover is simply not offered: the affordance is\n * hidden rather than advertised-then-broken.\n */\nexport const BRAIN_CHAT_UPLOAD_APIS = new InjectionToken<Record<string, BaseHttpService>>(\n 'BRAIN_CHAT_UPLOAD_APIS'\n);\n","// Voice Chat state vocabulary + status copy + visual mapping — extracted from\n// the BrainChatVoiceChat controller so it stays under the C1 line cap. The\n// controller re-exports the types, so external import sites are unchanged.\n\nexport type VoiceChatState =\n | 'idle'\n | 'listening'\n | 'processingSpeech'\n | 'thinking'\n | 'fetchingData'\n | 'speaking'\n | 'completed'\n | 'error';\n\n/** Visual treatment hint for the template — keeps animation choice out of HTML. */\nexport type VoiceChatVisual = 'idle' | 'pulse' | 'loader' | 'wave' | 'error';\n\nexport const VOICE_ERROR_MESSAGES: Record<string, string> = {\n mic: 'Microphone access was denied or is unavailable.',\n unauthorized: 'Could not authenticate the voice session.',\n disabled: 'Voice chat is not enabled here yet.',\n failed: 'Voice chat failed — please try again.'\n};\n\n/** Status copy per state — reassuring, conversational, and never silent. */\nexport const STATE_COPY: Record<VoiceChatState, string> = {\n idle: '',\n listening: 'Listening…',\n processingSpeech: 'Got that — one moment…',\n thinking: 'Understanding your question…',\n fetchingData: 'Checking your data…',\n speaking: 'Here’s what I found…',\n completed: 'Listening…',\n error: ''\n};\n\nexport const STATE_VISUAL: Record<VoiceChatState, VoiceChatVisual> = {\n idle: 'idle',\n listening: 'pulse',\n processingSpeech: 'loader',\n thinking: 'loader',\n fetchingData: 'loader',\n speaking: 'wave',\n completed: 'pulse',\n error: 'error'\n};\n","import { VoiceChatEvent, VoiceChatService } from '@posiwise/common-services';\n\nimport { Subscription } from 'rxjs';\n\nimport {\n STATE_COPY,\n STATE_VISUAL,\n VOICE_ERROR_MESSAGES,\n VoiceChatState,\n VoiceChatVisual\n} from './pw-brain-chat-voice-copy';\n\nexport type { VoiceChatState, VoiceChatVisual };\n\n/**\n * Voice Chat controller for the Brain chat composer (#58) — explicit state\n * machine over the WS relay: listening (start) → thinking (`text` role=user)\n * → fetchingData (`tool_use`) → speaking (`speaking_changed`) → listening.\n * Copy/visual vocab lives in pw-brain-chat-voice-copy.ts (C1 line budget).\n */\nexport class BrainChatVoiceChat {\n state: VoiceChatState = 'idle';\n error: string | null = null;\n available = false;\n /** Latest user transcript (Sonic ASR) — enriches the `fetchingData` copy. */\n transcript = '';\n /** Assistant reply text for the current turn — streams in alongside the audio. */\n reply = '';\n private sub?: Subscription;\n\n constructor(\n private readonly voice: VoiceChatService | undefined,\n private readonly changed: () => void,\n /** Called once per completed spoken exchange so the host can record it. */\n private readonly onTurn?: (userText: string, replyText: string) => void\n ) {}\n\n get isActive(): boolean {\n return this.state !== 'idle' && this.state !== 'error';\n }\n\n /** Back-compat for callers that only care whether audio is playing. */\n get speaking(): boolean {\n return this.state === 'speaking';\n }\n\n /** Animation family the template renders for the current state. */\n get visual(): VoiceChatVisual {\n return this.error ? 'error' : STATE_VISUAL[this.state];\n }\n\n /** Status text next to the button; `null` when there's nothing to say. */\n get statusMessage(): string | null {\n if (this.error) return this.error;\n if (this.state === 'fetchingData' && this.transcript) {\n return `Checking: “${this.transcript}”…`;\n }\n return STATE_COPY[this.state] || null;\n }\n\n /** Resolve once on init so the button shows only when voice-api is reachable. */\n async resolveAvailability(): Promise<void> {\n if (!this.voice) {\n this.available = false;\n return;\n }\n try {\n this.available = await this.voice.isAvailable();\n } catch {\n this.available = false;\n }\n this.changed();\n }\n\n /** Voice Chat button handler: start if idle, stop if active. */\n toggle(loading: boolean): void {\n if (this.isActive) {\n this.stop();\n } else {\n this.start(loading);\n }\n }\n\n stop(): void {\n if (this.state === 'idle') return; // 'error' also dismisses — setState('idle') clears it\n this.flushTurn(); // record any in-flight exchange before tearing down\n this.voice?.stop();\n this.setState('idle');\n }\n\n /** Tear down with the host component (called from ngOnDestroy). */\n dispose(): void {\n this.sub?.unsubscribe();\n this.sub = undefined;\n if (this.state !== 'idle') {\n this.flushTurn(); // persist any in-flight exchange before teardown\n this.voice?.stop();\n this.setState('idle');\n }\n }\n\n private start(loading: boolean): void {\n if (loading || !this.voice || !this.available) return;\n this.error = null;\n this.transcript = '';\n this.reply = '';\n this.setState('listening');\n this.sub = this.voice.start().subscribe({\n next: event => this.apply(event),\n error: reason => this.fail(reason),\n complete: () => this.setState('idle')\n });\n }\n\n private apply(event: VoiceChatEvent): void {\n switch (event.kind) {\n case 'text':\n this.onText(event.role, event.text);\n break;\n case 'tool_use':\n this.advanceTo('fetchingData');\n break;\n case 'speaking_changed':\n if (event.speaking) {\n this.onSpeakingStarted();\n } else {\n this.onSpeakingStopped();\n }\n break;\n case 'error':\n // Non-fatal in-session error: surface it without ending the chat.\n this.error = event.detail;\n this.changed();\n break;\n }\n }\n\n private onText(role: string | undefined, text: string): void {\n // Nova Sonic sends roles UPPERCASE on the wire ('USER'/'ASSISTANT') —\n // match case-insensitively or these branches never fire.\n const r = (role ?? '').toLowerCase();\n const t = text.trim();\n if (r === 'user' && t) {\n // ASR transcript = \"heard you, now understanding\". A new question\n // also closes any prior turn (barge-in while the reply was playing).\n this.flushTurn();\n this.transcript = t;\n this.advanceTo('thinking');\n } else if (r === 'assistant' && t) {\n // The reply's text — stream it live under the Sonar dial.\n this.reply = this.reply ? `${this.reply} ${t}` : t;\n this.changed();\n }\n }\n\n private onSpeakingStarted(): void {\n this.advanceTo('speaking');\n }\n\n private onSpeakingStopped(): void {\n // Turn finished — record the exchange, then listen for the next utterance.\n if (this.state === 'speaking') {\n this.flushTurn();\n this.advanceTo('listening');\n }\n }\n\n /** Hand the completed spoken exchange to the host (thread recording), then\n * reset the per-turn buffers. Safe to call with nothing buffered. */\n private flushTurn(): void {\n if (this.transcript || this.reply) {\n this.onTurn?.(this.transcript, this.reply);\n }\n this.transcript = '';\n this.reply = '';\n }\n\n /** Move forward only while a session is live (ignore stray events post-stop). */\n private advanceTo(next: VoiceChatState): void {\n if (!this.isActive) return;\n this.setState(next);\n }\n\n private fail(reason: unknown): void {\n const key = typeof reason === 'string' ? reason : 'failed';\n this.error = VOICE_ERROR_MESSAGES[key] ?? VOICE_ERROR_MESSAGES['failed'];\n this.state = 'error';\n this.changed();\n }\n\n private setState(next: VoiceChatState): void {\n this.state = next;\n if (next === 'idle') {\n this.error = null;\n this.transcript = '';\n this.reply = '';\n }\n this.changed();\n }\n}\n","import { Directive, HostListener } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { isSafeAppRelativePath } from './pw-brain-chat-url-safety.helpers';\n\n/**\n * Intercepts clicks on `<a>` elements rendered inside assistant markdown\n * bubbles. Internal paths (e.g. /account/details) are routed via Angular's\n * Router so the SPA does not do a full-page reload. External URLs fall\n * through to the browser's default behaviour (target=_blank already set by\n * SafeMarkdownPipe / renderMarkdown for external links).\n *\n * Applied via the `pwBrainChatThread` attribute on the chat thread div.\n */\n@Directive({ selector: '[pwBrainChatThread]' })\nexport class PwBrainChatThreadDirective {\n constructor(private readonly router: Router) {}\n\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n const anchor = (event.target as HTMLElement | null)?.closest('a');\n if (!anchor) {\n return;\n }\n const href = anchor.getAttribute('href');\n if (!href || !isSafeAppRelativePath(href)) {\n return;\n }\n event.preventDefault();\n this.router.navigateByUrl(href).catch(() => undefined);\n }\n}\n","import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';\n\nimport { PendingConfirmation } from './pw-brain-chat.types';\nimport { diffRowsFrom } from './pw-brain-chat-diff.helpers';\n\n/**\n * Pending-action confirmation panel for the Brain chat bubble — risk badge,\n * target tool, field-level diff, and Approve/Cancel controls. Extracted from\n * the parent component template so `pw-brain-chat.component.html` stays under\n * the C1 200-line cap. Emits back to the parent, which owns the /confirm call\n * and message mutation (approve/cancel).\n */\n@Component({\n selector: 'pw-brain-chat-confirm',\n templateUrl: './pw-brain-chat-confirm.component.html',\n styleUrls: ['./pw-brain-chat-confirm.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class PwBrainChatConfirmComponent {\n @Input({ required: true }) pending!: PendingConfirmation;\n @Input() loading = false;\n @Output() approveEvent = new EventEmitter<void>();\n @Output() cancelEvent = new EventEmitter<void>();\n\n readonly diffRows = diffRowsFrom;\n}\n","<div class=\"pw-brain-chat__confirm\" aria-label=\"Approve action\">\n <div class=\"pw-brain-chat__confirm-meta\">\n @if (pending.risk_level) {\n <span\n class=\"pw-brain-chat__risk\"\n [class.pw-brain-chat__risk--critical]=\"pending.risk_level === 'critical'\"\n [class.pw-brain-chat__risk--high]=\"pending.risk_level === 'high'\"\n [class.pw-brain-chat__risk--medium]=\"pending.risk_level === 'medium'\"\n [class.pw-brain-chat__risk--low]=\"pending.risk_level === 'low'\"\n >Risk: {{ pending.risk_level }}</span>\n }\n @if (pending.target_service && pending.target_tool) {\n <span class=\"pw-brain-chat__target\"\n >{{ pending.target_service }}.{{ pending.target_tool }}</span\n >\n }\n </div>\n @if (diffRows(pending.diff).length) {\n <table class=\"pw-brain-chat__diff\" aria-label=\"Field-level diff\">\n <thead>\n <tr>\n <th scope=\"col\">Field</th>\n <th scope=\"col\">Before</th>\n <th scope=\"col\">After</th>\n </tr>\n </thead>\n <tbody>\n @for (row of diffRows(pending.diff); track row.field) {\n <tr>\n <th scope=\"row\" class=\"pw-brain-chat__diff-field\">{{ row.field }}</th>\n <td class=\"pw-brain-chat__diff-before\">{{ row.before }}</td>\n <td class=\"pw-brain-chat__diff-after\">{{ row.after }}</td>\n </tr>\n }\n </tbody>\n </table>\n }\n <div class=\"pw-brain-chat__confirm-actions\">\n <button\n type=\"button\"\n class=\"btn btn-success btn-sm pw-brain-chat__approve\"\n [disabled]=\"loading\"\n (click)=\"approveEvent.emit()\"\n >Approve</button>\n <button\n type=\"button\"\n class=\"btn btn-outline-secondary btn-sm pw-brain-chat__cancel\"\n [disabled]=\"loading\"\n (click)=\"cancelEvent.emit()\"\n >Cancel</button>\n </div>\n</div>\n","import { InjectionToken } from '@angular/core';\n\nimport { BrainChatPrompt } from './pw-brain-chat-prompts';\n\n/** A suggested prompt a product adds to the Brain chat welcome, optionally behind a permission. */\nexport interface BrainChatProductPrompt extends BrainChatPrompt {\n /** Permission expression (PermissionService.evaluatePermissions); omitted = shown to everyone. */\n permission?: string;\n /** Short chip label above the composer (like \"Usage\"); omitted = shown on the welcome only. */\n label?: string;\n}\n\n/**\n * Product-specific suggested prompts, shown before the shared ones (cloudolive-api#441).\n *\n * The shared list is the same for every product, so a prompt only one product can answer — \"Check my\n * setup\" needs that product's `onboarding_status` tool — would show elsewhere and get a dead-end reply.\n * The product app provides it here instead, like HOME_PRODUCT_SECTIONS on /home.\n */\nexport const BRAIN_CHAT_PRODUCT_PROMPTS = new InjectionToken<BrainChatProductPrompt[]>(\n 'BRAIN_CHAT_PRODUCT_PROMPTS'\n);\n\n/** The product prompts the viewer may see; `canSee` evaluates a permission expression. */\nexport function visibleProductPrompts(\n prompts: readonly BrainChatProductPrompt[] | null | undefined,\n canSee: (permission: string) => boolean\n): BrainChatProductPrompt[] {\n return (prompts ?? []).filter(prompt => !prompt.permission || canSee(prompt.permission));\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Inject,\n Optional,\n Output\n} from '@angular/core';\n\nimport { PermissionService } from '@posiwise/common-services';\n\nimport {\n BRAIN_CHAT_PRODUCT_PROMPTS,\n BrainChatProductPrompt,\n visibleProductPrompts\n} from './pw-brain-chat-product-prompts.token';\nimport { BrainChatQuickAction, QUICK_ACTIONS } from './pw-brain-chat-prompts';\n\n/**\n * Quick-action chips above the composer: the product's own chips (e.g. \"Setup\", cloudolive-api#441)\n * the viewer may see, then the shared Usage / Tools / Status. Emits the prompt text; the parent sends it.\n */\n@Component({\n selector: 'pw-brain-chat-quick',\n template: `\n <div class=\"pw-brain-chat__quick\">\n @for (q of actions; track q.text) {\n <button type=\"button\" class=\"pw-brain-chat__chip\" (click)=\"pick.emit(q.text)\">\n <i class=\"fas\" [ngClass]=\"q.icon\" aria-hidden=\"true\"></i>{{ q.label }}\n </button>\n }\n </div>\n `,\n styleUrls: ['./pw-brain-chat-canvas.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class PwBrainChatQuickComponent {\n @Output() pick = new EventEmitter<string>();\n readonly actions: readonly BrainChatQuickAction[];\n\n constructor(\n permission: PermissionService,\n @Optional()\n @Inject(BRAIN_CHAT_PRODUCT_PROMPTS)\n productPrompts?: BrainChatProductPrompt[] | null\n ) {\n const own = visibleProductPrompts(productPrompts, p => permission.evaluatePermissions(p))\n .filter(prompt => prompt.label)\n .map(({ label, text, icon }) => ({ label: label as string, text, icon }));\n this.actions = [...own, ...QUICK_ACTIONS];\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Inject,\n Input,\n Optional,\n Output\n} from '@angular/core';\n\nimport { PermissionService } from '@posiwise/common-services';\n\nimport {\n BRAIN_CHAT_PRODUCT_PROMPTS,\n BrainChatProductPrompt,\n visibleProductPrompts\n} from './pw-brain-chat-product-prompts.token';\nimport { BrainChatPrompt } from './pw-brain-chat-prompts';\n\n/**\n * First-open welcome state for the Brain chat — greeting + suggested-prompt\n * rows. Extracted from the parent template so `pw-brain-chat.component.html`\n * stays under the C1 200-line cap. Emits the picked prompt text; the parent\n * owns send().\n */\n@Component({\n selector: 'pw-brain-chat-welcome',\n templateUrl: './pw-brain-chat-welcome.component.html',\n styleUrls: ['./pw-brain-chat-canvas.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class PwBrainChatWelcomeComponent {\n /** Signed-in user's first name; when set the greeting reads \"Hi {name},\". */\n @Input() userFirstName?: string;\n @Input() prompts: readonly BrainChatPrompt[] = [];\n @Output() pick = new EventEmitter<string>();\n\n constructor(\n private readonly permission: PermissionService,\n @Optional()\n @Inject(BRAIN_CHAT_PRODUCT_PROMPTS)\n private readonly productPrompts?: BrainChatProductPrompt[] | null\n ) {}\n\n /** The product's own prompts the viewer may see, then the shared ones. */\n get visiblePrompts(): readonly BrainChatPrompt[] {\n const own = visibleProductPrompts(this.productPrompts, p =>\n this.permission.evaluatePermissions(p)\n );\n return [...own.map(({ text, icon }) => ({ text, icon })), ...this.prompts];\n }\n}\n","<div class=\"pw-brain-chat__welcome\">\n <span class=\"pw-brain-chat__hero\" aria-hidden=\"true\"><i class=\"fas fa-brain\"></i></span>\n <div>\n <div class=\"pw-brain-chat__greet-h\">Hi{{ userFirstName ? ' ' + userFirstName : '' }}, how can I help?</div>\n <p class=\"pw-brain-chat__greet-sub\">Ask about your subscriptions, data, and integrations — tell me what to do, or something to remember.</p>\n </div>\n <div class=\"pw-brain-chat__suggest-lab\">Try one</div>\n <div class=\"pw-brain-chat__prompts\">\n @for (p of visiblePrompts; track p.text) {\n <button type=\"button\" class=\"pw-brain-chat__prompt\" (click)=\"pick.emit(p.text)\">\n <span class=\"pw-brain-chat__pic\"><i class=\"fas\" [ngClass]=\"p.icon\" aria-hidden=\"true\"></i></span>\n <span class=\"pw-brain-chat__prompt-text\">{{ p.text }}</span>\n <span class=\"pw-brain-chat__arw\"><i class=\"fas fa-chevron-right\" aria-hidden=\"true\"></i></span>\n </button>\n }\n </div>\n</div>\n","// Sonar voice-overlay — shared primitives (posiwise-frontend#51). Types +\n// geometry + the theme-neutral dial chrome / mono readout. The stateful\n// per-state renderers + rAF orchestration live in the SonarRenderer class\n// (pw-brain-chat-sonar-render.helpers.ts) to keep each file under C1.\n\nexport type SonarState =\n | 'listening'\n | 'processingSpeech'\n | 'thinking'\n | 'fetchingData'\n | 'speaking'\n | 'error';\n\nexport interface SonarColors {\n first: string;\n ink3: string;\n tick: string;\n tickMaj: string;\n idle: string;\n line: string;\n err: string;\n n500: string;\n}\n\nexport const SIZE = 280;\nexport const CX = SIZE / 2;\nexport const CY = SIZE / 2;\nexport const R_TICK = 118;\nexport const R_OUTER = 128;\nexport const R_CORE = 32;\nexport const R_MAX = 112;\n\n// ── transient animation state (owned by SonarRenderer, mutated by the scenes)\nexport interface Ring {\n r: number;\n life: number;\n amp: number;\n}\nexport interface SonarNode {\n a: number;\n r: number;\n lit: number;\n}\nexport interface SonarAnim {\n micLevel: number;\n ringPhase: number;\n rings: Ring[];\n radar: number;\n nodes: SonarNode[];\n}\n\nexport const SONAR_LABELS: Record<SonarState, string> = {\n listening: 'LISTENING',\n processingSpeech: 'CAPTURE',\n thinking: 'ANALYZING',\n fetchingData: 'SCANNING',\n speaking: 'OUTPUT',\n error: 'NO SIGNAL'\n};\n\nexport function makeAnim(): SonarAnim {\n return {\n micLevel: 0.45,\n ringPhase: 0,\n rings: [],\n radar: 0,\n nodes: [\n { a: -1.15, r: 70, lit: 0 },\n { a: 0.35, r: 96, lit: 0 },\n { a: 1.7, r: 60, lit: 0 },\n { a: 2.75, r: 88, lit: 0 },\n { a: -2.5, r: 82, lit: 0 }\n ]\n };\n}\n\n// Accepts #RRGGBB or an rgb()/rgba() string (getComputedStyle resolves CSS vars\n// to rgb) and returns rgba() at the given alpha.\nexport function alpha(color: string, a: number): string {\n const s = (color || '').trim();\n if (s.startsWith('#') && s.length === 7) {\n const r = Number.parseInt(s.slice(1, 3), 16);\n const g = Number.parseInt(s.slice(3, 5), 16);\n const b = Number.parseInt(s.slice(5, 7), 16);\n return `rgba(${r},${g},${b},${a})`;\n }\n const m = /rgba?\\(([^)]+)\\)/.exec(s);\n if (m) {\n const p = m[1].split(',');\n return `rgba(${p[0].trim()},${p[1].trim()},${p[2].trim()},${a})`;\n }\n return s;\n}\n\nexport function ring(ctx: CanvasRenderingContext2D, r: number, stroke: string, w: number): void {\n ctx.beginPath();\n ctx.arc(CX, CY, r, 0, Math.PI * 2);\n ctx.lineWidth = w;\n ctx.strokeStyle = stroke;\n ctx.stroke();\n}\n\n/** The persistent instrument bezel: outer boundary, 72 ticks, guide rings. */\nexport function chrome(ctx: CanvasRenderingContext2D, c: SonarColors): void {\n ring(ctx, R_OUTER, alpha(c.line, 0.9), 1);\n for (let i = 0; i < 72; i++) {\n const ang = (i / 72) * Math.PI * 2 - Math.PI / 2;\n const major = i % 6 === 0;\n const r2 = R_TICK - (major ? 9 : 4.5);\n ctx.beginPath();\n ctx.moveTo(CX + Math.cos(ang) * R_TICK, CY + Math.sin(ang) * R_TICK);\n ctx.lineTo(CX + Math.cos(ang) * r2, CY + Math.sin(ang) * r2);\n ctx.lineWidth = major ? 1.4 : 1;\n ctx.strokeStyle = major ? alpha(c.tickMaj, 0.75) : alpha(c.tick, 0.9);\n ctx.stroke();\n }\n [56, 84].forEach(r => {\n ctx.setLineDash([2, 5]);\n ring(ctx, r, alpha(c.tick, 0.5), 1);\n ctx.setLineDash([]);\n });\n}\n\n/** Centred JetBrains-Mono telemetry line (letter-spaced) below the dial core. */\nexport function readout(ctx: CanvasRenderingContext2D, text: string, col: string): void {\n ctx.font = \"600 10px 'JetBrains Mono',monospace\";\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.fillStyle = alpha(col, 0.9);\n const gap = 1.5;\n let total = 0;\n for (const ch of text) total += ctx.measureText(ch).width + gap;\n let x = CX - total / 2;\n const y = CY + R_TICK - 8;\n for (const ch of text) {\n const w = ctx.measureText(ch).width;\n ctx.fillText(ch, x + w / 2, y);\n x += w + gap;\n }\n ctx.textAlign = 'start';\n}\n","// Sonar voice-overlay — per-state scene renderers (posiwise-frontend#51).\n// Free functions over a mutable SonarAnim so the SonarRenderer class stays a\n// thin dispatcher (C1). Primitives live in pw-brain-chat-sonar.helpers.\n\nimport {\n alpha,\n CX,\n CY,\n R_CORE,\n R_MAX,\n R_TICK,\n readout,\n ring,\n SonarAnim,\n SonarColors\n} from './pw-brain-chat-sonar.helpers';\n\nexport function sceneListening(\n ctx: CanvasRenderingContext2D,\n a: SonarAnim,\n c: SonarColors,\n t: number,\n dt: number\n): void {\n const target =\n 0.5 + 0.42 * Math.sin(t * 2.1) * (0.5 + 0.5 * Math.sin(t * 0.7)) + 0.12 * Math.sin(t * 8.3);\n a.micLevel += (target - a.micLevel) * Math.min(1, dt * 6);\n const lvl = Math.max(0.08, Math.min(1, ((a.micLevel + 1) / 2) * 0.9 + 0.1));\n a.ringPhase += dt * (0.7 + lvl * 2.6);\n if (a.ringPhase >= 1) {\n a.ringPhase -= 1;\n a.rings.push({ r: R_CORE + 4, life: 1, amp: lvl });\n }\n for (let i = a.rings.length - 1; i >= 0; i--) {\n const g = a.rings[i];\n g.r += dt * (60 + g.amp * 70);\n g.life = 1 - (g.r - R_CORE) / (R_MAX - R_CORE);\n if (g.life <= 0 || g.r > R_MAX) {\n a.rings.splice(i, 1);\n continue;\n }\n ring(ctx, g.r, alpha(c.first, g.life * 0.55), 1.5 + g.amp * 1.6);\n }\n ctx.beginPath();\n ctx.arc(CX, CY, R_CORE + 9, -Math.PI / 2, -Math.PI / 2 + Math.PI * 2 * lvl);\n ctx.lineWidth = 3;\n ctx.lineCap = 'round';\n ctx.strokeStyle = alpha(c.first, 0.9);\n ctx.stroke();\n ctx.lineCap = 'butt';\n ring(ctx, R_CORE + 9, alpha(c.idle, 0.4), 3);\n readout(ctx, 'LVL ' + lvl.toFixed(2), c.first);\n}\n\nexport function sceneProcessing(\n ctx: CanvasRenderingContext2D,\n a: SonarAnim,\n c: SonarColors,\n t: number,\n dt: number\n): void {\n a.ringPhase += dt * 2.2;\n if (a.ringPhase >= 1) {\n a.ringPhase -= 1;\n a.rings.push({ r: R_MAX, life: 1, amp: 0.6 });\n }\n for (let i = a.rings.length - 1; i >= 0; i--) {\n const g = a.rings[i];\n g.r -= dt * 70;\n if (g.r <= R_CORE + 4) {\n a.rings.splice(i, 1);\n continue;\n }\n ring(ctx, g.r, alpha(c.first, (1 - (g.r - R_CORE) / (R_MAX - R_CORE)) * 0.5), 1.6);\n }\n const p = 0.5 + 0.5 * Math.sin(t * 6);\n ring(ctx, R_CORE + 7 + p * 3, alpha(c.first, 0.35 + p * 0.35), 2);\n readout(ctx, 'CAPTURE', c.first);\n}\n\nexport function sceneThinking(\n ctx: CanvasRenderingContext2D,\n a: SonarAnim,\n c: SonarColors,\n t: number,\n dt: number\n): void {\n a.radar += dt * 2.2;\n for (let i = 0; i < 44; i++) {\n const a0 = a.radar - (i / 44) * Math.PI * 0.62;\n const a1 = a.radar - ((i + 1) / 44) * Math.PI * 0.62;\n ctx.beginPath();\n ctx.arc(CX, CY, 84, a1, a0);\n ctx.lineWidth = 4;\n ctx.strokeStyle = alpha(c.first, (1 - i / 44) * 0.5);\n ctx.stroke();\n }\n for (let k = 0; k < 3; k++) {\n const ang = t * 1.6 + (k * Math.PI * 2) / 3;\n ctx.beginPath();\n ctx.arc(CX + Math.cos(ang) * 52, CY + Math.sin(ang) * 52, 2.6, 0, Math.PI * 2);\n ctx.fillStyle = alpha(c.first, 0.85);\n ctx.fill();\n }\n readout(ctx, 'ANALYZING', c.first);\n}\n\nexport function sceneFetching(\n ctx: CanvasRenderingContext2D,\n a: SonarAnim,\n c: SonarColors,\n dt: number\n): void {\n a.radar += dt * 1.9;\n const sweep = a.radar % (Math.PI * 2);\n for (let i = 0; i < 40; i++) {\n const a0 = sweep - (i / 40) * Math.PI * 0.5;\n const a1 = sweep - ((i + 1) / 40) * Math.PI * 0.5;\n ctx.beginPath();\n ctx.moveTo(CX, CY);\n ctx.arc(CX, CY, R_TICK, a1, a0);\n ctx.closePath();\n ctx.fillStyle = alpha(c.first, (1 - i / 40) * 0.14);\n ctx.fill();\n }\n let found = 0;\n a.nodes.forEach(nd => {\n let na = nd.a;\n if (na < 0) na += Math.PI * 2;\n const diff = Math.abs(((sweep - na + Math.PI * 3) % (Math.PI * 2)) - Math.PI);\n nd.lit = diff < 0.12 ? 1 : Math.max(0, nd.lit - dt * 0.7);\n const x = CX + Math.cos(nd.a) * nd.r;\n const y = CY + Math.sin(nd.a) * nd.r;\n if (nd.lit > 0.02) {\n ctx.beginPath();\n ctx.moveTo(CX, CY);\n ctx.lineTo(x, y);\n ctx.strokeStyle = alpha(c.first, nd.lit * 0.4);\n ctx.lineWidth = 1;\n ctx.stroke();\n found++;\n }\n ctx.strokeStyle = alpha(nd.lit > 0.3 ? c.first : c.tickMaj, nd.lit > 0.3 ? 0.95 : 0.5);\n ctx.lineWidth = 1.5;\n ctx.strokeRect(x - 3, y - 3, 6, 6);\n });\n readout(ctx, 'SCAN ' + found + '/' + a.nodes.length, c.first);\n}\n\nexport function sceneSpeaking(ctx: CanvasRenderingContext2D, c: SonarColors, t: number): void {\n for (let i = 0; i < 4; i++) {\n const osc = Math.sin(t * 3.2 - i * 0.6);\n ring(ctx, 44 + i * 20 + osc * 7, alpha(c.first, 0.28 + 0.35 * (0.5 + 0.5 * osc)), 2.4);\n }\n ctx.lineCap = 'round';\n for (let i = 0; i < 36; i++) {\n const ang = (i / 36) * Math.PI * 2 - Math.PI / 2;\n const h =\n 8 + (0.5 + 0.5 * Math.sin(t * 5 + i * 0.55)) * 14 * (0.5 + 0.5 * Math.sin(t * 2 + i));\n const r1 = R_CORE + 12;\n ctx.beginPath();\n ctx.moveTo(CX + Math.cos(ang) * r1, CY + Math.sin(ang) * r1);\n ctx.lineTo(CX + Math.cos(ang) * (r1 + h), CY + Math.sin(ang) * (r1 + h));\n ctx.lineWidth = 2;\n ctx.strokeStyle = alpha(c.first, 0.55);\n ctx.stroke();\n }\n ctx.lineCap = 'butt';\n readout(ctx, 'OUTPUT', c.first);\n}\n\nexport function sceneError(ctx: CanvasRenderingContext2D, c: SonarColors, t: number): void {\n const jitter = t ? Math.sin(t * 30) * 0.6 : 0;\n ctx.save();\n ctx.translate(jitter, 0);\n ctx.beginPath();\n ctx.arc(CX, CY, 72, -Math.PI * 0.35, Math.PI * 1.15);\n ctx.lineWidth = 3;\n ctx.strokeStyle = alpha(c.err, 0.85);\n ctx.stroke();\n ctx.setLineDash([4, 6]);\n ring(ctx, 50, alpha(c.n500, 0.6), 1.5);\n ctx.setLineDash([]);\n ctx.restore();\n readout(ctx, 'NO SIGNAL', c.err);\n}\n","// Sonar voice-overlay — stateful renderer (posiwise-frontend#51). Holds the\n// transient animation state (mic level, rings, radar sweep, data nodes) and\n// dispatches one structurally-distinct motion per voice state to the scene\n// renderers in pw-brain-chat-sonar-scenes. Primitives (chrome/readout/ring/\n// geometry) live in pw-brain-chat-sonar.helpers.\n\nimport {\n alpha,\n chrome,\n makeAnim,\n readout,\n ring,\n SIZE,\n SONAR_LABELS,\n SonarAnim,\n SonarColors,\n SonarState\n} from './pw-brain-chat-sonar.helpers';\nimport {\n sceneError,\n sceneFetching,\n sceneListening,\n sceneProcessing,\n sceneSpeaking,\n sceneThinking\n} from './pw-brain-chat-sonar-scenes.helpers';\n\nfunction staticRingRadii(state: SonarState): readonly number[] {\n if (state === 'processingSpeech') return [46, 66, 86];\n if (state === 'speaking') return [44, 64, 84];\n return [52, 74, 96];\n}\n\nexport class SonarRenderer {\n private readonly anim: SonarAnim = makeAnim();\n\n onStateChange(state: SonarState): void {\n this.anim.rings = [];\n if (state === 'fetchingData') this.anim.nodes.forEach(n => (n.lit = 0));\n }\n\n draw(\n ctx: CanvasRenderingContext2D,\n state: SonarState,\n c: SonarColors,\n t: number,\n dt: number\n ): void {\n ctx.clearRect(0, 0, SIZE, SIZE);\n chrome(ctx, c);\n if (state === 'listening') sceneListening(ctx, this.anim, c, t, dt);\n else if (state === 'processingSpeech') sceneProcessing(ctx, this.anim, c, t, dt);\n else if (state === 'thinking') sceneThinking(ctx, this.anim, c, t, dt);\n else if (state === 'fetchingData') sceneFetching(ctx, this.anim, c, dt);\n else if (state === 'speaking') sceneSpeaking(ctx, c, t);\n else if (state === 'error') sceneError(ctx, c, t);\n }\n\n /** Reduced-motion: one representative still frame per state. */\n drawStatic(ctx: CanvasRenderingContext2D, state: SonarState, c: SonarColors): void {\n ctx.clearRect(0, 0, SIZE, SIZE);\n chrome(ctx, c);\n if (state === 'error') {\n sceneError(ctx, c, 0);\n return;\n }\n const a = c.first;\n const rr = staticRingRadii(state);\n rr.forEach((r, i) => ring(ctx, r, alpha(a, 0.5 - i * 0.13), 2));\n readout(ctx, SONAR_LABELS[state], a);\n }\n}\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n ViewChild\n} from '@angular/core';\n\nimport { BrainChatDictation } from './pw-brain-chat-dictation.helpers';\nimport { SonarColors, SonarState } from './pw-brain-chat-sonar.helpers';\nimport { SonarRenderer } from './pw-brain-chat-sonar-render.helpers';\nimport { BrainChatVoiceChat } from './pw-brain-chat-voice-chat.helpers';\n\nconst LOOP: SonarState[] = [\n 'listening',\n 'processingSpeech',\n 'thinking',\n 'fetchingData',\n 'speaking'\n];\nconst STEP_CAP: Record<SonarState, string> = {\n listening: 'Turn · Hear',\n processingSpeech: 'Turn · Capture',\n thinking: 'Turn · Reason',\n fetchingData: 'Turn · Retrieve',\n speaking: 'Turn · Answer',\n error: 'Session interrupted'\n};\n\n/**\n * Sonar voice-session overlay (#51) — a focused takeover over the chat panel\n * that animates the real voice/dictation state machine on an instrument dial.\n * Default change detection: the voice/dictation controllers mutate in place, so\n * the template must re-read them on every parent CD tick. The canvas is driven\n * by its own rAF loop and never needs CD.\n */\n@Component({\n selector: 'pw-brain-chat-voice-overlay',\n templateUrl: './pw-brain-chat-voice-overlay.component.html',\n styleUrls: [\n './pw-brain-chat-voice-overlay.component.scss',\n './pw-brain-chat-voice-overlay-steps.scss'\n ],\n standalone: false\n})\nexport class PwBrainChatVoiceOverlayComponent implements AfterViewInit, OnDestroy {\n @Input() voice: BrainChatVoiceChat | null = null;\n @Input() dictation: BrainChatDictation | null = null;\n @Output() readonly end = new EventEmitter<void>();\n @ViewChild('dial') private readonly dialRef?: ElementRef<HTMLCanvasElement>;\n @ViewChild('endBtn') private readonly endBtnRef?: ElementRef<HTMLButtonElement>;\n\n private ctx: CanvasRenderingContext2D | null = null;\n private raf = 0;\n private last = 0;\n private prevState: SonarState | null = null;\n private colors: SonarColors | null = null;\n private readonly renderer = new SonarRenderer();\n private readonly reduce =\n typeof matchMedia !== 'undefined' && matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n constructor(private readonly host: ElementRef<HTMLElement>) {}\n\n // ── unified state derived from the two controllers ──\n /** The voice controller iff a voice session is live (active or errored). */\n private get activeVoice(): BrainChatVoiceChat | null {\n return this.voice && (this.voice.isActive || !!this.voice.error) ? this.voice : null;\n }\n get isVoice(): boolean {\n return !!this.activeVoice;\n }\n get state(): SonarState {\n const v = this.activeVoice;\n if (v) {\n if (v.error) return 'error';\n const s = v.state;\n return s === 'idle' || s === 'completed' ? 'listening' : (s as SonarState);\n }\n if (this.dictation?.error) return 'error';\n return this.dictation?.phase === 'processing' ? 'processingSpeech' : 'listening';\n }\n get isError(): boolean {\n return this.state === 'error';\n }\n get label(): string {\n const v = this.activeVoice;\n return (v ? v.statusMessage : this.dictation?.statusMessage) || 'Listening…';\n }\n get modeTag(): string {\n if (this.isError) return 'Session interrupted';\n return this.isVoice ? 'Voice session' : 'Dictation';\n }\n get transcript(): string {\n const v = this.activeVoice;\n return v ? v.transcript || '' : '';\n }\n get showTranscript(): boolean {\n const s = this.state;\n return (s === 'thinking' || s === 'fetchingData') && !!this.transcript;\n }\n /** Assistant reply text, streamed live while the audio answer plays. */\n get reply(): string {\n const v = this.activeVoice;\n return v ? v.reply || '' : '';\n }\n get showReply(): boolean {\n return this.state === 'speaking' && !!this.reply;\n }\n get showSteps(): boolean {\n return this.isVoice && !this.isError;\n }\n get stepIndex(): number {\n return LOOP.indexOf(this.state);\n }\n get stepCaption(): string {\n return STEP_CAP[this.state];\n }\n get coreIcon(): string {\n const s = this.state;\n if (s === 'error') return 'fa-microphone-slash';\n if (s === 'thinking' || s === 'fetchingData') return 'fa-brain';\n if (s === 'speaking') return 'fa-volume-high';\n return 'fa-microphone';\n }\n get hint(): string {\n return this.isError\n ? 'Check your browser mic permissions, then retry.'\n : 'Speak naturally — I’m listening.';\n }\n\n ngAfterViewInit(): void {\n const canvas = this.dialRef?.nativeElement;\n if (!canvas) return;\n const dpr = Math.min(2, window.devicePixelRatio || 1);\n canvas.width = 280 * dpr;\n canvas.height = 280 * dpr;\n this.ctx = canvas.getContext('2d');\n if (!this.ctx) return; // no 2d context (e.g. jsdom) — nothing to animate\n this.ctx.scale(dpr, dpr);\n this.colors = this.readColors();\n this.last = performance.now();\n this.raf = requestAnimationFrame(this.frame);\n // Full-panel takeover: move focus to the sole exit so keyboard/AT users\n // aren't stranded on the now-inert composer behind the scrim.\n this.endBtnRef?.nativeElement.focus();\n }\n\n ngOnDestroy(): void {\n cancelAnimationFrame(this.raf);\n }\n\n onEnd(): void {\n this.end.emit();\n }\n\n private readonly frame = (now: number): void => {\n const dt = Math.min(0.05, (now - this.last) / 1000);\n this.last = now;\n const state = this.state;\n const changed = state !== this.prevState;\n if (changed) {\n this.renderer.onStateChange(state);\n this.prevState = state;\n this.colors = this.readColors();\n }\n if (this.ctx && this.colors) {\n if (this.reduce) {\n if (changed) this.renderer.drawStatic(this.ctx, state, this.colors);\n } else {\n this.renderer.draw(this.ctx, state, this.colors, now / 1000, dt);\n }\n }\n this.raf = requestAnimationFrame(this.frame);\n };\n\n /** Read theme-aware colours (the --bc-* tokens inherit from .pw-brain-chat). */\n private readColors(): SonarColors {\n const s = getComputedStyle(this.host.nativeElement);\n const v = (n: string, d: string): string => s.getPropertyValue(n).trim() || d;\n return {\n first: v('--bc-accent', '#1769e1'),\n ink3: v('--bc-ink-3', '#7c8696'),\n tick: v('--bc-line-strong', '#cfd4dc'),\n tickMaj: v('--bc-ink-3', '#7c8696'),\n idle: v('--bc-line-strong', '#cfd4dc'),\n line: v('--bc-line', '#e2e5ea'),\n err: v('--bc-error', '#c0392b'),\n n500: v('--bc-ink-3', '#7c8696')\n };\n }\n}\n","<div\n class=\"pw-vo\"\n [class.pw-vo--err]=\"isError\"\n [attr.aria-live]=\"isError ? 'assertive' : 'polite'\"\n [attr.aria-label]=\"label\"\n>\n <div class=\"pw-vo__panel\">\n <div class=\"pw-vo__head\">\n <span class=\"pw-vo__kicker\">\n <span class=\"pw-vo__live\" [class.pw-vo__live--err]=\"isError\" aria-hidden=\"true\"></span>{{ modeTag }}\n </span>\n </div>\n\n <div class=\"pw-vo__sonar\">\n <canvas #dial class=\"pw-vo__dial\"></canvas>\n <div class=\"pw-vo__core\" aria-hidden=\"true\">\n <i class=\"fas\" [ngClass]=\"coreIcon\" [class.pw-vo__core-i--err]=\"isError\"></i>\n </div>\n </div>\n\n <div class=\"pw-vo__label\" [class.pw-vo__label--err]=\"isError\">{{ label }}</div>\n @if (showTranscript) {\n <div class=\"pw-vo__transcript\">“{{ transcript }}”</div>\n }\n @if (showReply) {\n <div class=\"pw-vo__reply\" aria-live=\"off\">{{ reply }}</div>\n }\n\n @if (showSteps) {\n <div class=\"pw-vo__steps\">\n @for (i of [0, 1, 2, 3, 4]; track i) {\n <div class=\"pw-vo__step\" [class.is-done]=\"i < stepIndex\" [class.is-active]=\"i === stepIndex\">\n <span class=\"pw-vo__dot\"></span>\n @if (i < 4) {\n <span class=\"pw-vo__seg\" [class.is-done]=\"i < stepIndex\"></span>\n }\n </div>\n }\n </div>\n <div class=\"pw-vo__step-cap\">{{ stepCaption }}</div>\n }\n\n <div class=\"pw-vo__actions\">\n <button #endBtn type=\"button\" class=\"pw-vo__end\" [class.pw-vo__end--err]=\"isError\" (click)=\"onEnd()\">\n <i class=\"fas\" [ngClass]=\"isError ? 'fa-xmark' : 'fa-stop'\" aria-hidden=\"true\"></i>\n {{ isError ? 'Close' : 'End session' }}\n </button>\n <span class=\"pw-vo__hint\">{{ hint }}</span>\n </div>\n </div>\n</div>\n","/**\n * Resolve the app-relative paths Brain answers carry into URLs a browser can follow.\n *\n * brain-api publishes documentation with relative `ui_paths` (`/settings/communication`),\n * and deliberately so: the corpus is shared across subscriptions and surfaces, so it\n * cannot bake in a host. The FRONTEND is what knows the host — main-api returns it in\n * the domain metadata every client already fetches, as `links.frontend_link`\n * (`Settings.endpoints.front_end_base_url`; see `domain_metadata_json_helpers#api_links`),\n * which is the same value `auth.service` and `linkedin-confirmation` build URLs from.\n *\n * Passing no `baseUrl` leaves paths relative, which is what the in-app widget needs\n * when it is already served from that origin.\n */\n\n/** A path that addresses a page in this app: leading slash, then a letter. */\nconst APP_PATH_RE = /^\\/[a-zA-Z][a-zA-Z0-9\\-_/]*$/;\n\n/**\n * First path segments that live UNDER the subscription slug in the router\n * (`:slug/faq/:id`, `:slug/crm`, … — dashboard-routing.module.ts). brain-api\n * publishes `/faq/x` because the corpus is shared across subscriptions and\n * cannot know the caller's slug; the frontend holds it, so it is spliced in\n * here. Without this the path is one segment short and matches NO route at all.\n *\n * `message` is deliberately ABSENT: both `/message` and `:slug/message` exist,\n * so prefixing would break the valid unscoped route.\n *\n * This mirrors the router by hand and can drift — the spec pins the list.\n */\nconst SUBSCRIPTION_SCOPED_SEGMENTS: ReadonlySet<string> = new Set([\n 'build',\n 'hyperdashboard',\n 'paas',\n 'crm',\n // CloudOlive's product pages (cloudolive-frontend dashboard-routing.module.ts `:slug/cloudolive`);\n // no unscoped `/cloudolive` route exists, so prefixing cannot break a valid path.\n 'cloudolive',\n // PosiWise Flows (`:slug/flows`, dashboard-routing.module.ts); `/flows` exists only as\n // a sidebar menu constant, never as an unscoped route.\n 'flows',\n 'enterprise',\n 'faq',\n 'documentation'\n]);\n\n/** A bare app path wrapped in a single-backtick code span. */\nconst CODE_SPANNED_PATH_RE = /`(\\/[a-zA-Z][a-zA-Z0-9\\-_/]*)`/g;\n\n/**\n * Drop any trailing slashes from `baseUrl` so joining never yields `host//path`.\n *\n * Deliberately NOT a regex: the obvious `/\\/+$/` has no left anchor, so the\n * engine retries at every offset and backtracks over the run of slashes — O(n^2)\n * on a pathological host string. Walking back from the end is linear.\n */\nfunction trimTrailingSlashes(value: string): string {\n let end = value.length;\n while (end > 0 && value[end - 1] === '/') {\n end -= 1;\n }\n\n return value.slice(0, end);\n}\n\n/**\n * Join `baseUrl` to an app-relative path. Anything that is not an app path (an\n * absolute URL, a mailto:, a fragment) is returned untouched, and an empty\n * `baseUrl` leaves the path relative rather than producing a `//`-prefixed URL.\n */\nexport function absolutiseAppPath(path: string, baseUrl = ''): string {\n if (!baseUrl || !APP_PATH_RE.test(path)) return path;\n\n return `${trimTrailingSlashes(baseUrl)}${path}`;\n}\n\n/**\n * Splice the caller's subscription slug into a path the router scopes under it.\n * A no-op for unscoped paths (`/account/details`, `/settings/communication`)\n * and when no slug is known.\n */\nexport function scopeAppPath(path: string, subscriptionSlug = ''): string {\n if (!subscriptionSlug || !APP_PATH_RE.test(path)) return path;\n const first = path.split('/')[1];\n return SUBSCRIPTION_SCOPED_SEGMENTS.has(first) ? `/${subscriptionSlug}${path}` : path;\n}\n\n/**\n * Full resolution: correct against the index, scope under the subscription,\n * then make absolute. Correction runs FIRST — the index holds unscoped paths,\n * so matching after scoping would never hit.\n */\nexport function resolveAppPath(\n path: string,\n baseUrl = '',\n subscriptionSlug = '',\n known: readonly string[] = []\n): string {\n const corrected = correctKnownPath(path, known);\n\n return absolutiseAppPath(scopeAppPath(corrected, subscriptionSlug), baseUrl);\n}\n\n/**\n * Unwrap a path the model emitted as inline code — `` `/settings/communication` ``.\n *\n * The renderer supports no code spans, so those backticks were rendered literally\n * and, worse, the bare-path linkifier's preceding-character class (`[\\s(,;:]`)\n * excludes a backtick, so the path was never linked at all: the user saw grey\n * code text where a link belonged. Stripping the backticks first lets the normal\n * linkifier see an ordinary bare path.\n */\nexport function unwrapCodeSpannedPaths(raw: string): string {\n return raw.replace(CODE_SPANNED_PATH_RE, '$1');\n}\n\n/**\n * Correct a path the model got *nearly* right, using the navigation index.\n *\n * The summariser writes prose and sometimes authors a plausible-but-wrong URL:\n * `/subscriptions` for a page that actually lives at `/account/subscriptions`\n * (PROD, 2026-09-24 — a 404 presented to the user as a working link).\n *\n * The correction is deliberately narrow. It fires only when EXACTLY ONE known\n * path ends with the candidate, so `/subscriptions` -> `/account/subscriptions`\n * resolves while anything ambiguous is left untouched. An unmatched path is\n * also left untouched rather than suppressed: the index holds MENU entries, so\n * a legitimate deep link (`/faq/can-i-stop-...`) is absent from it, and\n * treating absence as invalid would strip links that work.\n */\nexport function correctKnownPath(path: string, known: readonly string[] = []): string {\n if (!known.length || !APP_PATH_RE.test(path) || known.includes(path)) {\n return path;\n }\n const matches = known.filter(candidate => candidate.endsWith(path));\n\n return matches.length === 1 ? matches[0] : path;\n}\n","/**\n * Minimal markdown-to-HTML renderer for Brain chat assistant bubbles.\n * Handles inline links, bold, italic, newlines, and bare app-relative path\n * auto-linking. All user-supplied text is HTML-escaped before insertion so\n * the output is injection-safe when consumed by DomSanitizer.bypassSecurityTrustHtml.\n *\n * Intentionally small: no full CommonMark parser, no headings, no code\n * fences — only the subset that makes AI responses navigable.\n */\n\nimport { resolveAppPath, unwrapCodeSpannedPaths } from './pw-brain-chat-link-resolve.helpers';\n\n/** Escape the five HTML special characters in a plain-text fragment. */\nfunction escapeHtml(s: string): string {\n return s\n .replaceAll('&', '&amp;')\n .replaceAll('<', '&lt;')\n .replaceAll('>', '&gt;')\n .replaceAll('\"', '&quot;')\n .replaceAll(\"'\", '&#39;');\n}\n\n/** Inline-link regex shared by linkifyBareAppPaths (matchAll) and renderMarkdownCore (LINK_ANCHORED_RE exec). */\nconst LINK_PATTERN = /\\[([^\\]\\n]+)\\]\\(([^()\\n]*(?:\\([^()\\n]*\\)[^()\\n]*)*)\\)/g; // NOSONAR S5852\nconst LINK_ANCHORED_RE = new RegExp('^' + LINK_PATTERN.source);\n\n/** Deny-list of pseudo-schemes blocked in markdown hrefs. Pinned at module scope\n * so the literal strings live on a non-reformatable line — the inline NOSONAR\n * stays put against the SonarQube false-positive flag (defensive use, not eval). */\nconst DENIED_HREF_SCHEMES: readonly string[] = ['javascript:', 'data:']; // NOSONAR S1523\n\n/**\n * Validate and return a safe href, or null to discard a dangerous URL.\n * Allows app-relative paths (/foo/bar) and http/https absolute URLs.\n * Blocks javascript:, data:, protocol-relative (//) and anything else.\n */\nexport function sanitizeMarkdownHref(url: string): string | null {\n const trimmed = url.trim();\n // Decode once so percent-encoded schemes (%6A = j, %2F%2F = //) are caught.\n let decoded: string;\n try {\n decoded = decodeURIComponent(trimmed);\n } catch {\n return null;\n }\n const lower = decoded.toLowerCase();\n if (DENIED_HREF_SCHEMES.some(scheme => lower.startsWith(scheme))) {\n return null;\n }\n if (decoded.startsWith('//') || trimmed.startsWith('//')) {\n return null;\n }\n if (trimmed.startsWith('/') || /^https?:\\/\\//i.test(trimmed)) {\n return trimmed;\n }\n return null;\n}\n\n/**\n * Pre-process a segment of raw text (outside any existing markdown link) and\n * convert bare app-relative paths like /account/details into markdown link\n * syntax [/account/details](/account/details) so the main render loop picks\n * them up as clickable anchors.\n *\n * Matches paths that are preceded by whitespace, certain punctuation, or the\n * start of the string, and that begin with /letter to avoid matching lone\n * slashes, protocol-relative URLs (//), or numeric fractions (1/2).\n */\nfunction substituteBarePaths(\n segment: string,\n baseUrl: string,\n subSlug: string,\n known: readonly string[]\n): string {\n return segment.replace(/(^|[\\s(,;:])\\/([a-zA-Z][a-zA-Z0-9\\-_/]*)/g, (_, pre, rest) => {\n // Hoisted out of the template literal: nesting one inside another is\n // unreadable, and the path is needed twice anyway (label + href).\n const path = `/${rest}`;\n\n return `${pre}[${path}](${resolveAppPath(path, baseUrl, subSlug, known)})`;\n });\n}\n\n/**\n * Auto-link bare app-relative paths in raw markdown text while leaving paths\n * that are already inside a markdown link's URL segment ([text](url)) untouched.\n */\nexport function linkifyBareAppPaths(\n raw: string,\n baseUrl = '',\n subSlug = '',\n known: readonly string[] = []\n): string {\n const src = unwrapCodeSpannedPaths(raw);\n let result = '';\n let lastIndex = 0;\n\n for (const match of src.matchAll(LINK_PATTERN)) {\n result += substituteBarePaths(src.slice(lastIndex, match.index), baseUrl, subSlug, known);\n // An href the model already wrote as a markdown link still needs the host.\n result += `[${match[1]}](${resolveAppPath(match[2], baseUrl, subSlug, known)})`;\n lastIndex = (match.index ?? 0) + match[0].length;\n }\n\n result += substituteBarePaths(src.slice(lastIndex), baseUrl, subSlug, known);\n return result;\n}\n\n/**\n * Convert a subset of Markdown to an HTML string safe for innerHTML.\n * Processes characters sequentially so patterns never interfere with\n * each other and unmatched delimiters fall through as literal text.\n *\n * Supported:\n * [text](url) → <a href=\"url\">text</a> (external: target=_blank)\n * **text** → <strong>text</strong>\n * *text* → <em>text</em>\n * \\n → <br>\n * /path → <a href=\"/path\">/path</a> (bare app-relative paths)\n */\nexport function renderMarkdown(\n raw: string,\n baseUrl = '',\n subSlug = '',\n known: readonly string[] = []\n): string {\n return renderMarkdownCore(linkifyBareAppPaths(raw, baseUrl, subSlug, known));\n}\n\ntype TokenMatch = { html: string; consumed: number } | null;\n\nfunction tryLink(raw: string, i: number): TokenMatch {\n if (raw[i] !== '[') return null;\n const m = LINK_ANCHORED_RE.exec(raw.slice(i));\n if (!m) return null;\n const text = escapeHtml(m[1]);\n const href = sanitizeMarkdownHref(m[2]);\n if (href === null) return { html: text, consumed: m[0].length };\n const external = /^https?:\\/\\//i.test(href);\n const attrs = external ? ' target=\"_blank\" rel=\"noopener noreferrer\"' : '';\n return { html: `<a href=\"${escapeHtml(href)}\"${attrs}>${text}</a>`, consumed: m[0].length };\n}\n\nfunction tryBold(raw: string, i: number): TokenMatch {\n if (raw[i] !== '*' || raw[i + 1] !== '*') return null;\n const m = /^\\*\\*([^*\\n]+)\\*\\*/.exec(raw.slice(i));\n return m ? { html: `<strong>${escapeHtml(m[1])}</strong>`, consumed: m[0].length } : null;\n}\n\nfunction tryItalic(raw: string, i: number): TokenMatch {\n if (raw[i] !== '*' || raw[i + 1] === '*') return null;\n const m = /^\\*([^*\\n]+)\\*/.exec(raw.slice(i));\n return m ? { html: `<em>${escapeHtml(m[1])}</em>`, consumed: m[0].length } : null;\n}\n\nconst TOKEN_HANDLERS = [tryLink, tryBold, tryItalic];\n\nfunction matchToken(raw: string, i: number): TokenMatch {\n for (const handler of TOKEN_HANDLERS) {\n const result = handler(raw, i);\n if (result) return result;\n }\n return null;\n}\n\nfunction renderMarkdownCore(raw: string): string {\n let out = '';\n let buf = '';\n let i = 0;\n const flushBuf = (): void => {\n if (buf) {\n out += escapeHtml(buf);\n buf = '';\n }\n };\n while (i < raw.length) {\n const ch = raw[i];\n if (ch === '\\r') {\n i++;\n continue;\n }\n if (ch === '\\n') {\n flushBuf();\n out += '<br>';\n i++;\n continue;\n }\n const match = matchToken(raw, i);\n if (match) {\n flushBuf();\n out += match.html;\n i += match.consumed;\n } else {\n buf += ch;\n i++;\n }\n }\n flushBuf();\n return out;\n}\n","import { OnDestroy, Pipe, PipeTransform } from '@angular/core';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport { NavigationIndexService, PermissionService } from '@posiwise/common-services';\n\nimport { Subscription } from 'rxjs';\n\nimport { renderMarkdown } from './pw-brain-chat-markdown.helpers';\n\n/**\n * Converts a Brain assistant message string (containing a safe subset of\n * Markdown) into an HTML string suitable for `[innerHTML]` binding.\n *\n * Deliberately returns a plain `string`, NOT a `SafeHtml`: Angular sanitizes any\n * string bound to `[innerHTML]`, so the output passes through DomSanitizer on\n * the way to the DOM. `renderMarkdown` already HTML-escapes every user-sourced\n * fragment and allow-lists hrefs, which makes this defence in depth rather than\n * a substitute — two independent passes, neither trusting the other.\n *\n * Nothing is lost by it. The renderer only emits `<a href target rel>`,\n * `<strong>`, `<em>` and `<br>`; Angular's own allow-lists carry `href`\n * (URI_ATTRS) and `rel`/`target` (HTML_ATTRS), so sanitized output is\n * byte-identical to the rendered input. An earlier revision reached for\n * `bypassSecurityTrustHtml` here, which bought nothing and disabled the\n * platform's last line of defence if the renderer ever regressed.\n *\n * Applied only to assistant bubbles; user bubbles keep plain-text rendering.\n *\n * The app-relative paths Brain answers carry (`/settings/communication`) are\n * resolved against `links.frontend_link` from the domain metadata — the same\n * host `auth.service` and `linkedin-confirmation` build their URLs from.\n * `links` lives on the CONFIG object, not on the service, and the service's\n * only public accessor is `appConfig$`, so the latest value is cached here;\n * config resolves at app boot, long before a chat bubble renders.\n */\n@Pipe({ name: 'safeMarkdown' })\nexport class SafeMarkdownPipe implements PipeTransform, OnDestroy {\n private baseUrl = '';\n\n private readonly configSub: Subscription;\n\n constructor(\n private readonly navigationIndex: NavigationIndexService,\n appConfigService: AppConfigService\n ) {\n this.configSub = appConfigService.appConfig$.subscribe(config => {\n this.baseUrl = config?.links?.frontend_link ?? '';\n });\n }\n\n ngOnDestroy(): void {\n this.configSub.unsubscribe();\n }\n\n transform(text: string): string {\n return renderMarkdown(text ?? '', this.baseUrl, this.subscriptionSlug(), this.knownPaths());\n }\n\n /**\n * Every page the palette can reach, used to correct a path the model got\n * nearly right. An unknown path is left alone, never suppressed.\n */\n private knownPaths(): string[] {\n try {\n return this.navigationIndex.entries().map(entry => entry.path);\n } catch {\n return [];\n }\n }\n\n /**\n * Slug the router scopes dashboard pages under (`:slug/faq/:id`). Read per\n * call rather than cached: the user can switch subscription mid-session.\n */\n private subscriptionSlug(): string {\n return PermissionService.selectedSubscription?.slug ?? '';\n }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Inject,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport { AppState } from '@posiwise/app-store';\nimport {\n BaseHttpService,\n BrainSocketService,\n BrainVoiceService,\n DirectUploadService,\n LocalStorage,\n MCPExecuteResponse,\n MCPOrchestratorService,\n MCPStreamEvent,\n PermissionService,\n VoiceChatService\n} from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\n\nimport { Subject, Subscription } from 'rxjs';\nimport { filter, map, take, takeUntil } from 'rxjs/operators';\n\nimport { Store } from '@ngrx/store';\n\nimport { resolveBrandName } from '../collapsible-sidebar/collapsible-sidebar-brand.helpers';\nimport { DynamicPageContextService } from '../dynamic-page/dynamic-page-context.service';\n\nimport { ChatAttachment, ChatMessage } from './pw-brain-chat.types';\nimport { BrainChatAttachment } from './pw-brain-chat-attachment.controller';\nimport { buildConfirmationMessage } from './pw-brain-chat-confirmation.helpers';\nimport { buildWorkspaceContext } from './pw-brain-chat-context.helpers';\nimport { BrainChatDictation } from './pw-brain-chat-dictation.helpers';\nimport { diffRowsFrom } from './pw-brain-chat-diff.helpers';\nimport { dispatchNavigation, resolveNavigation } from './pw-brain-chat-navigation.helpers';\nimport { BrainChatPersistence } from './pw-brain-chat-persistence.helpers';\nimport { GREETING, SUGGESTED_PROMPTS } from './pw-brain-chat-prompts';\nimport { stickThreadToBottom } from './pw-brain-chat-scroll.helpers';\nimport { BRAIN_CHAT_UPLOAD_APIS } from './pw-brain-chat-upload.token';\nimport { BrainChatVoiceChat } from './pw-brain-chat-voice-chat.helpers';\n\nexport type { ChatMessage, ChatMessageRole, PendingConfirmation } from './pw-brain-chat.types';\n\n// Brain chat panel — posts to brain-api's MCP orchestrator; thread +\n// conversation_id persist per-user in localStorage (#4167).\n@Component({\n selector: 'pw-brain-chat',\n templateUrl: './pw-brain-chat.component.html',\n styleUrls: [\n './pw-brain-chat.component.scss',\n './pw-brain-chat-canvas.scss',\n './pw-brain-chat-content.scss',\n './pw-brain-chat-compose.scss',\n './pw-brain-chat-attachment.scss',\n './pw-brain-chat-voice.scss'\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class PwBrainChatComponent implements OnInit, OnDestroy {\n messages: ChatMessage[] = [];\n draft = '';\n loading = false;\n streamingStage: string | null = null;\n // Live SSE prose accumulator (#51) — partial bubble + caret (ChatGPT-style).\n streamingProse: string | null = null;\n brandName = 'PosiWise';\n userFirstName?: string;\n readonly suggestedPrompts = SUGGESTED_PROMPTS;\n private conversationId: string | null = null;\n private storage: BrainChatPersistence | null = null;\n private streamSub?: Subscription; // held so cancelRequest() can abort the in-flight stream\n private readonly destroy$ = new Subject<void>();\n readonly diffRows = diffRowsFrom;\n readonly dictation: BrainChatDictation; // mic-to-text (#22)\n readonly voiceChat: BrainChatVoiceChat; // full-duplex voice (#58)\n readonly attachment: BrainChatAttachment; // composer file drop\n private sentAttachment: ChatAttachment | null = null; // file on the in-flight send\n @ViewChild('thread') private readonly threadRef?: ElementRef<HTMLElement>;\n\n constructor(\n private readonly orchestrator: MCPOrchestratorService,\n private readonly localStorage: LocalStorage,\n private readonly router: Router,\n private readonly cdr: ChangeDetectorRef,\n private readonly store: Store<AppState>,\n private readonly dynamicPageCtx: DynamicPageContextService,\n @Optional() private readonly appConfigService?: AppConfigService,\n @Optional() private readonly brainSocket?: BrainSocketService,\n @Optional() private readonly brainVoice?: BrainVoiceService,\n @Optional() private readonly voiceChatService?: VoiceChatService,\n @Optional() private readonly directUpload?: DirectUploadService,\n @Optional()\n @Inject(BRAIN_CHAT_UPLOAD_APIS)\n private readonly uploadApis?: Record<string, BaseHttpService>\n ) {\n this.dictation = new BrainChatDictation(\n this.brainVoice,\n () => this.draft,\n text => {\n this.draft = text;\n },\n () => this.cdr.markForCheck()\n );\n this.voiceChat = new BrainChatVoiceChat(\n this.voiceChatService,\n () => this.cdr.markForCheck(),\n (userText, replyText) => this.recordVoiceTurn(userText, replyText)\n );\n this.attachment = new BrainChatAttachment(\n this.directUpload ?? null,\n this.uploadApis ?? null,\n () => PermissionService.selectedSubscription?.id ?? null,\n () => this.cdr.markForCheck()\n );\n }\n\n ngOnInit(): void {\n // What may be attached is discovered from the federated tool catalog,\n // not configured here — see BRAIN_CHAT_UPLOAD_APIS. Best-effort: a\n // failure simply leaves the panel with no upload affordance.\n this.attachment.discover(this.orchestrator.capabilities(), this.destroy$);\n\n // Personalise the welcome greeting with the signed-in user's first name\n // (AuthService persists it to native localStorage 'name' at login);\n // absent/blank → the greeting stays the plain \"Hi, I'm your … Brain\".\n this.userFirstName = localStorage.getItem('name')?.trim() || undefined;\n\n // White-label brand for placeholder + error text (domain company.name).\n this.appConfigService?.appConfig$.pipe(take(1), takeUntil(this.destroy$)).subscribe(c => {\n this.brandName = resolveBrandName(c);\n this.cdr.markForCheck();\n });\n\n // Probe voice-api reachability once — hides the Voice Chat button in\n // envs that haven't onboarded (Phase 5 wires the Vault key + ingress).\n void this.voiceChat.resolveAvailability();\n\n // Wait for the authenticated user before hydrating — a bare take(1)\n // races currentUser=null and orphans the thread (#4167).\n this.store\n .pipe(\n map(app => app?.user?.currentUser ?? null),\n filter((user): user is User => !!user && user.id != null),\n take(1),\n takeUntil(this.destroy$)\n )\n .subscribe(user => {\n this.storage = new BrainChatPersistence(this.localStorage, String(user.id));\n const hydrated = this.storage.readMessages();\n this.messages = hydrated.length\n ? hydrated.map(m => ({\n role: m.role,\n text: m.text,\n markdownEnabled: m.markdownEnabled,\n at: m.at\n }))\n : [];\n if (!hydrated.length) {\n this.pushAssistant(GREETING);\n }\n this.conversationId = this.storage.adoptConversationId();\n this.cdr.markForCheck();\n this.stick(true);\n this.subscribeToServerPush();\n });\n }\n\n // Server→client push (#45): render each pushed message as an assistant bubble.\n private subscribeToServerPush(): void {\n this.brainSocket\n ?.messages$()\n .pipe(takeUntil(this.destroy$))\n .subscribe(message => {\n this.pushAssistant(message.text, true);\n this.cdr.markForCheck();\n });\n }\n\n ngOnDestroy(): void {\n this.dictation.dispose();\n this.voiceChat.dispose();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * Paperclip path. The input is reset after every pick so choosing the same\n * file twice in a row still fires `change` (the browser suppresses it\n * otherwise, and \"nothing happened\" is a maddening bug to hit).\n */\n pickFile(input: HTMLInputElement): void {\n const file = input.files?.[0];\n input.value = '';\n if (file) {\n this.attachment.accept(file);\n }\n }\n\n /**\n * The composer teaches the affordance: with a file staged, the next thing\n * to do is send it, with or without a message. Leaving the generic prompt\n * there left people looking for an upload button that does not exist.\n */\n get composerPlaceholder(): string {\n if (this.attachment.busy) {\n return 'Uploading your file…';\n }\n if (this.attachment.choosing) {\n return 'Pick an action for the file';\n }\n return this.attachment.ready\n ? 'Add a message, or just send'\n : 'Ask a question or tell me what to do…';\n }\n\n send(): void {\n // A dropped file is a message on its own — the user should not have to\n // type something to send it. An upload still in flight blocks the send\n // rather than racing it, so the staged key is always present. A file\n // still waiting for \"which tool?\" blocks it too — sending would drop it.\n const typed = this.draft.trim();\n const staged = this.attachment.current;\n const held = this.attachment.busy || this.attachment.choosing;\n if ((!typed && !this.attachment.ready) || this.loading || held) {\n return;\n }\n const text = typed || `${staged?.title ?? 'Use this file'}: ${staged?.name ?? ''}`;\n this.draft = '';\n this.messages.push({ role: 'user', text, at: Date.now() });\n this.storage?.persistMessages(this.messages);\n this.loading = true;\n this.cdr.markForCheck();\n this.stick(true);\n\n const workspace_context = {\n ...buildWorkspaceContext(\n this.router,\n this.dynamicPageCtx.current,\n PermissionService.selectedSubscription?.id ?? null\n ),\n // Only the staging key and filename — never the bytes, and nothing\n // read out of the file. Null when nothing is attached.\n ...this.attachment.context\n };\n // The file stays attached until a planned call uses it, so a reply that\n // asks for missing details (vendor, due date…) still carries it.\n this.sentAttachment = staged;\n this.streamSub = this.orchestrator\n .executeStream({\n message: text,\n workspace_context,\n conversation_id: this.conversationId ?? undefined\n })\n .pipe(takeUntil(this.destroy$))\n .subscribe({\n next: (event: MCPStreamEvent) => {\n if (event.type === 'stage') {\n this.streamingStage = event.message ?? event.stage ?? null;\n this.cdr.markForCheck();\n } else if (event.type === 'prose' && event.text) {\n // First chunk clears the stage label; chunks append.\n this.streamingStage = null;\n this.streamingProse = (this.streamingProse ?? '') + event.text;\n this.cdr.markForCheck();\n } else if (event.type === 'result' && event.response) {\n this.handleExecuteResponse(event.response);\n } else if (event.type === 'error') {\n this.handleError(event);\n }\n },\n error: err => this.handleError(err),\n // Safety net (AI54): completed with no terminal frame → fail.\n complete: () => {\n if (this.loading) {\n this.handleError(\n new Error(`${this.brandName} Assistant did not return a response.`)\n );\n }\n }\n });\n }\n\n approve(message: ChatMessage): void {\n if (!message.pending || this.loading) {\n return;\n }\n this.loading = true;\n this.cdr.markForCheck();\n const token = message.pending.confirmation_token;\n // Strip pending up front to block double-click; /confirm repopulates it.\n message.pending = undefined;\n message.text = 'Approved — running…';\n this.storage?.persistMessages(this.messages);\n\n this.orchestrator\n .confirm({\n confirmation_token: token,\n conversation_id: this.conversationId ?? undefined\n })\n .pipe(takeUntil(this.destroy$))\n .subscribe({\n next: response => this.handleExecuteResponse(response),\n error: err => this.handleError(err)\n });\n }\n\n cancel(message: ChatMessage): void {\n message.pending = undefined;\n message.text = 'Cancelled — no action was taken.';\n this.storage?.persistMessages(this.messages);\n this.cdr.markForCheck();\n }\n\n // Abort the in-flight request (unsubscribe aborts the fetch) + reset composer.\n cancelRequest(): void {\n if (!this.loading) {\n return;\n }\n this.streamSub?.unsubscribe();\n this.streamSub = undefined;\n this.streamingStage = null;\n this.streamingProse = null;\n this.loading = false;\n this.pushAssistant('Request cancelled.', false);\n this.cdr.markForCheck();\n }\n\n trackByIndex(index: number, _item: ChatMessage): number {\n return index;\n }\n\n // Welcome-prompt / quick-action chip → prefill the draft and send.\n usePrompt(text: string): void {\n if (this.loading) {\n return;\n }\n this.draft = text;\n this.send();\n }\n\n // Start a fresh thread — clears messages + conversation, re-greets.\n newChat(): void {\n if (this.loading) {\n return;\n }\n this.messages = [];\n this.conversationId = null;\n this.storage?.setConversationId('');\n this.pushAssistant(GREETING);\n this.cdr.markForCheck();\n this.stick(true);\n }\n\n private handleExecuteResponse(response: MCPExecuteResponse): void {\n this.streamingStage = null;\n this.streamingProse = null;\n this.persistConversationId(response.conversation_id);\n // ONLY on a real success. A confirmation card means the tool has not run\n // yet: clearing there lost the file the moment you approved, so a call\n // that then failed (wrong vendor, say) left your follow-up answer with\n // no file attached -- and the planner, seeing no upload context, routed\n // the reply to an unrelated tool.\n if (response.result_status === 'success') {\n this.attachment.clearIfConsumed(this.sentAttachment);\n }\n if (response.needs_confirmation && response.confirmation_token) {\n this.messages.push(buildConfirmationMessage(response, response.confirmation_token));\n this.stick(false);\n } else if (response.result_status === 'success') {\n this.applySuccessResult(response);\n } else {\n this.pushAssistant(response.reason ?? 'I could not complete that request.');\n }\n this.storage?.persistMessages(this.messages);\n this.loading = false;\n this.cdr.markForCheck();\n }\n\n private applySuccessResult(response: MCPExecuteResponse): void {\n const handled = dispatchNavigation(resolveNavigation(response.tool_result), {\n pushAssistant: (text, markdownEnabled) => this.pushAssistant(text, markdownEnabled),\n navigateByUrl: url => this.router.navigateByUrl(url),\n assignExternal: url => window.location.assign(url)\n });\n if (handled) {\n return;\n }\n this.pushAssistant(\n response.response ?? JSON.stringify(response.tool_result ?? {}, null, 2)\n );\n // Page-aware grounding: when the answer came from this page's docs, tag\n // the just-pushed bubble so it renders a \"Documented on:\" provenance chip.\n const sourcePage = response.grounded_source_page?.trim();\n const lastMessage = this.messages.at(-1);\n if (sourcePage && lastMessage) {\n lastMessage.sourcePage = sourcePage;\n this.storage?.persistMessages(this.messages);\n }\n }\n\n private handleError(err: unknown): void {\n this.streamingStage = null;\n this.streamingProse = null;\n const e = (err ?? {}) as {\n error?: { detail?: string; message?: string };\n message?: string;\n };\n const message =\n e.error?.message ??\n e.error?.detail ??\n e.message ??\n `${this.brandName} Assistant request failed.`;\n this.pushAssistant(message, false);\n this.loading = false;\n this.cdr.markForCheck();\n }\n\n private persistConversationId(id?: string | null): void {\n if (!id || id === this.conversationId) {\n return;\n }\n this.conversationId = id;\n this.storage?.setConversationId(id);\n }\n\n private pushAssistant(text: string, markdownEnabled = true): void {\n this.messages.push({ role: 'assistant', text, markdownEnabled, at: Date.now() });\n this.storage?.persistMessages(this.messages);\n this.stick(false);\n }\n\n /** Voice session turn completed — record the spoken exchange in the thread\n * so the conversation survives the overlay (plain text: it was speech). */\n private recordVoiceTurn(userText: string, replyText: string): void {\n if (userText) this.messages.push({ role: 'user', text: userText, at: Date.now() });\n if (replyText) this.pushAssistant(replyText, false);\n else this.storage?.persistMessages(this.messages);\n this.cdr.markForCheck();\n }\n\n private stick(force: boolean): void {\n stickThreadToBottom(() => this.threadRef?.nativeElement, force);\n }\n}\n","<div\n class=\"pw-brain-chat\"\n (dragenter)=\"attachment.dragEnter($event)\"\n (dragover)=\"attachment.dragOver($event)\"\n (dragleave)=\"attachment.dragLeave($event)\"\n (drop)=\"attachment.drop($event)\"\n>\n @if (attachment.dragActive) {\n <div class=\"pw-brain-chat__dropzone\" aria-hidden=\"true\">\n <div class=\"pw-brain-chat__dropzone-frame\">\n <i class=\"fas fa-file-arrow-up pw-brain-chat__dropzone-icon\" aria-hidden=\"true\"></i>\n <span class=\"pw-brain-chat__dropzone-title\">{{ attachment.label }}</span>\n <span class=\"pw-brain-chat__dropzone-hint\">{{ attachment.hint }}</span>\n </div>\n </div>\n }\n <!-- The sidebar host header owns title + close + live status + New chat\n (SidebarContent.status / headerActions) — so the panel body starts at\n the thread, no duplicate status strip. newChat() is invoked from the\n host header action. -->\n <div #thread pwBrainChatThread class=\"pw-brain-chat__thread\" role=\"log\" aria-live=\"polite\">\n @if (messages.length <= 1 && !loading && !streamingProse) {\n <pw-brain-chat-welcome\n [userFirstName]=\"userFirstName\"\n [prompts]=\"suggestedPrompts\"\n (pick)=\"usePrompt($event)\"\n ></pw-brain-chat-welcome>\n } @else {\n @for (m of messages; track trackByIndex($index, m)) {\n @if (m.role === 'user') {\n <div class=\"pw-brain-chat__turn pw-brain-chat__turn--user\">\n <div class=\"pw-brain-chat__user-bubble\"><pre class=\"pw-brain-chat__user-text\">{{ m.text }}</pre></div>\n @if (m.at) {\n <span class=\"pw-brain-chat__time\">{{ m.at | date: 'shortTime' }}</span>\n }\n </div>\n } @else {\n <div class=\"pw-brain-chat__turn pw-brain-chat__turn--bot\">\n <div class=\"pw-brain-chat__spine\" aria-hidden=\"true\">\n <span class=\"pw-brain-chat__node\"><i class=\"fas fa-brain\"></i></span>\n <span class=\"pw-brain-chat__line\"></span>\n </div>\n <div class=\"pw-brain-chat__artifacts\">\n <span class=\"pw-brain-chat__who\">\n {{ brandName }} Brain\n @if (m.at) {\n <span class=\"pw-brain-chat__time\">· {{ m.at | date: 'shortTime' }}</span>\n }\n </span>\n <div class=\"pw-brain-chat__bubble\">\n @if (m.markdownEnabled) {\n <div class=\"pw-brain-chat__text\" [innerHTML]=\"m.text | safeMarkdown\"></div>\n } @else {\n <pre class=\"pw-brain-chat__text\">{{ m.text }}</pre>\n }\n </div>\n @if (m.sourcePage) {\n <div class=\"pw-brain-chat__source\" role=\"note\">\n <i class=\"fas fa-file-lines pw-brain-chat__source-icon\" aria-hidden=\"true\"></i>\n <span class=\"pw-brain-chat__source-text\">Documented on: {{ m.sourcePage }}</span>\n </div>\n }\n @if (m.pending) {\n <pw-brain-chat-confirm\n [pending]=\"m.pending\"\n [loading]=\"loading\"\n (approveEvent)=\"approve(m)\"\n (cancelEvent)=\"cancel(m)\"\n ></pw-brain-chat-confirm>\n }\n </div>\n </div>\n }\n }\n }\n\n @if (loading && streamingProse) {\n <!-- prose streams token-by-token into a partial bot turn; caret = writing (#51) -->\n <div class=\"pw-brain-chat__turn pw-brain-chat__turn--bot\">\n <div class=\"pw-brain-chat__spine\" aria-hidden=\"true\">\n <span class=\"pw-brain-chat__node\"><i class=\"fas fa-brain\"></i></span>\n <span class=\"pw-brain-chat__line\"></span>\n </div>\n <div class=\"pw-brain-chat__artifacts\">\n <span class=\"pw-brain-chat__who\">{{ brandName }} Brain</span>\n <div class=\"pw-brain-chat__bubble\">\n <pre class=\"pw-brain-chat__text\"\n >{{ streamingProse }}<span class=\"pw-brain-chat__caret\" aria-hidden=\"true\"></span></pre>\n </div>\n </div>\n </div>\n }\n </div>\n\n @if (loading && !streamingProse) {\n <div class=\"pw-brain-chat__loading\">\n <i class=\"fas fa-circle-notch fa-spin pw-brain-chat__loading-spinner\" aria-hidden=\"true\"></i>\n <span aria-live=\"polite\">{{ streamingStage || 'Working…' }}</span>\n <button type=\"button\" class=\"pw-brain-chat__iconbtn pw-brain-chat__stop\" (click)=\"cancelRequest()\"\n [ngbTooltip]=\"'Stop request'\" container=\"body\" aria-label=\"Stop request\">\n <i class=\"fas fa-stop\" aria-hidden=\"true\"></i>\n </button>\n </div>\n }\n\n <!-- Voice session / dictation → animated Sonar overlay (#51) -->\n @if (voiceChat.isActive || voiceChat.error || dictation.phase === 'listening' || dictation.phase === 'processing' || dictation.error) {\n <pw-brain-chat-voice-overlay\n [voice]=\"voiceChat\"\n [dictation]=\"dictation\"\n (end)=\"voiceChat.isActive || voiceChat.error ? voiceChat.stop() : dictation.dismiss()\"\n ></pw-brain-chat-voice-overlay>\n }\n\n <div class=\"pw-brain-chat__compose\">\n @if (messages.length > 1) {\n <pw-brain-chat-quick (pick)=\"usePrompt($event)\"></pw-brain-chat-quick>\n }\n <label class=\"visually-hidden\" for=\"pw-brain-chat-input\">Message {{ brandName }} Brain</label>\n <div class=\"pw-brain-chat__field\">\n @if (attachment.current; as file) {\n <div\n class=\"pw-brain-chat__attachment\"\n [class.pw-brain-chat__attachment--error]=\"file.status === 'error'\"\n [style.--pw-upload-progress]=\"file.percent + '%'\"\n >\n <span class=\"pw-brain-chat__attachment-icon\">\n <i class=\"fas\" [ngClass]=\"attachment.icon()\" aria-hidden=\"true\"></i>\n </span>\n <span class=\"pw-brain-chat__attachment-body\">\n <span class=\"pw-brain-chat__attachment-name\" [title]=\"file.name\">{{ file.name }}</span>\n <output class=\"pw-brain-chat__attachment-meta\" aria-live=\"polite\">{{ attachment.meta() }}</output>\n </span>\n <button\n type=\"button\"\n class=\"pw-brain-chat__iconbtn\"\n (click)=\"attachment.remove()\"\n ngbTooltip=\"Remove file\"\n container=\"body\"\n aria-label=\"Remove attached file\"\n ><i class=\"fas fa-xmark\" aria-hidden=\"true\"></i></button>\n @if (file.status === 'uploading') {\n <span class=\"pw-brain-chat__attachment-progress\"></span>\n }\n </div>\n @if (attachment.choosing) {\n <fieldset class=\"pw-brain-chat__choice\" aria-label=\"What should I do with this file?\">\n <span class=\"pw-brain-chat__choice-prompt\">What should I do with this file?</span>\n <div class=\"pw-brain-chat__choice-options\">\n @for (option of attachment.choices; track option.tool) {\n <button\n type=\"button\"\n class=\"pw-brain-chat__chip\"\n (click)=\"attachment.choose(option)\"\n >{{ attachment.choiceLabel(option) }}</button>\n }\n </div>\n </fieldset>\n }\n }\n <div class=\"pw-brain-chat__field-row\">\n <textarea\n id=\"pw-brain-chat-input\"\n class=\"pw-brain-chat__input\"\n rows=\"1\"\n [(ngModel)]=\"draft\"\n [placeholder]=\"composerPlaceholder\"\n (keydown.enter)=\"$event.preventDefault(); send()\"\n [attr.aria-label]=\"composerPlaceholder\"\n ></textarea>\n <div class=\"pw-brain-chat__tools\">\n @if (attachment.enabled) {\n <label for=\"pw-brain-chat-file-input\" class=\"visually-hidden\">Attach file</label>\n <input\n #fileInput\n id=\"pw-brain-chat-file-input\"\n type=\"file\"\n class=\"visually-hidden\"\n [accept]=\"attachment.acceptAttr\"\n (change)=\"pickFile(fileInput)\"\n />\n <button\n type=\"button\"\n class=\"pw-brain-chat__iconbtn\"\n [disabled]=\"loading || attachment.busy\"\n (click)=\"fileInput.click()\"\n ngbTooltip=\"Attach a file\"\n container=\"body\"\n aria-label=\"Attach a file\"\n ><i class=\"fas fa-paperclip\" aria-hidden=\"true\"></i></button>\n }\n <button\n type=\"button\"\n class=\"pw-brain-chat__iconbtn pw-brain-chat__mic\"\n [class.pw-brain-chat__mic--recording]=\"dictation.isRecording\"\n [disabled]=\"loading || dictation.phase === 'processing'\"\n (click)=\"dictation.toggle(loading)\"\n [ngbTooltip]=\"dictation.phase === 'listening' ? 'Stop dictation' : (dictation.phase === 'processing' ? 'Processing…' : 'Dictate')\"\n container=\"body\"\n [attr.aria-label]=\"dictation.phase === 'listening' ? 'Stop dictation' : 'Dictate with your voice'\"\n [attr.aria-pressed]=\"dictation.isRecording\"\n ><i class=\"fas fa-microphone\" aria-hidden=\"true\"></i></button>\n @if (voiceChat.available) {\n <button\n type=\"button\"\n class=\"pw-brain-chat__iconbtn\"\n [disabled]=\"loading || dictation.isRecording\"\n (click)=\"voiceChat.toggle(loading)\"\n [ngbTooltip]=\"voiceChat.isActive ? 'End voice chat' : 'Voice chat'\"\n container=\"body\"\n [attr.aria-label]=\"voiceChat.isActive ? 'End voice chat' : 'Start voice chat'\"\n [attr.aria-pressed]=\"voiceChat.isActive\"\n >\n @switch (voiceChat.visual) {\n @case ('loader') { <i class=\"fas fa-circle-notch fa-spin\" aria-hidden=\"true\"></i> }\n @case ('wave') { <i class=\"fas fa-volume-high\" aria-hidden=\"true\"></i> }\n <!-- fa-waveform-lines (FA Pro, shipped in assets/fontawesome) — the\n canonical \"voice mode\" glyph; fa-comment-dots read as a second\n text-chat button. -->\n @default { <i class=\"fas fa-waveform-lines\" aria-hidden=\"true\"></i> }\n }\n </button>\n }\n <button\n type=\"button\"\n class=\"pw-brain-chat__send\"\n [class.pw-brain-chat__send--stop]=\"loading\"\n [disabled]=\"!loading && ((!draft.trim() && !attachment.ready) || attachment.busy || attachment.choosing)\"\n (click)=\"loading ? cancelRequest() : send()\"\n [ngbTooltip]=\"loading ? 'Stop request' : 'Send message'\"\n container=\"body\"\n [attr.aria-label]=\"loading ? 'Stop request' : 'Send message'\"\n >\n <i class=\"fas\" [ngClass]=\"loading ? 'fa-stop' : 'fa-paper-plane'\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n <div class=\"pw-brain-chat__disclaimer\" role=\"note\">\n <i class=\"fas fa-triangle-exclamation\" aria-hidden=\"true\"></i>\n AI may be inaccurate — verify before acting.\n </div>\n </div>\n</div>\n","import { Component, Input, OnChanges } from '@angular/core';\n\nimport { HelperService } from '@posiwise/helper-service';\n\ninterface MonogramTint {\n bg: string;\n fg: string;\n}\n\n/**\n * Soft, muted tints for the initials-monogram fallback. Deliberately NOT the\n * tenant accent (`--first`) — per the design-system EUREKA constraint the accent\n * is a stateful spotlight only and must never be used to establish identity.\n * A company is mapped to one tint deterministically by name hash, so the same\n * company always renders the same colour.\n */\nconst MONOGRAM_TINTS: MonogramTint[] = [\n { bg: '#E8ECFB', fg: '#3B4FB0' }, // indigo\n { bg: '#E5F3EE', fg: '#1F7A57' }, // teal\n { bg: '#FBEEE0', fg: '#A35B12' }, // amber\n { bg: '#F6E7EE', fg: '#A03A6B' }, // rose\n { bg: '#E6F0F6', fg: '#2A6F90' }, // sky\n { bg: '#EFEAF7', fg: '#6A3FA0' }, // violet\n { bg: '#EDEFE6', fg: '#5A6A2E' }, // olive\n { bg: '#F7EBE6', fg: '#9A4A2E' } // terracotta\n];\n\n@Component({\n selector: 'pw-clearbit-icon',\n templateUrl: './clearbit-icon.component.html',\n styleUrls: ['./clearbit-icon.component.scss'],\n\n standalone: false\n})\nexport class ClearBitIconComponent implements OnChanges {\n @Input() src: string | null = null;\n @Input() altText = 'Logo';\n /** Company name — drives the initials shown when no real logo resolves. */\n @Input() name = '';\n /** Square edge length in px — applied to both the logo image and the monogram tile. */\n @Input() size = 25;\n /** Layout/margin classes for the rendered icon — override for centred contexts. */\n @Input() iconClass = 'me-2 mt-1';\n\n logoSrc: string | null = null;\n showFallback = true;\n initials = '#';\n tint: MonogramTint = MONOGRAM_TINTS[0];\n\n get tileRadius(): number {\n return Math.max(4, Math.round(this.size * 0.24));\n }\n\n get tileFontSize(): number {\n return Math.max(10, Math.round(this.size * 0.42));\n }\n\n ngOnChanges() {\n this.logoSrc = this.src ? (HelperService.getLogoByUrl(this.src) ?? null) : null;\n this.showFallback = !this.logoSrc;\n this.buildMonogram();\n }\n\n /** Called when a resolved logo URL fails to load — degrade to the monogram. */\n onLogoError() {\n this.showFallback = true;\n }\n\n private buildMonogram() {\n // Initials derive ONLY from `name` — never from `altText`. `altText` is the\n // image alt / aria-label (e.g. \"Logo\"), and folding it in here made an\n // unbound `name` masquerade as real initials (\"Logo\" → \"LO\"). With no name,\n // deriveInitials('') returns the '#' unknown-sigil, so a missing binding\n // fails visibly instead of silently wrong.\n const label = (this.name || '').trim();\n this.initials = ClearBitIconComponent.deriveInitials(label);\n this.tint = MONOGRAM_TINTS[ClearBitIconComponent.hash(label) % MONOGRAM_TINTS.length];\n }\n\n private static deriveInitials(label: string): string {\n const words = label.match(/[a-z0-9]+/gi) || [];\n if (words.length === 0) {\n return '#';\n }\n if (words.length === 1) {\n return words[0].substring(0, 2).toUpperCase();\n }\n return (words[0][0] + words[1][0]).toUpperCase();\n }\n\n private static hash(value: string): number {\n let hash = 0;\n for (let i = 0; i < value.length; i++) {\n hash = (hash * 31 + value.charCodeAt(i)) >>> 0; // NOSONAR: charCodeAt is intentional — hashes per UTF-16 code unit for stable per-name fallback icon color; swapping to codePointAt would change existing color assignments for non-ASCII names.\n }\n return hash;\n }\n}\n","@if (showFallback) {\n <span class=\"company-monogram\"\n [ngClass]=\"iconClass\"\n [attr.aria-label]=\"altText\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n [style.borderRadius.px]=\"tileRadius\"\n [style.fontSize.px]=\"tileFontSize\"\n [style.background-color]=\"tint.bg\"\n [style.color]=\"tint.fg\">{{ initials }}</span>\n} @else {\n <img [src]=\"logoSrc\"\n [alt]=\"altText\"\n (error)=\"onLogoError()\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n class=\"img-fluid company-logo\"\n [ngClass]=\"iconClass\" />\n}\n","import { Injectable } from '@angular/core';\n\nimport { BehaviorSubject, Observable } from 'rxjs';\n\nimport { SidebarContent } from './collapsible-sidebar.types';\n\n// Re-exported so existing consumers keep importing these from the service path.\nexport * from './collapsible-sidebar.types';\n\n/**\n * CollapsibleSidebarService manages dynamic sidebar content\n *\n * This service allows any module to register, update, or remove sidebar content.\n * It uses observables to notify components of state changes.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CollapsibleSidebarService {\n private readonly sidebarContentMap = new Map<string, SidebarContent>();\n private readonly sidebarExpandedSubject = new BehaviorSubject<boolean>(false);\n private readonly sidebarContentSubject = new BehaviorSubject<SidebarContent | null>(null);\n private readonly activeContentIdSubject = new BehaviorSubject<string | null>(null);\n\n /**\n * Observable for sidebar expanded/collapsed state\n */\n sidebarExpanded$: Observable<boolean> = this.sidebarExpandedSubject.asObservable();\n\n /**\n * Observable for current sidebar content\n */\n sidebarContent$: Observable<SidebarContent | null> = this.sidebarContentSubject.asObservable();\n\n /**\n * Observable for currently active content ID\n */\n activeContentId$: Observable<string | null> = this.activeContentIdSubject.asObservable();\n\n /**\n * Register sidebar content that can be triggered by a module\n * @param content - The sidebar content configuration\n */\n registerContent(content: SidebarContent): void {\n this.sidebarContentMap.set(content.id, content);\n }\n\n /**\n * Unregister sidebar content\n * @param contentId - The ID of the content to remove\n */\n unregisterContent(contentId: string): void {\n this.sidebarContentMap.delete(contentId);\n\n // If the removed content was active, clear it\n if (this.activeContentIdSubject.value === contentId) {\n this.activeContentIdSubject.next(null);\n this.sidebarContentSubject.next(null);\n }\n }\n\n /**\n * Load and display sidebar content by ID\n * @param contentId - The ID of the content to load\n */\n loadContent(contentId: string): void {\n const content = this.sidebarContentMap.get(contentId);\n\n if (!content) {\n return;\n }\n\n this.activeContentIdSubject.next(contentId);\n this.sidebarContentSubject.next(content);\n this.sidebarExpandedSubject.next(true);\n }\n\n /**\n * Load a panel and seed it with one-shot inputs.\n *\n * The host re-mounts the panel component on every load and `Object.assign`s\n * `content.data` onto the fresh instance, so this is how a caller opens a\n * panel in a particular starting state — e.g. the command palette opening\n * the Brain panel with the user's typed query already in the composer.\n *\n * @param contentId - The ID of the content to load\n * @param data - Fields copied onto the newly mounted panel instance\n */\n loadContentWithData(contentId: string, data: Record<string, unknown>): void {\n const content = this.sidebarContentMap.get(contentId);\n\n if (!content) {\n return;\n }\n\n this.sidebarContentMap.set(contentId, { ...content, data: { ...content.data, ...data } });\n this.loadContent(contentId);\n }\n\n /**\n * Toggle sidebar expanded/collapsed state\n */\n toggleSidebar(): void {\n this.sidebarExpandedSubject.next(!this.sidebarExpandedSubject.value);\n }\n\n /**\n * Expand the sidebar\n */\n expandSidebar(): void {\n this.sidebarExpandedSubject.next(true);\n }\n\n /**\n * Collapse the sidebar\n */\n collapseSidebar(): void {\n this.sidebarExpandedSubject.next(false);\n }\n\n /**\n * Get current expanded state synchronously\n */\n isExpanded(): boolean {\n return this.sidebarExpandedSubject.value;\n }\n\n /**\n * Get currently active content ID synchronously\n */\n getActiveContentId(): string | null {\n return this.activeContentIdSubject.value;\n }\n\n /**\n * Get all registered content IDs\n */\n getRegisteredContentIds(): string[] {\n return Array.from(this.sidebarContentMap.keys());\n }\n\n /**\n * Clear all sidebar content and collapse\n */\n clearAll(): void {\n this.sidebarContentMap.clear();\n this.activeContentIdSubject.next(null);\n this.sidebarContentSubject.next(null);\n this.sidebarExpandedSubject.next(false);\n }\n}\n","import { Directive, HostListener } from '@angular/core';\n\nimport { CollapsibleSidebarService } from './collapsible-sidebar.service';\n\n/**\n * Listens for Ctrl+Shift+A globally and toggles the PosiWise Assistant chat panel.\n * Applied via hostDirectives on CollapsibleSidebarComponent.\n */\n@Directive({\n selector: '[pwCollapsibleSidebarKeyboardShortcut]',\n standalone: true\n})\nexport class CollapsibleSidebarKeyboardShortcutDirective {\n constructor(private readonly sidebarService: CollapsibleSidebarService) {}\n\n @HostListener('document:keydown', ['$event'])\n onKeydown(event: KeyboardEvent): void {\n if (event.ctrlKey && event.shiftKey && event.key.toLowerCase() === 'a') {\n event.preventDefault();\n if (\n this.sidebarService.isExpanded() &&\n this.sidebarService.getActiveContentId() === 'posiwise-brain'\n ) {\n this.sidebarService.collapseSidebar();\n } else {\n this.sidebarService.loadContent('posiwise-brain');\n }\n }\n }\n}\n","/**\n * Track the live `nav.navbar.fixed-top` height and publish it as the\n * `--pw-collapsible-sidebar-top` CSS custom property on `<html>`, so the\n * drawer always docks flush under the navbar in every consumer frontend\n * (main, cloudolive, products, future spinouts) without each app needing\n * its own ResizeObserver in its layout shell.\n */\nexport interface NavbarOffsetTracker {\n detach(): void;\n}\n\nexport function attachNavbarOffsetTracker(doc: Document): NavbarOffsetTracker {\n let resizeObserver: ResizeObserver | null = null;\n let retryHandle: number | null = null;\n let detached = false;\n\n const sync = (nav: HTMLElement): void => {\n const height = Math.round(nav.getBoundingClientRect().height);\n if (height > 0) {\n doc.documentElement.style.setProperty('--pw-collapsible-sidebar-top', `${height}px`);\n }\n };\n\n const tryAttach = (): void => {\n if (detached) return;\n const nav = doc.querySelector<HTMLElement>('nav.navbar.fixed-top');\n if (!nav) {\n // Navbar not mounted yet (auth gate, lazy layout) — retry until detach.\n retryHandle = window.setTimeout(() => {\n retryHandle = null;\n tryAttach();\n }, 100);\n return;\n }\n sync(nav);\n if (typeof ResizeObserver !== 'undefined') {\n resizeObserver = new ResizeObserver(() => sync(nav));\n resizeObserver.observe(nav);\n }\n };\n\n tryAttach();\n\n return {\n detach(): void {\n detached = true;\n if (resizeObserver) {\n resizeObserver.disconnect();\n resizeObserver = null;\n }\n if (retryHandle !== null) {\n clearTimeout(retryHandle);\n retryHandle = null;\n }\n }\n };\n}\n","/**\n * Pure helpers for the collapsible-sidebar host — extracted so the host\n * component stays within the C1 size budget. Kept Angular-runtime-free\n * (only the `Type` type is imported) so they are unit-testable in isolation.\n */\nimport { Type } from '@angular/core';\n\nimport { SidebarContent } from './collapsible-sidebar.service';\n\n/**\n * Build the Assistant panel's SidebarContent descriptor — title + inline status\n * (rendered next to the title, costing no extra vertical space) + the New-chat\n * header action. `component` is passed in so this stays a pure function.\n */\nexport function buildBrainPanelContent(brand: string, component: Type<unknown>): SidebarContent {\n return {\n id: 'posiwise-brain',\n title: `${brand} Assistant`,\n titleKey: 'BrainChat.Panel.Title',\n titleParams: { brand },\n component,\n status: 'Connected · long-term memory on',\n beta: true,\n headerActions: [{ id: 'newChat', icon: 'fas fa-plus', ariaLabel: 'New chat' }]\n };\n}\n\n/**\n * Invoke a header action by calling the same-named public method on the mounted\n * panel instance (e.g. Brain's `newChat`). No-op if the method is absent so a\n * misconfigured descriptor fails silently rather than throwing.\n */\nexport function invokePanelMethod(instance: unknown, methodId: string): void {\n const handler = (instance as Record<string, unknown> | undefined)?.[methodId];\n if (typeof handler === 'function') {\n handler.call(instance);\n }\n}\n","import { DOCUMENT } from '@angular/common';\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ComponentRef,\n Inject,\n Injector,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\n\nimport { Subject } from 'rxjs';\nimport { take, takeUntil } from 'rxjs/operators';\n\nimport { PwBrainChatComponent } from '../brain-chat/pw-brain-chat.component';\n\nimport {\n CollapsibleSidebarService,\n SidebarContent,\n SidebarHeaderAction\n} from './collapsible-sidebar.service';\nimport { DEFAULT_BRAND, resolveBrandName } from './collapsible-sidebar-brand.helpers';\nimport { CollapsibleSidebarKeyboardShortcutDirective } from './collapsible-sidebar-keyboard-shortcut.directive';\nimport {\n attachNavbarOffsetTracker,\n NavbarOffsetTracker\n} from './collapsible-sidebar-navbar-offset.helpers';\nimport { buildBrainPanelContent, invokePanelMethod } from './collapsible-sidebar-panel.helpers';\n\n@Component({\n selector: 'pw-collapsible-sidebar',\n templateUrl: './collapsible-sidebar.component.html',\n styleUrls: [\n './collapsible-sidebar.component.scss',\n './collapsible-sidebar-header.scss',\n './collapsible-sidebar-content.scss'\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n hostDirectives: [CollapsibleSidebarKeyboardShortcutDirective]\n})\nexport class CollapsibleSidebarComponent implements OnInit, AfterViewInit, OnDestroy {\n @ViewChild('contentContainer', { read: ViewContainerRef }) contentContainer!: ViewContainerRef;\n\n /**\n * When true, the drawer is a flex sibling of the page: main content shrinks (GitLab issue-board style).\n * When false, the drawer is fixed over the viewport with a backdrop.\n */\n @Input({ transform: booleanAttribute }) embedInLayout = false;\n\n /**\n * When false, width/transform transitions are off so the first paint after\n * a full page load does not briefly animate or show border/shadow flash.\n */\n transitionReady = false;\n\n isExpanded = false;\n currentContent: SidebarContent | null = null;\n private componentRef: ComponentRef<unknown> | null = null;\n private navbarOffsetTracker: NavbarOffsetTracker | null = null;\n private readonly destroy$ = new Subject<void>();\n\n constructor(\n private readonly sidebarService: CollapsibleSidebarService,\n private readonly injector: Injector,\n private readonly cdr: ChangeDetectorRef,\n @Inject(DOCUMENT) private readonly document: Document,\n @Optional() private readonly appConfigService?: AppConfigService\n ) {}\n\n ngOnInit(): void {\n // Self-register the Brain (MCP) panel so every consumer frontend\n // works by rendering <pw-collapsible-sidebar>; registerContent is\n // idempotent, slot NOT unregistered on destroy (#4167). appConfig$\n // is a BehaviorSubject so the branded title resolves synchronously,\n // before the navbar can trigger loadContent().\n this.registerBrainPanel(DEFAULT_BRAND);\n this.appConfigService?.appConfig$\n .pipe(take(1))\n .subscribe(config => this.registerBrainPanel(resolveBrandName(config)));\n\n // Subscribe to expanded state\n this.sidebarService.sidebarExpanded$\n .pipe(takeUntil(this.destroy$))\n .subscribe(isExpanded => {\n this.isExpanded = isExpanded;\n this.cdr.markForCheck();\n });\n }\n\n ngAfterViewInit(): void {\n // `sidebarContent$` is a BehaviorSubject — it emits synchronously on\n // subscribe. Subscribing in ngOnInit would fire before `contentContainer`\n // (@ViewChild) is bound, so `loadComponent()` bails with \"Content\n // container not found\". #4167 (open-on-navigate-back) keeps the slot\n // populated, so subscribe AFTER the view init so the first emission lands\n // with `contentContainer` wired up.\n this.sidebarService.sidebarContent$.pipe(takeUntil(this.destroy$)).subscribe(content => {\n this.currentContent = content;\n\n if (content) {\n this.loadComponent(content);\n } else {\n this.clearComponent();\n }\n\n this.cdr.markForCheck();\n });\n\n // Double rAF: wait until after layout so we do not trigger transitions from mount → closed.\n requestAnimationFrame(() => {\n requestAnimationFrame(() => {\n this.transitionReady = true;\n this.cdr.markForCheck();\n });\n });\n\n // Track the live navbar height so the drawer always docks flush\n // under it across every consumer frontend (main, cloudolive,\n // products, future spinouts) — without each app needing its own\n // ResizeObserver in its layout shell.\n this.navbarOffsetTracker = attachNavbarOffsetTracker(this.document);\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.clearComponent();\n this.navbarOffsetTracker?.detach();\n this.navbarOffsetTracker = null;\n }\n\n /** Register (idempotently) the Assistant panel under the given brand. */\n private registerBrainPanel(brand: string): void {\n this.sidebarService.registerContent(buildBrainPanelContent(brand, PwBrainChatComponent));\n }\n\n /** Delegate a header action to the same-named method on the mounted panel. */\n invokeHeaderAction(action: SidebarHeaderAction): void {\n invokePanelMethod(this.componentRef?.instance, action.id);\n }\n\n /**\n * Load and render dynamic component based on sidebar content\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private loadComponent(content: SidebarContent): void {\n this.clearComponent();\n\n if (!this.contentContainer) {\n console.warn('Content container not found');\n return;\n }\n\n // Check if component is null or undefined\n if (!content.component) {\n console.warn('No component provided for sidebar content:', content.id);\n return;\n }\n\n // Create component dynamically\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const componentRef = this.contentContainer.createComponent(content.component as any, {\n injector: this.injector\n });\n\n // Set inputs if data provided\n if (content.data) {\n Object.assign(componentRef.instance, content.data);\n }\n\n this.componentRef = componentRef;\n }\n\n private clearComponent(): void {\n if (this.componentRef) {\n this.componentRef.destroy();\n this.componentRef = null;\n }\n if (this.contentContainer) {\n this.contentContainer.clear();\n }\n }\n\n closeSidebar(): void {\n this.sidebarService.collapseSidebar();\n }\n\n toggleSidebar(): void {\n this.sidebarService.toggleSidebar();\n }\n}\n","<div\n class=\"pw-collapsible-sidebar-host\"\n [class.pw-collapsible-sidebar-host--embedded]=\"embedInLayout\"\n [class.pw-collapsible-sidebar-host--transition-ready]=\"transitionReady\"\n>\n @if (isExpanded && !embedInLayout) {\n <button\n type=\"button\"\n class=\"pw-collapsible-sidebar-backdrop\"\n aria-label=\"Close side panel\"\n (click)=\"closeSidebar()\"\n ></button>\n }\n\n <aside\n class=\"pw-collapsible-sidebar\"\n [class.expanded]=\"isExpanded\"\n [attr.aria-hidden]=\"!isExpanded\"\n [style.--pw-drawer-width]=\"currentContent?.width\"\n >\n <div class=\"sidebar-header\">\n <div class=\"sidebar-header__lead\">\n <div class=\"sidebar-title-group\">\n <h2 class=\"sidebar-title\">\n @if (currentContent?.titleKey) {\n {{ currentContent!.titleKey! | transloco: currentContent?.titleParams }}\n } @else {\n {{ currentContent?.title ?? 'Details' }}\n }\n </h2>\n @if (currentContent?.beta) {\n <span class=\"sidebar-badge\">{{ 'BrainChat.Badge.Beta' | transloco }}</span>\n }\n </div>\n @if (currentContent?.status) {\n <span class=\"sidebar-status\" [attr.title]=\"currentContent?.status\">\n <span class=\"sidebar-status__dot\" aria-hidden=\"true\"></span>\n <span class=\"sidebar-status__text\">{{ currentContent?.status }}</span>\n </span>\n }\n </div>\n <div class=\"sidebar-header__actions\">\n @for (action of currentContent?.headerActions ?? []; track action.id) {\n <button\n type=\"button\"\n class=\"sidebar-action\"\n [attr.aria-label]=\"action.ariaLabel\"\n [attr.title]=\"action.ariaLabel\"\n (click)=\"invokeHeaderAction(action)\"\n >\n <i class=\"{{ action.icon }}\" aria-hidden=\"true\"></i>\n </button>\n }\n <button\n type=\"button\"\n class=\"close-btn\"\n aria-label=\"Close sidebar\"\n (click)=\"closeSidebar()\"\n >\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n\n <div class=\"sidebar-content\">\n <div #contentContainer></div>\n </div>\n </aside>\n</div>\n","import { Directive, HostListener, Input, isDevMode } from '@angular/core';\n\nimport { CollapsibleSidebarService } from './collapsible-sidebar.service';\n\n/**\n * pwCollapsibleSidebarTrigger\n *\n * Directive that makes an element a trigger for the collapsible sidebar.\n * Useful for cog icons or buttons that should expand the sidebar when clicked.\n *\n * Usage:\n * ```html\n * <button pwCollapsibleSidebarTrigger [contentId]=\"'posiwise-brain'\">\n * <i class=\"pi pi-cog\"></i>\n * </button>\n * ```\n */\n@Directive({\n selector: '[pwCollapsibleSidebarTrigger]',\n standalone: true\n})\nexport class CollapsibleSidebarTriggerDirective {\n /**\n * The ID of the sidebar content to load when this trigger is clicked\n */\n @Input() contentId = '';\n\n /**\n * Optional tooltip text shown on hover\n */\n @Input() tooltipText = '';\n\n constructor(private readonly sidebarService: CollapsibleSidebarService) {}\n\n /**\n * Handle click event to load sidebar content\n */\n @HostListener('click', ['$event'])\n onClick(event: MouseEvent): void {\n event.preventDefault();\n event.stopPropagation();\n\n if (this.contentId) {\n const alreadyOpen =\n this.sidebarService.isExpanded() &&\n this.sidebarService.getActiveContentId() === this.contentId;\n\n if (alreadyOpen) {\n this.sidebarService.collapseSidebar();\n } else {\n this.sidebarService.loadContent(this.contentId);\n }\n } else if (isDevMode()) {\n console.warn(\n 'pwCollapsibleSidebarTrigger: contentId is required when using this directive.'\n );\n }\n }\n}\n","import { Component, Input } from '@angular/core';\n\n@Component({\n selector: 'pw-coming-soon',\n template: `\n <div class=\"coming-soon\">\n <h2 class=\"card-title\">{{ message }}</h2>\n <p>... this section is under construction.</p>\n </div>\n `,\n standalone: false\n})\nexport class ComingSoonComponent {\n @Input()\n message = 'Coming soon';\n}\n","import { Injectable } from '@angular/core';\n\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/**\n * Open/close state for the global command palette.\n *\n * Kept in a root service (rather than inside the component) so any surface can\n * summon the palette — the navbar button, the ⌘K shortcut, an empty-state\n * \"find a page\" link — without reaching for a component reference.\n */\n@Injectable({ providedIn: 'root' })\nexport class CommandPaletteService {\n private readonly openSubject = new BehaviorSubject<boolean>(false);\n\n isOpen$: Observable<boolean> = this.openSubject.asObservable();\n\n open(): void {\n this.openSubject.next(true);\n }\n\n close(): void {\n this.openSubject.next(false);\n }\n\n toggle(): void {\n this.openSubject.next(!this.openSubject.value);\n }\n\n isOpen(): boolean {\n return this.openSubject.value;\n }\n}\n","import { PaletteItem } from './command-palette.model';\n\n/**\n * Everything activation needs, passed in rather than injected, so the dispatch\n * stays a pure function the component can hand its own collaborators to.\n */\nexport interface ActivateDeps {\n /** Hand the query to the Brain composer — seeded, not sent. */\n askAi: (query: string) => void;\n /** Returns true when the nav index took over via a subscription switch. */\n openEntry: (item: PaletteItem) => boolean;\n navigate: (path: string) => void;\n copyLink: () => void;\n logOut: () => void;\n}\n\n/**\n * Run a row.\n *\n * Returns whether the palette should close. Everything closes today; the return\n * value exists so a future row that reports back in place (a copy confirmation,\n * a toggle) can keep the panel open without rewriting every caller.\n */\nexport const activateItem = (item: PaletteItem | undefined, deps: ActivateDeps): boolean => {\n if (!item) {\n return false;\n }\n\n if (item.kind === 'ask-ai') {\n deps.askAi(item.label);\n\n return true;\n }\n\n if (item.kind === 'action') {\n runAction(item, deps);\n\n return true;\n }\n\n // A page in another product: the index hands it to the sidebar's context\n // switch, which navigates once that subscription is active.\n if (item.entry && deps.openEntry(item)) {\n return true;\n }\n\n if (item.path) {\n deps.navigate(item.path);\n }\n\n return true;\n};\n\nconst runAction = (item: PaletteItem, deps: ActivateDeps): void => {\n if (item.action === 'copy-link') {\n deps.copyLink();\n\n return;\n }\n if (item.action === 'log-out') {\n deps.logOut();\n }\n};\n\n/**\n * The collaborators `buildActivateDeps` wires together, as structural slices of\n * the real services so a test can pass plain objects.\n */\nexport interface ActivateCollaborators {\n sidebar: { loadContentWithData: (contentId: string, data: Record<string, unknown>) => void };\n navIndex: { open: (entry: NonNullable<PaletteItem['entry']>) => boolean };\n router: { navigateByUrl: (path: string) => unknown };\n translate: (key: string) => string;\n notify?: { success: (message: string) => void; error: (message: string) => void };\n /** Overridable so the clipboard and location can be faked in a test. */\n clipboard?: { writeText: (value: string) => Promise<void> };\n href?: () => string;\n}\n\n/**\n * Build the dispatch table from a component's collaborators.\n *\n * Lives here rather than inline in the component so the component stays inside\n * C1 and so the copy-link branch — the only one with a promise and user-visible\n * feedback — is reachable from a unit test.\n */\nexport const buildActivateDeps = (deps: ActivateCollaborators): ActivateDeps => ({\n // Seed the Brain composer rather than auto-sending, so the user can still\n // edit the question before committing to it.\n askAi: query => deps.sidebar.loadContentWithData('posiwise-brain', { draft: query }),\n openEntry: item => !!item.entry && deps.navIndex.open(item.entry),\n navigate: path => {\n deps.router.navigateByUrl(path);\n },\n copyLink: () => {\n const clipboard = deps.clipboard ?? globalThis.navigator?.clipboard;\n\n if (!clipboard) {\n deps.notify?.error(deps.translate('CommandPalette.Action.CopyFailed'));\n\n return;\n }\n\n clipboard\n .writeText(deps.href ? deps.href() : globalThis.location?.href)\n .then(() => deps.notify?.success(deps.translate('CommandPalette.Action.Copied')))\n .catch(() => deps.notify?.error(deps.translate('CommandPalette.Action.CopyFailed')));\n },\n // The same route the profile menu uses; it owns the whole teardown.\n logOut: () => {\n deps.router.navigateByUrl('/logout');\n }\n});\n","import { AppConfigService } from '@posiwise/app-config-service';\n\nimport { Observable, of } from 'rxjs';\nimport { map } from 'rxjs/operators';\n\nimport {\n DEFAULT_BRAND,\n resolveBrandName\n} from '../collapsible-sidebar/collapsible-sidebar-brand.helpers';\n\nexport { DEFAULT_BRAND };\n\n/**\n * The white-label brand for the Ask row.\n *\n * `AppConfigService` is optional in this library — a consumer that does not\n * provide it falls back to the default brand rather than failing to construct\n * the palette at all.\n */\nexport const brandName$ = (appConfig?: AppConfigService): Observable<string> =>\n appConfig ? appConfig.appConfig$.pipe(map(resolveBrandName)) : of(DEFAULT_BRAND);\n","import { NavEntry, PaletteGroup, PaletteItem, PalettePerson } from './command-palette.model';\n\n/** Cap per group so one noisy group can never bury the others. */\nconst MAX_PER_GROUP = 6;\n\nconst normalise = (value: string): string => (value ?? '').trim().toLowerCase();\n\n/**\n * Small, predictable ranking — prefix beats word-start beats substring.\n * Deliberately not fuzzy: a palette that reorders unpredictably as you type\n * costs more trust than it buys in recall.\n */\nexport const scoreEntry = (title: string, section: string, query: string): number => {\n const haystack = normalise(title);\n const needle = normalise(query);\n\n if (!needle) {\n return 0;\n }\n if (haystack.startsWith(needle)) {\n return 3;\n }\n if (haystack.includes(` ${needle}`)) {\n return 2;\n }\n if (haystack.includes(needle)) {\n return 1;\n }\n if (normalise(section).includes(needle)) {\n return 1;\n }\n\n return -1;\n};\n\n/** The entry's i18n keys, when it carries them, so the row renders translated. */\nconst translatedText = (entry: NavEntry): Pick<PaletteItem, 'labelKey' | 'detailKey'> => ({\n ...(entry.titleKey ? { labelKey: entry.titleKey } : {}),\n ...(entry.sectionKey ? { detailKey: entry.sectionKey } : {})\n});\n\n/**\n * Score what the row shows as well as the English it was built from, so a user\n * finds a page by the translated name they read and by its English name.\n */\nconst entryScore = (entry: NavEntry, query: string, translate?: (key: string) => string): number => {\n const english = scoreEntry(entry.title, entry.section, query);\n if (!translate || (!entry.titleKey && !entry.sectionKey)) {\n return english;\n }\n // A missing translation comes back as the key itself; never search key text.\n const shown = (key: string | undefined, fallback: string): string => {\n const text = key ? translate(key) : fallback;\n return text === key ? fallback : text;\n };\n const title = shown(entry.titleKey, entry.title);\n const section = shown(entry.sectionKey, entry.section);\n\n return Math.max(english, scoreEntry(title, section, query));\n};\n\nexport const pageItems = (\n entries: NavEntry[],\n query: string,\n translate?: (key: string) => string\n): PaletteItem[] =>\n entries\n .map(entry => ({ entry, score: entryScore(entry, query, translate) }))\n .filter(scored => scored.score >= 0)\n .sort((a, b) => b.score - a.score || a.entry.title.localeCompare(b.entry.title))\n .slice(0, MAX_PER_GROUP)\n .map(({ entry }) => ({\n id: `page:${entry.path}`,\n kind: 'page' as const,\n label: entry.title,\n detail: entry.section,\n ...translatedText(entry),\n icon: entry.icon || 'ft-file',\n path: entry.path,\n entry\n }));\n\nconst personName = (person: PalettePerson): string =>\n [person.first_name, person.last_name].filter(Boolean).join(' ').trim();\n\n/** `/members/:slug` — the same destination the legacy search results page used. */\nexport const personItems = (people: PalettePerson[]): PaletteItem[] =>\n (people ?? [])\n .filter(person => person?.slug && (personName(person) || person.email))\n .slice(0, MAX_PER_GROUP)\n .map(person => ({\n id: `person:${person.slug}`,\n kind: 'person' as const,\n label: personName(person) || person.email,\n detail: person.email ?? '',\n icon: 'ft-user',\n path: `/members/${person.slug}`\n }));\n\n/**\n * The jump-back list. Unscored and unsorted: `RecentPagesService` already returns\n * them newest-first, and re-ranking recency by name would defeat the point.\n */\nexport const recentItems = (entries: NavEntry[]): PaletteItem[] =>\n (entries ?? []).slice(0, MAX_PER_GROUP).map(entry => ({\n id: `recent:${entry.path}`,\n kind: 'page' as const,\n label: entry.title,\n detail: entry.section,\n ...translatedText(entry),\n icon: entry.icon || 'fas fa-clock-rotate-left',\n path: entry.path,\n entry\n }));\n\nexport const askAiItem = (query: string): PaletteItem => ({\n id: 'ask-ai',\n kind: 'ask-ai',\n label: query,\n detail: '',\n icon: 'fas fa-wand-magic-sparkles'\n});\n\n/**\n * Assemble the rendered groups.\n *\n * `Recent` leads when it has anything, because on an empty query it is a far\n * better first row than the alphabetical head of the full page list.\n *\n * `ask-ai` is pinned last and ALWAYS present, including on the empty-query\n * shortlist — it is the standing escape hatch when the palette (a known-item\n * finder) is the wrong tool for the question, so it must be discoverable before\n * the user has typed anything.\n */\nexport const buildGroups = (sources: {\n recents?: PaletteItem[];\n pages: PaletteItem[];\n people: PaletteItem[];\n switches?: PaletteItem[];\n actions?: PaletteItem[];\n query: string;\n}): PaletteGroup[] => {\n const groups: PaletteGroup[] = [];\n\n if (sources.recents?.length) {\n groups.push({ labelKey: 'CommandPalette.Group.Recent', items: sources.recents });\n }\n if (sources.pages.length) {\n groups.push({ labelKey: 'CommandPalette.Group.Pages', items: sources.pages });\n }\n if (sources.people.length) {\n groups.push({ labelKey: 'CommandPalette.Group.People', items: sources.people });\n }\n if (sources.switches?.length) {\n groups.push({ labelKey: 'CommandPalette.Group.Switch', items: sources.switches });\n }\n if (sources.actions?.length) {\n groups.push({ labelKey: 'CommandPalette.Group.Actions', items: sources.actions });\n }\n groups.push({\n labelKey: 'CommandPalette.Group.Ask',\n items: [askAiItem(sources.query.trim())]\n });\n\n return groups;\n};\n\n/** Flatten groups back to a single ordered list for keyboard traversal. */\nexport const flattenItems = (groups: PaletteGroup[]): PaletteItem[] =>\n groups.flatMap(group => group.items);\n","import { PaletteActionId, PaletteItem } from './command-palette.model';\nimport { scoreEntry } from './command-palette-sources';\n\nexport interface PaletteActionDef {\n id: PaletteActionId;\n labelKey: string;\n icon: string;\n}\n\n/**\n * The palette's own commands.\n *\n * Deliberately short. Anything that is really a destination belongs in the\n * navigation index, where it arrives with the permission gating already applied —\n * an action row carries no such gate, so every entry here must be safe for any\n * signed-in user.\n */\nexport const PALETTE_ACTIONS: PaletteActionDef[] = [\n {\n id: 'copy-link',\n labelKey: 'CommandPalette.Action.CopyLink',\n icon: 'fas fa-link'\n },\n {\n id: 'log-out',\n labelKey: 'CommandPalette.Action.LogOut',\n icon: 'fas fa-arrow-right-from-bracket'\n }\n];\n\n/** Below this, a query is too weak to be a deliberate command request. */\nconst MIN_QUERY = 2;\n\n/**\n * Actions matching the typed query, ranked with the same scorer as pages.\n *\n * Requires a real query on purpose: `log-out` must never sit on the empty-query\n * shortlist, where the keyboard's default row is one Enter away.\n */\nexport const actionItems = (\n query: string,\n translate: (key: string) => string,\n defs: PaletteActionDef[] = PALETTE_ACTIONS\n): PaletteItem[] => {\n const needle = (query ?? '').trim();\n\n if (needle.length < MIN_QUERY) {\n return [];\n }\n\n return defs\n .map(def => ({ def, label: translate(def.labelKey) }))\n .map(({ def, label }) => ({ def, label, score: scoreEntry(label, '', needle) }))\n .filter(scored => scored.score >= 0)\n .sort((a, b) => b.score - a.score || a.label.localeCompare(b.label))\n .map(({ def, label }) => ({\n id: `action:${def.id}`,\n kind: 'action' as const,\n label,\n labelKey: def.labelKey,\n detail: '',\n icon: def.icon,\n action: def.id\n }));\n};\n","import { ProductMenuSource } from '@posiwise/common-services';\n\nimport { PaletteItem } from './command-palette.model';\nimport { scoreEntry } from './command-palette-sources';\n\n/** Shown without a query too, so switching is discoverable — but kept short there. */\nconst BROWSE_LIMIT = 3;\n\nconst MATCH_LIMIT = 6;\n\nexport interface SwitchContext {\n /** The product the app is currently in; excluded from the rows. */\n currentPath?: string;\n currentSubscriptionId?: number;\n}\n\n/**\n * Switching only means something across subscriptions. A user in one subscription\n * — however many products it carries — has nowhere to switch to, so the whole\n * group is withheld rather than offering the product they are already in.\n */\nconst spansSubscriptions = (products: ProductMenuSource[]): boolean =>\n new Set(products.map(product => product.subscriptionId)).size > 1;\n\nconst isCurrent = (product: ProductMenuSource, context: SwitchContext): boolean =>\n !!context.currentSubscriptionId &&\n product.subscriptionId === context.currentSubscriptionId &&\n product.path === context.currentPath;\n\n/**\n * \"Switch to\" rows — one per product the user belongs to, in another subscription\n * or another product of the same one.\n *\n * These are `page` rows carrying a `product`, not a new item kind, so activation\n * goes through `NavigationIndexService.open()` — the same verified path a deep\n * page in a foreign product already uses. The entry's `path` is empty on purpose:\n * the sidebar's switcher reads a falsy target as \"this product's own dashboard\"\n * and resolves the subscription slug itself, which is the one place that mapping\n * is known to be correct.\n *\n * The row is named for the **organisation**, because that is what a user switching\n * context is actually choosing; the product name is the detail line.\n */\nexport const switchItems = (\n products: ProductMenuSource[],\n query: string,\n context: SwitchContext = {}\n): PaletteItem[] => {\n const needle = (query ?? '').trim();\n const switchable = (products ?? []).filter(product => !!product?.subscriptionId);\n\n if (!spansSubscriptions(switchable)) {\n return [];\n }\n\n const candidates = switchable.filter(product => !isCurrent(product, context));\n\n const scored = needle\n ? candidates\n .map(product => ({\n product,\n score: scoreEntry(product.organisation ?? '', product.title ?? '', needle)\n }))\n .filter(entry => entry.score >= 0)\n .sort((a, b) => b.score - a.score)\n .slice(0, MATCH_LIMIT)\n .map(entry => entry.product)\n : candidates.slice(0, BROWSE_LIMIT);\n\n return scored.map(product => {\n const label = product.organisation ?? product.title ?? '';\n const detail = product.organisation ? (product.title ?? '') : '';\n\n return {\n id: `switch:${product.subscriptionId}:${product.path}`,\n kind: 'page' as const,\n label,\n detail,\n icon: 'fas fa-building',\n entry: {\n title: label,\n path: '',\n icon: 'fas fa-building',\n section: detail,\n product\n }\n };\n });\n};\n","import { NavEntry, ProductMenuSource } from '@posiwise/common-services';\n\nimport { PaletteGroup, PaletteItem } from './command-palette.model';\nimport { actionItems } from './command-palette-actions';\nimport { buildGroups, pageItems, recentItems } from './command-palette-sources';\nimport { switchItems } from './command-palette-switch';\n\n/** Structural slices of the two services, so a test can pass plain objects. */\nexport interface NavIndexLike {\n entries: () => NavEntry[];\n canSwitch: () => boolean;\n switchTargets: () => ProductMenuSource[];\n}\n\nexport interface RecentsLike {\n resolve: (entries: NavEntry[], currentPath: string) => NavEntry[];\n}\n\nexport interface ComposeSources {\n navIndex: NavIndexLike;\n recents: RecentsLike;\n /** Router URL of the page in view; excluded from the recents list. */\n currentUrl: string;\n /** Debounced people results; relevance is decided here, not by the caller. */\n people: PaletteItem[];\n query: string;\n translate: (key: string) => string;\n current?: { path?: string; subscriptionId?: number };\n}\n\n/**\n * Turn the raw sources into rendered groups.\n *\n * Pure so the two precedence rules that shape the panel are testable without a\n * TestBed:\n *\n * 1. On an EMPTY query, recents replace the page list rather than sitting above\n * it. With no query every page scores 0, so `pageItems` falls back to\n * alphabetical order — six arbitrary names. Recent history is strictly more\n * useful, and showing both buries it.\n * 2. People only appear once something is typed. The list is a remote search;\n * there is nothing to show for an empty query.\n */\nexport const composeGroups = (sources: ComposeSources): PaletteGroup[] => {\n const typed = sources.query.trim();\n const entries = sources.navIndex.entries();\n const recents = typed ? [] : recentItems(sources.recents.resolve(entries, sources.currentUrl));\n const pages = typed || !recents.length ? pageItems(entries, sources.query, sources.translate) : [];\n\n return buildGroups({\n recents,\n pages,\n people: typed ? sources.people : [],\n switches: sources.navIndex.canSwitch()\n ? switchItems(sources.navIndex.switchTargets(), sources.query, {\n currentPath: sources.current?.path,\n currentSubscriptionId: sources.current?.subscriptionId\n })\n : [],\n actions: actionItems(sources.query, sources.translate),\n query: sources.query\n });\n};\n","import { PaletteItem } from './command-palette.model';\n\n/**\n * Keyboard position within the flattened row list.\n *\n * Extracted from the component so the component stays inside C1 while gaining\n * the recents/actions sources; it is also the only piece of palette state with\n * wrap-around arithmetic worth testing on its own.\n */\nexport class PaletteCursor {\n private index = 0;\n\n get position(): number {\n return this.index;\n }\n\n reset(): void {\n this.index = 0;\n }\n\n /** Wraps at both ends; a no-op while there is nothing to move through. */\n move(delta: number, length: number): void {\n if (length <= 0) {\n this.index = 0;\n\n return;\n }\n this.index = (this.index + delta + length) % length;\n }\n\n /** The row the keyboard is on, or undefined once the list has emptied. */\n current(items: PaletteItem[]): PaletteItem | undefined {\n return items[this.index];\n }\n\n isActive(items: PaletteItem[], item: PaletteItem): boolean {\n return this.current(items)?.id === item.id;\n }\n}\n","/**\n * Native <dialog> plumbing for the command palette.\n *\n * Split out of the component so `command-palette.component.ts` stays inside the\n * 200-line ceiling, and so the DOM-level behaviour can be exercised directly.\n *\n * Feature detection is NOT defensive padding: jsdom 26 ships `HTMLDialogElement`\n * with a working `open` property but no `showModal()` / `close()` methods, so a\n * bare call throws `showModal is not a function` under Jest. Falling back to the\n * `open` attribute keeps specs meaningful — `open` is what `showModal()` sets in\n * a real browser anyway, so both paths leave the element in the same state.\n */\n\n/** Drive the <dialog> to match the palette's open state. Idempotent. */\nexport function syncPaletteDialog(dialog: HTMLDialogElement | undefined, isOpen: boolean): void {\n if (!dialog) {\n return;\n }\n\n if (isOpen && !dialog.open) {\n openDialog(dialog);\n } else if (!isOpen && dialog.open) {\n closeDialog(dialog);\n }\n}\n\n/**\n * Close the palette when a click lands on the ::backdrop.\n *\n * A modal <dialog>'s backdrop is a pseudo-element with no node of its own, so\n * the click surfaces with the dialog box itself as `target` — something a click\n * on any content never produces. Bound imperatively rather than declared in the\n * template on purpose: the markup then carries no mouse-only close affordance,\n * and Escape remains the documented keyboard equivalent.\n *\n * Returns a teardown for ngOnDestroy.\n */\nexport function bindBackdropDismiss(\n dialog: HTMLDialogElement | undefined,\n onDismiss: () => void\n): () => void {\n if (!dialog) {\n return () => undefined;\n }\n\n const handler = (event: MouseEvent): void => {\n if (event.target === dialog) {\n onDismiss();\n }\n };\n\n dialog.addEventListener('click', handler);\n\n return () => dialog.removeEventListener('click', handler);\n}\n\nfunction openDialog(dialog: HTMLDialogElement): void {\n if (typeof dialog.showModal === 'function') {\n dialog.showModal();\n } else {\n dialog.setAttribute('open', '');\n }\n}\n\nfunction closeDialog(dialog: HTMLDialogElement): void {\n if (typeof dialog.close === 'function') {\n dialog.close();\n } else {\n dialog.removeAttribute('open');\n }\n}\n\n/**\n * Bind the native <dialog> once the view exists, and apply any open state that\n * raced the view's arrival (the palette can be opened from ⌘K before\n * `ngAfterViewInit` runs).\n *\n * Returns the backdrop-listener release function.\n */\nexport const attachDialog = (\n dialog: HTMLDialogElement | undefined,\n onDismiss: () => void,\n isOpen: boolean\n): (() => void) => {\n const release = bindBackdropDismiss(dialog, onDismiss);\n\n syncPaletteDialog(dialog, isOpen);\n\n return release;\n};\n","/** What a keypress inside the results list means; null when it means nothing. */\nexport type PaletteListAction = 'down' | 'up' | 'enter';\n\n/** The global open/close chord. Ctrl on Windows and Linux, ⌘ on a Mac. */\nexport const isToggleShortcut = (event: KeyboardEvent): boolean =>\n (event.metaKey || event.ctrlKey) && event.key.toLowerCase() === 'k';\n\nexport const listAction = (event: KeyboardEvent): PaletteListAction | null => {\n if (event.key === 'ArrowDown') {\n return 'down';\n }\n if (event.key === 'ArrowUp') {\n return 'up';\n }\n\n return event.key === 'Enter' ? 'enter' : null;\n};\n\n/**\n * The chord as a user should read it. `navigator.platform` is deprecated but is\n * still the only synchronous signal here; a wrong guess costs a wrong hint, not\n * a broken shortcut, since the handler accepts either modifier.\n */\nexport const shortcutHint = (): string =>\n /Mac|iPhone|iPad/i.test(navigator?.platform ?? '') ? '⌘K' : 'Ctrl K';\n","import { DashboardService, PermissionService } from '@posiwise/common-services';\n\nimport { Observable, of } from 'rxjs';\nimport { catchError, debounceTime, distinctUntilChanged, map, switchMap } from 'rxjs/operators';\n\nimport { PaletteItem, PalettePerson } from './command-palette.model';\nimport { personItems } from './command-palette-sources';\n\n/** Only hit the people endpoint once typing settles, and not for one letter. */\nconst PEOPLE_DEBOUNCE_MS = 250;\nconst PEOPLE_MIN_CHARS = 2;\n\n/**\n * Debounced people lookup, mapped straight to palette rows.\n *\n * Lifted out of the component so `command-palette.component.ts` keeps to the\n * 200-line ceiling once the native-dialog plumbing lands beside it.\n */\nexport function peopleSearch(\n queryChanges: Observable<string>,\n dashboard: DashboardService\n): Observable<PaletteItem[]> {\n return queryChanges.pipe(\n debounceTime(PEOPLE_DEBOUNCE_MS),\n distinctUntilChanged(),\n switchMap(term => fetchPeople(dashboard, term)),\n map(people => personItems(people))\n );\n}\n\nfunction fetchPeople(dashboard: DashboardService, term: string): Observable<PalettePerson[]> {\n const subscriptionId = PermissionService.selectedSubscription?.id;\n\n if (term.length < PEOPLE_MIN_CHARS || !subscriptionId) {\n return of([]);\n }\n\n // A failed lookup must not blank the palette — pages still render. The catch\n // sits INSIDE the inner observable so it never tears down the outer stream.\n return dashboard.search(term, subscriptionId).pipe(\n map(response => response?.users ?? []),\n catchError(() => of([] as PalettePerson[]))\n );\n}\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n HostListener,\n OnDestroy,\n OnInit,\n Optional,\n ViewChild\n} from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport {\n CustomToastService,\n DashboardService,\n NavigationIndexService,\n PermissionService,\n RecentPagesService\n} from '@posiwise/common-services';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { TranslocoService } from '@jsverse/transloco';\n\nimport { CollapsibleSidebarService } from '../collapsible-sidebar/collapsible-sidebar.service';\n\nimport { PaletteGroup, PaletteItem } from './command-palette.model';\nimport { CommandPaletteService } from './command-palette.service';\nimport { activateItem, buildActivateDeps } from './command-palette-activate.helpers';\nimport { brandName$, DEFAULT_BRAND } from './command-palette-brand';\nimport { composeGroups } from './command-palette-compose';\nimport { PaletteCursor } from './command-palette-cursor';\nimport { attachDialog, syncPaletteDialog } from './command-palette-dialog.helpers';\nimport { isToggleShortcut, listAction, shortcutHint } from './command-palette-keyboard';\nimport { peopleSearch } from './command-palette-people.helpers';\nimport { flattenItems } from './command-palette-sources';\n\n@Component({\n selector: 'pw-command-palette',\n templateUrl: './command-palette.component.html',\n styleUrls: ['./command-palette.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class CommandPaletteComponent implements OnInit, AfterViewInit, OnDestroy {\n @ViewChild('queryInput') queryInput?: { nativeElement: HTMLInputElement };\n /** The native <dialog>; always in the DOM, so this handle stays valid. */\n @ViewChild('paletteDialog') paletteDialog?: { nativeElement: HTMLDialogElement };\n\n isOpen = false;\n query = '';\n groups: PaletteGroup[] = [];\n\n brandName = DEFAULT_BRAND;\n readonly shortcutHint = shortcutHint();\n\n private readonly cursor = new PaletteCursor();\n private flat: PaletteItem[] = [];\n private readonly queryChanges = new Subject<string>();\n private readonly destroy$ = new Subject<void>();\n private people: PaletteItem[] = [];\n private releaseBackdrop: () => void = () => undefined;\n\n constructor(\n public readonly palette: CommandPaletteService,\n private readonly navIndex: NavigationIndexService,\n private readonly dashboard: DashboardService,\n private readonly recents: RecentPagesService,\n private readonly sidebar: CollapsibleSidebarService,\n private readonly router: Router,\n private readonly transloco: TranslocoService,\n private readonly cdr: ChangeDetectorRef,\n @Optional() private readonly appConfigService?: AppConfigService,\n @Optional() private readonly toast?: CustomToastService\n ) {}\n\n ngOnInit(): void {\n brandName$(this.appConfigService)\n .pipe(takeUntil(this.destroy$))\n .subscribe(name => {\n this.brandName = name;\n this.cdr.markForCheck();\n });\n\n this.palette.isOpen$.pipe(takeUntil(this.destroy$)).subscribe(isOpen => {\n this.isOpen = isOpen;\n if (isOpen) {\n this.reset();\n }\n this.cdr.markForCheck();\n syncPaletteDialog(this.paletteDialog?.nativeElement, isOpen);\n });\n\n peopleSearch(this.queryChanges, this.dashboard)\n .pipe(takeUntil(this.destroy$))\n .subscribe(people => {\n this.people = people;\n this.rebuild();\n });\n }\n\n ngAfterViewInit(): void {\n this.releaseBackdrop = attachDialog(\n this.paletteDialog?.nativeElement,\n () => this.palette.close(),\n this.isOpen\n );\n }\n\n ngOnDestroy(): void {\n this.releaseBackdrop();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /** A native close (Escape, or our own close()) mirrored back onto the service. */\n onDialogClose(): void {\n if (this.isOpen) {\n this.palette.close();\n }\n }\n\n /** ⌘K / Ctrl-K opens from anywhere; Escape closes. */\n @HostListener('document:keydown', ['$event'])\n onDocumentKeydown(event: KeyboardEvent): void {\n if (isToggleShortcut(event)) {\n event.preventDefault();\n this.palette.toggle();\n } else if (event.key === 'Escape' && this.isOpen) {\n this.palette.close();\n }\n }\n\n onQueryInput(value: string): void {\n this.query = value;\n this.queryChanges.next(value.trim());\n this.rebuild();\n }\n\n onKeydown(event: KeyboardEvent): void {\n const action = listAction(event);\n\n if (!action) {\n return;\n }\n event.preventDefault();\n\n if (action === 'enter') {\n this.activate(this.cursor.current(this.flat));\n } else {\n this.cursor.move(action === 'down' ? 1 : -1, this.flat.length);\n this.cdr.markForCheck();\n }\n }\n\n activate(item?: PaletteItem): void {\n if (activateItem(item, this.activateDeps())) {\n this.palette.close();\n }\n }\n\n isActive(item: PaletteItem): boolean {\n return this.cursor.isActive(this.flat, item);\n }\n\n private activateDeps() {\n return buildActivateDeps({\n sidebar: this.sidebar,\n navIndex: this.navIndex,\n router: this.router,\n translate: key => this.transloco.translate(key),\n notify: this.toast\n });\n }\n\n private rebuild(): void {\n this.groups = composeGroups({\n navIndex: this.navIndex,\n recents: this.recents,\n currentUrl: this.router.url,\n people: this.people,\n query: this.query,\n translate: key => this.transloco.translate(key),\n current: PermissionService.selectedProduct\n });\n this.flat = flattenItems(this.groups);\n this.cursor.reset();\n this.cdr.markForCheck();\n }\n\n private reset(): void {\n this.query = '';\n this.people = [];\n this.rebuild();\n setTimeout(() => this.queryInput?.nativeElement?.focus());\n }\n}\n","<!-- Navbar trigger — keeps the familiar search affordance, states the shortcut. -->\n<button type=\"button\"\n class=\"pw-palette-trigger\"\n (click)=\"palette.open()\"\n [attr.aria-label]=\"'CommandPalette.Trigger.Label' | transloco\">\n <i class=\"fas fa-magnifying-glass pw-palette-trigger-icon\" aria-hidden=\"true\"></i>\n <span class=\"pw-palette-trigger-text\">{{ 'CommandPalette.Trigger.Text' | transloco }}</span>\n <kbd class=\"pw-palette-kbd pw-palette-trigger-kbd\">{{ shortcutHint }}</kbd>\n</button>\n\n<!--\n Native <dialog> opened with showModal(): the platform supplies the modal\n semantics this used to hand-roll — the implicit dialog role and modal flag, a real\n focus trap, inert background content, Escape-to-close, and a ::backdrop we\n style instead of painting our own overlay <div>.\n\n The element is always in the DOM (a closed <dialog> is display:none) so the\n component holds one stable handle to call showModal()/close() on; only the\n contents are gated on isOpen so the results list costs nothing while closed.\n-->\n<dialog #paletteDialog\n class=\"pw-palette\"\n [attr.aria-label]=\"'CommandPalette.Aria.Dialog' | transloco\"\n (close)=\"onDialogClose()\">\n @if (isOpen) {\n <div class=\"pw-palette-search\">\n <i class=\"fas fa-magnifying-glass pw-palette-search-icon\" aria-hidden=\"true\"></i>\n <input #queryInput\n type=\"text\"\n class=\"pw-palette-field\"\n autocomplete=\"off\"\n [value]=\"query\"\n (input)=\"onQueryInput($any($event.target).value)\"\n (keydown)=\"onKeydown($event)\"\n [attr.placeholder]=\"'CommandPalette.Placeholder' | transloco\"\n [attr.aria-label]=\"'CommandPalette.Placeholder' | transloco\" />\n <kbd class=\"pw-palette-kbd\">esc</kbd>\n </div>\n\n <div class=\"pw-palette-results\">\n @for (group of groups; track group.labelKey) {\n <div class=\"pw-palette-group\">\n <p class=\"pw-palette-group-label\">{{ group.labelKey | transloco }}</p>\n @for (item of group.items; track item.id) {\n <button type=\"button\"\n class=\"pw-palette-row\"\n [class.is-active]=\"isActive(item)\"\n (click)=\"activate(item)\">\n <i class=\"pw-palette-row-icon\" [ngClass]=\"item.icon\" aria-hidden=\"true\"></i>\n <span class=\"pw-palette-row-label\">\n @if (item.kind === 'ask-ai') {\n {{ 'CommandPalette.Ask.Label' | transloco: { company: brandName } }}\n @if (item.label) {\n <span class=\"pw-palette-row-prefix\">— {{ item.label }}</span>\n }\n } @else if (item.labelKey) {\n <!-- Action rows are chrome, so they translate (C17), as do page\n rows that carry a key; person rows render the data's own text. -->\n {{ item.labelKey | transloco }}\n } @else {\n {{ item.label }}\n }\n </span>\n @if (item.detail) {\n <span class=\"pw-palette-row-detail\">{{ item.detailKey ? (item.detailKey | transloco) : item.detail }}</span>\n }\n </button>\n }\n </div>\n } @empty {\n <div class=\"pw-palette-empty\">\n <p class=\"pw-palette-empty-title\">{{ 'CommandPalette.Empty.Title' | transloco }}</p>\n <p class=\"pw-palette-empty-hint\">{{ 'CommandPalette.Empty.Hint' | transloco }}</p>\n </div>\n }\n </div>\n\n <div class=\"pw-palette-footer\">\n <span class=\"pw-palette-hint\"><kbd class=\"pw-palette-kbd\">↑↓</kbd>{{ 'CommandPalette.Hint.Navigate' | transloco }}</span>\n <span class=\"pw-palette-hint\"><kbd class=\"pw-palette-kbd\">↵</kbd>{{ 'CommandPalette.Hint.Open' | transloco }}</span>\n <span class=\"pw-palette-hint\"><kbd class=\"pw-palette-kbd\">esc</kbd>{{ 'CommandPalette.Hint.Close' | transloco }}</span>\n </div>\n }\n</dialog>\n","import { CommonModule, DOCUMENT } from '@angular/common';\nimport { Component, HostBinding, Inject, Input, OnInit, signal } from '@angular/core';\n\nimport { CoreTranslocoModule } from '@posiwise/core-transloco';\n\nimport { TranslocoService } from '@jsverse/transloco';\n\nconst DEFAULT_COOKIE_KEY = 'cookieconsent_status';\nconst DEFAULT_COOKIE_VALUE = 'dismiss';\n// 365 days: this is a notice banner (GA runs unconditionally), not a consent gate,\n// so there's no compliance reason to re-prompt sooner. Revisit if we ever add a\n// real consent gate (e.g. GDPR opt-in for EU users).\nconst DEFAULT_COOKIE_TTL_DAYS = 365;\n\n@Component({\n selector: 'pw-cookie-banner',\n templateUrl: './pw-cookie-banner.component.html',\n styleUrls: ['./pw-cookie-banner.component.scss'],\n standalone: true,\n imports: [CommonModule, CoreTranslocoModule]\n})\nexport class PwCookieBannerComponent implements OnInit {\n // Copy inputs default to null so the template falls back to the translated text;\n // a caller that passes its own string still wins.\n @Input() title: string | null = null;\n @Input() message: string | null = null;\n @Input() acceptLabel: string | null = null;\n @Input() privacyLinkLabel: string | null = null;\n @Input() privacyLinkUrl: string | null = null;\n @Input() privacyFallbackUrl = '/privacy-policy';\n @Input() cookieKey = DEFAULT_COOKIE_KEY;\n @Input() cookieTtlDays = DEFAULT_COOKIE_TTL_DAYS;\n\n // Signals, not plain fields: the app is zoneless, so the post-fade removal in a\n // setTimeout would otherwise never re-render and the invisible banner keeps\n // swallowing clicks.\n readonly visible = signal(false);\n readonly leaving = signal(false);\n\n @HostBinding('attr.role') readonly role = 'region';\n @HostBinding('attr.aria-label') get ariaLabel(): string {\n return this.translation.translate('CookieBanner.AriaLabel');\n }\n\n constructor(\n @Inject(DOCUMENT) private readonly document: Document,\n private readonly translation: TranslocoService\n ) {}\n\n ngOnInit(): void {\n this.visible.set(!this.hasConsentCookie());\n }\n\n get resolvedPrivacyUrl(): string {\n if (this.privacyLinkUrl) return this.privacyLinkUrl;\n return this.privacyFallbackUrl ?? '/privacy-policy';\n }\n\n accept(): void {\n this.setConsentCookie();\n this.animateOut();\n }\n\n private animateOut(): void {\n this.leaving.set(true);\n setTimeout(() => {\n this.visible.set(false);\n this.leaving.set(false);\n }, 220);\n }\n\n private hasConsentCookie(): boolean {\n const cookies = this.document.cookie?.split(';') ?? [];\n return cookies.map(c => c.trim()).some(c => c.startsWith(`${this.cookieKey}=`));\n }\n\n private setConsentCookie(): void {\n const expires = new Date();\n expires.setDate(expires.getDate() + this.cookieTtlDays);\n const parts = [\n `${this.cookieKey}=${DEFAULT_COOKIE_VALUE}`,\n `expires=${expires.toUTCString()}`,\n 'path=/',\n 'SameSite=Lax'\n ];\n if (this.document.location?.protocol === 'https:') {\n parts.push('Secure');\n }\n this.document.cookie = parts.join('; ');\n }\n}\n","@if (visible()) {\n <div\n class=\"pw-cookie-banner\"\n [class.pw-cookie-banner--leaving]=\"leaving()\">\n <div class=\"pw-cookie-banner__icon\" aria-hidden=\"true\">\n <i class=\"fas fa-cookie-bite\"></i>\n </div>\n <div class=\"pw-cookie-banner__body\">\n <h3 class=\"pw-cookie-banner__title\">{{ title ?? ('CookieBanner.Title' | transloco) }}</h3>\n <p class=\"pw-cookie-banner__message\">\n {{ message ?? ('CookieBanner.Message' | transloco) }}\n <a\n class=\"pw-cookie-banner__link\"\n [href]=\"resolvedPrivacyUrl\"\n target=\"_blank\"\n rel=\"noopener\">\n {{ privacyLinkLabel ?? ('CookieBanner.PrivacyLink' | transloco) }}\n </a>\n </p>\n </div>\n <div class=\"pw-cookie-banner__actions\">\n <button\n type=\"button\"\n class=\"pw-cookie-banner__accept\"\n (click)=\"accept()\">\n {{ acceptLabel ?? ('CookieBanner.Accept' | transloco) }}\n </button>\n </div>\n </div>\n}\n","import { Component, Input } from '@angular/core';\n\nimport { ResolvedBinding } from '../ui-config.model';\n\n// chart block. Phase 1 renders the titled frame + binding state only — real\n// charting is a Phase 3 registry expansion (ticket #933 §7). Kept minimal and\n// neutral; no charting library or bespoke look introduced here (doctrine:\n// build spec'd structure with existing patterns, do not invent a look).\n@Component({\n selector: 'pw-chart-block',\n standalone: false,\n template: `\n <div class=\"dyn-chart\">\n <div class=\"dyn-chart__label\">{{ title }}</div>\n <div class=\"dyn-chart__state\">\n {{ 'DynamicPage.State.' + (binding?.state || 'unavailable') | transloco }}\n </div>\n </div>\n `,\n styles: [\n `\n .dyn-chart {\n border: 1px solid var(--line, #e2e5ea);\n border-radius: 8px;\n padding: 16px;\n min-height: 96px;\n background: var(--surface, #fff);\n }\n .dyn-chart__label {\n color: var(--ink-2, #5a6473);\n font-size: 12px;\n font-weight: 500;\n margin-bottom: 8px;\n }\n .dyn-chart__state {\n color: var(--ink-3, #7c8696);\n font-size: 12px;\n }\n `\n ]\n})\nexport class ChartBlockComponent {\n @Input() props: Record<string, unknown> = {};\n @Input() binding: ResolvedBinding | null = null;\n\n get title(): string {\n const value = this.props?.['title'];\n return typeof value === 'string' ? value : '';\n }\n}\n","import { Component, Input } from '@angular/core';\n\nimport { ResolvedBinding } from '../ui-config.model';\n\n// data-table block. Renders bound rows as a lean, dense, hairline table\n// (App/Dashboard surface profile). Cells use interpolation only — never\n// innerHTML (#933 §6.1). Non-ok / empty bindings degrade to a state label.\n@Component({\n selector: 'pw-data-table-block',\n standalone: false,\n template: `\n @if (binding?.state === 'ok' && rows.length) {\n <table class=\"dyn-table\">\n <thead>\n <tr>\n @for (col of columns; track col) {\n <th>{{ col }}</th>\n }\n </tr>\n </thead>\n <tbody>\n @for (row of rows; track $index) {\n <tr>\n @for (col of columns; track col) {\n <td>{{ cell(row, col) }}</td>\n }\n </tr>\n }\n </tbody>\n </table>\n } @else {\n <div class=\"dyn-table__state\">\n {{ 'DynamicPage.State.' + stateKey | transloco }}\n </div>\n }\n `,\n styles: [\n `\n .dyn-table {\n width: 100%;\n border-collapse: collapse;\n font-variant-numeric: tabular-nums;\n }\n .dyn-table th,\n .dyn-table td {\n border-bottom: 1px solid var(--line, #e2e5ea);\n padding: 8px 12px;\n text-align: left;\n font-size: 14px;\n }\n .dyn-table th {\n color: var(--ink-2, #5a6473);\n font-weight: 500;\n }\n .dyn-table__state {\n color: var(--ink-3, #7c8696);\n font-size: 12px;\n padding: 12px;\n }\n `\n ]\n})\nexport class DataTableBlockComponent {\n @Input() props: Record<string, unknown> = {};\n @Input() binding: ResolvedBinding | null = null;\n\n get columns(): string[] {\n const cols = this.props?.['columns'];\n return Array.isArray(cols) ? cols.map(String) : [];\n }\n\n get rows(): Array<Record<string, unknown>> {\n const value = this.binding?.value as unknown;\n if (Array.isArray(value)) {\n return value.filter(\n (row): row is Record<string, unknown> => typeof row === 'object' && row !== null\n );\n }\n return [];\n }\n\n get stateKey(): string {\n if (this.binding?.state === 'ok') {\n return 'empty';\n }\n return this.binding?.state || 'unavailable';\n }\n\n cell(row: Record<string, unknown>, col: string): string {\n const value = row?.[col];\n return value === undefined || value === null ? '' : String(value);\n }\n}\n","import { Component, Input } from '@angular/core';\n\n// divider block — pure structural separator. Hairline neutral rule per the\n// design system (Refined Utilitarian, accent-agnostic — no --first).\n@Component({\n selector: 'pw-divider-block',\n standalone: false,\n template: `<hr class=\"dyn-divider\" [style.margin]=\"spacing + 'px 0'\" />`,\n styles: [\n `\n .dyn-divider {\n border: 0;\n border-top: 1px solid var(--line, #e2e5ea);\n opacity: 1;\n }\n `\n ]\n})\nexport class DividerBlockComponent {\n @Input() props: Record<string, unknown> = {};\n\n get spacing(): number {\n const value = Number(this.props?.['spacing']);\n return Number.isFinite(value) && value >= 0 && value <= 64 ? value : 16;\n }\n}\n","import { Component, Input } from '@angular/core';\n\n// section-heading block. Maps the config's semantic `level` to a real\n// heading element ONLY — no Bootstrap size utility, no bespoke class, no\n// component styles. The platform's global heading styling applies (same as\n// every sibling tab page's bare <hN>), so spacing/typography stay consistent\n// by construction (design-doctrine §2 #3: rely on the shared layer, never a\n// component-local override). Text via interpolation — never innerHTML (§6.1).\n@Component({\n selector: 'pw-section-heading-block',\n standalone: false,\n template: `\n @switch (level) {\n @case (1) {\n <h1>{{ text }}</h1>\n }\n @case (2) {\n <h2>{{ text }}</h2>\n }\n @case (3) {\n <h3>{{ text }}</h3>\n }\n @default {\n <h4>{{ text }}</h4>\n }\n }\n `\n})\nexport class SectionHeadingBlockComponent {\n @Input() props: Record<string, unknown> = {};\n\n get text(): string {\n const value = this.props?.['text'];\n return typeof value === 'string' ? value : '';\n }\n\n get level(): number {\n const value = Number(this.props?.['level']);\n return value >= 1 && value <= 4 ? value : 2;\n }\n}\n","import { Component, Input } from '@angular/core';\n\nimport { ResolvedBinding } from '../ui-config.model';\n\n// stat-card block. Title + a single bound metric. Neutral hairline card per\n// the design system (App/Dashboard surface — dense, tabular-nums, no --first\n// for hierarchy). Non-ok bindings degrade to a quiet state label (C17 i18n).\n@Component({\n selector: 'pw-stat-card-block',\n standalone: false,\n template: `\n <div class=\"dyn-card\">\n <div class=\"dyn-card__label\">{{ title }}</div>\n @if (binding?.state === 'ok') {\n <div class=\"dyn-card__value\">{{ metricValue }}</div>\n } @else {\n <div class=\"dyn-card__state\">\n {{ 'DynamicPage.State.' + (binding?.state || 'unavailable') | transloco }}\n </div>\n }\n </div>\n `,\n styles: [\n `\n .dyn-card {\n border: 1px solid var(--line, #e2e5ea);\n border-radius: 8px;\n padding: 16px;\n background: var(--surface, #fff);\n }\n .dyn-card__label {\n color: var(--ink-2, #5a6473);\n font-size: 12px;\n font-weight: 500;\n }\n .dyn-card__value {\n color: var(--ink, #1a1d21);\n font-size: 24px;\n font-weight: 700;\n font-variant-numeric: tabular-nums;\n }\n .dyn-card__state {\n color: var(--ink-3, #7c8696);\n font-size: 12px;\n }\n `\n ]\n})\nexport class StatCardBlockComponent {\n @Input() props: Record<string, unknown> = {};\n @Input() binding: ResolvedBinding | null = null;\n\n get title(): string {\n const value = this.props?.['title'];\n return typeof value === 'string' ? value : '';\n }\n\n get metricValue(): string {\n const key = String(this.props?.['metric_label'] ?? 'member_count');\n const raw = this.binding?.value?.[key];\n return raw === undefined || raw === null ? '—' : String(raw);\n }\n}\n","import { Type } from '@angular/core';\n\nimport { ChartBlockComponent } from './blocks/chart-block.component';\nimport { DataTableBlockComponent } from './blocks/data-table-block.component';\nimport { DividerBlockComponent } from './blocks/divider-block.component';\nimport { SectionHeadingBlockComponent } from './blocks/section-heading-block.component';\nimport { StatCardBlockComponent } from './blocks/stat-card-block.component';\n\n// Code-defined registry — structurally mirrors main-api\n// UiConfig::ComponentRegistry. The renderer instantiates ONLY these classes\n// (never a string, never ngComponentOutlet from server data) — ticket #933\n// §5.2/§6.1. New block types ship with releases only.\nexport const COMPONENT_REGISTRY: Readonly<Record<string, Type<unknown>>> = Object.freeze({\n 'section-heading': SectionHeadingBlockComponent,\n divider: DividerBlockComponent,\n 'stat-card': StatCardBlockComponent,\n 'data-table': DataTableBlockComponent,\n chart: ChartBlockComponent\n});\n\nexport function registeredType(type: string): Type<unknown> | null {\n return Object.prototype.hasOwnProperty.call(COMPONENT_REGISTRY, type)\n ? COMPONENT_REGISTRY[type]\n : null;\n}\n\nexport function registeredTypeNames(): string[] {\n return Object.keys(COMPONENT_REGISTRY);\n}\n","import { registeredType } from './component-registry';\nimport { UiBlock, UiLayoutConfig } from './ui-config.model';\n\n// Defensive client-side mirror of main-api UiConfig::SchemaValidator. The\n// SERVER is the authority (#933 §5.1/§6.4) — this exists only so the renderer\n// never attempts to instantiate an unregistered type if a malformed config\n// ever reaches the client. It validates structure, not authorization.\nexport interface UiConfigValidation {\n valid: boolean;\n errors: string[];\n}\n\nexport function validateUiConfig(config: unknown): UiConfigValidation {\n if (!config || typeof config !== 'object') {\n return { valid: false, errors: ['config must be an object'] };\n }\n const doc = config as Partial<UiLayoutConfig>;\n if (!Array.isArray(doc.blocks)) {\n return { valid: false, errors: ['blocks must be an array'] };\n }\n const errors: string[] = [];\n doc.blocks.forEach((block, index) => collectBlockErrors(block, index, errors));\n return { valid: errors.length === 0, errors };\n}\n\nfunction collectBlockErrors(block: unknown, index: number, errors: string[]): void {\n const path = `blocks[${index}]`;\n if (!block || typeof block !== 'object') {\n errors.push(`${path} must be an object`);\n return;\n }\n const candidate = block as UiBlock;\n if (typeof candidate.id !== 'string' || !candidate.id.trim()) {\n errors.push(`${path}.id must be a non-empty string`);\n }\n if (!registeredType(candidate.type)) {\n errors.push(`${path}.type not registered: ${String(candidate.type)}`);\n }\n if (!candidate.grid || typeof candidate.grid !== 'object') {\n errors.push(`${path}.grid must be an object`);\n }\n}\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Component,\n ComponentRef,\n Injector,\n Input,\n OnDestroy,\n Optional,\n ViewChild,\n ViewContainerRef\n} from '@angular/core';\n\nimport { AppConfigService } from '@posiwise/app-config-service';\nimport { FeatureFlagService, UserService } from '@posiwise/common-services';\n\nimport { take } from 'rxjs/operators';\n\nimport { CollapsibleSidebarService } from '../collapsible-sidebar/collapsible-sidebar.service';\n\nimport { registeredType } from './component-registry';\nimport { UiBlock, UiLayoutConfig } from './ui-config.model';\nimport { validateUiConfig } from './ui-config-validator';\n\nexport const UI_BUILDER_FLAG = 'conversational_ui_builder';\n\n// Conversational UI Builder renderer (#933 §5.2/§5.6/§6.1). Instantiates ONLY\n// registered component classes via createComponent(Type) — never innerHTML /\n// bypassSecurityTrust* / ngComponentOutlet. Feature-flag gated.\n@Component({\n selector: 'pw-dynamic-page',\n standalone: false,\n template: `\n @if (enabled) {\n <div class=\"dyn-page\"><ng-container #host></ng-container></div>\n @if (showEmpty) {\n <div class=\"dyn-empty\">\n <div class=\"dyn-empty__title\">{{ 'DynamicPage.Empty.Title' | transloco }}</div>\n <p class=\"dyn-empty__hint\">\n {{ 'DynamicPage.Empty.Hint' | transloco: { brand: brandName } }}\n </p>\n <button type=\"button\" class=\"btn btn-primary\" (click)=\"openBuilder()\">\n {{ 'DynamicPage.Empty.Cta' | transloco: { brand: brandName } }}\n </button>\n </div>\n }\n }\n `,\n styles: [\n `\n .dyn-page {\n display: grid;\n grid-template-columns: repeat(12, 1fr);\n gap: 16px;\n }\n :host ::ng-deep .dyn-page > * {\n grid-column: span 12;\n }\n .dyn-empty {\n border: 1px solid var(--line, #e2e5ea);\n border-radius: 8px;\n background: var(--surface, #fff);\n padding: 48px 24px;\n text-align: center;\n }\n .dyn-empty__title {\n color: var(--ink, #1a1d21);\n font-size: 17px;\n font-weight: 700;\n margin-bottom: 4px;\n }\n .dyn-empty__hint {\n color: var(--ink-3, #7c8696);\n font-size: 14px;\n margin: 0 auto 16px;\n max-width: 420px;\n }\n `\n ]\n})\nexport class PwDynamicPageComponent implements AfterViewInit, OnDestroy {\n @ViewChild('host', { read: ViewContainerRef }) host!: ViewContainerRef;\n\n // config arrives async (after ngAfterViewInit) — re-render on change.\n private _config: UiLayoutConfig | null = null;\n private viewReady = false;\n // True once a fetch resolved (even to empty) — drives the empty state.\n private configResolved = false;\n\n @Input()\n set config(value: UiLayoutConfig | null) {\n this._config = value;\n this.configResolved = true;\n if (this.viewReady) {\n this.render();\n this.cdr.detectChanges();\n }\n }\n\n get config(): UiLayoutConfig | null {\n return this._config;\n }\n\n private refs: ComponentRef<unknown>[] = [];\n\n // Self-hydrate FeatureFlagService.user (guards set it normally — see module-guard.service.ts:22).\n private userResolved = false;\n private resolving = false;\n\n constructor(\n private readonly injector: Injector,\n private readonly cdr: ChangeDetectorRef,\n private readonly featureFlags: FeatureFlagService,\n @Optional() private readonly userService?: UserService,\n @Optional() private readonly sidebarService?: CollapsibleSidebarService,\n @Optional() private readonly appConfigService?: AppConfigService\n ) {}\n\n // White-label brand = domain_metadata company.name (NOT .title placeholder).\n brandName = 'PosiWise';\n\n get enabled(): boolean {\n return this.featureFlags.isEnabled(UI_BUILDER_FLAG);\n }\n\n // Enabled + fetch resolved + nothing rendered → \"no layout yet\" (design-doctrine §2 #1).\n get showEmpty(): boolean {\n return this.enabled && this.configResolved && this.refs.length === 0;\n }\n\n openBuilder(): void {\n // Opens the Brain chat panel (Phase-1 creation path; persist = Phase 2).\n this.sidebarService?.loadContent('posiwise-brain');\n }\n\n ngAfterViewInit(): void {\n this.viewReady = true;\n this.appConfigService?.appConfig$.pipe(take(1)).subscribe(config => {\n const name = (config as { company?: { name?: string } })?.company?.name;\n if (name) {\n this.brandName = name;\n }\n this.cdr.detectChanges();\n });\n this.render();\n this.cdr.detectChanges();\n }\n\n ngOnDestroy(): void {\n this.clear();\n }\n\n private render(): void {\n this.ensureUser(() => this.doRender());\n }\n\n // Resolve the current user once if FeatureFlagService.user is unset.\n private ensureUser(done: () => void): void {\n if (this.userResolved || this.featureFlags.user || !this.userService) {\n done();\n return;\n }\n if (this.resolving) {\n return;\n }\n this.resolving = true;\n this.userService\n .getUserInfo()\n .pipe(take(1))\n .subscribe({\n next: user => {\n if (!this.featureFlags.user) {\n this.featureFlags.user = user;\n }\n this.userResolved = true;\n this.resolving = false;\n done();\n this.cdr.detectChanges();\n },\n error: () => {\n this.userResolved = true;\n this.resolving = false;\n done();\n }\n });\n }\n\n private doRender(): void {\n this.clear();\n if (!this.enabled || !this.host || !this.config) {\n return;\n }\n if (!validateUiConfig(this.config).valid) {\n return;\n }\n this.config.blocks.forEach(block => this.mount(block));\n }\n\n private mount(block: UiBlock): void {\n const type = registeredType(block.type);\n if (!type) {\n return; // unknown type → skip; never inject markup or a string\n }\n const ref = this.host.createComponent(type, { injector: this.injector });\n Object.assign(ref.instance as object, {\n props: block.props ?? {},\n binding: block.binding ?? null\n });\n ref.changeDetectorRef.markForCheck();\n this.refs.push(ref);\n }\n\n private clear(): void {\n this.refs.forEach(ref => ref.destroy());\n this.refs = [];\n this.host?.clear();\n }\n}\n","import { ChangeDetectorRef, Component, Injector, Input } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AuthService } from '@posiwise/common-services';\n\n@Component({\n selector: 'pw-header',\n templateUrl: './header.component.html',\n styleUrls: ['./header.component.scss'],\n\n standalone: false\n})\nexport class HeaderComponent extends AppBaseComponent {\n loggedIn: boolean;\n isMenuCollapsed = true;\n\n constructor(\n injector: Injector,\n private readonly authService: AuthService,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n this.authService\n .getToken$()\n .pipe()\n .subscribe(res => {\n this.loggedIn = !!res;\n this.cdr.markForCheck();\n });\n }\n\n @Input() landing = false;\n\n navigateToLogin() {\n window.location.href = '/login';\n }\n\n toggleMenu() {\n this.isMenuCollapsed = !this.isMenuCollapsed;\n }\n\n private logoFailed = false;\n\n get logo(): string | null {\n if (this.logoFailed) return null;\n return (\n this.appConfig?.company?.logos?.main_dark?.url ||\n this.appConfig?.company?.logos?.main?.url ||\n this.appConfig?.company?.logos?.main_contrast?.url ||\n null\n );\n }\n\n onLogoError() {\n this.logoFailed = true;\n this.cdr.markForCheck();\n }\n}\n","<header class=\"pw-bar\" [class.pw-bar--solid]=\"!landing\">\n <div class=\"pw-bar__inner\">\n <a class=\"pw-bar__brand\" href=\"/\">\n @if (logo) {\n <img class=\"pw-bar__brand-logo\" [src]=\"logo\" alt=\"\" (error)=\"onLogoError()\" />\n }\n <span class=\"visually-hidden\">Home</span>\n </a>\n\n <div class=\"pw-bar__actions\">\n @if (!loggedIn) {\n <button type=\"button\" class=\"pw-bar__login\" (click)=\"navigateToLogin()\">\n {{ 'Button.Login' | transloco }}\n </button>\n }\n <a class=\"pw-bar__cta\" href=\"/\">\n {{ 'Button.Home' | transloco }}\n </a>\n <button type=\"button\"\n class=\"pw-bar__toggle\"\n [class.pw-bar__toggle--open]=\"!isMenuCollapsed\"\n [attr.aria-expanded]=\"!isMenuCollapsed\"\n aria-label=\"Toggle menu\"\n (click)=\"toggleMenu()\">\n <span></span><span></span><span></span>\n </button>\n </div>\n </div>\n</header>\n","import {\n ChangeDetectorRef,\n Component,\n Injector,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewChild\n} from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { GroupService, PermissionService, SubscriptionService } from '@posiwise/common-services';\nimport { Subscription, TAG_ENTITY, User } from '@posiwise/common-utilities';\nimport { HelperService } from '@posiwise/helper-service';\n\nimport { NgbModal } from '@ng-bootstrap/ng-bootstrap';\n\nimport { EnrolledUser, SharedModalContext } from '../../shared/shared-component.interface';\n\n@Component({\n selector: 'pw-entity-group',\n templateUrl: './entity-group.component.html',\n styleUrls: ['./entity-group.component.scss'],\n\n standalone: false\n})\nexport class EntityGroupComponent extends AppBaseComponent implements OnInit, OnDestroy {\n @ViewChild('content', { static: true }) content: TemplateRef<SharedModalContext>;\n\n subscription: Subscription;\n subscriptionId: number;\n\n user: User;\n userId: number;\n\n entityId: number;\n selectedGroup: { name: string };\n\n subscriptionMembers = []; // Holds all the members\n subscribedMembers = []; // Holds all the members\n filteredMembers = []; // Populates in the autocomplete\n selectedMembers = []; // Selected in the autocomplete\n\n enrolledUsers: EnrolledUser[];\n\n admins = [];\n subscriptionInfo = [];\n subscriptionOwner: number;\n\n /** Chat permission for the selected product, read at render time (#4228). */\n get chatPermission(): string | null {\n return PermissionService.productPermission('Chat');\n }\n\n isLoaded = false;\n\n hasAccess: boolean;\n\n constructor(\n private readonly groupService: GroupService,\n private readonly subscriptionService: SubscriptionService,\n private readonly modalService: NgbModal,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n ngOnInit() {\n this.getUserSubscription().subscribe(response => {\n this.subscription = response;\n if (this.subscription?.id) {\n this.getSubscribedUsers();\n }\n this.cdr.markForCheck();\n });\n this.route.params.subscribe(params => {\n this.entityId = Number(params['groupId']);\n this.getEntity();\n this.cdr.markForCheck();\n });\n this.userStore().subscribe(user => {\n this.user = user;\n if (this.user) {\n this.userId = this.user.id;\n }\n this.cdr.markForCheck();\n });\n }\n\n search(event) {\n let data = [];\n if (event.query) {\n data = this.subscriptionMembers.filter((x: { displayName: string }) => {\n return x.displayName.toLowerCase().includes(event.query.toLowerCase());\n });\n } else {\n this.subscriptionMembers.forEach(element => {\n data.push(element);\n });\n }\n this.filteredMembers = data;\n }\n\n open() {\n this.groupService.getSubscriptionMembers(this.subscription?.id).subscribe(response => {\n response.members.forEach(member => {\n member.displayName = `${member.first_name ?? ''} ${member.last_name ?? ''} ${\n member.email\n }`.trim();\n });\n this.subscriptionMembers = response.members;\n this.cdr.markForCheck();\n });\n\n this.modalService.open(this.content, { centered: true, windowClass: 'modal-holder' });\n }\n\n closeModal(modal) {\n modal.close();\n this.filteredMembers = [];\n }\n\n getEntity() {\n this.groupService\n .getEntityGroup(this.entityId)\n .subscribe(response => {\n response.members.forEach(member => {\n member.displayName = `${member.first_name ?? ''} ${member.last_name ?? ''} ${\n member.email\n }`.trim();\n });\n this.subscribedMembers = response.members;\n this.selectedGroup = response;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n onSave() {\n const data = {\n entity_groups: [\n {\n related_entity_id: this.selectedMembers.map(x => x.id),\n related_entity_type: TAG_ENTITY.USER\n }\n ]\n };\n\n this.groupService.addEntityGroup(this.entityId, data).subscribe(() => {\n this.modalService.dismissAll();\n this.toast.success(this.translation.translate('Admin.Shared.Entity.AddedMessage'));\n\n this.getEntity();\n this.cdr.markForCheck();\n });\n }\n\n private getSubscribedUsers() {\n this.subscriptionService\n .getEnrolledSubscription(this.subscription?.id)\n .subscribe(response => {\n this.subscriptionOwner = response.owner_id;\n this.admins = response.admins;\n this.enrolledUsers = response.members;\n this.enrolledUsers.forEach(element => {\n element.is_owner = element?.id === this.user?.id;\n });\n this.hasAccess =\n this.admins.includes(this.user?.id) ||\n this.user?.id === this.subscriptionOwner ||\n this.permissionService.isSuperAdmin();\n this.cdr.markForCheck();\n });\n }\n\n onDelete(memberId) {\n HelperService.raiseDeletePopup()\n .then(resp => {\n if (resp.value) {\n const data = JSON.stringify([memberId]);\n this.groupService\n .deleteEntityGroup(this.entityId, data, 'User')\n .subscribe(() => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Entity.DeletedMessage')\n );\n this.getEntity();\n this.cdr.markForCheck();\n });\n }\n })\n .catch(error => this.toast.showToast(error));\n }\n\n navigateToCommunications() {\n this.router.navigate([`/${this.subscription?.slug}/enterprise/communications`], {\n queryParams: { entity_id: this.entityId }\n });\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","<div>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Team View</h2>\n\n <p>\n In this section, based on your permissions, you can add/remove members from your\n teams.\n <br />\n Then, you'll be able to see powerful insight on the activities performed by your\n team's members.\n </p>\n </div>\n </div>\n\n <div class=\"row\">\n <div class=\"col-md-6 col-xs-12 d-flex align-items-sm-center align-items-top text-start pe-0\">\n <a aria-label=\"Navigate to Target\"\n (click)=\"back()\"\n class=\"previous\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n <h3 class=\"ms-sm-2 d-inline mt-0 card-title mb-3 mb-sm-0\">\n Team view: {{ selectedGroup?.name }}\n </h3>\n </div>\n <div class=\"col-md-6 col-xs-12 text-end justify-content-end\">\n @if (hasAccess) {\n <button\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"open()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Add Members\n </button>\n }\n @if (hasAccess) {\n <button\n class=\"btn btn-sm btn-outline-primary ms-2\"\n (click)=\"navigateToCommunications()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> See Communications\n </button>\n }\n </div>\n </div>\n\n @if (!isLoaded) {\n <div class=\"w-100 mt-3\">\n <pw-skeleton-table [rows]=\"8\" [columns]=\"4\" [showCaption]=\"false\" />\n </div>\n }\n\n <div class=\"primeng-datatable-container actions-collapsed table-responsive\"\n [class.d-none]=\"!isLoaded\"\n [class.hideTable]=\"subscribedMembers?.length === 0\">\n <p-table #dt\n [value]=\"subscribedMembers\"\n [paginator]=\"true\"\n [rows]=\"PAGE_SIZE\"\n stateKey=\"pw-table.entity-group\"\n stateStorage=\"session\"\n [resizableColumns]=\"true\"\n columnResizeMode=\"expand\"\n >\n <ng-template #header>\n <tr>\n <th pResizableColumn scope=\"true\">{{ 'Label.FirstName' | transloco }}</th>\n <th pResizableColumn scope=\"true\">{{ 'Label.LastName' | transloco }}</th>\n <th pResizableColumn scope=\"true\">{{ 'Label.Email' | transloco }}</th>\n <th scope=\"true\" class=\"actions-list-three\">{{ 'Label.Actions' | transloco }}</th>\n </tr>\n </ng-template>\n <ng-template #body\n let-member>\n <tr class=\"table-row\">\n <td data-head=\"First Name\">\n <a [routerLink]=\"['/members', member.slug]\">{{ member.first_name || null }}\n </a>\n </td>\n <td data-head=\"Last Name\">{{ member.last_name || null }}</td>\n <td data-head=\"Email\">{{ member.email }}</td>\n <td data-head=\"Action\">\n <ul class=\"list-unstyled list-inline list-action\">\n @if (member.id !== userId) {\n <li pTooltip=\"Message\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n class=\"me-2 me-sm-3\"\n [routerLink]=\"['/message']\"\n [fragment]=\"member.slug\">\n <i\n class=\"fa fa-comments cta1-icon\"\n *rbacAllow=\"chatPermission\"\n aria-hidden=\"true\"\n ></i>\n </li>\n }\n @if (hasAccess) {\n <li pTooltip=\"Remove\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n class=\"me-2 me-sm-3\"\n (click)=\"onDelete(member.id)\"\n (keydown.enter)=\"onDelete(member.id)\"\n (keydown.space)=\"onDelete(member.id)\"\n >\n <i class=\"fa fa-trash delete-icon\" aria-hidden=\"true\"></i>\n </li>\n }\n </ul>\n </td>\n </tr>\n </ng-template>\n </p-table>\n </div>\n @if (subscribedMembers?.length === 0 && isLoaded) {\n <pw-no-data [withImage]=\"true\" message=\"There are no members in this team yet.\"\n >\n </pw-no-data>\n }\n </div>\n\n <ng-template #content\n let-modal>\n <div class=\"modal-header\">\n <h4 class=\"modal-title\"\n id=\"modal-basic-title\">Add Members</h4>\n <button type=\"button\"\n class=\"btn-close float-end\"\n aria-label=\"Close\"\n (click)=\"modal.dismiss()\">\n\n </button>\n </div>\n <div class=\"modal-body\">\n <p>Please start typing to select the members to add to this team.</p>\n <div class=\"ui-fluid skills-modal\">\n <p-auto-complete class=\"w-100\" appendTo=\"body\" [suggestions]=\"filteredMembers\"\n [(ngModel)]=\"selectedMembers\"\n dataKey=\"id\"\n optionLabel=\"displayName\"\n (completeMethod)=\"search($event)\"\n placeholder=\"Member\"\n [multiple]=\"true\">\n </p-auto-complete>\n </div>\n </div>\n <div class=\"modal-footer\">\n <button type=\"button\"\n class=\"btn btn-outline-default\"\n (click)=\"closeModal(modal)\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n class=\"btn btn-primary\"\n (click)=\"onSave()\">\n {{ 'Button.Save' | transloco }}\n </button>\n </div>\n </ng-template>\n","import {\n AfterViewInit,\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n inject,\n signal\n} from '@angular/core';\n\n/**\n * A form's Cancel / Submit row that stays on screen while a long form scrolls. Put the buttons inside\n * it. Pages that hold it rely on the `@posiwise/core-styles` rule that stops the shell's\n * `.overflow-hidden` containers from trapping a sticky element.\n */\n@Component({\n selector: 'pw-sticky-actions',\n standalone: true,\n templateUrl: './pw-sticky-actions.component.html',\n styleUrls: ['./pw-sticky-actions.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { '[class.is-floating]': 'floating()' }\n})\nexport class PwStickyActionsComponent implements AfterViewInit {\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly destroyRef = inject(DestroyRef);\n /** True while the bar is pinned over the form rather than resting below it. */\n readonly floating = signal(false);\n\n /**\n * The bar sits at `bottom: -1px`, so while it is pinned one pixel is off the bottom of the screen.\n * A bar cut off at the top is scrolling away under the header, not pinned.\n */\n ngAfterViewInit(): void {\n if (typeof IntersectionObserver === 'undefined') return;\n const observer = new IntersectionObserver(\n ([entry]) =>\n this.floating.set(\n entry.intersectionRatio < 1 &&\n entry.boundingClientRect.bottom > (entry.rootBounds?.bottom ?? innerHeight)\n ),\n { threshold: [1] }\n );\n observer.observe(this.el.nativeElement);\n this.destroyRef.onDestroy(() => observer.disconnect());\n }\n}\n","<div class=\"pw-sticky-actions\">\n <ng-content />\n</div>\n","import {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n Host,\n inject,\n Input,\n OnInit,\n Optional,\n SkipSelf\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { AbstractControl, ControlContainer, NG_VALUE_ACCESSOR } from '@angular/forms';\n\n@Component({\n selector: 'pw-input-container',\n templateUrl: './input-container.component.html',\n styleUrls: ['./input-container.component.scss'],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n useExisting: InputContainerComponent,\n multi: true\n }\n ],\n standalone: false\n})\nexport class InputContainerComponent implements OnInit {\n control: AbstractControl;\n\n @Input()\n name: string;\n\n /** Id of the form control; used as the label's `for` attribute for accessibility. When not set, falls back to `name`. */\n @Input()\n controlId: string;\n\n /** When true, label gets id=\"{{ controlId }}-label\" but no `for`; use with aria-labelledby on the control (e.g. quill-editor). */\n @Input()\n useAriaLabelledbyOnly = false;\n\n @Input()\n label: string;\n\n @Input()\n labelClass: string;\n\n @Input()\n tooltipPosition: string;\n\n @Input()\n required = false;\n\n @Input()\n errorMsg = 'An error occurred';\n\n @Input()\n isReadOnly = false;\n\n @Input()\n showTooltip: boolean;\n\n @Input()\n tooltipText: string;\n\n @Input()\n showTriangle = false;\n\n @Input()\n afterLabel: string;\n\n @Input()\n showAfterLabel: boolean;\n\n @Input()\n showTriangleText: string;\n\n @Input()\n isLeftTooltip = false;\n\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly destroyRef = inject(DestroyRef);\n\n constructor(\n @Optional()\n @Host()\n @SkipSelf()\n private readonly controlContainer: ControlContainer\n ) {}\n\n ngOnInit() {\n if (this.controlContainer) {\n if (this.name) {\n this.control = this.controlContainer.control.get(this.name);\n if (this.control?.validator) {\n const validator = this.control.validator({} as AbstractControl);\n if (validator?.['required']) {\n this.required = true;\n }\n }\n this.refreshOnControlEvents();\n }\n }\n }\n\n /**\n * Angular 22 makes components OnPush unless they opt out, and this one's inputs\n * never change when the control does. Without this, `markAllAsTouched()` on a\n * failed submit leaves every error message hidden and the button looks dead.\n */\n private refreshOnControlEvents(): void {\n this.control?.events\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => this.cdr.markForCheck());\n }\n}\n","@if (useAriaLabelledbyOnly) {\n <span class=\"pw-input-container-label mb-2 d-block\" [attr.id]=\"controlId ? (controlId + '-label') : null\">\n <span [class]=\"labelClass\"\n [ngClass]=\"{ mandatory: required && !control?.disabled }\">\n {{ label }}\n </span>\n @if (showTooltip && tooltipText) {\n <span class=\"info-circle tooltip-wrap ms-1\"\n [pTooltip]=\"tooltipText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n </span>\n }\n @if (showTriangle) {\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'Last month this value was set to ' + showTriangleText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n <i class=\"fas fa-exclamation-triangle text-warning\"></i>\n </span>\n }\n <!-- after label -->\n @if (afterLabel && showAfterLabel) {\n <span\n [innerHTML]=\"afterLabel\"></span>\n }\n <!-- after label end -->\n </span>\n}\n@if (!useAriaLabelledbyOnly) {\n <label class=\"pw-input-container-label mb-2\" [attr.for]=\"controlId || name\">\n <span [class]=\"labelClass\"\n [ngClass]=\"{ mandatory: required && !control?.disabled }\">\n {{ label }}\n </span>\n @if (showTooltip && tooltipText) {\n <span class=\"info-circle tooltip-wrap ms-1\"\n [pTooltip]=\"tooltipText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n </span>\n }\n @if (showTriangle) {\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"'Last month this value was set to ' + showTriangleText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n <i class=\"fas fa-exclamation-triangle text-warning\"></i>\n </span>\n }\n <!-- after label -->\n @if (afterLabel && showAfterLabel) {\n <span\n [innerHTML]=\"afterLabel\"></span>\n }\n <!-- after label end -->\n </label>\n}\n\n<div class=\"mb-3\">\n <ng-content></ng-content>\n @if (control?.errors) {\n <pw-field-error-display [displayError]=\"control?.invalid && control?.touched\"\n [errorMsg]=\"errorMsg | transloco\">\n </pw-field-error-display>\n }\n</div>\n","import { ChangeDetectorRef, Component, Injector, OnDestroy, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { DataService, GroupService, SubscriptionService } from '@posiwise/common-services';\nimport { TAG_ENTITY, User } from '@posiwise/common-utilities';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { ConfirmDialogService } from '../../confirm-dialog/confirm-dialog.service';\nimport { EnrolledUser, GroupDefinition } from '../../shared/shared-component.interface';\n\n@Component({\n selector: 'pw-group-definition',\n templateUrl: './group-definition.component.html',\n styleUrls: ['./group-definition.component.scss'],\n\n standalone: false\n})\nexport class GroupDefinitionComponent extends AppBaseComponent implements OnInit, OnDestroy {\n subscriptions = [];\n\n message: number;\n\n groupDefinition: object[];\n\n form: UntypedFormGroup;\n\n id: number;\n\n viewDefinition: boolean;\n\n viewEdit: boolean;\n\n private groupDefId: number;\n\n private groupDefinitionDetails: GroupDefinition;\n\n hasAccess: boolean;\n\n admins = [];\n\n subscriptionInfo = [];\n\n subscriptionOwner: number;\n\n enrolledUsers: EnrolledUser[];\n\n user: User;\n\n isLoaded = false;\n categoryBusyButton = false;\n\n constructor(\n private readonly groupService: GroupService,\n private readonly fb: UntypedFormBuilder,\n private readonly subscriptionService: SubscriptionService,\n private readonly data: DataService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef,\n private readonly confirmDialog: ConfirmDialogService\n ) {\n super(injector);\n this.form = this.fb.group({\n name: new UntypedFormControl('', [Validators.required]),\n description: new UntypedFormControl(''),\n is_private: [true]\n });\n }\n\n ngOnInit() {\n this.getUserSubscriptionId().subscribe(id => {\n this.id = id;\n this.cdr.markForCheck();\n });\n this.getAllGroupDefinition();\n this.getSubscribedUsers();\n this.userStore().subscribe(user => {\n this.user = user;\n this.cdr.markForCheck();\n });\n this.data.currentMessage.subscribe(message => {\n this.message = message;\n this.cdr.markForCheck();\n });\n }\n\n private getAllGroupDefinition() {\n this.groupService\n .groupDefinitionGetAll(this.id, 'Subscription')\n .subscribe(response => {\n if (response.group_definitions.length > 0) {\n this.groupDefinition = response.group_definitions;\n } else {\n this.groupDefinition = [];\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n private getSubscribedUsers() {\n this.subscriptionService.getEnrolledSubscription(this.id).subscribe(response => {\n this.subscriptionOwner = response.owner_id;\n this.admins = response.admins;\n this.enrolledUsers = response.members;\n this.enrolledUsers.forEach(element => {\n element.is_owner = element?.id === this.user?.id;\n });\n this.hasAccess =\n this.admins.includes(this.user?.id) ||\n this.user?.id === this.subscriptionOwner ||\n this.permissionService.isSuperAdmin();\n this.cdr.markForCheck();\n });\n }\n\n updateDetails() {\n this.categoryBusyButton = true;\n const formValue = this.form.value;\n const data = {\n name: formValue.name,\n description: formValue.description,\n is_private: formValue.is_private\n };\n this.groupService\n .groupDefinitionsUpdate(this.groupDefId, data)\n .subscribe(() => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Definition.UpdatedMessage')\n );\n\n this.form.reset();\n this.viewDefinition = false;\n this.getAllGroupDefinition();\n this.cdr.markForCheck();\n })\n .add(() => {\n this.categoryBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n onGroupDefinitionEdit(id: number) {\n this.viewEdit = true;\n this.viewDefinition = true;\n this.groupDefId = id;\n this.getSubscriptionDetails();\n }\n\n getSubscriptionDetails() {\n this.groupService.getGroupDefinitionById(this.groupDefId).subscribe(response => {\n this.groupDefinitionDetails = response;\n this.form.patchValue({\n description: this.groupDefinitionDetails.description,\n name: this.groupDefinitionDetails.name\n });\n this.cdr.markForCheck();\n });\n }\n\n @ValidateForm('form')\n saveGroupDefinition() {\n this.categoryBusyButton = true;\n const data = {\n name: this.form.value.name,\n description: this.form.value.description,\n related_entity_id: this.id,\n related_entity_type: TAG_ENTITY.SUBSCRIPTION,\n is_private: this.form.value.is_private\n };\n this.groupService\n .groupDefinitions(data)\n .subscribe(() => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Definition.AddedMessage')\n );\n this.form.reset();\n this.getAllGroupDefinition();\n this.viewDefinition = false;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.categoryBusyButton = false;\n this.cdr.markForCheck();\n });\n }\n\n onDelete(id: number) {\n this.confirmDialog\n .open({\n title: 'Delete',\n text: 'Are you sure you want to delete this label?',\n destructive: true\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n this.groupService.groupDefinitionsDelete(id).subscribe(_ => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Definition.DeletedMessage')\n );\n this.getAllGroupDefinition();\n this.cdr.markForCheck();\n });\n });\n }\n\n viewDefinitions() {\n this.viewDefinition = true;\n this.viewEdit = false;\n }\n\n previous() {\n this.location.back();\n this.data.changeMessage(1);\n }\n\n onCancel() {\n this.form.reset();\n this.viewDefinition = !this.viewDefinition;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","<section>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Enterprise Teams Categories</h2>\n\n <p>\n Here you can define the categories for your enterprise's groups. For example \"Sales\n Department\", \"Development Department\", etc.\n <br />\n Once the category created, you'll be able to add teams to them and see useful\n insight based on the members activity in the corresponding team.\n </p>\n </div>\n </div>\n\n @if (!viewDefinition) {\n <div class=\"row\"\n >\n <div class=\"col-6 d-flex align-items-center text-start mb-sm-3 mb-lg-0\">\n <a aria-label=\"Navigate to Target\"\n (click)=\"previous()\"\n class=\"previous\"><i class=\"fa fa-arrow-alt-circle-left\" aria-hidden=\"true\"></i></a>\n </div>\n @if (hasAccess) {\n <div class=\"col-6\"\n >\n <button class=\"float-end btn btn-sm btn-outline-primary me-2\"\n (click)=\"viewDefinitions()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Create Team Category\n </button>\n </div>\n }\n </div>\n }\n\n @if (viewDefinition) {\n <div>\n <h4 class=\"card-title d-inline mb-5\">\n {{ viewEdit ? 'Update the' : 'Create a new' }} category\n </h4>\n @if (!viewEdit) {\n <div class=\"mt-4\"\n >\n <form [formGroup]=\"form\"\n (ngSubmit)=\"saveGroupDefinition()\">\n <div class=\"row\">\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Label.Name' | transloco\" name=\"name\" controlId=\"group-definition-name\">\n <input type=\"text\"\n id=\"group-definition-name\"\n class=\"form-control\"\n formControlName=\"name\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Name' | transloco\"\n [attr.aria-label]=\"'Label.Name' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.Description' | transloco\" name=\"description\" controlId=\"group-definition-description\">\n <input type=\"text\"\n id=\"group-definition-description\"\n class=\"form-control\"\n formControlName=\"description\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Description' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.Description' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.IsPrivate' | transloco\" name=\"is_private\" controlId=\"group-definition-is_private\" [useAriaLabelledbyOnly]=\"true\">\n <ui-switch\n [attr.aria-labelledby]=\"'group-definition-is_private-label'\"\n formControlName=\"is_private\">\n </ui-switch>\n </pw-input-container>\n </div>\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCancel()\"\n (keydown.enter)=\"onCancel()\" >\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"categoryBusyButton\"\n class=\"btn btn-primary\">Add Category</button>\n </pw-sticky-actions>\n </form>\n </div>\n }\n @if (viewEdit) {\n <div class=\"mt-4\"\n >\n <form [formGroup]=\"form\"\n (ngSubmit)=\"updateDetails()\">\n <div class=\"row\">\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Label.Name' | transloco\" name=\"name\" controlId=\"group-definition-edit-name\">\n <input type=\"text\"\n id=\"group-definition-edit-name\"\n class=\"form-control\"\n formControlName=\"name\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Name' | transloco\"\n [attr.aria-label]=\"'Label.Name' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.Description' | transloco\" name=\"description\" controlId=\"group-definition-edit-description\">\n <input type=\"text\"\n id=\"group-definition-edit-description\"\n class=\"form-control\"\n formControlName=\"description\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Description' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.Description' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.IsPrivate' | transloco\" name=\"is_private\" controlId=\"group-definition-edit-is_private\" [useAriaLabelledbyOnly]=\"true\">\n <ui-switch\n [attr.aria-labelledby]=\"'group-definition-edit-is_private-label'\"\n formControlName=\"is_private\">\n </ui-switch>\n </pw-input-container>\n </div>\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"onCancel()\"\n (keydown.enter)=\"onCancel()\" >\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"categoryBusyButton\"\n class=\"btn btn-primary\">\n {{ 'Button.Update' | transloco }}\n </button>\n </pw-sticky-actions>\n </form>\n </div>\n }\n </div>\n }\n\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n\n @if (groupDefinition?.length !== 0) {\n @if (!viewDefinition) {\n <div class=\"row mb-last-3 group-definitions-wrapper\"\n >\n @for (group of groupDefinition; track group) {\n <div class=\"col-12 col-md-6 col-xl-4 mt-3\"\n >\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h5 class=\"mb-3\">{{ group.name }}</h5>\n <p>{{ group.description | slice: 0:200 }}</p>\n </div>\n <div class=\"card-footer\">\n <div class=\"float-end px-2\">\n @if (hasAccess) {\n <a class=\"btn btn-sm btn-outline-danger me-2\"\n (click)=\"onDelete(group.id)\">{{ 'Button.Delete' | transloco }}</a>\n }\n @if (hasAccess) {\n <a class=\"btn btn-sm btn-outline-primary me-2\"\n (click)=\"onGroupDefinitionEdit(group.id)\">{{ 'Button.Edit' | transloco }}</a>\n }\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n @if (groupDefinition?.length === 0 && hasAccess && !viewDefinition && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Enterprise.Teams.NoLabelsMessage' | transloco\"> </pw-no-data>\n </div>\n }\n @if (groupDefinition?.length === 0 && !hasAccess && isLoaded) {\n <div>\n <pw-no-data [withImage]=\"true\" [message]=\"'Enterprise.Teams.NoLabelsUserMessage' | transloco\"> </pw-no-data>\n </div>\n }\n </section>\n","import { ChangeDetectorRef, Component, Injector, OnDestroy, OnInit } from '@angular/core';\nimport {\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n Validators\n} from '@angular/forms';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { DataService, GroupService, SubscriptionService } from '@posiwise/common-services';\nimport { Subscription, User } from '@posiwise/common-utilities';\nimport { ValidateForm } from '@posiwise/utils';\n\nimport { ConfirmDialogService } from '../../confirm-dialog/confirm-dialog.service';\nimport { Group } from '../../shared/shared-component.interface';\n\n@Component({\n selector: 'pw-groups',\n templateUrl: './groups.component.html',\n styleUrls: ['./groups.component.scss'],\n\n standalone: false\n})\nexport class GroupsComponent extends AppBaseComponent implements OnInit, OnDestroy {\n private groupsData: Group[] = [];\n\n subscription: Subscription;\n\n message: number;\n id: number;\n group_id: number;\n\n form: UntypedFormGroup;\n\n description: string;\n name: string;\n\n allGroups: Group[] = [];\n groupDefinition: {\n name: string;\n groups: IterableIterator<object>;\n }[] = [];\n\n domainGroupDefinition = [];\n\n admins = [];\n subscriptionInfo = [];\n subscriptionOwner: number;\n enrolledUsers: { is_owner: boolean; id: number }[];\n\n user: User;\n\n submitted = false;\n viewEdit = false;\n buttonBusy = false;\n isGroupOperations = false;\n isGroupEdit = false;\n hasAccess = false;\n isLoaded = false;\n\n constructor(\n private readonly fb: UntypedFormBuilder,\n private readonly groupService: GroupService,\n private readonly subscriptionService: SubscriptionService,\n private readonly dataService: DataService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef,\n private readonly confirmDialog: ConfirmDialogService\n ) {\n super(injector);\n this.getUserSubscription().subscribe(response => {\n this.subscription = response;\n if (this.subscription?.id) {\n this.id = this.subscription?.id;\n }\n this.cdr.markForCheck();\n });\n\n this.form = this.fb.group({\n name: new UntypedFormControl('', [Validators.required]),\n description: new UntypedFormControl(''),\n group_definition_id: new UntypedFormControl('', [Validators.required])\n });\n }\n\n ngOnInit() {\n this.dataService.currentMessage.subscribe(message => {\n this.message = message;\n this.cdr.markForCheck();\n });\n this.userStore().subscribe(user => {\n if (user) {\n this.user = user;\n this.getSubscribedUsers();\n }\n this.cdr.markForCheck();\n });\n this.getAllGroupDefinition();\n }\n\n /** Function to save group */\n @ValidateForm('form')\n saveGroup() {\n this.buttonBusy = true;\n this.submitted = true;\n const formValue = this.form.value;\n const data = {\n name: formValue.name,\n description: formValue.description,\n group_definition_id: formValue.group_definition_id\n };\n this.groupService\n .postGroup(data)\n .subscribe(() => {\n this.toast.success('Saved Successfully', '', {\n extendedTimeOut: 1000000\n });\n this.form.reset();\n this.getAllGroupDefinition();\n this.isGroupOperations = false;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.submitted = false;\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n\n private getAllGroupDefinition() {\n this.isLoaded = false;\n this.allGroups = [];\n this.groupService.groupDefinitionGetAll(this.id, 'Subscription').subscribe(response => {\n this.isLoaded = true;\n if (response.group_definitions.length > 0) {\n this.groupDefinition = response.group_definitions;\n this.domainGroupDefinition = [\n { id: '0', name: 'All Team Categories', groups: [] },\n ...response.group_definitions\n ];\n this.groupDefinition.forEach(data => {\n const groups = [...data.groups];\n groups.forEach(group => {\n this.allGroups.push({ ...group, group_definition_name: data?.name });\n this.groupsData = this.allGroups;\n });\n });\n } else {\n this.groupDefinition = [];\n }\n this.cdr.markForCheck();\n });\n }\n\n private getSubscribedUsers() {\n this.getUserSubscription().subscribe(sub => {\n this.subscription = sub;\n if (this.subscription?.id) {\n this.subscriptionService.getEnrolledSubscription(sub?.id).subscribe(response => {\n this.subscriptionOwner = response.owner_id;\n this.admins = response.admins;\n this.enrolledUsers = response.members;\n this.enrolledUsers.forEach(element => {\n element.is_owner = element?.id === this.user?.id;\n });\n this.hasAccess =\n this.admins.includes(this.user?.id) ||\n this.user?.id === this.subscriptionOwner ||\n this.permissionService.isSuperAdmin();\n this.cdr.markForCheck();\n });\n }\n this.cdr.markForCheck();\n });\n }\n\n groupOperation() {\n this.form.reset();\n this.viewEdit = false;\n this.isGroupOperations = true;\n this.isGroupEdit = false;\n }\n\n cancelUpdate() {\n this.isGroupOperations = false;\n this.form.reset();\n }\n\n editGroup(group_id: number) {\n this.form.reset();\n this.viewEdit = true;\n this.isGroupOperations = true;\n this.isGroupEdit = true;\n this.group_id = group_id;\n this.getGroupDetails(group_id);\n }\n\n private getGroupDetails(id: number) {\n this.groupService.getGroup(id).subscribe(response => {\n this.form.patchValue({\n name: response.name,\n description: response.description,\n group_definition_id: response.group_definition_id\n });\n this.cdr.markForCheck();\n });\n }\n\n updateDetails() {\n this.buttonBusy = true;\n const formValue = this.form.value;\n const data = {\n name: formValue.name,\n description: formValue.description,\n group_definition_id: formValue.group_definition_id\n };\n this.groupService\n .updateGroup(this.group_id, data)\n .subscribe(() => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Groups.UpdatedMessage')\n );\n this.form.reset();\n this.getAllGroupDefinition();\n this.isGroupOperations = false;\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n\n onDelete(id: number) {\n this.confirmDialog\n .open({\n title: 'Delete',\n text: 'Are you sure you want to delete this team?',\n destructive: true\n })\n .then(ok => {\n if (!ok) {\n return;\n }\n this.groupService.deleteGroup(id).subscribe(_ => {\n this.toast.success(\n this.translation.translate('Admin.Shared.Groups.DeletedMessage')\n );\n this.isGroupOperations = false;\n this.getAllGroupDefinition();\n this.cdr.markForCheck();\n });\n });\n }\n\n filterDomainsList(event) {\n if (event !== '0') {\n const searchedList = this.groupsData.filter(\n group => group.group_definition_id === Number(event)\n );\n this.allGroups = searchedList;\n } else {\n this.allGroups = this.groupsData;\n }\n }\n\n previous() {\n this.location.back();\n this.dataService.changeMessage(1);\n }\n\n navigateToCommunications(id: number) {\n this.router.navigate([`/${this.subscription?.slug}/enterprise/communications`], {\n queryParams: { entity_id: id }\n });\n }\n\n navigateToDocumentations(id: number) {\n this.router.navigate([`/${this.subscription?.slug}/enterprise/wiki`], {\n queryParams: { entity_id: id }\n });\n }\n\n trackByGroup(_index: number, item: { id: number }) {\n return item.id;\n }\n\n override ngOnDestroy() {\n super.ngOnDestroy();\n }\n}\n","<div>\n <section>\n <div class=\"row\">\n <div class=\"col-12 mb-3\">\n <h2>Enterprise Teams</h2>\n\n <p>\n Here you can define the teams for your Enterprise members. For example\n \"Corporate Sales Team\", \"Frontend Dev Team\" etc.\n <br />\n Once the teams created, you'll be able to add members to them and see useful\n insight based on the members activity in the corresponding team.\n </p>\n </div>\n </div>\n\n @if (!isGroupOperations) {\n <div class=\"row\"\n >\n <div class=\"col-12 d-flex justify-content-end align-items-center text-end mb-3\">\n @if (hasAccess) {\n <button\n class=\"btn btn-sm btn-outline-primary\"\n (click)=\"groupOperation()\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Add Team\n </button>\n }\n @if (hasAccess) {\n <button\n class=\"btn btn-sm btn-outline-primary ms-1\"\n [routerLink]=\"['/' + subscription?.slug + '/enterprise', 'groups', 'labels']\">\n <i class=\"fa fa-plus-circle\" aria-hidden=\"true\"></i> Manage Team Categories\n </button>\n }\n </div>\n </div>\n }\n\n <!-- Add Group Template -->\n @if (isGroupOperations) {\n <div\n class=\"mb-4\">\n <h4 class=\"card-title d-inline\">{{ viewEdit ? 'Update the' : 'Create a new' }} team</h4>\n @if (!isGroupEdit) {\n <div class=\"mt-4\"\n >\n <form [formGroup]=\"form\"\n (ngSubmit)=\"saveGroup()\">\n <div class=\"row\">\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamName' | transloco\" name=\"name\" controlId=\"groups-teamName\">\n <input type=\"text\"\n id=\"groups-teamName\"\n class=\"form-control\"\n formControlName=\"name\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.TeamName' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.TeamName' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.Description' | transloco\" name=\"description\" controlId=\"groups-description\">\n <input type=\"text\"\n id=\"groups-description\"\n class=\"form-control\"\n formControlName=\"description\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Description' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.Description' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamCategory' | transloco\" name=\"group_definition_id\" controlId=\"groups-teamCategory\">\n <p-select\n inputId=\"groups-teamCategory\"\n [options]=\"groupDefinition\"\n formControlName=\"group_definition_id\"\n [ngClass]=\"{'is-invalid': submitted && form.controls['group_definition_id'].errors}\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.TeamCategory' | transloco\"\n optionValue=\"id\"\n optionLabel=\"name\">\n </p-select>\n </pw-input-container>\n </div>\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n (click)=\"isGroupOperations = !isGroupOperations\"\n class=\"btn btn-outline-default me-2\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\">Add</button>\n </pw-sticky-actions>\n </form>\n </div>\n }\n <!-- Edit Group Template -->\n @if (isGroupEdit) {\n <div class=\"mt-4\"\n >\n <form [formGroup]=\"form\"\n (ngSubmit)=\"updateDetails()\">\n <div class=\"row\">\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamName' | transloco\" name=\"name\" controlId=\"groups-edit-teamName\">\n <input type=\"text\"\n id=\"groups-edit-teamName\"\n class=\"form-control\"\n formControlName=\"name\"\n required=\"true\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.TeamName' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.TeamName' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamDescription' | transloco\" name=\"description\" controlId=\"groups-edit-description\">\n <input type=\"text\"\n id=\"groups-edit-description\"\n value=\"{{ description }}\"\n class=\"form-control\"\n formControlName=\"description\"\n required=\"true\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.Description' | transloco\"\n [attr.aria-label]=\"'Enterprise.Teams.TeamDescription' | transloco\" />\n </pw-input-container>\n </div>\n <div class=\"mb-3 col-12 col-md-4\">\n <pw-input-container [label]=\"'Enterprise.Teams.TeamCategory' | transloco\" name=\"group_definition_id\" controlId=\"groups-edit-teamCategory\">\n <p-select\n inputId=\"groups-edit-teamCategory\"\n [options]=\"groupDefinition\"\n formControlName=\"group_definition_id\"\n [ngClass]=\"{'is-invalid': submitted && form.controls['group_definition_id'].errors}\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.TeamCategory' | transloco\"\n optionValue=\"id\"\n optionLabel=\"name\">\n </p-select>\n </pw-input-container>\n </div>\n </div>\n <pw-sticky-actions>\n <button type=\"button\"\n class=\"btn btn-outline-default me-2\"\n (click)=\"cancelUpdate()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"submit\"\n [buttonBusy]=\"buttonBusy\"\n class=\"btn btn-primary\">\n {{ 'Button.Update' | transloco }}\n </button>\n </pw-sticky-actions>\n </form>\n </div>\n }\n </div>\n }\n\n @if (!isGroupOperations) {\n <div class=\"row\"\n >\n <div class=\"col-4 mt-2 filter\">\n <p-select class=\"pw-filter-select\"\n [options]=\"domainGroupDefinition\"\n optionLabel=\"name\"\n optionValue=\"id\"\n [ngModel]=\"'0'\"\n [placeholder]=\"'Enterprise.Teams.Placeholder.FilterTeamCategory' | transloco\"\n (onChange)=\"filterDomainsList($event.value)\">\n </p-select>\n </div>\n </div>\n }\n @if (!isLoaded) {\n <div class=\"w-100 text-center mt-3\"\n >\n <p-progress-spinner strokeWidth=\"2\"> </p-progress-spinner>\n </div>\n }\n @if (!isGroupOperations) {\n <div class=\"row group_list my-4\"\n >\n @for (group of allGroups; track trackByGroup($index, group)) {\n <div class=\"col-12 col-md-6 col-xl-4 mt-3\"\n >\n <div class=\"card\">\n <div class=\"card-content\">\n <div class=\"card-header\">\n <h5 class=\"mb-3\">{{ group.name }}</h5>\n <p>{{ group.description | slice: 0:200 }}</p>\n <span><a class=\"badge bg-primary\">{{\n group?.group_definition_name\n }}</a></span>\n </div>\n <div class=\"card-footer\">\n <div class=\"float-end px-2\">\n @if (hasAccess) {\n <a class=\"me-2 my-1\"\n aria-label=\"Delete\"\n (click)=\"onDelete(group.id)\">\n <i class=\"fa fa-trash delete-icon\" aria-hidden=\"true\"></i></a>\n }\n @if (hasAccess) {\n <a class=\"me-2 my-1\"\n aria-label=\"Edit Group\"\n (click)=\"editGroup(group.id)\"><i class=\"fa fa-edit edit-icon\" aria-hidden=\"true\"></i></a>\n }\n <a class=\"me-2 my-1\"\n aria-label=\"Members\"\n [routerLink]=\"[group.id, 'members']\"><i class=\"fa fa-tasks cta1-icon\" aria-hidden=\"true\"></i>\n </a>\n <a class=\"communications me-2 my-1\"\n aria-label=\"Communications\"\n (click)=\"navigateToCommunications(group.id)\"><i class=\"fa fa-comments cta2-icon\" aria-hidden=\"true\"></i></a>\n <a class=\"communications my-1\"\n aria-label=\"Documents\"\n (click)=\"navigateToDocumentations(group.id)\"><i class=\"fab fa-wikipedia-w cta1-icon\" aria-hidden=\"true\"></i></a>\n </div>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n }\n </section>\n </div>\n @if (allGroups?.length === 0 && hasAccess && !isGroupOperations && isLoaded) {\n <div\n class=\"clear-both\">\n <pw-no-data [withImage]=\"true\" [message]=\"'Enterprise.Teams.NoTeamMessage' | transloco\"> </pw-no-data>\n </div>\n }\n @if (allGroups?.length === 0 && !hasAccess && !isGroupOperations && isLoaded) {\n <div\n class=\"clear-both\">\n <pw-no-data [withImage]=\"true\" [message]=\"'Enterprise.Teams.NoTeamMessageIfUser' | transloco\"> </pw-no-data>\n </div>\n }\n","import { ChangeDetectorRef, Component, Injector, OnInit } from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { AuthService } from '@posiwise/common-services';\n\n@Component({\n selector: 'pw-landing-page-footer-b',\n templateUrl: './landing-page-footer-b.component.html',\n styleUrls: ['./landing-page-footer-b.component.scss'],\n\n standalone: false\n})\nexport class LandingPageFooterBComponent extends AppBaseComponent implements OnInit {\n isBrowserAccess: boolean;\n\n currentDate: Date = new Date();\n\n get companyName(): string {\n return this.appConfig?.company?.name || 'PosiWise';\n }\n\n get companyEmail(): string {\n return this.appConfig?.company?.email || 'info@posiwise.com';\n }\n\n get companyTagline(): string | null {\n return this.appConfig?.company?.description || null;\n }\n\n get logoUrl(): string {\n return (\n this.appConfig?.company?.logos?.main_dark?.url ||\n this.appConfig?.company?.logos?.main?.url ||\n '/assets/img/logos/logo_text_big_dark.png'\n );\n }\n\n get socialLinkedin(): string | null {\n return this.appConfig?.social?.linkedin_url || null;\n }\n\n get socialFacebook(): string | null {\n return this.appConfig?.social?.facebook_url || null;\n }\n\n get socialTwitter(): string | null {\n return this.appConfig?.social?.twitter_url || null;\n }\n\n constructor(\n private readonly authService: AuthService,\n private readonly cdr: ChangeDetectorRef,\n injector: Injector\n ) {\n super(injector);\n }\n\n ngOnInit() {\n this.authService.platform$.subscribe(platform => {\n if (platform === 'browser') {\n this.isBrowserAccess = true;\n }\n this.cdr.markForCheck();\n });\n }\n\n public scrollToTop(event: Event): void {\n event.preventDefault();\n if (!this.isBrowserAccess) return;\n window.scrollTo({ top: 0, behavior: 'smooth' });\n }\n}\n","<footer class=\"lp-foot\">\n <div class=\"lp-foot__inner\">\n <div class=\"lp-foot__brand-col\">\n <a href=\"/\" [attr.aria-label]=\"companyName\" class=\"lp-foot__brand\">\n <img [src]=\"logoUrl\"\n [alt]=\"companyName\"\n height=\"28\"\n width=\"140\"\n decoding=\"async\" />\n </a>\n @if (companyTagline) {\n <p class=\"lp-foot__line\">{{ companyTagline }}</p>\n }\n </div>\n\n <div class=\"lp-foot__cols\">\n <div class=\"lp-foot__col\">\n <p class=\"lp-foot__col-label\">Get in touch</p>\n <a [href]=\"'mailto:' + companyEmail\" class=\"lp-foot__link\">{{ companyEmail }}</a>\n <a href=\"#contact-b\" class=\"lp-foot__link\">Request access</a>\n </div>\n\n @if (socialLinkedin || socialFacebook || socialTwitter) {\n <div class=\"lp-foot__col\">\n <p class=\"lp-foot__col-label\">Elsewhere</p>\n @if (socialLinkedin) {\n <a [href]=\"socialLinkedin\" target=\"_blank\" rel=\"noopener\" class=\"lp-foot__link\">LinkedIn</a>\n }\n @if (socialFacebook) {\n <a [href]=\"socialFacebook\" target=\"_blank\" rel=\"noopener\" class=\"lp-foot__link\">Facebook</a>\n }\n @if (socialTwitter) {\n <a [href]=\"socialTwitter\" target=\"_blank\" rel=\"noopener\" class=\"lp-foot__link\">Twitter</a>\n }\n </div>\n }\n\n @if (isBrowserAccess) {\n <div class=\"lp-foot__col\">\n <p class=\"lp-foot__col-label\">Company</p>\n <a routerLink=\"/privacy-policy\" class=\"lp-foot__link\">Privacy Policy</a>\n <a routerLink=\"/terms-conditions\" class=\"lp-foot__link\">Terms &amp; Conditions</a>\n <a routerLink=\"/resources\" class=\"lp-foot__link\">Resources</a>\n <a routerLink=\"/status\" class=\"lp-foot__link\">Status</a>\n </div>\n }\n </div>\n </div>\n\n <div class=\"lp-foot__rule\" aria-hidden=\"true\"></div>\n\n <div class=\"lp-foot__base\">\n <p class=\"lp-foot__copy\">\n &copy; {{ currentDate | date: 'yyyy' }} {{ companyName }}. All rights reserved.\n </p>\n <span class=\"lp-foot__trust\" aria-label=\"SOC 2 compliant\">\n <span class=\"lp-foot__trust-dot\" aria-hidden=\"true\"></span>\n SOC&nbsp;2\n </span>\n <a href=\"#\"\n [attr.aria-label]=\"'Back to top'\"\n class=\"lp-foot__top\"\n (click)=\"scrollToTop($event)\">\n Back to top <span aria-hidden=\"true\">↑</span>\n </a>\n </div>\n</footer>\n","import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';\n\nimport { NumberPickerService } from '@posiwise/common-services';\n\nimport { buttonsOrientationType, CustomClasses, sizeType } from './number-picker.config';\n\n@Component({\n selector: 'pw-number-picker',\n templateUrl: './number-picker.component.html',\n styleUrls: ['./number-picker.component.scss'],\n\n standalone: false\n})\nexport class NumberPickerComponent implements OnInit {\n private precision: number;\n\n private eventHolder = null;\n\n private countInterval = null;\n\n private isInputFocused = false;\n\n @Input() min: number;\n\n @Input() showTooltip: boolean;\n\n @Input() tooltipText: string;\n\n @Input() max: number;\n\n @Input() step: number;\n\n @Input() value: number;\n\n @Input() pickStartAfter: number;\n\n @Input() pickTimer: number;\n\n @Input() prefix: string;\n\n @Input() postfix: string;\n\n @Input() placeholder: string;\n\n @Input() buttonsOrientation: buttonsOrientationType;\n\n @Input() size: sizeType = 'md';\n\n @Input() customClass: CustomClasses = {};\n\n @Input() mouseWheel = false;\n\n @Input() arrowKeys = true;\n\n @Input() inputReadOnly = false;\n\n @Input() showUpButton = true;\n\n @Input() showDownButton = true;\n\n /** Optional id for the number input (for accessibility/label association). */\n @Input() inputId: string;\n\n @Output() valueChange: EventEmitter<number> = new EventEmitter();\n\n @Output() minReached: EventEmitter<boolean> = new EventEmitter();\n\n @Output() maxReached: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickStarted: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickStopped: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickUpStarted: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickUpStopped: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickDownStarted: EventEmitter<boolean> = new EventEmitter();\n\n @Output() pickDownStopped: EventEmitter<boolean> = new EventEmitter();\n\n constructor(private readonly numberPickerService: NumberPickerService) {}\n\n ngOnInit() {\n this.initPicker();\n }\n\n isHorizontal(): boolean {\n return this.buttonsOrientation !== 'v' && this.buttonsOrientation !== 'vertical';\n }\n\n onFocus(event: FocusEvent) {\n event.preventDefault();\n event.stopPropagation();\n this.isInputFocused = true;\n }\n\n onBlur(event: Event) {\n event.preventDefault();\n event.stopPropagation();\n this.isInputFocused = false;\n }\n\n onMouseWheel(event: WheelEvent) {\n if (this.isInputFocused) {\n event.preventDefault();\n let wheelUp = null;\n let delta = null;\n\n if (event.deltaY) {\n delta = event.deltaY / 60;\n }\n if (event.detail) {\n delta = -event.detail / 2;\n }\n if (delta !== null) {\n wheelUp = delta > 0;\n }\n\n this.afterMouseWheels(wheelUp, event);\n event.stopPropagation();\n }\n }\n\n private afterMouseWheels(wheelUp: boolean, event: WheelEvent) {\n this.onPickStarted(wheelUp);\n if (wheelUp) {\n this.onIncrease(event);\n } else {\n this.onDecrease(event);\n }\n this.onPickStopped(wheelUp);\n }\n\n onValueChange(_event: Event) {\n if (this.value > this.max) {\n this.value = this.max;\n } else if (this.value < this.min) {\n this.value = this.min;\n }\n if (this.parseVal(this.value) === 0 || this.parseVal(this.value)) {\n this.valueChange.emit(this.value);\n }\n }\n\n onDecrease(event: MouseEvent | WheelEvent | KeyboardEvent) {\n event.preventDefault();\n if (this.canDecrease()) {\n this.value = this.round(this.value > this.min ? this.value - this.step : this.value);\n this.valueChange.emit(this.value);\n } else {\n this.minReached.emit(true);\n }\n event.stopPropagation();\n }\n\n onIncrease(event: MouseEvent | WheelEvent | KeyboardEvent) {\n event.preventDefault();\n if (this.canIncrease()) {\n this.value = this.round(this.value < this.max ? this.value + this.step : this.value);\n this.valueChange.emit(this.value);\n } else {\n this.maxReached.emit(true);\n }\n event.stopPropagation();\n }\n\n onMouseDown(event: MouseEvent, increase = true) {\n this.afterMouseDown(increase, event);\n }\n\n private isArrowUpDown(key: string): boolean {\n return key === 'ArrowUp' || key === 'ArrowDown';\n }\n\n private isArrowUp(key: string): boolean {\n return key === 'ArrowUp';\n }\n\n private loopPick(increase: boolean, event: MouseEvent | KeyboardEvent) {\n this.onPickStarted(increase);\n this.eventHolder = setTimeout(() => {\n this.countInterval = setInterval(() => {\n if (increase) {\n this.onIncrease(event);\n } else {\n this.onDecrease(event);\n }\n }, this.pickTimer);\n }, this.pickStartAfter);\n }\n\n onMouseUp(event: MouseEvent, increase = true) {\n this.afterMouseUp(increase, event);\n }\n\n onKeyDown(event: KeyboardEvent) {\n if (this.isArrowUpDown(event.key)) {\n event.preventDefault();\n if (!this.eventHolder) {\n this.loopPick(this.isArrowUp(event.key), event);\n }\n }\n event.stopPropagation();\n }\n\n onKeyUp(event: KeyboardEvent) {\n if (this.isArrowUpDown(event.key)) {\n event.preventDefault();\n this.afterPick(this.isArrowUp(event.key));\n }\n event.stopPropagation();\n }\n\n private afterMouseDown(up: boolean, event: MouseEvent) {\n event.preventDefault();\n if (this.isLeftClick(event)) {\n this.loopPick(up, event);\n }\n event.stopPropagation();\n }\n\n private afterMouseUp(up: boolean, event: MouseEvent) {\n event.preventDefault();\n this.afterPick(up);\n event.stopPropagation();\n }\n\n private afterPick(up: boolean) {\n this.onPickStopped(up);\n this.clearTimers();\n }\n\n private clearTimers() {\n clearTimeout(this.eventHolder);\n clearInterval(this.countInterval);\n this.eventHolder = null;\n this.countInterval = null;\n }\n\n private parseVal(value: string | number) {\n if (typeof value === 'number') {\n return value;\n }\n\n return Number.parseFloat(value);\n }\n\n private getPrecision(step: number): number {\n return /^\\d*$/.exec(String(step))[0].length;\n }\n\n private round(value: number): number {\n // eslint-disable-next-line no-restricted-properties\n return Math.round(value * 10 ** this.precision) / 10 ** this.precision;\n }\n\n private canIncrease(): boolean {\n const canIncrease = this.value <= this.max - this.step;\n if (!canIncrease) {\n this.value = this.max;\n }\n\n return canIncrease;\n }\n\n private canDecrease(): boolean {\n const canDecrease = this.value >= this.min + this.step;\n if (!canDecrease) {\n this.value = this.min;\n }\n\n return canDecrease;\n }\n\n private onPickStarted(increase: boolean) {\n const isIncrease = increase;\n if (isIncrease) {\n // NOSONAR\n if (this.canIncrease()) {\n this.pickStarted.emit(true);\n this.pickUpStarted.emit(true);\n }\n } else if (this.canDecrease()) {\n this.pickStarted.emit(true);\n this.pickDownStarted.emit(true);\n }\n }\n\n private onPickStopped(increase: boolean) {\n const isIncrease = increase;\n if (isIncrease) {\n // NOSONAR\n if (this.canIncrease()) {\n this.pickUpStopped.emit(true);\n this.pickStopped.emit(true);\n }\n } else if (this.canDecrease()) {\n this.pickDownStopped.emit(true);\n this.pickStopped.emit(true);\n }\n }\n\n private isLeftClick(event): boolean {\n return event.button === 0;\n }\n\n private initPicker(): void {\n this.min = this.parseVal(this.min) || this.numberPickerService.min;\n this.max = this.parseVal(this.max) || this.numberPickerService.max;\n this.step = this.parseVal(this.step) || this.numberPickerService.step;\n this.value = this.parseVal(this.value) || this.numberPickerService.value;\n this.pickStartAfter =\n this.parseVal(this.pickStartAfter) || this.numberPickerService.pickStartAfter;\n this.pickTimer = this.parseVal(this.pickTimer) || this.numberPickerService.pickTimer;\n this.precision = this.getPrecision(this.step) || this.numberPickerService.precision;\n this.value = this.round(this.value);\n this.placeholder = this.placeholder ?? '';\n }\n}\n","<div class=\"input-group mb-3 input-{{ size }} {{ customClass.container }}\">\n <!-- Horizontal decrease button orientation -->\n @if (isHorizontal() && showDownButton) {\n <span\n class=\"input-group-text decrease {{ customClass.down }}\"\n (click)=\"onDecrease($event)\"\n (keydown.enter)=\"onDecrease($event)\"\n (mouseup)=\"onMouseUp($event, false)\"\n (mousedown)=\"onMouseDown($event, false)\">-</span>\n }\n <!-- Input prefix -->\n @if (prefix) {\n <span\n class=\"input-group-text {{ customClass.prefix }}\">{{ prefix }}\n </span>\n }\n <input type=\"number\"\n class=\"form-control\"\n [attr.id]=\"inputId\"\n name=\"input-spin-val\"\n [(ngModel)]=\"value\"\n [readOnly]=\"inputReadOnly\"\n (blur)=\"onBlur($event)\"\n (focus)=\"onFocus($event)\"\n (wheel)=\"mouseWheel && onMouseWheel($event)\"\n (keyup)=\"arrowKeys && onKeyUp($event)\"\n (keydown.enter)=\"arrowKeys && onKeyDown($event)\"\n (keydown.arrowup)=\"arrowKeys && onIncrease($event)\"\n (keydown.arrowdown)=\"arrowKeys && onDecrease($event)\"\n (change)=\"onValueChange($event)\"\n [placeholder]=\"placeholder\"\n aria-label=\"Input Spin Val\" />\n <!-- Input postfix -->\n\n @if (postfix) {\n <span\n class=\"input-group-text {{ customClass.postfix }}\"\n [style.borderLeft]=\"'0'\">{{postfix}}\n @if (showTooltip && tooltipText) {\n <span class=\"tooltip-wrap ms-1\"\n [pTooltip]=\"tooltipText\"\n [appendTo]=\"'body'\"\n [tooltipPosition]=\"tooltipPosition || 'top'\">\n <i class=\"far fa-info-circle text-muted\"></i>\n </span>\n }\n </span>\n }\n\n <!-- Horizontal increase button orientation -->\n @if (isHorizontal() && showUpButton) {\n <span\n class=\"input-group-text increase {{ customClass.up }}\"\n [style.borderLeft]=\"!postfix ? '0' : ''\"\n (click)=\"onIncrease($event)\"\n (keydown.enter)=\"onIncrease($event)\"\n (mouseup)=\"onMouseUp($event)\"\n (mousedown)=\"onMouseDown($event)\">+</span>\n }\n <!-- Vertical buttons orientation -->\n @if (!isHorizontal()) {\n <span\n class=\"input-group-text vertical p-0\">\n @if (showUpButton) {\n <span\n class=\"{{ customClass.up }}\"\n (click)=\"onIncrease($event)\"\n (keydown.enter)=\"onIncrease($event)\"\n (mouseup)=\"onMouseUp($event)\"\n (mousedown)=\"onMouseDown($event)\">+</span>\n }\n @if (showDownButton) {\n <span\n class=\"{{ customClass.down }}\"\n (keydown.enter)=\"onDecrease($event)\"\n (click)=\"onDecrease($event)\"\n (mouseup)=\"onMouseUp($event, false)\"\n (mousedown)=\"onMouseDown($event, false)\">-</span>\n }\n </span>\n }\n</div>\n","import { Component, Input } from '@angular/core';\n\n/**\n * Green presence indicator shown beside a member's name.\n *\n * Feed it `current_sign_in_at` and nothing else. Do NOT pass `last_sign_in_at`, nor the\n * `current_sign_in_at || last_sign_in_at` fallback the surrounding cells use for the date:\n * an explicit logout nulls `current_sign_in_at` and rolls its value into `last_sign_in_at`,\n * so the fallback would light the dot for someone who has just signed out.\n *\n * The online window itself lives in the `isOnline` pipe, which is paired with main-api's\n * activity-refresh interval -- see ONLINE_THRESHOLD_MINUTES.\n */\n@Component({\n selector: 'pw-online-indicator',\n templateUrl: './online-indicator.component.html',\n styleUrls: ['./online-indicator.component.scss'],\n standalone: false\n})\nexport class OnlineIndicatorComponent {\n /** The member's `current_sign_in_at` stamp. Never `last_sign_in_at`. */\n @Input() lastSeen: string | Date | null = null;\n}\n","@if (lastSeen | isOnline) {\n <span\n class=\"online-indicator\"\n [pTooltip]=\"'Label.OnlineNow' | transloco\"\n tooltipPosition=\"top\"\n appendTo=\"body\"\n >{{ 'Label.Now' | transloco\n }}<span class=\"online-indicator__beacon text-success-muted\" aria-hidden=\"true\"></span\n ></span>\n}\n","import {\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Injector,\n Input,\n Output,\n TemplateRef,\n ViewChild\n} from '@angular/core';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\n\nimport { StatusCodes } from 'http-status-codes';\n\nimport { NgbModal, NgbModalRef } from '@ng-bootstrap/ng-bootstrap';\n\nimport { SharedModalContext } from '../shared/shared-component.interface';\n\n@Component({\n selector: 'pw-password-validation',\n templateUrl: './password-validation.component.html',\n styleUrls: ['./password-validation.component.scss'],\n standalone: false\n})\nexport class PasswordValidationComponent extends AppBaseComponent {\n @ViewChild('content', { static: true }) content: TemplateRef<SharedModalContext>;\n @ViewChild('passwordRef') passwordRef: ElementRef<HTMLInputElement>;\n\n @Input() confirmMessage: string;\n @Input() destructive = false;\n\n @Output()\n successEvent: EventEmitter<boolean> = new EventEmitter();\n\n password: string;\n passwordVisible = false;\n buttonBusy: boolean;\n\n private modalRef: NgbModalRef;\n\n constructor(\n injector: Injector,\n private readonly modal: NgbModal,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n get bodyMessage(): string {\n if (this.confirmMessage) {\n return this.confirmMessage;\n }\n return this.destructive\n ? 'Common.Confirm.PasswordValidation.BodyDestructive'\n : 'Common.Confirm.PasswordValidation.Body';\n }\n\n open() {\n this.passwordVisible = false;\n this.password = null;\n this.modalRef = this.modal.open(this.content, {\n centered: true,\n size: 'md',\n windowClass: 'pw-password-confirm-modal',\n backdrop: 'static',\n keyboard: true\n });\n setTimeout(() => this.passwordRef?.nativeElement?.focus(), 0);\n }\n\n validatePassword() {\n if (this.password) {\n this.buttonBusy = true;\n this.userService\n .checkPassword({ password: this.password })\n .subscribe(data => {\n if (data && data?.status === StatusCodes.OK) {\n this.successEvent.emit(true);\n this.modal.dismissAll();\n this.password = null;\n this.passwordVisible = false;\n } else {\n this.successEvent.emit(false);\n this.password = null;\n }\n this.cdr.markForCheck();\n })\n .add(() => {\n this.buttonBusy = false;\n this.cdr.markForCheck();\n });\n }\n }\n}\n","<ng-template #content\n let-modal>\n <div class=\"pw-password-confirm\"\n [class.pw-password-confirm--destructive]=\"destructive\">\n <div class=\"pw-password-confirm__header\">\n <span class=\"pw-password-confirm__icon\"\n aria-hidden=\"true\">\n <i [class]=\"destructive ? 'pi pi-exclamation-triangle' : 'pi pi-shield'\"></i>\n </span>\n <h5 class=\"pw-password-confirm__title\">\n {{ (destructive\n ? 'Common.Confirm.PasswordValidation.TitleDestructive'\n : 'Common.Confirm.PasswordValidation.Title') | transloco }}\n </h5>\n <button type=\"button\"\n class=\"btn-close pw-password-confirm__close\"\n [attr.aria-label]=\"'Button.Cancel' | transloco\"\n (click)=\"modal.dismiss()\">\n </button>\n </div>\n\n <div class=\"pw-password-confirm__body\">\n <p class=\"pw-password-confirm__message\">\n {{ bodyMessage | transloco }}\n </p>\n\n <ng-content></ng-content>\n\n <div class=\"pw-password-confirm__field\">\n <label class=\"pw-password-confirm__label\"\n for=\"pw-password-confirm-input\">\n {{ 'Common.Confirm.PasswordValidation.PasswordLabel' | transloco }}\n </label>\n <div class=\"pw-password-confirm__input-wrap\">\n <input #passwordRef\n [type]=\"passwordVisible ? 'text' : 'password'\"\n [(ngModel)]=\"password\"\n (keyup.enter)=\"validatePassword()\"\n class=\"form-control pw-password-confirm__input\"\n id=\"pw-password-confirm-input\"\n name=\"pw-password-confirm-input\"\n autocomplete=\"current-password\"\n [placeholder]=\"'Common.Confirm.PasswordValidation.PasswordPlaceholder' | transloco\"\n aria-label=\"Pw Password Confirm Input\" />\n <button type=\"button\"\n class=\"pw-password-confirm__reveal\"\n [attr.aria-label]=\"(passwordVisible\n ? 'Common.Confirm.PasswordValidation.HidePassword'\n : 'Common.Confirm.PasswordValidation.ShowPassword') | transloco\"\n [attr.aria-pressed]=\"passwordVisible\"\n (click)=\"passwordVisible = !passwordVisible\">\n <i [class]=\"passwordVisible ? 'pi pi-eye-slash' : 'pi pi-eye'\"\n aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n\n <div class=\"pw-password-confirm__footer\">\n <button type=\"button\"\n class=\"btn btn-outline-secondary\"\n (click)=\"modal.dismiss()\">\n {{ 'Button.Cancel' | transloco }}\n </button>\n <button type=\"button\"\n [buttonBusy]=\"buttonBusy\"\n [disabled]=\"!password\"\n [class]=\"destructive ? 'btn btn-danger' : 'btn btn-primary'\"\n (click)=\"validatePassword()\">\n {{ 'Button.Confirm' | transloco }}\n </button>\n </div>\n </div>\n</ng-template>\n","import {\n AfterViewInit,\n Component,\n ElementRef,\n Input,\n OnChanges,\n type SimpleChanges\n} from '@angular/core';\n\nimport { PermissionTreeData } from '../shared/shared-component.interface';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'permission-tree',\n template: ` <div class=\"permission-tree\"></div> `,\n\n standalone: false\n})\nexport class PermissionTreeComponent implements AfterViewInit, OnChanges {\n @Input() data: PermissionTreeData;\n\n private _$tree;\n private _createdTreeBefore: boolean;\n constructor(private readonly _element: ElementRef) {}\n\n ngOnChanges(simple: SimpleChanges) {\n if (simple['data']?.currentValue?.grantedPermissionNames) {\n this.refreshTree();\n }\n }\n\n ngAfterViewInit(): void {\n this._$tree = $(this._element.nativeElement);\n\n this.refreshTree();\n }\n\n getGrantedPermissionNames(): string[] {\n if (!this._$tree || !this._createdTreeBefore) {\n return [];\n }\n\n const permissionNames = [];\n\n const selectedPermissions = this._$tree.jstree('get_selected', true);\n for (const permission of selectedPermissions) {\n permissionNames.push(permission.original.id);\n }\n\n return permissionNames;\n }\n\n private refreshTree(): void {\n if (this._createdTreeBefore) {\n this._$tree.jstree('destroy');\n }\n\n this._createdTreeBefore = false;\n\n if (!this.data || !this._$tree) {\n return;\n }\n\n const treeData = this.data.permissions.map(item => {\n return {\n id: item.name,\n parent: item.parentName ?? '#',\n text: item.displayName,\n state: {\n opened: true,\n selected: this.data.grantedPermissionNames.includes(item.name)\n }\n };\n });\n\n this._$tree.jstree({\n core: {\n data: treeData\n },\n types: {\n default: {\n icon: 'fa fa-folder-open tree-item-icon-color icon-lg'\n },\n file: {\n icon: 'fa fa-file tree-item-icon-color icon-lg'\n }\n },\n checkbox: {\n keep_selected_style: false,\n three_state: false,\n cascade: ''\n },\n plugins: ['checkbox', 'types']\n });\n\n this._createdTreeBefore = true;\n\n let inTreeChangeEvent = false;\n\n const selectNodeAndAllParents = node => {\n this._$tree.jstree('select_node', node, true);\n const parent = this._$tree.jstree('get_parent', node);\n if (parent) {\n selectNodeAndAllParents(parent);\n }\n };\n\n this._$tree.on('changed.jstree', (_e, data) => {\n if (!data.node) {\n return;\n }\n\n const wasInTreeChangeEvent = inTreeChangeEvent;\n if (!wasInTreeChangeEvent) {\n inTreeChangeEvent = true;\n }\n\n let childrenNodes;\n\n if (data.node.state.selected) {\n selectNodeAndAllParents(this._$tree.jstree('get_parent', data.node));\n\n childrenNodes = $.makeArray(this._$tree.jstree('get_children_dom', data.node));\n this._$tree.jstree('select_node', childrenNodes);\n } else {\n childrenNodes = $.makeArray(this._$tree.jstree('get_children_dom', data.node));\n this._$tree.jstree('deselect_node', childrenNodes);\n }\n\n if (!wasInTreeChangeEvent) {\n inTreeChangeEvent = false;\n }\n });\n }\n}\n","interface OpenList {\n level: number;\n type: 'ol' | 'ul';\n el: HTMLElement;\n}\n\n/**\n * Quill 2 saves every list as `<ol><li data-list=\"bullet|ordered\">`, nests by `ql-indent-N`, and\n * draws the marker from `data-list`. Angular's `[innerHTML]` sanitizer drops `data-*` attributes,\n * so the markers vanish. Rebuilding plain nested `<ul>`/`<ol>` keeps them without trusting the HTML.\n */\nexport function toSemanticLists(doc: Document): void {\n doc.querySelectorAll('ol').forEach(list => {\n const items = Array.from(list.children).filter(\n (child): child is HTMLElement => child.tagName === 'LI'\n );\n if (!items.some(item => 'list' in item.dataset)) return;\n\n const root = doc.createDocumentFragment();\n const open: OpenList[] = [];\n const top = (): OpenList | undefined => open.at(-1);\n items.forEach(item => {\n const level = Number(/ql-indent-(\\d+)/.exec(item.className)?.[1] ?? 0);\n const type = item.dataset.list === 'ordered' ? 'ol' : 'ul';\n while ((top()?.level ?? -1) > level) open.pop();\n if (top()?.level === level && top()?.type !== type) open.pop();\n let current = top();\n if (current?.level !== level) {\n const el = doc.createElement(type);\n (current?.el.lastElementChild ?? current?.el ?? root).appendChild(el);\n current = { level, type, el };\n open.push(current);\n }\n item.querySelectorAll(':scope > .ql-ui').forEach(marker => marker.remove());\n delete item.dataset.list;\n item.classList.remove(`ql-indent-${level}`);\n if (!item.classList.length) item.removeAttribute('class');\n current.el.appendChild(item);\n });\n list.replaceWith(root);\n });\n}\n","import {\n ChangeDetectorRef,\n Component,\n DestroyRef,\n inject,\n Injector,\n Input,\n OnInit\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport {\n LegalPagesService,\n LegalPolicy,\n LegalTab,\n PermissionService\n} from '@posiwise/common-services';\nimport { ADMIN_ROUTERS } from '@posiwise/common-utilities';\n\nimport { Observable, of } from 'rxjs';\nimport { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/operators';\n\nimport { toSemanticLists } from './quill-lists';\n\nconst TABS = new Set<LegalTab>(['privacy-policy', 'terms-of-service']);\n\ninterface SubscribedProduct {\n id: number;\n product_privacy_service_id?: number;\n}\n\n/**\n * Public routes (`data.public`) show the policy at `/privacy-policy[/:slug]`; without a slug, the\n * visitor's domain default. Signed-in pages and the embedded `[productId]` use show the policy of\n * that product, resolved to a slug so the id never reaches a URL; with no signed-in user they fall\n * back to the domain default rather than waiting forever.\n */\n@Component({\n selector: 'pw-privacy-and-tos',\n templateUrl: './privacy-and-tos.component.html',\n styleUrls: ['./privacy-and-tos.component.scss', './privacy-and-tos-lists.scss'],\n\n standalone: false\n})\nexport class PrivacyAndTosComponent extends AppBaseComponent implements OnInit {\n @Input() productId: number;\n\n // Plain strings: Angular's sanitizer runs on [innerHTML]. The policy is readable without\n // signing in, so its HTML must never be marked trusted (rulebook OUT6).\n data: { privacy?: string; tos?: string; tos_updated_at?: string };\n\n privacyServiceId: number;\n\n readonly routers = ADMIN_ROUTERS;\n\n tabId: LegalTab = 'privacy-policy';\n\n isPublic: boolean;\n\n isLoaded: boolean;\n\n tocPrivacy: { id: string; text: string }[] = [];\n tocTos: { id: string; text: string }[] = [];\n\n private readonly destroyRef = inject(DestroyRef);\n\n get companyName(): string {\n return this.appConfig?.company?.name ?? '';\n }\n get companyEmail(): string {\n return this.appConfig?.company?.email ?? '';\n }\n\n constructor(\n private readonly legalPages: LegalPagesService,\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n /** Edit affordance is restricted to (Master) Subscription Admins who can reach /admin/tos. */\n get canEditPolicy(): boolean {\n return !!this.privacyServiceId && this.permissionService.isUserSubscriptionSuperAdmin();\n }\n\n ngOnInit() {\n const snapshot = this.route.snapshot;\n const tab = (snapshot.queryParamMap.get('tab') ?? snapshot.data?.['tab']) as LegalTab;\n this.tabId = TABS.has(tab) ? tab : 'privacy-policy';\n this.isPublic = !!snapshot.data?.['public'];\n\n const slug$ =\n this.productId || !this.isPublic\n ? this.productSlug(this.productId ?? PermissionService.selectedProduct?.id)\n : this.route.params.pipe(map(params => (params['slug'] as string) ?? null));\n\n slug$\n .pipe(\n tap(() => (this.isLoaded = false)),\n // switchMap: a newer slug (route change, user change) cancels an older request.\n switchMap(slug => this.legalPages.getPolicy(slug).pipe(catchError(() => of(null)))),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe(policy => {\n this.show(policy);\n this.isLoaded = true;\n this.cdr.markForCheck();\n });\n }\n\n private productSlug(productId?: number): Observable<string | null> {\n return this.userStore().pipe(\n map(user => user?.id ?? null),\n distinctUntilChanged(),\n switchMap(userId =>\n userId\n ? this.userService.getUserSubscriptions(userId).pipe(\n map(response => this.policyIdOf(response?.subscriptions, productId)),\n catchError(() => of(null))\n )\n : of(null)\n ),\n switchMap(policyId => this.legalPages.slugFor(policyId))\n );\n }\n\n private policyIdOf(\n subscriptions: { products: SubscribedProduct[] }[] | undefined,\n productId?: number\n ): number | null {\n const product = (subscriptions ?? [])\n .flatMap(subscription => subscription?.products ?? [])\n .find(item => item?.id === productId);\n return product?.product_privacy_service_id ?? null;\n }\n\n private show(policy: LegalPolicy | null) {\n this.privacyServiceId = policy?.id;\n const privacy = this.parse(policy?.privacy, 'pp');\n const tos = this.parse(policy?.tos, 'tos');\n this.tocPrivacy = privacy.toc;\n this.tocTos = tos.toc;\n this.data = policy\n ? { tos_updated_at: policy.tos_updated_at, privacy: privacy.html, tos: tos.html }\n : {};\n }\n\n private parse(html: string | undefined, prefix: string) {\n if (!html || typeof DOMParser === 'undefined') return { html, toc: [] };\n\n const doc = new DOMParser().parseFromString(html, 'text/html');\n doc.querySelectorAll('button').forEach(b => b.remove());\n toSemanticLists(doc);\n const toc = this.buildToc(doc, prefix);\n return { html: doc.body.innerHTML, toc };\n }\n\n private buildToc(doc: Document, prefix: string): { id: string; text: string }[] {\n const items: { id: string; text: string }[] = [];\n doc.querySelectorAll('h2').forEach((h, i) => {\n const id = `${prefix}-${i}`;\n h.id = id;\n items.push({ id, text: h.textContent?.trim() ?? '' });\n });\n return items;\n }\n}\n","@if (isPublic) {\n <pw-header [landing]=\"false\"></pw-header>\n}\n\n<div class=\"legal-page\" [class.legal-page--public]=\"isPublic\">\n\n <section class=\"legal-hero\">\n <div class=\"legal-hero__container\">\n @if (!isPublic) {\n <a class=\"legal-hero__back\" (click)=\"back()\" (keydown.enter)=\"back()\" role=\"button\" tabindex=\"0\" aria-label=\"Back\">\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\n <span>Back</span>\n </a>\n }\n <span class=\"legal-hero__eyebrow\">Legal</span>\n <h1 class=\"legal-hero__title\">Privacy &amp; terms</h1>\n <p class=\"legal-hero__subtitle\">\n @if (companyName) {\n Read how {{ companyName }} handles your data and what governs your use of the product.\n } @else {\n Read how we handle your data and what governs your use of the product.\n }\n </p>\n <div class=\"legal-hero__meta\">\n @if (data?.tos_updated_at) {\n <span class=\"legal-hero__pill\">\n <i class=\"fa fa-clock\" aria-hidden=\"true\"></i>\n Last updated {{ data.tos_updated_at | date: 'MMM d, y' }}\n </span>\n }\n @if (!isPublic && canEditPolicy) {\n <a class=\"legal-hero__edit\"\n [routerLink]=\"[routers.tosAndPrivacyDetails + privacyServiceId]\"\n [attr.aria-label]=\"'Button.Edit' | transloco\">\n <i class=\"fa fa-pen\" aria-hidden=\"true\"></i>\n <span>{{ 'Button.Edit' | transloco }}</span>\n </a>\n }\n </div>\n </div>\n </section>\n\n <div class=\"legal-tabs-band\">\n <div class=\"legal-tabs-band__container\">\n <ul ngbNav #nav=\"ngbNav\" [(activeId)]=\"tabId\" class=\"legal-tabs\">\n <li [ngbNavItem]=\"'privacy-policy'\" class=\"legal-tabs__item\">\n <a ngbNavLink class=\"legal-tabs__link\">Privacy policy</a>\n <ng-template ngbNavContent>\n <article class=\"legal-page__card\">\n @if (data?.privacy) {\n <div class=\"ql-container ql-snow legal-page__body\">\n <div class=\"ql-editor\" [innerHTML]=\"data?.privacy\"></div>\n </div>\n } @else {\n <div class=\"legal-page__empty\">\n <i class=\"fa fa-file-lines\" aria-hidden=\"true\"></i>\n <h2>Privacy policy isn't published yet</h2>\n <p>The policy for this product hasn't been written. Check back later.</p>\n </div>\n }\n </article>\n </ng-template>\n </li>\n <li [ngbNavItem]=\"'terms-of-service'\" class=\"legal-tabs__item\">\n <a ngbNavLink class=\"legal-tabs__link\">Terms of service</a>\n <ng-template ngbNavContent>\n <article class=\"legal-page__card\">\n @if (data?.tos) {\n <div class=\"ql-container ql-snow legal-page__body\">\n <div class=\"ql-editor\" [innerHTML]=\"data?.tos\"></div>\n </div>\n } @else {\n <div class=\"legal-page__empty\">\n <i class=\"fa fa-file-lines\" aria-hidden=\"true\"></i>\n <h2>Terms of service aren't published yet</h2>\n <p>The terms for this product haven't been written. Check back later.</p>\n </div>\n }\n </article>\n </ng-template>\n </li>\n </ul>\n </div>\n </div>\n\n <div class=\"legal-body\" [class.legal-body--no-toc]=\"\n (tabId === 'privacy-policy' && !tocPrivacy.length) ||\n (tabId === 'terms-of-service' && !tocTos.length)\n \">\n <div class=\"legal-body__container\">\n\n @if ((tabId === 'privacy-policy' && tocPrivacy.length) || (tabId === 'terms-of-service' && tocTos.length)) {\n <aside class=\"legal-sidebar\" aria-label=\"On this page\">\n <p class=\"legal-sidebar__label\">On this page</p>\n <nav class=\"legal-sidebar__nav\">\n @if (tabId === 'privacy-policy') {\n @for (item of tocPrivacy; track item.id) {\n <a class=\"legal-sidebar__link\" [href]=\"'#' + item.id\">{{ item.text }}</a>\n }\n } @else {\n @for (item of tocTos; track item.id) {\n <a class=\"legal-sidebar__link\" [href]=\"'#' + item.id\">{{ item.text }}</a>\n }\n }\n </nav>\n </aside>\n }\n\n <main class=\"legal-main\">\n <pw-loader [isVisible]=\"!isLoaded\"></pw-loader>\n @if (isLoaded) {\n <div [ngbNavOutlet]=\"nav\"></div>\n }\n\n @if (isLoaded && companyEmail) {\n <section class=\"legal-contact\">\n <span class=\"legal-contact__label\">Questions?</span>\n <h2 class=\"legal-contact__title\">Talk to us about your data.</h2>\n <p class=\"legal-contact__body\">\n If anything here is unclear, or you want to exercise a right under these\n policies, reach out and we'll get back to you.\n </p>\n <a class=\"legal-contact__cta\" [href]=\"'mailto:' + companyEmail\">\n <i class=\"fa fa-envelope\" aria-hidden=\"true\"></i>\n <span>{{ companyEmail }}</span>\n </a>\n </section>\n }\n </main>\n\n </div>\n </div>\n\n</div>\n","import { ChangeDetectorRef, Component, Injector, Input, OnDestroy, OnInit } from '@angular/core';\nimport { NavigationEnd } from '@angular/router';\n\nimport { AppBaseComponent } from '@posiwise/app-base-component';\nimport { PermissionService } from '@posiwise/common-services';\nimport { Subscription } from '@posiwise/common-utilities';\n\nimport { MenuItem } from 'primeng/api';\nimport { Subscription as RxSubscription } from 'rxjs';\n\n@Component({\n selector: 'pw-tabs',\n templateUrl: './pw-tabs.component.html',\n\n standalone: false\n})\nexport class PwTabsComponent extends AppBaseComponent implements OnInit, OnDestroy {\n @Input()\n items: MenuItem[] = [];\n\n @Input()\n withSubscription = false;\n\n /** Current tab value (route path) for p-tabs */\n activeTabValue: string | number;\n\n private routeEventSubscription: RxSubscription;\n\n constructor(\n injector: Injector,\n private readonly cdr: ChangeDetectorRef\n ) {\n super(injector);\n }\n\n ngOnInit() {\n if (this.withSubscription) {\n this.getUserSubscription().subscribe((subscription: Subscription) => {\n this.items.forEach(item => {\n // prepends the subscription slug to the route while keeping routerLink as an array\n if (Array.isArray(item.routerLink) && item.routerLink.length > 0) {\n const originalRoute = item.routerLink[0];\n item.routerLink = [`/${subscription?.slug}${originalRoute}`];\n }\n item.visible = item?.state\n ? this.permissionService.evaluatePermissions(\n item.state['permission'],\n PermissionService.selectedProduct?.feature_key,\n PermissionService.selectedProduct?.permission_key\n )\n : item.visible;\n });\n this.updateActiveTab();\n });\n } else {\n // For non-subscription tabs, update active tab after view init\n setTimeout(() => this.updateActiveTab(), 0);\n }\n\n this.routeEventSubscription = this.router.events.subscribe(e => {\n if (e instanceof NavigationEnd) {\n this.updateActiveTab();\n }\n });\n }\n\n /** Arrow function so trackBy is called with correct `this` from template */\n trackByItem = (_index: number, item: MenuItem): string => {\n return this.getItemValue(item);\n };\n\n getItemValue(item: MenuItem): string {\n if (!item.routerLink) {\n return (item as MenuItem & { id?: string }).id ?? item.label ?? '';\n }\n const routePath = Array.isArray(item.routerLink) ? item.routerLink[0] : item.routerLink;\n return String(routePath);\n }\n\n onTabChange(value: string | number): void {\n const item = this.items.find(i => this.getItemValue(i) === value);\n if (item?.routerLink) {\n const routePath = Array.isArray(item.routerLink) ? item.routerLink : [item.routerLink];\n this.router.navigate(routePath);\n }\n }\n\n private updateActiveTab(): void {\n if (!this.items.length) {\n return;\n }\n\n const currentUrl = this.router.url.split('?')[0];\n const matchedItem = this.items.find(item => {\n if (!item.routerLink || item.visible === false) {\n return false;\n }\n const routePath = Array.isArray(item.routerLink) ? item.routerLink[0] : item.routerLink;\n const pathStr = String(routePath);\n return currentUrl === pathStr || currentUrl.startsWith(pathStr + '/');\n });\n\n this.activeTabValue = matchedItem ? this.getItemValue(matchedItem) : undefined;\n this.cdr.markForCheck();\n }\n\n override ngOnDestroy() {\n this.routeEventSubscription.unsubscribe();\n }\n}\n","<div class=\"container-fluid pw-tab overflow-hidden\">\n <p-tabs [value]=\"activeTabValue\" (valueChange)=\"onTabChange($event)\">\n <p-tablist>\n @for (item of items; track trackByItem($index, item)) {\n @if (item.visible !== false) {\n <p-tab [value]=\"getItemValue(item)\">\n @if (item.icon) {\n <i [class]=\"item.icon\" aria-hidden=\"true\"></i>\n }\n <span>{{ item.label }}</span>\n </p-tab>\n }\n }\n </p-tablist>\n </p-tabs>\n <div class=\"dashboard\">\n <div class=\"dashboard-body\">\n <router-outlet></router-outlet>\n </div>\n </div>\n</div>\n","import { AfterViewInit, Component, EventEmitter, Input, Output, ViewChild } from '@angular/core';\n\nimport moment from 'moment';\nimport { DaterangepickerDirective } from 'ngx-daterangepicker-material';\n\n@Component({\n selector: 'app-date-picker',\n templateUrl: './date-range-picker.component.html',\n styleUrls: ['./date-range-picker.component.scss'],\n\n standalone: false\n})\nexport class DateRangePickerComponent implements AfterViewInit {\n @ViewChild(DaterangepickerDirective, { static: false })\n pickerDirective: DaterangepickerDirective;\n\n private initialized = false;\n\n @Input() selectedDateRange: { startDate: moment.Moment; endDate: moment.Moment };\n @Input() dateRanges;\n /** Optional unique id for the input (for accessibility). Defaults to 'date-range-picker-input'. */\n @Input() inputId = 'date-range-picker-input';\n @Output() dateRangeChange = new EventEmitter<{\n startDate: moment.Moment;\n endDate: moment.Moment;\n }>();\n\n onDateRangeSelect(event: { startDate: moment.Moment; endDate: moment.Moment }) {\n if (event.startDate && event.endDate) {\n this.dateRangeChange.emit(event);\n }\n }\n ngAfterViewInit() {\n setTimeout(() => {\n this.initialized = true;\n });\n }\n onClearDate() {\n if (!this.initialized) {\n return;\n }\n this.dateRangeChange.emit({ startDate: null, endDate: null });\n }\n openDatepicker() {\n setTimeout(() => {\n this.pickerDirective.open();\n this.refreshPicker();\n }, 50);\n }\n // The app runs zoneless (Angular 21+ default), but ngx-daterangepicker-material\n // relies on zone.js to re-render after `show()` sets `isShown`. Without this the\n // picker's state flips to open while its DOM keeps the `hidden` class. Only the\n // picker's own ChangeDetectorRef reaches its dynamically created view.\n refreshPicker() {\n setTimeout(() => this.pickerDirective?.picker?.['ref']?.detectChanges());\n }\n}\n","<div class=\"my-3\">\n <div class=\"row\">\n <!-- start date -->\n <div class=\"col-6 col-sm-3\">\n <div class=\"\">\n <label [attr.for]=\"inputId\" class=\"visually-hidden\">Select a date range (optional)</label>\n <input [id]=\"inputId\"\n [name]=\"inputId\"\n ngxDaterangepickerMd\n class=\"form-control\"\n [(ngModel)]=\"selectedDateRange\"\n [ranges]=\"dateRanges\"\n [alwaysShowCalendars]=\"true\"\n [locale]=\"{ format: 'DD-MMM-YYYY' }\"\n [showCustomRangeLabel]=\"true\"\n [linkedCalendars]=\"true\"\n [showClearButton]=\"true\"\n (clearClicked)=\"onClearDate()\"\n (click)=\"refreshPicker()\"\n placeholder=\"Select a date range (optional)\"\n opens=\"center\"\n (ngModelChange)=\"onDateRangeSelect($event)\"\n id=\"input_selectedDateRange_2368\" name=\"input_selectedDateRange_2368\"\n aria-label=\"Select a date range (optional)\" />\n </div>\n </div>\n <div class=\"col-6 col-sm-3 pop\">\n\n <div class=\"daterange-trigger\">\n <button class=\"btn btn-primary ngx-daterangepicker-action\"\n (click)=\"openDatepicker()\"\n type=\"button\">\n <i class=\"fa fa-calendar\" aria-hidden=\"true\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\nexport type CompletionTier = 'low' | 'mid' | 'high';\n\n/**\n * Generic, presentational segmented completion/progress bar.\n *\n * Renders a row of discrete segments; the first `round(value/100 * segments)`\n * are filled. The fill colour shifts by tier (low/mid/high) using the shared\n * semantic token maps — never the tenant accent (design-system: accent-agnostic).\n * Reusable anywhere via `@posiwise/shared-components`.\n */\n@Component({\n selector: 'pw-completion-bar',\n template: `\n <div\n class=\"pw-completion-bar\"\n role=\"progressbar\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n [attr.aria-valuenow]=\"clampedValue\"\n [attr.aria-label]=\"ariaLabel || tooltip || displayLabel\"\n [ngbTooltip]=\"tooltip\"\n container=\"body\"\n >\n <span class=\"pw-completion-bar__track\" [ngClass]=\"'tier-' + tier\">\n @for (i of segmentIndexes; track i) {\n <span class=\"pw-completion-bar__seg\" [class.is-filled]=\"i < filledCount\"></span>\n }\n </span>\n @if (showLabel) {\n <span class=\"pw-completion-bar__label\">{{ displayLabel }}</span>\n }\n </div>\n `,\n styleUrls: ['./completion-bar.component.scss'],\n standalone: false,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CompletionBarComponent {\n @Input() segments = 10;\n @Input() showLabel = true;\n /** Optional label override; defaults to the rounded percentage. */\n @Input() label: string | null = null;\n /** Optional aria-label override; defaults to the visible label. */\n @Input() ariaLabel: string | null = null;\n /**\n * Optional explanatory tooltip (e.g. \"what's missing to reach 100%\").\n * Rendered as a body-level portal (C18); no tooltip when null/empty.\n */\n @Input() tooltip: string | null = null;\n /** `value` below this is the low tier. */\n @Input() lowThreshold = 34;\n /** `value` at/above this is the high tier. */\n @Input() highThreshold = 67;\n\n private internalValue = 0;\n\n /** Completion as a 0–100 percentage. Out-of-range inputs are clamped. */\n @Input()\n set value(v: number) {\n this.internalValue = Number.isFinite(v) ? Math.min(100, Math.max(0, v)) : 0;\n }\n get value(): number {\n return this.internalValue;\n }\n\n get clampedValue(): number {\n return Math.round(this.internalValue);\n }\n\n get filledCount(): number {\n return Math.round((this.internalValue / 100) * this.segments);\n }\n\n get segmentIndexes(): number[] {\n return Array.from({ length: this.segments }, (_, i) => i);\n }\n\n get tier(): CompletionTier {\n if (this.internalValue < this.lowThreshold) {\n return 'low';\n }\n return this.internalValue >= this.highThreshold ? 'high' : 'mid';\n }\n\n get displayLabel(): string {\n return this.label ?? `${this.clampedValue}%`;\n }\n}\n","/**\n * Whether a subscription's onboarding checklist is collapsed, remembered in this browser (cloudolive-api#441).\n * Kept out of the component for its line budget.\n */\nfunction storageKey(subscriptionId: number | null): string {\n return `pw-onboarding-collapsed-${subscriptionId ?? 'none'}`;\n}\n\n/** true / false once the user has toggled; null when they never did or storage is unavailable. */\nexport function readCollapsed(subscriptionId: number | null): boolean | null {\n try {\n const value = localStorage.getItem(storageKey(subscriptionId));\n return value === null ? null : value === 'true';\n } catch {\n return null;\n }\n}\n\nexport function writeCollapsed(subscriptionId: number | null, collapsed: boolean): void {\n try {\n localStorage.setItem(storageKey(subscriptionId), String(collapsed));\n } catch {\n // Not remembered; the toggle still works for this visit.\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n faChevronDown,\n faChevronUp,\n faCircle,\n faCircleCheck,\n faCircleExclamation,\n faCircleHalfStroke,\n faCircleQuestion,\n faHourglassHalf,\n IconDefinition\n} from '@fortawesome/free-solid-svg-icons';\n\nimport { readCollapsed, writeCollapsed } from './onboarding-checklist.storage';\nimport {\n OnboardingStatus,\n OnboardingStep,\n OnboardingStepState\n} from './onboarding-checklist.types';\n\nconst STATE_ICONS: Record<OnboardingStepState, IconDefinition> = {\n done: faCircleCheck,\n next: faCircleHalfStroke,\n ready: faCircleHalfStroke,\n blocked: faCircleExclamation,\n waiting: faHourglassHalf,\n todo: faCircle,\n optional: faCircle,\n unknown: faCircleQuestion\n};\n\n/**\n * Presentational onboarding checklist (cloudolive-api#441). Product-agnostic: the host fetches the\n * status from its own product API and passes it in, plus the route placeholders' values.\n *\n * Gating (AI54) is the host's: pass `loading` until the request resolves and `loadFailed` on error.\n * Renders nothing for `not_applicable` / `unavailable` — \"no onboarding\" and \"can't tell right now\"\n * both hide the card rather than show an empty or broken one.\n */\n@Component({\n selector: 'pw-onboarding-checklist',\n templateUrl: './onboarding-checklist.component.html',\n styleUrls: ['./onboarding-checklist.component.scss'],\n standalone: false,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class OnboardingChecklistComponent implements OnChanges {\n @Input() status: OnboardingStatus | null = null;\n @Input() loading = false;\n @Input() loadFailed = false;\n /** Values for the `{slug}` / `{subscription_id}` placeholders in step routes. */\n @Input() slug = '';\n @Input() subscriptionId: number | null = null;\n\n /** The host is saving a manual tick: the tick controls are disabled meanwhile. */\n @Input() busy = false;\n\n @Output() readonly retry = new EventEmitter<void>();\n /** A manual step was ticked (completed: true) or unticked; the host saves it and passes the new status. */\n @Output() readonly markDone = new EventEmitter<{ key: string; completed: boolean }>();\n\n readonly doneIcon = faCircleCheck;\n readonly helpIcon = faCircleQuestion;\n readonly expandIcon = faChevronDown;\n readonly collapseIcon = faChevronUp;\n\n /**\n * Whether the steps below the progress line are shown. Collapsed by default, so the card stays a\n * one-line progress summary on /home until someone opens it; their choice is remembered per\n * subscription in this browser.\n */\n expanded = false;\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['subscriptionId']) {\n this.expanded = readCollapsed(this.subscriptionId) === false;\n }\n }\n\n toggle(): void {\n this.expanded = !this.expanded;\n writeCollapsed(this.subscriptionId, !this.expanded);\n }\n\n get visible(): boolean {\n return this.loading || this.loadFailed || this.status?.status === 'ok';\n }\n\n /** Recommended steps, done and total, shown next to the mandatory progress (\"+ 1 of 3 recommended\"). */\n get recommended(): { done: number; total: number } {\n const optional = (this.status?.steps ?? []).filter(step => step.kind === 'optional');\n return {\n done: optional.filter(step => step.state === 'done').length,\n total: optional.length\n };\n }\n\n /** One segment per mandatory step, so the bar reads as \"steps done\", not an abstract percentage. */\n get progressSegments(): number[] {\n return Array.from({ length: this.status?.progress?.total ?? 0 }, (_, index) => index);\n }\n\n /**\n * Every required step is done. Deliberately NOT `status.activated`: activation is the product's\n * milestone (e.g. a first finalised reconciliation) and can be reached with required steps still\n * open, which made \"You're all set\" sit above \"5 of 8 steps done\".\n */\n get allDone(): boolean {\n const progress = this.status?.progress;\n return !!progress?.total && progress.done >= progress.total;\n }\n\n /**\n * Mandatory steps (they count towards progress) and recommended ones (`kind: 'optional'`), listed\n * under their own headings instead of a label repeated on every row.\n */\n get groups(): { key: string; labelKey: string; steps: OnboardingStep[] }[] {\n const steps = this.status?.steps ?? [];\n return [\n {\n key: 'mandatory',\n labelKey: 'OnboardingChecklist.Group.Mandatory',\n steps: steps.filter(step => step.kind !== 'optional')\n },\n {\n key: 'recommended',\n labelKey: 'OnboardingChecklist.Group.Recommended',\n steps: steps.filter(step => step.kind === 'optional')\n }\n ];\n }\n\n /** The group heading already says \"Recommended\", so an open optional step reads \"To do\". */\n stateLabelKey(step: OnboardingStep): string {\n const state = step.state === 'optional' ? 'todo' : step.state;\n return `OnboardingChecklist.State.${state}`;\n }\n\n get currentStep(): OnboardingStep | null {\n return this.status?.steps.find(step => step.current) ?? null;\n }\n\n icon(step: OnboardingStep): IconDefinition {\n return STATE_ICONS[step.state] ?? faCircle;\n }\n\n routeFor(step: OnboardingStep): string | null {\n if (!step.route) {\n return null;\n }\n return step.route\n .replace('{slug}', this.slug ?? '')\n .replace('{subscription_id}', String(this.subscriptionId ?? ''));\n }\n\n /** /{subscription slug}/faq/{faq slug} (the app's `:slug/faq/:id` route); null when there is no FAQ. */\n faqHref(step: OnboardingStep): string | null {\n return step.faq_slug && this.slug ? `/${this.slug}/faq/${step.faq_slug}` : null;\n }\n\n /** A step's call to action; null when there is nothing for this viewer to click. */\n actionKey(step: OnboardingStep): string | null {\n if (\n step.can_act === false ||\n ['done', 'waiting', 'unknown'].includes(step.state) ||\n !this.routeFor(step)\n ) {\n return null;\n }\n if (step.state === 'blocked') {\n return 'OnboardingChecklist.Action.Fix';\n }\n return step.state === 'ready'\n ? 'OnboardingChecklist.Action.Finish'\n : 'OnboardingChecklist.Action.Start';\n }\n\n /**\n * A manual step the viewer can tick: no check decides it (check_key null), its state is known, and the\n * viewer may act on it (an admin-only step needs an admin).\n */\n canTick(step: OnboardingStep): boolean {\n return step.check_key === null && step.state !== 'unknown' && step.can_act !== false;\n }\n\n tick(step: OnboardingStep): void {\n this.markDone.emit({ key: step.key, completed: step.state !== 'done' });\n }\n}\n","@if (visible) {\n <div class=\"card pw-onboarding\">\n <div class=\"card-content p-0\">\n <pw-loader [isVisible]=\"loading\"></pw-loader>\n\n @if (!loading) {\n @if (loadFailed) {\n <pw-no-data [withImage]=\"true\" [message]=\"'OnboardingChecklist.LoadFailed' | transloco\">\n <div #content>\n <button type=\"button\" class=\"btn btn-outline-secondary btn-sm\" (click)=\"retry.emit()\">\n {{ 'OnboardingChecklist.Action.Retry' | transloco }}\n </button>\n </div>\n </pw-no-data>\n } @else if (status) {\n <div class=\"card-header mt-0\">\n <h3 class=\"mb-2\">{{ 'OnboardingChecklist.Title' | transloco }}</h3>\n @if (allDone) {\n <p class=\"pw-onboarding__all-set\">\n <fa-icon [icon]=\"doneIcon\" aria-hidden=\"true\"></fa-icon>\n {{ 'OnboardingChecklist.AllSet' | transloco }}\n </p>\n } @else {\n <p>{{ 'OnboardingChecklist.Intro' | transloco }}</p>\n }\n @if (status.progress.total) {\n <div class=\"pw-onboarding__progress\">\n <progress class=\"pw-onboarding__progress-value\" [max]=\"status.progress.total\" [value]=\"status.progress.done\"\n [attr.aria-label]=\"'OnboardingChecklist.Progress' | transloco: { done: status.progress.done, total: status.progress.total }\"></progress>\n <span class=\"pw-onboarding__progress-label\">\n {{ 'OnboardingChecklist.Progress' | transloco: { done: status.progress.done, total: status.progress.total } }}\n @if (recommended.total) {\n <span class=\"pw-onboarding__progress-extra\">\n {{ 'OnboardingChecklist.ProgressRecommended' | transloco: { done: recommended.done, total: recommended.total } }}\n </span>\n }\n </span>\n <span class=\"pw-onboarding__progress-track\" [class.is-complete]=\"allDone\" aria-hidden=\"true\">\n @for (segment of progressSegments; track segment) {\n <span class=\"pw-onboarding__progress-seg\" [class.is-filled]=\"segment < status.progress.done\"></span>\n }\n </span>\n </div>\n }\n <button type=\"button\" class=\"btn btn-outline-primary pw-onboarding__toggle\" (click)=\"toggle()\"\n [attr.aria-expanded]=\"expanded\" aria-controls=\"pw-onboarding-steps\">\n <fa-icon [icon]=\"expanded ? collapseIcon : expandIcon\" aria-hidden=\"true\"></fa-icon>\n {{ (expanded ? 'OnboardingChecklist.Toggle.Hide' : 'OnboardingChecklist.Toggle.Show') | transloco }}\n </button>\n </div>\n\n @if (expanded) {\n <div id=\"pw-onboarding-steps\">\n @if (currentStep; as step) {\n <div class=\"pw-onboarding__current\" [class.is-blocked]=\"step.state === 'blocked'\">\n <div class=\"pw-onboarding__current-text\">\n <span class=\"pw-onboarding__current-title\">\n <strong class=\"pw-onboarding__current-name\">{{ step.title ?? (step.title_key | transloco) }}</strong>\n <ng-container *ngTemplateOutlet=\"faqLink; context: { $implicit: step }\"></ng-container>\n </span>\n @if (step.state === 'blocked' && step.reason_key) {\n <span class=\"pw-onboarding__reason\">\n <fa-icon [icon]=\"icon(step)\" aria-hidden=\"true\"></fa-icon>\n {{ step.reason_key | transloco }}\n </span>\n @if (step.detail) {\n <span class=\"pw-onboarding__detail\">{{ step.detail }}</span>\n }\n } @else if (step.state === 'waiting') {\n <span class=\"pw-onboarding__muted\">{{ 'OnboardingChecklist.Waiting' | transloco }}</span>\n } @else if (step.description || step.description_key) {\n <span class=\"pw-onboarding__muted\">{{ step.description ?? (step.description_key | transloco) }}</span>\n }\n @if (step.can_act === false) {\n <span class=\"pw-onboarding__muted\">{{ 'OnboardingChecklist.AskAdmin' | transloco }}</span>\n }\n </div>\n <div class=\"pw-onboarding__current-actions\">\n @if (actionKey(step); as action) {\n <a class=\"btn btn-primary pw-onboarding__main-action\" [routerLink]=\"routeFor(step)\">{{ action | transloco }}</a>\n }\n @if (canTick(step)) {\n <button type=\"button\" class=\"btn pw-onboarding__main-action\" [class.btn-primary]=\"!actionKey(step)\"\n [class.btn-outline-primary]=\"actionKey(step)\" [disabled]=\"busy\" (click)=\"tick(step)\">\n {{ 'OnboardingChecklist.Action.MarkDone' | transloco }}\n </button>\n }\n </div>\n </div>\n }\n\n @for (group of groups; track group.key) {\n @if (group.steps.length) {\n <p class=\"pw-onboarding__group\">{{ group.labelKey | transloco }}</p>\n <ol class=\"pw-onboarding__steps\">\n @for (item of group.steps; track item.key) {\n <li class=\"pw-onboarding__step\" [ngClass]=\"'is-' + item.state\" [class.is-current]=\"item.current\">\n <fa-icon class=\"pw-onboarding__marker\" [icon]=\"icon(item)\" aria-hidden=\"true\"></fa-icon>\n <span class=\"pw-onboarding__step-title\">\n {{ item.title ?? (item.title_key | transloco) }}\n <ng-container *ngTemplateOutlet=\"faqLink; context: { $implicit: item }\"></ng-container>\n </span>\n @if (actionKey(item); as action) {\n <a class=\"btn btn-outline-primary btn-sm pw-onboarding__row-action\" [routerLink]=\"routeFor(item)\"\n [attr.aria-label]=\"(action | transloco) + ' ' + (item.title ?? (item.title_key | transloco))\">{{ action | transloco }}</a>\n }\n @if (canTick(item)) {\n <button type=\"button\" class=\"btn btn-outline-primary btn-sm pw-onboarding__row-action\" [disabled]=\"busy\"\n (click)=\"tick(item)\"\n [attr.aria-label]=\"((item.state === 'done' ? 'OnboardingChecklist.Action.Undo' : 'OnboardingChecklist.Action.MarkDone') | transloco) + ' ' + item.title\">\n {{ (item.state === 'done' ? 'OnboardingChecklist.Action.Undo' : 'OnboardingChecklist.Action.MarkDone') | transloco }}\n </button>\n }\n <span class=\"pw-onboarding__state\">{{ stateLabelKey(item) | transloco }}</span>\n </li>\n }\n </ol>\n }\n }\n </div>\n }\n }\n }\n </div>\n </div>\n}\n\n<ng-template #faqLink let-step>\n @if (faqHref(step); as href) {\n <a class=\"pw-onboarding__help\" [href]=\"href\" target=\"_blank\" rel=\"noopener\"\n [attr.aria-label]=\"('OnboardingChecklist.Help' | transloco) + ' ' + (step.title ?? (step.title_key | transloco))\"\n [pTooltip]=\"'OnboardingChecklist.Help' | transloco\" tooltipPosition=\"top\" appendTo=\"body\">\n <fa-icon [icon]=\"helpIcon\" aria-hidden=\"true\"></fa-icon>\n </a>\n }\n</ng-template>\n","import { DragDropModule } from '@angular/cdk/drag-drop';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\n\nimport { AppLoaderModule } from '@posiwise/app-loader';\nimport { CoreTranslocoModule } from '@posiwise/core-transloco';\nimport { DirectivesModule } from '@posiwise/directives';\nimport {\n FieldErrorDisplayModule,\n ProfileImageCropperModule,\n ResourceHeaderModule\n} from '@posiwise/utils';\n\nimport { AutoCompleteModule } from 'primeng/autocomplete';\nimport { ButtonModule } from 'primeng/button';\nimport { ProgressSpinnerModule } from 'primeng/progressspinner';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { FontAwesomeModule } from '@fortawesome/angular-fontawesome';\nimport { NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';\n\nimport { CompletionBarComponent } from './completion-bar/completion-bar.component';\nimport { InputContainerComponent } from './input-container/input-container.component';\nimport { NoDataComponent } from './no-data/no-data.component';\nimport { OnboardingChecklistComponent } from './onboarding-checklist/onboarding-checklist.component';\nimport { RecordsSummaryComponent } from './records-summary/records-summary.component';\n\n@NgModule({\n declarations: [\n NoDataComponent,\n InputContainerComponent,\n CompletionBarComponent,\n RecordsSummaryComponent,\n OnboardingChecklistComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n RouterModule,\n FontAwesomeModule,\n AppLoaderModule,\n CoreTranslocoModule,\n DirectivesModule,\n ButtonModule,\n NgbTooltipModule,\n TooltipModule,\n ProgressSpinnerModule,\n AutoCompleteModule,\n DragDropModule,\n FieldErrorDisplayModule,\n ProfileImageCropperModule, // ✅ Import the separate module\n ResourceHeaderModule // ✅ Import the separate module\n ],\n exports: [\n ProfileImageCropperModule, // ✅ Re-export module for backward compatibility\n ResourceHeaderModule, // ✅ Re-export module for backward compatibility\n InputContainerComponent,\n NoDataComponent,\n CompletionBarComponent,\n RecordsSummaryComponent,\n OnboardingChecklistComponent,\n ButtonModule,\n DragDropModule,\n ProgressSpinnerModule,\n AutoCompleteModule,\n TooltipModule,\n FieldErrorDisplayModule\n ]\n})\nexport class ResourceSharedComponentsModule {}\n","import { Component } from '@angular/core';\n\n@Component({\n templateUrl: './splash.component.html',\n\n standalone: false\n})\nexport class SplashComponent {}\n","<pw-loader [isVisible]=\"true\"></pw-loader>\n","import { CommonModule, NgIf } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { RouterModule } from '@angular/router';\n\nimport { AppLoaderModule } from '@posiwise/app-loader';\nimport { CoreTranslocoModule } from '@posiwise/core-transloco';\nimport { DirectivesModule } from '@posiwise/directives';\nimport { PipesModule } from '@posiwise/pipes';\nimport { FieldErrorDisplayModule } from '@posiwise/utils';\n\nimport { NgxDaterangepickerMd } from 'ngx-daterangepicker-material';\nimport { ImageCropperComponent } from 'ngx-image-cropper';\nimport { UiSwitchModule } from 'ngx-ui-switch';\nimport { AutoCompleteModule } from 'primeng/autocomplete';\nimport { ButtonModule } from 'primeng/button';\nimport { IconFieldModule } from 'primeng/iconfield';\nimport { InputIconModule } from 'primeng/inputicon';\nimport { InputTextModule } from 'primeng/inputtext';\nimport { MultiSelectModule } from 'primeng/multiselect';\nimport { ProgressSpinnerModule } from 'primeng/progressspinner';\nimport { SelectModule } from 'primeng/select';\nimport { TableModule } from 'primeng/table';\nimport { TabsModule } from 'primeng/tabs';\nimport { TooltipModule } from 'primeng/tooltip';\n\nimport { NgbModalModule, NgbNavModule, NgbTooltipModule } from '@ng-bootstrap/ng-bootstrap';\n\nimport { AiKnowledgeComponent } from './ai-knowledge/ai-knowledge.component';\nimport { AuthenticatorComponent } from './authenticator/authenticator.component';\nimport { PwBrainChatComponent } from './brain-chat/pw-brain-chat.component';\nimport { PwBrainChatConfirmComponent } from './brain-chat/pw-brain-chat-confirm.component';\nimport { PwBrainChatQuickComponent } from './brain-chat/pw-brain-chat-quick.component';\nimport { SafeMarkdownPipe } from './brain-chat/pw-brain-chat-safe-markdown.pipe';\nimport { PwBrainChatThreadDirective } from './brain-chat/pw-brain-chat-thread.directive';\nimport { PwBrainChatVoiceOverlayComponent } from './brain-chat/pw-brain-chat-voice-overlay.component';\nimport { PwBrainChatWelcomeComponent } from './brain-chat/pw-brain-chat-welcome.component';\nimport { ClearBitIconComponent } from './clearbit-icon/clearbit-icon.component';\nimport { CollapsibleSidebarComponent } from './collapsible-sidebar/collapsible-sidebar.component';\nimport { CollapsibleSidebarTriggerDirective } from './collapsible-sidebar/collapsible-sidebar-trigger.directive';\nimport { ComingSoonComponent } from './coming-soon/coming-soon.component';\nimport { CommandPaletteComponent } from './command-palette/command-palette.component';\nimport { ConfirmDialogComponent } from './confirm-dialog/confirm-dialog.component';\nimport { PwCookieBannerComponent } from './cookie-banner/pw-cookie-banner.component';\nimport { ChartBlockComponent } from './dynamic-page/blocks/chart-block.component';\nimport { DataTableBlockComponent } from './dynamic-page/blocks/data-table-block.component';\nimport { DividerBlockComponent } from './dynamic-page/blocks/divider-block.component';\nimport { SectionHeadingBlockComponent } from './dynamic-page/blocks/section-heading-block.component';\nimport { StatCardBlockComponent } from './dynamic-page/blocks/stat-card-block.component';\nimport { PwDynamicPageComponent } from './dynamic-page/pw-dynamic-page.component';\nimport { HeaderComponent } from './header/header.component';\nimport { EntityGroupComponent } from './label-management/entity-group/entity-group.component';\nimport { GroupDefinitionComponent } from './label-management/group-definition/group-definition.component';\nimport { GroupsComponent } from './label-management/groups/groups.component';\nimport { LandingPageFooterBComponent } from './landing-page-footer-b/landing-page-footer-b.component';\nimport { NumberPickerComponent } from './number-picker/number-picker.component';\nimport { OnlineIndicatorComponent } from './online-indicator/online-indicator.component';\nimport { PasswordValidationComponent } from './password-validation/password-validation.component';\nimport { PermissionTreeComponent } from './permission-tree/permission-tree.component';\nimport { PrivacyAndTosComponent } from './privacy-and-tos/privacy-and-tos.component';\nimport { PwTabsComponent } from './pw-tabs/pw-tabs.component';\nimport { DateRangePickerComponent } from './range-date-picker/date-range-picker.component';\nimport { ResourceSharedComponentsModule } from './resource-shared-components.module';\nimport { SplashComponent } from './splash/splash.component';\nimport { PwStickyActionsComponent } from './sticky-actions/pw-sticky-actions.component';\n\n// All modules needed for both landing page and dashboard\nconst allModules = [\n NgbTooltipModule,\n TooltipModule,\n NgbNavModule,\n NgbModalModule,\n TableModule,\n TabsModule,\n ButtonModule,\n SelectModule,\n MultiSelectModule,\n ProgressSpinnerModule,\n AutoCompleteModule,\n ImageCropperComponent,\n UiSwitchModule,\n NgxDaterangepickerMd.forRoot()\n];\n\n@NgModule({\n declarations: [\n AiKnowledgeComponent,\n CommandPaletteComponent,\n ConfirmDialogComponent,\n PasswordValidationComponent,\n PwTabsComponent,\n DateRangePickerComponent,\n PermissionTreeComponent,\n PrivacyAndTosComponent,\n SplashComponent,\n AuthenticatorComponent,\n ClearBitIconComponent,\n ComingSoonComponent,\n CollapsibleSidebarComponent,\n PwBrainChatComponent,\n PwBrainChatConfirmComponent,\n PwBrainChatQuickComponent,\n PwBrainChatWelcomeComponent,\n PwBrainChatVoiceOverlayComponent,\n\n EntityGroupComponent,\n GroupsComponent,\n GroupDefinitionComponent,\n NumberPickerComponent,\n OnlineIndicatorComponent,\n HeaderComponent,\n LandingPageFooterBComponent,\n\n PwDynamicPageComponent,\n SectionHeadingBlockComponent,\n DividerBlockComponent,\n StatCardBlockComponent,\n DataTableBlockComponent,\n ChartBlockComponent\n ],\n imports: [\n PwStickyActionsComponent,\n FormsModule,\n IconFieldModule,\n InputIconModule,\n InputTextModule,\n AppLoaderModule,\n ReactiveFormsModule,\n DirectivesModule,\n CoreTranslocoModule,\n RouterModule,\n allModules,\n PipesModule,\n CommonModule,\n NgIf,\n FieldErrorDisplayModule,\n ResourceSharedComponentsModule,\n CollapsibleSidebarTriggerDirective,\n PwCookieBannerComponent,\n SafeMarkdownPipe,\n PwBrainChatThreadDirective\n ],\n exports: [\n AiKnowledgeComponent,\n CommandPaletteComponent,\n ConfirmDialogComponent,\n PwCookieBannerComponent,\n PasswordValidationComponent,\n PwTabsComponent,\n DateRangePickerComponent,\n allModules,\n PermissionTreeComponent,\n PrivacyAndTosComponent,\n SplashComponent,\n AuthenticatorComponent,\n ClearBitIconComponent,\n ComingSoonComponent,\n CollapsibleSidebarComponent,\n CollapsibleSidebarTriggerDirective,\n PwBrainChatComponent,\n EntityGroupComponent,\n GroupsComponent,\n GroupDefinitionComponent,\n NumberPickerComponent,\n OnlineIndicatorComponent,\n HeaderComponent,\n LandingPageFooterBComponent,\n PwDynamicPageComponent,\n FieldErrorDisplayModule,\n ResourceSharedComponentsModule\n ]\n})\nexport class SharedComponentsModule {}\n","import { Route, Routes } from '@angular/router';\n\nimport { LegalTab } from '@posiwise/common-services';\n\nimport { PrivacyAndTosComponent } from './privacy-and-tos.component';\n\nexport interface LegalPageRouteOptions {\n /** Overrides the per-tab page title, e.g. for a product's SEO title. */\n title?: string;\n description?: string;\n canActivate?: Route['canActivate'];\n}\n\nconst TITLES: Record<LegalTab, string> = {\n 'privacy-policy': 'Privacy Policy',\n 'terms-of-service': 'Terms & conditions'\n};\n\n/** `/privacy-policy[/:slug]` and `/terms-conditions[/:slug]`, readable without signing in. */\nexport function publicLegalPageRoutes(options: LegalPageRouteOptions = {}): Routes {\n const page = (path: string, tab: LegalTab): Route => ({\n path,\n component: PrivacyAndTosComponent,\n data: {\n title: options.title ?? TITLES[tab],\n ...(options.description ? { description: options.description } : {}),\n public: true,\n tab\n },\n ...(options.canActivate ? { canActivate: options.canActivate } : {})\n });\n\n return [\n page('privacy-policy', 'privacy-policy'),\n page('privacy-policy/:slug', 'privacy-policy'),\n page('terms-conditions', 'terms-of-service'),\n page('terms-conditions/:slug', 'terms-of-service'),\n // Links published while policies were addressed by id: the id is ignored and the\n // visitor's domain default is shown, since an id is no longer accepted publicly.\n // `full`: a prefix match would carry the old id along as a slug (/privacy-policy/2).\n { path: 'privacy-and-tos', redirectTo: 'privacy-policy', pathMatch: 'full' },\n { path: 'privacy-and-tos/:Id', redirectTo: 'privacy-policy', pathMatch: 'full' }\n ];\n}\n\n/** Inside the signed-in app: the policy of the selected product. */\nexport function dashboardLegalPageRoutes(): Routes {\n const page = (path: string, tab: LegalTab): Route => ({\n path,\n component: PrivacyAndTosComponent,\n data: { title: TITLES[tab], tab }\n });\n\n // No 'privacy-and-tos' here: the dashboard is matched before the public routes, so its auth guard\n // would send a visitor who is not signed in to /login instead of the public redirect.\n return [\n page('privacy-policies', 'privacy-policy'),\n page('terms-of-service', 'terms-of-service')\n ];\n}\n","/**\n * The onboarding status every product API returns from its `onboarding_status` tool and\n * `GET onboarding/:subscription_id/status` endpoint (cloudolive-api#441). Product-agnostic: step titles and\n * descriptions are the text the product's master subscription admin wrote; blocked reasons and states arrive\n * as Transloco keys owned by the product.\n */\nexport type OnboardingStepState =\n 'done' | 'next' | 'ready' | 'blocked' | 'waiting' | 'todo' | 'optional' | 'unknown';\n\nexport interface OnboardingStep {\n key: string;\n position: number;\n kind: 'required' | 'optional' | 'system';\n /** The step's title as the admin wrote it. */\n title?: string;\n description?: string | null;\n /** The product's check that decides the step; null = manual, the customer ticks it. */\n check_key?: string | null;\n /** @deprecated Transloco key from before steps became editable; use `title`. */\n title_key?: string;\n /** @deprecated Use `description`. */\n description_key?: string | null;\n route?: string | null;\n /** Slug of the FAQ that explains the step; null when the product API found no FAQ the viewer can open. */\n faq_slug?: string | null;\n activation: boolean;\n admin_only: boolean;\n depends_on: string[];\n state: OnboardingStepState;\n /** True for the one step the customer should act on now. */\n current: boolean;\n reason_key?: string;\n /** The customer's own system's message (e.g. their PSA's error), already truncated. */\n detail?: string;\n meta?: Record<string, unknown>;\n /** False when the step needs an admin and the viewer is not one; null when unknown. */\n can_act: boolean | null;\n}\n\nexport interface OnboardingStatus {\n subscription_id: number;\n feature_key: string | null;\n status: 'ok' | 'not_applicable' | 'unavailable';\n activated: boolean;\n next_step: string | null;\n progress: { done: number; total: number };\n steps: OnboardingStep[];\n}\n\n/**\n * The subscription has a checklist with mandatory steps still to do. Products use it to hold a user on /home\n * at login (common-services ONBOARDING_STATUS_SOURCES).\n */\nexport function hasOpenMandatorySteps(status: OnboardingStatus | null | undefined): boolean {\n const progress = status?.progress;\n return status?.status === 'ok' && !!progress?.total && progress.done < progress.total;\n}\n","import { Injectable } from '@angular/core';\n\nimport { PermissionService, UserService } from '@posiwise/common-services';\nimport { User } from '@posiwise/common-utilities';\n\nimport { distinctUntilChanged, map } from 'rxjs/operators';\n\n/**\n * CollapsibleSidebarSuperAdminGuard\n *\n * RBAC guard to ensure only SuperAdmin users can access/trigger the collapsible sidebar.\n *\n * Usage in templates:\n * ```html\n * <button\n * *ngIf=\"(superAdminGuard.canAccessSidebar$ | async)\"\n * pwCollapsibleSidebarTrigger\n * [contentId]=\"'posiwise-brain'\"\n * >\n * <i class=\"pi pi-cog\"></i>\n * </button>\n * ```\n *\n * Usage in components:\n * ```typescript\n * canAccessSidebar$ = this.guard.canAccessSidebar$;\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CollapsibleSidebarSuperAdminGuard {\n /**\n * Emits true when the signed-in user has {@link PermissionService.isSuperAdmin}.\n * UX-only; backend must still enforce permissions.\n */\n readonly canAccessSidebar$ = this.userService.getUserState().pipe(\n map(state => CollapsibleSidebarSuperAdminGuard.userIsSuperAdmin(state?.currentUser)),\n distinctUntilChanged()\n );\n\n constructor(\n private readonly userService: UserService,\n private readonly permissionService: PermissionService\n ) {}\n\n /**\n * Same rule as {@link PermissionService#isSuperAdmin}, safe when user is not loaded.\n */\n canAccessSidebar(): boolean {\n return this.permissionService.user ? this.permissionService.isSuperAdmin() : false;\n }\n\n private static userIsSuperAdmin(user: User | null): boolean {\n return !!user?.auth?.granted?.['Pages.SuperAdmin'];\n }\n}\n","import { Injectable } from '@angular/core';\n\nimport { MainApiHttpService } from '@posiwise/common-services';\n\nimport { Observable } from 'rxjs';\n\nimport { UiLayoutResponse } from './ui-config.model';\n\n// Reads the caller's layout for a page from main-api. Server resolves all\n// bindings + RBAC; the client only renders what it is given (#933 §6.4).\n@Injectable({ providedIn: 'root' })\nexport class UiLayoutService {\n constructor(private readonly api: MainApiHttpService) {}\n\n getLayout(subscriptionId: number, pageKey: string): Observable<UiLayoutResponse> {\n const subscription = encodeURIComponent(String(subscriptionId));\n const page = encodeURIComponent(pageKey);\n return this.api.get<UiLayoutResponse>(\n `/ui_layouts?subscription_id=${subscription}&page_key=${page}`\n );\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n input,\n ViewEncapsulation\n} from '@angular/core';\n\nexport type PwNoticeTone = 'warning' | 'error' | 'info';\n\nconst ICONS: Record<PwNoticeTone, string> = {\n warning: 'fa-triangle-exclamation',\n error: 'fa-circle-exclamation',\n info: 'fa-circle-info'\n};\n\n/**\n * The notice banner a page shows above its content: a failed sync, a pinned note, a failed run.\n * The message is projected, so a caller can bind rich-text HTML into it. Tone colours come from\n * --pw-notice-warning / --pw-notice-error / --pw-notice-info, so a product can set its own.\n */\n@Component({\n selector: 'pw-notice',\n standalone: true,\n templateUrl: './pw-notice.component.html',\n styleUrls: ['./pw-notice.component.scss'],\n // Unscoped so .pw-notice__list reaches projected markup; every selector is prefixed .pw-notice.\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'pw-notice',\n '[class.pw-notice--warning]': \"tone() === 'warning'\",\n '[class.pw-notice--error]': \"tone() === 'error'\",\n '[class.pw-notice--info]': \"tone() === 'info'\",\n '[attr.role]': \"tone() === 'error' ? 'alert' : 'status'\"\n }\n})\nexport class PwNoticeComponent {\n readonly tone = input<PwNoticeTone>('warning');\n readonly heading = input<string | null | undefined>(null);\n\n readonly icon = computed(() => ICONS[this.tone()]);\n}\n","<i class=\"fas pw-notice__icon\"\n [class]=\"icon()\"\n aria-hidden=\"true\"></i>\n<div class=\"pw-notice__body\">\n @if (heading()) {\n <div class=\"pw-notice__heading\">{{ heading() }}</div>\n }\n <div class=\"pw-notice__text\">\n <ng-content />\n </div>\n</div>\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\n\n/**\n * The card an Add/Edit page groups its fields in: a tinted icon chip, a title, then the projected\n * fields. Dense, hairline-bordered, brand tint on the icon as the only colour.\n */\n@Component({\n selector: 'pw-edit-card',\n standalone: true,\n templateUrl: './pw-edit-card.component.html',\n styleUrls: ['./pw-edit-card.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class PwEditCardComponent {\n /** A Font Awesome icon name, e.g. `fa-layer-group`. */\n readonly icon = input.required<string>();\n readonly title = input.required<string>();\n}\n","<div class=\"card pw-edit-card\">\n <div class=\"card-body\">\n <div class=\"pw-edit-card__head\">\n <span class=\"pw-edit-card__icon\"\n aria-hidden=\"true\"><i class=\"fa-regular {{ icon() }}\"></i></span>\n <h3>{{ title() }}</h3>\n </div>\n <ng-content />\n </div>\n</div>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAa,yBAAb,MAAa,uBAAsB;CAG/B,YAA4B,OAAqB;EAArB,KAAA,QAAA;EAFnB,KAAA,SAA8B,CAAA;CAEa;CAEpD,IAAI,OAAI;EACJ,IAAI,KAAK,OAAO,MACZ,OAAO,KAAK,OAAO;EAEvB,IAAI,KAAK,OAAO,aACZ,OAAO;EAEX,IAAI,KAAK,OAAO,aACZ,OAAO;EAEX,OAAO;CACX;CAEA,IAAI,YAAS;EACT,IAAI,KAAK,OAAO,MACZ,OAAO,KAAK,OAAO;EAEvB,QAAQ,KAAK,MAAb;GACI,KAAK,eAID,OAAO;GACX,KAAK,QACD,OAAO;GACX,SACI,OAAO;EACf;CACJ;CAEA,IAAI,WAAQ;EACR,OAAO,KAAK,OAAO,YAAY;CACnC;CAEA,IAAI,WAAQ;EACR,OAAO,KAAK,OAAO,SAAS;CAChC;CAEA,IAAI,cAAW;EACX,OAAO,KAAK,OAAO,eAAe,CAAA;CACtC;CAEA,IAAI,UAAO;EACP,OAAO,KAAK,OAAO,WAAW;CAClC;CAEA,IAAI,UAAO;EACP,OAAO,KAAK,OAAO,QAAQ;CAC/B;CAEA,IAAI,aAAU;EACV,OAAO,KAAK,OAAO,cAAc,CAAA;CACrC;CAEA,IAAI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A;IACA;GAA0B;GAAA,SAAA;IAG1B;IACA;IACA;IACA;IACA;IACA;IACA;IAjFJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAAcA,GAAA;IAuEV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GAA8B;EAAA,CAAA;CAAA;CAGzB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAsB,SAAA;IAlD3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IAEA;IAtEJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IAAcA,GAAA;IAwFV;IACA;GAA8B;EAAA,CAAA;CAAA;;AAGzB,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAsB,YAAA,CAAA;EAxFlC,MAAA;EAAS,MAAA,CAAA;GACN,cAAc;IACV;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;IACA;IAEA;IACA;IACA;IACA;IACA;IACA;GACH;GACD,SAAS;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACH;GACD,SAAS;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACH;EACJ,CAAA;;;AC9JD,MAAM,SAAmC;CACrC,kBAAkB;CAClB,oBAAoB;AACvB;AAGD,SAAgB,sBAAsB,UAAiC,CAAA,GAAE;CACrE,MAAM,QAAQ,MAA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