@forgeroute/ui 0.5.31 → 0.5.33
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.
- package/fesm2022/forgeroute-ui-address-input.mjs +10 -2
- package/fesm2022/forgeroute-ui-address-input.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-conversations.mjs +1 -0
- package/fesm2022/forgeroute-ui-conversations.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-core.mjs +22 -2
- package/fesm2022/forgeroute-ui-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-data-table-core.mjs +21 -7
- package/fesm2022/forgeroute-ui-data-table-core.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-editor.mjs +1 -0
- package/fesm2022/forgeroute-ui-editor.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-form-row.mjs +54 -18
- package/fesm2022/forgeroute-ui-form-row.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-form-section.mjs +32 -4
- package/fesm2022/forgeroute-ui-form-section.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-kpi-card.mjs +20 -4
- package/fesm2022/forgeroute-ui-kpi-card.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-list-item.mjs +2 -2
- package/fesm2022/forgeroute-ui-list-item.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-map.mjs +10 -2
- package/fesm2022/forgeroute-ui-map.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-messaging.mjs +31 -6
- package/fesm2022/forgeroute-ui-messaging.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-notification-bell.mjs +1 -0
- package/fesm2022/forgeroute-ui-notification-bell.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-offline.mjs +1 -0
- package/fesm2022/forgeroute-ui-offline.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-payments.mjs +29 -5
- package/fesm2022/forgeroute-ui-payments.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-phone-number-picker.mjs +1 -0
- package/fesm2022/forgeroute-ui-phone-number-picker.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-quickbooks.mjs +11 -2
- package/fesm2022/forgeroute-ui-quickbooks.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-share-menu.mjs +46 -15
- package/fesm2022/forgeroute-ui-share-menu.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-square.mjs +1 -0
- package/fesm2022/forgeroute-ui-square.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-stripe.mjs +22 -4
- package/fesm2022/forgeroute-ui-stripe.mjs.map +1 -1
- package/fesm2022/forgeroute-ui-table-types.mjs.map +1 -1
- package/package.json +1 -1
- package/types/forgeroute-ui-core.d.ts +9 -2
- package/types/forgeroute-ui-data-table-core.d.ts +5 -0
- package/types/forgeroute-ui-form-row.d.ts +14 -0
- package/types/forgeroute-ui-form-section.d.ts +8 -1
- package/types/forgeroute-ui-kpi-card.d.ts +7 -0
- package/types/forgeroute-ui-list-item.d.ts +1 -1
- package/types/forgeroute-ui-share-menu.d.ts +20 -11
- package/types/forgeroute-ui-table-types.d.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forgeroute-ui-data-table-core.mjs","names":[],"sources":["../../../projects/forgeroute-ui/data-table-core/src/lib/data-table/load-error-message.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/data-table/filter-values.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/data-table/query-params.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/import-export/import-source-grid.component.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/import-export/import-export.component.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/data-table/data-table.component.ts"],"sourcesContent":["import { UiLabelKey } from '@forgeroute/ui/core';\n\n/**\n * Which sentence a failed table load (or table action) shows. The CAUSE decides, so each message says what happened, why in plain words and what to do, and\n * \"offline\" is said ONLY when it is true:\n * - gave up waiting (the offline layer's RequestTimeoutError: `timeout === true`) -> loadError.timeout\n * - the offline layer's own \"no connection and no saved copy\" answer (status 0, statusText 'Offline') -> loadError.noCopy (says there is no saved copy of THIS view on this device)\n * - no answer (status 0) while the browser reports it is offline -> loadError.offline (neutral: no claim about saved data)\n * - no answer (status 0) while the browser says it is online (server down, DNS, blocked) -> loadError.unreachable\n * - 401 session ended / 403 no permission / 5xx server problem -> loadError.session / forbidden / server\n * - anything else -> loadError.other\n * Duck-typed on purpose: the offline layer is a separate entry point that this component must not import.\n */\nexport type LoadErrorKey = Extract<UiLabelKey,\n 'dataTable.loadError.offline' | 'dataTable.loadError.noCopy' | 'dataTable.loadError.unreachable' | 'dataTable.loadError.timeout' | 'dataTable.loadError.session'\n | 'dataTable.loadError.forbidden' | 'dataTable.loadError.server' | 'dataTable.loadError.other'>;\n\nexport type ActionErrorKey = Extract<UiLabelKey, 'dataTable.actionError.offline' | 'dataTable.actionError.unreachable' | 'dataTable.actionError.timeout' | 'dataTable.genericError'>;\n\nconst browserIsOnline = (): boolean => (typeof navigator === 'undefined' ? true : navigator.onLine !== false);\n\ntype ErrLike = { status?: unknown; statusText?: unknown; timeout?: unknown };\n\nfunction noAnswerKind(err: unknown, online: boolean): 'timeout' | 'noCopy' | 'offline' | 'unreachable' | null {\n const e = err as ErrLike | null | undefined;\n if (!e || typeof e !== 'object') return null;\n if (e.timeout === true && e.status === 0) return 'timeout';\n if (e.status === 0) return e.statusText === 'Offline' ? 'noCopy' : !online ? 'offline' : 'unreachable';\n return null;\n}\n\nexport function loadErrorKey(err: unknown, online: boolean = browserIsOnline()): LoadErrorKey {\n const none = noAnswerKind(err, online);\n if (none) return `dataTable.loadError.${none}`;\n const status = (err as ErrLike | null | undefined)?.status;\n if (status === 401) return 'dataTable.loadError.session';\n if (status === 403) return 'dataTable.loadError.forbidden';\n if (typeof status === 'number' && status >= 500) return 'dataTable.loadError.server';\n return 'dataTable.loadError.other';\n}\n\nexport function actionErrorKey(err: unknown, online: boolean = browserIsOnline()): ActionErrorKey {\n const none = noAnswerKind(err, online);\n if (none === 'offline' || none === 'noCopy') return 'dataTable.actionError.offline';\n if (none === 'unreachable') return 'dataTable.actionError.unreachable';\n if (none === 'timeout') return 'dataTable.actionError.timeout';\n return 'dataTable.genericError';\n}\n\n/**\n * The text of a failed table ACTION (bulk change / delete / download). The server's own message wins; a write the offline layer refused (`offlineBlocked`) or\n * timed out says its own plain words; otherwise the cause-based sentence.\n */\nexport function actionErrorText(err: unknown, translate: (key: ActionErrorKey) => string): string {\n const e = err as { error?: { message?: unknown }; offlineBlocked?: unknown; timeout?: unknown; message?: unknown } | null | undefined;\n const server = e?.error?.message;\n if (typeof server === 'string' && server.trim()) return server;\n if ((e?.offlineBlocked === true || e?.timeout === true) && typeof e.message === 'string' && e.message.trim()) return e.message;\n return translate(actionErrorKey(err));\n}\n","/**\n * Column-filter values travel as ONE comma-joined request parameter (`?section=Roofing,Siding`). A value that itself contains a comma\n * (\"Roofing, Inc.\") would be read as two. These helpers keep the wire format backward compatible and make such values unambiguous:\n *\n * - a value is sent AS IS unless joining it would be ambiguous: it contains a comma, a doubled backslash, or ends with a backslash;\n * - such a value is escaped: `\\` becomes `\\\\` and `,` becomes `\\,`;\n * - the reader splits on commas that are not escaped and unescapes `\\,` and `\\\\`; any other backslash is an ordinary character.\n *\n * So every value that worked before (no comma, no doubled / trailing backslash) is byte-for-byte unchanged, and a backend that does not know the\n * escaping keeps working for them. Backends that parse filter values should split with the same rules (`splitFilterList` in the contractor\n * backend, `decodeFilterValues` here).\n */\n\n/** Whether a value must be escaped to survive the comma-joined format. */\nfunction needsEscape(value: string): boolean {\n return value.includes(',') || value.includes('\\\\\\\\') || value.endsWith('\\\\');\n}\n\n/** One value as it is written into the comma-joined parameter. */\nexport function encodeFilterValue(value: string): string {\n return needsEscape(value) ? value.replace(/\\\\/g, '\\\\\\\\').replace(/,/g, '\\\\,') : value;\n}\n\n/** The comma-joined parameter for a list of filter values (`['Roofing, Inc.', 'Siding']` -> `Roofing\\, Inc.,Siding`). */\nexport function encodeFilterValues(values: readonly string[]): string {\n return values.map(encodeFilterValue).join(',');\n}\n\n/**\n * The values of a comma-joined parameter, the inverse of {@link encodeFilterValues}: split on unescaped commas, unescape `\\,` and `\\\\`,\n * trim each value and drop the empty ones (the same as the plain split it replaces).\n */\nexport function decodeFilterValues(raw: string): string[] {\n const out: string[] = [];\n let current = '';\n for (let i = 0; i < raw.length; i++) {\n const ch = raw[i];\n if (ch === '\\\\' && (raw[i + 1] === ',' || raw[i + 1] === '\\\\')) { current += raw[i + 1]; i++; continue; }\n if (ch === ',') { out.push(current); current = ''; continue; }\n current += ch;\n }\n out.push(current);\n return out.map(v => v.trim()).filter(Boolean);\n}\n","import { HttpParameterCodec, HttpParams } from '@angular/common/http';\n\n/**\n * Angular's default `HttpParams` codec leaves `+` as a plain `+` in the query string, and a server decodes a plain `+` as a SPACE.\n * A search for `name+tag@gmail.com` therefore reached the backend as `name tag@gmail.com` and matched nothing. This codec is Angular's\n * own (same readable `@ : $ , ; = ? /`) except that `+` is sent as `%2B`, so every character the user types reaches the server as typed.\n */\nclass PlusSafeParamCodec implements HttpParameterCodec {\n private encode(v: string): string {\n return encodeURIComponent(v)\n .replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/gi, '$').replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';').replace(/%3D/gi, '=').replace(/%3F/gi, '?').replace(/%2F/gi, '/');\n }\n encodeKey(key: string): string { return this.encode(key); }\n encodeValue(value: string): string { return this.encode(value); }\n decodeKey(key: string): string { return decodeURIComponent(key); }\n decodeValue(value: string): string { return decodeURIComponent(value); }\n}\n\nconst CODEC = new PlusSafeParamCodec();\n\n/** `HttpParams` for a table request: empty values are kept as given by the caller; `+` (and every other character) arrives as typed. */\nexport function tableQueryParams(values: Record<string, string> = {}): HttpParams {\n return new HttpParams({ encoder: CODEC, fromObject: values });\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation, input, output, computed, inject } from '@angular/core';\nimport { OptionCardComponent } from '@forgeroute/ui/option-card';\nimport type { ImportSource } from './import-export.component';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/**\n * The grid of source cards (\"Follow Up Boss\", \"kvCORE\", \"Custom CSV\" ...) of the import wizard's first step. Used inside the import window and\n * on its own (the setup wizard shows it inline so the user picks a source without opening the window first).\n *\n * <ui-import-source-grid [sources]=\"sources\" [selected]=\"picked\" ariaLabel=\"Select your Contact source\" (sourceSelect)=\"picked = $event\" />\n */\n@Component({\n selector: 'ui-import-source-grid',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [OptionCardComponent],\n template: `\n <div class=\"ie-source-grid\" [attr.role]=\"appearance() === 'card' ? 'group' : 'list'\" [class.ie-source-grid--cards]=\"appearance() === 'card'\" [attr.aria-label]=\"ariaLabel() || null\">\n @for (src of sources(); track src.value) {\n @if (appearance() === 'card') {\n <ui-option-card [attr.data-testid]=\"'source-' + src.value\" [title]=\"src.label\" [description]=\"src.desc || ''\" [letter]=\"src.letter || ''\" [color]=\"src.color || '#64748b'\"\n [actionLabel]=\"actionLabel()\" [actionTestId]=\"'source-pick-' + src.value\" [disabled]=\"disabled()\" (action)=\"sourceSelect.emit(src.value)\" />\n } @else {\n <button\n class=\"ie-source-card\"\n role=\"listitem\"\n type=\"button\"\n [class.ie-source-card--active]=\"selected() === src.value\"\n [attr.aria-pressed]=\"selected() === src.value\"\n [attr.data-testid]=\"'source-' + src.value\"\n (click)=\"sourceSelect.emit(src.value)\">\n @if (src.letter) {\n <span class=\"ie-source-letter\" [style.background]=\"src.color || '#64748b'\" aria-hidden=\"true\">{{ src.letter }}</span>\n }\n <span class=\"ie-source-label\">{{ src.label }}</span>\n @if (src.desc) { <span class=\"ie-source-desc\">{{ src.desc }}</span> }\n </button>\n }\n }\n </div>\n `,\n styles: [`\n ui-import-source-grid { display: block; }\n .ie-source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }\n @media (max-width: 520px) { .ie-source-grid { grid-template-columns: repeat(2, 1fr); } }\n .ie-source-card {\n display: flex; flex-direction: column; align-items: flex-start; gap: 4px;\n padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px;\n background: #fff; cursor: pointer; font-family: inherit; text-align: left;\n transition: all 0.15s;\n }\n .ie-source-card:hover { border-color: #94a3b8; background: #f8fafc; }\n .ie-source-card.ie-source-card--active { border-color: #3b82f6; background: #eff6ff; }\n .ie-source-card:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }\n .ie-source-letter { width: 36px; height: 36px; border-radius: 8px; color: #fff; font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n .ie-source-label { font-size: 0.8125rem; font-weight: 600; color: #1e293b; line-height: 1.2; }\n .ie-source-desc { font-size: 0.75rem; color: #64748b; }\n /* card appearance (a ui-detail-card per source): two columns on wide screens, the cards stretch to one height */\n .ie-source-grid--cards { grid-template-columns: repeat(2, 1fr); }\n @media (max-width: 520px) { .ie-source-grid--cards { grid-template-columns: 1fr; } }\n `],\n})\nexport class ImportSourceGridComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly sources = input.required<ImportSource[]>();\n /** The `value` of the picked source (highlighted). `tile` only: the `card` appearance does not keep a selection. */\n readonly selected = input('');\n /** `tile`: the compact buttons of the import window. `card`: one `ui-detail-card` per source with its own select button (used on a page). */\n readonly appearance = input<'tile' | 'card'>('tile');\n /** `card`: disables every card's button (for example while the page is saving). */\n readonly disabled = input(false);\n /** `card`: the text of each card's button. */\n readonly actionLabelInput = input<string | null>(null, { alias: 'actionLabel' });\n readonly actionLabel = computed(() => this.actionLabelInput() ?? this.labels.t('importExport.actionLabel'));\n /** Accessible name of the list. */\n readonly ariaLabel = input('');\n /** Emits the `value` of the clicked source. */\n readonly sourceSelect = output<string>();\n}\n","import {\n Component, input, output, effect, ChangeDetectionStrategy,\n ChangeDetectorRef, DestroyRef, ElementRef, inject, viewChild,\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport type { Observable } from 'rxjs';\nimport { tableQueryParams } from '../data-table/query-params';\nimport { FORGEROUTE_CONFIG } from '@forgeroute/ui/core';\nimport { ImportSourceGridComponent } from './import-source-grid.component';\nimport { FormsModule } from '@angular/forms';\nimport { ModalComponent } from '@forgeroute/ui/core';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { SelectComponent } from '@forgeroute/ui/select';\nimport { HintComponent } from '@forgeroute/ui/hint';\nimport type { SelectOption } from '@forgeroute/ui/select';\nimport { ToastService } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { csvSafeText } from '@forgeroute/ui/utils';\n\n// ── Public types ─────────────────────────────────────────────────────────────\n\nexport interface ImportFieldDef {\n key: string;\n label: string;\n required?: boolean;\n /**\n * An example of what the column should contain (e.g. `VACANT, OCCUPIED`, `500.00`, `YYYY-MM-DD`). It is shown under the field's\n * label in the column-mapping step as \"e.g. <example>\" and linked to the column dropdown for screen readers. Omit it and nothing changes.\n */\n example?: string;\n}\n\nexport interface ImportSource {\n value: string;\n label: string;\n desc?: string;\n letter?: string;\n color?: string;\n aliases?: Record<string, string[]>;\n}\n\nexport interface ImportExportConfig {\n entityName: string;\n entityNamePlural: string;\n exportEndpoint: string;\n /**\n * POST endpoint for the import wizard. Omit to make the table export-only —\n * ui-data-table only injects the Import button when this is set.\n */\n importEndpoint?: string;\n exportHeaders: string[];\n exportRow: (item: any) => (string | number)[];\n importFields?: ImportFieldDef[];\n columnAliases?: Record<string, string[]>;\n templateSampleRows?: string[][];\n /** Text of the template download button inside the import window, e.g. \"Download Cases CSV Template\" (default: \"Download template\"). */\n templateLabel?: string;\n /** When true, the Export button appears in the More Actions dropdown instead of as a standalone button. */\n exportInMoreActions?: boolean;\n}\n\ninterface ImportError { row: number; message: string; }\nexport interface ImportSubmitRequest { file: File | null; records: Record<string, string>[]; mapping: Record<string, string>; }\nexport interface ImportSubmitResult { imported: number; errors?: { row: number; message: string }[]; warnings?: { row: number; message: string }[]; }\n/** One problem the `validate` check found in a CSV row (`row` is the 1-based data row, the header not counted). A row may have several. */\nexport interface ImportRowIssue { row: number; message: string; }\ntype ImportStep = 'source' | 'upload' | 'mapping' | 'preview' | 'result';\n\n// ── CSV helpers ───────────────────────────────────────────────────────────────\n\n/** The delimiter of a CSV: comma, semicolon (European Excel) or tab, whichever the header line uses most outside quotes; comma on a tie. */\nfunction detectCsvDelimiter(text: string): string {\n const counts: Record<string, number> = { ',': 0, ';': 0, '\\t': 0 };\n let quoted = false;\n for (const ch of text) {\n if (ch === '\"') quoted = !quoted;\n else if (!quoted) {\n if (ch === '\\n' || ch === '\\r') break;\n if (ch in counts) counts[ch]++;\n }\n }\n return [',', ';', '\\t'].reduce((best, d) => (counts[d] > counts[best] ? d : best), ',');\n}\n\n/**\n * Reads CSV text (RFC 4180): a quoted cell may hold the delimiter, doubled quotes (\"\") and line breaks (CRM notes do), rows end at LF, CRLF or CR,\n * a leading byte-order mark is dropped and rows with only empty cells are skipped. The delimiter is detected from the header line.\n */\nfunction parseCsv(text: string): string[][] {\n const delimiter = detectCsvDelimiter(text);\n const rows: string[][] = [];\n let row: string[] = [];\n let cell = '';\n let quoted = false;\n const endCell = () => { row.push(cell); cell = ''; };\n const endRow = () => { endCell(); if (row.some(c => c.trim() !== '')) rows.push(row); row = []; };\n const src = text.replace(/^\\uFEFF/, '');\n for (let i = 0; i < src.length; i++) {\n const ch = src[i];\n if (quoted) {\n if (ch !== '\"') cell += ch;\n else if (src[i + 1] === '\"') { cell += '\"'; i++; }\n else quoted = false;\n } else if (ch === '\"' && cell === '') quoted = true;\n else if (ch === delimiter) endCell();\n else if (ch === '\\r') { if (src[i + 1] === '\\n') i++; endRow(); }\n else if (ch === '\\n') endRow();\n else cell += ch;\n }\n if (cell !== '' || row.length) endRow();\n return rows;\n}\n\n// The formula guard is the public csvSafeText of ../utils/csv (the same one every app's own CSV download uses).\nfunction csvCell(cell: string | number): string {\n return csvSafeText(cell);\n}\n\nfunction exportToCsv(filenamePrefix: string, headers: string[], rows: (string | number)[][]): void {\n const csvContent = [headers, ...rows]\n .map(row => row.map(cell => `\"${csvCell(cell).replace(/\"/g, '\"\"')}\"`).join(','))\n .join('\\n');\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = `${filenamePrefix}-${new Date().toISOString().split('T')[0]}.csv`;\n // Firefox (and older Safari) only start the download of an anchor that is in the document: add it, click it, take it out again.\n link.style.display = 'none';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n // Revoking synchronously can cancel the download in some browsers — release the URL once the click has been handled.\n setTimeout(() => URL.revokeObjectURL(url), 1000);\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n@Component({\n selector: 'ui-import-export',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, ModalComponent, ButtonComponent, SelectComponent, ImportSourceGridComponent, HintComponent],\n template: `\n <!-- Trigger buttons -->\n <div class=\"ie-actions\">\n <ui-button variant=\"secondary\" size=\"sm\" [loading]=\"exporting\" (click)=\"exportAll()\" [ariaLabel]=\"labels.t('importExport.exportAllRecordsToCsv')\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"/></svg>{{ labels.t('common.export') }}</ui-button>\n @if (!exportOnly()) {\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"openImport()\" [ariaLabel]=\"labels.t('importExport.importRecordsFromCsv')\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 5 17 10\"/><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\"/></svg>{{ labels.t('common.import') }}</ui-button>\n }\n </div>\n\n <!-- Import modal -->\n <ui-modal [open]=\"importOpen\" [title]=\"modalTitle\" maxWidth=\"640px\" [closable]=\"!importing\" (close)=\"closeImport()\">\n\n <!-- Step indicator -->\n <ol class=\"ie-steps\" [attr.aria-label]=\"labels.t('importExport.importProgress')\">\n @for (st of stepItems; track st.key) {\n <li class=\"ie-step\" [class.active]=\"st.current\" [class.done]=\"st.done\" [attr.aria-current]=\"st.current ? 'step' : null\">\n <span class=\"ie-step-num\" aria-hidden=\"true\">{{ st.num }}</span><span class=\"ie-step-label\">{{ st.label }}</span>@if (st.done) {<span class=\"ie-sr-only\">, {{ labels.t('importExport.stepDone') }}</span>}@if (st.current) {<span class=\"ie-sr-only\">, {{ labels.t('importExport.stepCurrent') }}</span>}\n </li>\n }\n </ol>\n\n <!-- Persistent live region: it exists from the moment the window opens, so the result text it receives later is announced reliably -->\n <div class=\"ie-sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-testid=\"import-announcement\">{{ resultAnnouncement }}</div>\n\n <!-- Step 1: Source selection -->\n @if (step === 'source' && importSources()) {\n <div class=\"ie-source-step\" #stepBox tabindex=\"-1\">\n <p class=\"ie-mapping-hint\">{{ labels.t('importExport.selectWhereYouReImporting') }}</p>\n <ui-import-source-grid [sources]=\"importSources()!\" [selected]=\"selectedSource\" [ariaLabel]=\"labels.t('importExport.selectSource', { entity: config.entityName })\" (sourceSelect)=\"onSourceSelected($event)\" />\n </div>\n }\n\n <!-- Step 2: Upload -->\n @if (step === 'upload') {\n <div class=\"ie-upload-area\" #stepBox tabindex=\"-1\">\n <div class=\"ie-template-hint\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"/></svg>{{ labels.t('importExport.startWithOurCsvTemplate') }}<ui-button variant=\"ghost\" size=\"sm\" data-testid=\"import-template-button\" (click)=\"downloadTemplate()\">{{ config.templateLabel || labels.t('importExport.downloadTemplate') }}</ui-button>\n </div>\n <label class=\"ie-dropzone\" [class.has-error]=\"!!fileError\">\n <input type=\"file\" class=\"ie-file-hidden\" accept=\".csv,text/csv\" [attr.aria-invalid]=\"fileError ? 'true' : null\" [attr.aria-describedby]=\"fileError ? uid + '-file-error' : null\" (change)=\"onFileChange($event)\" />\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#94a3b8\" stroke-width=\"1.5\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"17 8 12 3 7 8\"/><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\"/></svg>\n <span class=\"ie-dropzone-text\">{{ labels.t('importExport.clickToChooseACsv') }}</span>\n <span class=\"ie-dropzone-sub\">{{ labels.t('importExport.supportedCsvFiles') }}</span>\n </label>\n @if (fileError) { <p class=\"ie-error\" role=\"alert\" [id]=\"uid + '-file-error'\">{{ fileError }}</p> }\n </div>\n }\n\n <!-- Step 3: Column mapping -->\n @if (step === 'mapping') {\n <div class=\"ie-mapping\" #stepBox tabindex=\"-1\">\n @if (allRequiredMapped) {\n <div class=\"ie-mapping-success\">\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"m9 12 2 2 4-4\"/></svg>{{ labels.t('importExport.allRequiredColumnsMatchedAutomatically') }}<strong>{{ labels.t('importExport.previewImport') }}</strong>{{ labels.t('importExport.toContinue') }}</div>\n } @else {\n <p class=\"ie-mapping-hint\">\n {{ labels.t(unmappedRequiredFields.length === 1 ? 'importExport.unmappedRequired_one' : 'importExport.unmappedRequired_other', { count: unmappedRequiredFields.length }) }} <strong>{{ unmappedRequiredFields.join(', ') }}</strong>.\n {{ labels.t('importExport.mapManually') }}\n </p>\n }\n <div class=\"ie-mapping-table\" role=\"table\" [attr.aria-label]=\"labels.t('importExport.columnMapping', { entity: config.entityName })\">\n <div class=\"ie-mapping-header\" role=\"row\">\n <span role=\"columnheader\">{{ labels.t('importExport.entityField', { entity: config.entityName }) }}</span>\n <span role=\"columnheader\">{{ labels.t('importExport.yourCsvColumn') }}</span>\n <span role=\"columnheader\">{{ labels.t('importExport.sampleValue') }}</span>\n </div>\n @for (field of config.importFields; track field.key) {\n <div class=\"ie-mapping-row\" [class.ie-mapping-row--matched]=\"!!columnMapping[field.key]\" [class.ie-mapping-row--required-missing]=\"field.required && !columnMapping[field.key]\" role=\"row\">\n <span class=\"ie-field-label\" role=\"rowheader\">\n @if (columnMapping[field.key]) {\n <svg class=\"ie-match-icon\" width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><path d=\"m20 6-11 11-5-5\"/></svg>\n }\n {{ field.label }}\n @if (field.required) { <span class=\"ie-required\" aria-hidden=\"true\">*</span> }\n @if (field.example) { <ui-hint class=\"ie-field-example\" [attr.id]=\"exampleId(field)\">{{ labels.t('common.example', { value: field.example }) }}</ui-hint> }\n </span>\n <div role=\"cell\">\n <ui-select\n [ariaLabel]=\"labels.t(field.required ? 'importExport.columnForRequired' : 'importExport.columnFor', { field: field.label })\"\n [ariaDescribedBy]=\"field.example ? exampleId(field) : ''\"\n [options]=\"csvHeaderOptions\"\n [(ngModel)]=\"columnMapping[field.key]\"\n [error]=\"field.required && !columnMapping[field.key] ? labels.t('importExport.requiredError') : ''\" />\n </div>\n <span class=\"ie-sample\" role=\"cell\">{{ getSample(field.key) }}</span>\n </div>\n }\n </div>\n @if (unmatchedCsvHeaders.length > 0) {\n <p class=\"ie-mapping-unmatched\">\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"/></svg>\n {{ labels.t(unmatchedCsvHeaders.length === 1 ? 'importExport.unmatchedCsv_one' : 'importExport.unmatchedCsv_other', { count: unmatchedCsvHeaders.length }) }} <em>{{ unmatchedCsvHeaders.join(', ') }}</em>\n </p>\n }\n @if (mappingError) { <p class=\"ie-error\" role=\"alert\">{{ mappingError }}</p> }\n </div>\n }\n\n <!-- Step 4: Preview -->\n @if (step === 'preview') {\n <div class=\"ie-preview\" #stepBox tabindex=\"-1\">\n <p class=\"ie-mapping-hint\">{{ labels.t(previewRows.length === 1 ? 'importExport.previewRows_one' : 'importExport.previewRows_other', { shown: previewRows.length, total: csvRows.length }) }}</p>\n @if (validating) {\n <p class=\"ie-progress-text\" role=\"status\" data-testid=\"import-validating\">{{ labels.t('importExport.checkingYourRows') }}</p>\n }\n @if (validationErrors && validationErrors.length > 0) {\n <div class=\"ie-errors-list ie-validation\" data-testid=\"import-validation\">\n <p class=\"ie-errors-title\" role=\"alert\" data-testid=\"import-validation-summary\">{{ labels.t(validationRowCount === 1 ? 'importExport.rowsWithErrors_one' : 'importExport.rowsWithErrors_other', { count: validationRowCount }) }}</p>\n @if (allOrNothing()) {\n <p class=\"ie-mapping-hint ie-validation-hint\" data-testid=\"import-all-or-nothing-hint\">{{ labels.t('importExport.nothingIsSavedUntilEvery') }}</p>\n }\n <ul class=\"ie-result-list\" [attr.aria-label]=\"labels.t('importExport.rowsWithErrors')\">\n @for (err of validationErrors; track $index) {\n <li class=\"ie-error-row\" data-testid=\"import-validation-row\">\n <span class=\"ie-error-row-num\">{{ labels.t('importExport.rowNumber', { row: err.row }) }}</span>&ngsp;<span>{{ err.message }}</span>\n </li>\n }\n </ul>\n </div>\n }\n <div class=\"ie-preview-scroll\" tabindex=\"0\" role=\"region\" [attr.aria-label]=\"labels.t('importExport.importDataPreview')\">\n <table class=\"ie-preview-table\" [attr.aria-label]=\"labels.t('importExport.importDataPreview')\">\n <thead>\n <tr>@for (field of mappedFields; track field.key) { <th scope=\"col\">{{ field.label }}</th> }</tr>\n </thead>\n <tbody>\n @for (row of previewRows; track $index) {\n <tr>@for (field of mappedFields; track field.key) { <td>{{ row[field.key] || '—' }}</td> }</tr>\n }\n </tbody>\n </table>\n </div>\n @if (importing) {\n <div class=\"ie-progress\" data-testid=\"import-progress\">\n <div class=\"ie-progress-track\" aria-hidden=\"true\"><span class=\"ie-progress-bar\"></span></div>\n <p class=\"ie-progress-text\" data-testid=\"import-progress-text\">{{ labels.t(csvRows.length === 1 ? 'importExport.importingRecords_one' : 'importExport.importingRecords_other', { count: labels.formatNumber(csvRows.length) }) }} <span aria-hidden=\"true\">{{ importElapsed }}s.</span> {{ labels.t('importExport.keepThisWindowOpenUntil') }}</p>\n </div>\n }\n </div>\n }\n\n <!-- Step 5: Result -->\n @if (step === 'result') {\n <div class=\"ie-result\" #resultBox tabindex=\"-1\" role=\"region\" [attr.aria-label]=\"labels.t('importExport.importResult')\">\n @if (importResult) {\n <div class=\"ie-result-summary\">\n <div class=\"ie-result-stat success\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"m9 12 2 2 4-4\"/></svg>\n <strong>{{ importResult.imported }}</strong> {{ labels.t(importResult.imported === 1 ? 'importExport.recordSImported_one' : 'importExport.recordSImported_other') }}</div>\n @if (importResult.errors.length > 0) {\n <div class=\"ie-result-stat error\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"/><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"/></svg>\n <strong>{{ importResult.errors.length }}</strong> {{ labels.t(importResult.errors.length === 1 ? 'importExport.rowSHadErrors_one' : 'importExport.rowSHadErrors_other') }}</div>\n }\n @if (importResult.warnings.length > 0) {\n <div class=\"ie-result-stat warning\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"/><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"/><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"/></svg>\n <strong>{{ importResult.warnings.length }}</strong> {{ labels.t(importResult.warnings.length === 1 ? 'importExport.valueSChangedDuringImport_one' : 'importExport.valueSChangedDuringImport_other') }}</div>\n }\n </div>\n @if (importResult.errors.length > 0) {\n <div class=\"ie-errors-list\">\n <p class=\"ie-errors-title\" [id]=\"uid + '-errors-title'\">{{ labels.t('importExport.errors') }}</p>\n <ul class=\"ie-result-list\" [attr.aria-labelledby]=\"uid + '-errors-title'\">\n @for (err of importResult.errors; track $index) {\n <li class=\"ie-error-row\">\n <span class=\"ie-error-row-num\">{{ labels.t('importExport.rowNumber', { row: err.row }) }}</span>&ngsp;<span>{{ err.message }}</span>\n </li>\n }\n </ul>\n </div>\n }\n @if (importResult.warnings.length > 0) {\n <div class=\"ie-warnings-list\">\n <p class=\"ie-warnings-title\" [id]=\"uid + '-warnings-title'\">{{ labels.t('importExport.importedWithChanges') }}</p>\n <ul class=\"ie-result-list\" [attr.aria-labelledby]=\"uid + '-warnings-title'\">\n @for (w of importResult.warnings; track $index) {\n <li class=\"ie-warning-row\">\n <span class=\"ie-warning-row-num\">{{ labels.t('importExport.rowNumber', { row: w.row }) }}</span>&ngsp;<span>{{ w.message }}</span>\n </li>\n }\n </ul>\n </div>\n }\n }\n </div>\n }\n\n <!-- Footer. Every item is its own top-level @if with ONE root element: that is what lets ui-modal project it into its footer slot (a wrapper block with several items would land in the body). -->\n <!-- closeOnly (the setup wizard): no Back, no Cancel - one Close that shuts the window at once, plus the step's primary button -->\n @if (closeOnly() && step !== 'result') {\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" data-testid=\"import-close-button\" [disabled]=\"importing\" (click)=\"closeImport()\">{{ labels.t('common.close') }}</ui-button>\n }\n @if (closeOnly() && step === 'source') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" [disabled]=\"!selectedSource\" (click)=\"confirmSource()\">{{ labels.t('common.next') }}</ui-button>\n }\n @if (closeOnly() && step === 'mapping') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" [disabled]=\"!canSubmit\" (click)=\"goToPreview()\">{{ labels.t('importExport.previewImport') }}</ui-button>\n }\n @if (closeOnly() && step === 'preview') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" [loading]=\"importing\" [disabled]=\"importBlocked\" data-testid=\"import-submit-button\" (click)=\"submitImport()\">{{ importButtonLabel }}</ui-button>\n }\n @if (!closeOnly() && step === 'source') {\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n }\n @if (!closeOnly() && step === 'source') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" [disabled]=\"!selectedSource\" (click)=\"confirmSource()\">{{ labels.t('common.next') }}</ui-button>\n }\n @if (!closeOnly() && step === 'upload') {\n <span modal-footer-left></span>\n }\n @if (!closeOnly() && step === 'upload' && importSources()?.length) {\n <div modal-footer-right class=\"ie-footer-right\">\n <ui-button variant=\"ghost\" size=\"sm\" (click)=\"goTo('source')\">{{ labels.t('common.back') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n </div>\n }\n @if (!closeOnly() && step === 'upload' && !importSources()?.length) {\n <ui-button modal-footer-right variant=\"secondary\" size=\"sm\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n }\n @if (!closeOnly() && step === 'mapping') {\n <ui-button modal-footer-left variant=\"ghost\" size=\"sm\" (click)=\"goTo('upload')\">{{ labels.t('common.back') }}</ui-button>\n }\n @if (!closeOnly() && step === 'mapping') {\n <div modal-footer-right class=\"ie-footer-right\">\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button variant=\"primary\" size=\"sm\" [disabled]=\"!canSubmit\" (click)=\"goToPreview()\">{{ labels.t('importExport.previewImport') }}</ui-button>\n </div>\n }\n @if (!closeOnly() && step === 'preview') {\n <ui-button modal-footer-left variant=\"ghost\" size=\"sm\" [disabled]=\"importing\" (click)=\"goTo('mapping')\">{{ labels.t('common.back') }}</ui-button>\n }\n @if (!closeOnly() && step === 'preview') {\n <div modal-footer-right class=\"ie-footer-right\">\n <ui-button variant=\"secondary\" size=\"sm\" [disabled]=\"importing\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button variant=\"primary\" size=\"sm\" [loading]=\"importing\" [disabled]=\"importBlocked\" data-testid=\"import-submit-button\" (click)=\"submitImport()\">{{ importButtonLabel }}</ui-button>\n </div>\n }\n @if (step === 'result') {\n <span modal-footer-left></span>\n }\n @if (step === 'result') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" (click)=\"finishImport()\">{{ labels.t('common.done') }}</ui-button>\n }\n\n </ui-modal>\n `,\n styles: [`\n .ie-actions { display: flex; gap: 8px; }\n\n /* Step indicator */\n .ie-steps { display: flex; align-items: center; margin-bottom: 24px; gap: 0; list-style: none; padding: 0; }\n .ie-step { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }\n .ie-step-num { width: 24px; height: 24px; border-radius: 50%; background: #e2e8f0; color: #64748b; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n .ie-step-label { font-size: 0.8125rem; color: #64748b; font-weight: 500; }\n .ie-step.active .ie-step-num { background: #3b82f6; color: #fff; }\n .ie-step.active .ie-step-label { color: #1e293b; font-weight: 600; }\n .ie-step.done .ie-step-num { background: #22c55e; color: #fff; }\n .ie-step.done .ie-step-label { color: #64748b; }\n /* the line between two steps is drawn by the step itself (an <ol> may only hold <li> children) */\n .ie-step:not(:last-child) { flex: 1 1 auto; }\n .ie-step:not(:last-child)::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; margin: 0 8px; min-width: 16px; }\n .ie-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n\n /* Source step */\n .ie-source-step { display: flex; flex-direction: column; gap: 16px; }\n\n /* Upload step */\n .ie-upload-area { display: flex; flex-direction: column; gap: 12px; }\n .ie-template-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.875rem; color: #64748b; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 14px; }\n /* visually hidden but still focusable and operable by keyboard (Enter / Space open the file picker); never display:none */\n /* The input covers the whole drop zone, so a file dropped onto the zone lands on it and a click anywhere opens the picker. */\n .ie-file-hidden { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; overflow: hidden; cursor: pointer; }\n .ie-dropzone {\n position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;\n gap: 8px; padding: 40px 24px; border: 2px dashed #7c8ba1; border-radius: 10px;\n cursor: pointer; transition: border-color 180ms ease, background 180ms ease;\n &:hover, &:focus-within { border-color: #3b82f6; background: #f0f7ff; }\n &:focus-within { outline: 2px solid #3b82f6; outline-offset: 2px; }\n &.has-error { border-color: #ef4444; }\n }\n .ie-dropzone-text { font-size: 0.9375rem; font-weight: 600; color: #1e293b; }\n .ie-dropzone-sub { font-size: 0.8125rem; color: #64748b; }\n\n /* Mapping step */\n .ie-mapping { display: flex; flex-direction: column; gap: 12px; }\n .ie-mapping-hint { font-size: 0.875rem; color: #64748b; margin: 0; }\n .ie-mapping-success { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; font-size: 0.875rem; color: #15803d; svg { flex-shrink: 0; margin-top: 1px; color: #16a34a; } }\n .ie-mapping-unmatched { display: flex; align-items: flex-start; gap: 6px; font-size: 0.8125rem; color: #64748b; margin: 0; padding-top: 4px; svg { flex-shrink: 0; margin-top: 1px; } em { font-style: normal; color: #475569; } }\n .ie-mapping-table { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }\n .ie-mapping-header { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: 0.75rem; font-weight: 600; color: #64748b; text-transform: uppercase; }\n .ie-mapping-row { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: start; padding: 8px 12px; border-bottom: 1px solid #f1f5f9; gap: 8px; &:last-child { border-bottom: none; } }\n .ie-mapping-row.ie-mapping-row--required-missing { background: #fff7ed; .ie-field-label { color: #c2410c; } }\n .ie-match-icon { color: #16a34a; margin-right: 4px; vertical-align: -1px; }\n .ie-field-label { display: flex; flex-wrap: wrap; align-items: center; font-size: 0.875rem; color: #1e293b; font-weight: 500; }\n .ie-field-example { flex-basis: 100%; font-weight: 400; }\n .ie-required { color: #dc2626; margin-left: 2px; }\n .ie-sample { font-size: 0.8125rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n\n /* Preview step */\n .ie-preview { display: flex; flex-direction: column; gap: 12px; }\n .ie-preview-scroll { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 8px; &:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; } }\n .ie-result:focus, .ie-source-step:focus, .ie-upload-area:focus, .ie-mapping:focus, .ie-preview:focus { outline: none; }\n .ie-result-list { list-style: none; margin: 0; padding: 0; }\n .ie-preview-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; th { background: #f8fafc; padding: 8px 12px; text-align: left; font-size: 0.75rem; font-weight: 600; color: #64748b; text-transform: uppercase; border-bottom: 1px solid #e2e8f0; white-space: nowrap; } td { padding: 7px 12px; color: #1e293b; border-bottom: 1px solid #f1f5f9; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } tr:last-child td { border-bottom: none; } }\n\n /* Result step */\n .ie-result { display: flex; flex-direction: column; gap: 16px; }\n .ie-result-summary { display: flex; flex-direction: column; gap: 8px; }\n .ie-result-stat { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 8px; font-size: 0.9375rem; &.success { background: #f0fdf4; color: #15803d; svg { stroke: #22c55e; } } &.error { background: #fef2f2; color: #b91c1c; svg { stroke: #ef4444; } } &.warning { background: #fffbeb; color: #b45309; svg { stroke: #f59e0b; } } }\n .ie-progress { margin-top: 14px; }\n .ie-progress-track { height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; position: relative; }\n .ie-progress-bar { position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 999px; background: #2563eb; animation: ie-progress-slide 1.2s ease-in-out infinite; }\n .ie-progress-text { margin: 8px 0 0; font-size: 0.8125rem; color: #475569; }\n @keyframes ie-progress-slide { 0% { left: -35%; } 100% { left: 100%; } }\n @media (prefers-reduced-motion: reduce) { .ie-progress-bar { animation: none; width: 100%; opacity: 0.5; } }\n .ie-errors-list { border: 1px solid #fecaca; border-radius: 8px; overflow: hidden; }\n .ie-errors-title { font-size: 0.8125rem; font-weight: 600; color: #b91c1c; padding: 8px 12px; background: #fef2f2; margin: 0; border-bottom: 1px solid #fecaca; }\n .ie-error-row { display: flex; gap: 12px; padding: 7px 12px; border-bottom: 1px solid #fff1f2; font-size: 0.8125rem; color: #374151; &:last-child { border-bottom: none; } }\n .ie-error-row-num { font-weight: 600; color: #b91c1c; flex-shrink: 0; }\n .ie-warnings-list { border: 1px solid #fde68a; border-radius: 8px; overflow: hidden; }\n .ie-warnings-title { font-size: 0.8125rem; font-weight: 600; color: #b45309; padding: 8px 12px; background: #fffbeb; margin: 0; border-bottom: 1px solid #fde68a; }\n .ie-warning-row { display: flex; gap: 12px; padding: 7px 12px; border-bottom: 1px solid #fef3c7; font-size: 0.8125rem; color: #374151; &:last-child { border-bottom: none; } }\n .ie-warning-row-num { font-weight: 600; color: #b45309; flex-shrink: 0; }\n\n /* Shared */\n .ie-error { font-size: 0.875rem; color: #dc2626; margin: 0; }\n .ie-footer-right { display: flex; gap: 8px; align-items: center; }\n\n @media (max-width: 600px) {\n /* hidden visually on a phone but still read by screen readers (display:none would remove the step names) */\n .ie-step-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n .ie-dropzone { padding: 24px 16px; }\n .ie-mapping-header { grid-template-columns: 1fr 1fr; span:last-child { display: none; } }\n .ie-mapping-row { grid-template-columns: 1fr 1fr; .ie-sample { display: none; } }\n }\n `],\n})\nexport class ImportExportComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly _configInput = input<ImportExportConfig | null>(null, { alias: 'config' });\n readonly importSources = input<ImportSource[] | undefined>(undefined);\n readonly exportParams = input<Record<string, string>>({});\n readonly exportOnly = input(false);\n /** The window's footer has one Close button that closes it at once, never Back / Cancel (the setup wizard). */\n readonly closeOnly = input(false);\n /**\n * Replaces the built-in `POST importEndpoint { records }` for an app whose import runs differently (e.g. the server reads the CSV file itself):\n * receives the chosen file, the parsed rows (field key -> value) and the mapping (field key -> CSV column) and answers the result.\n */\n readonly submit = input<((request: ImportSubmitRequest) => Observable<ImportSubmitResult>) | null>(null);\n /**\n * A check of the mapped rows that runs when the Preview step opens (e.g. the server's dry run). It gets the same request as `submit`\n * and answers the rows that would be refused; they are listed above the preview (\"N rows with errors found\") and the button reads\n * \"Import Valid Rows\". A check that fails shows no list (the import is still decided by the server). Omit it and nothing changes.\n */\n readonly validate = input<((request: ImportSubmitRequest) => Observable<ImportRowIssue[]>) | null>(null);\n /**\n * With `validate`: the server saves nothing when any row is refused, so the import button stays disabled while the check runs, failed,\n * or listed errors (and the list says so). Without `validate` it has no effect.\n */\n readonly allOrNothing = input(false);\n /** Fired when the user presses Done after an import, with what the import answered (also `imported`). */\n readonly finished = output<ImportSubmitResult>();\n readonly imported = output<void>();\n\n config!: ImportExportConfig;\n\n private static nextUid = 0;\n /** Unique prefix for the ids this window links with aria-describedby / aria-labelledby. */\n readonly uid = `ie-${++ImportExportComponent.nextUid}`;\n private readonly resultBox = viewChild<ElementRef<HTMLElement>>('resultBox');\n /** The container of the step on screen (Source / Upload / Map Columns / Preview): focused when the step changes, because the control the user pressed is gone. */\n private readonly stepBox = viewChild<ElementRef<HTMLElement>>('stepBox');\n\n private readonly http = inject(HttpClient);\n /** API root from FORGEROUTE_CONFIG (e.g. a cross-origin prod API); falls back to same-origin `/api`. */\n private readonly apiBase = inject(FORGEROUTE_CONFIG, { optional: true })?.baseUrl ?? '/api';\n private readonly toast = inject(ToastService);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly destroyRef = inject(DestroyRef);\n /** Seconds since the import request started (shown while it runs). */\n importElapsed = 0;\n private importTimer: ReturnType<typeof setInterval> | null = null;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.stopImportTimer());\n effect(() => { const v = this._configInput(); if (v !== null) this.config = v!; });\n }\n\n // ── Export ────────────────────────────────────────────────────────────────\n\n exporting = false;\n\n exportAll(): void {\n if (this.exporting) return;\n this.exporting = true;\n this.cdr.detectChanges();\n let params = tableQueryParams().set('size', '10000');\n Object.entries(this.exportParams()).forEach(([k, v]) => { if (v) params = params.set(k, v); });\n this.http.get<any>(`${this.apiBase}${this.config.exportEndpoint}`, { params }).subscribe({\n next: (response) => {\n const items: any[] = response.content ?? response;\n const totalInDb: number = response.totalElements ?? items.length;\n exportToCsv(\n this.config.entityNamePlural.toLowerCase().replace(/\\s+/g, '-'),\n this.config.exportHeaders,\n items.map(item => this.config.exportRow(item)),\n );\n this.exporting = false;\n if (totalInDb > items.length) {\n this.toast.show(this.labels.t('importExport.exportLimitReached', { count: items.length, total: totalInDb, entity: this.config.entityNamePlural.toLowerCase() }));\n } else {\n const noun = items.length === 1 ? this.config.entityName : this.config.entityNamePlural;\n this.toast.show(this.labels.t('importExport.exportedCount', { count: items.length, noun: noun.toLowerCase() }));\n }\n this.cdr.detectChanges();\n },\n error: () => {\n this.exporting = false;\n this.toast.error(this.labels.t('importExport.exportFailed', { entity: this.config.entityNamePlural.toLowerCase() }));\n this.cdr.detectChanges();\n },\n });\n }\n\n downloadTemplate(): void {\n const headers = (this.config.importFields ?? []).map(f => f.label);\n exportToCsv(\n `${this.config.entityName.toLowerCase().replace(/\\s+/g, '-')}-template`,\n headers,\n this.config.templateSampleRows ?? [],\n );\n }\n\n // ── Import modal state ────────────────────────────────────────────────────\n\n importOpen = false;\n step: ImportStep = 'upload';\n selectedSource = '';\n csvHeaders: string[] = [];\n csvRows: string[][] = [];\n fileError: string | null = null;\n columnMapping: Record<string, string> = {};\n mappingError: string | null = null;\n importing = false;\n /** The `validate` check of the Preview step is running. */\n validating = false;\n /** Result of the `validate` check: null = not run yet / failed, [] = every row is fine. */\n validationErrors: ImportRowIssue[] | null = null;\n private validationRun = 0;\n /** `warnings` = rows imported with a value changed (e.g. an unrecognised status mapped to the default). */\n importResult: { imported: number; errors: ImportError[]; warnings: ImportError[] } | null = null;\n\n get stepIndex(): number {\n if (this.importSources()) {\n return ({ source: 0, upload: 1, mapping: 2, preview: 3, result: 4 } as any)[this.step] ?? 0;\n }\n return ({ upload: 0, mapping: 1, preview: 2, result: 3 } as any)[this.step] ?? 0;\n }\n\n /** The progress list: one entry per step with its number, label and whether it is the current / a finished step. */\n get stepItems(): { key: ImportStep; num: number; label: string; current: boolean; done: boolean }[] {\n const keys: [ImportStep, string][] = [\n ...(this.importSources() ? [['source', this.labels.t('importExport.step.source')] as [ImportStep, string]] : []),\n ['upload', this.labels.t('importExport.step.upload')], ['mapping', this.labels.t('importExport.step.mapping')], ['preview', this.labels.t('common.preview')], ['result', this.labels.t('common.done')],\n ];\n const index = this.stepIndex;\n return keys.map(([key, label], i) => ({ key, num: i + 1, label, current: this.step === key, done: key !== 'result' && index > i }));\n }\n\n /** What the persistent status region says once the import has finished (empty before). */\n get resultAnnouncement(): string {\n // while the request runs the static sentence is announced once (the per-second counter in the visible text is aria-hidden)\n if (this.importing) return `${this.labels.t(this.csvRows.length === 1 ? 'importExport.importingRecords_one' : 'importExport.importingRecords_other', { count: this.labels.formatNumber(this.csvRows.length) })} ${this.labels.t('importExport.keepThisWindowOpenUntil')}`;\n const r = this.step === 'result' ? this.importResult : null;\n if (!r) return '';\n return [\n this.labels.t(r.imported === 1 ? 'importExport.recordsImported_one' : 'importExport.recordsImported_other', { count: r.imported }),\n r.errors.length ? this.labels.t(r.errors.length === 1 ? 'importExport.rowsHadErrors_one' : 'importExport.rowsHadErrors_other', { count: r.errors.length }) : '',\n r.warnings.length ? this.labels.t(r.warnings.length === 1 ? 'importExport.valuesChanged_one' : 'importExport.valuesChanged_other', { count: r.warnings.length }) : '',\n ].filter(Boolean).join(' ');\n }\n\n get modalTitle(): string {\n if (this.selectedSource && this.selectedSource !== 'custom') {\n const src = this.importSources()?.find(s => s.value === this.selectedSource);\n if (src) return this.labels.t('importExport.importFrom', { source: src.label });\n }\n return this.labels.t('importExport.importEntity', { entity: this.config?.entityNamePlural ?? '' });\n }\n\n openImport(): void {\n this.importOpen = true;\n this.step = this.importSources()?.length ? 'source' : 'upload';\n this.selectedSource = '';\n this.csvHeaders = []; this.csvRows = []; this.csvFile = null;\n this.fileError = null; this.columnMapping = {};\n this.mappingError = null; this.importResult = null;\n this.resetValidation();\n // Called from the host data-table (outside this OnPush view) — must trigger CD or the wizard never renders.\n this.cdr.detectChanges();\n }\n\n onSourceSelected(value: string): void { this.selectedSource = value; this.cdr.detectChanges(); }\n\n confirmSource(): void {\n if (!this.selectedSource) return;\n const src = this.importSources()?.find(s => s.value === this.selectedSource);\n this.config = { ...this.config, columnAliases: src?.aliases ?? {} };\n this.goTo('upload');\n }\n\n closeImport(): void {\n if (this.importing) return; // the window cannot be dismissed (Escape, backdrop, X, Close) while the request runs\n if (this.step === 'result') this.finishImport();\n else this.importOpen = false;\n }\n\n finishImport(): void {\n this.importOpen = false;\n if (this.importResult) this.finished.emit(this.importResult);\n this.imported.emit();\n }\n\n onFileChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n const file = input.files?.[0];\n if (!file) return;\n // Forget the chosen file in the input (the File object stays valid): choosing the SAME file again after fixing it still fires `change`.\n input.value = '';\n this.readCsvFile(file);\n }\n\n private csvFile: File | null = null;\n\n private readCsvFile(file: File, encoding?: string): void {\n this.csvFile = file;\n const reader = new FileReader();\n reader.onload = (e) => {\n const raw = e.target!.result as string;\n // an Excel \"CSV\" saved in a Windows code page shows U+FFFD for every accent when read as UTF-8: read it once more as Windows-1252\n if (!encoding && raw.includes('\\uFFFD')) { this.readCsvFile(file, 'windows-1252'); return; }\n try {\n const parsed = parseCsv(raw.trim());\n if (parsed.length < 1) { this.fileError = this.labels.t('importExport.csvEmpty'); this.cdr.detectChanges(); return; }\n if (parsed.length < 2) { this.fileError = this.labels.t('importExport.csvNeedsRows'); this.cdr.detectChanges(); return; }\n this.csvHeaders = parsed[0]; this.csvRows = parsed.slice(1);\n this.fileError = null; this.autoMap();\n this.goTo('mapping');\n } catch {\n this.fileError = this.labels.t('importExport.csvParseFailed');\n this.cdr.detectChanges();\n }\n };\n if (encoding) reader.readAsText(file, encoding); else reader.readAsText(file);\n }\n\n private autoMap(): void {\n this.columnMapping = {};\n const normalize = (s: string) => s.trim().toLowerCase().replace(/[\\s_\\-./]+/g, '');\n for (const field of (this.config.importFields ?? [])) {\n const normalizedLabel = normalize(field.label);\n const normalizedKey = normalize(field.key);\n let match = this.csvHeaders.find(h => h.trim().toLowerCase() === field.label.toLowerCase() || h.trim().toLowerCase() === field.key.toLowerCase());\n if (!match) match = this.csvHeaders.find(h => { const n = normalize(h); return n === normalizedLabel || n === normalizedKey; });\n if (!match && this.config.columnAliases?.[field.key]) {\n const aliases = this.config.columnAliases[field.key].map(normalize);\n match = this.csvHeaders.find(h => aliases.includes(normalize(h)));\n }\n this.columnMapping[field.key] = match ?? '';\n }\n // second pass for the REQUIRED fields still empty (a wrong guess on an optional field is worse than a blank one): a header that CONTAINS the field's words (\"Primary Email Address\" for Email), only when exactly one\n // unused header does, so \"Phone 1\" / \"Phone 2\" stay a manual choice and \"Real Estate Agent\" never lands in State\n const tokens = (t: string) => t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);\n const containsRun = (haystack: string[], needle: string[]) => needle.length > 0 && haystack.some((_, i) => needle.every((w, j) => haystack[i + j] === w));\n for (const field of (this.config.importFields ?? [])) {\n if (this.columnMapping[field.key] || !field.required) continue;\n const used = new Set(Object.values(this.columnMapping).filter(Boolean));\n const terms = [field.label, field.key.replace(/([a-z])([A-Z])/g, '$1 $2'), ...(this.config.columnAliases?.[field.key] ?? [])].map(tokens).filter(t => t.join('').length >= 3);\n const candidates = this.csvHeaders.filter(h => !used.has(h) && terms.some(t => containsRun(tokens(h), t)));\n if (new Set(candidates).size === 1) this.columnMapping[field.key] = candidates[0];\n }\n }\n\n private static nextId = 0;\n private readonly idPrefix = `ie-ex-${ImportExportComponent.nextId++}-`;\n /** Id of a field's example hint (the column dropdown points at it with aria-describedby). */\n protected exampleId(field: ImportFieldDef): string { return this.idPrefix + field.key; }\n\n get canSubmit(): boolean { return (this.config.importFields ?? []).filter(f => f.required).every(f => !!this.columnMapping[f.key]); }\n get unmappedRequiredFields(): string[] { return (this.config.importFields ?? []).filter(f => f.required && !this.columnMapping[f.key]).map(f => f.label); }\n get unmatchedCsvHeaders(): string[] { const used = new Set(Object.values(this.columnMapping).filter(Boolean)); return this.csvHeaders.filter(h => !used.has(h)); }\n\n get csvHeaderOptions(): SelectOption[] {\n return [\n { value: '', label: this.labels.t('importExport.leaveBlank') },\n ...this.csvHeaders.map(h => ({ value: h, label: h })),\n ];\n }\n get allRequiredMapped(): boolean { return this.unmappedRequiredFields.length === 0; }\n\n getSample(fieldKey: string): string {\n const col = this.columnMapping[fieldKey];\n if (!col) return '';\n const idx = this.csvHeaders.indexOf(col);\n return idx < 0 ? '' : (this.csvRows[0]?.[idx] ?? '');\n }\n\n goToPreview(): void {\n this.mappingError = null;\n const missing = (this.config.importFields ?? []).filter(f => f.required && !this.columnMapping[f.key]).map(f => f.label);\n if (missing.length) { this.mappingError = this.labels.t('importExport.requiredNotMapped', { fields: missing.join(', ') }); return; }\n this.goTo('preview');\n this.runValidation();\n }\n\n private resetValidation(): void { this.validationRun++; this.validating = false; this.validationErrors = null; }\n\n private runValidation(): void {\n this.resetValidation();\n const check = this.validate();\n if (!check) return;\n const run = this.validationRun;\n this.validating = true;\n this.cdr.detectChanges();\n check(this.buildRequest()).subscribe({\n next: (issues) => { if (run !== this.validationRun) return; this.validating = false; this.validationErrors = issues; this.cdr.detectChanges(); },\n error: () => { if (run !== this.validationRun) return; this.validating = false; this.validationErrors = null; this.cdr.detectChanges(); },\n });\n }\n\n /** Number of different rows the check refused. */\n get validationRowCount(): number { return new Set((this.validationErrors ?? []).map(e => e.row)).size; }\n\n /** `allOrNothing`: no import before a check came back clean. */\n get importBlocked(): boolean {\n return this.allOrNothing() && !!this.validate() && (this.validating || this.validationErrors === null || this.validationErrors.length > 0);\n }\n\n get importButtonLabel(): string {\n return this.validationErrors && this.validationErrors.length > 0 && !this.allOrNothing() ? this.labels.t('importExport.importValidRows') : this.labels.t(this.csvRows.length === 1 ? 'importExport.importRecords_one' : 'importExport.importRecords_other', { count: this.csvRows.length });\n }\n\n get mappedFields(): ImportFieldDef[] { return (this.config.importFields ?? []).filter(f => !!this.columnMapping[f.key]); }\n\n get previewRows(): Record<string, string>[] {\n return this.csvRows.slice(0, 5).map(row => {\n const record: Record<string, string> = {};\n for (const field of (this.config.importFields ?? [])) {\n const col = this.columnMapping[field.key];\n if (!col) continue;\n const idx = this.csvHeaders.indexOf(col);\n record[field.key] = idx >= 0 ? (row[idx] ?? '') : '';\n }\n return record;\n });\n }\n\n /** Shows another step and moves focus to its container (the pressed button / focused file input was removed from the page). */\n goTo(step: ImportStep): void {\n this.step = step;\n this.cdr.detectChanges();\n this.stepBox()?.nativeElement.focus();\n }\n\n /** Moves focus to the result summary (the button that had it is gone), so keyboard and screen reader users land on the outcome. */\n private focusResult(): void {\n this.resultBox()?.nativeElement.focus();\n }\n\n private stopImportTimer(): void {\n if (this.importTimer !== null) { clearInterval(this.importTimer); this.importTimer = null; }\n }\n\n private buildRequest(): ImportSubmitRequest {\n const records = this.csvRows.map(row => {\n const record: Record<string, string> = {};\n for (const field of (this.config.importFields ?? [])) {\n const col = this.columnMapping[field.key];\n if (!col) continue;\n const idx = this.csvHeaders.indexOf(col);\n record[field.key] = idx >= 0 ? (row[idx]?.trim() ?? '') : '';\n }\n return record;\n });\n return { file: this.csvFile, records, mapping: { ...this.columnMapping } };\n }\n\n submitImport(): void {\n if (this.importBlocked) return;\n this.importing = true;\n this.importElapsed = 0;\n this.stopImportTimer();\n this.importTimer = setInterval(() => { this.importElapsed++; this.cdr.detectChanges(); }, 1000);\n this.cdr.detectChanges();\n const request = this.buildRequest();\n const custom = this.submit();\n const request$: Observable<ImportSubmitResult> = custom\n ? custom(request)\n : this.http.post<ImportSubmitResult>(`${this.apiBase}${this.config.importEndpoint ?? ''}`, { records: request.records });\n request$.subscribe({\n next: (result) => {\n this.stopImportTimer();\n this.importing = false;\n this.importResult = { imported: result.imported, errors: result.errors ?? [], warnings: result.warnings ?? [] };\n this.step = 'result';\n if (result.imported > 0) this.toast.show(this.labels.t('importExport.importedSuccessfully', { count: result.imported, entity: this.config.entityNamePlural.toLowerCase() }));\n this.cdr.detectChanges();\n this.focusResult();\n },\n error: (err) => {\n this.stopImportTimer();\n this.importing = false;\n // the server refused the rows and listed them (e.g. every row failed validation): show that list as the result\n if (custom && Array.isArray(err?.error?.errors)) {\n this.importResult = { imported: err.error.successCount ?? 0, errors: err.error.errors, warnings: [] };\n this.step = 'result';\n this.cdr.detectChanges();\n this.focusResult();\n return;\n }\n // a custom submit's own server message (e.g. \"Maximum allowed is 500 rows\") is more useful than the generic one\n const serverMessage = custom && typeof err?.error?.message === 'string' ? err.error.message : '';\n this.toast.error(serverMessage || this.labels.t('importExport.importFailed'));\n this.cdr.detectChanges();\n },\n });\n }\n}\n","import {\n Component, input, output, signal, computed, viewChild, effect, untracked,\n ChangeDetectionStrategy, inject, DestroyRef, OnInit, Signal, Injector, ElementRef, afterNextRender,\n} from '@angular/core';\n\nimport { NgTemplateOutlet, Location } from '@angular/common';\nimport { Router, UrlTree } from '@angular/router';\nimport { FormsModule } from '@angular/forms';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { Subject, Subscription } from 'rxjs';\nimport { switchMap, catchError } from 'rxjs/operators';\nimport { of } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { UiLabelKey, UiLabelsService } from '@forgeroute/ui/core';\nimport { injectReadOnlyMode } from '@forgeroute/ui/read-only-mode';\nimport { FORGEROUTE_CONFIG } from '@forgeroute/ui/core';\nimport {\n ColumnDef, SortDir, QuickFilterTab, FilterOption, SavedView, ToolbarAction,\n BadgeConfig, autoVariant, semanticBadgeVariant, BADGE_VARIANT_STYLES,\n BulkActionDef, BulkActionEvent, BulkPanelEvent, TableRowReorderEvent, BulkConfirmContext, BulkConfirmCopy, DROPDOWN_GROUP, RowAction, TablePermission, BulkUpdateOption, LinkTarget, LinkClickEvent, RangeFilterConfig } from '@forgeroute/ui/table-types';\nimport { actionErrorText, loadErrorKey } from './load-error-message';\nimport { encodeFilterValues, decodeFilterValues } from './filter-values';\nimport { tableQueryParams } from './query-params';\nimport { getEligibleOptions, orderBulkOptions } from '@forgeroute/ui/bulk-eligible';\nimport { SearchInputComponent } from '@forgeroute/ui/search-input';\nimport { PaginationComponent } from '@forgeroute/ui/pagination';\nimport { QuickFilterTabsComponent } from '@forgeroute/ui/quick-filter-tabs';\nimport { ColumnFilterComponent, ColumnRangeSpec, ColumnRangeValue } from '@forgeroute/ui/column-filter';\nimport { TableToolbarComponent } from '@forgeroute/ui/table-toolbar';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { AvatarComponent } from '@forgeroute/ui/avatar';\nimport { StarComponent } from '@forgeroute/ui/star';\nimport { iconPath as uiIconPath } from '@forgeroute/ui/icon';\nimport { MoreMenuComponent } from '@forgeroute/ui/more-menu';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { ProgressBarComponent } from '@forgeroute/ui/progress-bar';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { CheckboxComponent } from '@forgeroute/ui/checkbox';\nimport { SelectComponent } from '@forgeroute/ui/select';\nimport { ToastComponent } from '@forgeroute/ui/toast';\nimport { ToastService } from '@forgeroute/ui/core';\nimport { humanReadableMessage } from '@forgeroute/ui/utils';\nimport { downloadBlob, fileNameFromContentDisposition } from '@forgeroute/ui/utils';\nimport { ImportExportComponent, ImportExportConfig, ImportSource } from '../import-export/import-export.component';\nimport { ConfirmService } from '@forgeroute/ui/core';\nimport { ConfirmOutletComponent } from '@forgeroute/ui/core';\nimport { ModalComponent } from '@forgeroute/ui/core';\nimport { EmptyStateComponent } from '@forgeroute/ui/empty-state';\nimport { ErrorStateComponent } from '@forgeroute/ui/error-state';\n\n/** Counts the tables so every table's reorder instructions get their own id. */\nlet reorderHelpSeq = 0;\n\nfunction formatPhone(raw: string | null | undefined): string {\n if (!raw) return '—';\n const digits = raw.replace(/\\D/g, '');\n if (digits.length === 10) {\n return `(${digits.slice(0, 3)}) ${digits.slice(3, 6)}-${digits.slice(6)}`;\n }\n if (digits.length === 11 && digits[0] === '1') {\n return `(${digits.slice(1, 4)}) ${digits.slice(4, 7)}-${digits.slice(7)}`;\n }\n return raw;\n}\n\n/** Simple English plural: \"property\" → \"properties\", \"box\" → \"boxes\", \"contact\" → \"contacts\". */\nexport function pluralize(word: string): string {\n if (!word) return word;\n if (/[^aeiou]y$/i.test(word)) return word.slice(0, -1) + 'ies';\n if (/(s|x|z|ch|sh)$/i.test(word)) return word + 'es';\n return word + 's';\n}\n\n/** Resolved anchor data of a link cell (internal). */\ninterface ResolvedLink {\n href: string;\n tree: UrlTree | null;\n blank: boolean;\n rel: string | null;\n download: boolean;\n ariaLabel: string | null;\n}\n\n@Component({\n selector: 'ui-data-table',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: DROPDOWN_GROUP, useFactory: () => signal('') }],\n imports: [\n NgTemplateOutlet,\n SearchInputComponent, PaginationComponent, QuickFilterTabsComponent,\n ColumnFilterComponent, TableToolbarComponent,\n FormsModule,\n BadgeComponent, AvatarComponent, StarComponent, MoreMenuComponent, SkeletonComponent, ProgressBarComponent, ButtonComponent, CheckboxComponent, SelectComponent,\n ToastComponent, ImportExportComponent, ConfirmOutletComponent, ModalComponent,\n EmptyStateComponent, ErrorStateComponent,\n ],\n template: `\n <div class=\"dt-host\">\n\n <!-- ── HEADER ──────────────────────────────────────────────── -->\n @if (!_hasLoaded() && !_error()) {\n <!-- Skeleton header: shaped to match real controls (only while the first load is running: a failed first load keeps no placeholder bars) -->\n @if (_showHeader()) {\n <div class=\"dt-sk-toolbar\">\n <div class=\"dt-sk-toolbar-left\">\n @if (tableTitle()) {\n <h3 class=\"dt-title\">{{ tableTitle() }}</h3>\n }\n @if (showSearch()) {\n <div class=\"dt-sk-search\">\n <div class=\"dt-sk-shimmer dt-sk-search-icon\"></div>\n <div class=\"dt-sk-shimmer dt-sk-search-text\"></div>\n </div>\n }\n @if (_effectiveTabs().length) {\n <div class=\"dt-sk-tab-strip\">\n @for (_ of _effectiveTabs(); track $index) {\n <div class=\"dt-sk-shimmer dt-sk-tab\"></div>\n }\n </div>\n }\n </div>\n @if (showToolbar()) {\n <div class=\"dt-sk-toolbar-right\">\n <div class=\"dt-sk-shimmer dt-sk-icon-btn\"></div>\n <div class=\"dt-sk-shimmer dt-sk-icon-btn\"></div>\n </div>\n }\n </div>\n }\n } @else if (_showHeader()) {\n <div class=\"dt-header alive-header\">\n <div class=\"dt-header-left\">\n @if (tableTitle()) {\n <h3 class=\"dt-title\">{{ tableTitle() }}</h3>\n }\n @if (showSearch() && !_emptyUnfiltered() && !_error()) {\n <ui-search-input\n [value]=\"_search()\"\n [placeholder]=\"_effectiveSearchPlaceholder()\"\n [loading]=\"_searchLoading() && !_error()\"\n (searchChange)=\"onSearchChange($event)\" />\n }\n @if (_effectiveTabs().length && !_emptyUnfiltered() && !_error()) {\n <ui-quick-filter-tabs\n [tabs]=\"_effectiveTabs()\"\n [counts]=\"_tabCounts()\"\n [activeValue]=\"_activeTab()\"\n (tabChange)=\"onTabChange($event)\" />\n }\n </div>\n <div class=\"dt-header-right\">\n @if (showToolbar()) {\n <ui-table-toolbar\n [columns]=\"columns()\"\n [visibleColumns]=\"visibleCols().map(c => c.key)\"\n [lockedColumn]=\"lockedColumn()\"\n [savedViews]=\"_effectiveSavedViews()\"\n [activeViewId]=\"_activeViewId()\"\n [showSavedViews]=\"_effectiveSavedViews().length > 0 || !!page() || showToolbar()\"\n [readOnly]=\"!_canEdit()\"\n [tableButtons]=\"_toolbarButtons()\"\n [hideMoreActions]=\"!showMoreActions() || (_emptyUnfiltered() && !_keepMoreActions())\"\n (visibleColumnsChange)=\"_visibleColumns.set(_configurableKeys($event))\"\n (saveViewClick)=\"onSaveViewClick($event)\"\n (loadViewClick)=\"onLoadViewClick($event)\"\n (deleteViewClick)=\"onDeleteViewClick($event)\"\n (tableButtonClick)=\"onInternalButtonClick($event)\" />\n }\n </div>\n </div>\n }\n\n <!-- ── BULK SELECTION BAR ───────────────────────────────── -->\n @if (_isSelectable() && _selectedIds().size > 0) {\n <div class=\"dt-bulk-bar\">\n <span class=\"dt-bulk-count\" role=\"status\" aria-live=\"polite\">{{ _selectedText() }}</span>\n <div class=\"dt-bulk-actions\">\n @if (_activeBulkDef(); as def) {\n <!-- Inline select for field-based bulk actions -->\n <ui-select name=\"dt-bulk\" size=\"sm\" [ariaLabel]=\"def.label\" [ngModel]=\"_bulkSelectStr\" (ngModelChange)=\"_bulkSelectStr = $event\" [options]=\"_eligibleBulkOptions()\" [ariaDescribedBy]=\"_bulkOptionHintIds()\" />\n <ui-button variant=\"primary\" size=\"sm\" [disabled]=\"!_bulkSelectStr\" [loading]=\"_applyingBulk()\" (click)=\"applyBulkAction()\">{{ labels.t('dataTable.apply') }}</ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" [disabled]=\"_applyingBulk()\" (click)=\"_activeBulkType.set(null)\">{{ labels.t('dataTable.cancel') }}</ui-button>\n @for (hint of _bulkOptionHints(); track $index) {\n <span class=\"dt-bulk-hint\" role=\"status\" data-testid=\"dt-bulk-option-hint\" [id]=\"_bulkHintId + '-' + $index\">{{ hint }}</span>\n }\n } @else {\n @for (def of _bulkDefs(); track def.type) {\n @if (!_bulkHidden(def)) {\n <ui-button [variant]=\"def.variant ?? 'secondary'\" size=\"sm\"\n [loading]=\"(def.type === 'delete' && _deletingBulk()) || (!!def.action && _runningAction() === def.type)\"\n [disabled]=\"_deletingBulk() || !!_runningAction() || !!_bulkBlockedReason(def)\"\n [ariaLabel]=\"_bulkBlockedReason(def) ? def.label + ' — ' + _bulkBlockedReason(def) : undefined\"\n [attr.title]=\"_bulkBlockedReason(def) || null\"\n (click)=\"onBulkActionClick(def)\">{{ def.label }}</ui-button>\n }\n }\n <!-- Visible reason for a blocked action (the title tooltip is invisible on touch) -->\n @for (reason of _bulkBlockedHints(); track reason) {\n <span class=\"dt-bulk-hint\" role=\"status\" data-testid=\"dt-bulk-hint\">{{ reason }}</span>\n }\n }\n </div>\n <ui-button variant=\"ghost\" size=\"sm\" (click)=\"clearSelection()\">{{ labels.t('dataTable.clear') }}</ui-button>\n </div>\n }\n\n <!-- Optional leading icon (ColumnDef.iconFn, library source 2026-11-05): decorative svg, plus sr-only text only when iconLabelFn returns one. Draws nothing when there is no valid icon. -->\n <ng-template #cellIcon let-col=\"col\" let-item=\"item\">\n @if (cellIconPath(col, item); as iconD) {\n <svg class=\"dt-cell-icon\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"iconD\" /></svg>\n @if (cellIconLabel(col, item); as iconLbl) { <span class=\"dt-sr-only\">{{ iconLbl }}</span> }\n }\n </ng-template>\n\n <!-- Shared image-cell markup (table cell + mobile card header) -->\n <ng-template #imageCell let-col=\"col\" let-item=\"item\" let-small=\"small\">\n @let imgUrl = imageUrl(col, item);\n @let imgClass = imageClass(col, !!small);\n @if (imgUrl && !_failedImages().has(imgUrl)) {\n <img [class]=\"imgClass + ' dt-img'\" [src]=\"imgUrl\" [attr.alt]=\"imageAlt(col, item)\"\n [style.object-position]=\"imagePosition(col, item)\" loading=\"lazy\" decoding=\"async\" (error)=\"onImageError(imgUrl)\" />\n } @else {\n <span [class]=\"imgClass + ' dt-img-ph'\" aria-hidden=\"true\">\n @if (col.imagePlaceholder === 'person') {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"8\" r=\"4\"/><path d=\"M4 21c0-4 3.6-7 8-7s8 3 8 7\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><circle cx=\"9\" cy=\"10\" r=\"1.8\"/><path d=\"M21 16l-5-5-8 9\"/></svg>\n }\n </span>\n }\n </ng-template>\n\n <!-- Shared link-cell markup (table cell + mobile card). Real anchor; text is escaped by interpolation. -->\n <ng-template #linkCell let-col=\"col\" let-item=\"item\">\n @let lv = linkView(col, item);\n @if (lv.link; as lk) {\n <a class=\"dt-link\"\n [attr.href]=\"lk.href\"\n [attr.target]=\"lk.blank ? '_blank' : null\"\n [attr.rel]=\"lk.rel\"\n [attr.download]=\"lk.download ? '' : null\"\n [attr.aria-label]=\"lk.ariaLabel\"\n (click)=\"onLinkClick($event, lk, col, item)\"\n (keydown)=\"$event.stopPropagation()\">{{ lv.text }}@if (lk.blank && !lk.ariaLabel) {<span class=\"dt-sr-only\"> {{ labels.t('dataTable.opensInNewTab') }}</span>}</a>\n } @else {\n {{ lv.text }}\n }\n </ng-template>\n\n <!-- ── TABLE ─────────────────────────────────────────────── -->\n @if (!_isPhone()) {\n <div class=\"dt-table-wrap\" [class.dt-sticky-actions]=\"stickyActions()\">\n <table [attr.aria-label]=\"tableLabelText()\" [attr.aria-busy]=\"_loading()\">\n <thead>\n <tr>\n @if (_reorderOn()) {\n <th class=\"dt-th-grip\" scope=\"col\"><span class=\"dt-sr-only\">{{ labels.t('dataTable.reorder') }}</span></th>\n }\n @if (_isSelectable()) {\n <th class=\"dt-th-cb\" scope=\"col\">\n <ui-checkbox\n [ariaLabel]=\"labels.t('dataTable.selectAll')\"\n [checked]=\"_allSelected()\"\n [indeterminate]=\"_someSelected()\"\n (checkedChange)=\"toggleSelectAll()\" />\n </th>\n }\n @for (col of visibleCols(); track col.key) {\n <th\n scope=\"col\"\n [style.text-align]=\"col.headerAlign ?? (col.cellType === 'number' ? 'right' : 'center')\"\n [style.width]=\"col.width ?? null\"\n [style.min-width]=\"col.width ?? null\"\n [style.max-width]=\"col.width ?? null\"\n [attr.aria-sort]=\"_canShowSort(col) ? sortAriaLabel(col.key) : null\"\n [class.dt-th-sorted]=\"_sortField() === col.key\"\n [class.dt-th-actions]=\"col.cellType === 'actions'\">\n <div class=\"dt-th-inner\">\n @if (_canShowSort(col)) {\n <button\n class=\"dt-sort-btn\"\n (click)=\"onSort(col.key)\"\n [attr.aria-label]=\"labels.t('dataTable.sortByColumn', { column: col.label })\">\n {{ col.label }}\n @if (_sortField() === col.key) {\n <svg class=\"dt-sort-icon\" [class.dt-sort-desc]=\"_sortDir() === 'desc'\" width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><path d=\"M12 5v14M5 12l7-7 7 7\"/></svg>\n } @else if (!_sortField()) {\n <svg class=\"dt-sort-icon dt-sort-inactive\" width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><path d=\"M7 15l5 5 5-5M7 9l5-5 5 5\"/></svg>\n }\n </button>\n } @else {\n {{ col.label }}\n }\n @if (_showColumnControls() ? getRangeFilter(col) : null; as rf) {\n <ui-column-filter\n [label]=\"col.label\"\n [range]=\"rf.spec\"\n [rangeValue]=\"rf.value\"\n (rangeChange)=\"onRangeChange(col.key, $event)\" />\n } @else if (_showColumnControls() ? getColFilter(col) : null; as cf) {\n <ui-column-filter\n [label]=\"col.label\"\n [options]=\"cf.options\"\n [activeValues]=\"cf.activeValues\"\n (filterChange)=\"onColFilterChange(_filterName(col), $event)\" />\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n\n <!-- Reload skeleton (search / filter / sort) -->\n @if (_loading()) {\n @for (_ of skeletonRows(); track $index) {\n <tr class=\"dt-sk-reload-row\">\n @if (_reorderOn()) {\n <td class=\"dt-td-grip\"></td>\n }\n @if (_isSelectable()) {\n <td class=\"dt-td-cb\"></td>\n }\n @for (col of visibleCols(); track col.key) {\n <td><ui-skeleton [height]=\"14\" [radius]=\"4\" /></td>\n }\n </tr>\n }\n }\n\n <!-- Error -->\n @else if (_error()) {\n <tr>\n <td [attr.colspan]=\"visibleCols().length + (_isSelectable() ? 1 : 0) + (_reorderOn() ? 1 : 0)\" class=\"dt-state-cell\">\n <ui-error-state [message]=\"_error()!\" [retryLabel]=\"_retryLabel()\" (retry)=\"_retryAfterError()\" />\n </td>\n </tr>\n }\n\n <!-- Empty (no filters active) -->\n @else if (_items().length === 0 && !_hasActiveFilters()) {\n <tr>\n <td [attr.colspan]=\"visibleCols().length + (_isSelectable() ? 1 : 0) + (_reorderOn() ? 1 : 0)\" class=\"dt-state-cell\">\n <ui-empty-state iconType=\"table\" [message]=\"emptyMessageText()\" />\n </td>\n </tr>\n }\n\n <!-- No match -->\n @else if (_items().length === 0 && _hasActiveFilters()) {\n <tr>\n <td [attr.colspan]=\"visibleCols().length + (_isSelectable() ? 1 : 0) + (_reorderOn() ? 1 : 0)\" class=\"dt-state-cell\">\n <ui-empty-state iconType=\"search\" [message]=\"labels.t('dataTable.noResults')\">\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"clearFilters()\">{{ labels.t('dataTable.clearFilters') }}</ui-button>\n </ui-empty-state>\n </td>\n </tr>\n }\n\n <!-- Data rows — --i is capped at 8 so the entrance stagger never exceeds ~240ms -->\n @else {\n @for (item of _items(); track trackItem(item, $index)) {\n <tr\n class=\"dt-row alive-row\"\n [style.--i]=\"$index < 8 ? $index : 8\"\n [class.dt-row-clickable]=\"isRowClickable(item)\"\n [class.dt-row-selected]=\"_isSelectable() && _selectedIds().has(item['id'])\"\n [class.dt-row-dragging]=\"_dragFrom() === $index\"\n [class.dt-row-over-before]=\"_reorderOn() && _dragFrom() !== null && _dragOver() === $index && _dragFrom()! > $index\"\n [class.dt-row-over-after]=\"_reorderOn() && _dragFrom() !== null && _dragOver() === $index && _dragFrom()! < $index\"\n [attr.data-row-key]=\"_reorderOn() ? trackItem(item, $index) : null\"\n [attr.tabindex]=\"isRowClickable(item) ? 0 : null\"\n [attr.aria-label]=\"rowLabel(item)\"\n (keydown)=\"onRowKeydown($event, item)\"\n (dragover)=\"onRowDragOver($event, $index)\"\n (drop)=\"onRowDrop($event, $index)\"\n (click)=\"onRowClick(item)\">\n @if (_reorderOn()) {\n <td class=\"dt-td-grip\" (click)=\"$event.stopPropagation()\">\n <span class=\"dt-grip\" role=\"button\" [attr.tabindex]=\"_reorderActive() ? 0 : null\"\n [attr.draggable]=\"_reorderActive() ? 'true' : null\"\n [attr.aria-label]=\"reorderLabel(item)\"\n [attr.aria-disabled]=\"_reorderActive() ? null : 'true'\"\n [attr.aria-roledescription]=\"labels.t('dataTable.dragHandle')\"\n [attr.aria-describedby]=\"_reorderHelpId\"\n [attr.title]=\"_reorderActive() ? labels.t('dataTable.dragHint') : _reorderHint()\"\n [class.dt-grip-off]=\"!_reorderActive()\"\n (dragstart)=\"onGripDragStart($event, $index)\"\n (dragend)=\"onGripDragEnd()\"\n (keydown)=\"onGripKeydown($event, $index)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\"><circle cx=\"9\" cy=\"6\" r=\"1.6\"/><circle cx=\"15\" cy=\"6\" r=\"1.6\"/><circle cx=\"9\" cy=\"12\" r=\"1.6\"/><circle cx=\"15\" cy=\"12\" r=\"1.6\"/><circle cx=\"9\" cy=\"18\" r=\"1.6\"/><circle cx=\"15\" cy=\"18\" r=\"1.6\"/></svg>\n </span>\n <!-- Touch screens (coarse primary pointer, e.g. a tablet) cannot rely on native drag: they get Move up / Move down instead of the grip. -->\n <span class=\"dt-row-move\">\n <ui-button variant=\"icon\" size=\"sm\" [ariaLabel]=\"labels.t('dataTable.moveUp', { name: rowAccessibleName(item) || labels.t('dataTable.rowWord') })\"\n [disabled]=\"!_reorderActive() || $first\" (click)=\"moveByButton($index, -1)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 15l6-6 6 6\"/></svg>\n </ui-button>\n <ui-button variant=\"icon\" size=\"sm\" [ariaLabel]=\"labels.t('dataTable.moveDown', { name: rowAccessibleName(item) || labels.t('dataTable.rowWord') })\"\n [disabled]=\"!_reorderActive() || $last\" (click)=\"moveByButton($index, 1)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 9l6 6 6-6\"/></svg>\n </ui-button>\n </span>\n </td>\n }\n @if (_isSelectable()) {\n <td class=\"dt-td-cb\" (click)=\"$event.stopPropagation()\">\n <ui-checkbox\n [ariaLabel]=\"selectRowLabel(item)\"\n [checked]=\"_selectedIds().has(item['id'])\"\n (checkedChange)=\"toggleRow(item)\" />\n </td>\n }\n @for (col of visibleCols(); track col.key) {\n <td\n [style.text-align]=\"resolveCellAlign(col, item)\"\n [style.width]=\"col.width ?? null\"\n [style.min-width]=\"col.width ?? null\"\n [style.max-width]=\"col.width ?? null\"\n [class.dt-td-width]=\"!!col.width && col.cellType !== 'actions'\"\n [class.dt-td-actions]=\"col.cellType === 'actions'\">\n\n @switch (col.cellType) {\n\n <!-- Badge cell -->\n @case ('badge') {\n @let bCfg = resolveBadge(col, item);\n @if (bCfg) { @if (col.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" /> } <ui-badge [label]=\"bCfg.label\" [variant]=\"bCfg.variant\" /> } @else { — }\n }\n\n <!-- Date cell -->\n @case ('date') {\n @if (col.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" /> }\n {{ item[col.key] ? labels.formatDate(item[col.key], col.dateFormat ?? 'MMM d, y') : '—' }}\n }\n\n <!-- Phone cell -->\n @case ('phone') {\n @if (col.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" /> }\n {{ phoneCell(item[col.key]) }}\n }\n\n <!-- Avatar + name cell -->\n @case ('avatar-name') {\n @let displayName = col.nameFn ? col.nameFn(item) : (item[col.key] ?? '');\n @let initials = col.initialsFn ? col.initialsFn(item) : getInitials(displayName);\n <span class=\"dt-avatar-name\">\n <ui-avatar [initials]=\"initials\" [name]=\"displayName\" [size]=\"28\" />\n <span class=\"dt-name-text\">{{ displayName }}</span>\n </span>\n }\n\n <!-- Days ago cell -->\n @case ('days-ago') {\n @let days = item[col.daysKey ?? col.key];\n <span [class.dt-overdue]=\"days !== null && days > (col.overdueThreshold ?? 30)\">\n @if (days !== null && days !== undefined) {\n {{ labels.t('dataTable.daysAgo', { days: days }) }}\n } @else {\n {{ labels.t('dataTable.never') }}\n }\n </span>\n }\n\n <!-- Progress cell -->\n @case ('progress') {\n @let pCfg = col.progressFn ? col.progressFn(item) : null;\n @if (pCfg) {\n <ui-progress-bar [value]=\"pCfg.value\" [max]=\"pCfg.max\" [label]=\"pCfg.label ?? ''\"\n [variant]=\"pCfg.variant ?? null\" [tooltip]=\"pCfg.tooltip ?? ''\" [ariaLabel]=\"pCfg.ariaLabel ?? ''\" />\n } @else { <span class=\"dt-none\">—</span> }\n }\n\n <!-- Tags cell -->\n @case ('tags') {\n @let tags = item[col.tagsKey ?? col.key];\n @if (tags?.length > 0) {\n <span class=\"dt-tags\">\n <ui-badge\n [label]=\"tags[0].name\"\n [variant]=\"tags[0].variant ?? null\"\n [color]=\"tags[0].color ?? null\" />\n @if (tags[0].colorName) {<span class=\"dt-sr-only\">, {{ tags[0].colorName }}</span>}\n @if (tags.length > 1) {\n <span\n class=\"dt-tags-more\"\n (mouseenter)=\"showTagTooltip($event, tags.slice(1))\"\n (mouseleave)=\"hideTagTooltip()\"\n (focus)=\"showTagTooltip($event, tags.slice(1))\"\n (blur)=\"hideTagTooltip()\"\n tabindex=\"0\"\n [attr.aria-label]=\"tags.slice(1).map(t => t.colorName ? t.name + ' (' + t.colorName + ')' : t.name).join(', ')\">\n +{{ tags.length - 1 }}\n </span>\n }\n </span>\n } @else {\n <span class=\"dt-none\">—</span>\n }\n }\n\n <!-- Image cell -->\n @case ('image') {\n <ng-container [ngTemplateOutlet]=\"imageCell\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" />\n }\n\n <!-- Link cell -->\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkCell\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" />\n }\n\n <!-- Actions cell -->\n @case ('actions') {\n <span class=\"dt-actions-cell\" (click)=\"$event.stopPropagation()\">\n @let rowActions = _rowActions(col, item);\n @if (rowActions.length) {\n <ui-more-menu\n [actions]=\"rowActions\"\n [ariaLabel]=\"rowActionsLabel(item)\"\n (opened)=\"rowMenuOpen.emit({ item })\"\n (actionClick)=\"onTableRowAction($event, col, item)\" />\n }\n </span>\n }\n\n <!-- Default: plain text -->\n @default {\n @if (col.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" /> }\n @if (col.starFn?.(item); as starTip) {\n <ui-star class=\"dt-cell-star\" [tooltip]=\"starTip\" />\n }\n {{ col.render ? col.render(item) : (item[col.key] ?? '—') }}\n }\n\n }\n </td>\n }\n </tr>\n }\n }\n </tbody>\n @if (_footerVisible()) {\n <tfoot data-testid=\"dt-footer\">\n <tr>\n @if (_reorderOn()) { <td class=\"dt-td-grip\"></td> }\n @if (_isSelectable()) { <td class=\"dt-td-cb\"></td> }\n @for (col of visibleCols(); track col.key; let first = $first) {\n @if (first) {\n <th scope=\"row\" class=\"dt-foot-label\"\n [style.text-align]=\"col.align ?? (col.cellType === 'number' ? 'right' : 'left')\"\n [style.width]=\"col.width ?? null\"\n [style.min-width]=\"col.width ?? null\"\n [style.max-width]=\"col.width ?? null\">\n @if (_footerCells()[col.key]; as ft) {\n <span class=\"dt-sr-only\">{{ totalsLabelText() }}: </span>{{ ft }}\n } @else {\n {{ totalsLabelText() }}\n }\n </th>\n } @else {\n <td class=\"dt-foot-cell\"\n [style.text-align]=\"col.align ?? (col.cellType === 'number' ? 'right' : 'left')\"\n [style.width]=\"col.width ?? null\"\n [style.min-width]=\"col.width ?? null\"\n [style.max-width]=\"col.width ?? null\">{{ _footerCells()[col.key] || '' }}</td>\n }\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n }\n\n <!-- ── CARD LIST (phone, ≤640px) — only one tree is rendered per viewport ─── -->\n @if (_isPhone()) {\n <!-- Phone sort + column filters: the table header (which owns them on larger screens) isn't rendered here -->\n @if (_hasPhoneControls() && _showColumnControls()) {\n <div class=\"dt-phone-controls\" role=\"group\" [attr.aria-label]=\"labels.t('dataTable.sortAndFilter')\">\n @if (_phoneSortOptions().length > 1) {\n <label class=\"dt-phone-sort\">\n <span class=\"dt-phone-sort-label\">{{ labels.t('dataTable.sort') }}</span>\n <select class=\"dt-phone-sort-select\" [attr.aria-label]=\"labels.t('dataTable.sortBy')\" (change)=\"onPhoneSort($any($event.target).value)\">\n @for (opt of _phoneSortOptions(); track opt.value) {\n <option [value]=\"opt.value\" [selected]=\"opt.value === _phoneSortValue()\">{{ opt.label }}</option>\n }\n </select>\n </label>\n }\n @if (_phoneFilterCols().length || _phoneRangeCols().length) {\n <div class=\"dt-phone-filters\">\n @for (f of _phoneRangeCols(); track f.col.key) {\n <ui-column-filter\n [chip]=\"true\"\n [label]=\"f.col.label\"\n [range]=\"f.rf.spec\"\n [rangeValue]=\"f.rf.value\"\n (rangeChange)=\"onRangeChange(f.col.key, $event)\" />\n }\n @for (f of _phoneFilterCols(); track f.col.key) {\n <ui-column-filter\n [chip]=\"true\"\n [label]=\"f.col.label\"\n [options]=\"f.cf.options\"\n [activeValues]=\"f.cf.activeValues\"\n (filterChange)=\"onColFilterChange(_filterName(f.col), $event)\" />\n }\n </div>\n }\n </div>\n }\n <!-- role=list only while it holds listitems (cards or skeleton cards); empty / error / no-match states are not an empty list -->\n <div class=\"dt-card-list\" [attr.role]=\"_cardListHasItems() ? 'list' : null\" [attr.aria-label]=\"_cardListHasItems() ? tableLabelText() : null\">\n\n @if (_loading()) {\n @for (_ of skeletonRows(); track $index) {\n <!-- Card skeleton matches exact layout: avatar circle + name line + menu dot | badge pills | key/value rows -->\n <div class=\"dt-card dt-card-sk\" role=\"listitem\">\n <div class=\"dt-card-sk-header\">\n <!-- Avatar circle -->\n <ui-skeleton [height]=\"32\" width=\"32px\" [radius]=\"50\" />\n <!-- Name line -->\n <ui-skeleton [height]=\"14\" width=\"160px\" [radius]=\"4\" />\n <!-- Action menu dot -->\n <ui-skeleton [height]=\"24\" width=\"24px\" [radius]=\"5\" style=\"margin-left:auto\" />\n </div>\n <!-- Badge pills row -->\n <div class=\"dt-card-sk-badges\">\n <ui-skeleton [height]=\"22\" width=\"72px\" [radius]=\"999\" />\n <ui-skeleton [height]=\"22\" width=\"52px\" [radius]=\"999\" />\n </div>\n <!-- Detail key/value rows -->\n <div class=\"dt-card-sk-rows\">\n <ui-skeleton [height]=\"12\" [radius]=\"4\" />\n <ui-skeleton [height]=\"12\" width=\"70%\" [radius]=\"4\" />\n </div>\n </div>\n }\n\n } @else if (_error()) {\n <ui-error-state [message]=\"_error()!\" [retryLabel]=\"_retryLabel()\" (retry)=\"_retryAfterError()\" />\n\n } @else if (_items().length === 0 && !_hasActiveFilters()) {\n <ui-empty-state iconType=\"table\" [message]=\"emptyMessageText()\" />\n\n } @else if (_items().length === 0 && _hasActiveFilters()) {\n <ui-empty-state iconType=\"search\" [message]=\"labels.t('dataTable.noResults')\">\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"clearFilters()\">{{ labels.t('dataTable.clearFilters') }}</ui-button>\n </ui-empty-state>\n\n } @else {\n @for (item of _items(); track trackItem(item, $index)) {\n <div\n class=\"dt-card alive-row\"\n [attr.data-row-key]=\"_reorderOn() ? trackItem(item, $index) : null\"\n [style.--i]=\"$index < 8 ? $index : 8\"\n role=\"listitem\"\n [class.dt-card-clickable]=\"isRowClickable(item)\"\n [class.dt-card-selected]=\"_isSelectable() && _selectedIds().has(item['id'])\"\n [attr.tabindex]=\"isRowClickable(item) ? 0 : null\"\n [attr.aria-label]=\"rowLabel(item)\"\n (keydown)=\"onRowKeydown($event, item)\"\n (click)=\"onRowClick(item)\">\n\n <!-- Selection checkbox (shown when bulk actions are enabled) -->\n @if (_isSelectable()) {\n <div class=\"dt-card-cb\" (click)=\"$event.stopPropagation()\">\n <ui-checkbox\n [ariaLabel]=\"selectRowLabel(item)\"\n [checked]=\"_selectedIds().has(item['id'])\"\n (checkedChange)=\"toggleRow(item)\" />\n </div>\n }\n\n <!-- Title row: avatar/name + action menu -->\n <div class=\"dt-card-header\">\n @if (_cardCols().imageCol; as ic) {\n <ng-container [ngTemplateOutlet]=\"imageCell\" [ngTemplateOutletContext]=\"{ col: ic, item: item, small: true }\" />\n }\n @if (_cardCols().titleCol; as tc) {\n @if (tc.cellType === 'avatar-name') {\n @let displayName = tc.nameFn ? tc.nameFn(item) : (item[tc.key] ?? '');\n @let initials = tc.initialsFn ? tc.initialsFn(item) : getInitials(displayName);\n <span class=\"dt-card-title\">\n <ui-avatar [initials]=\"initials\" [name]=\"displayName\" [size]=\"32\" />\n <span class=\"dt-card-name\">{{ displayName }}</span>\n </span>\n } @else if (tc.cellType === 'link') {\n <span class=\"dt-card-name dt-card-name-plain\">\n <ng-container [ngTemplateOutlet]=\"linkCell\" [ngTemplateOutletContext]=\"{ col: tc, item: item }\" />\n </span>\n } @else {\n <span class=\"dt-card-name dt-card-name-plain\">\n @if (tc.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: tc, item: item }\" /> }\n @if (tc.starFn?.(item); as starTip) {\n <ui-star class=\"dt-cell-star\" [tooltip]=\"starTip\" />\n }\n {{ tc.render ? tc.render(item) : cardCellText(tc, item) }}\n </span>\n }\n }\n @if (_reorderOn()) {\n <span class=\"dt-card-move\" (click)=\"$event.stopPropagation()\">\n <ui-button variant=\"icon\" size=\"sm\" [ariaLabel]=\"labels.t('dataTable.moveUp', { name: rowAccessibleName(item) || labels.t('dataTable.rowWord') })\"\n [disabled]=\"!_reorderActive() || $first\" (click)=\"moveByButton($index, -1)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 15l6-6 6 6\"/></svg>\n </ui-button>\n <ui-button variant=\"icon\" size=\"sm\" [ariaLabel]=\"labels.t('dataTable.moveDown', { name: rowAccessibleName(item) || labels.t('dataTable.rowWord') })\"\n [disabled]=\"!_reorderActive() || $last\" (click)=\"moveByButton($index, 1)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 9l6 6 6-6\"/></svg>\n </ui-button>\n </span>\n }\n @if (_cardCols().actionsCol; as ac) {\n @let cardActions = _rowActions(ac, item);\n @if (cardActions.length) {\n <span class=\"dt-card-actions\" (click)=\"$event.stopPropagation()\">\n <ui-more-menu\n [actions]=\"cardActions\"\n [ariaLabel]=\"rowActionsLabel(item)\"\n (opened)=\"rowMenuOpen.emit({ item })\"\n (actionClick)=\"onTableRowAction($event, ac, item)\" />\n </span>\n }\n }\n </div>\n\n <!-- Badge pills (status / type / source etc.) -->\n @if (_cardCols().badgeCols.length) {\n <div class=\"dt-card-badges\">\n @for (bc of _cardCols().badgeCols; track bc.key) {\n @let bCfg = resolveBadge(bc, item);\n @if (bCfg) { @if (bc.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: bc, item: item }\" /> } <ui-badge [label]=\"bCfg.label\" [variant]=\"bCfg.variant\" /> }\n }\n </div>\n }\n\n <!-- Tag pills (rendered as badge pills, one row per tags column) -->\n @for (tc of _cardCols().tagCols; track tc.key) {\n @let tagItems = item[tc.tagsKey ?? tc.key];\n @if (tagItems?.length) {\n <div class=\"dt-card-tags\">\n @for (tag of tagItems; track tag.name) {\n <ui-badge [label]=\"tag.name\" [variant]=\"tag.variant ?? 'gray'\" size=\"sm\" />\n @if (tag.colorName) {<span class=\"dt-sr-only\">, {{ tag.colorName }}</span>}\n }\n </div>\n }\n }\n\n <!-- Detail key/value rows -->\n @if (_cardCols().detailCols.length) {\n <div class=\"dt-card-details\">\n @for (dc of _cardCols().detailCols; track dc.key) {\n @let val = cardCellText(dc, item);\n @if (val !== '—') {\n <div class=\"dt-card-detail-row\">\n <span class=\"dt-card-detail-label\">{{ dc.label }}</span>\n <span class=\"dt-card-detail-value\"\n [class.dt-overdue]=\"dc.cellType === 'days-ago' && isCardOverdue(dc, item)\">\n @if (dc.cellType === 'link') {\n <ng-container [ngTemplateOutlet]=\"linkCell\" [ngTemplateOutletContext]=\"{ col: dc, item: item }\" />\n } @else {\n @if (dc.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: dc, item: item }\" /> }\n {{ val }}\n }</span>\n </div>\n }\n }\n </div>\n }\n\n </div>\n }\n }\n\n </div>\n @if (_footerVisible()) {\n <div class=\"dt-card dt-card-totals\" role=\"group\" [attr.aria-label]=\"totalsLabelText()\" data-testid=\"dt-footer-card\">\n <div class=\"dt-card-details\">\n @for (fc of _footerPhoneLines(); track fc.key) {\n <div class=\"dt-card-detail-row\">\n <span class=\"dt-card-detail-label\">{{ fc.label }}</span>\n <span class=\"dt-card-detail-value\">{{ fc.value }}</span>\n </div>\n }\n </div>\n </div>\n }\n }\n\n @if (_reorderOn()) {\n <span class=\"dt-sr-only\" [id]=\"_reorderHelpId\">{{ _reorderActive()\n ? labels.t('dataTable.reorderHelp')\n : _reorderHint() }}</span>\n <span class=\"dt-sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ _reorderAnnouncement() }}</span>\n }\n\n <!-- ── PAGINATION ─────────────────────────────────────────── -->\n @if (showPagination() && _total() > pageSize()) {\n <ui-pagination\n [page]=\"_page()\"\n [pageSize]=\"pageSize()\"\n [totalItems]=\"_total()\"\n [detached]=\"_isPhone()\"\n (pageChange)=\"onPageChange($event)\" />\n }\n\n <!-- ── BUILT-IN SERVICES (toast, confirm, import/export) ──── -->\n <ui-toast />\n <ui-confirm-outlet />\n\n @if (importExportConfig()) {\n <ui-import-export\n #ieRef\n [config]=\"importExportConfig()!\"\n [importSources]=\"importSources()\"\n [exportParams]=\"_exportParams()\"\n (imported)=\"onImported()\"\n style=\"display:none\" />\n }\n\n <!-- Built-in row-delete confirmation modal -->\n @if (_rowDeleteTarget()) {\n <ui-modal\n data-testid=\"confirm-modal\"\n [open]=\"true\"\n [title]=\"_rowDeleteConfig().title\"\n maxWidth=\"420px\"\n [describedBy]=\"_rowDeleteConfig().details?.length ? _confirmMsgId + ' ' + _confirmDetailsId : _confirmMsgId\"\n (close)=\"_rowDeleteTarget.set(null)\">\n <p class=\"dt-confirm-msg\" data-testid=\"confirm-message\" [id]=\"_confirmMsgId\">{{ _rowDeleteConfig().message }}</p>\n @if (_rowDeleteConfig().details?.length) {\n <ul class=\"dt-confirm-details\" data-testid=\"confirm-details\" [attr.aria-label]=\"labels.t('dataTable.whatWillHappen')\" [id]=\"_confirmDetailsId\">\n @for (d of _rowDeleteConfig().details; track $index) { <li>{{ d }}</li> }\n </ul>\n }\n <ui-button modal-footer-left data-testid=\"confirm-cancel\" variant=\"secondary\" size=\"sm\" [disabled]=\"_rowDeleting()\" (click)=\"_rowDeleteTarget.set(null)\">{{ labels.t('dataTable.cancel') }}</ui-button>\n <ui-button modal-footer-right data-testid=\"confirm-accept\" [variant]=\"_rowDeleteConfig().variant === 'primary' ? 'primary' : _rowDeleteConfig().variant === 'warning' ? 'warning' : 'danger'\" size=\"sm\" [loading]=\"_rowDeleting()\" (click)=\"_confirmRowDelete()\">{{ _rowDeleteConfig().confirmLabel }}</ui-button>\n </ui-modal>\n }\n\n <!-- Tags overflow tooltip — position: fixed so it escapes dt-table-wrap overflow -->\n @if (_tagTooltip()) {\n <div\n class=\"dt-tag-tooltip\"\n role=\"tooltip\"\n [style.left.px]=\"_tagTooltip()!.x\"\n [style.top.px]=\"_tagTooltip()!.y\">\n @for (tag of _tagTooltip()!.tags; track tag.name) {\n <ui-badge [label]=\"tag.name\" [variant]=\"tag.variant ?? 'gray'\" [color]=\"tag.color ?? null\" />\n }\n </div>\n }\n </div>\n `,\n styles: [`\n :host { display: flex; flex-direction: column; flex: 1; min-height: 0; }\n\n .dt-host { display: flex; flex-direction: column; height: 100%; min-height: 0; }\n\n /* ── Header ─── */\n .dt-header {\n display: flex; align-items: center; gap: 12px;\n margin-bottom: 16px; flex-wrap: wrap; justify-content: space-between;\n position: relative; z-index: 10;\n }\n .dt-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }\n .dt-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }\n .dt-title { margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; overflow-wrap: anywhere; }\n\n /* ── Shimmer base — GPU-composited via transform so no paint per frame ─── */\n .dt-sk-shimmer {\n position: relative; overflow: hidden; background: #f1f5f9;\n &::after {\n content: ''; position: absolute; inset: 0;\n background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.65) 50%, transparent 75%);\n transform: translateX(-100%);\n animation: dt-shimmer 1.4s ease-in-out infinite;\n }\n }\n @keyframes dt-shimmer { to { transform: translateX(200%); } }\n\n /* ── Header skeleton toolbar ─── */\n .dt-sk-toolbar {\n display: flex; align-items: center; justify-content: space-between;\n gap: 12px; margin-bottom: 16px;\n }\n .dt-sk-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }\n .dt-sk-toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }\n\n /* Search input: matches padding:8px 10px 8px 34px, border-radius:6px, min-width:380px */\n .dt-sk-search {\n display: flex; align-items: center; gap: 10px;\n width: 380px; height: 36px; padding: 0 12px;\n border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc;\n box-sizing: border-box;\n }\n .dt-sk-search-icon { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }\n .dt-sk-search-text { flex: 1; height: 11px; border-radius: 4px; }\n\n /* Quick filter tab strip: matches wrapper border-radius:8px padding:3px, tabs padding:6px 14px border-radius:6px */\n .dt-sk-tab-strip {\n display: flex; gap: 2px; padding: 3px;\n background: #f1f5f9; border-radius: 8px;\n }\n .dt-sk-tab { height: 28px; width: 70px; border-radius: 6px; }\n\n /* Toolbar icon buttons: matches padding:6px 10px border-radius:6px */\n .dt-sk-icon-btn { width: 32px; height: 32px; border-radius: 6px; }\n\n /* ── Table skeleton ─── */\n .dt-skeleton { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }\n .dt-sk-header {\n display: flex; gap: 24px; padding: 12px 16px;\n background: #f8fafc; border-bottom: 1px solid #e2e8f0;\n }\n .dt-sk-row {\n display: flex; gap: 24px; padding: 13px 16px;\n border-bottom: 1px solid #f1f5f9;\n &:last-child { border-bottom: none; }\n }\n .dt-sk-cell {\n flex: 1; height: 13px; border-radius: 4px;\n position: relative; overflow: hidden; background: #f1f5f9;\n &:first-child { max-width: 100px; }\n &::after {\n content: ''; position: absolute; inset: 0;\n background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.65) 50%, transparent 75%);\n transform: translateX(-100%);\n animation: dt-shimmer 1.4s ease-in-out infinite;\n }\n }\n .dt-sk-head { height: 10px; }\n\n /* ── Table wrap — only as tall as its rows (flex: 0 1 auto: no empty box down to the bottom of the page); when the rows do not fit it shrinks to the remaining height and scrolls on both axes ─── */\n .dt-table-wrap {\n flex: 0 1 auto; min-height: 0; overflow: auto;\n border: 1px solid #e2e8f0; border-radius: 10px 10px 0 0;\n }\n .dt-sk-reload-row td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }\n\n table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }\n\n /* ── Head — sticky so column headers stay visible while rows scroll ─── */\n thead tr { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }\n thead { position: sticky; top: 0; z-index: 2; }\n th {\n padding: 10px 14px; font-size: 0.75rem; font-weight: 600;\n color: #64748b; text-transform: uppercase; letter-spacing: 0.04em;\n white-space: nowrap; border-right: 1px solid #e2e8f0; text-align: center;\n background: #f8fafc;\n &:last-child { border-right: none; }\n &.dt-th-sorted { background: #f1f5f9; }\n &.dt-th-actions { width: 48px; }\n }\n .dt-th-inner { display: flex; align-items: center; justify-content: center; gap: 4px; }\n\n /* ── Sort ─── */\n .dt-sort-btn {\n display: inline-flex; align-items: center; gap: 4px;\n background: none; border: none; cursor: pointer; font-size: inherit;\n font-weight: inherit; color: inherit; font-family: inherit; padding: 0;\n text-transform: inherit; letter-spacing: inherit;\n &:hover { color: #1e293b; }\n &:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; border-radius: 2px; }\n }\n /* Touch: the sort button keeps its look and gets a >= 44px hit height through ::after (desktop unchanged) */\n @media (pointer: coarse) {\n .dt-sort-btn { position: relative; }\n .dt-sort-btn::after { content: ''; position: absolute; left: -4px; right: -4px; top: 50%; height: 44px; transform: translateY(-50%); }\n }\n .dt-sort-icon { transition: transform 0.15s; }\n .dt-sort-desc { transform: rotate(180deg); }\n .dt-sort-inactive { opacity: 0.4; }\n\n /* ── Body ─── */\n tbody tr {\n border-bottom: 1px solid #f1f5f9; background: #fff;\n transition: background 0.1s;\n &:last-child { border-bottom: none; }\n &:hover { background: #f8fafc; }\n }\n /* ── Footer totals row (totalsEndpoint) ─── */\n tfoot tr { background: #f8fafc; border-top: 2px solid #e2e8f0; }\n tfoot th.dt-foot-label {\n padding: 10px 14px; font-size: 0.875rem; font-weight: 700; color: #1e293b;\n text-transform: none; letter-spacing: normal; background: #f8fafc; border-right: 1px solid #f1f5f9; white-space: nowrap;\n }\n tfoot td { padding: 10px 14px; font-weight: 700; color: #1e293b; background: #f8fafc; }\n .dt-card-totals { background: #f8fafc; font-weight: 600; }\n .dt-row-clickable { cursor: pointer; }\n .dt-row-clickable:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }\n td {\n padding: 10px 14px; color: #334155; vertical-align: middle;\n white-space: nowrap; border-right: 1px solid #f1f5f9;\n &:last-child { border-right: none; }\n }\n .dt-td-actions { text-align: center; padding: 6px 8px; }\n /* stickyActions: the Actions header + cells stay at the right edge of a sideways-scrolling table (opaque, so the cells scrolling under them stay hidden) */\n .dt-sticky-actions th.dt-th-actions,\n .dt-sticky-actions td.dt-td-actions { position: sticky; right: 0; box-shadow: -1px 0 0 #e2e8f0; }\n .dt-sticky-actions th.dt-th-actions { z-index: 3; background: #f8fafc; }\n .dt-sticky-actions td.dt-td-actions { z-index: 1; background: #fff; }\n /* Each pinned cell is its own stacking layer, so the row menu opened in it was painted UNDER the pinned cells of the rows below it (later in the DOM, same z-index).\n The cell that holds the open menu (:has - Safari does not focus a button on click, so :focus-within alone is not enough) goes one layer up. */\n .dt-sticky-actions td.dt-td-actions:focus-within,\n .dt-sticky-actions td.dt-td-actions:has(.mm-dropdown) { z-index: 2; }\n .dt-sticky-actions tbody tr:hover td.dt-td-actions { background: #f8fafc; }\n .dt-sticky-actions tbody tr.dt-row-selected td.dt-td-actions { background: #eff6ff; }\n .dt-sticky-actions tbody tr.dt-row-selected:hover td.dt-td-actions { background: #dbeafe; }\n /* ColumnDef.width: the cell is fixed to that width; longer text is cut with an ellipsis */\n .dt-td-width { overflow: hidden; text-overflow: ellipsis; }\n\n /* ── Cell types ─── */\n .dt-img { display: inline-block; vertical-align: middle; object-fit: cover; border: 1px solid #e2e8f0; background: #f1f5f9; flex-shrink: 0; }\n .dt-img-ph { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; color: #94a3b8; background: #f1f5f9; border: 1px solid #e2e8f0; flex-shrink: 0; }\n .dt-img-ph svg { width: 55%; height: 55%; }\n .dt-img-circle-md { width: 40px; height: 40px; border-radius: 50%; }\n .dt-img-circle-sm { width: 28px; height: 28px; border-radius: 50%; }\n .dt-img-rounded-md { width: 48px; height: 32px; border-radius: 6px; }\n .dt-img-rounded-sm { width: 36px; height: 24px; border-radius: 5px; }\n .dt-avatar-name { display: flex; align-items: center; gap: 8px; }\n .dt-name-text { color: #1e293b; }\n .dt-overdue { color: #dc2626; font-weight: 500; }\n .dt-none { color: #64748b; } /* slate-500: 4.76:1 on white (slate-400 was 2.56:1) */\n /* Link cell: real <a>; long text is cut with an ellipsis like other cells (inline-block + overflow, plain CSS). */\n .dt-link {\n position: relative; display: inline-block; max-width: 100%; padding: 1px 2px; vertical-align: bottom;\n overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n color: #2563eb; text-decoration: none; border-radius: 3px; cursor: pointer;\n }\n .dt-link:hover { text-decoration: underline; color: #1d4ed8; }\n .dt-link:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; text-decoration: underline; }\n /* Touch: a link cell is a 44px target without making the row taller (padding grows the box, the equal negative margin takes it back out of the layout). */\n @media (pointer: coarse), (max-width: 480px) {\n .dt-link { padding: 12px 2px; margin: -12px 0; }\n }\n .dt-card-detail-value .dt-link, .dt-card-name .dt-link { white-space: normal; overflow-wrap: anywhere; }\n .dt-sr-only {\n position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;\n clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;\n }\n .dt-tags { display: flex; align-items: center; gap: 4px; }\n .dt-tags-more {\n font-size: 0.75rem; font-weight: 600; color: #475569;\n background: #f1f5f9; border-radius: 999px; padding: 2px 7px;\n cursor: default; user-select: none;\n border: 1px solid #e2e8f0;\n &:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; border-radius: 999px; }\n }\n\n /* Fixed tooltip — renders outside dt-table-wrap so overflow:auto can't clip it */\n .dt-tag-tooltip {\n position: fixed; z-index: 9999; pointer-events: none;\n background: #1e293b; border-radius: 10px;\n padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.06), 0 10px 24px rgba(0,0,0,0.14);\n transform: translateX(-50%) translateY(-100%);\n animation: dt-tip-in 120ms ease;\n max-width: 220px;\n }\n @keyframes dt-tip-in { from { opacity: 0; transform: translateX(-50%) translateY(calc(-100% + 4px)); } to { opacity: 1; transform: translateX(-50%) translateY(-100%); } }\n .dt-cell-star { margin-right: 6px; }\n /* Leading icon (iconFn): sits on the first text line, never shrinks, takes the text colour. */\n .dt-cell-icon { flex-shrink: 0; display: inline-block; margin-right: 6px; vertical-align: -3px; color: #64748b; }\n .dt-actions-cell { display: flex; align-items: center; justify-content: center; }\n\n /* ── Bulk bar ─── */\n .dt-bulk-bar {\n display: flex; align-items: center; gap: 10px; flex-wrap: wrap;\n align-self: flex-start;\n padding: 10px 14px; margin-bottom: 8px;\n background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;\n }\n .dt-bulk-count { font-size: 0.875rem; font-weight: 600; color: #1e40af; white-space: nowrap; flex-shrink: 0; }\n .dt-bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }\n .dt-bulk-actions ui-select { max-width: 180px; min-width: 120px; }\n .dt-bulk-hint { font-size: 0.8125rem; line-height: 1.35; color: #475569; }\n\n /* ── Card checkbox ─── */\n .dt-card-cb {\n display: flex; align-items: center; padding: 0 0 6px 0;\n }\n\n /* ── Card selected state ─── */\n .dt-card-selected { background: #eff6ff !important; border-color: #bfdbfe !important; }\n\n /* ── Checkbox column ─── */\n .dt-th-cb {\n width: 44px; padding: 0 10px !important; text-align: center !important;\n border-right: 1px solid #e2e8f0; background: #f8fafc;\n }\n .dt-td-cb {\n width: 44px; padding: 0 10px !important; text-align: center !important;\n border-right: 1px solid #f1f5f9;\n }\n\n /* ── Row reordering (reorderable) ─── */\n .dt-th-grip { width: 36px; padding: 0 !important; border-right: 1px solid #e2e8f0; background: #f8fafc; }\n .dt-td-grip { width: 36px; padding: 0 !important; text-align: center !important; border-right: 1px solid #f1f5f9; }\n .dt-grip {\n display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px;\n color: #64748b; cursor: grab; -webkit-user-select: none; user-select: none; touch-action: none;\n }\n .dt-grip:hover { background: #f1f5f9; color: #334155; }\n .dt-grip:active { cursor: grabbing; }\n .dt-grip:focus-visible { outline: 2px solid #3b82f6; outline-offset: 1px; }\n .dt-grip-off { color: #cbd5e1; cursor: not-allowed; }\n .dt-grip-off:hover { background: none; color: #cbd5e1; }\n .dt-row-move { display: none; }\n /* A touch screen moves rows with the buttons (native drag is unreliable there): the grip gives way to them. */\n @media (pointer: coarse) {\n .dt-grip { display: none; }\n .dt-row-move { display: inline-flex; flex-direction: column; align-items: center; }\n .dt-th-grip, .dt-td-grip { width: 56px; }\n }\n .dt-row-dragging { opacity: 0.45; }\n .dt-row-over-before > td { box-shadow: inset 0 2px 0 #3b82f6; }\n .dt-row-over-after > td { box-shadow: inset 0 -2px 0 #3b82f6; }\n .dt-card-move { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }\n @media (forced-colors: active) {\n .dt-row-over-before > td { box-shadow: inset 0 2px 0 Highlight; }\n .dt-row-over-after > td { box-shadow: inset 0 -2px 0 Highlight; }\n .dt-grip:focus-visible { outline-color: Highlight; }\n }\n\n /* ── Selected row ─── */\n .dt-row-selected { background: #eff6ff !important; }\n .dt-row-selected:hover { background: #dbeafe !important; }\n\n /* ── States ─── */\n .dt-state-cell { padding: 0 !important; border: none !important; background: #fff !important; }\n /* td is nowrap for data cells; the error / empty message in this cell must wrap inside the table border (it inherited nowrap and ran past it). */\n .dt-state-cell { white-space: normal; }\n\n /* ── iPad / tablet optimizations (≤1024px) ─── */\n @media (max-width: 1024px) {\n /* Row height: 38px+ for comfortable touch */\n th { padding: 10px 12px; }\n td { padding: 11px 12px; }\n /* Sort button — larger vertical tap area */\n .dt-sort-btn { padding: 4px 0; }\n /* Actions cell — taller so ⋮ button is easier to tap */\n .dt-td-actions { padding: 6px 6px; }\n /* Bulk bar stretches full width on tablet so wrapped buttons have room */\n .dt-bulk-bar { align-self: stretch; }\n }\n\n /* ── Tablet portrait / large phone (≤820px): search + tabs on their own row, buttons on the next ─── */\n @media (max-width: 820px) {\n .dt-header-left { flex-basis: 100%; }\n .dt-header-right { flex-basis: 100%; justify-content: flex-start; }\n }\n\n /* ── Small tablet / large phone landscape (≤768px) ─── */\n @media (max-width: 768px) {\n th { padding: 9px 10px; font-size: 0.8125rem; }\n td { padding: 10px 10px; font-size: 0.8125rem; }\n .dt-sk-search { width: 100%; }\n }\n\n /* ── Phone (≤640px): card view replaces table ─── */\n @media (max-width: 640px) {\n /* Never shrink or wrap: in a height-limited host (card list taller than the screen) a shrinking, wrapping column\n pushed the right-hand slot into a second column and the whole page scrolled sideways. */\n .dt-header { flex-direction: column; flex-wrap: nowrap; flex-shrink: 0; align-items: stretch; }\n /* The tablet rule above gives both slots flex-basis: 100%, which is the full WIDTH in a wrapping row. In this column that same 100% is the\n whole header HEIGHT, so the right-hand slot (search toolbar) became as tall as the header and its vertically centred buttons landed on top of the\n phone Sort row below. Each slot takes its own content height here. */\n .dt-header-left, .dt-header-right { width: 100%; flex-basis: auto; }\n /* Hide table, show cards */\n .dt-table-wrap { display: none; }\n /* Skeleton toolbar adapts */\n .dt-sk-search { width: 100%; }\n .dt-sk-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }\n .dt-sk-toolbar-right { align-self: flex-end; }\n /* Bulk bar: full width, count + clear on one row, buttons fill below */\n .dt-bulk-bar {\n align-self: stretch;\n padding: 10px 12px;\n row-gap: 8px;\n }\n /* The count takes the first row; the action buttons share the next one with Clear (right-aligned) while they fit and wrap together when they do not.\n (flex: 1 sets the flex-basis to 0, so a plain width: 100% was ignored and the buttons sat beside the count with Clear floating between them.) */\n .dt-bulk-count { flex: 1 1 100%; }\n .dt-bulk-actions { flex: 1 1 auto; width: auto; }\n .dt-bulk-hint { flex-basis: 100%; }\n .dt-bulk-actions ui-select { max-width: 100%; flex: 1; }\n }\n\n /* Built-in delete confirm modal message */\n .dt-confirm-msg { margin: 0; font-size: 0.9375rem; color: #334155; line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; white-space: pre-line; }\n .dt-confirm-details { margin: 10px 0 0; padding-left: 20px; font-size: 0.875rem; color: #64748b; line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; }\n .dt-confirm-details li + li { margin-top: 4px; }\n\n /* Pagination stays flush to the table bottom border */\n /* The pagination footer uses the same light grey as the column headers (thead tr). */\n ui-pagination { flex-shrink: 0; --ui-pagination-bg: #f8fafc; }\n\n /* ── Card list — fills remaining height and scrolls vertically on mobile ─── */\n /* Phone-only sort + filter row above the card list (rendered only when _isPhone()). */\n .dt-phone-controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; flex-shrink: 0; }\n .dt-phone-sort { display: flex; align-items: center; gap: 8px; }\n .dt-phone-sort-label { font-size: 0.8125rem; font-weight: 600; color: #475569; /* slate-600: 6.92:1 on #f1f5f9 */ flex-shrink: 0; }\n .dt-phone-sort-select {\n flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 0 36px 0 12px;\n font-family: inherit; font-size: 1rem; /* 16px: no iOS focus-zoom */\n color: #1e293b; border: 1px solid #7c8ba1; border-radius: 8px;\n /* Safari (macOS) ignores min-height / height on a native select unless its own appearance is switched off (the library's ui-select does the same);\n the chevron the native control drew is then drawn here. */\n -webkit-appearance: none; appearance: none;\n background: #fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E\") no-repeat right 12px center;\n }\n .dt-phone-filters { display: flex; flex-wrap: wrap; gap: 8px; }\n\n .dt-card-list {\n display: none; /* shown only at ≤640px via the media query below */\n flex-direction: column; gap: 8px;\n flex: 1; min-height: 0; overflow-y: auto;\n }\n /* Must come after the base rule above: same specificity, so the later rule wins. */\n @media (max-width: 640px) {\n .dt-card-list { display: flex; padding-bottom: 8px; }\n }\n\n .dt-card {\n background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;\n contain: layout style;\n padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;\n transition: background 0.1s;\n }\n /* contain: layout makes each card its own stacking context, which would trap an open row menu\n beneath the following cards. The menu's dropdown only exists in the DOM while open, so raise\n just that card above its siblings. */\n .dt-card:has(.mm-dropdown) { position: relative; z-index: 1; }\n .dt-card-clickable { cursor: pointer; }\n .dt-card-clickable:active { background: #f8fafc; }\n .dt-card-clickable:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }\n\n /* Card header: avatar/name + action menu */\n .dt-card-header {\n display: flex; align-items: center; gap: 10px;\n }\n .dt-card-title {\n display: flex; align-items: center; gap: 10px;\n flex: 1; min-width: 0;\n }\n /* Long names (a property address) wrap to at most three lines, then end in an ellipsis. */\n .dt-card-name {\n min-width: 0; font-weight: 600; color: #1e293b; font-size: 0.9375rem;\n overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere;\n display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;\n }\n .dt-card-name-plain { flex: 1; }\n .dt-card-actions { margin-left: auto; flex-shrink: 0; }\n\n /* Badge pills row */\n .dt-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }\n\n /* Tag pills row (smaller than status badges) */\n .dt-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }\n\n /* Detail key/value rows */\n .dt-card-details { display: flex; flex-direction: column; gap: 5px; }\n .dt-card-detail-row {\n display: flex; justify-content: space-between; align-items: baseline;\n gap: 8px; font-size: 0.8125rem;\n }\n .dt-card-detail-label { color: #64748b; flex-shrink: 0; }\n .dt-card-detail-value { color: #334155; font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }\n\n /* Card skeleton layout wrappers (ui-skeleton handles shimmer) */\n .dt-card-sk { gap: 12px; }\n .dt-card-sk-header { display: flex; align-items: center; gap: 10px; }\n .dt-card-sk-badges { display: flex; gap: 6px; }\n .dt-card-sk-rows { display: flex; flex-direction: column; gap: 8px; }\n\n /* Reduced motion: no entrance / shimmer animation (a loading spinner stays, slower). */\n @media (prefers-reduced-motion: reduce) {\n .dt-sk-shimmer::after, .dt-sk-cell::after { animation: none; transform: none; opacity: 0; } /* no shimmer sweep */\n .dt-tag-tooltip { animation: none; }\n .dt-sort-icon { transition: none; }\n }\n `],\n})\nexport class DataTableComponent<T extends Record<string, any>> implements OnInit {\n /* ── Inputs ─────────────────────────────────────────────────── */\n readonly endpoint = input.required<string>();\n readonly columns = input.required<ColumnDef[]>();\n /** Search box placeholder when no column is searchable; `null` (default) = the library text for the active language. */\n readonly searchPlaceholder = input<string | null>(null);\n readonly pageSize = input(50);\n /** Accessible name of the table; `null` (default) = the library text for the active language. */\n readonly tableLabel = input<string | null>(null);\n protected readonly tableLabelText = computed(() => this.tableLabel() ?? this.labels.t('dataTable.tableLabel'));\n /** Message of the empty table; `null` (default) = the library text for the active language. */\n readonly emptyMessage = input<string | null>(null);\n protected readonly emptyMessageText = computed(() => this.emptyMessage() ?? this.labels.t('dataTable.emptyMessage'));\n /**\n * Text of the retry button in the failed-load state (desktop table and phone cards). Plain text.\n * Empty / blank keeps the error state's own default (\"Try again\").\n */\n readonly retryLabel = input('');\n protected readonly _retryLabel = computed(() => this.retryLabel().trim() || this.labels.t('dataTable.tryAgain'));\n readonly lockedColumn = input('');\n readonly savedViews = input<SavedView[]>([]);\n /**\n * When provided, the table manages saved views automatically — loads from backend on init,\n * saves/deletes via API, and restores state on load. Value is the `page` key used in\n * `GET /api/saved-views?page=<savedViewsPage>`. No host wiring needed.\n */\n readonly page = input('');\n /** Show column config + saved views toolbar. Defaults true. Set false to hide both. */\n readonly showToolbar = input(true);\n /**\n * Show the More Actions menu in the toolbar (Import, Columns, Save/Saved Views and page-defined menu items). Defaults true.\n * Set false for a page that has nothing to offer there; Export, page-defined primary/secondary buttons and the search box\n * are unaffected. The table still hides the menu by itself when it is empty and unfiltered.\n */\n readonly showMoreActions = input(true);\n /**\n * Words a quick-filter tab. Called with the tab's key (a key of `/counts`, e.g. `no-deals`); the text it returns is the tab's label. Return `null`, `undefined` or `''` for a key the host does not\n * word and the table reads it as before (the label of a column with a `badgeFn` that has that value, else the key split into capitalised words: `no-deals` → \"No Deals\"). Use it when a tab has no\n * column to take its text from, e.g. a Spanish app wording `no-deals` → \"Sin negocios\". The tab's `value` (the key sent to the backend) never changes. Default: none (every label as before).\n */\n readonly quickTabLabelFn = input<((key: string) => string | null | undefined) | null>(null);\n /**\n * Show the search box above the table. Defaults true. Set false for small fixed tables where searching is meaningless\n * (a handful of summary rows). Quick-filter tabs and the toolbar are unaffected; when the search box, the tabs and the\n * toolbar are all off, the header row above the table is not rendered at all.\n */\n readonly showSearch = input(true);\n /**\n * Show the quick-filter tabs (\"All / Active / ...\"), which the table builds from the `/counts` endpoint. Defaults true:\n * with correct `/counts` data the tabs show. Set false for a table where the tabs add nothing (a small breakdown table in a\n * side panel); search, toolbar, column filters and the counts requests are unaffected. When the search box, the toolbar and the\n * tabs are all off, the header row is not rendered at all.\n */\n readonly showQuickTabs = input(true);\n /** `false` hides the pager under the rows: the table shows only the first `pageSize` rows (a dashboard card that links to the full list instead). Default `true`. */\n readonly showPagination = input(true);\n /**\n * Keep the Actions column (the row \"⋮\" menu) pinned to the right edge while the table scrolls sideways, so a wide table never hides it\n * off-screen. Default false: every existing table is unchanged. Only matters when the table is wider than its container (columns scroll);\n * phones use the card list, which has no sideways scroll.\n */\n readonly stickyActions = input(false);\n /**\n * Optional heading shown at the start of the header row, on the same row as the search box / tabs on the left and the\n * Export / primary buttons on the right (rendered as an `<h3>`, also while the table is loading and when it is empty).\n * Empty (default) renders nothing. Use it when the table is a section of a page and its title belongs with its toolbar.\n */\n readonly tableTitle = input('');\n /** False when the header row would be empty (no title, no search box, no toolbar, no quick-filter tabs). */\n protected readonly _showHeader = computed(() => !!this.tableTitle() || this.showSearch() || this.showToolbar() || this._effectiveTabs().length > 0);\n /** Optional endpoint that returns Record<string,number> counts per quick-filter value. */\n readonly countsEndpoint = input('');\n /**\n * Optional footer totals row. Path relative to `baseUrl` (like `endpoint`). When set, the table GETs it with the same query params as the\n * rows request except paging and sorting (host `params`, lower-cased `search` + `searchFields`, active tab as `filter`, column filters) and\n * shows a footer built from each column's `footerFn`. The response is `Record<string, string | number | null>`. Totals follow the FILTERED\n * set, not the page; they are refetched on search / tab / filter / params / refresh() / resetToFirstPage() / import (not on paging or\n * sorting) and never cached. Hidden while loading, on error, with zero rows, or when the totals request fails (silently).\n */\n readonly totalsEndpoint = input('');\n /** Text of the footer's label cell (first visible column) and the phone summary card's accessible name. */\n /** Label of the footer totals row; `null` (default) = the library text for the active language. */\n readonly totalsLabel = input<string | null>(null);\n protected readonly totalsLabelText = computed(() => this.totalsLabel() ?? this.labels.t('dataTable.totalsLabel'));\n /**\n * Optional extra query params owned by the host page (e.g. a period picker or a parent-record id),\n * sent with every row, /counts, /filter-counts and export request. When the value changes the table\n * goes back to page 1 and refreshes rows + counts; search, sort, tab and column filters are kept.\n * Omit it (default null) and nothing changes. Empty / null values are dropped.\n * [params]=\"{ period: period() }\"\n */\n readonly params = input<Record<string, string | null | undefined> | null>(null);\n /** Action buttons rendered in the table header. Primary variant = standalone button; secondary = More Actions dropdown. */\n readonly tableButtons = input<ToolbarAction[]>([]);\n /** Optional endpoint that returns Record<string, Record<string,number>> counts per badge column value. */\n readonly filterCountsEndpoint = input('');\n /** Import/export config. When provided, Import + Export buttons are automatically added to the toolbar. */\n readonly importExportConfig = input<ImportExportConfig | null>(null);\n /** Competitor/source profiles for the import wizard. App-defined — not baked into the library. */\n readonly importSources = input<ImportSource[] | undefined>(undefined);\n /**\n * Page permission. Anything other than 'full' makes the table read-only: no Import,\n * no bulk update/delete and no checkbox column (even when `selectable` is set), no page-defined\n * toolbar buttons except Export and pure reads marked `allowReadOnly` (More Actions offers only their existing Saved Views), and the\n * row menu offers only View (`type: 'view'`).\n * Rows with nothing to show get no \"⋮\" trigger; the Actions column is dropped when no row has View.\n */\n readonly permission = input<TablePermission>('full');\n /** The app's optional central read-only switch (`provideReadOnlyMode`): while it is on, every table is read-only whatever its `permission` says. Off / not provided = no effect. */\n private readonly _readOnlyMode = injectReadOnlyMode();\n protected readonly _canEdit = computed(() => this.permission() === 'full' && !this._readOnlyMode());\n /** Enable row checkboxes and selection count bar (without bulk actions). */\n readonly selectable = input(false);\n /** Singular item label used in the selection count (e.g. \"contact\" → \"3 contacts selected\"). */\n readonly itemLabel = input('item');\n /** Plural label; defaults to English pluralisation of `itemLabel` (\"property\" → \"properties\"). */\n readonly itemLabelPlural = input<string>('');\n /** The singular item word: the host's `itemLabel`, or (when the host left the default `item`) the dictionary word for the active language. */\n protected _itemWord(): string {\n const v = this.itemLabel();\n return v === 'item' ? this.labels.t('dataTable.itemWord') : v;\n }\n /** The plural item word: the host's `itemLabelPlural`, else the dictionary word for the default item, else English pluralisation of the host's label (hosts in other languages pass `itemLabelPlural`). */\n protected _itemsWord(): string {\n const p = this.itemLabelPlural();\n if (p) return p;\n return this.itemLabel() === 'item' ? this.labels.t('dataTable.itemsWord') : pluralize(this.itemLabel());\n }\n protected _countLabel(count: number): string {\n return count === 1 ? this._itemWord() : this._itemsWord();\n }\n /** \"3 contacts selected\" in the active language (singular/plural forms differ in Spanish: \"1 contacto seleccionado\"). */\n protected _selectedText(): string {\n const n = this._selectedIds().size;\n return this._plural('dataTable.selectedCount', n, { item: this._countLabel(n) });\n }\n /** `<base>_one` / `<base>_other` label for a count, with `count` (and any `extra` placeholders) filled in. */\n private _plural(base: string, count: number, extra: Record<string, string | number> = {}): string {\n return this.labels.t(`${base}_${count === 1 ? 'one' : 'other'}` as UiLabelKey, { count, ...extra });\n }\n /**\n * \"3 updated, 1 skipped, 2 not allowed, 4 busy (try again).\" when some rows were left out (\"Actualización: 3, omisiones: 1, sin permiso: 2, en uso: 4 (intente de nuevo).\" in Spanish), else \"3 item(s) updated.\".\n * `busy` = rows another save held at that moment (the backend's `busy`, not part of `skipped`); when ONLY busy rows exist the sentence is \"4 contacts are busy: another save was in progress, try again.\".\n */\n private _resultSummary(count: number, done: string, skipped: number, notAllowed: number, busy = 0): string {\n if (busy > 0 && count === 0 && skipped === 0 && notAllowed === 0) return this._plural('dataTable.summaryBusyOnly', busy, { item: this._countLabel(busy) });\n if (skipped > 0 || notAllowed > 0 || busy > 0) {\n return [\n this.labels.t('dataTable.summaryDone', { count, done }),\n skipped > 0 ? this.labels.t('dataTable.summarySkipped', { count: skipped }) : '',\n notAllowed > 0 ? this.labels.t('dataTable.summaryNotAllowed', { count: notAllowed }) : '',\n busy > 0 ? this.labels.t('dataTable.summaryBusy', { count: busy }) : '',\n ].filter(Boolean).join(', ') + '.';\n }\n return this._summaryAll(count, done);\n }\n /** The response's `busy`: a finite number above 0 (whole rows), else 0 (absent, 0, negative, text, NaN: ignored). */\n private _busyOf(r: { busy?: unknown } | null | undefined): number {\n const b = r?.busy;\n return typeof b === 'number' && Number.isFinite(b) && b >= 1 ? Math.floor(b) : 0;\n }\n /** Every row that was sent was busy (nothing updated / skipped / refused): the selection (and an open \"Change <field>\" select) is kept so the user can simply try again. */\n private _allBusy(count: number, busy: number, serverSkipped: number, notAllowed: number): boolean {\n return busy > 0 && count === 0 && serverSkipped === 0 && notAllowed === 0;\n }\n /** The toast of a finished bulk request: busy rows with nothing changed = an amber warning (polite live region, retry needed); a server `message` with nothing changed = an error; otherwise the success toast. */\n private _toastBulkResult(summary: string, serverMsg: string | null, count: number, busy: number): void {\n if (busy > 0 && count === 0) this._toast.warning(serverMsg ? `${summary} ${serverMsg}` : summary);\n else if (serverMsg && count === 0) this._toast.error(serverMsg);\n else this._toast.show(serverMsg ? `${summary} ${serverMsg}` : summary);\n }\n /** \"3 item(s) updated.\" in English (the singular word and \"(s)\"); \"Actualización: 3 contactos.\" in a language whose dictionary turns `dataTable.summaryUsesCountAgreement` on (the word agrees with the count). */\n private _summaryAll(count: number, done: string): string {\n const item = this.labels.t('dataTable.summaryUsesCountAgreement') === 'yes' ? this._countLabel(count) : this._itemWord();\n return this.labels.t(count === 1 ? 'dataTable.summaryAll_one' : 'dataTable.summaryAll_other', { count, item, done });\n }\n /** Default bulk-Delete confirm title: \"Delete \" + the title-cased plural item label (\"template\" → \"Delete Templates\", \"lien waiver\" → \"Delete Lien Waivers\"). */\n protected _deleteTitle(): string {\n const plural = this._itemsWord();\n return this.labels.t('dataTable.deleteTitle', { items: plural.replace(/(^|\\s)(\\S)/g, (_m, sp: string, ch: string) => sp + ch.toUpperCase()) });\n }\n /**\n * Column keys to enable bulk updates for, plus the special keyword `'delete'`.\n * e.g. `['status', 'type', 'delete']`\n * The table matches each key to its column definition to get the label and options —\n * no extra config or API calls needed. Setting this automatically enables row checkboxes.\n * Use `{ field, exclude }` to leave values users can't set out of that field's bulk select:\n * `[{ field: 'status', exclude: ['EXPIRED'] }, 'delete']` (see `BulkUpdateOption`).\n * Use `{ field, allowedFrom: { TARGET: [sourceValues] } }` for a status workflow: only targets some selected row can\n * legally move to are offered, and rows that can't move are skipped (never sent).\n * Use `{ field: 'resend', action: true, label: 'Resend', eligible?, confirm?, variant?, doneLabel? }` for a direct bulk action: a bar button\n * that confirms and POSTs `<endpoint>/bulk/<field>` with `{ ids }` of the eligible rows (no select, no column needed).\n * A blank `label` falls back to the key split on `_`, `-` and camelCase with only the first word capitalised ('send_reminder' -> 'Send reminder');\n * two actions with the same key collapse to the first; an `eligible` that throws counts as \"row not eligible\".\n */\n readonly bulkUpdateOptions = input<BulkUpdateOption<T>[]>([]);\n\n /* ── Outputs ────────────────────────────────────────────────── */\n readonly rowClick = output<T>();\n /**\n * A `cellType: 'link'` anchor was clicked (plain or with ctrl/cmd/shift; a middle-button click is an `auxclick`, not emitted). Fires instead of\n * `rowClick`: the anchor stops the click from reaching the row. For an in-app `routerLink` the table has already\n * called `Router.navigateByUrl` on a plain left click (modifier / `_blank` clicks are left to the browser).\n */\n readonly linkClick = output<LinkClickEvent<T>>();\n /**\n * Optional per-row opt-out for (rowClick): rows where it returns false get no pointer cursor,\n * no tab stop and no click/keyboard activation (e.g. log rows with no linked record).\n */\n readonly rowClickableFn = input<((item: T) => boolean) | null>(null);\n /**\n * Accessible name of a row / card (e.g. `View case for Jane Doe`) so a screen reader announces what activating it does.\n * Return '' (or omit the input) for no `aria-label`.\n */\n readonly rowLabelFn = input<((item: T) => string) | null>(null);\n readonly tableButtonClick = output<string>();\n /** Emitted when a row action with opens === 'panel' is clicked.\n * The host component listens to this and opens the appropriate side panel or form modal. */\n readonly panelActionClick = output<{ type: string; item: T }>();\n readonly saveViewClick = output<void>();\n readonly loadViewClick = output<SavedView>();\n readonly deleteViewClick = output<string>();\n readonly imported = output<void>();\n readonly selectionChange = output<Set<string>>();\n /**\n * Emitted with the active quick-filter tab's key whenever it changes — a tab click, \"Clear filters\" (`''`),\n * or a saved view being applied. `''` means the \"All\" tab. Lets a host page know which tab the user is on\n * (e.g. to preselect it in an Add panel).\n */\n readonly tabChange = output<string>();\n /** Emitted when the user applies a bulk action. The table has already filtered to eligible IDs. */\n readonly bulkAction = output<BulkActionEvent>();\n /**\n * Emitted when the user clicks a bulk action declared `{ field, action: true, opens: 'panel' }`. The table sends nothing: the host opens its\n * own panel for `rows` and, when it has finished, calls `clearSelection()` and `refresh()` on the table.\n */\n readonly bulkPanelClick = output<BulkPanelEvent<T>>();\n /**\n * Emitted after every rows request that completes (a request superseded by a newer one emits nothing; first load, page, sort, search, tab, filter, `refresh()` ...): `{ ok: true, total }` when the rows\n * arrived (`total` = all matching rows), `{ ok: false, total }` when the request failed (the rows on screen are kept, `total` is the last known).\n * Lets a host refresh something that must follow the table (e.g. a failure banner above it).\n */\n readonly loaded = output<{ ok: boolean; total: number }>();\n /** Emitted after a built-in single-row delete completes successfully. */\n readonly rowDeleted = output<T>();\n /**\n * Emitted when a row's ⋮ menu opens (table rows and phone cards), with that row. Library source 2026-11-21. The table fetches nothing: a host that needs fresh data for a row-dependent action (is this unit\n * still bookable? is a reader payment still open?) reads it here and updates what `actionsFn` returns (the host's `getRowActions` cache key must include what it refreshed). Not emitted for read-only users\n * who have no menu, and not again while the same menu stays open.\n */\n readonly rowMenuOpen = output<{ item: T }>();\n /**\n * Words an error for the user (library source 2026-11-21, additive; default `null` = every message as before). Called with the failed request's error (an `HttpErrorResponse`, or the offline layer's error)\n * for: the table's load-failure message (the text replaces the \"Your items couldn't be loaded...\" sentence next to \"Try again\"), and the failure toast of a bulk action (Delete, Change <field>, a direct\n * action, a file action) and of the built-in row delete. The text it returns (trimmed, not empty) is used; `null` / `undefined` / `''` (or a throw) keeps the table's own wording for that error, so a host can\n * word only the errors it knows (e.g. a 409 `{ code: 'reader_busy' }` of its own backend).\n */\n readonly errorTextFn = input<((err: unknown) => string | null | undefined) | null>(null);\n /**\n * Optional drag-and-drop ordering of the rows. Off by default; when `true` (and the user has full access) every row gets a grip\n * (drag it, or focus it and use the arrow keys / Home / End; phone cards get Move up / Move down buttons). Reordering is only\n * offered while the list is in its stored order: with a sort, search, quick tab or column filter active the grips are disabled\n * (their tooltip says why), because the visible order is then not the stored one. The move is applied to the page on screen at\n * once and announced as `(rowReorder)`; the host saves it (a failed save should call `refresh()` to bring back the stored order).\n */\n readonly reorderable = input(false);\n /** Emitted after the user moves a row: `items` is the page in its new order, `from` / `to` are page indexes, `offset` is the number of rows on earlier pages. */\n readonly rowReorder = output<TableRowReorderEvent<T>>();\n\n /* ── DI ─────────────────────────────────────────────────────── */\n private readonly config = inject(FORGEROUTE_CONFIG);\n private readonly http = inject(HttpClient);\n private readonly destroyRef = inject(DestroyRef);\n protected readonly labels = inject(UiLabelsService);\n private readonly _confirmSvc = inject(ConfirmService);\n private readonly _toast = inject(ToastService);\n\n /* ── Internal state ─────────────────────────────────────────── */\n protected readonly _items = signal<T[]>([]);\n /** Public read-only signal of current page items — used by host components for bulk selection. */\n readonly items: Signal<T[]> = this._items.asReadonly();\n protected readonly _selectedIds = signal<Set<string>>(new Set());\n protected readonly _total = signal(0);\n protected readonly _loading = signal(true);\n protected readonly _hasLoaded = signal(false);\n /** Image URLs that failed to load — their cells show the placeholder instead. */\n /** True only while a SEARCH-triggered load is in flight (drives the search box spinner). */\n protected readonly _searchLoading = signal(false);\n private _searchPending = false;\n protected readonly _failedImages = signal<Set<string>>(new Set());\n private readonly _numericKeys = signal<Set<string>>(new Set());\n protected readonly _tabCounts = signal<Record<string, number>>({});\n protected readonly _filterCounts = signal<Record<string, Record<string, number>>>({});\n private _tabCountsSub?: Subscription;\n private _filterCountsSub?: Subscription;\n\n /**\n * Values that actually occur in the data (count > 0). Shared by quick-filter tabs\n * and column filters so both follow the same rule: with only one value there is\n * nothing to filter on — tabs are disabled and the column filter icon is hidden.\n */\n private _presentKeys(counts: Record<string, number>): string[] {\n return Object.keys(counts).filter(k => k !== '' && k !== 'all' && (counts[k] ?? 0) > 0);\n }\n\n /** Auto-generates tabs from countsEndpoint keys. */\n protected readonly _effectiveTabs = computed<QuickFilterTab[]>(() => {\n if (!this.showQuickTabs()) return [];\n const counts = this._tabCounts();\n const present = this._presentKeys(counts);\n // The selected tab always stays (even at 0 under a search): the user is searching within it.\n const active = this._activeTab();\n const hasCounts = Object.keys(counts).length > 0;\n const keys = hasCounts && active && !present.includes(active) ? [...present, active] : present;\n if (!keys.length) return [];\n const hostLabel = this.quickTabLabelFn();\n const toLabel = (s: string) => hostLabel?.(s) || (this._columnBadgeLabel(s) ?? (/[a-z]/.test(s) ? s : s.toLowerCase())\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/-/g, ' ')\n .replace(/(^|\\s)\\p{L}/gu, c => c.toUpperCase())); // word starts only: \"booking.com\" stays \"Booking.com\"\n const singleValue = keys.length === 1;\n return [\n { value: '', label: this.labels.t('dataTable.all') },\n ...keys.map(k => ({ value: k, label: toLabel(k), disabled: singleValue })),\n ];\n });\n\n /**\n * Badge label for a quick-filter tab key, so a tab reads exactly like the column's badges\n * (`signsAndPrint` → \"Signs & Print\", `mlsFees` → \"MLS Fees\"). The key is matched to a value from\n * /filter-counts of a column with a badgeFn, ignoring case, dashes, underscores and spaces.\n * null when nothing matches — the caller falls back to splitting the key.\n */\n private _columnBadgeLabel(key: string): string | null {\n const norm = (v: string) => v.toLowerCase().replace(/[^a-z0-9]/g, '');\n const target = norm(key);\n if (!target) return null;\n const filterCounts = this._filterCounts();\n for (const col of this.columns()) {\n if (!col.badgeFn) continue;\n const value = Object.keys(filterCounts[this._filterName(col)] ?? {}).find(v => norm(v) === target);\n if (value === undefined) continue;\n const label = col.badgeFn(value, null)?.label;\n if (label) return label;\n }\n return null;\n }\n protected readonly _error = signal<string | null>(null);\n /** Phone card list is only a role=list while it contains listitems: skeleton cards or real rows (not error / empty / no-match). */\n protected readonly _cardListHasItems = computed(() => this._loading() || (!this._error() && this._items().length > 0));\n private readonly _loadFailed = signal(false);\n /**\n * True from a failed load (the table shows its error state) until a later load SUCCEEDS. Unlike the error state itself it stays true while\n * Retry / a reload is in flight, so a host can keep its own controls (a date range card, say) out of the page for the whole time the\n * table is not showing real data. Read it through the table reference: `tableRef()?.loadFailed()`.\n */\n readonly loadFailed = this._loadFailed.asReadonly();\n protected readonly _search = signal('');\n /** The search text as sent to the API: lower-cased, so every search is case-insensitive whatever the backend does. The input still shows what the user typed. */\n protected readonly _searchParam = computed(() => this._search().toLowerCase());\n protected readonly _page = signal(1);\n protected readonly _sortField = signal<string | null>(null);\n protected readonly _sortDir = signal<SortDir>('asc');\n protected readonly _activeTab = signal('');\n protected readonly _colFilterValues = signal<Record<string, string[]>>({});\n /**\n * Opt-in numeric range filters (`<ui-data-table [rangeFilters]>`): a visible column whose key is listed gets a Min / Max filter (same funnel icon\n * and popover as the value list; the range replaces the value list for that column). Empty (default) = no range filter anywhere: no icon, no\n * param, no saved-view field. The table sends `<minParam>` / `<maxParam>` on rows, export and totals (never on /counts or /filter-counts, like\n * every column filter); the backend filters.\n */\n readonly rangeFilters = input<RangeFilterConfig[]>([]);\n /** Applied ranges by column key (bounds are finite numbers; a bound that is null is omitted). */\n protected readonly _rangeValues = signal<Record<string, ColumnRangeValue>>({});\n /** Listed configs by column key, with defaults resolved. */\n private readonly _rangeSpecs = computed(() => {\n const out = new Map<string, { spec: ColumnRangeSpec; minParam: string; maxParam: string }>();\n for (const c of this.rangeFilters() ?? []) {\n if (!c || typeof c.key !== 'string' || !c.key || out.has(c.key)) continue;\n const step = typeof c.step === 'number' && Number.isFinite(c.step) && c.step > 0 ? c.step : 1;\n const min = typeof c.min === 'number' && Number.isFinite(c.min) ? c.min : 0;\n // A max below min (or not a number) would make the popover unusable: it is ignored.\n const max = typeof c.max === 'number' && Number.isFinite(c.max) && c.max >= min ? c.max : undefined;\n out.set(c.key, {\n minParam: c.minParam || `${c.key}Min`, maxParam: c.maxParam || `${c.key}Max`,\n spec: { min, ...(max !== undefined ? { max } : {}), step, format: c.format ?? 'number', ...(c.unit ? { unit: c.unit } : {}) },\n });\n }\n return out;\n });\n /**\n * Ranges of columns that are no longer listed are forgotten, so listing the column again later starts empty (no stale range comes back).\n * When a forgotten range had a bound, the rows were filtered by it, so the rows are reloaded (page 1, rows only: counts never carry filters)\n * and match the params again. A host that briefly passes `[]` therefore drops the user's ranges.\n */\n private readonly _pruneRanges = effect(() => {\n const keys = this._rangeSpecs();\n untracked(() => {\n const cur = this._rangeValues();\n const stale = Object.keys(cur).filter(k => !keys.has(k));\n if (!stale.length) return;\n const hadBound = stale.some(k => cur[k]?.min != null || cur[k]?.max != null);\n this._rangeValues.set(Object.fromEntries(Object.entries(cur).filter(([k]) => keys.has(k))));\n if (hadBound) { this._page.set(1); this.load(); }\n });\n });\n /** Query params of the applied ranges (only listed keys; empty bounds omitted). */\n protected readonly _rangeParams = computed<Record<string, string>>(() => {\n const out: Record<string, string> = {};\n const values = this._rangeValues();\n for (const [key, cfg] of this._rangeSpecs()) {\n const v = values[key];\n if (!v) continue;\n if (v.min != null) out[cfg.minParam] = String(v.min);\n if (v.max != null) out[cfg.maxParam] = String(v.max);\n }\n return out;\n });\n /** The range filter of a header cell: null unless the table lists this column's key. */\n protected getRangeFilter(col: ColumnDef): { spec: ColumnRangeSpec; value: ColumnRangeValue } | null {\n if (col.cellType === 'actions') return null;\n const cfg = this._rangeSpecs().get(col.key);\n return cfg ? { spec: cfg.spec, value: this._rangeValues()[col.key] ?? { min: null, max: null } } : null;\n }\n protected readonly _phoneRangeCols = computed(() =>\n this._rangeSpecs().size === 0 ? [] : this.visibleCols()\n .map(col => ({ col, rf: this.getRangeFilter(col) }))\n .filter((f): f is { col: ColumnDef; rf: { spec: ColumnRangeSpec; value: ColumnRangeValue } } => f.rf !== null));\n protected onRangeChange(key: string, value: ColumnRangeValue) {\n this._rangeValues.update(prev => {\n const next = { ...prev };\n if (value.min == null && value.max == null) delete next[key]; else next[key] = { min: value.min ?? null, max: value.max ?? null };\n return next;\n });\n this._page.set(1);\n this.load();\n }\n /** True while a listed range filter has a bound set. */\n private _anyRangeActive(): boolean { return Object.keys(this._rangeParams()).length > 0; }\n protected readonly _activeViewId = signal<string | null>(null);\n\n /** Internal saved views managed by the table when savedViewsPage is set. */\n private readonly _internalSavedViews = signal<SavedView[]>([]);\n /** Resolved saved views — internal when savedViewsPage is set, host-supplied otherwise. */\n protected readonly _effectiveSavedViews = computed(() =>\n this.page() ? this._internalSavedViews() : this.savedViews(),\n );\n\n /** Empty = show all defaultVisible; non-empty = show exactly these keys */\n protected readonly _visibleColumns = signal<string[]>([]);\n\n /** Drops the key of every `cellType: 'actions'` column — Actions is never part of a configured/saved column list. */\n protected _configurableKeys(keys: string[] | null | undefined): string[] {\n const actionKeys = new Set(this.columns().filter(c => c.cellType === 'actions').map(c => c.key));\n return (keys ?? []).filter(k => !actionKeys.has(k));\n }\n\n protected readonly _ieRef = viewChild<ImportExportComponent>('ieRef');\n\n /** Tag overflow tooltip — fixed position to escape table's overflow:auto */\n protected readonly _tagTooltip = signal<{ tags: any[]; x: number; y: number } | null>(null);\n\n protected readonly visibleCols = computed(() => {\n const vis = this._visibleColumns();\n const cols = this.columns();\n const numericKeys = this._numericKeys();\n // The Actions column is never user-configurable: it stays visible even when a stored list omits it.\n const base = vis.length\n ? cols.filter(c => c.cellType === 'actions' || vis.includes(c.key))\n : cols.filter(c => c.defaultVisible !== false);\n\n const dates: ColumnDef[] = [];\n const status: ColumnDef[] = [];\n const regular: ColumnDef[] = [];\n const numeric: ColumnDef[] = [];\n const actions: ColumnDef[] = [];\n for (const col of base) {\n if (col.cellType === 'actions') { actions.push(col); }\n else if (col.cellType === 'date') { dates.push(col); }\n else if (col.key === 'status') { status.push(col); }\n else if (numericKeys.has(col.key)) { numeric.push(col); }\n else { regular.push(col); }\n }\n // Read-only users only get View in the row menu — drop the Actions column when no loaded row offers it.\n const shownActions = this._canEdit()\n ? actions\n : actions.filter(col => this._items().some(item => this._rowActions(col, item).length > 0));\n return [...dates, ...status, ...regular, ...numeric, ...shownActions];\n });\n\n protected readonly _effectiveSearchPlaceholder = computed(() => {\n const searchableCols = this.visibleCols().filter(c => c.searchable);\n if (!searchableCols.length) return this.searchPlaceholder() ?? this.labels.t('dataTable.searchPlaceholder');\n const labels = searchableCols.map(c => c.label.toLowerCase());\n return this.labels.t('dataTable.searchBy', { fields: labels.join(', ') });\n });\n\n /**\n * True when the host binds (rowClick). Signal outputs have no public \"observed\" flag, so read the\n * OutputEmitterRef's subscriber list (a method, not a computed: subscribers aren't a signal).\n * Falls back to true if Angular ever changes that internal shape.\n */\n protected _rowClickable(): boolean {\n const listeners = (this.rowClick as any).listeners;\n return listeners === undefined ? true : (listeners?.length ?? 0) > 0;\n }\n\n protected readonly skeletonCols = computed(() =>\n Array.from({ length: Math.min(this.columns().length || 5, 8) }),\n );\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.min(this.pageSize(), 8) }),\n );\n\n /** Splits visible columns into roles for the mobile card view. */\n protected readonly _cardCols = computed(() => {\n const cols = this.visibleCols();\n // Title: avatar-name column, else the page's locked (primary identifier) column, else the first\n // data column. The locked column matters because column order puts the record date first.\n const locked = this.lockedColumn();\n const titleCol = cols.find(c => c.cellType === 'avatar-name')\n ?? (locked ? cols.find(c => c.key === locked && c.cellType !== 'actions') : undefined)\n ?? cols.find(c => c.cellType !== 'actions' && c.cellType !== 'image') ?? null;\n return {\n titleCol,\n imageCol: cols.find(c => c.cellType === 'image') ?? null,\n badgeCols: cols.filter(c => c.cellType === 'badge'),\n tagCols: cols.filter(c => c.cellType === 'tags'),\n detailCols: cols.filter(c =>\n c.key !== titleCol?.key &&\n c.cellType !== 'avatar-name' &&\n c.cellType !== 'image' &&\n c.cellType !== 'badge' &&\n c.cellType !== 'tags' &&\n c.cellType !== 'actions' &&\n !c.mobileHidden,\n ),\n actionsCol: cols.find(c => c.cellType === 'actions') ?? null,\n };\n });\n\n /**\n * A successful load returned no rows and no search, tab or column filter is active: there is nothing to search,\n * export or configure, so only the primary buttons (Add) stay in the toolbar. Host `params` (a date range, a selected\n * parent) don't count — the host's own controls for them stay on screen — but an active search, tab or column filter\n * keeps the full toolbar so the user can clear it.\n */\n protected readonly _emptyUnfiltered = computed(() =>\n this._hasLoaded() && !this._loading() && !this._error() && this._items().length === 0 &&\n !this._hasActiveFilters(),\n );\n\n /** Buttons handed to the toolbar: all of them, or only the primary ones while the table is empty and unfiltered. */\n protected readonly _toolbarButtons = computed((): ToolbarAction[] =>\n this._emptyUnfiltered() ? this._effectiveButtons().filter(b => b.variant === 'primary' || b.keepWhenEmpty) : this._effectiveButtons(),\n );\n\n /** True while the table is empty and unfiltered but the host kept a More Actions item (`keepWhenEmpty`) — the menu stays. */\n protected readonly _keepMoreActions = computed(() =>\n this._emptyUnfiltered() && this._toolbarButtons().some(b => !b.variant && !b.hidden),\n );\n\n /** The reorder column is part of the table (the grips may still be disabled, see `_reorderActive`). */\n protected readonly _reorderOn = computed(() => this.reorderable() && this._canEdit());\n /** Moves are allowed: the list is in its stored order (no sort / search / tab / filter), loaded, and has more than one row. */\n protected readonly _reorderActive = computed(() =>\n this._reorderOn() && !this._loading() && !this._error() && !this._sortField() && !this._hasActiveFilters() && this._items().length > 1);\n /** Why the grips are off: an active sort / search / tab / filter is the reason to name even when it left one row (\"nothing to reorder\" would hide it). */\n protected readonly _reorderHint = computed(() => this._sortField() || this._hasActiveFilters()\n ? this.labels.t('dataTable.reorderBlockedFiltered')\n : this._items().length < 2 ? this.labels.t('dataTable.reorderBlockedNothing') : this.labels.t('dataTable.reorderBlockedOther'));\n /** One id per table, so each grip can point to the instructions (aria-describedby) even with several tables on a page. */\n protected readonly _reorderHelpId = `dt-reorder-help-${++reorderHelpSeq}`;\n protected readonly _dragFrom = signal<number | null>(null);\n /** Key of the row being dragged: the index can go stale if the page reloads mid-drag, the key cannot. */\n private _dragKey: string | number | null = null;\n protected readonly _dragOver = signal<number | null>(null);\n /** Polite screen-reader message after a move. */\n protected readonly _reorderAnnouncement = signal('');\n private readonly _host = inject(ElementRef);\n\n protected reorderLabel(item: T): string {\n const name = this.rowAccessibleName(item);\n return name ? this.labels.t('dataTable.reorderRowNamed', { name }) : this.labels.t('dataTable.reorderRow');\n }\n\n protected onGripDragStart(e: DragEvent, index: number): void {\n if (!this._reorderActive()) { e.preventDefault(); return; }\n this._dragFrom.set(index);\n this._dragKey = this.trackItem(this._items()[index], index);\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', String(index)); // Firefox does not start a drag without drag data\n const row = (e.target as HTMLElement).closest('tr, .dt-card');\n if (row) e.dataTransfer.setDragImage(row, 16, 16);\n }\n }\n protected onGripDragEnd(): void { this._dragFrom.set(null); this._dragOver.set(null); this._dragKey = null; }\n protected onRowDragOver(e: DragEvent, index: number): void {\n if (this._dragFrom() === null) return;\n e.preventDefault();\n if (e.dataTransfer) e.dataTransfer.dropEffect = 'move';\n this._dragOver.set(index);\n }\n protected onRowDrop(e: DragEvent, index: number): void {\n const dragged = this._dragFrom();\n if (dragged === null) return;\n e.preventDefault();\n // Where the dragged row is NOW (a reload mid-drag can have changed the page); gone = nothing to move.\n const key = this._dragKey;\n const from = key === null ? dragged : this._items().findIndex((item, i) => this.trackItem(item, i) === key);\n this.onGripDragEnd();\n if (from >= 0) this.moveRow(from, index);\n }\n protected onGripKeydown(e: KeyboardEvent, index: number): void {\n if (!this._reorderActive()) return;\n const last = this._items().length - 1;\n if (e.key === 'Enter' || e.key === ' ') {\n // A button must do something when activated: say where the row is and how to move it (it never moves on its own).\n e.preventDefault();\n e.stopPropagation();\n const name = this.rowAccessibleName(this._items()[index]) || this.labels.t('dataTable.rowWordCapital');\n this._reorderAnnouncement.set('');\n afterNextRender(() => this._reorderAnnouncement.set(this.labels.t('dataTable.reorderAtPosition', { name, position: index + 1, total: last + 1 })), { injector: this._injector });\n return;\n }\n const target = e.key === 'ArrowUp' ? index - 1 : e.key === 'ArrowDown' ? index + 1 : e.key === 'Home' ? 0 : e.key === 'End' ? last : null;\n if (target === null) return;\n e.preventDefault();\n e.stopPropagation();\n if (this.moveRow(index, target)) {\n // The rows re-render in the new order: put focus back on the moved row's grip.\n const key = String(this._items()[Math.max(0, Math.min(last, target))]['id'] ?? target);\n afterNextRender(() => {\n this._host.nativeElement.querySelector(`[data-row-key=\"${CSS.escape(key)}\"] .dt-grip`)?.focus();\n }, { injector: this._injector });\n }\n }\n\n /**\n * A Move up / Move down button (touch screens and phone cards). The pressed button can end up disabled (the row reached an end), and a\n * focused control that gets disabled drops focus to the page, so focus goes to the row's other Move button then.\n */\n protected moveByButton(index: number, direction: -1 | 1): void {\n const key = String(this.trackItem(this._items()[index], index));\n if (!this.moveRow(index, index + direction)) return;\n afterNextRender(() => {\n const row = this._host.nativeElement.querySelector(`[data-row-key=\"${CSS.escape(key)}\"]`) as HTMLElement | null;\n const suffix = direction === -1 ? ' up' : ' down';\n const same = row?.querySelector<HTMLElement>(`button[aria-label$=\"${suffix}\"]:not(:disabled)`);\n (same ?? row?.querySelector<HTMLElement>('.dt-row-move button:not(:disabled), .dt-card-move button:not(:disabled)'))?.focus();\n }, { injector: this._injector });\n }\n\n /** Moves the row at `from` to `to` (both page indexes) in the table and tells the host. false = nothing changed. */\n protected moveRow(from: number, to: number): boolean {\n const items = this._items();\n if (!this._reorderActive() || !Number.isInteger(from) || from < 0 || from >= items.length) return false;\n const target = Math.max(0, Math.min(items.length - 1, to));\n if (target === from) return false;\n const next = [...items];\n const [moved] = next.splice(from, 1);\n next.splice(target, 0, moved);\n this._items.set(next);\n const name = this.rowAccessibleName(moved) || this.labels.t('dataTable.rowWordCapital');\n this._reorderAnnouncement.set('');\n afterNextRender(() => this._reorderAnnouncement.set(this.labels.t('dataTable.reorderMoved', { name, position: target + 1, total: next.length })), { injector: this._injector });\n this.rowReorder.emit({ item: moved, from, to: target, items: next, offset: (this._page() - 1) * this.pageSize() });\n return true;\n }\n\n protected readonly _hasActiveFilters = computed(() => {\n const cf = this._colFilterValues();\n return !!this._search() || !!this._activeTab() || Object.values(cf).some(v => v.length > 0) || this._anyRangeActive();\n });\n\n /** Host `params` with empty values dropped; equal by content so a new object with the same values doesn't reload. */\n protected readonly _extraParams = computed<Record<string, string>>(() => {\n const out: Record<string, string> = {};\n for (const [key, val] of Object.entries(this.params() ?? {})) {\n if (val != null && val !== '') out[key] = String(val);\n }\n return out;\n }, { equal: (a, b) => JSON.stringify(a) === JSON.stringify(b) });\n\n /** Current active filter/search/sort params — passed to the export so it exports the filtered view. */\n /** Visible searchable column keys (comma-joined) — the table and Export only search what's on screen. */\n protected readonly _searchFields = computed(() =>\n this.visibleCols().filter(c => c.searchable).map(c => c.key).join(','));\n\n /** Latest footer totals response (null = none / failed / not requested). */\n protected readonly _totals = signal<Record<string, string | number | null> | null>(null);\n private _totalsSub?: Subscription;\n /** Set by paging and sorting: they reload rows but never change the totals. */\n private _totalsSkipNext = false;\n\n protected readonly _footerVisible = computed(() =>\n !!this.totalsEndpoint() && this._totals() !== null && this._hasLoaded() && !this._loading() && !this._error() && this._items().length > 0);\n\n /** Footer text per visible column key (only columns whose footerFn returns text). */\n protected readonly _footerCells = computed<Record<string, string>>(() => {\n const totals = this._totals();\n const out: Record<string, string> = {};\n if (!totals) return out;\n for (const col of this.visibleCols()) {\n if (col.cellType === 'actions' || !col.footerFn) continue;\n const v = col.footerFn(totals);\n if (v != null && v !== '') out[col.key] = String(v);\n }\n return out;\n });\n\n protected readonly _footerPhoneLines = computed(() => {\n const cells = this._footerCells();\n return this.visibleCols().filter(c => cells[c.key] !== undefined).map(c => ({ key: c.key, label: c.label, value: cells[c.key] }));\n });\n\n /** Totals request params: the export params without sorting (the rows request without paging and sorting). */\n private _totalsParams(): Record<string, string> {\n const { sort: _s, direction: _d, ...rest } = this._exportParams();\n return rest;\n }\n\n /** `keepShown`: a silent (background) refresh keeps the current footer on screen until the new totals arrive. */\n private _fetchTotals(keepShown = false): void {\n this._totalsSub?.unsubscribe();\n const ep = this.totalsEndpoint();\n if (!ep) { this._totals.set(null); return; }\n if (!keepShown) this._totals.set(null);\n this._totalsSub = this.http.get<Record<string, string | number | null>>(`${this.config.baseUrl}${ep}`, { params: tableQueryParams(this._totalsParams()) })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: totals => this._totals.set(totals && typeof totals === 'object' ? totals : null),\n error: () => this._totals.set(null),\n });\n }\n\n protected readonly _exportParams = computed<Record<string, string>>(() => {\n const params: Record<string, string> = { ...this._extraParams() };\n if (this._search()) {\n params['search'] = this._searchParam();\n // Same scope as the table's own search, so the CSV never includes rows the table hides.\n if (this._searchFields()) params['searchFields'] = this._searchFields();\n }\n if (this._activeTab()) params['filter'] = this._activeTab();\n if (this._sortField()) { params['sort'] = this._sortField()!; params['direction'] = this._sortDir(); }\n const cf = this._colFilterValues();\n for (const [key, vals] of Object.entries(cf)) { if (vals.length > 0) params[key] = encodeFilterValues(vals); }\n Object.assign(params, this._rangeParams());\n return params;\n });\n\n /**\n * Toolbar buttons with auto-injected Export (always) and Import (only when\n * importExportConfig.importEndpoint is set) when importExportConfig is provided.\n */\n protected readonly _effectiveButtons = computed((): ToolbarAction[] => {\n const canEdit = this._canEdit();\n // Read-only users get no page-defined toolbar actions — only Export (+ their saved views) and pure reads marked `allowReadOnly`.\n const buttons = canEdit ? this.tableButtons() : this.tableButtons().filter(b => b.allowReadOnly);\n const cfg = this.importExportConfig();\n if (!cfg) return buttons;\n // Remove any manually-defined import/export buttons to avoid duplication\n const filtered = buttons.filter(b => b.type !== 'import' && b.type !== 'export');\n return [\n ...filtered,\n { type: 'export', label: this.labels.t('dataTable.export'), ...(cfg.exportInMoreActions ? {} : { variant: 'secondary' as const }),\n icon: 'M4 16v1a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1m-4-8l-4-4m0 0L8 8m4-4v12' },\n // No importEndpoint → export-only table; read-only permission → no Import either\n ...(cfg.importEndpoint && canEdit ? [{ type: 'import', label: this.labels.t('dataTable.import'),\n icon: 'M4 16v1a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4' }] : []),\n ];\n });\n\n /** True when checkboxes should be shown — either explicit selectable or bulk options are defined. */\n /** Row checkboxes — never for read-only users (no bulk column at all), even when `selectable` is set. */\n protected readonly _isSelectable = computed(() => this._canEdit() && (this.selectable() || this._bulkDefs().length > 0));\n\n /**\n * Derives internal action definitions from the `bulkUpdateOptions` string array.\n * 'delete' → built-in danger action with table-managed confirm dialog.\n * `{ field, action: true, label }` → direct action (type `action-<key>`, no column needed, no select).\n * Everything else → matched to a column: label = the entry's `label` when given, else \"Change {col.label}\"; options from column config.\n */\n protected readonly _bulkDefs = computed((): BulkActionDef[] =>\n (this._canEdit() ? this.bulkUpdateOptions() : [])\n .map((entry): BulkActionDef => {\n const key = typeof entry === 'string' ? entry : entry.field;\n const confirm = typeof entry === 'string' ? undefined : entry.confirm;\n const deletable = typeof entry === 'string' ? undefined : entry.deletable;\n if (key === 'delete') return { type: 'delete', label: this.labels.t('dataTable.delete'), variant: 'danger', ...(confirm ? { confirm } : {}),\n ...(deletable ? { deletable } : {}) };\n if (typeof entry !== 'string' && entry.action) {\n // Direct action: no column, no select — the entry's label is the button text.\n const label = entry.label?.trim() || this._actionKeyLabel(key);\n return { type: `action-${key}`, label, variant: entry.variant === 'danger' ? 'danger' : 'secondary', action: true,\n ...(entry.eligible ? { eligible: entry.eligible } : {}), ...(entry.doneLabel ? { doneLabel: entry.doneLabel } : {}),\n ...(entry.download && entry.opens !== 'panel' ? { download: entry.download } : {}),\n ...(entry.opens === 'panel' ? { opensPanel: true } : {}), ...(entry.opens === 'panel' && entry.hidden ? { hidden: entry.hidden } : {}),\n ...(confirm ? { confirm } : {}) };\n }\n const exclude = typeof entry === 'string' ? [] : (entry.exclude ?? []);\n const col = this.columns().find(c => c.key === key);\n const allowedFrom = typeof entry === 'string' ? undefined : entry.allowedFrom;\n const canChange = typeof entry === 'string' ? undefined : entry.canChange;\n const canApply = typeof entry === 'string' ? undefined : entry.canApply;\n const skipReason = typeof entry === 'string' ? undefined : entry.skipReason;\n const listAll = typeof entry === 'string' ? undefined : entry.listAll;\n const order = typeof entry === 'string' ? undefined : entry.order;\n const custom = typeof entry === 'string' ? '' : (entry.label?.trim() ?? '');\n return { type: `change-${key}`, label: custom || this.labels.t('dataTable.changeColumn', { column: col?.label ?? key }), variant: 'secondary', field: key,\n ...(custom ? { customLabel: true } : {}),\n ...(exclude.length ? { exclude } : {}), ...(allowedFrom ? { allowedFrom } : {}), ...(canChange ? { canChange } : {}),\n ...(canApply ? { canApply } : {}), ...(skipReason ? { skipReason } : {}), ...(listAll === true || (Array.isArray(listAll) && listAll.length) ? { listAll } : {}),\n ...(Array.isArray(order) && order.length ? { order } : {}),\n ...(confirm ? { confirm } : {}) };\n })\n // A field whose exclusions leave nothing to pick gets no \"Change <column>\" button.\n .filter(def => !def.field || !def.exclude?.length || this._bulkOptionsFor(def).length > 0)\n // Two direct actions with the same key: the first wins (`track def.type` must stay unique).\n .filter((def, i, all) => !def.action || all.findIndex(d => d.type === def.type) === i),\n );\n\n /** Fallback label of a direct action without one: splits the key on `_`, `-` and camelCase, capitalises the first word only ('send_reminder' / 'sendReminder' -> 'Send reminder'). */\n private _actionKeyLabel(key: string): string {\n const words = key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').split(/[\\s_-]+/).filter(Boolean).join(' ').toLowerCase();\n return words.charAt(0).toUpperCase() + words.slice(1);\n }\n\n /** Runs a direct action's `eligible` predicate; a predicate that throws counts as \"row not eligible\". */\n private _isActionEligible(def: BulkActionDef, row: T): boolean {\n try { return !!def.eligible!(row); } catch { return false; }\n }\n\n /** Options for a field-based bulk action: the field's options (or, with `listAll`, its full value set) minus the entry's `exclude` values. */\n private _bulkOptionsFor(def: BulkActionDef): { value: string; label: string }[] {\n const opts = def.listAll ? this._listAllOptions(def) : this._getOptionsForField(def.field!);\n const kept = def.exclude?.length ? opts.filter(o => !this._isBulkExcluded(def, o.value)) : opts;\n return def.order?.length ? orderBulkOptions(kept, def.order) : kept;\n }\n\n /**\n * `listAll` options: a list of values = exactly that set in that order; `true` = the usual options (filter counts, or the page's distinct values)\n * plus every `allowedFrom` target not yet listed. Labels go through the column's `badgeFn`, like the usual options. Blank and repeated values are dropped.\n */\n private _listAllOptions(def: BulkActionDef): { value: string; label: string }[] {\n const col = this.columns().find(c => c.key === def.field);\n const label = (value: string) => (col?.badgeFn ? (col.badgeFn(value, null)?.label || value) : value);\n const values = Array.isArray(def.listAll)\n ? [...def.listAll]\n : [...this._getOptionsForField(def.field!).map(o => o.value), ...Object.keys(def.allowedFrom ?? {})];\n return [...new Set(values.filter(v => typeof v === 'string' && v.trim() !== ''))].map(value => ({ value, label: label(value) }));\n }\n\n /** The loaded-page rows the user has selected. */\n private _selectedRows(): T[] {\n return (this._items() as T[]).filter(i => this._selectedIds().has((i as any)['id']));\n }\n\n /** The `canApply` verdict of a bulk change for the whole selection: allowed, or the reason it is refused (a throwing rule refuses). */\n private _applyVerdict(def: BulkActionDef, target: string, rows: T[], optionLabel: string): { ok: true } | { ok: false; reason: string } {\n if (!def.canApply) return { ok: true };\n let verdict: unknown;\n try { verdict = def.canApply([...rows], target); } catch { verdict = false; }\n if (verdict === true) return { ok: true };\n return { ok: false, reason: typeof verdict === 'string' && verdict.trim() !== '' ? verdict.trim() : this.labels.t('dataTable.bulkCannotApply', { option: optionLabel }) };\n }\n\n /** True when a row whose field currently holds `current` may be moved to `target` by this action. */\n private _canBulkMove(def: BulkActionDef, current: unknown, target: string, row?: unknown): boolean {\n const cur = String(current ?? '');\n if (cur === String(target)) return false; // already there\n if (def.allowedFrom && !def.allowedFrom[target]?.includes(cur)) return false; // workflow: no entry = not selectable\n return !def.canChange || row === undefined || def.canChange(row as T, String(target)); // the page's per-row rule\n }\n\n /** True when `value` is in the action's `exclude` list (ignoring case, spaces, dashes and underscores). */\n private _isBulkExcluded(def: BulkActionDef, value: string): boolean {\n if (!def.exclude?.length) return false;\n const norm = (v: string) => String(v).toLowerCase().replace(/[^a-z0-9]/g, '');\n const target = norm(value);\n return def.exclude.some(x => norm(x) === target);\n }\n\n /** Which bulk action is currently showing its inline select (null = show action buttons). */\n protected readonly _activeBulkType = signal<string | null>(null);\n /** True while the Apply (field change) HTTP call is in flight. */\n protected readonly _applyingBulk = signal(false);\n /** True while the bulk Delete HTTP call is in flight. */\n protected readonly _deletingBulk = signal(false);\n protected readonly _activeBulkDef = computed(() => {\n const t = this._activeBulkType();\n return t ? (this._bulkDefs().find(d => d.type === t) ?? null) : null;\n });\n\n /** Bound to the inline ui-select via ngModel. Plain property — signal change triggers re-render. */\n protected _bulkSelectStr = '';\n\n /** Options for the active bulk action's inline select, filtered to exclude no-ops. */\n protected readonly _eligibleBulkOptions = computed((): { value: string; label: string; disabled?: boolean }[] => {\n const def = this._activeBulkDef();\n if (!def?.field) return [];\n const allOpts = this._bulkOptionsFor(def);\n const selected = this._items().filter(i => this._selectedIds().has(i['id']));\n const eligible = getEligibleOptions(allOpts, selected, def.field as keyof T);\n const reachable = !def.allowedFrom && !def.canChange\n ? eligible\n // Workflow / per-row rule: offer only targets at least one selected row can legally move to.\n : eligible.filter(o => selected.some(i => this._canBulkMove(def, i[def.field!], o.value, i)));\n if (!def.canApply) return reachable;\n // Whole-selection rule: a refused target stays listed but cannot be picked (its reason is shown beside the select).\n return reachable.map(o => this._applyVerdict(def, o.value, selected as T[], o.label).ok ? o : { ...o, disabled: true });\n });\n\n /** Id prefix of the reason hints beside the inline select (the select is linked to them with aria-describedby). */\n protected readonly _bulkHintId = `dt-bulk-hint-${Math.random().toString(36).slice(2, 8)}`;\n /** Space-separated ids of the reason hints, for the select's `aria-describedby` ('' = none, no attribute). */\n protected readonly _bulkOptionHintIds = computed((): string => this._bulkOptionHints().map((_, i) => `${this._bulkHintId}-${i}`).join(' '));\n\n /** \"<option>: <reason>\" for each target the whole-selection rule (`canApply`) refuses right now; shown as visible text beside the inline select. */\n protected readonly _bulkOptionHints = computed((): string[] => {\n const def = this._activeBulkDef();\n if (!def?.canApply) return [];\n const selected = this._items().filter(i => this._selectedIds().has(i['id'])) as T[];\n return this._eligibleBulkOptions().filter(o => o.disabled).flatMap(o => {\n const verdict = this._applyVerdict(def, o.value, selected, o.label);\n return verdict.ok ? [] : [this.labels.t('dataTable.bulkOptionBlocked', { option: o.label, reason: verdict.reason })];\n });\n });\n\n protected readonly _allSelected = computed(() => {\n const items = this._items();\n const sel = this._selectedIds();\n return items.length > 0 && items.every(item => sel.has(item['id']));\n });\n\n protected readonly _someSelected = computed(() =>\n this._selectedIds().size > 0 && !this._allSelected(),\n );\n\n /**\n * The row's human name for assistive tech: the locked column's value (or the first avatar-name / text column),\n * through the column's own `nameFn` / `render` so it reads exactly like the cell. '' when there is none.\n */\n protected rowName(item: T): string {\n const cols = this.columns();\n const locked = this.lockedColumn();\n const col = (locked ? cols.find(c => c.key === locked) : undefined)\n ?? cols.find(c => c.cellType === 'avatar-name')\n ?? cols.find(c => !c.cellType || c.cellType === 'text');\n if (!col) return '';\n const raw = col.nameFn ? col.nameFn(item) : col.render ? col.render(item) : (item as Record<string, unknown>)[col.key];\n return raw == null ? '' : String(raw).trim();\n }\n\n /**\n * Rows of the loaded page whose name repeats get a position suffix (\" (1 of 2)\", \" (2 of 2)\"), so a screen-reader user never hears two rows\n * announced identically (\"Select Jane Cooper\" twice). Names that are unique on the page — and rows with no name — are left exactly as they are.\n */\n private readonly _rowNameSuffix = computed(() => {\n const items = this._items();\n const names = items.map(item => this.rowName(item));\n const total = new Map<string, number>();\n for (const n of names) if (n) total.set(n, (total.get(n) ?? 0) + 1);\n const seen = new Map<string, number>();\n const out = new Map<unknown, string>();\n items.forEach((item, index) => {\n const n = names[index];\n if (!n || (total.get(n) ?? 0) < 2) return;\n const k = (seen.get(n) ?? 0) + 1;\n seen.set(n, k);\n out.set(item, ' ' + this.labels.t('dataTable.rowPosition', { k, total: total.get(n) ?? 0 }));\n });\n return out;\n });\n\n /** A row's accessible name: its name, plus the position among rows of the same name when that name repeats on the page. */\n protected rowAccessibleName(item: T): string {\n const name = this.rowName(item);\n return name ? `${name}${this._rowNameSuffix().get(item) ?? ''}` : '';\n }\n\n /** \"Select Acme Electric\" — a row's selection checkbox name (\"Select Acme Electric (2 of 3)\" when the name repeats on the page). */\n protected selectRowLabel(item: T): string {\n const name = this.rowAccessibleName(item);\n return name ? this.labels.t('dataTable.selectRowNamed', { name }) : this.labels.t('dataTable.selectRow');\n }\n\n /**\n * \"Row actions for Acme Electric\" — a row's actions-menu trigger name. It still contains the generic \"Row actions\"\n * text, so lookups by that accessible name (substring) keep finding the button, while a screen-reader user now\n * hears which row it belongs to (\"Row actions for Acme Electric (2 of 3)\" when the name repeats on the page).\n */\n protected rowActionsLabel(item: T): string {\n const name = this.rowAccessibleName(item);\n return name ? this.labels.t('dataTable.rowActionsNamed', { name }) : this.labels.t('dataTable.rowActions');\n }\n\n protected toggleSelectAll(): void {\n if (!this._isSelectable()) return; // read-only users can never select rows\n const next = this._allSelected()\n ? new Set<string>()\n : new Set(this._items().map(item => item['id'] as string));\n this._selectedIds.set(next);\n this.selectionChange.emit(new Set(next));\n }\n\n protected toggleRow(item: T): void {\n if (!this._isSelectable()) return; // read-only users can never select rows\n const current = new Set(this._selectedIds());\n const id = item['id'] as string;\n if (current.has(id)) { current.delete(id); } else { current.add(id); }\n this._selectedIds.set(current);\n this.selectionChange.emit(new Set(current));\n }\n\n /**\n * The table's current query as the parameters it sends with Export: the host `params`, the lower-cased `search` (+ `searchFields`),\n * the active quick tab as `filter`, `sort` + `direction`, and every active column filter (multi-values comma-joined). A new copy\n * on every call; reading it changes nothing. A host uses it to act on exactly what the table shows (print the same rows, call a\n * report endpoint with the same search / filters) without keeping its own copy of that state. Paging is not included.\n */\n currentQuery(): Record<string, string> {\n return { ...this._exportParams() };\n }\n\n /** Clears the selection — call from the host component after a bulk action completes. */\n clearSelection(): void {\n this._selectedIds.set(new Set());\n this._activeBulkType.set(null);\n this.selectionChange.emit(new Set());\n }\n\n resetColumns(): void {\n this._visibleColumns.set([]);\n }\n\n /**\n * Host-written confirm copy for a bulk action (null = use the default wording). `skippedNote` is the library's standard\n * skipped-rows sentence, appended on a new paragraph unless the copy sets `omitSkippedNote`.\n */\n private _hostConfirm(def: BulkActionDef, ctx: BulkConfirmContext<T>, skippedNote: string,\n fallback: { title: string; confirmLabel: string; variant: 'primary' | 'danger' | 'warning' }) {\n // A direct action has no target value: only the function form applies (a map falls back to the default copy).\n const fn = typeof def.confirm === 'function' ? def.confirm : def.action ? undefined : def.confirm?.[ctx.targetValue];\n if (!fn) return null;\n const out = fn(ctx);\n const copy: BulkConfirmCopy = typeof out === 'string' ? { message: out } : out;\n const note = copy.omitSkippedNote ? '' : skippedNote.trim();\n return {\n title: copy.title ?? fallback.title,\n message: note ? `${copy.message}\\n\\n${note}` : copy.message,\n confirmLabel: copy.confirmLabel ?? fallback.confirmLabel,\n variant: copy.variant ?? fallback.variant,\n ...(copy.details?.length ? { details: copy.details } : {}),\n };\n }\n\n /**\n * The host's reasons for the rows a field change skips (`{ field, skipReason }`): one `{ row, reason }` per skipped row that cannot move to the target and got a non-empty reason.\n * A row that already holds the value is not asked. A callback that throws, or a non-string / blank answer, gives no reason; the text is single-lined and capped at 300 characters.\n */\n private _skipReasonsFor(def: BulkActionDef, skippedRows: T[], target: string): { row: T; reason: string }[] {\n const fn = def.skipReason;\n if (!fn || !def.field) return [];\n const out: { row: T; reason: string }[] = [];\n for (const row of skippedRows) {\n if (String((row as any)[def.field] ?? '') === target) continue;\n let raw: unknown = null;\n try { raw = fn(row, target); } catch { raw = null; }\n const reason = typeof raw === 'string' ? raw.replace(/\\s+/g, ' ').trim().slice(0, 300) : '';\n if (reason) out.push({ row, reason });\n }\n return out;\n }\n\n /** The confirm bullets for the skip reasons: one line per distinct reason in first-seen order, \"<reason> (<rows>)\". */\n private _skipReasonLines(reasons: { reason: string }[]): string[] {\n const counts = new Map<string, number>();\n for (const r of reasons) counts.set(r.reason, (counts.get(r.reason) ?? 0) + 1);\n return [...counts].map(([reason, n]) => `${reason} (${n})`);\n }\n\n /** Why a bulk action can't be used right now ('' = it can). Only Delete with `deletable` and a direct action with `eligible` can be blocked. */\n protected _bulkBlockedReason(def: BulkActionDef): string {\n if (def.action) {\n // A panel action that cannot be used is not shown at all (see _bulkHidden), so it never reaches this reason.\n if (def.opensPanel) return '';\n return def.eligible && this._actionSplit(def).eligible.length === 0\n ? this.labels.t('dataTable.noneQualify', { action: def.label.toLowerCase() }) : '';\n }\n if (def.type !== 'delete' || !def.deletable) return '';\n return this._deleteSplit(def).deletable.length === 0 ? this.labels.t('dataTable.noneDeletable') : '';\n }\n\n /** A panel action is not shown while the host says it is unavailable or no selected row is eligible. Everything else is always shown. */\n protected _bulkHidden(def: BulkActionDef): boolean {\n if (!def.opensPanel) return false;\n let hide = false;\n try { hide = !!def.hidden?.(); } catch { hide = false; }\n return hide || (!!def.eligible && this._actionSplit(def).eligible.length === 0);\n }\n\n /** The distinct reasons of the currently blocked bulk actions, shown as visible text next to the disabled buttons. */\n protected _bulkBlockedHints(): string[] {\n return [...new Set(this._bulkDefs().map(d => this._bulkBlockedReason(d)).filter(r => !!r))];\n }\n\n /** Selected rows (loaded page) split by the delete option's `deletable` predicate; without it every selected row is deletable. */\n private _deleteSplit(def: BulkActionDef): { deletable: T[]; blocked: T[] } {\n const selected = (this._items() as T[]).filter(i => this._selectedIds().has((i as any)['id']));\n if (!def.deletable) return { deletable: selected, blocked: [] };\n return { deletable: selected.filter(r => def.deletable!(r)), blocked: selected.filter(r => !def.deletable!(r)) };\n }\n\n /** Selected rows (loaded page) split by a direct action's `eligible` predicate; without it every selected row is eligible. */\n private _actionSplit(def: BulkActionDef): { eligible: T[]; refused: T[] } {\n const selected = (this._items() as T[]).filter(i => this._selectedIds().has((i as any)['id']));\n if (!def.eligible) return { eligible: selected, refused: [] };\n const ok = selected.map(r => this._isActionEligible(def, r));\n return { eligible: selected.filter((_, i) => ok[i]), refused: selected.filter((_, i) => !ok[i]) };\n }\n\n /** Type of the direct bulk action whose request is in flight (null = none). */\n protected readonly _runningAction = signal<string | null>(null);\n /** True while a direct action's confirm dialog is open (guards against a second click). */\n private _confirmingAction = false;\n\n /** Panel action: no confirm and no request; hands the eligible rows to the host, which opens its own panel. */\n private _openBulkPanel(def: BulkActionDef): void {\n if (this._runningAction() || this._deletingBulk() || this._bulkHidden(def)) return;\n const split = this._actionSplit(def);\n if (split.eligible.length === 0) return;\n this.bulkPanelClick.emit({\n type: def.type, key: def.type.slice('action-'.length), ids: split.eligible.map(r => (r as any)['id'] as string),\n rows: split.eligible, skippedCount: split.refused.length,\n });\n }\n\n /** Direct bulk action: confirm, then POST `<endpoint>/bulk/<key>` with `{ ids }` of the eligible rows. */\n private async _runDirectAction(def: BulkActionDef): Promise<void> {\n if (this._confirmingAction || this._runningAction()) return;\n const split = this._actionSplit(def);\n // Nothing the server would accept: no confirm, no request.\n if (split.eligible.length === 0) return;\n const ids = split.eligible.map(r => (r as any)['id'] as string);\n const skippedCount = split.refused.length;\n const lower = def.label.toLowerCase();\n const skippedNote = skippedCount === 0 ? '' : ' ' + this._plural('dataTable.skipNotQualify', skippedCount, { action: lower });\n const variant = def.variant === 'danger' ? 'danger' as const : 'primary' as const;\n this._confirmingAction = true;\n let confirmed = false;\n try {\n const defaultCopy = {\n title: def.label,\n message: this.labels.t('dataTable.actionConfirm', { action: def.label, count: ids.length, item: this._countLabel(ids.length) }) + skippedNote,\n confirmLabel: def.label,\n variant,\n };\n const hostCopy = def.confirm\n ? this._hostConfirm(def, {\n count: ids.length, skippedAlready: 0, skippedBlocked: skippedCount, selectedCount: this._selectedIds().size,\n itemLabel: this._itemWord(), itemLabelPlural: this._itemsWord(),\n columnLabel: def.label, targetValue: '', targetLabel: '', rows: split.eligible, skippedRows: split.refused, skippedReasons: [],\n }, skippedNote, { title: defaultCopy.title, confirmLabel: defaultCopy.confirmLabel, variant })\n : null;\n confirmed = await this._confirmSvc.confirm(hostCopy ?? defaultCopy);\n } catch {\n // A failing confirm service must neither leave the guard stuck nor send anything.\n confirmed = false;\n } finally {\n this._confirmingAction = false;\n }\n if (!confirmed) return;\n this._runningAction.set(def.type);\n const done = def.doneLabel?.trim() || this.labels.t('dataTable.doneUpdated');\n const url = `${this.config.baseUrl}${this.endpoint()}/bulk/${def.type.slice('action-'.length)}`;\n if (def.download) { this._runDownloadAction(def, url, ids, skippedCount); return; }\n this.http.post<any>(url, { ids })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (r: any) => {\n this._runningAction.set(null);\n // An empty body (204 / null) means the backend handled everything it was sent.\n const count = r == null ? ids.length : (r.updated ?? r.deleted ?? 0);\n const totalSkipped = skippedCount + (r?.skipped ?? 0);\n const notAllowed = r?.notAllowed ?? 0;\n const busy = this._busyOf(r);\n const msg = this._resultSummary(count, done, totalSkipped, notAllowed, busy);\n this._toastBulkResult(msg, this._bulkServerMessage(r), count, busy);\n const keep = this._allBusy(count, busy, r?.skipped ?? 0, notAllowed);\n if (!keep) { this.clearSelection(); this.refresh(); }\n this.bulkAction.emit({ type: def.type, ids, skippedCount, ...(busy > 0 ? { busyCount: busy } : {}) });\n },\n error: (err: any) => {\n this._runningAction.set(null);\n this._toast.error(this._actionError(err));\n },\n });\n }\n\n /** Direct action that returns a file: POST `{ ids }` asking for a blob, save it as one download, toast, clear the selection. */\n private _runDownloadAction(def: BulkActionDef, url: string, ids: string[], skippedCount: number): void {\n const key = def.type.slice('action-'.length);\n const done = def.doneLabel?.trim() || this.labels.t('dataTable.doneDownloaded');\n this.http.post(url, { ids }, { responseType: 'blob', observe: 'response' })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (res) => {\n this._runningAction.set(null);\n if (!res.body) { this._toast.error(this.labels.t('dataTable.genericError')); return; }\n downloadBlob(res.body, fileNameFromContentDisposition(res.headers.get('Content-Disposition')) || def.download?.fileName?.trim() || key);\n const serverSkipped = Math.max(0, Number(res.headers.get('X-Skipped-Count')) || 0);\n // `X-Busy-Count`: rows another save held at that moment (left out of the file, retry later); not part of the skipped count.\n const busy = Math.max(0, Math.floor(Number(res.headers.get('X-Busy-Count')) || 0));\n const count = Math.max(0, ids.length - serverSkipped - busy);\n const totalSkipped = skippedCount + serverSkipped;\n if (busy > 0) this._toast.show(this._resultSummary(count, done, totalSkipped, 0, busy));\n else this._toast.show(totalSkipped > 0 ? this.labels.t('dataTable.summaryDownloadSkipped', { count, done, skipped: totalSkipped }) : this._summaryAll(count, done));\n this.clearSelection();\n this.bulkAction.emit({ type: def.type, ids, skippedCount, ...(busy > 0 ? { busyCount: busy } : {}) });\n },\n error: (err: any) => {\n this._runningAction.set(null);\n void this._downloadErrorMessage(err).then(message => this._toast.error(message));\n },\n });\n }\n\n /**\n * The wording of a failed file request. With a blob response the error body arrives as a Blob, so it is parsed first (JSON `{ message, code, ... }`) and the host's `errorTextFn` gets the SAME shape as for any other failed request\n * (`err.error.code`, `err.error.message`, ...): an `HttpErrorResponse` carrying the parsed object (the offline layer's plain errors keep their shape with `error` replaced). A body that is not JSON is passed as it came (a Blob).\n */\n private async _downloadErrorMessage(err: any): Promise<string> {\n const plain = await this._parsedBlobError(err);\n const host = this._hostErrorText(plain);\n if (host) return host;\n const message = plain !== err ? plain?.error?.message : null;\n if (typeof message === 'string' && message.trim()) return message;\n return actionErrorText(plain, k => this.labels.t(k));\n }\n\n /** The error with its Blob body replaced by the parsed JSON object (same error when the body is no Blob or no JSON object). */\n private async _parsedBlobError(err: any): Promise<any> {\n const body = err?.error;\n if (!(body instanceof Blob)) return err;\n let json: unknown;\n try { json = JSON.parse(await body.text()); } catch { return err; }\n if (json === null || typeof json !== 'object' || Array.isArray(json)) return err;\n return err instanceof HttpErrorResponse\n ? new HttpErrorResponse({ error: json, headers: err.headers, status: err.status, statusText: err.statusText, url: err.url ?? undefined })\n : { ...err, error: json };\n }\n\n /** Called when the user clicks a bulk action button in the selection bar. */\n protected onBulkActionClick(def: BulkActionDef): void {\n if (def.action && def.opensPanel) { this._openBulkPanel(def); return; }\n if (def.action) { void this._runDirectAction(def); return; }\n if (def.type === 'delete') {\n const split = this._deleteSplit(def);\n // Nothing the server would accept: no confirm, no request.\n if (def.deletable && split.deletable.length === 0) return;\n const selectedCount = this._selectedIds().size;\n const count = def.deletable ? split.deletable.length : selectedCount;\n const blockedCount = split.blocked.length;\n const skippedNote = blockedCount === 0 ? '' : ' ' + this._plural('dataTable.skipCantDelete', blockedCount);\n const deleteDefault = {\n title: this._deleteTitle(),\n message: this.labels.t('dataTable.deleteBulkConfirm', { count, item: this._countLabel(count) }) + skippedNote,\n confirmLabel: this.labels.t('dataTable.delete'),\n variant: 'danger' as const,\n };\n const hostCopy = def.confirm\n ? this._hostConfirm(def, {\n count, skippedAlready: 0, skippedBlocked: blockedCount, selectedCount,\n itemLabel: this._itemWord(), itemLabelPlural: this._itemsWord(),\n columnLabel: this.labels.t('dataTable.delete'), targetValue: '', targetLabel: '', rows: split.deletable, skippedRows: split.blocked, skippedReasons: [],\n }, skippedNote, { title: deleteDefault.title, confirmLabel: deleteDefault.confirmLabel, variant: 'danger' })\n : null;\n this._confirmSvc.confirm(hostCopy ?? deleteDefault).then(confirmed => {\n if (!confirmed) return;\n const { eligibleIds, skippedCount } = this._getEligible('delete', undefined, def);\n this._deletingBulk.set(true);\n const url = `${this.config.baseUrl}${this.endpoint()}/bulk/delete`;\n this.http.post<any>(url, { ids: eligibleIds })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (r: any) => {\n this._deletingBulk.set(false);\n // Rows the backend refused to delete (e.g. not in a deletable status) come back as `skipped`.\n // An empty body (204 / null) means the backend deleted everything it was sent.\n const deleted = r == null ? eligibleIds.length : (r.deleted ?? 0);\n const skipped = skippedCount + (r?.skipped ?? 0);\n // Rows the user isn't permitted to change come back as `notAllowed` — report them, don't hide them.\n const notAllowed = r?.notAllowed ?? 0;\n const busy = this._busyOf(r);\n const generated = this._resultSummary(deleted, this.labels.t('dataTable.doneDeleted'), skipped, notAllowed, busy);\n // A readable server `message` explains why rows were left out; nothing deleted → shown as an error (busy rows = a retry warning).\n this._toastBulkResult(generated, this._bulkServerMessage(r), deleted, busy);\n if (!this._allBusy(deleted, busy, r?.skipped ?? 0, notAllowed)) { this.clearSelection(); this.refresh(); }\n this.bulkAction.emit({ type: 'delete', ids: eligibleIds, skippedCount, ...(busy > 0 ? { busyCount: busy } : {}) });\n },\n error: (err: any) => {\n this._deletingBulk.set(false);\n this._toast.error(this._actionError(err));\n },\n });\n });\n return;\n }\n if (def.field) {\n // Field-based action: show inline select with eligible options pre-selected\n this._activeBulkType.set(def.type);\n const opts = this._eligibleBulkOptions();\n this._bulkSelectStr = opts.find(o => !o.disabled)?.value ?? '';\n }\n }\n\n /** True while the field-change confirmation dialog is open (guards against a second Apply click). */\n private _confirmingBulk = false;\n\n /**\n * Applies the inline-selected value for the active field-based bulk action.\n * Asks the user to confirm first (library confirm dialog, same as bulk Delete); the request is only sent on confirm.\n * Cancel / Escape / backdrop leave the selection and the inline select untouched.\n */\n protected async applyBulkAction(): Promise<void> {\n const def = this._activeBulkDef();\n if (!def || !this._bulkSelectStr || !def.field) return;\n if (this._confirmingBulk || this._applyingBulk()) return;\n // An excluded value (e.g. set programmatically) is never sent.\n if (this._isBulkExcluded(def, this._bulkSelectStr)) return;\n const selectedValue = this._bulkSelectStr;\n const optionLabel = this._bulkOptionsFor(def).find(o => o.value === selectedValue)?.label ?? selectedValue;\n // The whole-selection rule: a refused target is never confirmed or sent (the selection may have changed since the select was filled).\n const verdict = this._applyVerdict(def, selectedValue, this._selectedRows(), optionLabel);\n if (!verdict.ok) { this._toast.error(verdict.reason); return; }\n const { eligibleIds, skippedCount } = this._getEligible(def.type, selectedValue, def);\n // How many skipped rows already hold the value (the rest can't legally move to it).\n const selectedRows = (this._items() as any[]).filter(i => this._selectedIds().has(i.id));\n const alreadyCount = selectedRows.filter(i => String(i[def.field!] ?? '') === selectedValue).length;\n const blockedCount = skippedCount - alreadyCount;\n // Nothing can change — nothing to send, nothing to confirm.\n if (eligibleIds.length === 0) {\n this._toast.show(blockedCount > 0\n ? this.labels.t('dataTable.noChangesBlocked', { option: optionLabel })\n : this.labels.t('dataTable.noChangesAlready', { item: this._countLabel(skippedCount), option: optionLabel }));\n this._activeBulkType.set(null);\n return;\n }\n const columnLabel = this.columns().find(c => c.key === def.field)?.label ?? def.field;\n // \"already has this value\" only when that is true of every skipped row; otherwise the generic wording.\n const skippedNote = skippedCount === 0 ? ''\n : ' ' + (blockedCount > 0\n ? this._plural('dataTable.skipCantChange', skippedCount, { option: optionLabel })\n : this._plural('dataTable.skipAlreadyHas', skippedCount));\n this._confirmingBulk = true;\n let confirmed = false;\n try {\n const defaultCopy = {\n title: def.label,\n message: (def.customLabel\n ? this.labels.t('dataTable.bulkCustomConfirm', { label: def.label, option: optionLabel, count: eligibleIds.length, item: this._countLabel(eligibleIds.length) })\n : this.labels.t('dataTable.bulkChangeConfirm', { column: String(columnLabel), option: optionLabel, count: eligibleIds.length, item: this._countLabel(eligibleIds.length) })) + skippedNote,\n confirmLabel: def.label,\n variant: 'primary' as const,\n };\n const eligibleSet = new Set(eligibleIds);\n const skippedRows = selectedRows.filter(i => !eligibleSet.has(i.id)) as T[];\n const skippedReasons = this._skipReasonsFor(def, skippedRows, selectedValue);\n const reasonLines = this._skipReasonLines(skippedReasons);\n const hostCopy = def.confirm\n ? this._hostConfirm(def, {\n count: eligibleIds.length, skippedAlready: alreadyCount, skippedBlocked: blockedCount,\n selectedCount: this._selectedIds().size,\n itemLabel: this._itemWord(), itemLabelPlural: this._itemsWord(),\n columnLabel: columnLabel as string, targetValue: selectedValue, targetLabel: optionLabel,\n rows: selectedRows.filter(i => eligibleSet.has(i.id)) as T[],\n skippedRows, skippedReasons,\n }, skippedNote, { title: defaultCopy.title, confirmLabel: defaultCopy.confirmLabel, variant: 'primary' })\n : null;\n // The skip reasons are listed under the message after the host's own details (host copy) or alone (default copy).\n const shown = hostCopy ? { ...hostCopy, ...(reasonLines.length ? { details: [...(hostCopy.details ?? []), ...reasonLines] } : {}) }\n : { ...defaultCopy, ...(reasonLines.length ? { details: reasonLines } : {}) };\n confirmed = await this._confirmSvc.confirm(shown);\n } catch {\n // A failing confirm service must neither leave the guard stuck nor send anything.\n confirmed = false;\n } finally {\n this._confirmingBulk = false;\n }\n if (!confirmed) return;\n this._applyingBulk.set(true);\n const url = `${this.config.baseUrl}${this.endpoint()}/bulk/${def.field}`;\n this.http.post<any>(url, { ids: eligibleIds, [def.field]: selectedValue })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (r: any) => {\n this._applyingBulk.set(false);\n // An empty body (204 / null) means the backend updated everything it was sent.\n const count = r == null ? eligibleIds.length : (r.updated ?? r.deleted ?? 0);\n // Rows the table left out plus rows the backend skipped (e.g. changed elsewhere since the page loaded).\n const totalSkipped = skippedCount + (r?.skipped ?? 0);\n // Rows the user isn't permitted to change come back as `notAllowed` — report them, don't hide them.\n const notAllowed = r?.notAllowed ?? 0;\n const busy = this._busyOf(r);\n const msg = this._resultSummary(count, this.labels.t('dataTable.doneUpdated'), totalSkipped, notAllowed, busy);\n this._toastBulkResult(msg, this._bulkServerMessage(r), count, busy);\n // Every sent row was busy: keep the selection and the open select (nothing changed, retry with the same Apply); otherwise the usual clear + refresh.\n if (!this._allBusy(count, busy, r?.skipped ?? 0, notAllowed)) { this._activeBulkType.set(null); this.clearSelection(); this.refresh(); }\n this.bulkAction.emit({ type: def.type, ids: eligibleIds, value: selectedValue, skippedCount, ...(busy > 0 ? { busyCount: busy } : {}) });\n },\n error: (err: any) => {\n this._applyingBulk.set(false);\n this._toast.error(this._actionError(err));\n },\n });\n }\n\n /**\n * Returns the eligible IDs and skipped count for a bulk action.\n * - 'delete' — all selected are eligible\n * - 'change-{field}' — skip rows already at targetValue\n * - anything else — all selected are eligible\n */\n private _getEligible(action: string, targetValue?: string, def?: BulkActionDef): { eligibleIds: string[]; skippedCount: number } {\n const selected = (this._items() as any[]).filter(i => this._selectedIds().has(i.id));\n if (action === 'delete') {\n if (def?.deletable) {\n const ok = selected.filter(i => def.deletable!(i));\n return { eligibleIds: ok.map(i => i.id), skippedCount: selected.length - ok.length };\n }\n return { eligibleIds: selected.map(i => i.id), skippedCount: 0 };\n }\n if (action.startsWith('change-') && targetValue !== undefined) {\n const field = action.slice(7);\n const eligible = selected.filter(item => def\n ? this._canBulkMove(def, (item as any)[field], targetValue, item)\n : String((item as any)[field] ?? '') !== String(targetValue));\n return { eligibleIds: eligible.map(i => i.id), skippedCount: selected.length - eligible.length };\n }\n return { eligibleIds: selected.map(i => i.id), skippedCount: 0 };\n }\n\n /**\n * Derives the available options for a given field from the table's existing config —\n * no extra inputs or API calls needed.\n * Priority: filterCounts → distinct item values.\n */\n private _getOptionsForField(field: string): { value: string; label: string }[] {\n // 0. Explicit bulk options declared on the column (only user-settable values)\n const declared = this.columns().find(c => c.key === field);\n if (declared?.bulkOptions?.length) {\n return declared.bulkOptions.map(value => ({\n value,\n label: declared.badgeFn ? (declared.badgeFn(value, null)?.label || value) : value,\n }));\n }\n\n // 1. Already-fetched filter counts (from /filter-counts endpoint)\n // Bulk `field` is the row field (column key); the counts are keyed by the column's filter wire name.\n const colCounts = this._filterCounts()[declared ? this._filterName(declared) : field];\n if (colCounts) {\n const col = declared;\n return Object.keys(colCounts).map(value => ({\n value,\n label: col?.badgeFn ? (col.badgeFn(value, null)?.label || value) : value,\n }));\n }\n\n // 4. Distinct values from current page items\n const col = this.columns().find(c => c.key === field);\n const distinct = [...new Set(this._items().map(i => String(i[field] ?? '')).filter(Boolean))];\n return distinct.map(value => ({\n value,\n label: col?.badgeFn ? (col.badgeFn(value, null)?.label || value) : value,\n }));\n }\n\n /** State for the built-in single-row delete confirmation modal. */\n protected readonly _rowDeleteTarget = signal<T | null>(null);\n protected readonly _rowDeleting = signal(false);\n /** Ids the built-in delete confirm dialog is described by (aria-describedby): its message and the \"what will happen\" list. */\n private readonly _confirmUid = Math.random().toString(36).slice(2, 8);\n protected readonly _confirmMsgId = `dt-confirm-msg-${this._confirmUid}`;\n protected readonly _confirmDetailsId = `dt-confirm-details-${this._confirmUid}`;\n protected readonly _rowDeleteConfig = signal<{ title: string; message: string; confirmLabel: string; details?: string[]; variant?: 'danger' | 'primary' | 'warning' }>({\n title: this.labels.t('dataTable.delete'), message: this.labels.t('dataTable.deleteConfirm'), confirmLabel: this.labels.t('dataTable.delete'),\n });\n\n protected _confirmRowDelete(): void {\n // A confirm that was already open when edit rights ended (the central read-only switch turned on, or the permission dropped) sends nothing and closes.\n if (!this._canEdit()) { this._rowDeleteTarget.set(null); return; }\n const item = this._rowDeleteTarget();\n if (!item || this._rowDeleting()) return;\n this._rowDeleting.set(true);\n this.http.post<{ deleted?: number; skipped?: number; busy?: number; message?: string; skippedReason?: string } | null>(\n `${this.config.baseUrl}${this.endpoint()}/bulk/delete`,\n { ids: [item['id']] },\n ).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (r) => {\n this._rowDeleting.set(false);\n this._rowDeleteTarget.set(null);\n // The backend refused (not deletable / changed elsewhere) or the row is already gone: `deleted: 0`.\n // A response without a count (e.g. 204) is treated as success.\n if (r?.deleted === 0) {\n const busy = this._busyOf(r);\n if (busy > 0) {\n // Another save held the row: nothing was deleted, try again (not \"changed or already removed\").\n const serverBusyMsg = this._bulkServerMessage(r);\n const busyText = this._resultSummary(0, '', 0, 0, busy);\n this._toast.warning(serverBusyMsg ? `${busyText} ${serverBusyMsg}` : busyText);\n this.refresh();\n return;\n }\n this._toast.error(this._bulkServerMessage(r) || this.labels.t('dataTable.rowNotDeleted', { item: this._itemWord() }));\n this.refresh();\n return;\n }\n // A readable server `message` / `skippedReason` on a successful delete (e.g. a note about what was left alone) follows the standard toast.\n const rowMsg = this._bulkServerMessage(r);\n const rowDone = this.labels.t('dataTable.rowDeleted', { item: this._itemWord() });\n this._toast.show(rowMsg ? `${rowDone} ${rowMsg}` : rowDone);\n this.refresh();\n this.rowDeleted.emit(item);\n },\n error: (err: any) => {\n this._rowDeleting.set(false);\n this._toast.error(this._hostErrorText(err) ?? err?.error?.message ?? this.labels.t('dataTable.deleteFailed'));\n },\n });\n }\n\n private readonly triggerLoad$ = new Subject<void>();\n\n /** Phone viewport (≤640px, same breakpoint as the card-view CSS) — renders the card list instead of the table. */\n protected readonly _isPhone = signal(false);\n\n constructor() {\n // Render ONE tree (table or cards) per viewport so row menus/checkboxes/renderers don't run twice.\n if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {\n const mq = window.matchMedia('(max-width: 640px)');\n this._isPhone.set(mq.matches);\n const onChange = (e: MediaQueryListEvent) => this._isPhone.set(e.matches);\n mq.addEventListener('change', onChange);\n this.destroyRef.onDestroy(() => mq.removeEventListener('change', onChange));\n }\n\n // Losing edit permission (e.g. switching to read-only) drops any selection — read-only users never\n // have selected rows, and the host is told via selectionChange.\n effect(() => {\n if (this._canEdit()) return;\n untracked(() => {\n if (this._selectedIds().size > 0 || this._activeBulkType()) this.clearSelection();\n this._rowDeleteTarget.set(null); // an open \"delete this row?\" confirm goes with the rights it was opened under\n });\n });\n\n // Host `params` changed (e.g. a new period) → page 1 + full refresh. The first run only records the\n // initial value — ngOnInit does the initial load.\n let paramsSeen = false;\n effect(() => {\n this._extraParams();\n if (!paramsSeen) { paramsSeen = true; return; }\n untracked(() => this.resetToFirstPage());\n });\n\n // HTTP pipeline\n this.triggerLoad$.pipe(\n switchMap(() => {\n // A silent refresh (background poll) keeps the rows on screen instead of swapping in skeleton rows.\n const silentLoad = this._silentNext;\n if (!silentLoad) this._loading.set(true);\n this._silentNext = false;\n this._searchLoading.set(this._searchPending);\n this._searchPending = false;\n this._error.set(null);\n if (this._totalsSkipNext) this._totalsSkipNext = false;\n else this._fetchTotals(silentLoad);\n\n let params = tableQueryParams(this._extraParams())\n .set('page', this._page() - 1)\n .set('size', this.pageSize());\n\n if (this._search()) {\n params = params.set('search', this._searchParam());\n const searchFields = this._searchFields();\n if (searchFields) params = params.set('searchFields', searchFields);\n }\n if (this._sortField()) {\n params = params.set('sort', this._sortField()!).set('direction', this._sortDir());\n }\n if (this._activeTab()) params = params.set('filter', this._activeTab());\n const cf = this._colFilterValues();\n for (const [key, vals] of Object.entries(cf)) {\n if (vals.length > 0) params = params.set(key, encodeFilterValues(vals));\n }\n for (const [key, val] of Object.entries(this._rangeParams())) params = params.set(key, val);\n\n return this.http.get<any>(`${this.config.baseUrl}${this.endpoint()}`, { params }).pipe(\n catchError((err: unknown) => {\n this._error.set(this._hostErrorText(err) ?? this.labels.t(loadErrorKey(err), { items: this._itemsWord() }));\n this._loadFailed.set(true);\n return of(null);\n }),\n );\n }),\n takeUntilDestroyed(this.destroyRef),\n ).subscribe(response => {\n if (response !== null) {\n this._loadFailed.set(false);\n const items: T[] = Array.isArray(response) ? response : (response?.content ?? []);\n this._items.set(items);\n // A completed load gives every image URL a fresh attempt (a recovered image shows again); one that fails\n // again after this render becomes a placeholder again. A failed request keeps the rows, so it never clears.\n if (this._failedImages().size > 0) this._failedImages.set(new Set());\n this._selectedIds.set(new Set());\n this.selectionChange.emit(new Set());\n this._total.set(Array.isArray(response) ? response.length : (response?.totalElements ?? 0));\n if (!this._hasLoaded()) {\n const numericKeys = new Set(\n this.columns().filter(c => this.isNumericCol(c, items)).map(c => c.key)\n );\n this._numericKeys.set(numericKeys);\n this._hasLoaded.set(true);\n }\n }\n this._loading.set(false);\n this._searchLoading.set(false);\n this.loaded.emit({ ok: response !== null, total: this._total() });\n });\n\n }\n\n /** Query params for the counts requests: host params plus the active search (and its scope). Tabs and column filters are never sent. */\n private _countParams(): Record<string, string> {\n const params: Record<string, string> = { ...this._extraParams() };\n if (this._search()) {\n params['search'] = this._searchParam();\n if (this._searchFields()) params['searchFields'] = this._searchFields();\n }\n return params;\n }\n\n /**\n * Fetches `/counts` (tab badges) and `/filter-counts` (column options). The numbers follow the SEARCH only: the\n * requests carry the active `search` + `searchFields`, and are refetched when the search changes. Picking a tab or a\n * column-filter option never changes them. A backend may ignore the params (counts stay tenant-wide). Stale\n * responses are cancelled. As always, only values with a count above 0 become tabs / filter options.\n */\n private _fetchCounts(): void {\n const ep = this.countsEndpoint() || (this.page() ? `/${this.page()}/counts` : '');\n if (ep) {\n const params = this._countParams();\n this._tabCountsSub?.unsubscribe();\n this._tabCountsSub = this.http.get<Record<string, number>>(`${this.config.baseUrl}${ep}`, { params: tableQueryParams(params) })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: counts => {\n const { all: allCount, ...tabCounts } = counts as Record<string, number> & { all?: number };\n const total = allCount ?? Object.values(tabCounts).reduce((a, b) => a + b, 0);\n this._tabCounts.set({ '': total, ...tabCounts });\n },\n error: () => {},\n });\n }\n const fep = this.filterCountsEndpoint() || (this.page() ? `/${this.page()}/filter-counts` : '');\n if (fep) {\n const params = this._countParams();\n this._filterCountsSub?.unsubscribe();\n this._filterCountsSub = this.http.get<Record<string, Record<string, number>>>(`${this.config.baseUrl}${fep}`, { params: tableQueryParams(params) })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: counts => this._filterCounts.set(counts),\n error: () => {},\n });\n }\n }\n\n ngOnInit(): void {\n this.triggerLoad$.next();\n if (this.page()) this._loadSavedViews();\n this._fetchCounts();\n }\n\n /**\n * Retry from the error state. A failed table shows no search box or quick tabs (there is nothing to search), so a search term that was\n * active when the request failed could not be cleared any more: the retry therefore asks for the unsearched list on page 1.\n */\n protected _retryAfterError() {\n if (this._search()) { this._search.set(''); this._page.set(1); this._fetchCounts(); }\n this.load();\n }\n\n /* ── Event handlers ─────────────────────────────────────────── */\n protected onSearchChange(val: string) {\n // Already applied (e.g. the search box echoing a reset from clearFilters) — avoid a duplicate load.\n if (val === this._search()) return;\n this._search.set(val);\n this._page.set(1);\n this._searchPending = true;\n this.load();\n this._fetchCounts();\n }\n\n /** Phone sort control: \"Default\" (value '') + one entry per sortable visible column and direction (\"<key>:asc|desc\"). */\n protected readonly _phoneSortOptions = computed(() => {\n const opts = [{ value: '', label: this.labels.t('dataTable.default') }];\n for (const col of this.visibleCols()) {\n if (!this._isSortable(col) || this._emptyColumnKeys().has(col.key)) continue;\n opts.push({ value: `${col.key}:asc`, label: `${col.label} ↑` }, { value: `${col.key}:desc`, label: `${col.label} ↓` });\n }\n return opts;\n });\n\n protected readonly _phoneSortValue = computed(() => this._sortField() ? `${this._sortField()}:${this._sortDir()}` : '');\n\n /** Filterable visible columns (same rule as the header funnels). */\n protected readonly _phoneFilterCols = computed(() =>\n this.visibleCols()\n .filter(col => this.getRangeFilter(col) === null) // a listed range column gets its range chip only: the range replaces the value list\n .map(col => ({ col, cf: this.getColFilter(col) }))\n .filter((f): f is { col: ColumnDef; cf: { options: FilterOption[]; activeValues: string[] } } => f.cf !== null));\n\n /**\n * The sort buttons / icons and the column-filter icons only show while there is something to sort or filter: not after a failed\n * load, and not when the table is empty because nothing exists or only a search / quick tab matched nothing (clear the search to\n * get back). Once the user has used a column header control (a column filter or a sort is active) the controls stay, even with\n * zero rows, so they can change or clear it. Headers are plain labels otherwise.\n */\n protected readonly _showColumnControls = computed(() =>\n !this._error() && (\n this._items().length > 0 ||\n !!this._sortField() ||\n Object.values(this._colFilterValues()).some(v => v.length > 0) ||\n this._anyRangeActive()\n ),\n );\n\n /**\n * Keys of sortable columns whose cell is blank ('' or '—') on every loaded row — nothing to sort by, so the sort control is\n * hidden. Judged from the loaded page (the same text the cells show); an active sort on the column keeps its control so it\n * can be changed or cleared.\n */\n protected readonly _emptyColumnKeys = computed(() => {\n const items = this._items();\n const out = new Set<string>();\n if (items.length === 0) return out;\n for (const col of this.visibleCols()) {\n if (!this._isSortable(col) || this._sortField() === col.key) continue;\n let hasValue = false;\n for (const item of items) {\n if (col.cellType === 'image') { if (this.imageUrl(col, item) !== null) { hasValue = true; break; } continue; } // an image cell has no text: its value is the picture's address\n let text: unknown;\n try { text = this.cardCellText(col, item); } catch { hasValue = true; break; }\n const t = text === null || text === undefined ? '' : String(text).trim();\n if (t !== '' && t !== '—') { hasValue = true; break; }\n }\n if (!hasValue) out.add(col.key);\n }\n return out;\n });\n\n /** A header sort control shows for a sortable column while there are rows and the column has a value somewhere. */\n protected _canShowSort(col: ColumnDef): boolean {\n return this._isSortable(col) && this._showColumnControls() && !this._emptyColumnKeys().has(col.key);\n }\n\n protected readonly _hasPhoneControls = computed(() => this._phoneSortOptions().length > 1 || this._phoneFilterCols().length > 0 || this._phoneRangeCols().length > 0);\n\n /** Phone sort select → sets the sort directly (same state, page reset and load as the header's onSort). */\n protected onPhoneSort(value: string) {\n if (!value) {\n this._sortField.set(null); this._sortDir.set('asc');\n } else {\n const i = value.lastIndexOf(':');\n this._sortField.set(value.slice(0, i)); this._sortDir.set(value.slice(i + 1) === 'desc' ? 'desc' : 'asc');\n }\n this._page.set(1);\n this.load();\n }\n\n protected onSort(field: string) {\n if (this._sortField() === field) {\n if (this._sortDir() === 'desc') {\n // Third click: reset\n this._sortField.set(null); this._sortDir.set('asc');\n } else {\n // Second click: asc → desc\n this._sortDir.set('desc');\n }\n } else {\n // First click: start asc\n this._sortField.set(field); this._sortDir.set('asc');\n }\n this._page.set(1);\n this._totalsSkipNext = true;\n this.load();\n }\n\n protected onPageChange(p: number) { this._page.set(p); this._totalsSkipNext = true; this.load(); }\n\n protected onTabChange(value: string) {\n this._activeTab.set(value);\n this.tabChange.emit(value);\n this._page.set(1);\n this.load();\n }\n\n /**\n * Wire name of a column's filter: `filterParam` when set, else the column `key`. Used ONLY for the column-filter query\n * param, the /filter-counts lookup, `_colFilterValues` and saved views (never for sort, row data, bulk fields).\n */\n protected _filterName(col: ColumnDef): string {\n return col.filterParam ?? col.key;\n }\n\n protected onColFilterChange(column: string, values: string[]) {\n this._colFilterValues.update(prev => ({ ...prev, [column]: values }));\n this._page.set(1);\n this.load();\n }\n\n protected clearFilters() {\n const hadSearch = !!this._search();\n this._search.set('');\n this._activeTab.set('');\n this.tabChange.emit('');\n this._colFilterValues.set({});\n if (Object.keys(this._rangeValues()).length > 0) this._rangeValues.set({});\n this._page.set(1);\n this.load();\n if (hadSearch) this._fetchCounts(); // the numbers only follow the search\n }\n\n protected getColFilter(col: ColumnDef): { options: FilterOption[]; activeValues: string[] } | null {\n const colCounts = this._filterCounts()[this._filterName(col)] ?? {};\n const activeValues = this._colFilterValues()[this._filterName(col)] ?? [];\n const present = this._presentKeys(colCounts);\n // Same rule as quick-filter tabs: a single value means nothing to filter on.\n // Keep the icon while a filter is active so the user can still clear it.\n if (present.length <= 1 && activeValues.length === 0) return null;\n // A selected value stays listed even when a search leaves it at 0, so it can still be unchecked.\n const keys = [...present, ...activeValues.filter(v => !present.includes(v))];\n\n const countOptions: FilterOption[] = keys\n .map(value => [value, colCounts[value] ?? 0] as const)\n .sort(([, a], [, b]) => b - a)\n .map(([value, count]) => {\n const badgeCfg = (col.badgeFn ? col.badgeFn(value, null) : null)\n ?? { label: value, variant: semanticBadgeVariant(value, this.labels.locale()) ?? autoVariant(value) } as BadgeConfig;\n const color = BADGE_VARIANT_STYLES[badgeCfg.variant]?.color ?? '#64748b';\n return { value, label: badgeCfg.label || value, color, count: count as number };\n });\n\n return countOptions.length > 0 ? { options: countOptions, activeValues } : null;\n }\n\n private _loadSavedViews(): void {\n this.http.get<any[]>(`${this.config.baseUrl}/saved-views`, { params: { page: this.page() } })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (dtos) => this._internalSavedViews.set(dtos.map(d => ({\n id: d.id, name: d.name,\n quickFilter: d.quickFilter ?? null,\n sortField: d.sortField ?? null,\n sortDir: d.sortDir ?? null,\n visibleColumns: d.visibleColumns ?? [],\n columnFilters: d.columnFilters ?? null,\n ...(d.rangeFilters ? { rangeFilters: d.rangeFilters } : {}),\n }))),\n error: () => {},\n });\n }\n\n protected onSaveViewClick(name: string): void {\n if (!this._canEdit()) return; // read-only users can load their saved views but not create them\n if (this.page()) {\n const state = this.getState();\n this.http.post<any>(`${this.config.baseUrl}/saved-views`, { page: this.page(), name, ...state })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (dto) => {\n this._internalSavedViews.update(v => [...v, {\n id: dto.id, name: dto.name,\n quickFilter: dto.quickFilter ?? null,\n sortField: dto.sortField ?? null,\n sortDir: dto.sortDir ?? null,\n visibleColumns: dto.visibleColumns ?? [],\n columnFilters: dto.columnFilters ?? null,\n ...(dto.rangeFilters ? { rangeFilters: dto.rangeFilters } : {}),\n }]);\n this._toast.show(this.labels.t('dataTable.viewSaved'));\n },\n error: () => this._toast.error(this.labels.t('dataTable.viewSaveFailed')),\n });\n } else {\n this.saveViewClick.emit();\n }\n }\n\n protected onLoadViewClick(view: SavedView): void {\n if (this.page()) {\n this._activeViewId.set(view.id);\n this.applyView(view);\n } else {\n this.loadViewClick.emit(view);\n }\n }\n\n protected onDeleteViewClick(id: string): void {\n if (!this._canEdit()) return; // read-only users can't delete saved views\n if (this.page()) {\n this.http.delete(`${this.config.baseUrl}/saved-views/${id}`)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: () => {\n this._internalSavedViews.update(v => v.filter(v => v.id !== id));\n if (this._activeViewId() === id) this._activeViewId.set(null);\n this._toast.show(this.labels.t('dataTable.viewDeleted'));\n },\n error: () => this._toast.error(this.labels.t('dataTable.viewDeleteFailed')),\n });\n } else {\n this.deleteViewClick.emit(id);\n }\n }\n\n /** Returns a snapshot of current table state for saving as a view. */\n getState(): Pick<SavedView, 'quickFilter' | 'sortField' | 'sortDir' | 'visibleColumns' | 'rangeFilters'> & { columnFilters: Record<string, string> } {\n const columnFilters: Record<string, string> = {};\n for (const [key, vals] of Object.entries(this._colFilterValues())) {\n if (vals.length > 0) columnFilters[key] = encodeFilterValues(vals);\n }\n // Only a table that lists rangeFilters writes the field (`{}` = no range set, so loading the view clears ranges); other tables save exactly what they did.\n const rangeFilters: Record<string, { min: number | null; max: number | null }> = {};\n for (const key of this._rangeSpecs().keys()) { const v = this._rangeValues()[key]; if (v) rangeFilters[key] = { min: v.min, max: v.max }; }\n return {\n columnFilters,\n ...(this._rangeSpecs().size > 0 ? { rangeFilters } : {}),\n quickFilter: this._activeTab() || null,\n sortField: this._sortField() || null,\n sortDir: this._sortField() ? this._sortDir() : null,\n visibleColumns: this._configurableKeys(this._visibleColumns()),\n };\n }\n\n /** Restores table state from a saved view and reloads. */\n applyView(view: SavedView): void {\n this._activeTab.set(view.quickFilter ?? '');\n this.tabChange.emit(view.quickFilter ?? '');\n if (view.sortField) {\n this._sortField.set(view.sortField);\n this._sortDir.set((view.sortDir as SortDir) ?? 'asc');\n } else {\n this._sortField.set(null);\n this._sortDir.set('asc');\n }\n this._visibleColumns.set(this._configurableKeys(view.visibleColumns));\n // Views saved before ranges existed (field absent/null) leave the current ranges alone; a stored object replaces them (listed keys, finite bounds only).\n if (view.rangeFilters && typeof view.rangeFilters === 'object') this._rangeValues.set(this._restorableRanges(view.rangeFilters));\n // Views saved before column filters were stored (field absent/null) leave the current filters alone.\n if (view.columnFilters && typeof view.columnFilters === 'object') {\n this._colFilterValues.set(this._restorableColumnFilters(view.columnFilters));\n }\n this.resetToFirstPage();\n }\n\n private _restorableRanges(saved: Record<string, { min?: number | null; max?: number | null } | null>): Record<string, ColumnRangeValue> {\n const out: Record<string, ColumnRangeValue> = {};\n const num = (n: unknown): number | null => (typeof n === 'number' && Number.isFinite(n) ? n : null);\n for (const [key, raw] of Object.entries(saved)) {\n if (!this._rangeSpecs().has(key) || !raw || typeof raw !== 'object') continue;\n const min = num(raw.min), max = num(raw.max);\n if (min != null && max != null && min > max) continue;\n if (min != null || max != null) out[key] = { min, max };\n }\n return out;\n }\n\n /** Keeps only filters that still make sense: known column keys, and (when the counts list the column) known values. */\n private _restorableColumnFilters(saved: Record<string, string>): Record<string, string[]> {\n // wire name -> itself; a column with a filterParam also accepts its plain key (views saved before it had one).\n const names = new Map<string, string>();\n for (const c of this.columns()) names.set(c.key, this._filterName(c));\n for (const c of this.columns()) names.set(this._filterName(c), this._filterName(c));\n const counts = this._filterCounts();\n const out: Record<string, string[]> = {};\n for (const [savedKey, raw] of Object.entries(saved)) {\n const key = names.get(savedKey);\n if (key === undefined || typeof raw !== 'string') continue;\n // A view holding both the legacy key and the wire name of one column: the wire name wins, whatever the order.\n if (savedKey !== key && Object.prototype.hasOwnProperty.call(saved, key)) continue;\n const known = Object.keys(counts[key] ?? {});\n let vals = decodeFilterValues(raw);\n if (known.length > 0) vals = vals.filter(v => known.includes(v));\n if (vals.length > 0) out[key] = vals;\n }\n return out;\n }\n\n /** Plain/number/date columns sort unless `sortable: false`; badge and image columns only when `sortable: true`; never actions. */\n protected _isSortable(col: ColumnDef): boolean {\n if (col.cellType === 'actions') return false;\n return col.cellType === 'badge' || col.cellType === 'image' ? col.sortable === true : col.sortable !== false;\n }\n\n protected sortAriaLabel(field: string): string {\n if (this._sortField() !== field) return 'none';\n return this._sortDir() === 'asc' ? 'ascending' : 'descending';\n }\n\n protected trackItem(item: T, index: number): string | number {\n return item['id'] ?? index;\n }\n\n protected isRowClickable(item: T): boolean {\n if (!this._rowClickable()) return false;\n const fn = this.rowClickableFn();\n return fn ? fn(item) : true;\n }\n\n protected rowLabel(item: T): string | null {\n const fn = this.rowLabelFn();\n return fn ? (fn(item) || null) : null;\n }\n\n protected onRowClick(item: T) {\n if (this.isRowClickable(item)) this.rowClick.emit(item);\n }\n\n /** Enter / Space on a focused clickable row or card activates it — ignored when focus is on a control inside it. */\n protected onRowKeydown(e: KeyboardEvent, item: T) {\n if (e.target !== e.currentTarget || (e.key !== 'Enter' && e.key !== ' ')) return;\n if (!this.isRowClickable(item)) return;\n e.preventDefault();\n this.rowClick.emit(item);\n }\n\n protected async onInternalButtonClick(type: string): Promise<void> {\n if (type === 'import') { this._ieRef()?.openImport(); return; }\n if (type === 'export') { this._ieRef()?.exportAll(); return; }\n // A page-defined action that declares `confirm` asks first; only a confirmed click is reported to the host.\n const confirm = this._effectiveButtons().find(b => b.type === type)?.confirm;\n if (confirm) {\n const message = typeof confirm.message === 'function' ? confirm.message() : confirm.message;\n const confirmed = await this._confirmSvc.confirm({\n title: confirm.title,\n message,\n confirmLabel: confirm.confirmLabel,\n cancelLabel: confirm.cancelLabel,\n variant: confirm.variant,\n ...(confirm.details?.length ? { details: confirm.details } : {}),\n });\n if (!confirmed) return;\n }\n this.tableButtonClick.emit(type);\n }\n\n protected onImported(): void {\n this.refresh();\n this.imported.emit();\n }\n\n /** Row actions visible for the current permission: everything for 'full'; otherwise only View (`type: 'view'`) and actions marked\n * `allowReadOnly` (never the built-in delete). The Actions column itself is shown only while some row has a visible action. */\n protected _rowActions(col: ColumnDef, item: T): RowAction[] {\n const actions = this._withResolvedReasons(col.actionsFn?.(item) ?? [], item);\n if (this._canEdit()) return this._stableActionList(col, item, actions);\n const visible = actions.filter(a => a.type === 'view' || (a.allowReadOnly === true && a.type !== 'delete'));\n return this._stableActionList(col, item, visible.length === actions.length ? actions : visible);\n }\n\n /**\n * Pure derivation memo (never server data): the resolved action of one row + action type, kept weakly by the row object. The same row, the same host action object and the same resolved `disabled` /\n * `disabledReason` give back the SAME object, so a host's own `_rowActionsCache` identity survives change detection and the row menu is not re-rendered for nothing.\n */\n private readonly _resolvedActionCache = new WeakMap<object, Map<string, { src: RowAction; off: boolean | undefined; reason: string | undefined; shape: readonly unknown[]; out: RowAction }>>();\n /** The last list returned per row + actions column: an equal list (same action objects in the same order, and none of them changed in place) is returned as the same array. */\n private readonly _actionListCache = new WeakMap<object, WeakMap<ColumnDef, { list: RowAction[]; shapes: (readonly unknown[])[] }>>();\n\n /**\n * What the row menu draws or decides from an action object, captured by value: a host that mutates an action IN PLACE (a new `label`, `icon`, `variant`) still gets a re-render, because the memo compares these values and not only the object's identity.\n * (Treating a RowAction as immutable is still the recommended way; this makes the memo safe if it is not.)\n */\n private _actionShape(a: RowAction): readonly unknown[] {\n return [a.type, a.label, a.icon, a.variant, a.opens, a.modal, a.requiresFull, a.allowReadOnly, a.hidden, a.disabled, a.disabledReason];\n }\n private _sameShape(a: readonly unknown[], b: readonly unknown[]): boolean { return a.length === b.length && a.every((v, i) => v === b[i]); }\n\n private _stableActionList(col: ColumnDef, item: T, list: RowAction[]): RowAction[] {\n if (typeof item !== 'object' || item === null) return list;\n let perRow = this._actionListCache.get(item as object);\n if (!perRow) { perRow = new WeakMap(); this._actionListCache.set(item as object, perRow); }\n const shapes = list.map(a => this._actionShape(a));\n const prev = perRow.get(col);\n if (prev && prev.list.length === list.length && prev.list.every((a, i) => a === list[i])) {\n if (prev.shapes.every((sh, i) => this._sameShape(sh, shapes[i]))) return prev.list;\n // The same action objects, but one was changed in place: a NEW array, so the (OnPush) row menu draws the new values.\n const fresh = list.slice();\n perRow.set(col, { list: fresh, shapes });\n return fresh;\n }\n perRow.set(col, { list, shapes });\n return list;\n }\n\n /**\n * `disabled` and `disabledReason` given as functions are resolved here with the row (the menu has no row and calls them with `null`): `disabled: r => r.x` works.\n * A function that throws counts as \"not disabled\" / \"no reason\" (never breaks rendering). A string reason and an action with no function keep the host's object untouched; the array keeps its identity when nothing needs resolving.\n * A resolved action object is reused while its source object and the resolved values are unchanged (see `_resolvedActionCache`).\n */\n private _withResolvedReasons(actions: RowAction[], item: T): RowAction[] {\n if (!actions.some(a => typeof a.disabled === 'function' || typeof a.disabledReason === 'function')) return actions;\n const rowKey = typeof item === 'object' && item !== null ? (item as object) : null;\n let perRow = rowKey ? this._resolvedActionCache.get(rowKey) : undefined;\n if (rowKey && !perRow) { perRow = new Map(); this._resolvedActionCache.set(rowKey, perRow); }\n return actions.map(a => {\n if (typeof a.disabled !== 'function' && typeof a.disabledReason !== 'function') return a;\n let off: boolean | undefined;\n if (typeof a.disabled === 'function') {\n try { off = !!a.disabled(item); } catch { off = false; }\n }\n let reason: string | undefined;\n if (typeof a.disabledReason === 'function') {\n let raw: string | null | undefined;\n try { raw = a.disabledReason(item); } catch { raw = null; }\n reason = typeof raw === 'string' ? raw : undefined;\n }\n const held = perRow?.get(a.type);\n const shape = this._actionShape(a);\n if (held && held.src === a && held.off === off && held.reason === reason && this._sameShape(held.shape, shape)) return held.out;\n const resolved: RowAction = { ...a };\n if (off !== undefined) resolved.disabled = () => off;\n if (typeof a.disabledReason === 'function') resolved.disabledReason = reason;\n perRow?.set(a.type, { src: a, off, reason, shape, out: resolved });\n return resolved;\n });\n }\n\n /** The host's wording of an error (`errorTextFn`), or `null` when it has none (or throws): the table then words the error itself. */\n private _hostErrorText(err: unknown): string | null {\n const fn = this.errorTextFn();\n if (!fn) return null;\n try {\n const text = fn(err);\n return typeof text === 'string' && text.trim() ? text.trim() : null;\n } catch { return null; }\n }\n\n /** The failure text of a table action: the host's (`errorTextFn`), else the server's own message / the cause-based sentence. */\n private _actionError(err: unknown): string {\n return this._hostErrorText(err) ?? actionErrorText(err, k => this.labels.t(k));\n }\n\n /** The sentence a bulk response adds after the standard summary: its readable `message`, plus a different readable `skippedReason`. */\n private _bulkServerMessage(r: { message?: unknown; skippedReason?: unknown } | null | undefined): string | null {\n const message = humanReadableMessage(r?.message);\n const reason = humanReadableMessage(r?.skippedReason);\n return [message, reason && reason !== message ? reason : null].filter((x): x is string => !!x).join(' ') || null;\n }\n\n protected async onTableRowAction(type: string, col: ColumnDef, item: T): Promise<void> {\n const actions = this._rowActions(col, item);\n const action = actions.find(a => a.type === type);\n // An action hidden by permission (or unknown) must never run — including the built-in delete.\n if (!action) return;\n\n if (action?.opens === 'panel') {\n this.panelActionClick.emit({ type, item });\n return;\n }\n\n // Built-in delete: fires when type === 'delete' and no opens override is set.\n // Opens the table's own confirmation modal (bypasses ConfirmService entirely).\n // Host pages need only define { type: 'delete', label: '...', variant: 'danger' } —\n // no opens, no modal config, no onAction handler required.\n if (type === 'delete' && !action?.opens) {\n const title = action?.modal?.title ?? this.labels.t('dataTable.delete');\n const rawMsg = action?.modal?.message;\n const msg = rawMsg\n ? (typeof rawMsg === 'function' ? rawMsg(item) : rawMsg)\n : this.labels.t('dataTable.deleteRecordConfirm', { item: this._itemWord() });\n const confirmLabel = action?.modal?.confirmLabel ?? this.labels.t('dataTable.delete');\n const details = action?.modal?.details;\n const variant = action?.modal?.variant;\n this._rowDeleteConfig.set({ title, message: msg, confirmLabel,\n ...(details?.length ? { details } : {}), ...(variant ? { variant } : {}) });\n this._rowDeleteTarget.set(item);\n return;\n }\n\n if (action?.opens === 'modal' && action.modal) {\n const msg = typeof action.modal.message === 'function'\n ? action.modal.message(item)\n : action.modal.message;\n const confirmed = await this._confirmSvc.confirm({\n title: action.modal.title,\n message: msg,\n confirmLabel: action.modal.confirmLabel,\n cancelLabel: action.modal.cancelLabel,\n variant: action.modal.variant,\n ...(action.modal.details?.length ? { details: action.modal.details } : {}),\n });\n if (!confirmed) return;\n }\n\n col.onAction?.(type, item);\n }\n\n private isNumericCol(col: ColumnDef, items: T[]): boolean {\n // Any explicit cellType (including 'text') opts out of numeric auto-detection — e.g. ZIP codes are text.\n if (col.cellType) return false;\n for (const item of items) {\n const raw = col.render ? col.render(item) : item[col.key];\n if (raw == null || raw === '' || raw === '—') continue;\n if (typeof raw === 'number') return true;\n if (typeof raw === 'string') {\n const t = raw.trim();\n if (t.startsWith('$') || t.endsWith('%')) return true;\n if (isFinite(Number(t))) return true;\n }\n return false;\n }\n return false;\n }\n\n protected resolveCellAlign(col: ColumnDef, item: T): 'left' | 'right' | 'center' {\n if (col.align) return col.align;\n if (col.cellType === 'number') return 'right';\n if (col.cellType === 'actions' || col.cellType === 'image') return 'center';\n if (this.isNumericCol(col, [item])) return 'right';\n return 'left';\n }\n\n /** null → the cell renders a plain '—' (badgeFn returned null, or an empty value without a badgeFn). */\n protected resolveBadge(col: ColumnDef, item: T): BadgeConfig | null {\n if (col.badgeFn) return col.badgeFn(item[col.key], item);\n const value = String(item[col.key] ?? '');\n if (!value) return null;\n return {\n label: value,\n variant: semanticBadgeVariant(value, this.labels.locale()) ?? autoVariant(value),\n };\n }\n\n protected showTagTooltip(event: MouseEvent | FocusEvent, tags: any[]): void {\n const rect = (event.target as HTMLElement).getBoundingClientRect();\n this._tagTooltip.set({ tags, x: rect.left + rect.width / 2, y: rect.top - 8 });\n }\n\n protected hideTagTooltip(): void {\n this._tagTooltip.set(null);\n }\n\n protected imageUrl(col: ColumnDef, item: T): string | null {\n try {\n const url = col.imageFn?.(item);\n if (typeof url !== 'string') return null;\n return url.trim() || null;\n } catch {\n return null;\n }\n }\n\n /** Always a string so the <img> keeps an `alt` attribute ('' = decorative). */\n protected imageAlt(col: ColumnDef, item: T): string {\n try {\n return col.imageAlt?.(item) ?? '';\n } catch {\n return '';\n }\n }\n\n /** CSS object-position from `imagePositionFn` (percent); centered when there is none or it throws. */\n protected imagePosition(col: ColumnDef, item: T): string {\n try {\n const p = col.imagePositionFn?.(item);\n const clamp = (n: unknown) => typeof n === 'number' && Number.isFinite(n) ? Math.min(100, Math.max(0, n)) : 50;\n return `${clamp(p?.x)}% ${clamp(p?.y)}%`;\n } catch {\n return '50% 50%';\n }\n }\n\n protected imageClass(col: ColumnDef, small: boolean): string {\n const size = small ? 'sm' : (col.imageSize ?? 'md');\n return `dt-img-${col.imageShape ?? 'circle'}-${size}`;\n }\n\n protected onImageError(url: string): void {\n this._failedImages.update(s => new Set(s).add(url));\n }\n\n protected phoneCell(value: any): string { return formatPhone(value); }\n\n private readonly _injector = inject(Injector);\n\n /** Safe hrefs only: mailto:, tel:, http(s):// and root-relative paths. Everything else is refused (null). */\n private _safeHref(raw: unknown): string | null {\n if (typeof raw !== 'string') return null;\n const h = raw.trim();\n if (!h || /[\\u0000-\\u001f\\u007f]/.test(h)) return null;\n if (/^(mailto|tel):\\S/i.test(h) || /^https?:\\/\\/\\S/i.test(h) || /^\\/(?![\\/\\\\])/.test(h)) return h;\n return null;\n }\n\n /** Text and (when there is a safe target) the anchor data of a `cellType: 'link'` cell. Never throws. */\n protected linkView(col: ColumnDef, item: T): { text: string; link: ResolvedLink | null } {\n let target: LinkTarget | null = null;\n try {\n const r = col.linkFn?.(item, item[col.key]);\n if (typeof r === 'string') target = r.trim() ? { href: r } : null;\n else if (r && typeof r === 'object') target = r;\n } catch { target = null; }\n\n let raw: any;\n try { raw = col.render ? col.render(item) : item[col.key]; } catch { raw = item[col.key]; }\n const own = raw === null || raw === undefined ? '' : String(raw);\n const text = own !== '' ? own : (typeof target?.label === 'string' && target.label !== '' ? target.label : '—');\n if (!target || text === '—') return { text, link: null };\n\n let href: string | null = null;\n let tree: UrlTree | null = null;\n const rl = target.routerLink;\n if (rl !== undefined && rl !== null && (typeof rl === 'string' ? rl.trim() !== '' : rl.length > 0)) {\n try {\n const router = this._injector.get(Router);\n tree = router.createUrlTree(typeof rl === 'string' ? [rl] : [...rl], { queryParams: target.queryParams });\n href = this._injector.get(Location).prepareExternalUrl(router.serializeUrl(tree));\n } catch { return { text, link: null }; }\n } else {\n href = this._safeHref(target.href);\n }\n if (!href) return { text, link: null };\n\n const blank = target.target === '_blank';\n const external = /^https?:/i.test(href);\n const label = typeof target.ariaLabel === 'string' && target.ariaLabel !== '' ? target.ariaLabel : null;\n return {\n text,\n link: {\n href, tree, blank,\n rel: blank || external ? 'noopener noreferrer' : null,\n download: target.download === true,\n ariaLabel: label === null ? null : (blank ? this.labels.t('dataTable.linkOpensNewTab', { label }) : label),\n },\n };\n }\n\n /** Anchor click: never reaches the row; a plain left click on an in-app route navigates via the Router (SPA, no reload). */\n protected onLinkClick(e: MouseEvent, link: ResolvedLink, col: ColumnDef, item: T): void {\n e.stopPropagation();\n this.linkClick.emit({ item, column: col, href: link.href });\n const plain = e.button === 0 && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey;\n if (link.tree && plain && !link.blank && !e.defaultPrevented) {\n e.preventDefault();\n void this._injector.get(Router).navigateByUrl(link.tree);\n }\n }\n protected getInitials(name: string): string {\n return name.split(' ').filter(Boolean).map(p => p[0]).slice(0, 2).join('').toUpperCase();\n }\n\n protected isCardOverdue(col: ColumnDef, item: T): boolean {\n const days = item[col.daysKey ?? col.key];\n return days != null && days > (col.overdueThreshold ?? 30);\n }\n\n /** Cell types that never get a leading icon: they draw their own leading visual or are not text-like. */\n private static readonly _NO_ICON_TYPES: readonly string[] = ['avatar-name', 'link', 'tags', 'progress', 'image', 'actions', 'days-ago'];\n\n /**\n * Path of the leading icon for a cell (library source 2026-11-05, not yet published): `iconFn` returns a `<ui-icon>` key (known key wins) or a raw\n * 24x24 stroke path (drawing commands and numbers only, same rule as ui-radio's `icon`); anything else, an empty value, a throwing `iconFn` or a\n * non-text-like cell type gives null (nothing is drawn).\n */\n protected cellIconPath(col: ColumnDef, item: T): string | null {\n if (!col.iconFn || DataTableComponent._NO_ICON_TYPES.includes(col.cellType ?? '')) return null;\n let raw: string | null | undefined;\n try { raw = col.iconFn(item); } catch { return null; }\n const v = (raw ?? '').trim();\n if (!v) return null;\n return uiIconPath(v) ?? (/^[Mm][\\d\\s.,\\-MmLlHhVvCcSsQqTtAaZz]+$/.test(v) ? v : null);\n }\n\n /** Screen-reader text for a meaningful icon (`iconLabelFn`); '' (decorative) when absent, empty, throwing or when no icon is drawn. */\n protected cellIconLabel(col: ColumnDef, item: T): string {\n if (!col.iconLabelFn || !this.cellIconPath(col, item)) return '';\n try { return (col.iconLabelFn(item) ?? '').trim(); } catch { return ''; }\n }\n\n /** Renders any non-badge column value as a plain string for the mobile card view. */\n protected cardCellText(col: ColumnDef, item: T): string {\n switch (col.cellType) {\n case 'date': {\n const v = item[col.key];\n return v ? (this.labels.formatDate(v, col.dateFormat ?? 'MMM d, y') || '—') : '—';\n }\n case 'phone': return formatPhone(item[col.key]);\n case 'link': return this.linkView(col, item).text;\n case 'days-ago': {\n const days = item[col.daysKey ?? col.key];\n return days != null ? this.labels.t('dataTable.daysAgo', { days }) : this.labels.t('dataTable.never');\n }\n case 'tags': {\n const tags = item[col.tagsKey ?? col.key];\n return tags?.length > 0 ? tags.map((t: any) => t.name).join(', ') : '—';\n }\n case 'image': return '';\n case 'progress': {\n const p = col.progressFn?.(item);\n return p ? (p.label ?? `${p.value}/${p.max}`) : '—';\n }\n default:\n return col.render ? col.render(item) : String(item[col.key] ?? '—');\n }\n }\n\n /** Refresh data rows only — used internally for sort, filter, search, pagination. */\n load() { this.triggerLoad$.next(); }\n\n /**\n * Drops the active quick-filter tab (back to \"All\"), emits `tabChange('')` and reloads from page 1. For hosts\n * whose tab was renamed or removed by the user's own change, so the table doesn't stay on a tab key that no\n * longer exists. No-op when no tab is active.\n */\n resetTab(): void {\n if (!this._activeTab()) return;\n this._activeTab.set('');\n this.tabChange.emit('');\n this.resetToFirstPage();\n }\n\n /** Go to page 1 and do a full refresh — use after adding a new record. */\n resetToFirstPage(): void { this._page.set(1); this.refresh(); }\n\n /**\n * Full refresh after a mutation — fires data rows, tab counts, and filter counts\n * in parallel so every part of the UI (pagination totals, quick-filter badges,\n * column filter options) reflects the change.\n */\n refresh(options?: { silent?: boolean }): void {\n this._silentNext = !!options?.silent && this._hasLoaded();\n this.triggerLoad$.next();\n this._fetchCounts();\n }\n\n /** Set by `refresh({ silent: true })` for the next load only: rows stay visible (no skeleton) while it runs. */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GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,WAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,gBAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,gBAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,QAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,aAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,aAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,YAAA;EAAA,CAAA;EAAA,cAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,SAAO,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"forgeroute-ui-data-table-core.mjs","names":[],"sources":["../../../projects/forgeroute-ui/data-table-core/src/lib/data-table/load-error-message.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/data-table/filter-values.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/data-table/query-params.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/import-export/import-source-grid.component.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/import-export/import-export.component.ts","../../../projects/forgeroute-ui/data-table-core/src/lib/data-table/data-table.component.ts"],"sourcesContent":["import { UiLabelKey } from '@forgeroute/ui/core';\n\n/**\n * Which sentence a failed table load (or table action) shows. The CAUSE decides, so each message says what happened, why in plain words and what to do, and\n * \"offline\" is said ONLY when it is true:\n * - gave up waiting (the offline layer's RequestTimeoutError: `timeout === true`) -> loadError.timeout\n * - the offline layer's own \"no connection and no saved copy\" answer (status 0, statusText 'Offline') -> loadError.noCopy (says there is no saved copy of THIS view on this device)\n * - no answer (status 0) while the browser reports it is offline -> loadError.offline (neutral: no claim about saved data)\n * - no answer (status 0) while the browser says it is online (server down, DNS, blocked) -> loadError.unreachable\n * - 401 session ended / 403 no permission / 5xx server problem -> loadError.session / forbidden / server\n * - anything else -> loadError.other\n * Duck-typed on purpose: the offline layer is a separate entry point that this component must not import.\n */\nexport type LoadErrorKey = Extract<UiLabelKey,\n 'dataTable.loadError.offline' | 'dataTable.loadError.noCopy' | 'dataTable.loadError.unreachable' | 'dataTable.loadError.timeout' | 'dataTable.loadError.session'\n | 'dataTable.loadError.forbidden' | 'dataTable.loadError.server' | 'dataTable.loadError.other'>;\n\nexport type ActionErrorKey = Extract<UiLabelKey, 'dataTable.actionError.offline' | 'dataTable.actionError.unreachable' | 'dataTable.actionError.timeout' | 'dataTable.genericError'>;\n\nconst browserIsOnline = (): boolean => (typeof navigator === 'undefined' ? true : navigator.onLine !== false);\n\ntype ErrLike = { status?: unknown; statusText?: unknown; timeout?: unknown };\n\nfunction noAnswerKind(err: unknown, online: boolean): 'timeout' | 'noCopy' | 'offline' | 'unreachable' | null {\n const e = err as ErrLike | null | undefined;\n if (!e || typeof e !== 'object') return null;\n if (e.timeout === true && e.status === 0) return 'timeout';\n if (e.status === 0) return e.statusText === 'Offline' ? 'noCopy' : !online ? 'offline' : 'unreachable';\n return null;\n}\n\nexport function loadErrorKey(err: unknown, online: boolean = browserIsOnline()): LoadErrorKey {\n const none = noAnswerKind(err, online);\n if (none) return `dataTable.loadError.${none}`;\n const status = (err as ErrLike | null | undefined)?.status;\n if (status === 401) return 'dataTable.loadError.session';\n if (status === 403) return 'dataTable.loadError.forbidden';\n if (typeof status === 'number' && status >= 500) return 'dataTable.loadError.server';\n return 'dataTable.loadError.other';\n}\n\nexport function actionErrorKey(err: unknown, online: boolean = browserIsOnline()): ActionErrorKey {\n const none = noAnswerKind(err, online);\n if (none === 'offline' || none === 'noCopy') return 'dataTable.actionError.offline';\n if (none === 'unreachable') return 'dataTable.actionError.unreachable';\n if (none === 'timeout') return 'dataTable.actionError.timeout';\n return 'dataTable.genericError';\n}\n\n/**\n * The text of a failed table ACTION (bulk change / delete / download). The server's own message wins; a write the offline layer refused (`offlineBlocked`) or\n * timed out says its own plain words; otherwise the cause-based sentence.\n */\nexport function actionErrorText(err: unknown, translate: (key: ActionErrorKey) => string): string {\n const e = err as { error?: { message?: unknown }; offlineBlocked?: unknown; timeout?: unknown; message?: unknown } | null | undefined;\n const server = e?.error?.message;\n if (typeof server === 'string' && server.trim()) return server;\n if ((e?.offlineBlocked === true || e?.timeout === true) && typeof e.message === 'string' && e.message.trim()) return e.message;\n return translate(actionErrorKey(err));\n}\n","/**\n * Column-filter values travel as ONE comma-joined request parameter (`?section=Roofing,Siding`). A value that itself contains a comma\n * (\"Roofing, Inc.\") would be read as two. These helpers keep the wire format backward compatible and make such values unambiguous:\n *\n * - a value is sent AS IS unless joining it would be ambiguous: it contains a comma, a doubled backslash, or ends with a backslash;\n * - such a value is escaped: `\\` becomes `\\\\` and `,` becomes `\\,`;\n * - the reader splits on commas that are not escaped and unescapes `\\,` and `\\\\`; any other backslash is an ordinary character.\n *\n * So every value that worked before (no comma, no doubled / trailing backslash) is byte-for-byte unchanged, and a backend that does not know the\n * escaping keeps working for them. Backends that parse filter values should split with the same rules (`splitFilterList` in the contractor\n * backend, `decodeFilterValues` here).\n */\n\n/** Whether a value must be escaped to survive the comma-joined format. */\nfunction needsEscape(value: string): boolean {\n return value.includes(',') || value.includes('\\\\\\\\') || value.endsWith('\\\\');\n}\n\n/** One value as it is written into the comma-joined parameter. */\nexport function encodeFilterValue(value: string): string {\n return needsEscape(value) ? value.replace(/\\\\/g, '\\\\\\\\').replace(/,/g, '\\\\,') : value;\n}\n\n/** The comma-joined parameter for a list of filter values (`['Roofing, Inc.', 'Siding']` -> `Roofing\\, Inc.,Siding`). */\nexport function encodeFilterValues(values: readonly string[]): string {\n return values.map(encodeFilterValue).join(',');\n}\n\n/**\n * The values of a comma-joined parameter, the inverse of {@link encodeFilterValues}: split on unescaped commas, unescape `\\,` and `\\\\`,\n * trim each value and drop the empty ones (the same as the plain split it replaces).\n */\nexport function decodeFilterValues(raw: string): string[] {\n const out: string[] = [];\n let current = '';\n for (let i = 0; i < raw.length; i++) {\n const ch = raw[i];\n if (ch === '\\\\' && (raw[i + 1] === ',' || raw[i + 1] === '\\\\')) { current += raw[i + 1]; i++; continue; }\n if (ch === ',') { out.push(current); current = ''; continue; }\n current += ch;\n }\n out.push(current);\n return out.map(v => v.trim()).filter(Boolean);\n}\n","import { HttpParameterCodec, HttpParams } from '@angular/common/http';\n\n/**\n * Angular's default `HttpParams` codec leaves `+` as a plain `+` in the query string, and a server decodes a plain `+` as a SPACE.\n * A search for `name+tag@gmail.com` therefore reached the backend as `name tag@gmail.com` and matched nothing. This codec is Angular's\n * own (same readable `@ : $ , ; = ? /`) except that `+` is sent as `%2B`, so every character the user types reaches the server as typed.\n */\nclass PlusSafeParamCodec implements HttpParameterCodec {\n private encode(v: string): string {\n return encodeURIComponent(v)\n .replace(/%40/gi, '@').replace(/%3A/gi, ':').replace(/%24/gi, '$').replace(/%2C/gi, ',')\n .replace(/%3B/gi, ';').replace(/%3D/gi, '=').replace(/%3F/gi, '?').replace(/%2F/gi, '/');\n }\n encodeKey(key: string): string { return this.encode(key); }\n encodeValue(value: string): string { return this.encode(value); }\n decodeKey(key: string): string { return decodeURIComponent(key); }\n decodeValue(value: string): string { return decodeURIComponent(value); }\n}\n\nconst CODEC = new PlusSafeParamCodec();\n\n/** `HttpParams` for a table request: empty values are kept as given by the caller; `+` (and every other character) arrives as typed. */\nexport function tableQueryParams(values: Record<string, string> = {}): HttpParams {\n return new HttpParams({ encoder: CODEC, fromObject: values });\n}\n","import { ChangeDetectionStrategy, Component, ViewEncapsulation, input, output, computed, inject } from '@angular/core';\nimport { OptionCardComponent } from '@forgeroute/ui/option-card';\nimport type { ImportSource } from './import-export.component';\nimport { UiLabelsService } from '@forgeroute/ui/core';\n\n/**\n * The grid of source cards (\"Follow Up Boss\", \"kvCORE\", \"Custom CSV\" ...) of the import wizard's first step. Used inside the import window and\n * on its own (the setup wizard shows it inline so the user picks a source without opening the window first).\n *\n * <ui-import-source-grid [sources]=\"sources\" [selected]=\"picked\" ariaLabel=\"Select your Contact source\" (sourceSelect)=\"picked = $event\" />\n */\n@Component({\n selector: 'ui-import-source-grid',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n imports: [OptionCardComponent],\n template: `\n <div class=\"ie-source-grid\" [attr.role]=\"appearance() === 'card' ? 'group' : 'list'\" [class.ie-source-grid--cards]=\"appearance() === 'card'\" [attr.aria-label]=\"ariaLabel() || null\">\n @for (src of sources(); track src.value) {\n @if (appearance() === 'card') {\n <ui-option-card [attr.data-testid]=\"'source-' + src.value\" [title]=\"src.label\" [description]=\"src.desc || ''\" [letter]=\"src.letter || ''\" [color]=\"src.color || '#64748b'\"\n [actionLabel]=\"actionLabel()\" [actionTestId]=\"'source-pick-' + src.value\" [disabled]=\"disabled()\" (action)=\"sourceSelect.emit(src.value)\" />\n } @else {\n <button\n class=\"ie-source-card\"\n role=\"listitem\"\n type=\"button\"\n [class.ie-source-card--active]=\"selected() === src.value\"\n [attr.aria-pressed]=\"selected() === src.value\"\n [attr.data-testid]=\"'source-' + src.value\"\n (click)=\"sourceSelect.emit(src.value)\">\n @if (src.letter) {\n <span class=\"ie-source-letter\" [style.background]=\"src.color || '#64748b'\" aria-hidden=\"true\">{{ src.letter }}</span>\n }\n <span class=\"ie-source-label\">{{ src.label }}</span>\n @if (src.desc) { <span class=\"ie-source-desc\">{{ src.desc }}</span> }\n </button>\n }\n }\n </div>\n `,\n styles: [`\n ui-import-source-grid { display: block; }\n .ie-source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }\n @media (max-width: 520px) { .ie-source-grid { grid-template-columns: repeat(2, 1fr); } }\n .ie-source-card {\n display: flex; flex-direction: column; align-items: flex-start; gap: 4px;\n padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px;\n background: #fff; cursor: pointer; font-family: inherit; text-align: left;\n transition: all 0.15s;\n }\n .ie-source-card:hover { border-color: #94a3b8; background: #f8fafc; }\n .ie-source-card.ie-source-card--active { border-color: #3b82f6; background: #eff6ff; }\n .ie-source-card:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; }\n .ie-source-letter { width: 36px; height: 36px; border-radius: 8px; color: #fff; font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n .ie-source-label { font-size: 0.8125rem; font-weight: 600; color: #1e293b; line-height: 1.2; }\n .ie-source-desc { font-size: 0.75rem; color: #64748b; }\n /* card appearance (a ui-detail-card per source): two columns on wide screens, the cards stretch to one height */\n .ie-source-grid--cards { grid-template-columns: repeat(2, 1fr); }\n @media (max-width: 520px) { .ie-source-grid--cards { grid-template-columns: 1fr; } }\n `],\n})\nexport class ImportSourceGridComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly sources = input.required<ImportSource[]>();\n /** The `value` of the picked source (highlighted). `tile` only: the `card` appearance does not keep a selection. */\n readonly selected = input('');\n /** `tile`: the compact buttons of the import window. `card`: one `ui-detail-card` per source with its own select button (used on a page). */\n readonly appearance = input<'tile' | 'card'>('tile');\n /** `card`: disables every card's button (for example while the page is saving). */\n readonly disabled = input(false);\n /** `card`: the text of each card's button. */\n readonly actionLabelInput = input<string | null>(null, { alias: 'actionLabel' });\n readonly actionLabel = computed(() => this.actionLabelInput() ?? this.labels.t('importExport.actionLabel'));\n /** Accessible name of the list. */\n readonly ariaLabel = input('');\n /** Emits the `value` of the clicked source. */\n readonly sourceSelect = output<string>();\n}\n","import {\n Component, input, output, effect, ChangeDetectionStrategy,\n ChangeDetectorRef, DestroyRef, ElementRef, inject, viewChild,\n} from '@angular/core';\nimport { HttpClient } from '@angular/common/http';\nimport type { Observable } from 'rxjs';\nimport { tableQueryParams } from '../data-table/query-params';\nimport { FORGEROUTE_CONFIG } from '@forgeroute/ui/core';\nimport { ImportSourceGridComponent } from './import-source-grid.component';\nimport { FormsModule } from '@angular/forms';\nimport { ModalComponent } from '@forgeroute/ui/core';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { SelectComponent } from '@forgeroute/ui/select';\nimport { HintComponent } from '@forgeroute/ui/hint';\nimport type { SelectOption } from '@forgeroute/ui/select';\nimport { ToastService } from '@forgeroute/ui/core';\nimport { UiLabelsService } from '@forgeroute/ui/core';\nimport { csvSafeText } from '@forgeroute/ui/utils';\n\n// ── Public types ─────────────────────────────────────────────────────────────\n\nexport interface ImportFieldDef {\n key: string;\n label: string;\n required?: boolean;\n /**\n * An example of what the column should contain (e.g. `VACANT, OCCUPIED`, `500.00`, `YYYY-MM-DD`). It is shown under the field's\n * label in the column-mapping step as \"e.g. <example>\" and linked to the column dropdown for screen readers. Omit it and nothing changes.\n */\n example?: string;\n}\n\nexport interface ImportSource {\n value: string;\n label: string;\n desc?: string;\n letter?: string;\n color?: string;\n aliases?: Record<string, string[]>;\n}\n\nexport interface ImportExportConfig {\n entityName: string;\n entityNamePlural: string;\n exportEndpoint: string;\n /**\n * POST endpoint for the import wizard. Omit to make the table export-only —\n * ui-data-table only injects the Import button when this is set.\n */\n importEndpoint?: string;\n exportHeaders: string[];\n exportRow: (item: any) => (string | number)[];\n importFields?: ImportFieldDef[];\n columnAliases?: Record<string, string[]>;\n templateSampleRows?: string[][];\n /** Text of the template download button inside the import window, e.g. \"Download Cases CSV Template\" (default: \"Download template\"). */\n templateLabel?: string;\n /** When true, the Export button appears in the More Actions dropdown instead of as a standalone button. */\n exportInMoreActions?: boolean;\n}\n\ninterface ImportError { row: number; message: string; }\nexport interface ImportSubmitRequest { file: File | null; records: Record<string, string>[]; mapping: Record<string, string>; }\nexport interface ImportSubmitResult { imported: number; errors?: { row: number; message: string }[]; warnings?: { row: number; message: string }[]; }\n/** One problem the `validate` check found in a CSV row (`row` is the 1-based data row, the header not counted). A row may have several. */\nexport interface ImportRowIssue { row: number; message: string; }\ntype ImportStep = 'source' | 'upload' | 'mapping' | 'preview' | 'result';\n\n// ── CSV helpers ───────────────────────────────────────────────────────────────\n\n/** The delimiter of a CSV: comma, semicolon (European Excel) or tab, whichever the header line uses most outside quotes; comma on a tie. */\nfunction detectCsvDelimiter(text: string): string {\n const counts: Record<string, number> = { ',': 0, ';': 0, '\\t': 0 };\n let quoted = false;\n for (const ch of text) {\n if (ch === '\"') quoted = !quoted;\n else if (!quoted) {\n if (ch === '\\n' || ch === '\\r') break;\n if (ch in counts) counts[ch]++;\n }\n }\n return [',', ';', '\\t'].reduce((best, d) => (counts[d] > counts[best] ? d : best), ',');\n}\n\n/**\n * Reads CSV text (RFC 4180): a quoted cell may hold the delimiter, doubled quotes (\"\") and line breaks (CRM notes do), rows end at LF, CRLF or CR,\n * a leading byte-order mark is dropped and rows with only empty cells are skipped. The delimiter is detected from the header line.\n */\nfunction parseCsv(text: string): string[][] {\n const delimiter = detectCsvDelimiter(text);\n const rows: string[][] = [];\n let row: string[] = [];\n let cell = '';\n let quoted = false;\n const endCell = () => { row.push(cell); cell = ''; };\n const endRow = () => { endCell(); if (row.some(c => c.trim() !== '')) rows.push(row); row = []; };\n const src = text.replace(/^\\uFEFF/, '');\n for (let i = 0; i < src.length; i++) {\n const ch = src[i];\n if (quoted) {\n if (ch !== '\"') cell += ch;\n else if (src[i + 1] === '\"') { cell += '\"'; i++; }\n else quoted = false;\n } else if (ch === '\"' && cell === '') quoted = true;\n else if (ch === delimiter) endCell();\n else if (ch === '\\r') { if (src[i + 1] === '\\n') i++; endRow(); }\n else if (ch === '\\n') endRow();\n else cell += ch;\n }\n if (cell !== '' || row.length) endRow();\n return rows;\n}\n\n// The formula guard is the public csvSafeText of ../utils/csv (the same one every app's own CSV download uses).\nfunction csvCell(cell: string | number): string {\n return csvSafeText(cell);\n}\n\nfunction exportToCsv(filenamePrefix: string, headers: string[], rows: (string | number)[][]): void {\n const csvContent = [headers, ...rows]\n .map(row => row.map(cell => `\"${csvCell(cell).replace(/\"/g, '\"\"')}\"`).join(','))\n .join('\\n');\n const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8;' });\n const url = URL.createObjectURL(blob);\n const link = document.createElement('a');\n link.href = url;\n link.download = `${filenamePrefix}-${new Date().toISOString().split('T')[0]}.csv`;\n // Firefox (and older Safari) only start the download of an anchor that is in the document: add it, click it, take it out again.\n link.style.display = 'none';\n document.body.appendChild(link);\n link.click();\n document.body.removeChild(link);\n // Revoking synchronously can cancel the download in some browsers — release the URL once the click has been handled.\n setTimeout(() => URL.revokeObjectURL(url), 1000);\n}\n\n// ── Component ─────────────────────────────────────────────────────────────────\n\n@Component({\n selector: 'ui-import-export',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [FormsModule, ModalComponent, ButtonComponent, SelectComponent, ImportSourceGridComponent, HintComponent],\n template: `\n <!-- Trigger buttons -->\n <div class=\"ie-actions\">\n <ui-button variant=\"secondary\" size=\"sm\" [loading]=\"exporting\" (click)=\"exportAll()\" [ariaLabel]=\"labels.t('importExport.exportAllRecordsToCsv')\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 15 17 10\"/><line x1=\"12\" y1=\"15\" x2=\"12\" y2=\"3\"/></svg>{{ labels.t('common.export') }}</ui-button>\n @if (!exportOnly()) {\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"openImport()\" [ariaLabel]=\"labels.t('importExport.importRecordsFromCsv')\">\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"7 10 12 5 17 10\"/><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\"/></svg>{{ labels.t('common.import') }}</ui-button>\n }\n </div>\n\n <!-- Import modal -->\n <ui-modal [open]=\"importOpen\" [title]=\"modalTitle\" maxWidth=\"640px\" [closable]=\"!importing\" (close)=\"closeImport()\">\n\n <!-- Step indicator -->\n <ol class=\"ie-steps\" [attr.aria-label]=\"labels.t('importExport.importProgress')\">\n @for (st of stepItems; track st.key) {\n <li class=\"ie-step\" [class.active]=\"st.current\" [class.done]=\"st.done\" [attr.aria-current]=\"st.current ? 'step' : null\">\n <span class=\"ie-step-num\" aria-hidden=\"true\">{{ st.num }}</span><span class=\"ie-step-label\">{{ st.label }}</span>@if (st.done) {<span class=\"ie-sr-only\">, {{ labels.t('importExport.stepDone') }}</span>}@if (st.current) {<span class=\"ie-sr-only\">, {{ labels.t('importExport.stepCurrent') }}</span>}\n </li>\n }\n </ol>\n\n <!-- Persistent live region: it exists from the moment the window opens, so the result text it receives later is announced reliably -->\n <div class=\"ie-sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\" data-testid=\"import-announcement\">{{ resultAnnouncement }}</div>\n\n <!-- Step 1: Source selection -->\n @if (step === 'source' && importSources()) {\n <div class=\"ie-source-step\" #stepBox tabindex=\"-1\">\n <p class=\"ie-mapping-hint\">{{ labels.t('importExport.selectWhereYouReImporting') }}</p>\n <ui-import-source-grid [sources]=\"importSources()!\" [selected]=\"selectedSource\" [ariaLabel]=\"labels.t('importExport.selectSource', { entity: config.entityName })\" (sourceSelect)=\"onSourceSelected($event)\" />\n </div>\n }\n\n <!-- Step 2: Upload -->\n @if (step === 'upload') {\n <div class=\"ie-upload-area\" #stepBox tabindex=\"-1\">\n <div class=\"ie-template-hint\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"/></svg>{{ labels.t('importExport.startWithOurCsvTemplate') }}<ui-button variant=\"ghost\" size=\"sm\" data-testid=\"import-template-button\" (click)=\"downloadTemplate()\">{{ config.templateLabel || labels.t('importExport.downloadTemplate') }}</ui-button>\n </div>\n <label class=\"ie-dropzone\" [class.has-error]=\"!!fileError\">\n <input type=\"file\" class=\"ie-file-hidden\" accept=\".csv,text/csv\" [attr.aria-invalid]=\"fileError ? 'true' : null\" [attr.aria-describedby]=\"fileError ? uid + '-file-error' : null\" (change)=\"onFileChange($event)\" />\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#94a3b8\" stroke-width=\"1.5\" aria-hidden=\"true\"><path d=\"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4\"/><polyline points=\"17 8 12 3 7 8\"/><line x1=\"12\" y1=\"3\" x2=\"12\" y2=\"15\"/></svg>\n <span class=\"ie-dropzone-text\">{{ labels.t('importExport.clickToChooseACsv') }}</span>\n <span class=\"ie-dropzone-sub\">{{ labels.t('importExport.supportedCsvFiles') }}</span>\n </label>\n @if (fileError) { <p class=\"ie-error\" role=\"alert\" [id]=\"uid + '-file-error'\">{{ fileError }}</p> }\n </div>\n }\n\n <!-- Step 3: Column mapping -->\n @if (step === 'mapping') {\n <div class=\"ie-mapping\" #stepBox tabindex=\"-1\">\n @if (allRequiredMapped) {\n <div class=\"ie-mapping-success\">\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"m9 12 2 2 4-4\"/></svg>{{ labels.t('importExport.allRequiredColumnsMatchedAutomatically') }}<strong>{{ labels.t('importExport.previewImport') }}</strong>{{ labels.t('importExport.toContinue') }}</div>\n } @else {\n <p class=\"ie-mapping-hint\">\n {{ labels.t(unmappedRequiredFields.length === 1 ? 'importExport.unmappedRequired_one' : 'importExport.unmappedRequired_other', { count: unmappedRequiredFields.length }) }} <strong>{{ unmappedRequiredFields.join(', ') }}</strong>.\n {{ labels.t('importExport.mapManually') }}\n </p>\n }\n <div class=\"ie-mapping-table\" role=\"table\" [attr.aria-label]=\"labels.t('importExport.columnMapping', { entity: config.entityName })\">\n <div class=\"ie-mapping-header\" role=\"row\">\n <span role=\"columnheader\">{{ labels.t('importExport.entityField', { entity: config.entityName }) }}</span>\n <span role=\"columnheader\">{{ labels.t('importExport.yourCsvColumn') }}</span>\n <span role=\"columnheader\">{{ labels.t('importExport.sampleValue') }}</span>\n </div>\n @for (field of config.importFields; track field.key) {\n <div class=\"ie-mapping-row\" [class.ie-mapping-row--matched]=\"!!columnMapping[field.key]\" [class.ie-mapping-row--required-missing]=\"field.required && !columnMapping[field.key]\" role=\"row\">\n <span class=\"ie-field-label\" role=\"rowheader\">\n @if (columnMapping[field.key]) {\n <svg class=\"ie-match-icon\" width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><path d=\"m20 6-11 11-5-5\"/></svg>\n }\n {{ field.label }}\n @if (field.required) { <span class=\"ie-required\" aria-hidden=\"true\">*</span> }\n @if (field.example) { <ui-hint class=\"ie-field-example\" [attr.id]=\"exampleId(field)\">{{ labels.t('common.example', { value: field.example }) }}</ui-hint> }\n </span>\n <div role=\"cell\">\n <ui-select\n [ariaLabel]=\"labels.t(field.required ? 'importExport.columnForRequired' : 'importExport.columnFor', { field: field.label })\"\n [ariaDescribedBy]=\"field.example ? exampleId(field) : ''\"\n [options]=\"csvHeaderOptions\"\n [(ngModel)]=\"columnMapping[field.key]\"\n [error]=\"field.required && !columnMapping[field.key] ? labels.t('importExport.requiredError') : ''\" />\n </div>\n <span class=\"ie-sample\" role=\"cell\">{{ getSample(field.key) }}</span>\n </div>\n }\n </div>\n @if (unmatchedCsvHeaders.length > 0) {\n <p class=\"ie-mapping-unmatched\">\n <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"/></svg>\n {{ labels.t(unmatchedCsvHeaders.length === 1 ? 'importExport.unmatchedCsv_one' : 'importExport.unmatchedCsv_other', { count: unmatchedCsvHeaders.length }) }} <em>{{ unmatchedCsvHeaders.join(', ') }}</em>\n </p>\n }\n @if (mappingError) { <p class=\"ie-error\" role=\"alert\">{{ mappingError }}</p> }\n </div>\n }\n\n <!-- Step 4: Preview -->\n @if (step === 'preview') {\n <div class=\"ie-preview\" #stepBox tabindex=\"-1\">\n <p class=\"ie-mapping-hint\">{{ labels.t(previewRows.length === 1 ? 'importExport.previewRows_one' : 'importExport.previewRows_other', { shown: previewRows.length, total: csvRows.length }) }}</p>\n @if (validating) {\n <p class=\"ie-progress-text\" role=\"status\" data-testid=\"import-validating\">{{ labels.t('importExport.checkingYourRows') }}</p>\n }\n @if (validationErrors && validationErrors.length > 0) {\n <div class=\"ie-errors-list ie-validation\" data-testid=\"import-validation\">\n <p class=\"ie-errors-title\" role=\"alert\" data-testid=\"import-validation-summary\">{{ labels.t(validationRowCount === 1 ? 'importExport.rowsWithErrors_one' : 'importExport.rowsWithErrors_other', { count: validationRowCount }) }}</p>\n @if (allOrNothing()) {\n <p class=\"ie-mapping-hint ie-validation-hint\" data-testid=\"import-all-or-nothing-hint\">{{ labels.t('importExport.nothingIsSavedUntilEvery') }}</p>\n }\n <ul class=\"ie-result-list\" [attr.aria-label]=\"labels.t('importExport.rowsWithErrors')\">\n @for (err of validationErrors; track $index) {\n <li class=\"ie-error-row\" data-testid=\"import-validation-row\">\n <span class=\"ie-error-row-num\">{{ labels.t('importExport.rowNumber', { row: err.row }) }}</span>&ngsp;<span>{{ err.message }}</span>\n </li>\n }\n </ul>\n </div>\n }\n <div class=\"ie-preview-scroll\" tabindex=\"0\" role=\"region\" [attr.aria-label]=\"labels.t('importExport.importDataPreview')\">\n <table class=\"ie-preview-table\" [attr.aria-label]=\"labels.t('importExport.importDataPreview')\">\n <thead>\n <tr>@for (field of mappedFields; track field.key) { <th scope=\"col\">{{ field.label }}</th> }</tr>\n </thead>\n <tbody>\n @for (row of previewRows; track $index) {\n <tr>@for (field of mappedFields; track field.key) { <td>{{ row[field.key] || '—' }}</td> }</tr>\n }\n </tbody>\n </table>\n </div>\n @if (importing) {\n <div class=\"ie-progress\" data-testid=\"import-progress\">\n <div class=\"ie-progress-track\" aria-hidden=\"true\"><span class=\"ie-progress-bar\"></span></div>\n <p class=\"ie-progress-text\" data-testid=\"import-progress-text\">{{ labels.t(csvRows.length === 1 ? 'importExport.importingRecords_one' : 'importExport.importingRecords_other', { count: labels.formatNumber(csvRows.length) }) }} <span aria-hidden=\"true\">{{ importElapsed }}s.</span> {{ labels.t('importExport.keepThisWindowOpenUntil') }}</p>\n </div>\n }\n </div>\n }\n\n <!-- Step 5: Result -->\n @if (step === 'result') {\n <div class=\"ie-result\" #resultBox tabindex=\"-1\" role=\"region\" [attr.aria-label]=\"labels.t('importExport.importResult')\">\n @if (importResult) {\n <div class=\"ie-result-summary\">\n <div class=\"ie-result-stat success\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"m9 12 2 2 4-4\"/></svg>\n <strong>{{ importResult.imported }}</strong> {{ labels.t(importResult.imported === 1 ? 'importExport.recordSImported_one' : 'importExport.recordSImported_other') }}</div>\n @if (importResult.errors.length > 0) {\n <div class=\"ie-result-stat error\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"/><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"/></svg>\n <strong>{{ importResult.errors.length }}</strong> {{ labels.t(importResult.errors.length === 1 ? 'importExport.rowSHadErrors_one' : 'importExport.rowSHadErrors_other') }}</div>\n }\n @if (importResult.warnings.length > 0) {\n <div class=\"ie-result-stat warning\">\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" aria-hidden=\"true\"><path d=\"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"/><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"/><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"/></svg>\n <strong>{{ importResult.warnings.length }}</strong> {{ labels.t(importResult.warnings.length === 1 ? 'importExport.valueSChangedDuringImport_one' : 'importExport.valueSChangedDuringImport_other') }}</div>\n }\n </div>\n @if (importResult.errors.length > 0) {\n <div class=\"ie-errors-list\">\n <p class=\"ie-errors-title\" [id]=\"uid + '-errors-title'\">{{ labels.t('importExport.errors') }}</p>\n <ul class=\"ie-result-list\" [attr.aria-labelledby]=\"uid + '-errors-title'\">\n @for (err of importResult.errors; track $index) {\n <li class=\"ie-error-row\">\n <span class=\"ie-error-row-num\">{{ labels.t('importExport.rowNumber', { row: err.row }) }}</span>&ngsp;<span>{{ err.message }}</span>\n </li>\n }\n </ul>\n </div>\n }\n @if (importResult.warnings.length > 0) {\n <div class=\"ie-warnings-list\">\n <p class=\"ie-warnings-title\" [id]=\"uid + '-warnings-title'\">{{ labels.t('importExport.importedWithChanges') }}</p>\n <ul class=\"ie-result-list\" [attr.aria-labelledby]=\"uid + '-warnings-title'\">\n @for (w of importResult.warnings; track $index) {\n <li class=\"ie-warning-row\">\n <span class=\"ie-warning-row-num\">{{ labels.t('importExport.rowNumber', { row: w.row }) }}</span>&ngsp;<span>{{ w.message }}</span>\n </li>\n }\n </ul>\n </div>\n }\n }\n </div>\n }\n\n <!-- Footer. Every item is its own top-level @if with ONE root element: that is what lets ui-modal project it into its footer slot (a wrapper block with several items would land in the body). -->\n <!-- closeOnly (the setup wizard): no Back, no Cancel - one Close that shuts the window at once, plus the step's primary button -->\n @if (closeOnly() && step !== 'result') {\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" data-testid=\"import-close-button\" [disabled]=\"importing\" (click)=\"closeImport()\">{{ labels.t('common.close') }}</ui-button>\n }\n @if (closeOnly() && step === 'source') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" [disabled]=\"!selectedSource\" (click)=\"confirmSource()\">{{ labels.t('common.next') }}</ui-button>\n }\n @if (closeOnly() && step === 'mapping') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" [disabled]=\"!canSubmit\" (click)=\"goToPreview()\">{{ labels.t('importExport.previewImport') }}</ui-button>\n }\n @if (closeOnly() && step === 'preview') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" [loading]=\"importing\" [disabled]=\"importBlocked\" data-testid=\"import-submit-button\" (click)=\"submitImport()\">{{ importButtonLabel }}</ui-button>\n }\n @if (!closeOnly() && step === 'source') {\n <ui-button modal-footer-left variant=\"secondary\" size=\"sm\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n }\n @if (!closeOnly() && step === 'source') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" [disabled]=\"!selectedSource\" (click)=\"confirmSource()\">{{ labels.t('common.next') }}</ui-button>\n }\n @if (!closeOnly() && step === 'upload') {\n <span modal-footer-left></span>\n }\n @if (!closeOnly() && step === 'upload' && importSources()?.length) {\n <div modal-footer-right class=\"ie-footer-right\">\n <ui-button variant=\"ghost\" size=\"sm\" (click)=\"goTo('source')\">{{ labels.t('common.back') }}</ui-button>\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n </div>\n }\n @if (!closeOnly() && step === 'upload' && !importSources()?.length) {\n <ui-button modal-footer-right variant=\"secondary\" size=\"sm\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n }\n @if (!closeOnly() && step === 'mapping') {\n <ui-button modal-footer-left variant=\"ghost\" size=\"sm\" (click)=\"goTo('upload')\">{{ labels.t('common.back') }}</ui-button>\n }\n @if (!closeOnly() && step === 'mapping') {\n <div modal-footer-right class=\"ie-footer-right\">\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button variant=\"primary\" size=\"sm\" [disabled]=\"!canSubmit\" (click)=\"goToPreview()\">{{ labels.t('importExport.previewImport') }}</ui-button>\n </div>\n }\n @if (!closeOnly() && step === 'preview') {\n <ui-button modal-footer-left variant=\"ghost\" size=\"sm\" [disabled]=\"importing\" (click)=\"goTo('mapping')\">{{ labels.t('common.back') }}</ui-button>\n }\n @if (!closeOnly() && step === 'preview') {\n <div modal-footer-right class=\"ie-footer-right\">\n <ui-button variant=\"secondary\" size=\"sm\" [disabled]=\"importing\" (click)=\"closeImport()\">{{ labels.t('common.cancel') }}</ui-button>\n <ui-button variant=\"primary\" size=\"sm\" [loading]=\"importing\" [disabled]=\"importBlocked\" data-testid=\"import-submit-button\" (click)=\"submitImport()\">{{ importButtonLabel }}</ui-button>\n </div>\n }\n @if (step === 'result') {\n <span modal-footer-left></span>\n }\n @if (step === 'result') {\n <ui-button modal-footer-right variant=\"primary\" size=\"sm\" (click)=\"finishImport()\">{{ labels.t('common.done') }}</ui-button>\n }\n\n </ui-modal>\n `,\n styles: [`\n .ie-actions { display: flex; gap: 8px; }\n\n /* Step indicator */\n .ie-steps { display: flex; align-items: center; margin-bottom: 24px; gap: 0; list-style: none; padding: 0; }\n .ie-step { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }\n .ie-step-num { width: 24px; height: 24px; border-radius: 50%; background: #e2e8f0; color: #64748b; font-size: 0.75rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }\n .ie-step-label { font-size: 0.8125rem; color: #64748b; font-weight: 500; }\n .ie-step.active .ie-step-num { background: #3b82f6; color: #fff; }\n .ie-step.active .ie-step-label { color: #1e293b; font-weight: 600; }\n .ie-step.done .ie-step-num { background: #22c55e; color: #fff; }\n .ie-step.done .ie-step-label { color: #64748b; }\n /* the line between two steps is drawn by the step itself (an <ol> may only hold <li> children) */\n .ie-step:not(:last-child) { flex: 1 1 auto; }\n .ie-step:not(:last-child)::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; margin: 0 8px; min-width: 16px; }\n .ie-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n\n /* Source step */\n .ie-source-step { display: flex; flex-direction: column; gap: 16px; }\n\n /* Upload step */\n .ie-upload-area { display: flex; flex-direction: column; gap: 12px; }\n .ie-template-hint { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.875rem; color: #64748b; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 14px; }\n /* visually hidden but still focusable and operable by keyboard (Enter / Space open the file picker); never display:none */\n /* The input covers the whole drop zone, so a file dropped onto the zone lands on it and a click anywhere opens the picker. */\n .ie-file-hidden { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; overflow: hidden; cursor: pointer; }\n .ie-dropzone {\n position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;\n gap: 8px; padding: 40px 24px; border: 2px dashed #7c8ba1; border-radius: 10px;\n cursor: pointer; transition: border-color 180ms ease, background 180ms ease;\n &:hover, &:focus-within { border-color: #3b82f6; background: #f0f7ff; }\n &:focus-within { outline: 2px solid #3b82f6; outline-offset: 2px; }\n &.has-error { border-color: #ef4444; }\n }\n .ie-dropzone-text { font-size: 0.9375rem; font-weight: 600; color: #1e293b; }\n .ie-dropzone-sub { font-size: 0.8125rem; color: #64748b; }\n\n /* Mapping step */\n .ie-mapping { display: flex; flex-direction: column; gap: 12px; }\n .ie-mapping-hint { font-size: 0.875rem; color: #64748b; margin: 0; }\n .ie-mapping-success { display: flex; align-items: flex-start; gap: 8px; padding: 10px 14px; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; font-size: 0.875rem; color: #15803d; svg { flex-shrink: 0; margin-top: 1px; color: #16a34a; } }\n .ie-mapping-unmatched { display: flex; align-items: flex-start; gap: 6px; font-size: 0.8125rem; color: #64748b; margin: 0; padding-top: 4px; svg { flex-shrink: 0; margin-top: 1px; } em { font-style: normal; color: #475569; } }\n .ie-mapping-table { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }\n .ie-mapping-header { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 8px 12px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; font-size: 0.75rem; font-weight: 600; color: #64748b; text-transform: uppercase; }\n .ie-mapping-row { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: start; padding: 8px 12px; border-bottom: 1px solid #f1f5f9; gap: 8px; &:last-child { border-bottom: none; } }\n .ie-mapping-row.ie-mapping-row--required-missing { background: #fff7ed; .ie-field-label { color: #c2410c; } }\n .ie-match-icon { color: #16a34a; margin-right: 4px; vertical-align: -1px; }\n .ie-field-label { display: flex; flex-wrap: wrap; align-items: center; font-size: 0.875rem; color: #1e293b; font-weight: 500; }\n .ie-field-example { flex-basis: 100%; font-weight: 400; }\n .ie-required { color: #dc2626; margin-left: 2px; }\n .ie-sample { font-size: 0.8125rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n\n /* Preview step */\n .ie-preview { display: flex; flex-direction: column; gap: 12px; }\n .ie-preview-scroll { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 8px; &:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; } }\n .ie-result:focus, .ie-source-step:focus, .ie-upload-area:focus, .ie-mapping:focus, .ie-preview:focus { outline: none; }\n .ie-result-list { list-style: none; margin: 0; padding: 0; }\n .ie-preview-table { width: 100%; border-collapse: collapse; font-size: 0.8125rem; th { background: #f8fafc; padding: 8px 12px; text-align: left; font-size: 0.75rem; font-weight: 600; color: #64748b; text-transform: uppercase; border-bottom: 1px solid #e2e8f0; white-space: nowrap; } td { padding: 7px 12px; color: #1e293b; border-bottom: 1px solid #f1f5f9; max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } tr:last-child td { border-bottom: none; } }\n\n /* Result step */\n .ie-result { display: flex; flex-direction: column; gap: 16px; }\n .ie-result-summary { display: flex; flex-direction: column; gap: 8px; }\n .ie-result-stat { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 8px; font-size: 0.9375rem; &.success { background: #f0fdf4; color: #15803d; svg { stroke: #22c55e; } } &.error { background: #fef2f2; color: #b91c1c; svg { stroke: #ef4444; } } &.warning { background: #fffbeb; color: #b45309; svg { stroke: #f59e0b; } } }\n .ie-progress { margin-top: 14px; }\n .ie-progress-track { height: 6px; border-radius: 999px; background: #e2e8f0; overflow: hidden; position: relative; }\n .ie-progress-bar { position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 999px; background: #2563eb; animation: ie-progress-slide 1.2s ease-in-out infinite; }\n .ie-progress-text { margin: 8px 0 0; font-size: 0.8125rem; color: #475569; }\n @keyframes ie-progress-slide { 0% { left: -35%; } 100% { left: 100%; } }\n @media (prefers-reduced-motion: reduce) { .ie-progress-bar { animation: none; width: 100%; opacity: 0.5; } }\n .ie-errors-list { border: 1px solid #fecaca; border-radius: 8px; overflow: hidden; }\n .ie-errors-title { font-size: 0.8125rem; font-weight: 600; color: #b91c1c; padding: 8px 12px; background: #fef2f2; margin: 0; border-bottom: 1px solid #fecaca; }\n .ie-error-row { display: flex; gap: 12px; padding: 7px 12px; border-bottom: 1px solid #fff1f2; font-size: 0.8125rem; color: #374151; &:last-child { border-bottom: none; } }\n .ie-error-row-num { font-weight: 600; color: #b91c1c; flex-shrink: 0; }\n .ie-warnings-list { border: 1px solid #fde68a; border-radius: 8px; overflow: hidden; }\n .ie-warnings-title { font-size: 0.8125rem; font-weight: 600; color: #b45309; padding: 8px 12px; background: #fffbeb; margin: 0; border-bottom: 1px solid #fde68a; }\n .ie-warning-row { display: flex; gap: 12px; padding: 7px 12px; border-bottom: 1px solid #fef3c7; font-size: 0.8125rem; color: #374151; &:last-child { border-bottom: none; } }\n .ie-warning-row-num { font-weight: 600; color: #b45309; flex-shrink: 0; }\n\n /* Shared */\n .ie-error { font-size: 0.875rem; color: #dc2626; margin: 0; }\n .ie-footer-right { display: flex; gap: 8px; align-items: center; }\n\n @media (max-width: 600px) {\n /* hidden visually on a phone but still read by screen readers (display:none would remove the step names) */\n .ie-step-label { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }\n .ie-dropzone { padding: 24px 16px; }\n .ie-mapping-header { grid-template-columns: 1fr 1fr; span:last-child { display: none; } }\n .ie-mapping-row { grid-template-columns: 1fr 1fr; .ie-sample { display: none; } }\n }\n `],\n})\nexport class ImportExportComponent {\n protected readonly labels = inject(UiLabelsService);\n readonly _configInput = input<ImportExportConfig | null>(null, { alias: 'config' });\n readonly importSources = input<ImportSource[] | undefined>(undefined);\n readonly exportParams = input<Record<string, string>>({});\n readonly exportOnly = input(false);\n /** The window's footer has one Close button that closes it at once, never Back / Cancel (the setup wizard). */\n readonly closeOnly = input(false);\n /**\n * Replaces the built-in `POST importEndpoint { records }` for an app whose import runs differently (e.g. the server reads the CSV file itself):\n * receives the chosen file, the parsed rows (field key -> value) and the mapping (field key -> CSV column) and answers the result.\n */\n readonly submit = input<((request: ImportSubmitRequest) => Observable<ImportSubmitResult>) | null>(null);\n /**\n * A check of the mapped rows that runs when the Preview step opens (e.g. the server's dry run). It gets the same request as `submit`\n * and answers the rows that would be refused; they are listed above the preview (\"N rows with errors found\") and the button reads\n * \"Import Valid Rows\". A check that fails shows no list (the import is still decided by the server). Omit it and nothing changes.\n */\n readonly validate = input<((request: ImportSubmitRequest) => Observable<ImportRowIssue[]>) | null>(null);\n /**\n * With `validate`: the server saves nothing when any row is refused, so the import button stays disabled while the check runs, failed,\n * or listed errors (and the list says so). Without `validate` it has no effect.\n */\n readonly allOrNothing = input(false);\n /** Fired when the user presses Done after an import, with what the import answered (also `imported`). */\n readonly finished = output<ImportSubmitResult>();\n readonly imported = output<void>();\n\n config!: ImportExportConfig;\n\n private static nextUid = 0;\n /** Unique prefix for the ids this window links with aria-describedby / aria-labelledby. */\n readonly uid = `ie-${++ImportExportComponent.nextUid}`;\n private readonly resultBox = viewChild<ElementRef<HTMLElement>>('resultBox');\n /** The container of the step on screen (Source / Upload / Map Columns / Preview): focused when the step changes, because the control the user pressed is gone. */\n private readonly stepBox = viewChild<ElementRef<HTMLElement>>('stepBox');\n\n private readonly http = inject(HttpClient);\n /** API root from FORGEROUTE_CONFIG (e.g. a cross-origin prod API); falls back to same-origin `/api`. */\n private readonly apiBase = inject(FORGEROUTE_CONFIG, { optional: true })?.baseUrl ?? '/api';\n private readonly toast = inject(ToastService);\n private readonly cdr = inject(ChangeDetectorRef);\n private readonly destroyRef = inject(DestroyRef);\n /** Seconds since the import request started (shown while it runs). */\n importElapsed = 0;\n private importTimer: ReturnType<typeof setInterval> | null = null;\n\n constructor() {\n this.destroyRef.onDestroy(() => this.stopImportTimer());\n effect(() => { const v = this._configInput(); if (v !== null) this.config = v!; });\n }\n\n // ── Export ────────────────────────────────────────────────────────────────\n\n exporting = false;\n\n exportAll(): void {\n if (this.exporting) return;\n this.exporting = true;\n this.cdr.detectChanges();\n let params = tableQueryParams().set('size', '10000');\n Object.entries(this.exportParams()).forEach(([k, v]) => { if (v) params = params.set(k, v); });\n this.http.get<any>(`${this.apiBase}${this.config.exportEndpoint}`, { params }).subscribe({\n next: (response) => {\n const items: any[] = response.content ?? response;\n const totalInDb: number = response.totalElements ?? items.length;\n exportToCsv(\n this.config.entityNamePlural.toLowerCase().replace(/\\s+/g, '-'),\n this.config.exportHeaders,\n items.map(item => this.config.exportRow(item)),\n );\n this.exporting = false;\n if (totalInDb > items.length) {\n this.toast.show(this.labels.t('importExport.exportLimitReached', { count: items.length, total: totalInDb, entity: this.config.entityNamePlural.toLowerCase() }));\n } else {\n const noun = items.length === 1 ? this.config.entityName : this.config.entityNamePlural;\n this.toast.show(this.labels.t('importExport.exportedCount', { count: items.length, noun: noun.toLowerCase() }));\n }\n this.cdr.detectChanges();\n },\n error: () => {\n this.exporting = false;\n this.toast.error(this.labels.t('importExport.exportFailed', { entity: this.config.entityNamePlural.toLowerCase() }));\n this.cdr.detectChanges();\n },\n });\n }\n\n downloadTemplate(): void {\n const headers = (this.config.importFields ?? []).map(f => f.label);\n exportToCsv(\n `${this.config.entityName.toLowerCase().replace(/\\s+/g, '-')}-template`,\n headers,\n this.config.templateSampleRows ?? [],\n );\n }\n\n // ── Import modal state ────────────────────────────────────────────────────\n\n importOpen = false;\n step: ImportStep = 'upload';\n selectedSource = '';\n csvHeaders: string[] = [];\n csvRows: string[][] = [];\n fileError: string | null = null;\n columnMapping: Record<string, string> = {};\n mappingError: string | null = null;\n importing = false;\n /** The `validate` check of the Preview step is running. */\n validating = false;\n /** Result of the `validate` check: null = not run yet / failed, [] = every row is fine. */\n validationErrors: ImportRowIssue[] | null = null;\n private validationRun = 0;\n /** `warnings` = rows imported with a value changed (e.g. an unrecognised status mapped to the default). */\n importResult: { imported: number; errors: ImportError[]; warnings: ImportError[] } | null = null;\n\n get stepIndex(): number {\n if (this.importSources()) {\n return ({ source: 0, upload: 1, mapping: 2, preview: 3, result: 4 } as any)[this.step] ?? 0;\n }\n return ({ upload: 0, mapping: 1, preview: 2, result: 3 } as any)[this.step] ?? 0;\n }\n\n /** The progress list: one entry per step with its number, label and whether it is the current / a finished step. */\n get stepItems(): { key: ImportStep; num: number; label: string; current: boolean; done: boolean }[] {\n const keys: [ImportStep, string][] = [\n ...(this.importSources() ? [['source', this.labels.t('importExport.step.source')] as [ImportStep, string]] : []),\n ['upload', this.labels.t('importExport.step.upload')], ['mapping', this.labels.t('importExport.step.mapping')], ['preview', this.labels.t('common.preview')], ['result', this.labels.t('common.done')],\n ];\n const index = this.stepIndex;\n return keys.map(([key, label], i) => ({ key, num: i + 1, label, current: this.step === key, done: key !== 'result' && index > i }));\n }\n\n /** What the persistent status region says once the import has finished (empty before). */\n get resultAnnouncement(): string {\n // while the request runs the static sentence is announced once (the per-second counter in the visible text is aria-hidden)\n if (this.importing) return `${this.labels.t(this.csvRows.length === 1 ? 'importExport.importingRecords_one' : 'importExport.importingRecords_other', { count: this.labels.formatNumber(this.csvRows.length) })} ${this.labels.t('importExport.keepThisWindowOpenUntil')}`;\n const r = this.step === 'result' ? this.importResult : null;\n if (!r) return '';\n return [\n this.labels.t(r.imported === 1 ? 'importExport.recordsImported_one' : 'importExport.recordsImported_other', { count: r.imported }),\n r.errors.length ? this.labels.t(r.errors.length === 1 ? 'importExport.rowsHadErrors_one' : 'importExport.rowsHadErrors_other', { count: r.errors.length }) : '',\n r.warnings.length ? this.labels.t(r.warnings.length === 1 ? 'importExport.valuesChanged_one' : 'importExport.valuesChanged_other', { count: r.warnings.length }) : '',\n ].filter(Boolean).join(' ');\n }\n\n get modalTitle(): string {\n if (this.selectedSource && this.selectedSource !== 'custom') {\n const src = this.importSources()?.find(s => s.value === this.selectedSource);\n if (src) return this.labels.t('importExport.importFrom', { source: src.label });\n }\n return this.labels.t('importExport.importEntity', { entity: this.config?.entityNamePlural ?? '' });\n }\n\n openImport(): void {\n this.importOpen = true;\n this.step = this.importSources()?.length ? 'source' : 'upload';\n this.selectedSource = '';\n this.csvHeaders = []; this.csvRows = []; this.csvFile = null;\n this.fileError = null; this.columnMapping = {};\n this.mappingError = null; this.importResult = null;\n this.resetValidation();\n // Called from the host data-table (outside this OnPush view) — must trigger CD or the wizard never renders.\n this.cdr.detectChanges();\n }\n\n onSourceSelected(value: string): void { this.selectedSource = value; this.cdr.detectChanges(); }\n\n confirmSource(): void {\n if (!this.selectedSource) return;\n const src = this.importSources()?.find(s => s.value === this.selectedSource);\n this.config = { ...this.config, columnAliases: src?.aliases ?? {} };\n this.goTo('upload');\n }\n\n closeImport(): void {\n if (this.importing) return; // the window cannot be dismissed (Escape, backdrop, X, Close) while the request runs\n if (this.step === 'result') this.finishImport();\n else this.importOpen = false;\n }\n\n finishImport(): void {\n this.importOpen = false;\n if (this.importResult) this.finished.emit(this.importResult);\n this.imported.emit();\n }\n\n onFileChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n const file = input.files?.[0];\n if (!file) return;\n // Forget the chosen file in the input (the File object stays valid): choosing the SAME file again after fixing it still fires `change`.\n input.value = '';\n this.readCsvFile(file);\n }\n\n private csvFile: File | null = null;\n\n private readCsvFile(file: File, encoding?: string): void {\n this.csvFile = file;\n const reader = new FileReader();\n reader.onload = (e) => {\n const raw = e.target!.result as string;\n // an Excel \"CSV\" saved in a Windows code page shows U+FFFD for every accent when read as UTF-8: read it once more as Windows-1252\n if (!encoding && raw.includes('\\uFFFD')) { this.readCsvFile(file, 'windows-1252'); return; }\n try {\n const parsed = parseCsv(raw.trim());\n if (parsed.length < 1) { this.fileError = this.labels.t('importExport.csvEmpty'); this.cdr.detectChanges(); return; }\n if (parsed.length < 2) { this.fileError = this.labels.t('importExport.csvNeedsRows'); this.cdr.detectChanges(); return; }\n this.csvHeaders = parsed[0]; this.csvRows = parsed.slice(1);\n this.fileError = null; this.autoMap();\n this.goTo('mapping');\n } catch {\n this.fileError = this.labels.t('importExport.csvParseFailed');\n this.cdr.detectChanges();\n }\n };\n if (encoding) reader.readAsText(file, encoding); else reader.readAsText(file);\n }\n\n private autoMap(): void {\n this.columnMapping = {};\n const normalize = (s: string) => s.trim().toLowerCase().replace(/[\\s_\\-./]+/g, '');\n for (const field of (this.config.importFields ?? [])) {\n const normalizedLabel = normalize(field.label);\n const normalizedKey = normalize(field.key);\n let match = this.csvHeaders.find(h => h.trim().toLowerCase() === field.label.toLowerCase() || h.trim().toLowerCase() === field.key.toLowerCase());\n if (!match) match = this.csvHeaders.find(h => { const n = normalize(h); return n === normalizedLabel || n === normalizedKey; });\n if (!match && this.config.columnAliases?.[field.key]) {\n const aliases = this.config.columnAliases[field.key].map(normalize);\n match = this.csvHeaders.find(h => aliases.includes(normalize(h)));\n }\n this.columnMapping[field.key] = match ?? '';\n }\n // second pass for the REQUIRED fields still empty (a wrong guess on an optional field is worse than a blank one): a header that CONTAINS the field's words (\"Primary Email Address\" for Email), only when exactly one\n // unused header does, so \"Phone 1\" / \"Phone 2\" stay a manual choice and \"Real Estate Agent\" never lands in State\n const tokens = (t: string) => t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);\n const containsRun = (haystack: string[], needle: string[]) => needle.length > 0 && haystack.some((_, i) => needle.every((w, j) => haystack[i + j] === w));\n for (const field of (this.config.importFields ?? [])) {\n if (this.columnMapping[field.key] || !field.required) continue;\n const used = new Set(Object.values(this.columnMapping).filter(Boolean));\n const terms = [field.label, field.key.replace(/([a-z])([A-Z])/g, '$1 $2'), ...(this.config.columnAliases?.[field.key] ?? [])].map(tokens).filter(t => t.join('').length >= 3);\n const candidates = this.csvHeaders.filter(h => !used.has(h) && terms.some(t => containsRun(tokens(h), t)));\n if (new Set(candidates).size === 1) this.columnMapping[field.key] = candidates[0];\n }\n }\n\n private static nextId = 0;\n private readonly idPrefix = `ie-ex-${ImportExportComponent.nextId++}-`;\n /** Id of a field's example hint (the column dropdown points at it with aria-describedby). */\n protected exampleId(field: ImportFieldDef): string { return this.idPrefix + field.key; }\n\n get canSubmit(): boolean { return (this.config.importFields ?? []).filter(f => f.required).every(f => !!this.columnMapping[f.key]); }\n get unmappedRequiredFields(): string[] { return (this.config.importFields ?? []).filter(f => f.required && !this.columnMapping[f.key]).map(f => f.label); }\n get unmatchedCsvHeaders(): string[] { const used = new Set(Object.values(this.columnMapping).filter(Boolean)); return this.csvHeaders.filter(h => !used.has(h)); }\n\n get csvHeaderOptions(): SelectOption[] {\n return [\n { value: '', label: this.labels.t('importExport.leaveBlank') },\n ...this.csvHeaders.map(h => ({ value: h, label: h })),\n ];\n }\n get allRequiredMapped(): boolean { return this.unmappedRequiredFields.length === 0; }\n\n getSample(fieldKey: string): string {\n const col = this.columnMapping[fieldKey];\n if (!col) return '';\n const idx = this.csvHeaders.indexOf(col);\n return idx < 0 ? '' : (this.csvRows[0]?.[idx] ?? '');\n }\n\n goToPreview(): void {\n this.mappingError = null;\n const missing = (this.config.importFields ?? []).filter(f => f.required && !this.columnMapping[f.key]).map(f => f.label);\n if (missing.length) { this.mappingError = this.labels.t('importExport.requiredNotMapped', { fields: missing.join(', ') }); return; }\n this.goTo('preview');\n this.runValidation();\n }\n\n private resetValidation(): void { this.validationRun++; this.validating = false; this.validationErrors = null; }\n\n private runValidation(): void {\n this.resetValidation();\n const check = this.validate();\n if (!check) return;\n const run = this.validationRun;\n this.validating = true;\n this.cdr.detectChanges();\n check(this.buildRequest()).subscribe({\n next: (issues) => { if (run !== this.validationRun) return; this.validating = false; this.validationErrors = issues; this.cdr.detectChanges(); },\n error: () => { if (run !== this.validationRun) return; this.validating = false; this.validationErrors = null; this.cdr.detectChanges(); },\n });\n }\n\n /** Number of different rows the check refused. */\n get validationRowCount(): number { return new Set((this.validationErrors ?? []).map(e => e.row)).size; }\n\n /** `allOrNothing`: no import before a check came back clean. */\n get importBlocked(): boolean {\n return this.allOrNothing() && !!this.validate() && (this.validating || this.validationErrors === null || this.validationErrors.length > 0);\n }\n\n get importButtonLabel(): string {\n return this.validationErrors && this.validationErrors.length > 0 && !this.allOrNothing() ? this.labels.t('importExport.importValidRows') : this.labels.t(this.csvRows.length === 1 ? 'importExport.importRecords_one' : 'importExport.importRecords_other', { count: this.csvRows.length });\n }\n\n get mappedFields(): ImportFieldDef[] { return (this.config.importFields ?? []).filter(f => !!this.columnMapping[f.key]); }\n\n get previewRows(): Record<string, string>[] {\n return this.csvRows.slice(0, 5).map(row => {\n const record: Record<string, string> = {};\n for (const field of (this.config.importFields ?? [])) {\n const col = this.columnMapping[field.key];\n if (!col) continue;\n const idx = this.csvHeaders.indexOf(col);\n record[field.key] = idx >= 0 ? (row[idx] ?? '') : '';\n }\n return record;\n });\n }\n\n /** Shows another step and moves focus to its container (the pressed button / focused file input was removed from the page). */\n goTo(step: ImportStep): void {\n this.step = step;\n this.cdr.detectChanges();\n this.stepBox()?.nativeElement.focus();\n }\n\n /** Moves focus to the result summary (the button that had it is gone), so keyboard and screen reader users land on the outcome. */\n private focusResult(): void {\n this.resultBox()?.nativeElement.focus();\n }\n\n private stopImportTimer(): void {\n if (this.importTimer !== null) { clearInterval(this.importTimer); this.importTimer = null; }\n }\n\n private buildRequest(): ImportSubmitRequest {\n const records = this.csvRows.map(row => {\n const record: Record<string, string> = {};\n for (const field of (this.config.importFields ?? [])) {\n const col = this.columnMapping[field.key];\n if (!col) continue;\n const idx = this.csvHeaders.indexOf(col);\n record[field.key] = idx >= 0 ? (row[idx]?.trim() ?? '') : '';\n }\n return record;\n });\n return { file: this.csvFile, records, mapping: { ...this.columnMapping } };\n }\n\n submitImport(): void {\n if (this.importBlocked) return;\n this.importing = true;\n this.importElapsed = 0;\n this.stopImportTimer();\n this.importTimer = setInterval(() => { this.importElapsed++; this.cdr.detectChanges(); }, 1000);\n this.cdr.detectChanges();\n const request = this.buildRequest();\n const custom = this.submit();\n const request$: Observable<ImportSubmitResult> = custom\n ? custom(request)\n : this.http.post<ImportSubmitResult>(`${this.apiBase}${this.config.importEndpoint ?? ''}`, { records: request.records });\n request$.subscribe({\n next: (result) => {\n this.stopImportTimer();\n this.importing = false;\n this.importResult = { imported: result.imported, errors: result.errors ?? [], warnings: result.warnings ?? [] };\n this.step = 'result';\n if (result.imported > 0) this.toast.show(this.labels.t('importExport.importedSuccessfully', { count: result.imported, entity: this.config.entityNamePlural.toLowerCase() }));\n this.cdr.detectChanges();\n this.focusResult();\n },\n error: (err) => {\n this.stopImportTimer();\n this.importing = false;\n // the server refused the rows and listed them (e.g. every row failed validation): show that list as the result\n if (custom && Array.isArray(err?.error?.errors)) {\n this.importResult = { imported: err.error.successCount ?? 0, errors: err.error.errors, warnings: [] };\n this.step = 'result';\n this.cdr.detectChanges();\n this.focusResult();\n return;\n }\n // a custom submit's own server message (e.g. \"Maximum allowed is 500 rows\") is more useful than the generic one\n const serverMessage = custom && typeof err?.error?.message === 'string' ? err.error.message : '';\n this.toast.error(serverMessage || this.labels.t('importExport.importFailed'));\n this.cdr.detectChanges();\n },\n });\n }\n}\n","import {\n Component, input, output, signal, computed, viewChild, effect, untracked,\n ChangeDetectionStrategy, inject, DestroyRef, OnInit, Signal, Injector, ElementRef, afterNextRender,\n} from '@angular/core';\n\nimport { NgTemplateOutlet, Location } from '@angular/common';\nimport { Router, UrlTree } from '@angular/router';\nimport { FormsModule } from '@angular/forms';\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\nimport { Subject, Subscription } from 'rxjs';\nimport { switchMap, catchError } from 'rxjs/operators';\nimport { of } from 'rxjs';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { UiLabelKey, UiLabelsService } from '@forgeroute/ui/core';\nimport { injectReadOnlyMode } from '@forgeroute/ui/read-only-mode';\nimport { FORGEROUTE_CONFIG } from '@forgeroute/ui/core';\nimport {\n ColumnDef, SortDir, QuickFilterTab, FilterOption, SavedView, ToolbarAction,\n BadgeConfig, autoVariant, semanticBadgeVariant, BADGE_VARIANT_STYLES,\n BulkActionDef, BulkActionEvent, BulkPanelEvent, TableRowReorderEvent, BulkConfirmContext, BulkConfirmCopy, DROPDOWN_GROUP, RowAction, TablePermission, BulkUpdateOption, LinkTarget, LinkClickEvent, RangeFilterConfig } from '@forgeroute/ui/table-types';\nimport { actionErrorText, loadErrorKey } from './load-error-message';\nimport { encodeFilterValues, decodeFilterValues } from './filter-values';\nimport { tableQueryParams } from './query-params';\nimport { getEligibleOptions, orderBulkOptions } from '@forgeroute/ui/bulk-eligible';\nimport { SearchInputComponent } from '@forgeroute/ui/search-input';\nimport { PaginationComponent } from '@forgeroute/ui/pagination';\nimport { QuickFilterTabsComponent } from '@forgeroute/ui/quick-filter-tabs';\nimport { ColumnFilterComponent, ColumnRangeSpec, ColumnRangeValue } from '@forgeroute/ui/column-filter';\nimport { TableToolbarComponent } from '@forgeroute/ui/table-toolbar';\nimport { BadgeComponent } from '@forgeroute/ui/badge';\nimport { AvatarComponent } from '@forgeroute/ui/avatar';\nimport { StarComponent } from '@forgeroute/ui/star';\nimport { iconPath as uiIconPath } from '@forgeroute/ui/icon';\nimport { MoreMenuComponent } from '@forgeroute/ui/more-menu';\nimport { SkeletonComponent } from '@forgeroute/ui/skeleton';\nimport { ProgressBarComponent } from '@forgeroute/ui/progress-bar';\nimport { ButtonComponent } from '@forgeroute/ui/core';\nimport { CheckboxComponent } from '@forgeroute/ui/checkbox';\nimport { SelectComponent } from '@forgeroute/ui/select';\nimport { ToastComponent } from '@forgeroute/ui/toast';\nimport { ToastService } from '@forgeroute/ui/core';\nimport { humanReadableMessage } from '@forgeroute/ui/utils';\nimport { downloadBlob, fileNameFromContentDisposition } from '@forgeroute/ui/utils';\nimport { ImportExportComponent, ImportExportConfig, ImportSource } from '../import-export/import-export.component';\nimport { ConfirmService } from '@forgeroute/ui/core';\nimport { ConfirmOutletComponent } from '@forgeroute/ui/core';\nimport { ModalComponent } from '@forgeroute/ui/core';\nimport { EmptyStateComponent } from '@forgeroute/ui/empty-state';\nimport { ErrorStateComponent } from '@forgeroute/ui/error-state';\n\n/** Counts the tables so every table's reorder instructions get their own id. */\nlet reorderHelpSeq = 0;\n\nfunction formatPhone(raw: string | null | undefined): string {\n if (!raw) return '—';\n const digits = raw.replace(/\\D/g, '');\n if (digits.length === 10) {\n return `(${digits.slice(0, 3)}) ${digits.slice(3, 6)}-${digits.slice(6)}`;\n }\n if (digits.length === 11 && digits[0] === '1') {\n return `(${digits.slice(1, 4)}) ${digits.slice(4, 7)}-${digits.slice(7)}`;\n }\n return raw;\n}\n\n/** Simple English plural: \"property\" → \"properties\", \"box\" → \"boxes\", \"contact\" → \"contacts\". */\nexport function pluralize(word: string): string {\n if (!word) return word;\n if (/[^aeiou]y$/i.test(word)) return word.slice(0, -1) + 'ies';\n if (/(s|x|z|ch|sh)$/i.test(word)) return word + 'es';\n return word + 's';\n}\n\n/** Resolved anchor data of a link cell (internal). */\ninterface ResolvedLink {\n href: string;\n tree: UrlTree | null;\n blank: boolean;\n rel: string | null;\n download: boolean;\n ariaLabel: string | null;\n}\n\n@Component({\n selector: 'ui-data-table',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: DROPDOWN_GROUP, useFactory: () => signal('') }],\n imports: [\n NgTemplateOutlet,\n SearchInputComponent, PaginationComponent, QuickFilterTabsComponent,\n ColumnFilterComponent, TableToolbarComponent,\n FormsModule,\n BadgeComponent, AvatarComponent, StarComponent, MoreMenuComponent, SkeletonComponent, ProgressBarComponent, ButtonComponent, CheckboxComponent, SelectComponent,\n ToastComponent, ImportExportComponent, ConfirmOutletComponent, ModalComponent,\n EmptyStateComponent, ErrorStateComponent,\n ],\n template: `\n <div class=\"dt-host\">\n\n <!-- ── HEADER ──────────────────────────────────────────────── -->\n @if (!_hasLoaded() && !_error()) {\n <!-- Skeleton header: shaped to match real controls (only while the first load is running: a failed first load keeps no placeholder bars) -->\n @if (_showHeader()) {\n <div class=\"dt-sk-toolbar\">\n <div class=\"dt-sk-toolbar-left\">\n @if (tableTitle()) {\n <h3 class=\"dt-title\">{{ tableTitle() }}</h3>\n }\n @if (showSearch()) {\n <div class=\"dt-sk-search\">\n <div class=\"dt-sk-shimmer dt-sk-search-icon\"></div>\n <div class=\"dt-sk-shimmer dt-sk-search-text\"></div>\n </div>\n }\n @if (_effectiveTabs().length) {\n <div class=\"dt-sk-tab-strip\">\n @for (_ of _effectiveTabs(); track $index) {\n <div class=\"dt-sk-shimmer dt-sk-tab\"></div>\n }\n </div>\n }\n </div>\n @if (showToolbar()) {\n <div class=\"dt-sk-toolbar-right\">\n <div class=\"dt-sk-shimmer dt-sk-icon-btn\"></div>\n <div class=\"dt-sk-shimmer dt-sk-icon-btn\"></div>\n </div>\n }\n </div>\n }\n } @else if (_showHeader()) {\n <div class=\"dt-header alive-header\">\n <div class=\"dt-header-left\">\n @if (tableTitle()) {\n <h3 class=\"dt-title\">{{ tableTitle() }}</h3>\n }\n @if (showSearch() && !_emptyUnfiltered() && !_error()) {\n <ui-search-input\n [value]=\"_search()\"\n [placeholder]=\"_effectiveSearchPlaceholder()\"\n [loading]=\"_searchLoading() && !_error()\"\n (searchChange)=\"onSearchChange($event)\" />\n }\n @if (_effectiveTabs().length && !_emptyUnfiltered() && !_error()) {\n <ui-quick-filter-tabs\n [tabs]=\"_effectiveTabs()\"\n [counts]=\"_tabCounts()\"\n [activeValue]=\"_activeTab()\"\n (tabChange)=\"onTabChange($event)\" />\n }\n </div>\n <div class=\"dt-header-right\">\n @if (showToolbar()) {\n <ui-table-toolbar\n [columns]=\"columns()\"\n [visibleColumns]=\"visibleCols().map(c => c.key)\"\n [lockedColumn]=\"lockedColumn()\"\n [savedViews]=\"_effectiveSavedViews()\"\n [activeViewId]=\"_activeViewId()\"\n [showSavedViews]=\"_effectiveSavedViews().length > 0 || !!page() || showToolbar()\"\n [readOnly]=\"!_canEdit()\"\n [tableButtons]=\"_toolbarButtons()\"\n [hideMoreActions]=\"!showMoreActions() || (_emptyUnfiltered() && !_keepMoreActions())\"\n (visibleColumnsChange)=\"_visibleColumns.set(_configurableKeys($event))\"\n (saveViewClick)=\"onSaveViewClick($event)\"\n (loadViewClick)=\"onLoadViewClick($event)\"\n (deleteViewClick)=\"onDeleteViewClick($event)\"\n (tableButtonClick)=\"onInternalButtonClick($event)\" />\n }\n </div>\n </div>\n }\n\n <!-- ── BULK SELECTION BAR ───────────────────────────────── -->\n @if (_isSelectable() && _selectedIds().size > 0) {\n <div class=\"dt-bulk-bar\">\n <span class=\"dt-bulk-count\" role=\"status\" aria-live=\"polite\">{{ _selectedText() }}</span>\n <div class=\"dt-bulk-actions\">\n @if (_activeBulkDef(); as def) {\n <!-- Inline select for field-based bulk actions -->\n <ui-select name=\"dt-bulk\" size=\"sm\" [ariaLabel]=\"def.label\" [ngModel]=\"_bulkSelectStr\" (ngModelChange)=\"_bulkSelectStr = $event\" [options]=\"_eligibleBulkOptions()\" [ariaDescribedBy]=\"_bulkOptionHintIds()\" />\n <ui-button variant=\"primary\" size=\"sm\" [disabled]=\"!_bulkSelectStr\" [loading]=\"_applyingBulk()\" (click)=\"applyBulkAction()\">{{ labels.t('dataTable.apply') }}</ui-button>\n <ui-button variant=\"ghost\" size=\"sm\" [disabled]=\"_applyingBulk()\" (click)=\"_activeBulkType.set(null)\">{{ labels.t('dataTable.cancel') }}</ui-button>\n @for (hint of _bulkOptionHints(); track $index) {\n <span class=\"dt-bulk-hint\" role=\"status\" data-testid=\"dt-bulk-option-hint\" [id]=\"_bulkHintId + '-' + $index\">{{ hint }}</span>\n }\n } @else {\n @for (def of _bulkDefs(); track def.type) {\n @if (!_bulkHidden(def)) {\n <ui-button [variant]=\"def.variant ?? 'secondary'\" size=\"sm\"\n [loading]=\"(def.type === 'delete' && _deletingBulk()) || (!!def.action && _runningAction() === def.type)\"\n [disabled]=\"_deletingBulk() || !!_runningAction() || !!_bulkBlockedReason(def)\"\n [ariaLabel]=\"_bulkBlockedReason(def) ? def.label + ' — ' + _bulkBlockedReason(def) : undefined\"\n [attr.title]=\"_bulkBlockedReason(def) || null\"\n (click)=\"onBulkActionClick(def)\">@if (bulkIconPath(def); as iconD) {<svg class=\"dt-bulk-icon\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"iconD\" /></svg>}{{ def.label }}</ui-button>\n }\n }\n <!-- Visible reason for a blocked action (the title tooltip is invisible on touch) -->\n @for (reason of _bulkBlockedHints(); track reason) {\n <span class=\"dt-bulk-hint\" role=\"status\" data-testid=\"dt-bulk-hint\">{{ reason }}</span>\n }\n }\n </div>\n <ui-button variant=\"ghost\" size=\"sm\" (click)=\"clearSelection()\">{{ labels.t('dataTable.clear') }}</ui-button>\n </div>\n }\n\n <!-- Optional leading icon (ColumnDef.iconFn, library source 2026-11-05): decorative svg, plus sr-only text only when iconLabelFn returns one. Draws nothing when there is no valid icon. -->\n <ng-template #cellIcon let-col=\"col\" let-item=\"item\">\n @if (cellIconPath(col, item); as iconD) {\n <svg class=\"dt-cell-icon\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\" focusable=\"false\"><path [attr.d]=\"iconD\" /></svg>\n @if (cellIconLabel(col, item); as iconLbl) { <span class=\"dt-sr-only\">{{ iconLbl }}</span> }\n }\n </ng-template>\n\n <!-- Shared image-cell markup (table cell + mobile card header) -->\n <ng-template #imageCell let-col=\"col\" let-item=\"item\" let-small=\"small\">\n @let imgUrl = imageUrl(col, item);\n @let imgClass = imageClass(col, !!small);\n @if (imgUrl && !_failedImages().has(imgUrl)) {\n <img [class]=\"imgClass + ' dt-img'\" [src]=\"imgUrl\" [attr.alt]=\"imageAlt(col, item)\"\n [style.object-position]=\"imagePosition(col, item)\" loading=\"lazy\" decoding=\"async\" (error)=\"onImageError(imgUrl)\" />\n } @else {\n <span [class]=\"imgClass + ' dt-img-ph'\" aria-hidden=\"true\">\n @if (col.imagePlaceholder === 'person') {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"8\" r=\"4\"/><path d=\"M4 21c0-4 3.6-7 8-7s8 3 8 7\"/></svg>\n } @else {\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"4\" width=\"18\" height=\"16\" rx=\"2\"/><circle cx=\"9\" cy=\"10\" r=\"1.8\"/><path d=\"M21 16l-5-5-8 9\"/></svg>\n }\n </span>\n }\n </ng-template>\n\n <!-- Shared link-cell markup (table cell + mobile card). Real anchor; text is escaped by interpolation. -->\n <ng-template #linkCell let-col=\"col\" let-item=\"item\">\n @let lv = linkView(col, item);\n @if (lv.link; as lk) {\n <a class=\"dt-link\"\n [attr.href]=\"lk.href\"\n [attr.target]=\"lk.blank ? '_blank' : null\"\n [attr.rel]=\"lk.rel\"\n [attr.download]=\"lk.download ? '' : null\"\n [attr.aria-label]=\"lk.ariaLabel\"\n (click)=\"onLinkClick($event, lk, col, item)\"\n (keydown)=\"$event.stopPropagation()\">{{ lv.text }}@if (lk.blank && !lk.ariaLabel) {<span class=\"dt-sr-only\"> {{ labels.t('dataTable.opensInNewTab') }}</span>}</a>\n } @else {\n {{ lv.text }}\n }\n </ng-template>\n\n <!-- ── TABLE ─────────────────────────────────────────────── -->\n @if (!_isPhone()) {\n <div class=\"dt-table-wrap\" [class.dt-sticky-actions]=\"stickyActions()\">\n <table [attr.aria-label]=\"tableLabelText()\" [attr.aria-busy]=\"_loading()\">\n <thead>\n <tr>\n @if (_reorderOn()) {\n <th class=\"dt-th-grip\" scope=\"col\"><span class=\"dt-sr-only\">{{ labels.t('dataTable.reorder') }}</span></th>\n }\n @if (_isSelectable()) {\n <th class=\"dt-th-cb\" scope=\"col\">\n <ui-checkbox\n [ariaLabel]=\"labels.t('dataTable.selectAll')\"\n [checked]=\"_allSelected()\"\n [indeterminate]=\"_someSelected()\"\n (checkedChange)=\"toggleSelectAll()\" />\n </th>\n }\n @for (col of visibleCols(); track col.key) {\n <th\n scope=\"col\"\n [style.text-align]=\"col.headerAlign ?? (col.cellType === 'number' ? 'right' : 'center')\"\n [style.width]=\"col.width ?? null\"\n [style.min-width]=\"col.width ?? null\"\n [style.max-width]=\"col.width ?? null\"\n [attr.aria-sort]=\"_canShowSort(col) ? sortAriaLabel(col.key) : null\"\n [class.dt-th-sorted]=\"_sortField() === col.key\"\n [class.dt-th-actions]=\"col.cellType === 'actions'\">\n <div class=\"dt-th-inner\">\n @if (_canShowSort(col)) {\n <button\n class=\"dt-sort-btn\"\n (click)=\"onSort(col.key)\"\n [attr.aria-label]=\"labels.t('dataTable.sortByColumn', { column: col.label })\">\n {{ col.label }}\n @if (_sortField() === col.key) {\n <svg class=\"dt-sort-icon\" [class.dt-sort-desc]=\"_sortDir() === 'desc'\" width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><path d=\"M12 5v14M5 12l7-7 7 7\"/></svg>\n } @else if (!_sortField()) {\n <svg class=\"dt-sort-icon dt-sort-inactive\" width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" aria-hidden=\"true\"><path d=\"M7 15l5 5 5-5M7 9l5-5 5 5\"/></svg>\n }\n </button>\n } @else {\n {{ col.label }}\n }\n @if (_showColumnControls() ? getRangeFilter(col) : null; as rf) {\n <ui-column-filter\n [label]=\"col.label\"\n [range]=\"rf.spec\"\n [rangeValue]=\"rf.value\"\n (rangeChange)=\"onRangeChange(col.key, $event)\" />\n } @else if (_showColumnControls() ? getColFilter(col) : null; as cf) {\n <ui-column-filter\n [label]=\"col.label\"\n [options]=\"cf.options\"\n [activeValues]=\"cf.activeValues\"\n (filterChange)=\"onColFilterChange(_filterName(col), $event)\" />\n }\n </div>\n </th>\n }\n </tr>\n </thead>\n <tbody>\n\n <!-- Reload skeleton (search / filter / sort) -->\n @if (_loading()) {\n @for (_ of skeletonRows(); track $index) {\n <tr class=\"dt-sk-reload-row\">\n @if (_reorderOn()) {\n <td class=\"dt-td-grip\"></td>\n }\n @if (_isSelectable()) {\n <td class=\"dt-td-cb\"></td>\n }\n @for (col of visibleCols(); track col.key) {\n <td><ui-skeleton [height]=\"14\" [radius]=\"4\" /></td>\n }\n </tr>\n }\n }\n\n <!-- Error -->\n @else if (_error()) {\n <tr>\n <td [attr.colspan]=\"visibleCols().length + (_isSelectable() ? 1 : 0) + (_reorderOn() ? 1 : 0)\" class=\"dt-state-cell\">\n <ui-error-state [message]=\"_error()!\" [retryLabel]=\"_retryLabel()\" (retry)=\"_retryAfterError()\" />\n </td>\n </tr>\n }\n\n <!-- Empty (no filters active) -->\n @else if (_items().length === 0 && !_hasActiveFilters()) {\n <tr>\n <td [attr.colspan]=\"visibleCols().length + (_isSelectable() ? 1 : 0) + (_reorderOn() ? 1 : 0)\" class=\"dt-state-cell\">\n <ui-empty-state iconType=\"table\" [message]=\"emptyMessageText()\" />\n </td>\n </tr>\n }\n\n <!-- No match -->\n @else if (_items().length === 0 && _hasActiveFilters()) {\n <tr>\n <td [attr.colspan]=\"visibleCols().length + (_isSelectable() ? 1 : 0) + (_reorderOn() ? 1 : 0)\" class=\"dt-state-cell\">\n <ui-empty-state iconType=\"search\" [message]=\"labels.t('dataTable.noResults')\">\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"clearFilters()\">{{ labels.t('dataTable.clearFilters') }}</ui-button>\n </ui-empty-state>\n </td>\n </tr>\n }\n\n <!-- Data rows — --i is capped at 8 so the entrance stagger never exceeds ~240ms -->\n @else {\n @for (item of _items(); track trackItem(item, $index)) {\n <tr\n class=\"dt-row alive-row\"\n [style.--i]=\"$index < 8 ? $index : 8\"\n [class.dt-row-clickable]=\"isRowClickable(item)\"\n [class.dt-row-selected]=\"_isSelectable() && _selectedIds().has(item['id'])\"\n [class.dt-row-dragging]=\"_dragFrom() === $index\"\n [class.dt-row-over-before]=\"_reorderOn() && _dragFrom() !== null && _dragOver() === $index && _dragFrom()! > $index\"\n [class.dt-row-over-after]=\"_reorderOn() && _dragFrom() !== null && _dragOver() === $index && _dragFrom()! < $index\"\n [attr.data-row-key]=\"_reorderOn() ? trackItem(item, $index) : null\"\n [attr.tabindex]=\"isRowClickable(item) ? 0 : null\"\n [attr.aria-label]=\"rowLabel(item)\"\n (keydown)=\"onRowKeydown($event, item)\"\n (dragover)=\"onRowDragOver($event, $index)\"\n (drop)=\"onRowDrop($event, $index)\"\n (click)=\"onRowClick(item)\">\n @if (_reorderOn()) {\n <td class=\"dt-td-grip\" (click)=\"$event.stopPropagation()\">\n <span class=\"dt-grip\" role=\"button\" [attr.tabindex]=\"_reorderActive() ? 0 : null\"\n [attr.draggable]=\"_reorderActive() ? 'true' : null\"\n [attr.aria-label]=\"reorderLabel(item)\"\n [attr.aria-disabled]=\"_reorderActive() ? null : 'true'\"\n [attr.aria-roledescription]=\"labels.t('dataTable.dragHandle')\"\n [attr.aria-describedby]=\"_reorderHelpId\"\n [attr.title]=\"_reorderActive() ? labels.t('dataTable.dragHint') : _reorderHint()\"\n [class.dt-grip-off]=\"!_reorderActive()\"\n (dragstart)=\"onGripDragStart($event, $index)\"\n (dragend)=\"onGripDragEnd()\"\n (keydown)=\"onGripKeydown($event, $index)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"currentColor\" aria-hidden=\"true\" focusable=\"false\"><circle cx=\"9\" cy=\"6\" r=\"1.6\"/><circle cx=\"15\" cy=\"6\" r=\"1.6\"/><circle cx=\"9\" cy=\"12\" r=\"1.6\"/><circle cx=\"15\" cy=\"12\" r=\"1.6\"/><circle cx=\"9\" cy=\"18\" r=\"1.6\"/><circle cx=\"15\" cy=\"18\" r=\"1.6\"/></svg>\n </span>\n <!-- Touch screens (coarse primary pointer, e.g. a tablet) cannot rely on native drag: they get Move up / Move down instead of the grip. -->\n <span class=\"dt-row-move\">\n <ui-button variant=\"icon\" size=\"sm\" [ariaLabel]=\"labels.t('dataTable.moveUp', { name: rowAccessibleName(item) || labels.t('dataTable.rowWord') })\"\n [disabled]=\"!_reorderActive() || $first\" (click)=\"moveByButton($index, -1)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 15l6-6 6 6\"/></svg>\n </ui-button>\n <ui-button variant=\"icon\" size=\"sm\" [ariaLabel]=\"labels.t('dataTable.moveDown', { name: rowAccessibleName(item) || labels.t('dataTable.rowWord') })\"\n [disabled]=\"!_reorderActive() || $last\" (click)=\"moveByButton($index, 1)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 9l6 6 6-6\"/></svg>\n </ui-button>\n </span>\n </td>\n }\n @if (_isSelectable()) {\n <td class=\"dt-td-cb\" (click)=\"$event.stopPropagation()\">\n <ui-checkbox\n [ariaLabel]=\"selectRowLabel(item)\"\n [checked]=\"_selectedIds().has(item['id'])\"\n (checkedChange)=\"toggleRow(item)\" />\n </td>\n }\n @for (col of visibleCols(); track col.key) {\n <td\n [style.text-align]=\"resolveCellAlign(col, item)\"\n [style.width]=\"col.width ?? null\"\n [style.min-width]=\"col.width ?? null\"\n [style.max-width]=\"col.width ?? null\"\n [class.dt-td-width]=\"!!col.width && col.cellType !== 'actions'\"\n [class.dt-td-actions]=\"col.cellType === 'actions'\">\n\n @switch (col.cellType) {\n\n <!-- Badge cell -->\n @case ('badge') {\n @let bCfg = resolveBadge(col, item);\n @if (bCfg) { @if (col.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" /> } <ui-badge [label]=\"bCfg.label\" [variant]=\"bCfg.variant\" /> } @else { — }\n }\n\n <!-- Date cell -->\n @case ('date') {\n @if (col.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" /> }\n {{ item[col.key] ? labels.formatDate(item[col.key], col.dateFormat ?? 'MMM d, y') : '—' }}\n }\n\n <!-- Phone cell -->\n @case ('phone') {\n @if (col.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" /> }\n {{ phoneCell(item[col.key]) }}\n }\n\n <!-- Avatar + name cell -->\n @case ('avatar-name') {\n @let displayName = col.nameFn ? col.nameFn(item) : (item[col.key] ?? '');\n @let initials = col.initialsFn ? col.initialsFn(item) : getInitials(displayName);\n <span class=\"dt-avatar-name\">\n <ui-avatar [initials]=\"initials\" [name]=\"displayName\" [size]=\"28\" />\n <span class=\"dt-name-text\">{{ displayName }}</span>\n </span>\n }\n\n <!-- Days ago cell -->\n @case ('days-ago') {\n @let days = item[col.daysKey ?? col.key];\n <span [class.dt-overdue]=\"days !== null && days > (col.overdueThreshold ?? 30)\">\n @if (days !== null && days !== undefined) {\n {{ labels.t('dataTable.daysAgo', { days: days }) }}\n } @else {\n {{ labels.t('dataTable.never') }}\n }\n </span>\n }\n\n <!-- Progress cell -->\n @case ('progress') {\n @let pCfg = col.progressFn ? col.progressFn(item) : null;\n @if (pCfg) {\n <ui-progress-bar [value]=\"pCfg.value\" [max]=\"pCfg.max\" [label]=\"pCfg.label ?? ''\"\n [variant]=\"pCfg.variant ?? null\" [tooltip]=\"pCfg.tooltip ?? ''\" [ariaLabel]=\"pCfg.ariaLabel ?? ''\" />\n } @else { <span class=\"dt-none\">—</span> }\n }\n\n <!-- Tags cell -->\n @case ('tags') {\n @let tags = item[col.tagsKey ?? col.key];\n @if (tags?.length > 0) {\n <span class=\"dt-tags\">\n <ui-badge\n [label]=\"tags[0].name\"\n [variant]=\"tags[0].variant ?? null\"\n [color]=\"tags[0].color ?? null\" />\n @if (tags[0].colorName) {<span class=\"dt-sr-only\">, {{ tags[0].colorName }}</span>}\n @if (tags.length > 1) {\n <span\n class=\"dt-tags-more\"\n (mouseenter)=\"showTagTooltip($event, tags.slice(1))\"\n (mouseleave)=\"hideTagTooltip()\"\n (focus)=\"showTagTooltip($event, tags.slice(1))\"\n (blur)=\"hideTagTooltip()\"\n tabindex=\"0\"\n [attr.aria-label]=\"tags.slice(1).map(t => t.colorName ? t.name + ' (' + t.colorName + ')' : t.name).join(', ')\">\n +{{ tags.length - 1 }}\n </span>\n }\n </span>\n } @else {\n <span class=\"dt-none\">—</span>\n }\n }\n\n <!-- Image cell -->\n @case ('image') {\n <ng-container [ngTemplateOutlet]=\"imageCell\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" />\n }\n\n <!-- Link cell -->\n @case ('link') {\n <ng-container [ngTemplateOutlet]=\"linkCell\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" />\n }\n\n <!-- Actions cell -->\n @case ('actions') {\n <span class=\"dt-actions-cell\" (click)=\"$event.stopPropagation()\">\n @let rowActions = _rowActions(col, item);\n @if (rowActions.length) {\n <ui-more-menu\n [actions]=\"rowActions\"\n [ariaLabel]=\"rowActionsLabel(item)\"\n (opened)=\"rowMenuOpen.emit({ item })\"\n (actionClick)=\"onTableRowAction($event, col, item)\" />\n }\n </span>\n }\n\n <!-- Default: plain text -->\n @default {\n @if (col.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: col, item: item }\" /> }\n @if (col.starFn?.(item); as starTip) {\n <ui-star class=\"dt-cell-star\" [tooltip]=\"starTip\" />\n }\n {{ col.render ? col.render(item) : (item[col.key] ?? '—') }}\n }\n\n }\n </td>\n }\n </tr>\n }\n }\n </tbody>\n @if (_footerVisible()) {\n <tfoot data-testid=\"dt-footer\">\n <tr>\n @if (_reorderOn()) { <td class=\"dt-td-grip\"></td> }\n @if (_isSelectable()) { <td class=\"dt-td-cb\"></td> }\n @for (col of visibleCols(); track col.key; let first = $first) {\n @if (first) {\n <th scope=\"row\" class=\"dt-foot-label\"\n [style.text-align]=\"col.align ?? (col.cellType === 'number' ? 'right' : 'left')\"\n [style.width]=\"col.width ?? null\"\n [style.min-width]=\"col.width ?? null\"\n [style.max-width]=\"col.width ?? null\">\n @if (_footerCells()[col.key]; as ft) {\n <span class=\"dt-sr-only\">{{ totalsLabelText() }}: </span>{{ ft }}\n } @else {\n {{ totalsLabelText() }}\n }\n </th>\n } @else {\n <td class=\"dt-foot-cell\"\n [style.text-align]=\"col.align ?? (col.cellType === 'number' ? 'right' : 'left')\"\n [style.width]=\"col.width ?? null\"\n [style.min-width]=\"col.width ?? null\"\n [style.max-width]=\"col.width ?? null\">{{ _footerCells()[col.key] || '' }}</td>\n }\n }\n </tr>\n </tfoot>\n }\n </table>\n </div>\n }\n\n <!-- ── CARD LIST (phone, ≤640px) — only one tree is rendered per viewport ─── -->\n @if (_isPhone()) {\n <!-- Phone sort + column filters: the table header (which owns them on larger screens) isn't rendered here -->\n @if (_hasPhoneControls() && _showColumnControls()) {\n <div class=\"dt-phone-controls\" role=\"group\" [attr.aria-label]=\"labels.t('dataTable.sortAndFilter')\">\n @if (_phoneSortOptions().length > 1) {\n <label class=\"dt-phone-sort\">\n <span class=\"dt-phone-sort-label\">{{ labels.t('dataTable.sort') }}</span>\n <select class=\"dt-phone-sort-select\" [attr.aria-label]=\"labels.t('dataTable.sortBy')\" (change)=\"onPhoneSort($any($event.target).value)\">\n @for (opt of _phoneSortOptions(); track opt.value) {\n <option [value]=\"opt.value\" [selected]=\"opt.value === _phoneSortValue()\">{{ opt.label }}</option>\n }\n </select>\n </label>\n }\n @if (_phoneFilterCols().length || _phoneRangeCols().length) {\n <div class=\"dt-phone-filters\">\n @for (f of _phoneRangeCols(); track f.col.key) {\n <ui-column-filter\n [chip]=\"true\"\n [label]=\"f.col.label\"\n [range]=\"f.rf.spec\"\n [rangeValue]=\"f.rf.value\"\n (rangeChange)=\"onRangeChange(f.col.key, $event)\" />\n }\n @for (f of _phoneFilterCols(); track f.col.key) {\n <ui-column-filter\n [chip]=\"true\"\n [label]=\"f.col.label\"\n [options]=\"f.cf.options\"\n [activeValues]=\"f.cf.activeValues\"\n (filterChange)=\"onColFilterChange(_filterName(f.col), $event)\" />\n }\n </div>\n }\n </div>\n }\n <!-- role=list only while it holds listitems (cards or skeleton cards); empty / error / no-match states are not an empty list -->\n <div class=\"dt-card-list\" [attr.role]=\"_cardListHasItems() ? 'list' : null\" [attr.aria-label]=\"_cardListHasItems() ? tableLabelText() : null\">\n\n @if (_loading()) {\n @for (_ of skeletonRows(); track $index) {\n <!-- Card skeleton matches exact layout: avatar circle + name line + menu dot | badge pills | key/value rows -->\n <div class=\"dt-card dt-card-sk\" role=\"listitem\">\n <div class=\"dt-card-sk-header\">\n <!-- Avatar circle -->\n <ui-skeleton [height]=\"32\" width=\"32px\" [radius]=\"50\" />\n <!-- Name line -->\n <ui-skeleton [height]=\"14\" width=\"160px\" [radius]=\"4\" />\n <!-- Action menu dot -->\n <ui-skeleton [height]=\"24\" width=\"24px\" [radius]=\"5\" style=\"margin-left:auto\" />\n </div>\n <!-- Badge pills row -->\n <div class=\"dt-card-sk-badges\">\n <ui-skeleton [height]=\"22\" width=\"72px\" [radius]=\"999\" />\n <ui-skeleton [height]=\"22\" width=\"52px\" [radius]=\"999\" />\n </div>\n <!-- Detail key/value rows -->\n <div class=\"dt-card-sk-rows\">\n <ui-skeleton [height]=\"12\" [radius]=\"4\" />\n <ui-skeleton [height]=\"12\" width=\"70%\" [radius]=\"4\" />\n </div>\n </div>\n }\n\n } @else if (_error()) {\n <ui-error-state [message]=\"_error()!\" [retryLabel]=\"_retryLabel()\" (retry)=\"_retryAfterError()\" />\n\n } @else if (_items().length === 0 && !_hasActiveFilters()) {\n <ui-empty-state iconType=\"table\" [message]=\"emptyMessageText()\" />\n\n } @else if (_items().length === 0 && _hasActiveFilters()) {\n <ui-empty-state iconType=\"search\" [message]=\"labels.t('dataTable.noResults')\">\n <ui-button variant=\"secondary\" size=\"sm\" (click)=\"clearFilters()\">{{ labels.t('dataTable.clearFilters') }}</ui-button>\n </ui-empty-state>\n\n } @else {\n @for (item of _items(); track trackItem(item, $index)) {\n <div\n class=\"dt-card alive-row\"\n [attr.data-row-key]=\"_reorderOn() ? trackItem(item, $index) : null\"\n [style.--i]=\"$index < 8 ? $index : 8\"\n role=\"listitem\"\n [class.dt-card-clickable]=\"isRowClickable(item)\"\n [class.dt-card-selected]=\"_isSelectable() && _selectedIds().has(item['id'])\"\n [attr.tabindex]=\"isRowClickable(item) ? 0 : null\"\n [attr.aria-label]=\"rowLabel(item)\"\n (keydown)=\"onRowKeydown($event, item)\"\n (click)=\"onRowClick(item)\">\n\n <!-- Selection checkbox (shown when bulk actions are enabled) -->\n @if (_isSelectable()) {\n <div class=\"dt-card-cb\" (click)=\"$event.stopPropagation()\">\n <ui-checkbox\n [ariaLabel]=\"selectRowLabel(item)\"\n [checked]=\"_selectedIds().has(item['id'])\"\n (checkedChange)=\"toggleRow(item)\" />\n </div>\n }\n\n <!-- Title row: avatar/name + action menu -->\n <div class=\"dt-card-header\">\n @if (_cardCols().imageCol; as ic) {\n <ng-container [ngTemplateOutlet]=\"imageCell\" [ngTemplateOutletContext]=\"{ col: ic, item: item, small: true }\" />\n }\n @if (_cardCols().titleCol; as tc) {\n @if (tc.cellType === 'avatar-name') {\n @let displayName = tc.nameFn ? tc.nameFn(item) : (item[tc.key] ?? '');\n @let initials = tc.initialsFn ? tc.initialsFn(item) : getInitials(displayName);\n <span class=\"dt-card-title\">\n <ui-avatar [initials]=\"initials\" [name]=\"displayName\" [size]=\"32\" />\n <span class=\"dt-card-name\">{{ displayName }}</span>\n </span>\n } @else if (tc.cellType === 'link') {\n <span class=\"dt-card-name dt-card-name-plain\">\n <ng-container [ngTemplateOutlet]=\"linkCell\" [ngTemplateOutletContext]=\"{ col: tc, item: item }\" />\n </span>\n } @else {\n <span class=\"dt-card-name dt-card-name-plain\">\n @if (tc.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: tc, item: item }\" /> }\n @if (tc.starFn?.(item); as starTip) {\n <ui-star class=\"dt-cell-star\" [tooltip]=\"starTip\" />\n }\n {{ tc.render ? tc.render(item) : cardCellText(tc, item) }}\n </span>\n }\n }\n @if (_reorderOn()) {\n <span class=\"dt-card-move\" (click)=\"$event.stopPropagation()\">\n <ui-button variant=\"icon\" size=\"sm\" [ariaLabel]=\"labels.t('dataTable.moveUp', { name: rowAccessibleName(item) || labels.t('dataTable.rowWord') })\"\n [disabled]=\"!_reorderActive() || $first\" (click)=\"moveByButton($index, -1)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 15l6-6 6 6\"/></svg>\n </ui-button>\n <ui-button variant=\"icon\" size=\"sm\" [ariaLabel]=\"labels.t('dataTable.moveDown', { name: rowAccessibleName(item) || labels.t('dataTable.rowWord') })\"\n [disabled]=\"!_reorderActive() || $last\" (click)=\"moveByButton($index, 1)\">\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M6 9l6 6 6-6\"/></svg>\n </ui-button>\n </span>\n }\n @if (_cardCols().actionsCol; as ac) {\n @let cardActions = _rowActions(ac, item);\n @if (cardActions.length) {\n <span class=\"dt-card-actions\" (click)=\"$event.stopPropagation()\">\n <ui-more-menu\n [actions]=\"cardActions\"\n [ariaLabel]=\"rowActionsLabel(item)\"\n (opened)=\"rowMenuOpen.emit({ item })\"\n (actionClick)=\"onTableRowAction($event, ac, item)\" />\n </span>\n }\n }\n </div>\n\n <!-- Badge pills (status / type / source etc.) -->\n @if (_cardCols().badgeCols.length) {\n <div class=\"dt-card-badges\">\n @for (bc of _cardCols().badgeCols; track bc.key) {\n @let bCfg = resolveBadge(bc, item);\n @if (bCfg) { @if (bc.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: bc, item: item }\" /> } <ui-badge [label]=\"bCfg.label\" [variant]=\"bCfg.variant\" /> }\n }\n </div>\n }\n\n <!-- Tag pills (rendered as badge pills, one row per tags column) -->\n @for (tc of _cardCols().tagCols; track tc.key) {\n @let tagItems = item[tc.tagsKey ?? tc.key];\n @if (tagItems?.length) {\n <div class=\"dt-card-tags\">\n @for (tag of tagItems; track tag.name) {\n <ui-badge [label]=\"tag.name\" [variant]=\"tag.variant ?? 'gray'\" size=\"sm\" />\n @if (tag.colorName) {<span class=\"dt-sr-only\">, {{ tag.colorName }}</span>}\n }\n </div>\n }\n }\n\n <!-- Detail key/value rows -->\n @if (_cardCols().detailCols.length) {\n <div class=\"dt-card-details\">\n @for (dc of _cardCols().detailCols; track dc.key) {\n @let val = cardCellText(dc, item);\n @if (val !== '—') {\n <div class=\"dt-card-detail-row\">\n <span class=\"dt-card-detail-label\">{{ dc.label }}</span>\n <span class=\"dt-card-detail-value\"\n [class.dt-overdue]=\"dc.cellType === 'days-ago' && isCardOverdue(dc, item)\">\n @if (dc.cellType === 'link') {\n <ng-container [ngTemplateOutlet]=\"linkCell\" [ngTemplateOutletContext]=\"{ col: dc, item: item }\" />\n } @else {\n @if (dc.iconFn) { <ng-container [ngTemplateOutlet]=\"cellIcon\" [ngTemplateOutletContext]=\"{ col: dc, item: item }\" /> }\n {{ val }}\n }</span>\n </div>\n }\n }\n </div>\n }\n\n </div>\n }\n }\n\n </div>\n @if (_footerVisible()) {\n <div class=\"dt-card dt-card-totals\" role=\"group\" [attr.aria-label]=\"totalsLabelText()\" data-testid=\"dt-footer-card\">\n <div class=\"dt-card-details\">\n @for (fc of _footerPhoneLines(); track fc.key) {\n <div class=\"dt-card-detail-row\">\n <span class=\"dt-card-detail-label\">{{ fc.label }}</span>\n <span class=\"dt-card-detail-value\">{{ fc.value }}</span>\n </div>\n }\n </div>\n </div>\n }\n }\n\n @if (_reorderOn()) {\n <span class=\"dt-sr-only\" [id]=\"_reorderHelpId\">{{ _reorderActive()\n ? labels.t('dataTable.reorderHelp')\n : _reorderHint() }}</span>\n <span class=\"dt-sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\">{{ _reorderAnnouncement() }}</span>\n }\n\n <!-- ── PAGINATION ─────────────────────────────────────────── -->\n @if (showPagination() && _total() > pageSize()) {\n <ui-pagination\n [page]=\"_page()\"\n [pageSize]=\"pageSize()\"\n [totalItems]=\"_total()\"\n [detached]=\"_isPhone()\"\n (pageChange)=\"onPageChange($event)\" />\n }\n\n <!-- ── BUILT-IN SERVICES (toast, confirm, import/export) ──── -->\n <ui-toast />\n <ui-confirm-outlet />\n\n @if (importExportConfig()) {\n <ui-import-export\n #ieRef\n [config]=\"importExportConfig()!\"\n [importSources]=\"importSources()\"\n [exportParams]=\"_exportParams()\"\n (imported)=\"onImported()\"\n style=\"display:none\" />\n }\n\n <!-- Built-in row-delete confirmation modal -->\n @if (_rowDeleteTarget()) {\n <ui-modal\n data-testid=\"confirm-modal\"\n [open]=\"true\"\n [title]=\"_rowDeleteConfig().title\"\n maxWidth=\"420px\"\n [describedBy]=\"_rowDeleteConfig().details?.length ? _confirmMsgId + ' ' + _confirmDetailsId : _confirmMsgId\"\n (close)=\"_rowDeleteTarget.set(null)\">\n <p class=\"dt-confirm-msg\" data-testid=\"confirm-message\" [id]=\"_confirmMsgId\">{{ _rowDeleteConfig().message }}</p>\n @if (_rowDeleteConfig().details?.length) {\n <ul class=\"dt-confirm-details\" data-testid=\"confirm-details\" [attr.aria-label]=\"labels.t('dataTable.whatWillHappen')\" [id]=\"_confirmDetailsId\">\n @for (d of _rowDeleteConfig().details; track $index) { <li>{{ d }}</li> }\n </ul>\n }\n <ui-button modal-footer-left data-testid=\"confirm-cancel\" variant=\"secondary\" size=\"sm\" [disabled]=\"_rowDeleting()\" (click)=\"_rowDeleteTarget.set(null)\">{{ labels.t('dataTable.cancel') }}</ui-button>\n <ui-button modal-footer-right data-testid=\"confirm-accept\" [variant]=\"_rowDeleteConfig().variant === 'primary' ? 'primary' : _rowDeleteConfig().variant === 'warning' ? 'warning' : 'danger'\" size=\"sm\" [loading]=\"_rowDeleting()\" (click)=\"_confirmRowDelete()\">{{ _rowDeleteConfig().confirmLabel }}</ui-button>\n </ui-modal>\n }\n\n <!-- Tags overflow tooltip — position: fixed so it escapes dt-table-wrap overflow -->\n @if (_tagTooltip()) {\n <div\n class=\"dt-tag-tooltip\"\n role=\"tooltip\"\n [style.left.px]=\"_tagTooltip()!.x\"\n [style.top.px]=\"_tagTooltip()!.y\">\n @for (tag of _tagTooltip()!.tags; track tag.name) {\n <ui-badge [label]=\"tag.name\" [variant]=\"tag.variant ?? 'gray'\" [color]=\"tag.color ?? null\" />\n }\n </div>\n }\n </div>\n `,\n styles: [`\n :host { display: flex; flex-direction: column; flex: 1; min-height: 0; }\n\n .dt-host { display: flex; flex-direction: column; height: 100%; min-height: 0; }\n\n /* ── Header ─── */\n .dt-header {\n display: flex; align-items: center; gap: 12px;\n margin-bottom: 16px; flex-wrap: wrap; justify-content: space-between;\n position: relative; z-index: 10;\n }\n .dt-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; min-width: 0; }\n .dt-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }\n .dt-title { margin: 0; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; overflow-wrap: anywhere; }\n\n /* ── Shimmer base — GPU-composited via transform so no paint per frame ─── */\n .dt-sk-shimmer {\n position: relative; overflow: hidden; background: #f1f5f9;\n &::after {\n content: ''; position: absolute; inset: 0;\n background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.65) 50%, transparent 75%);\n transform: translateX(-100%);\n animation: dt-shimmer 1.4s ease-in-out infinite;\n }\n }\n @keyframes dt-shimmer { to { transform: translateX(200%); } }\n\n /* ── Header skeleton toolbar ─── */\n .dt-sk-toolbar {\n display: flex; align-items: center; justify-content: space-between;\n gap: 12px; margin-bottom: 16px;\n }\n .dt-sk-toolbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }\n .dt-sk-toolbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }\n\n /* Search input: matches padding:8px 10px 8px 34px, border-radius:6px, min-width:380px */\n .dt-sk-search {\n display: flex; align-items: center; gap: 10px;\n width: 380px; height: 36px; padding: 0 12px;\n border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc;\n box-sizing: border-box;\n }\n .dt-sk-search-icon { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; }\n .dt-sk-search-text { flex: 1; height: 11px; border-radius: 4px; }\n\n /* Quick filter tab strip: matches wrapper border-radius:8px padding:3px, tabs padding:6px 14px border-radius:6px */\n .dt-sk-tab-strip {\n display: flex; gap: 2px; padding: 3px;\n background: #f1f5f9; border-radius: 8px;\n }\n .dt-sk-tab { height: 28px; width: 70px; border-radius: 6px; }\n\n /* Toolbar icon buttons: matches padding:6px 10px border-radius:6px */\n .dt-sk-icon-btn { width: 32px; height: 32px; border-radius: 6px; }\n\n /* ── Table skeleton ─── */\n .dt-skeleton { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }\n .dt-sk-header {\n display: flex; gap: 24px; padding: 12px 16px;\n background: #f8fafc; border-bottom: 1px solid #e2e8f0;\n }\n .dt-sk-row {\n display: flex; gap: 24px; padding: 13px 16px;\n border-bottom: 1px solid #f1f5f9;\n &:last-child { border-bottom: none; }\n }\n .dt-sk-cell {\n flex: 1; height: 13px; border-radius: 4px;\n position: relative; overflow: hidden; background: #f1f5f9;\n &:first-child { max-width: 100px; }\n &::after {\n content: ''; position: absolute; inset: 0;\n background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.65) 50%, transparent 75%);\n transform: translateX(-100%);\n animation: dt-shimmer 1.4s ease-in-out infinite;\n }\n }\n .dt-sk-head { height: 10px; }\n\n /* ── Table wrap — only as tall as its rows (flex: 0 1 auto: no empty box down to the bottom of the page); when the rows do not fit it shrinks to the remaining height and scrolls on both axes ─── */\n .dt-table-wrap {\n flex: 0 1 auto; min-height: 0; overflow: auto;\n border: 1px solid #e2e8f0; border-radius: 10px 10px 0 0;\n }\n .dt-sk-reload-row td { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; }\n\n table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }\n\n /* ── Head — sticky so column headers stay visible while rows scroll ─── */\n thead tr { background: #f8fafc; border-bottom: 1px solid #e2e8f0; }\n thead { position: sticky; top: 0; z-index: 2; }\n /* The sticky head is its own stacking layer (z-index 2), so a column-filter dropdown opened in it - fixed, and flipped ABOVE the header near the bottom of the screen - was painted UNDER\n the search / tabs row (.dt-header, z-index 10). While a dropdown is open the head goes above that row (:has - the dropdown only exists while it is open). */\n thead:has(.cf-dropdown) { z-index: 11; }\n th {\n padding: 10px 14px; font-size: 0.75rem; font-weight: 600;\n color: #64748b; text-transform: uppercase; letter-spacing: 0.04em;\n white-space: nowrap; border-right: 1px solid #e2e8f0; text-align: center;\n background: #f8fafc;\n &:last-child { border-right: none; }\n &.dt-th-sorted { background: #f1f5f9; }\n &.dt-th-actions { width: 48px; }\n }\n .dt-th-inner { display: flex; align-items: center; justify-content: center; gap: 4px; }\n\n /* ── Sort ─── */\n .dt-sort-btn {\n display: inline-flex; align-items: center; gap: 4px;\n background: none; border: none; cursor: pointer; font-size: inherit;\n font-weight: inherit; color: inherit; font-family: inherit; padding: 0;\n text-transform: inherit; letter-spacing: inherit;\n &:hover { color: #1e293b; }\n &:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; border-radius: 2px; }\n }\n /* Touch: the sort button keeps its look and gets a >= 44px hit height through ::after (desktop unchanged) */\n @media (pointer: coarse) {\n .dt-sort-btn { position: relative; }\n .dt-sort-btn::after { content: ''; position: absolute; left: -4px; right: -4px; top: 50%; height: 44px; transform: translateY(-50%); }\n }\n .dt-sort-icon { transition: transform 0.15s; }\n .dt-sort-desc { transform: rotate(180deg); }\n .dt-sort-inactive { opacity: 0.4; }\n\n /* ── Body ─── */\n tbody tr {\n border-bottom: 1px solid #f1f5f9; background: #fff;\n transition: background 0.1s;\n &:last-child { border-bottom: none; }\n &:hover { background: #f8fafc; }\n }\n /* ── Footer totals row (totalsEndpoint) ─── */\n tfoot tr { background: #f8fafc; border-top: 2px solid #e2e8f0; }\n tfoot th.dt-foot-label {\n padding: 10px 14px; font-size: 0.875rem; font-weight: 700; color: #1e293b;\n text-transform: none; letter-spacing: normal; background: #f8fafc; border-right: 1px solid #f1f5f9; white-space: nowrap;\n }\n tfoot td { padding: 10px 14px; font-weight: 700; color: #1e293b; background: #f8fafc; }\n .dt-card-totals { background: #f8fafc; font-weight: 600; }\n .dt-row-clickable { cursor: pointer; }\n .dt-row-clickable:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; }\n td {\n padding: 10px 14px; color: #334155; vertical-align: middle;\n white-space: nowrap; border-right: 1px solid #f1f5f9;\n &:last-child { border-right: none; }\n }\n .dt-td-actions { text-align: center; padding: 6px 8px; }\n /* stickyActions: the Actions header + cells stay at the right edge of a sideways-scrolling table (opaque, so the cells scrolling under them stay hidden) */\n .dt-sticky-actions th.dt-th-actions,\n .dt-sticky-actions td.dt-td-actions { position: sticky; right: 0; box-shadow: -1px 0 0 #e2e8f0; }\n .dt-sticky-actions th.dt-th-actions { z-index: 3; background: #f8fafc; }\n .dt-sticky-actions td.dt-td-actions { z-index: 1; background: #fff; }\n /* Each pinned cell is its own stacking layer, so the row menu opened in it was painted UNDER the pinned cells of the rows below it (later in the DOM, same z-index).\n The cell that holds the open menu (:has - Safari does not focus a button on click, so :focus-within alone is not enough) goes one layer up. */\n .dt-sticky-actions td.dt-td-actions:focus-within,\n .dt-sticky-actions td.dt-td-actions:has(.mm-dropdown) { z-index: 2; }\n .dt-sticky-actions tbody tr:hover td.dt-td-actions { background: #f8fafc; }\n .dt-sticky-actions tbody tr.dt-row-selected td.dt-td-actions { background: #eff6ff; }\n .dt-sticky-actions tbody tr.dt-row-selected:hover td.dt-td-actions { background: #dbeafe; }\n /* ColumnDef.width: the cell is fixed to that width; longer text is cut with an ellipsis */\n .dt-td-width { overflow: hidden; text-overflow: ellipsis; }\n\n /* ── Cell types ─── */\n .dt-img { display: inline-block; vertical-align: middle; object-fit: cover; border: 1px solid #e2e8f0; background: #f1f5f9; flex-shrink: 0; }\n .dt-img-ph { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; color: #94a3b8; background: #f1f5f9; border: 1px solid #e2e8f0; flex-shrink: 0; }\n .dt-img-ph svg { width: 55%; height: 55%; }\n .dt-img-circle-md { width: 40px; height: 40px; border-radius: 50%; }\n .dt-img-circle-sm { width: 28px; height: 28px; border-radius: 50%; }\n .dt-img-rounded-md { width: 48px; height: 32px; border-radius: 6px; }\n .dt-img-rounded-sm { width: 36px; height: 24px; border-radius: 5px; }\n .dt-avatar-name { display: flex; align-items: center; gap: 8px; }\n .dt-name-text { color: #1e293b; }\n .dt-overdue { color: #dc2626; font-weight: 500; }\n .dt-none { color: #64748b; } /* slate-500: 4.76:1 on white (slate-400 was 2.56:1) */\n /* Link cell: real <a>; long text is cut with an ellipsis like other cells (inline-block + overflow, plain CSS). */\n .dt-link {\n position: relative; display: inline-block; max-width: 100%; padding: 1px 2px; vertical-align: bottom;\n overflow: hidden; text-overflow: ellipsis; white-space: nowrap;\n color: #2563eb; text-decoration: none; border-radius: 3px; cursor: pointer;\n }\n .dt-link:hover { text-decoration: underline; color: #1d4ed8; }\n .dt-link:focus-visible { outline: 2px solid #3b82f6; outline-offset: -2px; text-decoration: underline; }\n /* Touch: a link cell is a 44px target without making the row taller (padding grows the box, the equal negative margin takes it back out of the layout). */\n @media (pointer: coarse), (max-width: 480px) {\n .dt-link { padding: 12px 2px; margin: -12px 0; }\n }\n .dt-card-detail-value .dt-link, .dt-card-name .dt-link { white-space: normal; overflow-wrap: anywhere; }\n .dt-sr-only {\n position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;\n clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;\n }\n .dt-tags { display: flex; align-items: center; gap: 4px; }\n .dt-tags-more {\n font-size: 0.75rem; font-weight: 600; color: #475569;\n background: #f1f5f9; border-radius: 999px; padding: 2px 7px;\n cursor: default; user-select: none;\n border: 1px solid #e2e8f0;\n &:focus-visible { outline: 2px solid #60a5fa; outline-offset: 2px; border-radius: 999px; }\n }\n\n /* Fixed tooltip — renders outside dt-table-wrap so overflow:auto can't clip it */\n .dt-tag-tooltip {\n position: fixed; z-index: 9999; pointer-events: none;\n background: #1e293b; border-radius: 10px;\n padding: 8px 10px; display: flex; flex-direction: column; gap: 5px;\n box-shadow: 0 4px 6px rgba(0,0,0,0.06), 0 10px 24px rgba(0,0,0,0.14);\n transform: translateX(-50%) translateY(-100%);\n animation: dt-tip-in 120ms ease;\n max-width: 220px;\n }\n @keyframes dt-tip-in { from { opacity: 0; transform: translateX(-50%) translateY(calc(-100% + 4px)); } to { opacity: 1; transform: translateX(-50%) translateY(-100%); } }\n .dt-cell-star { margin-right: 6px; }\n /* Leading icon (iconFn): sits on the first text line, never shrinks, takes the text colour. */\n .dt-cell-icon { flex-shrink: 0; display: inline-block; margin-right: 6px; vertical-align: -3px; color: #64748b; }\n .dt-actions-cell { display: flex; align-items: center; justify-content: center; }\n\n /* ── Bulk bar ─── */\n .dt-bulk-bar {\n display: flex; align-items: center; gap: 10px; flex-wrap: wrap;\n align-self: flex-start;\n padding: 10px 14px; margin-bottom: 8px;\n background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px;\n }\n .dt-bulk-count { font-size: 0.875rem; font-weight: 600; color: #1e40af; white-space: nowrap; flex-shrink: 0; }\n .dt-bulk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }\n .dt-bulk-actions ui-select { max-width: 180px; min-width: 120px; }\n .dt-bulk-icon { flex-shrink: 0; margin-right: 6px; vertical-align: -3px; }\n .dt-bulk-hint { font-size: 0.8125rem; line-height: 1.35; color: #475569; }\n\n /* ── Card checkbox ─── */\n .dt-card-cb {\n display: flex; align-items: center; padding: 0 0 6px 0;\n }\n\n /* ── Card selected state ─── */\n .dt-card-selected { background: #eff6ff !important; border-color: #bfdbfe !important; }\n\n /* ── Checkbox column ─── */\n .dt-th-cb {\n width: 44px; padding: 0 10px !important; text-align: center !important;\n border-right: 1px solid #e2e8f0; background: #f8fafc;\n }\n .dt-td-cb {\n width: 44px; padding: 0 10px !important; text-align: center !important;\n border-right: 1px solid #f1f5f9;\n }\n\n /* ── Row reordering (reorderable) ─── */\n .dt-th-grip { width: 36px; padding: 0 !important; border-right: 1px solid #e2e8f0; background: #f8fafc; }\n .dt-td-grip { width: 36px; padding: 0 !important; text-align: center !important; border-right: 1px solid #f1f5f9; }\n .dt-grip {\n display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px;\n color: #64748b; cursor: grab; -webkit-user-select: none; user-select: none; touch-action: none;\n }\n .dt-grip:hover { background: #f1f5f9; color: #334155; }\n .dt-grip:active { cursor: grabbing; }\n .dt-grip:focus-visible { outline: 2px solid #3b82f6; outline-offset: 1px; }\n .dt-grip-off { color: #cbd5e1; cursor: not-allowed; }\n .dt-grip-off:hover { background: none; color: #cbd5e1; }\n .dt-row-move { display: none; }\n /* A touch screen moves rows with the buttons (native drag is unreliable there): the grip gives way to them. */\n @media (pointer: coarse) {\n .dt-grip { display: none; }\n .dt-row-move { display: inline-flex; flex-direction: column; align-items: center; }\n .dt-th-grip, .dt-td-grip { width: 56px; }\n }\n .dt-row-dragging { opacity: 0.45; }\n .dt-row-over-before > td { box-shadow: inset 0 2px 0 #3b82f6; }\n .dt-row-over-after > td { box-shadow: inset 0 -2px 0 #3b82f6; }\n .dt-card-move { display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0; }\n @media (forced-colors: active) {\n .dt-row-over-before > td { box-shadow: inset 0 2px 0 Highlight; }\n .dt-row-over-after > td { box-shadow: inset 0 -2px 0 Highlight; }\n .dt-grip:focus-visible { outline-color: Highlight; }\n }\n\n /* ── Selected row ─── */\n .dt-row-selected { background: #eff6ff !important; }\n .dt-row-selected:hover { background: #dbeafe !important; }\n\n /* ── States ─── */\n .dt-state-cell { padding: 0 !important; border: none !important; background: #fff !important; }\n /* td is nowrap for data cells; the error / empty message in this cell must wrap inside the table border (it inherited nowrap and ran past it). */\n .dt-state-cell { white-space: normal; }\n\n /* ── iPad / tablet optimizations (≤1024px) ─── */\n @media (max-width: 1024px) {\n /* Row height: 38px+ for comfortable touch */\n th { padding: 10px 12px; }\n td { padding: 11px 12px; }\n /* Sort button — larger vertical tap area */\n .dt-sort-btn { padding: 4px 0; }\n /* Actions cell — taller so ⋮ button is easier to tap */\n .dt-td-actions { padding: 6px 6px; }\n /* Bulk bar stretches full width on tablet so wrapped buttons have room */\n .dt-bulk-bar { align-self: stretch; }\n }\n\n /* ── Tablet portrait / large phone (≤820px): search + tabs on their own row, buttons on the next ─── */\n @media (max-width: 820px) {\n .dt-header-left { flex-basis: 100%; }\n .dt-header-right { flex-basis: 100%; justify-content: flex-start; }\n }\n\n /* ── Small tablet / large phone landscape (≤768px) ─── */\n @media (max-width: 768px) {\n th { padding: 9px 10px; font-size: 0.8125rem; }\n td { padding: 10px 10px; font-size: 0.8125rem; }\n .dt-sk-search { width: 100%; }\n }\n\n /* ── Phone (≤640px): card view replaces table ─── */\n @media (max-width: 640px) {\n /* Never shrink or wrap: in a height-limited host (card list taller than the screen) a shrinking, wrapping column\n pushed the right-hand slot into a second column and the whole page scrolled sideways. */\n .dt-header { flex-direction: column; flex-wrap: nowrap; flex-shrink: 0; align-items: stretch; }\n /* The tablet rule above gives both slots flex-basis: 100%, which is the full WIDTH in a wrapping row. In this column that same 100% is the\n whole header HEIGHT, so the right-hand slot (search toolbar) became as tall as the header and its vertically centred buttons landed on top of the\n phone Sort row below. Each slot takes its own content height here. */\n .dt-header-left, .dt-header-right { width: 100%; flex-basis: auto; }\n /* Hide table, show cards */\n .dt-table-wrap { display: none; }\n /* Skeleton toolbar adapts */\n .dt-sk-search { width: 100%; }\n .dt-sk-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }\n .dt-sk-toolbar-right { align-self: flex-end; }\n /* Bulk bar: full width, count + clear on one row, buttons fill below */\n .dt-bulk-bar {\n align-self: stretch;\n padding: 10px 12px;\n row-gap: 8px;\n }\n /* The count takes the first row; the action buttons share the next one with Clear (right-aligned) while they fit and wrap together when they do not.\n (flex: 1 sets the flex-basis to 0, so a plain width: 100% was ignored and the buttons sat beside the count with Clear floating between them.) */\n .dt-bulk-count { flex: 1 1 100%; }\n .dt-bulk-actions { flex: 1 1 auto; width: auto; }\n .dt-bulk-hint { flex-basis: 100%; }\n .dt-bulk-actions ui-select { max-width: 100%; flex: 1; }\n }\n\n /* Built-in delete confirm modal message */\n .dt-confirm-msg { margin: 0; font-size: 0.9375rem; color: #334155; line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; white-space: pre-line; }\n .dt-confirm-details { margin: 10px 0 0; padding-left: 20px; font-size: 0.875rem; color: #64748b; line-height: 1.5; overflow-wrap: anywhere; word-break: break-word; }\n .dt-confirm-details li + li { margin-top: 4px; }\n\n /* Pagination stays flush to the table bottom border */\n /* The pagination footer uses the same light grey as the column headers (thead tr). */\n ui-pagination { flex-shrink: 0; --ui-pagination-bg: #f8fafc; }\n\n /* ── Card list — fills remaining height and scrolls vertically on mobile ─── */\n /* Phone-only sort + filter row above the card list (rendered only when _isPhone()). */\n .dt-phone-controls { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; flex-shrink: 0; }\n .dt-phone-sort { display: flex; align-items: center; gap: 8px; }\n .dt-phone-sort-label { font-size: 0.8125rem; font-weight: 600; color: #475569; /* slate-600: 6.92:1 on #f1f5f9 */ flex-shrink: 0; }\n .dt-phone-sort-select {\n flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 0 36px 0 12px;\n font-family: inherit; font-size: 1rem; /* 16px: no iOS focus-zoom */\n color: #1e293b; border: 1px solid #7c8ba1; border-radius: 8px;\n /* Safari (macOS) ignores min-height / height on a native select unless its own appearance is switched off (the library's ui-select does the same);\n the chevron the native control drew is then drawn here. */\n -webkit-appearance: none; appearance: none;\n background: #fff url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E\") no-repeat right 12px center;\n }\n .dt-phone-filters { display: flex; flex-wrap: wrap; gap: 8px; }\n\n .dt-card-list {\n display: none; /* shown only at ≤640px via the media query below */\n flex-direction: column; gap: 8px;\n flex: 1; min-height: 0; overflow-y: auto;\n }\n /* Must come after the base rule above: same specificity, so the later rule wins. */\n @media (max-width: 640px) {\n .dt-card-list { display: flex; padding-bottom: 8px; }\n }\n\n .dt-card {\n background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;\n contain: layout style;\n padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;\n transition: background 0.1s;\n }\n /* contain: layout makes each card its own stacking context, which would trap an open row menu\n beneath the following cards. The menu's dropdown only exists in the DOM while open, so raise\n just that card above its siblings. */\n .dt-card:has(.mm-dropdown) { position: relative; z-index: 1; }\n .dt-card-clickable { cursor: pointer; }\n .dt-card-clickable:active { background: #f8fafc; }\n .dt-card-clickable:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }\n\n /* Card header: avatar/name + action menu */\n .dt-card-header {\n display: flex; align-items: center; gap: 10px;\n }\n .dt-card-title {\n display: flex; align-items: center; gap: 10px;\n flex: 1; min-width: 0;\n }\n /* Long names (a property address) wrap to at most three lines, then end in an ellipsis. */\n .dt-card-name {\n min-width: 0; font-weight: 600; color: #1e293b; font-size: 0.9375rem;\n overflow: hidden; text-overflow: ellipsis; overflow-wrap: anywhere;\n display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3;\n }\n .dt-card-name-plain { flex: 1; }\n .dt-card-actions { margin-left: auto; flex-shrink: 0; }\n\n /* Badge pills row */\n .dt-card-badges { display: flex; flex-wrap: wrap; gap: 6px; }\n\n /* Tag pills row (smaller than status badges) */\n .dt-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }\n\n /* Detail key/value rows */\n .dt-card-details { display: flex; flex-direction: column; gap: 5px; }\n .dt-card-detail-row {\n display: flex; justify-content: space-between; align-items: baseline;\n gap: 8px; font-size: 0.8125rem;\n }\n .dt-card-detail-label { color: #64748b; flex-shrink: 0; }\n .dt-card-detail-value { color: #334155; font-weight: 500; text-align: right; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }\n\n /* Card skeleton layout wrappers (ui-skeleton handles shimmer) */\n .dt-card-sk { gap: 12px; }\n .dt-card-sk-header { display: flex; align-items: center; gap: 10px; }\n .dt-card-sk-badges { display: flex; gap: 6px; }\n .dt-card-sk-rows { display: flex; flex-direction: column; gap: 8px; }\n\n /* Reduced motion: no entrance / shimmer animation (a loading spinner stays, slower). */\n @media (prefers-reduced-motion: reduce) {\n .dt-sk-shimmer::after, .dt-sk-cell::after { animation: none; transform: none; opacity: 0; } /* no shimmer sweep */\n .dt-tag-tooltip { animation: none; }\n .dt-sort-icon { transition: none; }\n }\n `],\n})\nexport class DataTableComponent<T extends Record<string, any>> implements OnInit {\n /* ── Inputs ─────────────────────────────────────────────────── */\n readonly endpoint = input.required<string>();\n readonly columns = input.required<ColumnDef[]>();\n /** Search box placeholder when no column is searchable; `null` (default) = the library text for the active language. */\n readonly searchPlaceholder = input<string | null>(null);\n readonly pageSize = input(50);\n /** Accessible name of the table; `null` (default) = the library text for the active language. */\n readonly tableLabel = input<string | null>(null);\n protected readonly tableLabelText = computed(() => this.tableLabel() ?? this.labels.t('dataTable.tableLabel'));\n /** Message of the empty table; `null` (default) = the library text for the active language. */\n readonly emptyMessage = input<string | null>(null);\n protected readonly emptyMessageText = computed(() => this.emptyMessage() ?? this.labels.t('dataTable.emptyMessage'));\n /**\n * Text of the retry button in the failed-load state (desktop table and phone cards). Plain text.\n * Empty / blank keeps the error state's own default (\"Try again\").\n */\n readonly retryLabel = input('');\n protected readonly _retryLabel = computed(() => this.retryLabel().trim() || this.labels.t('dataTable.tryAgain'));\n readonly lockedColumn = input('');\n readonly savedViews = input<SavedView[]>([]);\n /**\n * When provided, the table manages saved views automatically — loads from backend on init,\n * saves/deletes via API, and restores state on load. Value is the `page` key used in\n * `GET /api/saved-views?page=<savedViewsPage>`. No host wiring needed.\n */\n readonly page = input('');\n /** Show column config + saved views toolbar. Defaults true. Set false to hide both. */\n readonly showToolbar = input(true);\n /**\n * Show the More Actions menu in the toolbar (Import, Columns, Save/Saved Views and page-defined menu items). Defaults true.\n * Set false for a page that has nothing to offer there; Export, page-defined primary/secondary buttons and the search box\n * are unaffected. The table still hides the menu by itself when it is empty and unfiltered.\n */\n readonly showMoreActions = input(true);\n /**\n * Words a quick-filter tab. Called with the tab's key (a key of `/counts`, e.g. `no-deals`); the text it returns is the tab's label. Return `null`, `undefined` or `''` for a key the host does not\n * word and the table reads it as before (the label of a column with a `badgeFn` that has that value, else the key split into capitalised words: `no-deals` → \"No Deals\"). Use it when a tab has no\n * column to take its text from, e.g. a Spanish app wording `no-deals` → \"Sin negocios\". The tab's `value` (the key sent to the backend) never changes. Default: none (every label as before).\n */\n readonly quickTabLabelFn = input<((key: string) => string | null | undefined) | null>(null);\n /**\n * Show the search box above the table. Defaults true. Set false for small fixed tables where searching is meaningless\n * (a handful of summary rows). Quick-filter tabs and the toolbar are unaffected; when the search box, the tabs and the\n * toolbar are all off, the header row above the table is not rendered at all.\n */\n readonly showSearch = input(true);\n /**\n * Show the quick-filter tabs (\"All / Active / ...\"), which the table builds from the `/counts` endpoint. Defaults true:\n * with correct `/counts` data the tabs show. Set false for a table where the tabs add nothing (a small breakdown table in a\n * side panel); search, toolbar, column filters and the counts requests are unaffected. When the search box, the toolbar and the\n * tabs are all off, the header row is not rendered at all.\n */\n readonly showQuickTabs = input(true);\n /** `false` hides the pager under the rows: the table shows only the first `pageSize` rows (a dashboard card that links to the full list instead). Default `true`. */\n readonly showPagination = input(true);\n /**\n * Keep the Actions column (the row \"⋮\" menu) pinned to the right edge while the table scrolls sideways, so a wide table never hides it\n * off-screen. Default false: every existing table is unchanged. Only matters when the table is wider than its container (columns scroll);\n * phones use the card list, which has no sideways scroll.\n */\n readonly stickyActions = input(false);\n /**\n * Optional heading shown at the start of the header row, on the same row as the search box / tabs on the left and the\n * Export / primary buttons on the right (rendered as an `<h3>`, also while the table is loading and when it is empty).\n * Empty (default) renders nothing. Use it when the table is a section of a page and its title belongs with its toolbar.\n */\n readonly tableTitle = input('');\n /** False when the header row would be empty (no title, no search box, no toolbar, no quick-filter tabs). */\n protected readonly _showHeader = computed(() => !!this.tableTitle() || this.showSearch() || this.showToolbar() || this._effectiveTabs().length > 0);\n /** Optional endpoint that returns Record<string,number> counts per quick-filter value. */\n readonly countsEndpoint = input('');\n /**\n * Optional footer totals row. Path relative to `baseUrl` (like `endpoint`). When set, the table GETs it with the same query params as the\n * rows request except paging and sorting (host `params`, lower-cased `search` + `searchFields`, active tab as `filter`, column filters) and\n * shows a footer built from each column's `footerFn`. The response is `Record<string, string | number | null>`. Totals follow the FILTERED\n * set, not the page; they are refetched on search / tab / filter / params / refresh() / resetToFirstPage() / import (not on paging or\n * sorting) and never cached. Hidden while loading, on error, with zero rows, or when the totals request fails (silently).\n */\n readonly totalsEndpoint = input('');\n /** Text of the footer's label cell (first visible column) and the phone summary card's accessible name. */\n /** Label of the footer totals row; `null` (default) = the library text for the active language. */\n readonly totalsLabel = input<string | null>(null);\n protected readonly totalsLabelText = computed(() => this.totalsLabel() ?? this.labels.t('dataTable.totalsLabel'));\n /**\n * Optional extra query params owned by the host page (e.g. a period picker or a parent-record id),\n * sent with every row, /counts, /filter-counts and export request. When the value changes the table\n * goes back to page 1 and refreshes rows + counts; search, sort, tab and column filters are kept.\n * Omit it (default null) and nothing changes. Empty / null values are dropped.\n * [params]=\"{ period: period() }\"\n */\n readonly params = input<Record<string, string | null | undefined> | null>(null);\n /** Action buttons rendered in the table header. Primary variant = standalone button; secondary = More Actions dropdown. */\n readonly tableButtons = input<ToolbarAction[]>([]);\n /** Optional endpoint that returns Record<string, Record<string,number>> counts per badge column value. */\n readonly filterCountsEndpoint = input('');\n /** Import/export config. When provided, Import + Export buttons are automatically added to the toolbar. */\n readonly importExportConfig = input<ImportExportConfig | null>(null);\n /** Competitor/source profiles for the import wizard. App-defined — not baked into the library. */\n readonly importSources = input<ImportSource[] | undefined>(undefined);\n /**\n * Page permission. Anything other than 'full' makes the table read-only: no Import,\n * no bulk update/delete and no checkbox column (even when `selectable` is set), no page-defined\n * toolbar buttons except Export and pure reads marked `allowReadOnly` (More Actions offers only their existing Saved Views), and the\n * row menu offers only View (`type: 'view'`).\n * Rows with nothing to show get no \"⋮\" trigger; the Actions column is dropped when no row has View.\n */\n readonly permission = input<TablePermission>('full');\n /** The app's optional central read-only switch (`provideReadOnlyMode`): while it is on, every table is read-only whatever its `permission` says. Off / not provided = no effect. */\n private readonly _readOnlyMode = injectReadOnlyMode();\n protected readonly _canEdit = computed(() => this.permission() === 'full' && !this._readOnlyMode());\n /** Enable row checkboxes and selection count bar (without bulk actions). */\n readonly selectable = input(false);\n /** Singular item label used in the selection count (e.g. \"contact\" → \"3 contacts selected\"). */\n readonly itemLabel = input('item');\n /** Plural label; defaults to English pluralisation of `itemLabel` (\"property\" → \"properties\"). */\n readonly itemLabelPlural = input<string>('');\n /** The singular item word: the host's `itemLabel`, or (when the host left the default `item`) the dictionary word for the active language. */\n protected _itemWord(): string {\n const v = this.itemLabel();\n return v === 'item' ? this.labels.t('dataTable.itemWord') : v;\n }\n /** The plural item word: the host's `itemLabelPlural`, else the dictionary word for the default item, else English pluralisation of the host's label (hosts in other languages pass `itemLabelPlural`). */\n protected _itemsWord(): string {\n const p = this.itemLabelPlural();\n if (p) return p;\n return this.itemLabel() === 'item' ? this.labels.t('dataTable.itemsWord') : pluralize(this.itemLabel());\n }\n protected _countLabel(count: number): string {\n return count === 1 ? this._itemWord() : this._itemsWord();\n }\n /** \"3 contacts selected\" in the active language (singular/plural forms differ in Spanish: \"1 contacto seleccionado\"). */\n protected _selectedText(): string {\n const n = this._selectedIds().size;\n return this._plural('dataTable.selectedCount', n, { item: this._countLabel(n) });\n }\n /** `<base>_one` / `<base>_other` label for a count, with `count` (and any `extra` placeholders) filled in. */\n private _plural(base: string, count: number, extra: Record<string, string | number> = {}): string {\n return this.labels.t(`${base}_${count === 1 ? 'one' : 'other'}` as UiLabelKey, { count, ...extra });\n }\n /**\n * \"3 updated, 1 skipped, 2 not allowed, 4 busy (try again).\" when some rows were left out (\"Actualización: 3, omisiones: 1, sin permiso: 2, en uso: 4 (intente de nuevo).\" in Spanish), else \"3 item(s) updated.\".\n * `busy` = rows another save held at that moment (the backend's `busy`, not part of `skipped`); when ONLY busy rows exist the sentence is \"4 contacts are busy: another save was in progress, try again.\".\n */\n private _resultSummary(count: number, done: string, skipped: number, notAllowed: number, busy = 0): string {\n if (busy > 0 && count === 0 && skipped === 0 && notAllowed === 0) return this._plural('dataTable.summaryBusyOnly', busy, { item: this._countLabel(busy) });\n if (skipped > 0 || notAllowed > 0 || busy > 0) {\n return [\n this.labels.t('dataTable.summaryDone', { count, done }),\n skipped > 0 ? this.labels.t('dataTable.summarySkipped', { count: skipped }) : '',\n notAllowed > 0 ? this.labels.t('dataTable.summaryNotAllowed', { count: notAllowed }) : '',\n busy > 0 ? this.labels.t('dataTable.summaryBusy', { count: busy }) : '',\n ].filter(Boolean).join(', ') + '.';\n }\n return this._summaryAll(count, done);\n }\n /** The response's `busy`: a finite number above 0 (whole rows), else 0 (absent, 0, negative, text, NaN: ignored). */\n private _busyOf(r: { busy?: unknown } | null | undefined): number {\n const b = r?.busy;\n return typeof b === 'number' && Number.isFinite(b) && b >= 1 ? Math.floor(b) : 0;\n }\n /** Every row that was sent was busy (nothing updated / skipped / refused): the selection (and an open \"Change <field>\" select) is kept so the user can simply try again. */\n private _allBusy(count: number, busy: number, serverSkipped: number, notAllowed: number): boolean {\n return busy > 0 && count === 0 && serverSkipped === 0 && notAllowed === 0;\n }\n /** The toast of a finished bulk request: busy rows with nothing changed = an amber warning (polite live region, retry needed); a server `message` with nothing changed = an error; otherwise the success toast. */\n private _toastBulkResult(summary: string, serverMsg: string | null, count: number, busy: number): void {\n if (busy > 0 && count === 0) this._toast.warning(serverMsg ? `${summary} ${serverMsg}` : summary);\n else if (serverMsg && count === 0) this._toast.error(serverMsg);\n else this._toast.show(serverMsg ? `${summary} ${serverMsg}` : summary);\n }\n /** \"3 item(s) updated.\" in English (the singular word and \"(s)\"); \"Actualización: 3 contactos.\" in a language whose dictionary turns `dataTable.summaryUsesCountAgreement` on (the word agrees with the count). */\n private _summaryAll(count: number, done: string): string {\n const item = this.labels.t('dataTable.summaryUsesCountAgreement') === 'yes' ? this._countLabel(count) : this._itemWord();\n return this.labels.t(count === 1 ? 'dataTable.summaryAll_one' : 'dataTable.summaryAll_other', { count, item, done });\n }\n /** Default bulk-Delete confirm title: \"Delete \" + the title-cased plural item label (\"template\" → \"Delete Templates\", \"lien waiver\" → \"Delete Lien Waivers\"). */\n protected _deleteTitle(): string {\n const plural = this._itemsWord();\n return this.labels.t('dataTable.deleteTitle', { items: plural.replace(/(^|\\s)(\\S)/g, (_m, sp: string, ch: string) => sp + ch.toUpperCase()) });\n }\n /**\n * Column keys to enable bulk updates for, plus the special keyword `'delete'`.\n * e.g. `['status', 'type', 'delete']`\n * The table matches each key to its column definition to get the label and options —\n * no extra config or API calls needed. Setting this automatically enables row checkboxes.\n * Use `{ field, exclude }` to leave values users can't set out of that field's bulk select:\n * `[{ field: 'status', exclude: ['EXPIRED'] }, 'delete']` (see `BulkUpdateOption`).\n * Use `{ field, allowedFrom: { TARGET: [sourceValues] } }` for a status workflow: only targets some selected row can\n * legally move to are offered, and rows that can't move are skipped (never sent).\n * Use `{ field: 'resend', action: true, label: 'Resend', eligible?, confirm?, variant?, doneLabel? }` for a direct bulk action: a bar button\n * that confirms and POSTs `<endpoint>/bulk/<field>` with `{ ids }` of the eligible rows (no select, no column needed).\n * A blank `label` falls back to the key split on `_`, `-` and camelCase with only the first word capitalised ('send_reminder' -> 'Send reminder');\n * two actions with the same key collapse to the first; an `eligible` that throws counts as \"row not eligible\".\n */\n readonly bulkUpdateOptions = input<BulkUpdateOption<T>[]>([]);\n\n /* ── Outputs ────────────────────────────────────────────────── */\n readonly rowClick = output<T>();\n /**\n * A `cellType: 'link'` anchor was clicked (plain or with ctrl/cmd/shift; a middle-button click is an `auxclick`, not emitted). Fires instead of\n * `rowClick`: the anchor stops the click from reaching the row. For an in-app `routerLink` the table has already\n * called `Router.navigateByUrl` on a plain left click (modifier / `_blank` clicks are left to the browser).\n */\n readonly linkClick = output<LinkClickEvent<T>>();\n /**\n * Optional per-row opt-out for (rowClick): rows where it returns false get no pointer cursor,\n * no tab stop and no click/keyboard activation (e.g. log rows with no linked record).\n */\n readonly rowClickableFn = input<((item: T) => boolean) | null>(null);\n /**\n * Accessible name of a row / card (e.g. `View case for Jane Doe`) so a screen reader announces what activating it does.\n * Return '' (or omit the input) for no `aria-label`.\n */\n readonly rowLabelFn = input<((item: T) => string) | null>(null);\n readonly tableButtonClick = output<string>();\n /** Emitted when a row action with opens === 'panel' is clicked.\n * The host component listens to this and opens the appropriate side panel or form modal. */\n readonly panelActionClick = output<{ type: string; item: T }>();\n readonly saveViewClick = output<void>();\n readonly loadViewClick = output<SavedView>();\n readonly deleteViewClick = output<string>();\n readonly imported = output<void>();\n readonly selectionChange = output<Set<string>>();\n /**\n * Emitted with the active quick-filter tab's key whenever it changes — a tab click, \"Clear filters\" (`''`),\n * or a saved view being applied. `''` means the \"All\" tab. Lets a host page know which tab the user is on\n * (e.g. to preselect it in an Add panel).\n */\n readonly tabChange = output<string>();\n /** Emitted when the user applies a bulk action. The table has already filtered to eligible IDs. */\n readonly bulkAction = output<BulkActionEvent>();\n /**\n * Emitted when the user clicks a bulk action declared `{ field, action: true, opens: 'panel' }`. The table sends nothing: the host opens its\n * own panel for `rows` and, when it has finished, calls `clearSelection()` and `refresh()` on the table.\n */\n readonly bulkPanelClick = output<BulkPanelEvent<T>>();\n /**\n * Emitted after every rows request that completes (a request superseded by a newer one emits nothing; first load, page, sort, search, tab, filter, `refresh()` ...): `{ ok: true, total }` when the rows\n * arrived (`total` = all matching rows), `{ ok: false, total }` when the request failed (the rows on screen are kept, `total` is the last known).\n * Lets a host refresh something that must follow the table (e.g. a failure banner above it).\n */\n readonly loaded = output<{ ok: boolean; total: number }>();\n /** Emitted after a built-in single-row delete completes successfully. */\n readonly rowDeleted = output<T>();\n /**\n * Emitted when a row's ⋮ menu opens (table rows and phone cards), with that row. Library source 2026-11-21. The table fetches nothing: a host that needs fresh data for a row-dependent action (is this unit\n * still bookable? is a reader payment still open?) reads it here and updates what `actionsFn` returns (the host's `getRowActions` cache key must include what it refreshed). Not emitted for read-only users\n * who have no menu, and not again while the same menu stays open.\n */\n readonly rowMenuOpen = output<{ item: T }>();\n /**\n * Words an error for the user (library source 2026-11-21, additive; default `null` = every message as before). Called with the failed request's error (an `HttpErrorResponse`, or the offline layer's error)\n * for: the table's load-failure message (the text replaces the \"Your items couldn't be loaded...\" sentence next to \"Try again\"), and the failure toast of a bulk action (Delete, Change <field>, a direct\n * action, a file action) and of the built-in row delete. The text it returns (trimmed, not empty) is used; `null` / `undefined` / `''` (or a throw) keeps the table's own wording for that error, so a host can\n * word only the errors it knows (e.g. a 409 `{ code: 'reader_busy' }` of its own backend).\n */\n readonly errorTextFn = input<((err: unknown) => string | null | undefined) | null>(null);\n /**\n * Optional drag-and-drop ordering of the rows. Off by default; when `true` (and the user has full access) every row gets a grip\n * (drag it, or focus it and use the arrow keys / Home / End; phone cards get Move up / Move down buttons). Reordering is only\n * offered while the list is in its stored order: with a sort, search, quick tab or column filter active the grips are disabled\n * (their tooltip says why), because the visible order is then not the stored one. The move is applied to the page on screen at\n * once and announced as `(rowReorder)`; the host saves it (a failed save should call `refresh()` to bring back the stored order).\n */\n readonly reorderable = input(false);\n /** Emitted after the user moves a row: `items` is the page in its new order, `from` / `to` are page indexes, `offset` is the number of rows on earlier pages. */\n readonly rowReorder = output<TableRowReorderEvent<T>>();\n\n /* ── DI ─────────────────────────────────────────────────────── */\n private readonly config = inject(FORGEROUTE_CONFIG);\n private readonly http = inject(HttpClient);\n private readonly destroyRef = inject(DestroyRef);\n protected readonly labels = inject(UiLabelsService);\n private readonly _confirmSvc = inject(ConfirmService);\n private readonly _toast = inject(ToastService);\n\n /* ── Internal state ─────────────────────────────────────────── */\n protected readonly _items = signal<T[]>([]);\n /** Public read-only signal of current page items — used by host components for bulk selection. */\n readonly items: Signal<T[]> = this._items.asReadonly();\n protected readonly _selectedIds = signal<Set<string>>(new Set());\n protected readonly _total = signal(0);\n protected readonly _loading = signal(true);\n protected readonly _hasLoaded = signal(false);\n /** Image URLs that failed to load — their cells show the placeholder instead. */\n /** True only while a SEARCH-triggered load is in flight (drives the search box spinner). */\n protected readonly _searchLoading = signal(false);\n private _searchPending = false;\n protected readonly _failedImages = signal<Set<string>>(new Set());\n private readonly _numericKeys = signal<Set<string>>(new Set());\n protected readonly _tabCounts = signal<Record<string, number>>({});\n protected readonly _filterCounts = signal<Record<string, Record<string, number>>>({});\n private _tabCountsSub?: Subscription;\n private _filterCountsSub?: Subscription;\n\n /**\n * Values that actually occur in the data (count > 0). Shared by quick-filter tabs\n * and column filters so both follow the same rule: with only one value there is\n * nothing to filter on — tabs are disabled and the column filter icon is hidden.\n */\n private _presentKeys(counts: Record<string, number>): string[] {\n return Object.keys(counts).filter(k => k !== '' && k !== 'all' && (counts[k] ?? 0) > 0);\n }\n\n /** Auto-generates tabs from countsEndpoint keys. */\n protected readonly _effectiveTabs = computed<QuickFilterTab[]>(() => {\n if (!this.showQuickTabs()) return [];\n const counts = this._tabCounts();\n const present = this._presentKeys(counts);\n // The selected tab always stays (even at 0 under a search): the user is searching within it.\n const active = this._activeTab();\n const hasCounts = Object.keys(counts).length > 0;\n const keys = hasCounts && active && !present.includes(active) ? [...present, active] : present;\n if (!keys.length) return [];\n const hostLabel = this.quickTabLabelFn();\n const toLabel = (s: string) => hostLabel?.(s) || (this._columnBadgeLabel(s) ?? (/[a-z]/.test(s) ? s : s.toLowerCase())\n .replace(/([a-z])([A-Z])/g, '$1 $2')\n .replace(/-/g, ' ')\n .replace(/(^|\\s)\\p{L}/gu, c => c.toUpperCase())); // word starts only: \"booking.com\" stays \"Booking.com\"\n const singleValue = keys.length === 1;\n return [\n { value: '', label: this.labels.t('dataTable.all') },\n ...keys.map(k => ({ value: k, label: toLabel(k), disabled: singleValue })),\n ];\n });\n\n /**\n * Badge label for a quick-filter tab key, so a tab reads exactly like the column's badges\n * (`signsAndPrint` → \"Signs & Print\", `mlsFees` → \"MLS Fees\"). The key is matched to a value from\n * /filter-counts of a column with a badgeFn, ignoring case, dashes, underscores and spaces.\n * null when nothing matches — the caller falls back to splitting the key.\n */\n private _columnBadgeLabel(key: string): string | null {\n const norm = (v: string) => v.toLowerCase().replace(/[^a-z0-9]/g, '');\n const target = norm(key);\n if (!target) return null;\n const filterCounts = this._filterCounts();\n for (const col of this.columns()) {\n if (!col.badgeFn) continue;\n const value = Object.keys(filterCounts[this._filterName(col)] ?? {}).find(v => norm(v) === target);\n if (value === undefined) continue;\n const label = col.badgeFn(value, null)?.label;\n if (label) return label;\n }\n return null;\n }\n protected readonly _error = signal<string | null>(null);\n /** Phone card list is only a role=list while it contains listitems: skeleton cards or real rows (not error / empty / no-match). */\n protected readonly _cardListHasItems = computed(() => this._loading() || (!this._error() && this._items().length > 0));\n private readonly _loadFailed = signal(false);\n /**\n * True from a failed load (the table shows its error state) until a later load SUCCEEDS. Unlike the error state itself it stays true while\n * Retry / a reload is in flight, so a host can keep its own controls (a date range card, say) out of the page for the whole time the\n * table is not showing real data. Read it through the table reference: `tableRef()?.loadFailed()`.\n */\n readonly loadFailed = this._loadFailed.asReadonly();\n protected readonly _search = signal('');\n /** The search text as sent to the API: lower-cased, so every search is case-insensitive whatever the backend does. The input still shows what the user typed. */\n protected readonly _searchParam = computed(() => this._search().toLowerCase());\n protected readonly _page = signal(1);\n protected readonly _sortField = signal<string | null>(null);\n protected readonly _sortDir = signal<SortDir>('asc');\n protected readonly _activeTab = signal('');\n protected readonly _colFilterValues = signal<Record<string, string[]>>({});\n /**\n * Opt-in numeric range filters (`<ui-data-table [rangeFilters]>`): a visible column whose key is listed gets a Min / Max filter (same funnel icon\n * and popover as the value list; the range replaces the value list for that column). Empty (default) = no range filter anywhere: no icon, no\n * param, no saved-view field. The table sends `<minParam>` / `<maxParam>` on rows, export and totals (never on /counts or /filter-counts, like\n * every column filter); the backend filters.\n */\n readonly rangeFilters = input<RangeFilterConfig[]>([]);\n /** Applied ranges by column key (bounds are finite numbers; a bound that is null is omitted). */\n protected readonly _rangeValues = signal<Record<string, ColumnRangeValue>>({});\n /** Listed configs by column key, with defaults resolved. */\n private readonly _rangeSpecs = computed(() => {\n const out = new Map<string, { spec: ColumnRangeSpec; minParam: string; maxParam: string }>();\n for (const c of this.rangeFilters() ?? []) {\n if (!c || typeof c.key !== 'string' || !c.key || out.has(c.key)) continue;\n const step = typeof c.step === 'number' && Number.isFinite(c.step) && c.step > 0 ? c.step : 1;\n const min = typeof c.min === 'number' && Number.isFinite(c.min) ? c.min : 0;\n // A max below min (or not a number) would make the popover unusable: it is ignored.\n const max = typeof c.max === 'number' && Number.isFinite(c.max) && c.max >= min ? c.max : undefined;\n out.set(c.key, {\n minParam: c.minParam || `${c.key}Min`, maxParam: c.maxParam || `${c.key}Max`,\n spec: { min, ...(max !== undefined ? { max } : {}), step, format: c.format ?? 'number', ...(c.unit ? { unit: c.unit } : {}) },\n });\n }\n return out;\n });\n /**\n * Ranges of columns that are no longer listed are forgotten, so listing the column again later starts empty (no stale range comes back).\n * When a forgotten range had a bound, the rows were filtered by it, so the rows are reloaded (page 1, rows only: counts never carry filters)\n * and match the params again. A host that briefly passes `[]` therefore drops the user's ranges.\n */\n private readonly _pruneRanges = effect(() => {\n const keys = this._rangeSpecs();\n untracked(() => {\n const cur = this._rangeValues();\n const stale = Object.keys(cur).filter(k => !keys.has(k));\n if (!stale.length) return;\n const hadBound = stale.some(k => cur[k]?.min != null || cur[k]?.max != null);\n this._rangeValues.set(Object.fromEntries(Object.entries(cur).filter(([k]) => keys.has(k))));\n if (hadBound) { this._page.set(1); this.load(); }\n });\n });\n /** Query params of the applied ranges (only listed keys; empty bounds omitted). */\n protected readonly _rangeParams = computed<Record<string, string>>(() => {\n const out: Record<string, string> = {};\n const values = this._rangeValues();\n for (const [key, cfg] of this._rangeSpecs()) {\n const v = values[key];\n if (!v) continue;\n if (v.min != null) out[cfg.minParam] = String(v.min);\n if (v.max != null) out[cfg.maxParam] = String(v.max);\n }\n return out;\n });\n /** The range filter of a header cell: null unless the table lists this column's key. */\n protected getRangeFilter(col: ColumnDef): { spec: ColumnRangeSpec; value: ColumnRangeValue } | null {\n if (col.cellType === 'actions') return null;\n const cfg = this._rangeSpecs().get(col.key);\n return cfg ? { spec: cfg.spec, value: this._rangeValues()[col.key] ?? { min: null, max: null } } : null;\n }\n protected readonly _phoneRangeCols = computed(() =>\n this._rangeSpecs().size === 0 ? [] : this.visibleCols()\n .map(col => ({ col, rf: this.getRangeFilter(col) }))\n .filter((f): f is { col: ColumnDef; rf: { spec: ColumnRangeSpec; value: ColumnRangeValue } } => f.rf !== null));\n protected onRangeChange(key: string, value: ColumnRangeValue) {\n this._rangeValues.update(prev => {\n const next = { ...prev };\n if (value.min == null && value.max == null) delete next[key]; else next[key] = { min: value.min ?? null, max: value.max ?? null };\n return next;\n });\n this._page.set(1);\n this.load();\n }\n /** True while a listed range filter has a bound set. */\n private _anyRangeActive(): boolean { return Object.keys(this._rangeParams()).length > 0; }\n protected readonly _activeViewId = signal<string | null>(null);\n\n /** Internal saved views managed by the table when savedViewsPage is set. */\n private readonly _internalSavedViews = signal<SavedView[]>([]);\n /** Resolved saved views — internal when savedViewsPage is set, host-supplied otherwise. */\n protected readonly _effectiveSavedViews = computed(() =>\n this.page() ? this._internalSavedViews() : this.savedViews(),\n );\n\n /** Empty = show all defaultVisible; non-empty = show exactly these keys */\n protected readonly _visibleColumns = signal<string[]>([]);\n\n /** Drops the key of every `cellType: 'actions'` column — Actions is never part of a configured/saved column list. */\n protected _configurableKeys(keys: string[] | null | undefined): string[] {\n const actionKeys = new Set(this.columns().filter(c => c.cellType === 'actions').map(c => c.key));\n return (keys ?? []).filter(k => !actionKeys.has(k));\n }\n\n protected readonly _ieRef = viewChild<ImportExportComponent>('ieRef');\n\n /** Tag overflow tooltip — fixed position to escape table's overflow:auto */\n protected readonly _tagTooltip = signal<{ tags: any[]; x: number; y: number } | null>(null);\n\n protected readonly visibleCols = computed(() => {\n const vis = this._visibleColumns();\n const cols = this.columns();\n const numericKeys = this._numericKeys();\n // The Actions column is never user-configurable: it stays visible even when a stored list omits it.\n const base = vis.length\n ? cols.filter(c => c.cellType === 'actions' || vis.includes(c.key))\n : cols.filter(c => c.defaultVisible !== false);\n\n const dates: ColumnDef[] = [];\n const status: ColumnDef[] = [];\n const regular: ColumnDef[] = [];\n const numeric: ColumnDef[] = [];\n const actions: ColumnDef[] = [];\n for (const col of base) {\n if (col.cellType === 'actions') { actions.push(col); }\n else if (col.cellType === 'date') { dates.push(col); }\n else if (col.key === 'status') { status.push(col); }\n else if (numericKeys.has(col.key)) { numeric.push(col); }\n else { regular.push(col); }\n }\n // Read-only users only get View in the row menu — drop the Actions column when no loaded row offers it.\n const shownActions = this._canEdit()\n ? actions\n : actions.filter(col => this._items().some(item => this._rowActions(col, item).length > 0));\n return [...dates, ...status, ...regular, ...numeric, ...shownActions];\n });\n\n protected readonly _effectiveSearchPlaceholder = computed(() => {\n const searchableCols = this.visibleCols().filter(c => c.searchable);\n if (!searchableCols.length) return this.searchPlaceholder() ?? this.labels.t('dataTable.searchPlaceholder');\n const labels = searchableCols.map(c => c.label.toLowerCase());\n return this.labels.t('dataTable.searchBy', { fields: labels.join(', ') });\n });\n\n /**\n * True when the host binds (rowClick). Signal outputs have no public \"observed\" flag, so read the\n * OutputEmitterRef's subscriber list (a method, not a computed: subscribers aren't a signal).\n * Falls back to true if Angular ever changes that internal shape.\n */\n protected _rowClickable(): boolean {\n const listeners = (this.rowClick as any).listeners;\n return listeners === undefined ? true : (listeners?.length ?? 0) > 0;\n }\n\n protected readonly skeletonCols = computed(() =>\n Array.from({ length: Math.min(this.columns().length || 5, 8) }),\n );\n protected readonly skeletonRows = computed(() =>\n Array.from({ length: Math.min(this.pageSize(), 8) }),\n );\n\n /** Splits visible columns into roles for the mobile card view. */\n protected readonly _cardCols = computed(() => {\n const cols = this.visibleCols();\n // Title: avatar-name column, else the page's locked (primary identifier) column, else the first\n // data column. The locked column matters because column order puts the record date first.\n const locked = this.lockedColumn();\n const titleCol = cols.find(c => c.cellType === 'avatar-name')\n ?? (locked ? cols.find(c => c.key === locked && c.cellType !== 'actions') : undefined)\n ?? cols.find(c => c.cellType !== 'actions' && c.cellType !== 'image') ?? null;\n return {\n titleCol,\n imageCol: cols.find(c => c.cellType === 'image') ?? null,\n badgeCols: cols.filter(c => c.cellType === 'badge'),\n tagCols: cols.filter(c => c.cellType === 'tags'),\n detailCols: cols.filter(c =>\n c.key !== titleCol?.key &&\n c.cellType !== 'avatar-name' &&\n c.cellType !== 'image' &&\n c.cellType !== 'badge' &&\n c.cellType !== 'tags' &&\n c.cellType !== 'actions' &&\n !c.mobileHidden,\n ),\n actionsCol: cols.find(c => c.cellType === 'actions') ?? null,\n };\n });\n\n /**\n * A successful load returned no rows and no search, tab or column filter is active: there is nothing to search,\n * export or configure, so only the primary buttons (Add) stay in the toolbar. Host `params` (a date range, a selected\n * parent) don't count — the host's own controls for them stay on screen — but an active search, tab or column filter\n * keeps the full toolbar so the user can clear it.\n */\n protected readonly _emptyUnfiltered = computed(() =>\n this._hasLoaded() && !this._loading() && !this._error() && this._items().length === 0 &&\n !this._hasActiveFilters(),\n );\n\n /** Buttons handed to the toolbar: all of them, or only the primary ones while the table is empty and unfiltered. */\n protected readonly _toolbarButtons = computed((): ToolbarAction[] =>\n this._emptyUnfiltered() ? this._effectiveButtons().filter(b => b.variant === 'primary' || b.keepWhenEmpty) : this._effectiveButtons(),\n );\n\n /** True while the table is empty and unfiltered but the host kept a More Actions item (`keepWhenEmpty`) — the menu stays. */\n protected readonly _keepMoreActions = computed(() =>\n this._emptyUnfiltered() && this._toolbarButtons().some(b => !b.variant && !b.hidden),\n );\n\n /** The reorder column is part of the table (the grips may still be disabled, see `_reorderActive`). */\n protected readonly _reorderOn = computed(() => this.reorderable() && this._canEdit());\n /** Moves are allowed: the list is in its stored order (no sort / search / tab / filter), loaded, and has more than one row. */\n protected readonly _reorderActive = computed(() =>\n this._reorderOn() && !this._loading() && !this._error() && !this._sortField() && !this._hasActiveFilters() && this._items().length > 1);\n /** Why the grips are off: an active sort / search / tab / filter is the reason to name even when it left one row (\"nothing to reorder\" would hide it). */\n protected readonly _reorderHint = computed(() => this._sortField() || this._hasActiveFilters()\n ? this.labels.t('dataTable.reorderBlockedFiltered')\n : this._items().length < 2 ? this.labels.t('dataTable.reorderBlockedNothing') : this.labels.t('dataTable.reorderBlockedOther'));\n /** One id per table, so each grip can point to the instructions (aria-describedby) even with several tables on a page. */\n protected readonly _reorderHelpId = `dt-reorder-help-${++reorderHelpSeq}`;\n protected readonly _dragFrom = signal<number | null>(null);\n /** Key of the row being dragged: the index can go stale if the page reloads mid-drag, the key cannot. */\n private _dragKey: string | number | null = null;\n protected readonly _dragOver = signal<number | null>(null);\n /** Polite screen-reader message after a move. */\n protected readonly _reorderAnnouncement = signal('');\n private readonly _host = inject(ElementRef);\n\n protected reorderLabel(item: T): string {\n const name = this.rowAccessibleName(item);\n return name ? this.labels.t('dataTable.reorderRowNamed', { name }) : this.labels.t('dataTable.reorderRow');\n }\n\n protected onGripDragStart(e: DragEvent, index: number): void {\n if (!this._reorderActive()) { e.preventDefault(); return; }\n this._dragFrom.set(index);\n this._dragKey = this.trackItem(this._items()[index], index);\n if (e.dataTransfer) {\n e.dataTransfer.effectAllowed = 'move';\n e.dataTransfer.setData('text/plain', String(index)); // Firefox does not start a drag without drag data\n const row = (e.target as HTMLElement).closest('tr, .dt-card');\n if (row) e.dataTransfer.setDragImage(row, 16, 16);\n }\n }\n protected onGripDragEnd(): void { this._dragFrom.set(null); this._dragOver.set(null); this._dragKey = null; }\n protected onRowDragOver(e: DragEvent, index: number): void {\n if (this._dragFrom() === null) return;\n e.preventDefault();\n if (e.dataTransfer) e.dataTransfer.dropEffect = 'move';\n this._dragOver.set(index);\n }\n protected onRowDrop(e: DragEvent, index: number): void {\n const dragged = this._dragFrom();\n if (dragged === null) return;\n e.preventDefault();\n // Where the dragged row is NOW (a reload mid-drag can have changed the page); gone = nothing to move.\n const key = this._dragKey;\n const from = key === null ? dragged : this._items().findIndex((item, i) => this.trackItem(item, i) === key);\n this.onGripDragEnd();\n if (from >= 0) this.moveRow(from, index);\n }\n protected onGripKeydown(e: KeyboardEvent, index: number): void {\n if (!this._reorderActive()) return;\n const last = this._items().length - 1;\n if (e.key === 'Enter' || e.key === ' ') {\n // A button must do something when activated: say where the row is and how to move it (it never moves on its own).\n e.preventDefault();\n e.stopPropagation();\n const name = this.rowAccessibleName(this._items()[index]) || this.labels.t('dataTable.rowWordCapital');\n this._reorderAnnouncement.set('');\n afterNextRender(() => this._reorderAnnouncement.set(this.labels.t('dataTable.reorderAtPosition', { name, position: index + 1, total: last + 1 })), { injector: this._injector });\n return;\n }\n const target = e.key === 'ArrowUp' ? index - 1 : e.key === 'ArrowDown' ? index + 1 : e.key === 'Home' ? 0 : e.key === 'End' ? last : null;\n if (target === null) return;\n e.preventDefault();\n e.stopPropagation();\n if (this.moveRow(index, target)) {\n // The rows re-render in the new order: put focus back on the moved row's grip.\n const key = String(this._items()[Math.max(0, Math.min(last, target))]['id'] ?? target);\n afterNextRender(() => {\n this._host.nativeElement.querySelector(`[data-row-key=\"${CSS.escape(key)}\"] .dt-grip`)?.focus();\n }, { injector: this._injector });\n }\n }\n\n /**\n * A Move up / Move down button (touch screens and phone cards). The pressed button can end up disabled (the row reached an end), and a\n * focused control that gets disabled drops focus to the page, so focus goes to the row's other Move button then.\n */\n protected moveByButton(index: number, direction: -1 | 1): void {\n const key = String(this.trackItem(this._items()[index], index));\n if (!this.moveRow(index, index + direction)) return;\n afterNextRender(() => {\n const row = this._host.nativeElement.querySelector(`[data-row-key=\"${CSS.escape(key)}\"]`) as HTMLElement | null;\n const suffix = direction === -1 ? ' up' : ' down';\n const same = row?.querySelector<HTMLElement>(`button[aria-label$=\"${suffix}\"]:not(:disabled)`);\n (same ?? row?.querySelector<HTMLElement>('.dt-row-move button:not(:disabled), .dt-card-move button:not(:disabled)'))?.focus();\n }, { injector: this._injector });\n }\n\n /** Moves the row at `from` to `to` (both page indexes) in the table and tells the host. false = nothing changed. */\n protected moveRow(from: number, to: number): boolean {\n const items = this._items();\n if (!this._reorderActive() || !Number.isInteger(from) || from < 0 || from >= items.length) return false;\n const target = Math.max(0, Math.min(items.length - 1, to));\n if (target === from) return false;\n const next = [...items];\n const [moved] = next.splice(from, 1);\n next.splice(target, 0, moved);\n this._items.set(next);\n const name = this.rowAccessibleName(moved) || this.labels.t('dataTable.rowWordCapital');\n this._reorderAnnouncement.set('');\n afterNextRender(() => this._reorderAnnouncement.set(this.labels.t('dataTable.reorderMoved', { name, position: target + 1, total: next.length })), { injector: this._injector });\n this.rowReorder.emit({ item: moved, from, to: target, items: next, offset: (this._page() - 1) * this.pageSize() });\n return true;\n }\n\n protected readonly _hasActiveFilters = computed(() => {\n const cf = this._colFilterValues();\n return !!this._search() || !!this._activeTab() || Object.values(cf).some(v => v.length > 0) || this._anyRangeActive();\n });\n\n /** Host `params` with empty values dropped; equal by content so a new object with the same values doesn't reload. */\n protected readonly _extraParams = computed<Record<string, string>>(() => {\n const out: Record<string, string> = {};\n for (const [key, val] of Object.entries(this.params() ?? {})) {\n if (val != null && val !== '') out[key] = String(val);\n }\n return out;\n }, { equal: (a, b) => JSON.stringify(a) === JSON.stringify(b) });\n\n /** Current active filter/search/sort params — passed to the export so it exports the filtered view. */\n /** Visible searchable column keys (comma-joined) — the table and Export only search what's on screen. */\n protected readonly _searchFields = computed(() =>\n this.visibleCols().filter(c => c.searchable).map(c => c.key).join(','));\n\n /** Latest footer totals response (null = none / failed / not requested). */\n protected readonly _totals = signal<Record<string, string | number | null> | null>(null);\n private _totalsSub?: Subscription;\n /** Set by paging and sorting: they reload rows but never change the totals. */\n private _totalsSkipNext = false;\n\n protected readonly _footerVisible = computed(() =>\n !!this.totalsEndpoint() && this._totals() !== null && this._hasLoaded() && !this._loading() && !this._error() && this._items().length > 0);\n\n /** Footer text per visible column key (only columns whose footerFn returns text). */\n protected readonly _footerCells = computed<Record<string, string>>(() => {\n const totals = this._totals();\n const out: Record<string, string> = {};\n if (!totals) return out;\n for (const col of this.visibleCols()) {\n if (col.cellType === 'actions' || !col.footerFn) continue;\n const v = col.footerFn(totals);\n if (v != null && v !== '') out[col.key] = String(v);\n }\n return out;\n });\n\n protected readonly _footerPhoneLines = computed(() => {\n const cells = this._footerCells();\n return this.visibleCols().filter(c => cells[c.key] !== undefined).map(c => ({ key: c.key, label: c.label, value: cells[c.key] }));\n });\n\n /** Totals request params: the export params without sorting (the rows request without paging and sorting). */\n private _totalsParams(): Record<string, string> {\n const { sort: _s, direction: _d, ...rest } = this._exportParams();\n return rest;\n }\n\n /** `keepShown`: a silent (background) refresh keeps the current footer on screen until the new totals arrive. */\n private _fetchTotals(keepShown = false): void {\n this._totalsSub?.unsubscribe();\n const ep = this.totalsEndpoint();\n if (!ep) { this._totals.set(null); return; }\n if (!keepShown) this._totals.set(null);\n this._totalsSub = this.http.get<Record<string, string | number | null>>(`${this.config.baseUrl}${ep}`, { params: tableQueryParams(this._totalsParams()) })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: totals => this._totals.set(totals && typeof totals === 'object' ? totals : null),\n error: () => this._totals.set(null),\n });\n }\n\n protected readonly _exportParams = computed<Record<string, string>>(() => {\n const params: Record<string, string> = { ...this._extraParams() };\n if (this._search()) {\n params['search'] = this._searchParam();\n // Same scope as the table's own search, so the CSV never includes rows the table hides.\n if (this._searchFields()) params['searchFields'] = this._searchFields();\n }\n if (this._activeTab()) params['filter'] = this._activeTab();\n if (this._sortField()) { params['sort'] = this._sortField()!; params['direction'] = this._sortDir(); }\n const cf = this._colFilterValues();\n for (const [key, vals] of Object.entries(cf)) { if (vals.length > 0) params[key] = encodeFilterValues(vals); }\n Object.assign(params, this._rangeParams());\n return params;\n });\n\n /**\n * Toolbar buttons with auto-injected Export (always) and Import (only when\n * importExportConfig.importEndpoint is set) when importExportConfig is provided.\n */\n protected readonly _effectiveButtons = computed((): ToolbarAction[] => {\n const canEdit = this._canEdit();\n // Read-only users get no page-defined toolbar actions — only Export (+ their saved views) and pure reads marked `allowReadOnly`.\n const buttons = canEdit ? this.tableButtons() : this.tableButtons().filter(b => b.allowReadOnly);\n const cfg = this.importExportConfig();\n if (!cfg) return buttons;\n // Remove any manually-defined import/export buttons to avoid duplication\n const filtered = buttons.filter(b => b.type !== 'import' && b.type !== 'export');\n return [\n ...filtered,\n { type: 'export', label: this.labels.t('dataTable.export'), ...(cfg.exportInMoreActions ? {} : { variant: 'secondary' as const }),\n icon: 'M4 16v1a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1m-4-8l-4-4m0 0L8 8m4-4v12' },\n // No importEndpoint → export-only table; read-only permission → no Import either\n ...(cfg.importEndpoint && canEdit ? [{ type: 'import', label: this.labels.t('dataTable.import'),\n icon: 'M4 16v1a3 3 0 0 0 3 3h10a3 3 0 0 0 3-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4' }] : []),\n ];\n });\n\n /** True when checkboxes should be shown — either explicit selectable or bulk options are defined. */\n /** Row checkboxes — never for read-only users (no bulk column at all), even when `selectable` is set. */\n protected readonly _isSelectable = computed(() => this._canEdit() && (this.selectable() || this._bulkDefs().length > 0));\n\n /**\n * Derives internal action definitions from the `bulkUpdateOptions` string array.\n * 'delete' → built-in danger action with table-managed confirm dialog.\n * `{ field, action: true, label }` → direct action (type `action-<key>`, no column needed, no select).\n * Everything else → matched to a column: label = the entry's `label` when given, else \"Change {col.label}\"; options from column config.\n */\n protected readonly _bulkDefs = computed((): BulkActionDef[] =>\n (this._canEdit() ? this.bulkUpdateOptions() : [])\n .map((entry): BulkActionDef => {\n const key = typeof entry === 'string' ? entry : entry.field;\n const confirm = typeof entry === 'string' ? undefined : entry.confirm;\n const deletable = typeof entry === 'string' ? undefined : entry.deletable;\n const icon = typeof entry === 'string' ? undefined : entry.icon;\n if (key === 'delete') return { type: 'delete', label: this.labels.t('dataTable.delete'), variant: 'danger', ...(confirm ? { confirm } : {}),\n ...(deletable ? { deletable } : {}), ...(icon ? { icon } : {}) };\n if (typeof entry !== 'string' && entry.action) {\n // Direct action: no column, no select — the entry's label is the button text.\n const label = entry.label?.trim() || this._actionKeyLabel(key);\n return { type: `action-${key}`, label, variant: entry.variant === 'danger' ? 'danger' : 'secondary', action: true,\n ...(entry.eligible ? { eligible: entry.eligible } : {}), ...(entry.doneLabel ? { doneLabel: entry.doneLabel } : {}),\n ...(entry.download && entry.opens !== 'panel' ? { download: entry.download } : {}),\n ...(entry.opens === 'panel' ? { opensPanel: true } : {}), ...(entry.opens === 'panel' && entry.hidden ? { hidden: entry.hidden } : {}),\n ...(confirm ? { confirm } : {}), ...(icon ? { icon } : {}) };\n }\n const exclude = typeof entry === 'string' ? [] : (entry.exclude ?? []);\n const col = this.columns().find(c => c.key === key);\n const allowedFrom = typeof entry === 'string' ? undefined : entry.allowedFrom;\n const canChange = typeof entry === 'string' ? undefined : entry.canChange;\n const canApply = typeof entry === 'string' ? undefined : entry.canApply;\n const skipReason = typeof entry === 'string' ? undefined : entry.skipReason;\n const listAll = typeof entry === 'string' ? undefined : entry.listAll;\n const order = typeof entry === 'string' ? undefined : entry.order;\n const custom = typeof entry === 'string' ? '' : (entry.label?.trim() ?? '');\n return { type: `change-${key}`, label: custom || this.labels.t('dataTable.changeColumn', { column: col?.label ?? key }), variant: 'secondary', field: key,\n ...(custom ? { customLabel: true } : {}),\n ...(exclude.length ? { exclude } : {}), ...(allowedFrom ? { allowedFrom } : {}), ...(canChange ? { canChange } : {}),\n ...(canApply ? { canApply } : {}), ...(skipReason ? { skipReason } : {}), ...(listAll === true || (Array.isArray(listAll) && listAll.length) ? { listAll } : {}),\n ...(Array.isArray(order) && order.length ? { order } : {}),\n ...(confirm ? { confirm } : {}), ...(icon ? { icon } : {}) };\n })\n // A field whose exclusions leave nothing to pick gets no \"Change <column>\" button.\n .filter(def => !def.field || !def.exclude?.length || this._bulkOptionsFor(def).length > 0)\n // Two direct actions with the same key: the first wins (`track def.type` must stay unique).\n .filter((def, i, all) => !def.action || all.findIndex(d => d.type === def.type) === i),\n );\n\n /**\n * Path of a bulk bar button's icon (library source 2026-11-25): the entry's `icon` (a `<ui-icon>` key, known key wins, or a raw 24x24 stroke path), else the default of the kind: Delete = the bin,\n * \"Change <column>\" = the pencil, a direct action = none. An invalid value falls back to the default of its kind. Decorative only.\n */\n protected bulkIconPath(def: BulkActionDef): string | null {\n const v = (def.icon ?? '').trim();\n if (v) {\n const p = uiIconPath(v) ?? (/^[Mm][\\d\\s.,\\-MmLlHhVvCcSsQqTtAaZz]+$/.test(v) ? v : null);\n if (p) return p;\n }\n if (def.type === 'delete') return uiIconPath('delete') ?? null;\n if (def.field && !def.action) return uiIconPath('edit') ?? null;\n return null;\n }\n\n /** Fallback label of a direct action without one: splits the key on `_`, `-` and camelCase, capitalises the first word only ('send_reminder' / 'sendReminder' -> 'Send reminder'). */\n private _actionKeyLabel(key: string): string {\n const words = key.replace(/([a-z0-9])([A-Z])/g, '$1 $2').split(/[\\s_-]+/).filter(Boolean).join(' ').toLowerCase();\n return words.charAt(0).toUpperCase() + words.slice(1);\n }\n\n /** Runs a direct action's `eligible` predicate; a predicate that throws counts as \"row not eligible\". */\n private _isActionEligible(def: BulkActionDef, row: T): boolean {\n try { return !!def.eligible!(row); } catch { return false; }\n }\n\n /** Options for a field-based bulk action: the field's options (or, with `listAll`, its full value set) minus the entry's `exclude` values. */\n private _bulkOptionsFor(def: BulkActionDef): { value: string; label: string }[] {\n const opts = def.listAll ? this._listAllOptions(def) : this._getOptionsForField(def.field!);\n const kept = def.exclude?.length ? opts.filter(o => !this._isBulkExcluded(def, o.value)) : opts;\n return def.order?.length ? orderBulkOptions(kept, def.order) : kept;\n }\n\n /**\n * `listAll` options: a list of values = exactly that set in that order; `true` = the usual options (filter counts, or the page's distinct values)\n * plus every `allowedFrom` target not yet listed. Labels go through the column's `badgeFn`, like the usual options. Blank and repeated values are dropped.\n */\n private _listAllOptions(def: BulkActionDef): { value: string; label: string }[] {\n const col = this.columns().find(c => c.key === def.field);\n const label = (value: string) => (col?.badgeFn ? (col.badgeFn(value, null)?.label || value) : value);\n const values = Array.isArray(def.listAll)\n ? [...def.listAll]\n : [...this._getOptionsForField(def.field!).map(o => o.value), ...Object.keys(def.allowedFrom ?? {})];\n return [...new Set(values.filter(v => typeof v === 'string' && v.trim() !== ''))].map(value => ({ value, label: label(value) }));\n }\n\n /** The loaded-page rows the user has selected. */\n private _selectedRows(): T[] {\n return (this._items() as T[]).filter(i => this._selectedIds().has((i as any)['id']));\n }\n\n /** The `canApply` verdict of a bulk change for the whole selection: allowed, or the reason it is refused (a throwing rule refuses). */\n private _applyVerdict(def: BulkActionDef, target: string, rows: T[], optionLabel: string): { ok: true } | { ok: false; reason: string } {\n if (!def.canApply) return { ok: true };\n let verdict: unknown;\n try { verdict = def.canApply([...rows], target); } catch { verdict = false; }\n if (verdict === true) return { ok: true };\n return { ok: false, reason: typeof verdict === 'string' && verdict.trim() !== '' ? verdict.trim() : this.labels.t('dataTable.bulkCannotApply', { option: optionLabel }) };\n }\n\n /** True when a row whose field currently holds `current` may be moved to `target` by this action. */\n private _canBulkMove(def: BulkActionDef, current: unknown, target: string, row?: unknown): boolean {\n const cur = String(current ?? '');\n if (cur === String(target)) return false; // already there\n if (def.allowedFrom && !def.allowedFrom[target]?.includes(cur)) return false; // workflow: no entry = not selectable\n return !def.canChange || row === undefined || def.canChange(row as T, String(target)); // the page's per-row rule\n }\n\n /** True when `value` is in the action's `exclude` list (ignoring case, spaces, dashes and underscores). */\n private _isBulkExcluded(def: BulkActionDef, value: string): boolean {\n if (!def.exclude?.length) return false;\n const norm = (v: string) => String(v).toLowerCase().replace(/[^a-z0-9]/g, '');\n const target = norm(value);\n return def.exclude.some(x => norm(x) === target);\n }\n\n /** Which bulk action is currently showing its inline select (null = show action buttons). */\n protected readonly _activeBulkType = signal<string | null>(null);\n /** True while the Apply (field change) HTTP call is in flight. */\n protected readonly _applyingBulk = signal(false);\n /** True while the bulk Delete HTTP call is in flight. */\n protected readonly _deletingBulk = signal(false);\n protected readonly _activeBulkDef = computed(() => {\n const t = this._activeBulkType();\n return t ? (this._bulkDefs().find(d => d.type === t) ?? null) : null;\n });\n\n /** Bound to the inline ui-select via ngModel. Plain property — signal change triggers re-render. */\n protected _bulkSelectStr = '';\n\n /** Options for the active bulk action's inline select, filtered to exclude no-ops. */\n protected readonly _eligibleBulkOptions = computed((): { value: string; label: string; disabled?: boolean }[] => {\n const def = this._activeBulkDef();\n if (!def?.field) return [];\n const allOpts = this._bulkOptionsFor(def);\n const selected = this._items().filter(i => this._selectedIds().has(i['id']));\n const eligible = getEligibleOptions(allOpts, selected, def.field as keyof T);\n const reachable = !def.allowedFrom && !def.canChange\n ? eligible\n // Workflow / per-row rule: offer only targets at least one selected row can legally move to.\n : eligible.filter(o => selected.some(i => this._canBulkMove(def, i[def.field!], o.value, i)));\n if (!def.canApply) return reachable;\n // Whole-selection rule: a refused target stays listed but cannot be picked (its reason is shown beside the select).\n return reachable.map(o => this._applyVerdict(def, o.value, selected as T[], o.label).ok ? o : { ...o, disabled: true });\n });\n\n /** Id prefix of the reason hints beside the inline select (the select is linked to them with aria-describedby). */\n protected readonly _bulkHintId = `dt-bulk-hint-${Math.random().toString(36).slice(2, 8)}`;\n /** Space-separated ids of the reason hints, for the select's `aria-describedby` ('' = none, no attribute). */\n protected readonly _bulkOptionHintIds = computed((): string => this._bulkOptionHints().map((_, i) => `${this._bulkHintId}-${i}`).join(' '));\n\n /** \"<option>: <reason>\" for each target the whole-selection rule (`canApply`) refuses right now; shown as visible text beside the inline select. */\n protected readonly _bulkOptionHints = computed((): string[] => {\n const def = this._activeBulkDef();\n if (!def?.canApply) return [];\n const selected = this._items().filter(i => this._selectedIds().has(i['id'])) as T[];\n return this._eligibleBulkOptions().filter(o => o.disabled).flatMap(o => {\n const verdict = this._applyVerdict(def, o.value, selected, o.label);\n return verdict.ok ? [] : [this.labels.t('dataTable.bulkOptionBlocked', { option: o.label, reason: verdict.reason })];\n });\n });\n\n protected readonly _allSelected = computed(() => {\n const items = this._items();\n const sel = this._selectedIds();\n return items.length > 0 && items.every(item => sel.has(item['id']));\n });\n\n protected readonly _someSelected = computed(() =>\n this._selectedIds().size > 0 && !this._allSelected(),\n );\n\n /**\n * The row's human name for assistive tech: the locked column's value (or the first avatar-name / text column),\n * through the column's own `nameFn` / `render` so it reads exactly like the cell. '' when there is none.\n */\n protected rowName(item: T): string {\n const cols = this.columns();\n const locked = this.lockedColumn();\n const col = (locked ? cols.find(c => c.key === locked) : undefined)\n ?? cols.find(c => c.cellType === 'avatar-name')\n ?? cols.find(c => !c.cellType || c.cellType === 'text');\n if (!col) return '';\n const raw = col.nameFn ? col.nameFn(item) : col.render ? col.render(item) : (item as Record<string, unknown>)[col.key];\n return raw == null ? '' : String(raw).trim();\n }\n\n /**\n * Rows of the loaded page whose name repeats get a position suffix (\" (1 of 2)\", \" (2 of 2)\"), so a screen-reader user never hears two rows\n * announced identically (\"Select Jane Cooper\" twice). Names that are unique on the page — and rows with no name — are left exactly as they are.\n */\n private readonly _rowNameSuffix = computed(() => {\n const items = this._items();\n const names = items.map(item => this.rowName(item));\n const total = new Map<string, number>();\n for (const n of names) if (n) total.set(n, (total.get(n) ?? 0) + 1);\n const seen = new Map<string, number>();\n const out = new Map<unknown, string>();\n items.forEach((item, index) => {\n const n = names[index];\n if (!n || (total.get(n) ?? 0) < 2) return;\n const k = (seen.get(n) ?? 0) + 1;\n seen.set(n, k);\n out.set(item, ' ' + this.labels.t('dataTable.rowPosition', { k, total: total.get(n) ?? 0 }));\n });\n return out;\n });\n\n /** A row's accessible name: its name, plus the position among rows of the same name when that name repeats on the page. */\n protected rowAccessibleName(item: T): string {\n const name = this.rowName(item);\n return name ? `${name}${this._rowNameSuffix().get(item) ?? ''}` : '';\n }\n\n /** \"Select Acme Electric\" — a row's selection checkbox name (\"Select Acme Electric (2 of 3)\" when the name repeats on the page). */\n protected selectRowLabel(item: T): string {\n const name = this.rowAccessibleName(item);\n return name ? this.labels.t('dataTable.selectRowNamed', { name }) : this.labels.t('dataTable.selectRow');\n }\n\n /**\n * \"Row actions for Acme Electric\" — a row's actions-menu trigger name. It still contains the generic \"Row actions\"\n * text, so lookups by that accessible name (substring) keep finding the button, while a screen-reader user now\n * hears which row it belongs to (\"Row actions for Acme Electric (2 of 3)\" when the name repeats on the page).\n */\n protected rowActionsLabel(item: T): string {\n const name = this.rowAccessibleName(item);\n return name ? this.labels.t('dataTable.rowActionsNamed', { name }) : this.labels.t('dataTable.rowActions');\n }\n\n protected toggleSelectAll(): void {\n if (!this._isSelectable()) return; // read-only users can never select rows\n const next = this._allSelected()\n ? new Set<string>()\n : new Set(this._items().map(item => item['id'] as string));\n this._selectedIds.set(next);\n this.selectionChange.emit(new Set(next));\n }\n\n protected toggleRow(item: T): void {\n if (!this._isSelectable()) return; // read-only users can never select rows\n const current = new Set(this._selectedIds());\n const id = item['id'] as string;\n if (current.has(id)) { current.delete(id); } else { current.add(id); }\n this._selectedIds.set(current);\n this.selectionChange.emit(new Set(current));\n }\n\n /**\n * The table's current query as the parameters it sends with Export: the host `params`, the lower-cased `search` (+ `searchFields`),\n * the active quick tab as `filter`, `sort` + `direction`, and every active column filter (multi-values comma-joined). A new copy\n * on every call; reading it changes nothing. A host uses it to act on exactly what the table shows (print the same rows, call a\n * report endpoint with the same search / filters) without keeping its own copy of that state. Paging is not included.\n */\n currentQuery(): Record<string, string> {\n return { ...this._exportParams() };\n }\n\n /** Clears the selection — call from the host component after a bulk action completes. */\n clearSelection(): void {\n this._selectedIds.set(new Set());\n this._activeBulkType.set(null);\n this.selectionChange.emit(new Set());\n }\n\n resetColumns(): void {\n this._visibleColumns.set([]);\n }\n\n /**\n * Host-written confirm copy for a bulk action (null = use the default wording). `skippedNote` is the library's standard\n * skipped-rows sentence, appended on a new paragraph unless the copy sets `omitSkippedNote`.\n */\n private _hostConfirm(def: BulkActionDef, ctx: BulkConfirmContext<T>, skippedNote: string,\n fallback: { title: string; confirmLabel: string; variant: 'primary' | 'danger' | 'warning' }) {\n // A direct action has no target value: only the function form applies (a map falls back to the default copy).\n const fn = typeof def.confirm === 'function' ? def.confirm : def.action ? undefined : def.confirm?.[ctx.targetValue];\n if (!fn) return null;\n const out = fn(ctx);\n const copy: BulkConfirmCopy = typeof out === 'string' ? { message: out } : out;\n const note = copy.omitSkippedNote ? '' : skippedNote.trim();\n return {\n title: copy.title ?? fallback.title,\n message: note ? `${copy.message}\\n\\n${note}` : copy.message,\n confirmLabel: copy.confirmLabel ?? fallback.confirmLabel,\n variant: copy.variant ?? fallback.variant,\n ...(copy.details?.length ? { details: copy.details } : {}),\n };\n }\n\n /**\n * The host's reasons for the rows a field change skips (`{ field, skipReason }`): one `{ row, reason }` per skipped row that cannot move to the target and got a non-empty reason.\n * A row that already holds the value is not asked. A callback that throws, or a non-string / blank answer, gives no reason; the text is single-lined and capped at 300 characters.\n */\n private _skipReasonsFor(def: BulkActionDef, skippedRows: T[], target: string): { row: T; reason: string }[] {\n const fn = def.skipReason;\n if (!fn || !def.field) return [];\n const out: { row: T; reason: string }[] = [];\n for (const row of skippedRows) {\n if (String((row as any)[def.field] ?? '') === target) continue;\n let raw: unknown = null;\n try { raw = fn(row, target); } catch { raw = null; }\n const reason = typeof raw === 'string' ? raw.replace(/\\s+/g, ' ').trim().slice(0, 300) : '';\n if (reason) out.push({ row, reason });\n }\n return out;\n }\n\n /** The confirm bullets for the skip reasons: one line per distinct reason in first-seen order, \"<reason> (<rows>)\". */\n private _skipReasonLines(reasons: { reason: string }[]): string[] {\n const counts = new Map<string, number>();\n for (const r of reasons) counts.set(r.reason, (counts.get(r.reason) ?? 0) + 1);\n return [...counts].map(([reason, n]) => `${reason} (${n})`);\n }\n\n /** Why a bulk action can't be used right now ('' = it can). Only Delete with `deletable` and a direct action with `eligible` can be blocked. */\n protected _bulkBlockedReason(def: BulkActionDef): string {\n if (def.action) {\n // A panel action that cannot be used is not shown at all (see _bulkHidden), so it never reaches this reason.\n if (def.opensPanel) return '';\n return def.eligible && this._actionSplit(def).eligible.length === 0\n ? this.labels.t('dataTable.noneQualify', { action: def.label.toLowerCase() }) : '';\n }\n if (def.type !== 'delete' || !def.deletable) return '';\n return this._deleteSplit(def).deletable.length === 0 ? this.labels.t('dataTable.noneDeletable') : '';\n }\n\n /** A panel action is not shown while the host says it is unavailable or no selected row is eligible. Everything else is always shown. */\n protected _bulkHidden(def: BulkActionDef): boolean {\n if (!def.opensPanel) return false;\n let hide = false;\n try { hide = !!def.hidden?.(); } catch { hide = false; }\n return hide || (!!def.eligible && this._actionSplit(def).eligible.length === 0);\n }\n\n /** The distinct reasons of the currently blocked bulk actions, shown as visible text next to the disabled buttons. */\n protected _bulkBlockedHints(): string[] {\n return [...new Set(this._bulkDefs().map(d => this._bulkBlockedReason(d)).filter(r => !!r))];\n }\n\n /** Selected rows (loaded page) split by the delete option's `deletable` predicate; without it every selected row is deletable. */\n private _deleteSplit(def: BulkActionDef): { deletable: T[]; blocked: T[] } {\n const selected = (this._items() as T[]).filter(i => this._selectedIds().has((i as any)['id']));\n if (!def.deletable) return { deletable: selected, blocked: [] };\n return { deletable: selected.filter(r => def.deletable!(r)), blocked: selected.filter(r => !def.deletable!(r)) };\n }\n\n /** Selected rows (loaded page) split by a direct action's `eligible` predicate; without it every selected row is eligible. */\n private _actionSplit(def: BulkActionDef): { eligible: T[]; refused: T[] } {\n const selected = (this._items() as T[]).filter(i => this._selectedIds().has((i as any)['id']));\n if (!def.eligible) return { eligible: selected, refused: [] };\n const ok = selected.map(r => this._isActionEligible(def, r));\n return { eligible: selected.filter((_, i) => ok[i]), refused: selected.filter((_, i) => !ok[i]) };\n }\n\n /** Type of the direct bulk action whose request is in flight (null = none). */\n protected readonly _runningAction = signal<string | null>(null);\n /** True while a direct action's confirm dialog is open (guards against a second click). */\n private _confirmingAction = false;\n\n /** Panel action: no confirm and no request; hands the eligible rows to the host, which opens its own panel. */\n private _openBulkPanel(def: BulkActionDef): void {\n if (this._runningAction() || this._deletingBulk() || this._bulkHidden(def)) return;\n const split = this._actionSplit(def);\n if (split.eligible.length === 0) return;\n this.bulkPanelClick.emit({\n type: def.type, key: def.type.slice('action-'.length), ids: split.eligible.map(r => (r as any)['id'] as string),\n rows: split.eligible, skippedCount: split.refused.length,\n });\n }\n\n /** Direct bulk action: confirm, then POST `<endpoint>/bulk/<key>` with `{ ids }` of the eligible rows. */\n private async _runDirectAction(def: BulkActionDef): Promise<void> {\n if (this._confirmingAction || this._runningAction()) return;\n const split = this._actionSplit(def);\n // Nothing the server would accept: no confirm, no request.\n if (split.eligible.length === 0) return;\n const ids = split.eligible.map(r => (r as any)['id'] as string);\n const skippedCount = split.refused.length;\n const lower = def.label.toLowerCase();\n const skippedNote = skippedCount === 0 ? '' : ' ' + this._plural('dataTable.skipNotQualify', skippedCount, { action: lower });\n const variant = def.variant === 'danger' ? 'danger' as const : 'primary' as const;\n this._confirmingAction = true;\n let confirmed = false;\n try {\n const defaultCopy = {\n title: def.label,\n message: this.labels.t('dataTable.actionConfirm', { action: def.label, count: ids.length, item: this._countLabel(ids.length) }) + skippedNote,\n confirmLabel: def.label,\n variant,\n };\n const hostCopy = def.confirm\n ? this._hostConfirm(def, {\n count: ids.length, skippedAlready: 0, skippedBlocked: skippedCount, selectedCount: this._selectedIds().size,\n itemLabel: this._itemWord(), itemLabelPlural: this._itemsWord(),\n columnLabel: def.label, targetValue: '', targetLabel: '', rows: split.eligible, skippedRows: split.refused, skippedReasons: [],\n }, skippedNote, { title: defaultCopy.title, confirmLabel: defaultCopy.confirmLabel, variant })\n : null;\n confirmed = await this._confirmSvc.confirm(hostCopy ?? defaultCopy);\n } catch {\n // A failing confirm service must neither leave the guard stuck nor send anything.\n confirmed = false;\n } finally {\n this._confirmingAction = false;\n }\n if (!confirmed) return;\n this._runningAction.set(def.type);\n const done = def.doneLabel?.trim() || this.labels.t('dataTable.doneUpdated');\n const url = `${this.config.baseUrl}${this.endpoint()}/bulk/${def.type.slice('action-'.length)}`;\n if (def.download) { this._runDownloadAction(def, url, ids, skippedCount); return; }\n this.http.post<any>(url, { ids })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (r: any) => {\n this._runningAction.set(null);\n // An empty body (204 / null) means the backend handled everything it was sent.\n const count = r == null ? ids.length : (r.updated ?? r.deleted ?? 0);\n const totalSkipped = skippedCount + (r?.skipped ?? 0);\n const notAllowed = r?.notAllowed ?? 0;\n const busy = this._busyOf(r);\n const msg = this._resultSummary(count, done, totalSkipped, notAllowed, busy);\n this._toastBulkResult(msg, this._bulkServerMessage(r), count, busy);\n const keep = this._allBusy(count, busy, r?.skipped ?? 0, notAllowed);\n if (!keep) { this.clearSelection(); this.refresh(); }\n this.bulkAction.emit({ type: def.type, ids, skippedCount, ...(busy > 0 ? { busyCount: busy } : {}) });\n },\n error: (err: any) => {\n this._runningAction.set(null);\n this._toast.error(this._actionError(err));\n },\n });\n }\n\n /** Direct action that returns a file: POST `{ ids }` asking for a blob, save it as one download, toast, clear the selection. */\n private _runDownloadAction(def: BulkActionDef, url: string, ids: string[], skippedCount: number): void {\n const key = def.type.slice('action-'.length);\n const done = def.doneLabel?.trim() || this.labels.t('dataTable.doneDownloaded');\n this.http.post(url, { ids }, { responseType: 'blob', observe: 'response' })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (res) => {\n this._runningAction.set(null);\n if (!res.body) { this._toast.error(this.labels.t('dataTable.genericError')); return; }\n downloadBlob(res.body, fileNameFromContentDisposition(res.headers.get('Content-Disposition')) || def.download?.fileName?.trim() || key);\n const serverSkipped = Math.max(0, Number(res.headers.get('X-Skipped-Count')) || 0);\n // `X-Busy-Count`: rows another save held at that moment (left out of the file, retry later); not part of the skipped count.\n const busy = Math.max(0, Math.floor(Number(res.headers.get('X-Busy-Count')) || 0));\n const count = Math.max(0, ids.length - serverSkipped - busy);\n const totalSkipped = skippedCount + serverSkipped;\n if (busy > 0) this._toast.show(this._resultSummary(count, done, totalSkipped, 0, busy));\n else this._toast.show(totalSkipped > 0 ? this.labels.t('dataTable.summaryDownloadSkipped', { count, done, skipped: totalSkipped }) : this._summaryAll(count, done));\n this.clearSelection();\n this.bulkAction.emit({ type: def.type, ids, skippedCount, ...(busy > 0 ? { busyCount: busy } : {}) });\n },\n error: (err: any) => {\n this._runningAction.set(null);\n void this._downloadErrorMessage(err).then(message => this._toast.error(message));\n },\n });\n }\n\n /**\n * The wording of a failed file request. With a blob response the error body arrives as a Blob, so it is parsed first (JSON `{ message, code, ... }`) and the host's `errorTextFn` gets the SAME shape as for any other failed request\n * (`err.error.code`, `err.error.message`, ...): an `HttpErrorResponse` carrying the parsed object (the offline layer's plain errors keep their shape with `error` replaced). A body that is not JSON is passed as it came (a Blob).\n */\n private async _downloadErrorMessage(err: any): Promise<string> {\n const plain = await this._parsedBlobError(err);\n const host = this._hostErrorText(plain);\n if (host) return host;\n const message = plain !== err ? plain?.error?.message : null;\n if (typeof message === 'string' && message.trim()) return message;\n return actionErrorText(plain, k => this.labels.t(k));\n }\n\n /** The error with its Blob body replaced by the parsed JSON object (same error when the body is no Blob or no JSON object). */\n private async _parsedBlobError(err: any): Promise<any> {\n const body = err?.error;\n if (!(body instanceof Blob)) return err;\n let json: unknown;\n try { json = JSON.parse(await body.text()); } catch { return err; }\n if (json === null || typeof json !== 'object' || Array.isArray(json)) return err;\n return err instanceof HttpErrorResponse\n ? new HttpErrorResponse({ error: json, headers: err.headers, status: err.status, statusText: err.statusText, url: err.url ?? undefined })\n : { ...err, error: json };\n }\n\n /** Called when the user clicks a bulk action button in the selection bar. */\n protected onBulkActionClick(def: BulkActionDef): void {\n if (def.action && def.opensPanel) { this._openBulkPanel(def); return; }\n if (def.action) { void this._runDirectAction(def); return; }\n if (def.type === 'delete') {\n const split = this._deleteSplit(def);\n // Nothing the server would accept: no confirm, no request.\n if (def.deletable && split.deletable.length === 0) return;\n const selectedCount = this._selectedIds().size;\n const count = def.deletable ? split.deletable.length : selectedCount;\n const blockedCount = split.blocked.length;\n const skippedNote = blockedCount === 0 ? '' : ' ' + this._plural('dataTable.skipCantDelete', blockedCount);\n const deleteDefault = {\n title: this._deleteTitle(),\n message: this.labels.t('dataTable.deleteBulkConfirm', { count, item: this._countLabel(count) }) + skippedNote,\n confirmLabel: this.labels.t('dataTable.delete'),\n variant: 'danger' as const,\n };\n const hostCopy = def.confirm\n ? this._hostConfirm(def, {\n count, skippedAlready: 0, skippedBlocked: blockedCount, selectedCount,\n itemLabel: this._itemWord(), itemLabelPlural: this._itemsWord(),\n columnLabel: this.labels.t('dataTable.delete'), targetValue: '', targetLabel: '', rows: split.deletable, skippedRows: split.blocked, skippedReasons: [],\n }, skippedNote, { title: deleteDefault.title, confirmLabel: deleteDefault.confirmLabel, variant: 'danger' })\n : null;\n this._confirmSvc.confirm(hostCopy ?? deleteDefault).then(confirmed => {\n if (!confirmed) return;\n const { eligibleIds, skippedCount } = this._getEligible('delete', undefined, def);\n this._deletingBulk.set(true);\n const url = `${this.config.baseUrl}${this.endpoint()}/bulk/delete`;\n this.http.post<any>(url, { ids: eligibleIds })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (r: any) => {\n this._deletingBulk.set(false);\n // Rows the backend refused to delete (e.g. not in a deletable status) come back as `skipped`.\n // An empty body (204 / null) means the backend deleted everything it was sent.\n const deleted = r == null ? eligibleIds.length : (r.deleted ?? 0);\n const skipped = skippedCount + (r?.skipped ?? 0);\n // Rows the user isn't permitted to change come back as `notAllowed` — report them, don't hide them.\n const notAllowed = r?.notAllowed ?? 0;\n const busy = this._busyOf(r);\n const generated = this._resultSummary(deleted, this.labels.t('dataTable.doneDeleted'), skipped, notAllowed, busy);\n // A readable server `message` explains why rows were left out; nothing deleted → shown as an error (busy rows = a retry warning).\n this._toastBulkResult(generated, this._bulkServerMessage(r), deleted, busy);\n if (!this._allBusy(deleted, busy, r?.skipped ?? 0, notAllowed)) { this.clearSelection(); this.refresh(); }\n this.bulkAction.emit({ type: 'delete', ids: eligibleIds, skippedCount, ...(busy > 0 ? { busyCount: busy } : {}) });\n },\n error: (err: any) => {\n this._deletingBulk.set(false);\n this._toast.error(this._actionError(err));\n },\n });\n });\n return;\n }\n if (def.field) {\n // Field-based action: show inline select with eligible options pre-selected\n this._activeBulkType.set(def.type);\n const opts = this._eligibleBulkOptions();\n this._bulkSelectStr = opts.find(o => !o.disabled)?.value ?? '';\n }\n }\n\n /** True while the field-change confirmation dialog is open (guards against a second Apply click). */\n private _confirmingBulk = false;\n\n /**\n * Applies the inline-selected value for the active field-based bulk action.\n * Asks the user to confirm first (library confirm dialog, same as bulk Delete); the request is only sent on confirm.\n * Cancel / Escape / backdrop leave the selection and the inline select untouched.\n */\n protected async applyBulkAction(): Promise<void> {\n const def = this._activeBulkDef();\n if (!def || !this._bulkSelectStr || !def.field) return;\n if (this._confirmingBulk || this._applyingBulk()) return;\n // An excluded value (e.g. set programmatically) is never sent.\n if (this._isBulkExcluded(def, this._bulkSelectStr)) return;\n const selectedValue = this._bulkSelectStr;\n const optionLabel = this._bulkOptionsFor(def).find(o => o.value === selectedValue)?.label ?? selectedValue;\n // The whole-selection rule: a refused target is never confirmed or sent (the selection may have changed since the select was filled).\n const verdict = this._applyVerdict(def, selectedValue, this._selectedRows(), optionLabel);\n if (!verdict.ok) { this._toast.error(verdict.reason); return; }\n const { eligibleIds, skippedCount } = this._getEligible(def.type, selectedValue, def);\n // How many skipped rows already hold the value (the rest can't legally move to it).\n const selectedRows = (this._items() as any[]).filter(i => this._selectedIds().has(i.id));\n const alreadyCount = selectedRows.filter(i => String(i[def.field!] ?? '') === selectedValue).length;\n const blockedCount = skippedCount - alreadyCount;\n // Nothing can change — nothing to send, nothing to confirm.\n if (eligibleIds.length === 0) {\n this._toast.show(blockedCount > 0\n ? this.labels.t('dataTable.noChangesBlocked', { option: optionLabel })\n : this.labels.t('dataTable.noChangesAlready', { item: this._countLabel(skippedCount), option: optionLabel }));\n this._activeBulkType.set(null);\n return;\n }\n const columnLabel = this.columns().find(c => c.key === def.field)?.label ?? def.field;\n // \"already has this value\" only when that is true of every skipped row; otherwise the generic wording.\n const skippedNote = skippedCount === 0 ? ''\n : ' ' + (blockedCount > 0\n ? this._plural('dataTable.skipCantChange', skippedCount, { option: optionLabel })\n : this._plural('dataTable.skipAlreadyHas', skippedCount));\n this._confirmingBulk = true;\n let confirmed = false;\n try {\n const defaultCopy = {\n title: def.label,\n message: (def.customLabel\n ? this.labels.t('dataTable.bulkCustomConfirm', { label: def.label, option: optionLabel, count: eligibleIds.length, item: this._countLabel(eligibleIds.length) })\n : this.labels.t('dataTable.bulkChangeConfirm', { column: String(columnLabel), option: optionLabel, count: eligibleIds.length, item: this._countLabel(eligibleIds.length) })) + skippedNote,\n confirmLabel: def.label,\n variant: 'primary' as const,\n };\n const eligibleSet = new Set(eligibleIds);\n const skippedRows = selectedRows.filter(i => !eligibleSet.has(i.id)) as T[];\n const skippedReasons = this._skipReasonsFor(def, skippedRows, selectedValue);\n const reasonLines = this._skipReasonLines(skippedReasons);\n const hostCopy = def.confirm\n ? this._hostConfirm(def, {\n count: eligibleIds.length, skippedAlready: alreadyCount, skippedBlocked: blockedCount,\n selectedCount: this._selectedIds().size,\n itemLabel: this._itemWord(), itemLabelPlural: this._itemsWord(),\n columnLabel: columnLabel as string, targetValue: selectedValue, targetLabel: optionLabel,\n rows: selectedRows.filter(i => eligibleSet.has(i.id)) as T[],\n skippedRows, skippedReasons,\n }, skippedNote, { title: defaultCopy.title, confirmLabel: defaultCopy.confirmLabel, variant: 'primary' })\n : null;\n // The skip reasons are listed under the message after the host's own details (host copy) or alone (default copy).\n const shown = hostCopy ? { ...hostCopy, ...(reasonLines.length ? { details: [...(hostCopy.details ?? []), ...reasonLines] } : {}) }\n : { ...defaultCopy, ...(reasonLines.length ? { details: reasonLines } : {}) };\n confirmed = await this._confirmSvc.confirm(shown);\n } catch {\n // A failing confirm service must neither leave the guard stuck nor send anything.\n confirmed = false;\n } finally {\n this._confirmingBulk = false;\n }\n if (!confirmed) return;\n this._applyingBulk.set(true);\n const url = `${this.config.baseUrl}${this.endpoint()}/bulk/${def.field}`;\n this.http.post<any>(url, { ids: eligibleIds, [def.field]: selectedValue })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (r: any) => {\n this._applyingBulk.set(false);\n // An empty body (204 / null) means the backend updated everything it was sent.\n const count = r == null ? eligibleIds.length : (r.updated ?? r.deleted ?? 0);\n // Rows the table left out plus rows the backend skipped (e.g. changed elsewhere since the page loaded).\n const totalSkipped = skippedCount + (r?.skipped ?? 0);\n // Rows the user isn't permitted to change come back as `notAllowed` — report them, don't hide them.\n const notAllowed = r?.notAllowed ?? 0;\n const busy = this._busyOf(r);\n const msg = this._resultSummary(count, this.labels.t('dataTable.doneUpdated'), totalSkipped, notAllowed, busy);\n this._toastBulkResult(msg, this._bulkServerMessage(r), count, busy);\n // Every sent row was busy: keep the selection and the open select (nothing changed, retry with the same Apply); otherwise the usual clear + refresh.\n if (!this._allBusy(count, busy, r?.skipped ?? 0, notAllowed)) { this._activeBulkType.set(null); this.clearSelection(); this.refresh(); }\n this.bulkAction.emit({ type: def.type, ids: eligibleIds, value: selectedValue, skippedCount, ...(busy > 0 ? { busyCount: busy } : {}) });\n },\n error: (err: any) => {\n this._applyingBulk.set(false);\n this._toast.error(this._actionError(err));\n },\n });\n }\n\n /**\n * Returns the eligible IDs and skipped count for a bulk action.\n * - 'delete' — all selected are eligible\n * - 'change-{field}' — skip rows already at targetValue\n * - anything else — all selected are eligible\n */\n private _getEligible(action: string, targetValue?: string, def?: BulkActionDef): { eligibleIds: string[]; skippedCount: number } {\n const selected = (this._items() as any[]).filter(i => this._selectedIds().has(i.id));\n if (action === 'delete') {\n if (def?.deletable) {\n const ok = selected.filter(i => def.deletable!(i));\n return { eligibleIds: ok.map(i => i.id), skippedCount: selected.length - ok.length };\n }\n return { eligibleIds: selected.map(i => i.id), skippedCount: 0 };\n }\n if (action.startsWith('change-') && targetValue !== undefined) {\n const field = action.slice(7);\n const eligible = selected.filter(item => def\n ? this._canBulkMove(def, (item as any)[field], targetValue, item)\n : String((item as any)[field] ?? '') !== String(targetValue));\n return { eligibleIds: eligible.map(i => i.id), skippedCount: selected.length - eligible.length };\n }\n return { eligibleIds: selected.map(i => i.id), skippedCount: 0 };\n }\n\n /**\n * Derives the available options for a given field from the table's existing config —\n * no extra inputs or API calls needed.\n * Priority: filterCounts → distinct item values.\n */\n private _getOptionsForField(field: string): { value: string; label: string }[] {\n // 0. Explicit bulk options declared on the column (only user-settable values)\n const declared = this.columns().find(c => c.key === field);\n if (declared?.bulkOptions?.length) {\n return declared.bulkOptions.map(value => ({\n value,\n label: declared.badgeFn ? (declared.badgeFn(value, null)?.label || value) : value,\n }));\n }\n\n // 1. Already-fetched filter counts (from /filter-counts endpoint)\n // Bulk `field` is the row field (column key); the counts are keyed by the column's filter wire name.\n const colCounts = this._filterCounts()[declared ? this._filterName(declared) : field];\n if (colCounts) {\n const col = declared;\n return Object.keys(colCounts).map(value => ({\n value,\n label: col?.badgeFn ? (col.badgeFn(value, null)?.label || value) : value,\n }));\n }\n\n // 4. Distinct values from current page items\n const col = this.columns().find(c => c.key === field);\n const distinct = [...new Set(this._items().map(i => String(i[field] ?? '')).filter(Boolean))];\n return distinct.map(value => ({\n value,\n label: col?.badgeFn ? (col.badgeFn(value, null)?.label || value) : value,\n }));\n }\n\n /** State for the built-in single-row delete confirmation modal. */\n protected readonly _rowDeleteTarget = signal<T | null>(null);\n protected readonly _rowDeleting = signal(false);\n /** Ids the built-in delete confirm dialog is described by (aria-describedby): its message and the \"what will happen\" list. */\n private readonly _confirmUid = Math.random().toString(36).slice(2, 8);\n protected readonly _confirmMsgId = `dt-confirm-msg-${this._confirmUid}`;\n protected readonly _confirmDetailsId = `dt-confirm-details-${this._confirmUid}`;\n protected readonly _rowDeleteConfig = signal<{ title: string; message: string; confirmLabel: string; details?: string[]; variant?: 'danger' | 'primary' | 'warning' }>({\n title: this.labels.t('dataTable.delete'), message: this.labels.t('dataTable.deleteConfirm'), confirmLabel: this.labels.t('dataTable.delete'),\n });\n\n protected _confirmRowDelete(): void {\n // A confirm that was already open when edit rights ended (the central read-only switch turned on, or the permission dropped) sends nothing and closes.\n if (!this._canEdit()) { this._rowDeleteTarget.set(null); return; }\n const item = this._rowDeleteTarget();\n if (!item || this._rowDeleting()) return;\n this._rowDeleting.set(true);\n this.http.post<{ deleted?: number; skipped?: number; busy?: number; message?: string; skippedReason?: string } | null>(\n `${this.config.baseUrl}${this.endpoint()}/bulk/delete`,\n { ids: [item['id']] },\n ).pipe(takeUntilDestroyed(this.destroyRef)).subscribe({\n next: (r) => {\n this._rowDeleting.set(false);\n this._rowDeleteTarget.set(null);\n // The backend refused (not deletable / changed elsewhere) or the row is already gone: `deleted: 0`.\n // A response without a count (e.g. 204) is treated as success.\n if (r?.deleted === 0) {\n const busy = this._busyOf(r);\n if (busy > 0) {\n // Another save held the row: nothing was deleted, try again (not \"changed or already removed\").\n const serverBusyMsg = this._bulkServerMessage(r);\n const busyText = this._resultSummary(0, '', 0, 0, busy);\n this._toast.warning(serverBusyMsg ? `${busyText} ${serverBusyMsg}` : busyText);\n this.refresh();\n return;\n }\n this._toast.error(this._bulkServerMessage(r) || this.labels.t('dataTable.rowNotDeleted', { item: this._itemWord() }));\n this.refresh();\n return;\n }\n // A readable server `message` / `skippedReason` on a successful delete (e.g. a note about what was left alone) follows the standard toast.\n const rowMsg = this._bulkServerMessage(r);\n const rowDone = this.labels.t('dataTable.rowDeleted', { item: this._itemWord() });\n this._toast.show(rowMsg ? `${rowDone} ${rowMsg}` : rowDone);\n this.refresh();\n this.rowDeleted.emit(item);\n },\n error: (err: any) => {\n this._rowDeleting.set(false);\n this._toast.error(this._hostErrorText(err) ?? err?.error?.message ?? this.labels.t('dataTable.deleteFailed'));\n },\n });\n }\n\n private readonly triggerLoad$ = new Subject<void>();\n\n /** Phone viewport (≤640px, same breakpoint as the card-view CSS) — renders the card list instead of the table. */\n protected readonly _isPhone = signal(false);\n\n constructor() {\n // Render ONE tree (table or cards) per viewport so row menus/checkboxes/renderers don't run twice.\n if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {\n const mq = window.matchMedia('(max-width: 640px)');\n this._isPhone.set(mq.matches);\n const onChange = (e: MediaQueryListEvent) => this._isPhone.set(e.matches);\n mq.addEventListener('change', onChange);\n this.destroyRef.onDestroy(() => mq.removeEventListener('change', onChange));\n }\n\n // Losing edit permission (e.g. switching to read-only) drops any selection — read-only users never\n // have selected rows, and the host is told via selectionChange.\n effect(() => {\n if (this._canEdit()) return;\n untracked(() => {\n if (this._selectedIds().size > 0 || this._activeBulkType()) this.clearSelection();\n this._rowDeleteTarget.set(null); // an open \"delete this row?\" confirm goes with the rights it was opened under\n });\n });\n\n // Host `params` changed (e.g. a new period) → page 1 + full refresh. The first run only records the\n // initial value — ngOnInit does the initial load.\n let paramsSeen = false;\n effect(() => {\n this._extraParams();\n if (!paramsSeen) { paramsSeen = true; return; }\n untracked(() => this.resetToFirstPage());\n });\n\n // HTTP pipeline\n this.triggerLoad$.pipe(\n switchMap(() => {\n // A silent refresh (background poll) keeps the rows on screen instead of swapping in skeleton rows.\n const silentLoad = this._silentNext;\n if (!silentLoad) this._loading.set(true);\n this._silentNext = false;\n this._searchLoading.set(this._searchPending);\n this._searchPending = false;\n this._error.set(null);\n if (this._totalsSkipNext) this._totalsSkipNext = false;\n else this._fetchTotals(silentLoad);\n\n let params = tableQueryParams(this._extraParams())\n .set('page', this._page() - 1)\n .set('size', this.pageSize());\n\n if (this._search()) {\n params = params.set('search', this._searchParam());\n const searchFields = this._searchFields();\n if (searchFields) params = params.set('searchFields', searchFields);\n }\n if (this._sortField()) {\n params = params.set('sort', this._sortField()!).set('direction', this._sortDir());\n }\n if (this._activeTab()) params = params.set('filter', this._activeTab());\n const cf = this._colFilterValues();\n for (const [key, vals] of Object.entries(cf)) {\n if (vals.length > 0) params = params.set(key, encodeFilterValues(vals));\n }\n for (const [key, val] of Object.entries(this._rangeParams())) params = params.set(key, val);\n\n return this.http.get<any>(`${this.config.baseUrl}${this.endpoint()}`, { params }).pipe(\n catchError((err: unknown) => {\n this._error.set(this._hostErrorText(err) ?? this.labels.t(loadErrorKey(err), { items: this._itemsWord() }));\n this._loadFailed.set(true);\n return of(null);\n }),\n );\n }),\n takeUntilDestroyed(this.destroyRef),\n ).subscribe(response => {\n if (response !== null) {\n this._loadFailed.set(false);\n const items: T[] = Array.isArray(response) ? response : (response?.content ?? []);\n this._items.set(items);\n // A completed load gives every image URL a fresh attempt (a recovered image shows again); one that fails\n // again after this render becomes a placeholder again. A failed request keeps the rows, so it never clears.\n if (this._failedImages().size > 0) this._failedImages.set(new Set());\n this._selectedIds.set(new Set());\n this.selectionChange.emit(new Set());\n this._total.set(Array.isArray(response) ? response.length : (response?.totalElements ?? 0));\n if (!this._hasLoaded()) {\n const numericKeys = new Set(\n this.columns().filter(c => this.isNumericCol(c, items)).map(c => c.key)\n );\n this._numericKeys.set(numericKeys);\n this._hasLoaded.set(true);\n }\n }\n this._loading.set(false);\n this._searchLoading.set(false);\n this.loaded.emit({ ok: response !== null, total: this._total() });\n });\n\n }\n\n /** Query params for the counts requests: host params plus the active search (and its scope). Tabs and column filters are never sent. */\n private _countParams(): Record<string, string> {\n const params: Record<string, string> = { ...this._extraParams() };\n if (this._search()) {\n params['search'] = this._searchParam();\n if (this._searchFields()) params['searchFields'] = this._searchFields();\n }\n return params;\n }\n\n /**\n * Fetches `/counts` (tab badges) and `/filter-counts` (column options). The numbers follow the SEARCH only: the\n * requests carry the active `search` + `searchFields`, and are refetched when the search changes. Picking a tab or a\n * column-filter option never changes them. A backend may ignore the params (counts stay tenant-wide). Stale\n * responses are cancelled. As always, only values with a count above 0 become tabs / filter options.\n */\n private _fetchCounts(): void {\n const ep = this.countsEndpoint() || (this.page() ? `/${this.page()}/counts` : '');\n if (ep) {\n const params = this._countParams();\n this._tabCountsSub?.unsubscribe();\n this._tabCountsSub = this.http.get<Record<string, number>>(`${this.config.baseUrl}${ep}`, { params: tableQueryParams(params) })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: counts => {\n const { all: allCount, ...tabCounts } = counts as Record<string, number> & { all?: number };\n const total = allCount ?? Object.values(tabCounts).reduce((a, b) => a + b, 0);\n this._tabCounts.set({ '': total, ...tabCounts });\n },\n error: () => {},\n });\n }\n const fep = this.filterCountsEndpoint() || (this.page() ? `/${this.page()}/filter-counts` : '');\n if (fep) {\n const params = this._countParams();\n this._filterCountsSub?.unsubscribe();\n this._filterCountsSub = this.http.get<Record<string, Record<string, number>>>(`${this.config.baseUrl}${fep}`, { params: tableQueryParams(params) })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: counts => this._filterCounts.set(counts),\n error: () => {},\n });\n }\n }\n\n ngOnInit(): void {\n this.triggerLoad$.next();\n if (this.page()) this._loadSavedViews();\n this._fetchCounts();\n }\n\n /**\n * Retry from the error state. A failed table shows no search box or quick tabs (there is nothing to search), so a search term that was\n * active when the request failed could not be cleared any more: the retry therefore asks for the unsearched list on page 1.\n */\n protected _retryAfterError() {\n if (this._search()) { this._search.set(''); this._page.set(1); this._fetchCounts(); }\n this.load();\n }\n\n /* ── Event handlers ─────────────────────────────────────────── */\n protected onSearchChange(val: string) {\n // Already applied (e.g. the search box echoing a reset from clearFilters) — avoid a duplicate load.\n if (val === this._search()) return;\n this._search.set(val);\n this._page.set(1);\n this._searchPending = true;\n this.load();\n this._fetchCounts();\n }\n\n /** Phone sort control: \"Default\" (value '') + one entry per sortable visible column and direction (\"<key>:asc|desc\"). */\n protected readonly _phoneSortOptions = computed(() => {\n const opts = [{ value: '', label: this.labels.t('dataTable.default') }];\n for (const col of this.visibleCols()) {\n if (!this._isSortable(col) || this._emptyColumnKeys().has(col.key)) continue;\n opts.push({ value: `${col.key}:asc`, label: `${col.label} ↑` }, { value: `${col.key}:desc`, label: `${col.label} ↓` });\n }\n return opts;\n });\n\n protected readonly _phoneSortValue = computed(() => this._sortField() ? `${this._sortField()}:${this._sortDir()}` : '');\n\n /** Filterable visible columns (same rule as the header funnels). */\n protected readonly _phoneFilterCols = computed(() =>\n this.visibleCols()\n .filter(col => this.getRangeFilter(col) === null) // a listed range column gets its range chip only: the range replaces the value list\n .map(col => ({ col, cf: this.getColFilter(col) }))\n .filter((f): f is { col: ColumnDef; cf: { options: FilterOption[]; activeValues: string[] } } => f.cf !== null));\n\n /**\n * The sort buttons / icons and the column-filter icons only show while there is something to sort or filter: not after a failed\n * load, and not when the table is empty because nothing exists or only a search / quick tab matched nothing (clear the search to\n * get back). Once the user has used a column header control (a column filter or a sort is active) the controls stay, even with\n * zero rows, so they can change or clear it. Headers are plain labels otherwise.\n */\n protected readonly _showColumnControls = computed(() =>\n !this._error() && (\n this._items().length > 0 ||\n !!this._sortField() ||\n Object.values(this._colFilterValues()).some(v => v.length > 0) ||\n this._anyRangeActive()\n ),\n );\n\n /**\n * Keys of sortable columns whose cell is blank ('' or '—') on every loaded row — nothing to sort by, so the sort control is\n * hidden. Judged from the loaded page (the same text the cells show); an active sort on the column keeps its control so it\n * can be changed or cleared.\n */\n protected readonly _emptyColumnKeys = computed(() => {\n const items = this._items();\n const out = new Set<string>();\n if (items.length === 0) return out;\n for (const col of this.visibleCols()) {\n if (!this._isSortable(col) || this._sortField() === col.key) continue;\n let hasValue = false;\n for (const item of items) {\n if (col.cellType === 'image') { if (this.imageUrl(col, item) !== null) { hasValue = true; break; } continue; } // an image cell has no text: its value is the picture's address\n let text: unknown;\n try { text = this.cardCellText(col, item); } catch { hasValue = true; break; }\n const t = text === null || text === undefined ? '' : String(text).trim();\n if (t !== '' && t !== '—') { hasValue = true; break; }\n }\n if (!hasValue) out.add(col.key);\n }\n return out;\n });\n\n /** A header sort control shows for a sortable column while there are rows and the column has a value somewhere. */\n protected _canShowSort(col: ColumnDef): boolean {\n return this._isSortable(col) && this._showColumnControls() && !this._emptyColumnKeys().has(col.key);\n }\n\n protected readonly _hasPhoneControls = computed(() => this._phoneSortOptions().length > 1 || this._phoneFilterCols().length > 0 || this._phoneRangeCols().length > 0);\n\n /** Phone sort select → sets the sort directly (same state, page reset and load as the header's onSort). */\n protected onPhoneSort(value: string) {\n if (!value) {\n this._sortField.set(null); this._sortDir.set('asc');\n } else {\n const i = value.lastIndexOf(':');\n this._sortField.set(value.slice(0, i)); this._sortDir.set(value.slice(i + 1) === 'desc' ? 'desc' : 'asc');\n }\n this._page.set(1);\n this.load();\n }\n\n protected onSort(field: string) {\n if (this._sortField() === field) {\n if (this._sortDir() === 'desc') {\n // Third click: reset\n this._sortField.set(null); this._sortDir.set('asc');\n } else {\n // Second click: asc → desc\n this._sortDir.set('desc');\n }\n } else {\n // First click: start asc\n this._sortField.set(field); this._sortDir.set('asc');\n }\n this._page.set(1);\n this._totalsSkipNext = true;\n this.load();\n }\n\n protected onPageChange(p: number) { this._page.set(p); this._totalsSkipNext = true; this.load(); }\n\n protected onTabChange(value: string) {\n this._activeTab.set(value);\n this.tabChange.emit(value);\n this._page.set(1);\n this.load();\n }\n\n /**\n * Wire name of a column's filter: `filterParam` when set, else the column `key`. Used ONLY for the column-filter query\n * param, the /filter-counts lookup, `_colFilterValues` and saved views (never for sort, row data, bulk fields).\n */\n protected _filterName(col: ColumnDef): string {\n return col.filterParam ?? col.key;\n }\n\n protected onColFilterChange(column: string, values: string[]) {\n this._colFilterValues.update(prev => ({ ...prev, [column]: values }));\n this._page.set(1);\n this.load();\n }\n\n protected clearFilters() {\n const hadSearch = !!this._search();\n this._search.set('');\n this._activeTab.set('');\n this.tabChange.emit('');\n this._colFilterValues.set({});\n if (Object.keys(this._rangeValues()).length > 0) this._rangeValues.set({});\n this._page.set(1);\n this.load();\n if (hadSearch) this._fetchCounts(); // the numbers only follow the search\n }\n\n protected getColFilter(col: ColumnDef): { options: FilterOption[]; activeValues: string[] } | null {\n const colCounts = this._filterCounts()[this._filterName(col)] ?? {};\n const activeValues = this._colFilterValues()[this._filterName(col)] ?? [];\n const present = this._presentKeys(colCounts);\n // Same rule as quick-filter tabs: a single value means nothing to filter on.\n // Keep the icon while a filter is active so the user can still clear it.\n if (present.length <= 1 && activeValues.length === 0) return null;\n // A selected value stays listed even when a search leaves it at 0, so it can still be unchecked.\n const keys = [...present, ...activeValues.filter(v => !present.includes(v))];\n\n const countOptions: FilterOption[] = keys\n .map(value => [value, colCounts[value] ?? 0] as const)\n .sort(([, a], [, b]) => b - a)\n .map(([value, count]) => {\n const badgeCfg = (col.badgeFn ? col.badgeFn(value, null) : null)\n ?? { label: value, variant: semanticBadgeVariant(value, this.labels.locale()) ?? autoVariant(value) } as BadgeConfig;\n const color = BADGE_VARIANT_STYLES[badgeCfg.variant]?.color ?? '#64748b';\n return { value, label: badgeCfg.label || value, color, count: count as number };\n });\n\n return countOptions.length > 0 ? { options: countOptions, activeValues } : null;\n }\n\n private _loadSavedViews(): void {\n this.http.get<any[]>(`${this.config.baseUrl}/saved-views`, { params: { page: this.page() } })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (dtos) => this._internalSavedViews.set(dtos.map(d => ({\n id: d.id, name: d.name,\n quickFilter: d.quickFilter ?? null,\n sortField: d.sortField ?? null,\n sortDir: d.sortDir ?? null,\n visibleColumns: d.visibleColumns ?? [],\n columnFilters: d.columnFilters ?? null,\n ...(d.rangeFilters ? { rangeFilters: d.rangeFilters } : {}),\n }))),\n error: () => {},\n });\n }\n\n protected onSaveViewClick(name: string): void {\n if (!this._canEdit()) return; // read-only users can load their saved views but not create them\n if (this.page()) {\n const state = this.getState();\n this.http.post<any>(`${this.config.baseUrl}/saved-views`, { page: this.page(), name, ...state })\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (dto) => {\n this._internalSavedViews.update(v => [...v, {\n id: dto.id, name: dto.name,\n quickFilter: dto.quickFilter ?? null,\n sortField: dto.sortField ?? null,\n sortDir: dto.sortDir ?? null,\n visibleColumns: dto.visibleColumns ?? [],\n columnFilters: dto.columnFilters ?? null,\n ...(dto.rangeFilters ? { rangeFilters: dto.rangeFilters } : {}),\n }]);\n this._toast.show(this.labels.t('dataTable.viewSaved'));\n },\n error: () => this._toast.error(this.labels.t('dataTable.viewSaveFailed')),\n });\n } else {\n this.saveViewClick.emit();\n }\n }\n\n protected onLoadViewClick(view: SavedView): void {\n if (this.page()) {\n this._activeViewId.set(view.id);\n this.applyView(view);\n } else {\n this.loadViewClick.emit(view);\n }\n }\n\n protected onDeleteViewClick(id: string): void {\n if (!this._canEdit()) return; // read-only users can't delete saved views\n if (this.page()) {\n this.http.delete(`${this.config.baseUrl}/saved-views/${id}`)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: () => {\n this._internalSavedViews.update(v => v.filter(v => v.id !== id));\n if (this._activeViewId() === id) this._activeViewId.set(null);\n this._toast.show(this.labels.t('dataTable.viewDeleted'));\n },\n error: () => this._toast.error(this.labels.t('dataTable.viewDeleteFailed')),\n });\n } else {\n this.deleteViewClick.emit(id);\n }\n }\n\n /** Returns a snapshot of current table state for saving as a view. */\n getState(): Pick<SavedView, 'quickFilter' | 'sortField' | 'sortDir' | 'visibleColumns' | 'rangeFilters'> & { columnFilters: Record<string, string> } {\n const columnFilters: Record<string, string> = {};\n for (const [key, vals] of Object.entries(this._colFilterValues())) {\n if (vals.length > 0) columnFilters[key] = encodeFilterValues(vals);\n }\n // Only a table that lists rangeFilters writes the field (`{}` = no range set, so loading the view clears ranges); other tables save exactly what they did.\n const rangeFilters: Record<string, { min: number | null; max: number | null }> = {};\n for (const key of this._rangeSpecs().keys()) { const v = this._rangeValues()[key]; if (v) rangeFilters[key] = { min: v.min, max: v.max }; }\n return {\n columnFilters,\n ...(this._rangeSpecs().size > 0 ? { rangeFilters } : {}),\n quickFilter: this._activeTab() || null,\n sortField: this._sortField() || null,\n sortDir: this._sortField() ? this._sortDir() : null,\n visibleColumns: this._configurableKeys(this._visibleColumns()),\n };\n }\n\n /** Restores table state from a saved view and reloads. */\n applyView(view: SavedView): void {\n this._activeTab.set(view.quickFilter ?? '');\n this.tabChange.emit(view.quickFilter ?? '');\n if (view.sortField) {\n this._sortField.set(view.sortField);\n this._sortDir.set((view.sortDir as SortDir) ?? 'asc');\n } else {\n this._sortField.set(null);\n this._sortDir.set('asc');\n }\n this._visibleColumns.set(this._configurableKeys(view.visibleColumns));\n // Views saved before ranges existed (field absent/null) leave the current ranges alone; a stored object replaces them (listed keys, finite bounds only).\n if (view.rangeFilters && typeof view.rangeFilters === 'object') this._rangeValues.set(this._restorableRanges(view.rangeFilters));\n // Views saved before column filters were stored (field absent/null) leave the current filters alone.\n if (view.columnFilters && typeof view.columnFilters === 'object') {\n this._colFilterValues.set(this._restorableColumnFilters(view.columnFilters));\n }\n this.resetToFirstPage();\n }\n\n private _restorableRanges(saved: Record<string, { min?: number | null; max?: number | null } | null>): Record<string, ColumnRangeValue> {\n const out: Record<string, ColumnRangeValue> = {};\n const num = (n: unknown): number | null => (typeof n === 'number' && Number.isFinite(n) ? n : null);\n for (const [key, raw] of Object.entries(saved)) {\n if (!this._rangeSpecs().has(key) || !raw || typeof raw !== 'object') continue;\n const min = num(raw.min), max = num(raw.max);\n if (min != null && max != null && min > max) continue;\n if (min != null || max != null) out[key] = { min, max };\n }\n return out;\n }\n\n /** Keeps only filters that still make sense: known column keys, and (when the counts list the column) known values. */\n private _restorableColumnFilters(saved: Record<string, string>): Record<string, string[]> {\n // wire name -> itself; a column with a filterParam also accepts its plain key (views saved before it had one).\n const names = new Map<string, string>();\n for (const c of this.columns()) names.set(c.key, this._filterName(c));\n for (const c of this.columns()) names.set(this._filterName(c), this._filterName(c));\n const counts = this._filterCounts();\n const out: Record<string, string[]> = {};\n for (const [savedKey, raw] of Object.entries(saved)) {\n const key = names.get(savedKey);\n if (key === undefined || typeof raw !== 'string') continue;\n // A view holding both the legacy key and the wire name of one column: the wire name wins, whatever the order.\n if (savedKey !== key && Object.prototype.hasOwnProperty.call(saved, key)) continue;\n const known = Object.keys(counts[key] ?? {});\n let vals = decodeFilterValues(raw);\n if (known.length > 0) vals = vals.filter(v => known.includes(v));\n if (vals.length > 0) out[key] = vals;\n }\n return out;\n }\n\n /** Plain/number/date columns sort unless `sortable: false`; badge and image columns only when `sortable: true`; never actions. */\n protected _isSortable(col: ColumnDef): boolean {\n if (col.cellType === 'actions') return false;\n return col.cellType === 'badge' || col.cellType === 'image' ? col.sortable === true : col.sortable !== false;\n }\n\n protected sortAriaLabel(field: string): string {\n if (this._sortField() !== field) return 'none';\n return this._sortDir() === 'asc' ? 'ascending' : 'descending';\n }\n\n protected trackItem(item: T, index: number): string | number {\n return item['id'] ?? index;\n }\n\n protected isRowClickable(item: T): boolean {\n if (!this._rowClickable()) return false;\n const fn = this.rowClickableFn();\n return fn ? fn(item) : true;\n }\n\n protected rowLabel(item: T): string | null {\n const fn = this.rowLabelFn();\n return fn ? (fn(item) || null) : null;\n }\n\n protected onRowClick(item: T) {\n if (this.isRowClickable(item)) this.rowClick.emit(item);\n }\n\n /** Enter / Space on a focused clickable row or card activates it — ignored when focus is on a control inside it. */\n protected onRowKeydown(e: KeyboardEvent, item: T) {\n if (e.target !== e.currentTarget || (e.key !== 'Enter' && e.key !== ' ')) return;\n if (!this.isRowClickable(item)) return;\n e.preventDefault();\n this.rowClick.emit(item);\n }\n\n protected async onInternalButtonClick(type: string): Promise<void> {\n if (type === 'import') { this._ieRef()?.openImport(); return; }\n if (type === 'export') { this._ieRef()?.exportAll(); return; }\n // A page-defined action that declares `confirm` asks first; only a confirmed click is reported to the host.\n const confirm = this._effectiveButtons().find(b => b.type === type)?.confirm;\n if (confirm) {\n const message = typeof confirm.message === 'function' ? confirm.message() : confirm.message;\n const confirmed = await this._confirmSvc.confirm({\n title: confirm.title,\n message,\n confirmLabel: confirm.confirmLabel,\n cancelLabel: confirm.cancelLabel,\n variant: confirm.variant,\n ...(confirm.details?.length ? { details: confirm.details } : {}),\n });\n if (!confirmed) return;\n }\n this.tableButtonClick.emit(type);\n }\n\n protected onImported(): void {\n this.refresh();\n this.imported.emit();\n }\n\n /** Row actions visible for the current permission: everything for 'full'; otherwise only View (`type: 'view'`) and actions marked\n * `allowReadOnly` (never the built-in delete). The Actions column itself is shown only while some row has a visible action. */\n protected _rowActions(col: ColumnDef, item: T): RowAction[] {\n const actions = this._withResolvedReasons(col.actionsFn?.(item) ?? [], item);\n if (this._canEdit()) return this._stableActionList(col, item, actions);\n const visible = actions.filter(a => a.type === 'view' || (a.allowReadOnly === true && a.type !== 'delete'));\n return this._stableActionList(col, item, visible.length === actions.length ? actions : visible);\n }\n\n /**\n * Pure derivation memo (never server data): the resolved action of one row + action type, kept weakly by the row object. The same row, the same host action object and the same resolved `disabled` /\n * `disabledReason` give back the SAME object, so a host's own `_rowActionsCache` identity survives change detection and the row menu is not re-rendered for nothing.\n */\n private readonly _resolvedActionCache = new WeakMap<object, Map<string, { src: RowAction; off: boolean | undefined; reason: string | undefined; shape: readonly unknown[]; out: RowAction }>>();\n /** The last list returned per row + actions column: an equal list (same action objects in the same order, and none of them changed in place) is returned as the same array. */\n private readonly _actionListCache = new WeakMap<object, WeakMap<ColumnDef, { list: RowAction[]; shapes: (readonly unknown[])[] }>>();\n\n /**\n * What the row menu draws or decides from an action object, captured by value: a host that mutates an action IN PLACE (a new `label`, `icon`, `variant`) still gets a re-render, because the memo compares these values and not only the object's identity.\n * (Treating a RowAction as immutable is still the recommended way; this makes the memo safe if it is not.)\n */\n private _actionShape(a: RowAction): readonly unknown[] {\n return [a.type, a.label, a.icon, a.variant, a.opens, a.modal, a.requiresFull, a.allowReadOnly, a.hidden, a.disabled, a.disabledReason];\n }\n private _sameShape(a: readonly unknown[], b: readonly unknown[]): boolean { return a.length === b.length && a.every((v, i) => v === b[i]); }\n\n private _stableActionList(col: ColumnDef, item: T, list: RowAction[]): RowAction[] {\n if (typeof item !== 'object' || item === null) return list;\n let perRow = this._actionListCache.get(item as object);\n if (!perRow) { perRow = new WeakMap(); this._actionListCache.set(item as object, perRow); }\n const shapes = list.map(a => this._actionShape(a));\n const prev = perRow.get(col);\n if (prev && prev.list.length === list.length && prev.list.every((a, i) => a === list[i])) {\n if (prev.shapes.every((sh, i) => this._sameShape(sh, shapes[i]))) return prev.list;\n // The same action objects, but one was changed in place: a NEW array, so the (OnPush) row menu draws the new values.\n const fresh = list.slice();\n perRow.set(col, { list: fresh, shapes });\n return fresh;\n }\n perRow.set(col, { list, shapes });\n return list;\n }\n\n /**\n * `disabled` and `disabledReason` given as functions are resolved here with the row (the menu has no row and calls them with `null`): `disabled: r => r.x` works.\n * A function that throws counts as \"not disabled\" / \"no reason\" (never breaks rendering). A string reason and an action with no function keep the host's object untouched; the array keeps its identity when nothing needs resolving.\n * A resolved action object is reused while its source object and the resolved values are unchanged (see `_resolvedActionCache`).\n */\n private _withResolvedReasons(actions: RowAction[], item: T): RowAction[] {\n if (!actions.some(a => typeof a.disabled === 'function' || typeof a.disabledReason === 'function')) return actions;\n const rowKey = typeof item === 'object' && item !== null ? (item as object) : null;\n let perRow = rowKey ? this._resolvedActionCache.get(rowKey) : undefined;\n if (rowKey && !perRow) { perRow = new Map(); this._resolvedActionCache.set(rowKey, perRow); }\n return actions.map(a => {\n if (typeof a.disabled !== 'function' && typeof a.disabledReason !== 'function') return a;\n let off: boolean | undefined;\n if (typeof a.disabled === 'function') {\n try { off = !!a.disabled(item); } catch { off = false; }\n }\n let reason: string | undefined;\n if (typeof a.disabledReason === 'function') {\n let raw: string | null | undefined;\n try { raw = a.disabledReason(item); } catch { raw = null; }\n reason = typeof raw === 'string' ? raw : undefined;\n }\n const held = perRow?.get(a.type);\n const shape = this._actionShape(a);\n if (held && held.src === a && held.off === off && held.reason === reason && this._sameShape(held.shape, shape)) return held.out;\n const resolved: RowAction = { ...a };\n if (off !== undefined) resolved.disabled = () => off;\n if (typeof a.disabledReason === 'function') resolved.disabledReason = reason;\n perRow?.set(a.type, { src: a, off, reason, shape, out: resolved });\n return resolved;\n });\n }\n\n /** The host's wording of an error (`errorTextFn`), or `null` when it has none (or throws): the table then words the error itself. */\n private _hostErrorText(err: unknown): string | null {\n const fn = this.errorTextFn();\n if (!fn) return null;\n try {\n const text = fn(err);\n return typeof text === 'string' && text.trim() ? text.trim() : null;\n } catch { return null; }\n }\n\n /** The failure text of a table action: the host's (`errorTextFn`), else the server's own message / the cause-based sentence. */\n private _actionError(err: unknown): string {\n return this._hostErrorText(err) ?? actionErrorText(err, k => this.labels.t(k));\n }\n\n /** The sentence a bulk response adds after the standard summary: its readable `message`, plus a different readable `skippedReason`. */\n private _bulkServerMessage(r: { message?: unknown; skippedReason?: unknown } | null | undefined): string | null {\n const message = humanReadableMessage(r?.message);\n const reason = humanReadableMessage(r?.skippedReason);\n return [message, reason && reason !== message ? reason : null].filter((x): x is string => !!x).join(' ') || null;\n }\n\n protected async onTableRowAction(type: string, col: ColumnDef, item: T): Promise<void> {\n const actions = this._rowActions(col, item);\n const action = actions.find(a => a.type === type);\n // An action hidden by permission (or unknown) must never run — including the built-in delete.\n if (!action) return;\n\n if (action?.opens === 'panel') {\n this.panelActionClick.emit({ type, item });\n return;\n }\n\n // Built-in delete: fires when type === 'delete' and no opens override is set.\n // Opens the table's own confirmation modal (bypasses ConfirmService entirely).\n // Host pages need only define { type: 'delete', label: '...', variant: 'danger' } —\n // no opens, no modal config, no onAction handler required.\n if (type === 'delete' && !action?.opens) {\n const title = action?.modal?.title ?? this.labels.t('dataTable.delete');\n const rawMsg = action?.modal?.message;\n const msg = rawMsg\n ? (typeof rawMsg === 'function' ? rawMsg(item) : rawMsg)\n : this.labels.t('dataTable.deleteRecordConfirm', { item: this._itemWord() });\n const confirmLabel = action?.modal?.confirmLabel ?? this.labels.t('dataTable.delete');\n const details = action?.modal?.details;\n const variant = action?.modal?.variant;\n this._rowDeleteConfig.set({ title, message: msg, confirmLabel,\n ...(details?.length ? { details } : {}), ...(variant ? { variant } : {}) });\n this._rowDeleteTarget.set(item);\n return;\n }\n\n if (action?.opens === 'modal' && action.modal) {\n const msg = typeof action.modal.message === 'function'\n ? action.modal.message(item)\n : action.modal.message;\n const confirmed = await this._confirmSvc.confirm({\n title: action.modal.title,\n message: msg,\n confirmLabel: action.modal.confirmLabel,\n cancelLabel: action.modal.cancelLabel,\n variant: action.modal.variant,\n ...(action.modal.details?.length ? { details: action.modal.details } : {}),\n });\n if (!confirmed) return;\n }\n\n col.onAction?.(type, item);\n }\n\n private isNumericCol(col: ColumnDef, items: T[]): boolean {\n // Any explicit cellType (including 'text') opts out of numeric auto-detection — e.g. ZIP codes are text.\n if (col.cellType) return false;\n for (const item of items) {\n const raw = col.render ? col.render(item) : item[col.key];\n if (raw == null || raw === '' || raw === '—') continue;\n if (typeof raw === 'number') return true;\n if (typeof raw === 'string') {\n const t = raw.trim();\n if (t.startsWith('$') || t.endsWith('%')) return true;\n if (isFinite(Number(t))) return true;\n }\n return false;\n }\n return false;\n }\n\n protected resolveCellAlign(col: ColumnDef, item: T): 'left' | 'right' | 'center' {\n if (col.align) return col.align;\n if (col.cellType === 'number') return 'right';\n if (col.cellType === 'actions' || col.cellType === 'image') return 'center';\n if (this.isNumericCol(col, [item])) return 'right';\n return 'left';\n }\n\n /** null → the cell renders a plain '—' (badgeFn returned null, or an empty value without a badgeFn). */\n protected resolveBadge(col: ColumnDef, item: T): BadgeConfig | null {\n if (col.badgeFn) return col.badgeFn(item[col.key], item);\n const value = String(item[col.key] ?? '');\n if (!value) return null;\n return {\n label: value,\n variant: semanticBadgeVariant(value, this.labels.locale()) ?? autoVariant(value),\n };\n }\n\n protected showTagTooltip(event: MouseEvent | FocusEvent, tags: any[]): void {\n const rect = (event.target as HTMLElement).getBoundingClientRect();\n this._tagTooltip.set({ tags, x: rect.left + rect.width / 2, y: rect.top - 8 });\n }\n\n protected hideTagTooltip(): void {\n this._tagTooltip.set(null);\n }\n\n protected imageUrl(col: ColumnDef, item: T): string | null {\n try {\n const url = col.imageFn?.(item);\n if (typeof url !== 'string') return null;\n return url.trim() || null;\n } catch {\n return null;\n }\n }\n\n /** Always a string so the <img> keeps an `alt` attribute ('' = decorative). */\n protected imageAlt(col: ColumnDef, item: T): string {\n try {\n return col.imageAlt?.(item) ?? '';\n } catch {\n return '';\n }\n }\n\n /** CSS object-position from `imagePositionFn` (percent); centered when there is none or it throws. */\n protected imagePosition(col: ColumnDef, item: T): string {\n try {\n const p = col.imagePositionFn?.(item);\n const clamp = (n: unknown) => typeof n === 'number' && Number.isFinite(n) ? Math.min(100, Math.max(0, n)) : 50;\n return `${clamp(p?.x)}% ${clamp(p?.y)}%`;\n } catch {\n return '50% 50%';\n }\n }\n\n protected imageClass(col: ColumnDef, small: boolean): string {\n const size = small ? 'sm' : (col.imageSize ?? 'md');\n return `dt-img-${col.imageShape ?? 'circle'}-${size}`;\n }\n\n protected onImageError(url: string): void {\n this._failedImages.update(s => new Set(s).add(url));\n }\n\n protected phoneCell(value: any): string { return formatPhone(value); }\n\n private readonly _injector = inject(Injector);\n\n /** Safe hrefs only: mailto:, tel:, http(s):// and root-relative paths. Everything else is refused (null). */\n private _safeHref(raw: unknown): string | null {\n if (typeof raw !== 'string') return null;\n const h = raw.trim();\n if (!h || /[\\u0000-\\u001f\\u007f]/.test(h)) return null;\n if (/^(mailto|tel):\\S/i.test(h) || /^https?:\\/\\/\\S/i.test(h) || /^\\/(?![\\/\\\\])/.test(h)) return h;\n return null;\n }\n\n /** Text and (when there is a safe target) the anchor data of a `cellType: 'link'` cell. Never throws. */\n protected linkView(col: ColumnDef, item: T): { text: string; link: ResolvedLink | null } {\n let target: LinkTarget | null = null;\n try {\n const r = col.linkFn?.(item, item[col.key]);\n if (typeof r === 'string') target = r.trim() ? { href: r } : null;\n else if (r && typeof r === 'object') target = r;\n } catch { target = null; }\n\n let raw: any;\n try { raw = col.render ? col.render(item) : item[col.key]; } catch { raw = item[col.key]; }\n const own = raw === null || raw === undefined ? '' : String(raw);\n const text = own !== '' ? own : (typeof target?.label === 'string' && target.label !== '' ? target.label : '—');\n if (!target || text === '—') return { text, link: null };\n\n let href: string | null = null;\n let tree: UrlTree | null = null;\n const rl = target.routerLink;\n if (rl !== undefined && rl !== null && (typeof rl === 'string' ? rl.trim() !== '' : rl.length > 0)) {\n try {\n const router = this._injector.get(Router);\n tree = router.createUrlTree(typeof rl === 'string' ? [rl] : [...rl], { queryParams: target.queryParams });\n href = this._injector.get(Location).prepareExternalUrl(router.serializeUrl(tree));\n } catch { return { text, link: null }; }\n } else {\n href = this._safeHref(target.href);\n }\n if (!href) return { text, link: null };\n\n const blank = target.target === '_blank';\n const external = /^https?:/i.test(href);\n const label = typeof target.ariaLabel === 'string' && target.ariaLabel !== '' ? target.ariaLabel : null;\n return {\n text,\n link: {\n href, tree, blank,\n rel: blank || external ? 'noopener noreferrer' : null,\n download: target.download === true,\n ariaLabel: label === null ? null : (blank ? this.labels.t('dataTable.linkOpensNewTab', { label }) : label),\n },\n };\n }\n\n /** Anchor click: never reaches the row; a plain left click on an in-app route navigates via the Router (SPA, no reload). */\n protected onLinkClick(e: MouseEvent, link: ResolvedLink, col: ColumnDef, item: T): void {\n e.stopPropagation();\n this.linkClick.emit({ item, column: col, href: link.href });\n const plain = e.button === 0 && !e.ctrlKey && !e.metaKey && !e.shiftKey && !e.altKey;\n if (link.tree && plain && !link.blank && !e.defaultPrevented) {\n e.preventDefault();\n void this._injector.get(Router).navigateByUrl(link.tree);\n }\n }\n protected getInitials(name: string): string {\n return name.split(' ').filter(Boolean).map(p => p[0]).slice(0, 2).join('').toUpperCase();\n }\n\n protected isCardOverdue(col: ColumnDef, item: T): boolean {\n const days = item[col.daysKey ?? col.key];\n return days != null && days > (col.overdueThreshold ?? 30);\n }\n\n /** Cell types that never get a leading icon: they draw their own leading visual or are not text-like. */\n private static readonly _NO_ICON_TYPES: readonly string[] = ['avatar-name', 'link', 'tags', 'progress', 'image', 'actions', 'days-ago'];\n\n /**\n * Path of the leading icon for a cell (library source 2026-11-05, not yet published): `iconFn` returns a `<ui-icon>` key (known key wins) or a raw\n * 24x24 stroke path (drawing commands and numbers only, same rule as ui-radio's `icon`); anything else, an empty value, a throwing `iconFn` or a\n * non-text-like cell type gives null (nothing is drawn).\n */\n protected cellIconPath(col: ColumnDef, item: T): string | null {\n if (!col.iconFn || DataTableComponent._NO_ICON_TYPES.includes(col.cellType ?? '')) return null;\n let raw: string | null | undefined;\n try { raw = col.iconFn(item); } catch { return null; }\n const v = (raw ?? '').trim();\n if (!v) return null;\n return uiIconPath(v) ?? (/^[Mm][\\d\\s.,\\-MmLlHhVvCcSsQqTtAaZz]+$/.test(v) ? v : null);\n }\n\n /** Screen-reader text for a meaningful icon (`iconLabelFn`); '' (decorative) when absent, empty, throwing or when no icon is drawn. */\n protected cellIconLabel(col: ColumnDef, item: T): string {\n if (!col.iconLabelFn || !this.cellIconPath(col, item)) return '';\n try { return (col.iconLabelFn(item) ?? '').trim(); } catch { return ''; }\n }\n\n /** Renders any non-badge column value as a plain string for the mobile card view. */\n protected cardCellText(col: ColumnDef, item: T): string {\n switch (col.cellType) {\n case 'date': {\n const v = item[col.key];\n return v ? (this.labels.formatDate(v, col.dateFormat ?? 'MMM d, y') || '—') : '—';\n }\n case 'phone': return formatPhone(item[col.key]);\n case 'link': return this.linkView(col, item).text;\n case 'days-ago': {\n const days = item[col.daysKey ?? col.key];\n return days != null ? this.labels.t('dataTable.daysAgo', { days }) : this.labels.t('dataTable.never');\n }\n case 'tags': {\n const tags = item[col.tagsKey ?? col.key];\n return tags?.length > 0 ? tags.map((t: any) => t.name).join(', ') : '—';\n }\n case 'image': return '';\n case 'progress': {\n const p = col.progressFn?.(item);\n return p ? (p.label ?? `${p.value}/${p.max}`) : '—';\n }\n default:\n return col.render ? col.render(item) : String(item[col.key] ?? '—');\n }\n }\n\n /** Refresh data rows only — used internally for sort, filter, search, pagination. */\n load() { this.triggerLoad$.next(); }\n\n /**\n * Drops the active quick-filter tab (back to \"All\"), emits `tabChange('')` and reloads from page 1. For hosts\n * whose tab was renamed or removed by the user's own change, so the table doesn't stay on a tab key that no\n * longer exists. No-op when no tab is active.\n */\n resetTab(): void {\n if (!this._activeTab()) return;\n this._activeTab.set('');\n this.tabChange.emit('');\n this.resetToFirstPage();\n }\n\n /** Go to page 1 and do a full refresh — use after adding a new record. */\n resetToFirstPage(): void { this._page.set(1); this.refresh(); }\n\n /**\n * Full refresh after a mutation — fires data rows, tab counts, and filter counts\n * in parallel so every part of the UI (pagination totals, quick-filter badges,\n * column filter options) reflects the change.\n */\n refresh(options?: { silent?: boolean }): void {\n this._silentNext = !!options?.silent && this._hasLoaded();\n this.triggerLoad$.next();\n this._fetchCounts();\n }\n\n /** Set by `refresh({ silent: true })` for the next load only: rows stay visible (no skeleton) while it runs. */\n private _silentNext = false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;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