@ids-group-ltd/ids-design-system 0.13.0 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +295 -3
  2. package/components.md +15 -6
  3. package/docs/agent/INDEX.md +1 -0
  4. package/docs/agent/charts/ds-bar-chart.md +1 -1
  5. package/docs/agent/charts/ds-column-chart.md +1 -1
  6. package/docs/agent/charts/ds-config.md +12 -0
  7. package/docs/agent/charts/ds-donut-chart.md +2 -2
  8. package/docs/agent/charts/ds-funnel-chart.md +1 -1
  9. package/docs/agent/charts/ds-line-chart.md +1 -1
  10. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs +2 -2
  11. package/fesm2022/ids-group-ltd-ids-design-system-components-accordion.mjs.map +1 -1
  12. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs +2 -2
  13. package/fesm2022/ids-group-ltd-ids-design-system-components-alert.mjs.map +1 -1
  14. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +9 -4
  15. package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
  16. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs +2 -2
  17. package/fesm2022/ids-group-ltd-ids-design-system-components-banner.mjs.map +1 -1
  18. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +30 -14
  19. package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
  20. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +2 -2
  21. package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
  22. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs +2 -2
  23. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-legend.mjs.map +1 -1
  24. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +21 -6
  25. package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
  26. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +9 -4
  27. package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
  28. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +39 -16
  29. package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
  30. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +9 -4
  31. package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
  32. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs +33 -21
  33. package/fesm2022/ids-group-ltd-ids-design-system-components-donut-chart.mjs.map +1 -1
  34. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +2 -1
  35. package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
  36. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs +2 -2
  37. package/fesm2022/ids-group-ltd-ids-design-system-components-empty-state.mjs.map +1 -1
  38. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +37 -15
  39. package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
  40. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +62 -21
  41. package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
  42. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs +2 -1
  43. package/fesm2022/ids-group-ltd-ids-design-system-components-list.mjs.map +1 -1
  44. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs +4 -4
  45. package/fesm2022/ids-group-ltd-ids-design-system-components-modal.mjs.map +1 -1
  46. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +9 -4
  47. package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
  48. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs +2 -2
  49. package/fesm2022/ids-group-ltd-ids-design-system-components-page-header.mjs.map +1 -1
  50. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs +1 -1
  51. package/fesm2022/ids-group-ltd-ids-design-system-components-pagination.mjs.map +1 -1
  52. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +9 -4
  53. package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
  54. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
  55. package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
  56. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +9 -4
  57. package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
  58. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs +2 -2
  59. package/fesm2022/ids-group-ltd-ids-design-system-components-toast.mjs.map +1 -1
  60. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +56 -8
  61. package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
  62. package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
  63. package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
  64. package/migrations/0.13.1.json +236 -0
  65. package/package.json +1 -1
  66. package/styles/_chart-frame.scss +15 -0
  67. package/styles/_chart-interactive.scss +17 -6
  68. package/styles/_chart-motion.scss +61 -18
  69. package/styles/_dropdown-overlay.scss +9 -3
  70. package/styles/_focus.scss +10 -1
  71. package/styles/_overlay-motion.scss +10 -1
  72. package/styles/_tokens-charts.scss +5 -0
  73. package/types/ids-group-ltd-ids-design-system-components-autocomplete.d.ts +6 -1
  74. package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +24 -9
  75. package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +7 -1
  76. package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +6 -1
  77. package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +29 -9
  78. package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +6 -1
  79. package/types/ids-group-ltd-ids-design-system-components-donut-chart.d.ts +27 -13
  80. package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +29 -10
  81. package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +36 -9
  82. package/types/ids-group-ltd-ids-design-system-components-multi-select.d.ts +6 -1
  83. package/types/ids-group-ltd-ids-design-system-components-select.d.ts +6 -1
  84. package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +6 -1
  85. package/types/ids-group-ltd-ids-design-system-components.d.ts +18 -2
  86. package/types/ids-group-ltd-ids-design-system-core.d.ts +24 -1
  87. package/types/ids-group-ltd-ids-design-system.d.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ids-group-ltd-ids-design-system-components.mjs","sources":["../../../src/lib/components/brand-defaults.ts","../../../src/lib/components/chart-palette.generated.ts","../../../src/lib/components/charts-format.ts","../../../src/lib/components/charts-measure.ts","../../../src/lib/components/charts-scale.ts","../../../src/lib/components/charts-motion.ts","../../../src/lib/components/charts-roving.ts","../../../src/lib/components/charts-summary.ts","../../../src/lib/components/chip-overflow.ts","../../../src/lib/components/chip-template.directive.ts","../../../src/lib/components/field-defaults.ts","../../../src/lib/components/field-errors.ts","../../../src/lib/components/message-base.ts","../../../src/lib/components/field-base.ts","../../../src/lib/components/control-value-accessor.ts","../../../src/lib/components/create-template.directive.ts","../../../src/lib/components/destination.ts","../../../src/lib/components/empty-template.directive.ts","../../../src/lib/components/field-click-focus.directive.ts","../../../src/lib/components/field-ids.ts","../../../src/lib/components/group-label-template.directive.ts","../../../src/lib/components/option-template.directive.ts","../../../src/lib/components/overlay-motion.ts","../../../src/lib/components/panel-footer-template.directive.ts","../../../src/lib/components/panel-header-template.directive.ts","../../../src/lib/components/picker-announcer.ts","../../../src/lib/components/picker-trigger.directive.ts","../../../src/lib/components/projection-dropped.directive.ts","../../../src/lib/components/scroll-active-option.ts","../../../src/lib/components/static-preview.directive.ts","../../../src/lib/components/type-ahead.ts","../../../src/lib/components/ids-group-ltd-ids-design-system-components.ts"],"sourcesContent":["import { Signal, computed, inject } from '@angular/core';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\n\n/**\n * Resolve one brand string against the app-level default. `ds-sidenav` and\n * `ds-auth-layout` ask the same three questions and an app answers them\n * identically on every screen, so the answer belongs in one provider rather than\n * in four bindings per template.\n *\n * Same `null`-means-unset shape as `resolveReserveMessage` — here `''` is an\n * explicit \"this screen has no brand\", and each field resolves on its own.\n * @internal\n */\nexport function resolveBrandValue(\n value: Signal<string | null>,\n key: 'name' | 'logoLetter' | 'tagline',\n): Signal<string> {\n const config = inject(DS_CONFIG);\n\n return computed(() => value() ?? config.brand?.[key] ?? '');\n}\n","// GENERATED by tools/generate-chart-palette.mjs. Do not edit. Values are var()\n// references, not resolved colours, so a consumer overriding the token still wins\n// at runtime.\n\n/** @internal Exported for the chart entry points that import it across the boundary;\n * not part of the package surface. */\nexport const chartColors = {\n series1: 'var(--ds-chart-series-1-color)',\n series2: 'var(--ds-chart-series-2-color)',\n series3: 'var(--ds-chart-series-3-color)',\n series4: 'var(--ds-chart-series-4-color)',\n series5: 'var(--ds-chart-series-5-color)',\n series6: 'var(--ds-chart-series-6-color)',\n series7: 'var(--ds-chart-series-7-color)',\n series8: 'var(--ds-chart-series-8-color)',\n seriesDefault: 'var(--ds-chart-series-default-color)',\n seriesAccent: 'var(--ds-chart-series-accent-color)',\n ramp1: 'var(--ds-chart-ramp-1-color)',\n ramp2: 'var(--ds-chart-ramp-2-color)',\n ramp3: 'var(--ds-chart-ramp-3-color)',\n ramp4: 'var(--ds-chart-ramp-4-color)',\n ramp5: 'var(--ds-chart-ramp-5-color)',\n ramp6: 'var(--ds-chart-ramp-6-color)',\n ramp7: 'var(--ds-chart-ramp-7-color)',\n ramp8: 'var(--ds-chart-ramp-8-color)',\n} as const;\n\n/** @internal See chartColors. */\nexport const CHART_SERIES_COLORS: readonly string[] = [\n chartColors.series1,\n chartColors.series2,\n chartColors.series3,\n chartColors.series4,\n chartColors.series5,\n chartColors.series6,\n chartColors.series7,\n chartColors.series8,\n];\n\n/** @internal See chartColors. */\nexport const CHART_RAMP_COLORS: readonly string[] = [\n chartColors.ramp1,\n chartColors.ramp2,\n chartColors.ramp3,\n chartColors.ramp4,\n chartColors.ramp5,\n chartColors.ramp6,\n chartColors.ramp7,\n chartColors.ramp8,\n];\n","const numberFormatters = new Map<string, Intl.NumberFormat>();\n\nfunction numberFormatter(locale: string | undefined): Intl.NumberFormat {\n const key = locale ?? 'default';\n let formatter = numberFormatters.get(key);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale);\n numberFormatters.set(key, formatter);\n }\n\n return formatter;\n}\n\n/** @internal */\nexport function formatValue(value: number, locale?: string): string {\n if (!Number.isFinite(value)) {\n return '—';\n }\n\n return numberFormatter(locale).format(value);\n}\n\n/** @internal */\nexport function formatPercent(value: number, total: number): string {\n if (!total || !Number.isFinite(value) || !Number.isFinite(total)) {\n return '—';\n }\n\n const percent = (value / total) * 100;\n // A real share must never print as an exact zero: at one decimal, 214 of 987,654,321 rounds to\n // \"0.0%\" beside a bar too short to see, and the row reads as nothing when it is not nothing.\n if (percent !== 0 && Math.abs(percent) < 0.05) {\n return percent > 0 ? '<0.1%' : '>-0.1%';\n }\n\n return `${percent.toFixed(1)}%`;\n}\n\n/** Whole percentages that sum to exactly 100. Rounding each share on its own\n * gives 33/33/33 for three equal parts, and a legend that visibly loses 1%.\n *\n * @internal Exported for the chart entry points; not part of the package surface. */\nexport function largestRemainder(values: readonly number[]): number[] {\n const total = values.reduce((sum, value) => sum + value, 0);\n if (!total) {\n return values.map(() => 0);\n }\n const exact = values.map((value) => (value / total) * 100);\n const floors = exact.map(Math.floor);\n let remaining = 100 - floors.reduce((sum, value) => sum + value, 0);\n const order = exact\n .map((value, index) => ({ index, fraction: value - Math.floor(value) }))\n .sort((a, b) => b.fraction - a.fraction);\n const result = [...floors];\n for (const { index } of order) {\n if (remaining <= 0) {\n break;\n }\n result[index]++;\n remaining--;\n }\n\n return result;\n}\n\n/** @internal */\nexport function formatTick(value: number, step: number): string {\n if (!Number.isFinite(value)) {\n return '';\n }\n if (Math.abs(value) < 1000) {\n return String(value);\n }\n\n // The unit follows the STEP, not the value, so every label on one axis carries the same suffix:\n // a step of 200M labels 1e9 as 1000M, never 1B beside 800M.\n const units = [\n { suffix: 'B', scale: 1e9 },\n { suffix: 'M', scale: 1e6 },\n { suffix: 'K', scale: 1e3 },\n ];\n const unit =\n units.find((candidate) => Math.abs(step) >= candidate.scale) ?? units[2];\n const scaled = value / unit.scale;\n\n // A step that divides its unit evenly needs no decimal; one that does not needs exactly one on\n // EVERY label, so an axis reads 1.0K · 1.5K · 2.0K rather than mixing 1K with 1.5K. Rounding the\n // whole branch matters too: a caller passing a raw datum instead of a tick would otherwise print\n // every digit of the division, as 987.654321M.\n return step % unit.scale === 0\n ? `${Math.round(scaled)}${unit.suffix}`\n : `${scaled.toFixed(1)}${unit.suffix}`;\n}\n","import {\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n Signal,\n inject,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n/** Container width as a signal. It is 0 under SSR, while the container is\n * `display: none`, and before the first observation.\n *\n * @internal */\nexport function elementWidth(host: ElementRef<HTMLElement>): Signal<number> {\n const width = signal(0);\n if (!isPlatformBrowser(inject(PLATFORM_ID))) {\n return width.asReadonly();\n }\n\n const observer = new ResizeObserver((entries) => {\n width.set(Math.round(entries[0]?.contentRect.width ?? 0));\n });\n observer.observe(host.nativeElement);\n inject(DestroyRef).onDestroy(() => observer.disconnect());\n\n return width.asReadonly();\n}\n","const E10 = Math.sqrt(50);\nconst E5 = Math.sqrt(10);\nconst E2 = Math.sqrt(2);\n\n/** d3's tick-increment rule. A naive `max / count` produces steps like 482, which\n * no reader parses; this snaps to 1, 2, 5 or 10 times a power of ten. */\nfunction tickIncrement(domainMax: number, targetCount: number): number {\n const step = domainMax / Math.max(1, targetCount);\n const power = Math.floor(Math.log10(step));\n const error = step / Math.pow(10, power);\n const factor = error >= E10 ? 10 : error >= E5 ? 5 : error >= E2 ? 2 : 1;\n\n return factor * Math.pow(10, power);\n}\n\n/** @internal */\nexport function tickValues(domainMax: number, targetCount: number): number[] {\n if (!Number.isFinite(domainMax) || domainMax <= 0) {\n return [0];\n }\n const step = tickIncrement(domainMax, targetCount);\n const out: number[] = [];\n for (let i = 0; i <= Math.ceil(domainMax / step); i++) {\n out.push(i * step);\n }\n\n return out;\n}\n\n/** @internal */\nexport function niceMax(domainMax: number, targetCount: number): number {\n if (!Number.isFinite(domainMax) || domainMax <= 0) {\n return 0;\n }\n const step = tickIncrement(domainMax, targetCount);\n\n return Math.ceil(domainMax / step) * step;\n}\n\n/** Distance between two ticks, which `formatTick` needs to pick a precision. A\n * degenerate series yields a single tick and therefore no step.\n *\n * @internal */\nexport function tickStep(ticks: readonly number[]): number {\n return ticks.length > 1 ? ticks[1] - ticks[0] : 0;\n}\n\n/** @internal */\nexport function linearScale(\n domainMax: number,\n rangeSize: number,\n): (value: number) => number {\n if (!Number.isFinite(domainMax) || domainMax <= 0) {\n return () => 0;\n }\n\n return (value) => (value / domainMax) * rangeSize;\n}\n\n/** @internal */\nexport interface BandScale {\n readonly bandWidth: number;\n /** Centre to centre, so it exceeds `bandWidth` by the padding. */\n readonly step: number;\n readonly count: number;\n position(index: number): number;\n /** The band an offset falls in, clamped at both ends so a pointer leaving the plot\n * keeps the band it left from. `-1` when there are no bands, which is the one case\n * a caller branches on rather than clamps. */\n indexAt(offset: number): number;\n}\n\n/** @internal */\nexport function bandScale(\n count: number,\n rangeSize: number,\n paddingRatio: number,\n): BandScale {\n if (count <= 0) {\n return {\n bandWidth: 0,\n step: 0,\n count: 0,\n position: () => 0,\n indexAt: () => -1,\n };\n }\n const step = rangeSize / count;\n const bandWidth = step * (1 - paddingRatio);\n\n return {\n bandWidth,\n step,\n count,\n position: (index) => step * index + (step - bandWidth) / 2,\n indexAt: (offset) =>\n Math.min(count - 1, Math.max(0, Math.floor(offset / step))),\n };\n}\n","// Past this the entrance stops reading as one gesture and starts reading as a queue: at 40ms a\n// 100-mark series would otherwise take four seconds to finish arriving.\nconst STAGGER_CAP_MS = 300;\n\n/** Entrance delay for the mark at `index`, in milliseconds. `stepMs` of `0` is the default and\n * means no stagger at all.\n *\n * @internal */\nexport function staggerDelay(index: number, stepMs: number): number {\n if (!(stepMs > 0) || !Number.isFinite(index) || index <= 0) {\n return 0;\n }\n\n return Math.min(index * stepMs, STAGGER_CAP_MS);\n}\n","/** Where a roving tabindex lands after `key`, or `null` when the key does not traverse.\n *\n * The ends wrap, as they do in `ds-radio-group`: a chart's marks are a closed set, and Home and\n * End are the direct way to either extreme.\n *\n * @internal */\nexport function nextRovingIndex(\n key: string,\n current: number,\n count: number,\n): number | null {\n if (!Number.isFinite(count) || count <= 0) {\n return null;\n }\n switch (key) {\n case 'ArrowRight':\n case 'ArrowDown':\n return (current + 1) % count;\n case 'ArrowLeft':\n case 'ArrowUp':\n return (current - 1 + count) % count;\n case 'Home':\n return 0;\n case 'End':\n return count - 1;\n default:\n return null;\n }\n}\n\n/** Moves DOM focus to the mark `index` within `scope`, which is what makes the roving tabindex a\n * traversal rather than a state change nobody can see. `within` narrows the search for a chart\n * whose marks repeat the same index once per series.\n *\n * @internal */\nexport function focusMark(\n scope: Element | null,\n index: number,\n within = '',\n): void {\n const target = scope?.querySelector(`${within}[data-mark-index=\"${index}\"]`);\n if (target instanceof HTMLElement || target instanceof SVGElement) {\n target.focus();\n }\n}\n","import { formatValue } from './charts-format';\n\n/** @internal */\nexport interface SummaryPoint {\n readonly label: string;\n readonly value: number;\n}\n\nfunction trendOf(values: readonly number[]): string {\n const first = values[0];\n const last = values[values.length - 1];\n const rose = values.every(\n (value, index) => index === 0 || value > values[index - 1],\n );\n const fell = values.every(\n (value, index) => index === 0 || value < values[index - 1],\n );\n if (rose) {\n return 'Rising throughout';\n }\n if (fell) {\n return 'Falling throughout';\n }\n if (last > first) {\n return 'Rising overall';\n }\n if (last < first) {\n return 'Falling overall';\n }\n\n return 'Ending where it started';\n}\n\n/** The sentence a screen reader gets as the chart's accessible name. Generated rather than\n * required, because a required one is a field that gets left at the component's default and then\n * lies.\n *\n * The ORDER is the contract: what the chart is and its scale, then the trend, then the extremes,\n * then where the numbers are. Blind readers rank a recital of the encoding lowest of the four\n * levels of chart description, and the encoding is the one thing a screen-reader user cannot use.\n *\n * @internal */\nexport function describeSeries(\n label: string,\n points: readonly SummaryPoint[],\n format: (value: number) => string = formatValue,\n tableFollows = true,\n): string {\n const pointer = tableFollows ? ' Full values in the table below.' : '';\n if (points.length === 0) {\n return `${label}. No data.`;\n }\n if (points.length === 1) {\n return `${label}, one point: ${format(points[0].value)} at ${points[0].label}.${pointer}`;\n }\n const lowest = points.reduce((min, point) =>\n point.value < min.value ? point : min,\n );\n const highest = points.reduce((max, point) =>\n point.value > max.value ? point : max,\n );\n\n return (\n `${label}, ${points.length} points, ` +\n `${format(lowest.value)} to ${format(highest.value)}. ` +\n `${trendOf(points.map((point) => point.value))}. ` +\n `Highest in ${highest.label} at ${format(highest.value)}, ` +\n `lowest in ${lowest.label} at ${format(lowest.value)}.${pointer}`\n );\n}\n","import {\n ElementRef,\n Signal,\n afterRenderEffect,\n computed,\n signal,\n untracked,\n} from '@angular/core';\n\n/**\n * @fileoverview How many chips fit one line of a trigger, measured rather than\n * guessed.\n *\n * INVARIANT: nothing here may measure something the cut itself changes, or the\n * measurement feeds back into its own input and the split never settles — a hung\n * page, not a wrong number. Hence the budget comes off the trigger's PARENT\n * content box (the trigger's own width is the fallback for when there is no usable\n * parent), never the row, and the \"+N more\" marker gets a fixed reserve rather\n * than a measurement.\n *\n * The caller owes two things: chips carry `data-chip`, and they sit in a row of\n * their own that is a direct child of the trigger. `enabled` gates the whole thing\n * because measuring forces layout.\n */\n\n/**\n * Null when the host cannot supply a budget: a detached node, an inline one with no content box,\n * or one whose own width DEPENDS on the trigger — which would feed the cut back into its own\n * input.\n *\n * That last one is asked of layout, not read off a style: `getComputedStyle().width` is a used\n * pixel value, so the `fit-content` a consumer wrote is not readable back. Pinning the trigger to\n * zero and re-reading the host tests it directly — a host sized by its own parent does not move,\n * one sized by its content collapses — at the cost of a second forced layout.\n */\nfunction hostContentWidth(\n host: HTMLElement | null,\n trigger: HTMLElement,\n): number | null {\n if (!host || host.clientWidth === 0) {\n return null;\n }\n const styles = getComputedStyle(host);\n if (styles.display === 'inline') {\n return null;\n }\n\n const before = host.clientWidth;\n const pinned = trigger.style.width;\n trigger.style.width = '0px';\n const dependsOnTrigger = host.clientWidth !== before;\n trigger.style.width = pinned;\n if (dependsOnTrigger) {\n return null;\n }\n\n return (\n before - parseFloat(styles.paddingLeft) - parseFloat(styles.paddingRight)\n );\n}\n\n/** Room held for \"+N more\", in em so a retuned type scale carries. Measured at\n * 4.5em wide with three digits; 5em keeps a chip from being dropped for a pixel. */\nconst MARKER_RESERVE_EM = 5;\n\n/** What a sibling of the chip row costs the chips. One that can grow gives back\n * what it does not use, so only its floor is owed; anything else owes its box. */\nfunction reservedWidth(element: HTMLElement): number {\n const styles = getComputedStyle(element);\n\n return parseFloat(styles.flexGrow) > 0\n ? parseFloat(styles.minWidth) || 0\n : element.offsetWidth;\n}\n\n/** @internal */\nexport function chipFit(\n count: Signal<number>,\n chipRow: Signal<ElementRef<HTMLElement> | undefined>,\n enabled: Signal<boolean>,\n /** The whole selection, which `count` may already cap. */\n selectionSize: Signal<number> = count,\n): Signal<number> {\n const available = signal(0);\n const gap = signal(0);\n const markerReserve = signal(0);\n /** Widths of ALL chips, from the last render that held all of them. */\n const chipWidths = signal<readonly number[]>([]);\n /** `count` at that render, so a stale cache is never trusted. */\n const measuredFor = signal(-1);\n /** Geometry the last measure ran against, to skip one that would repeat it.\n * Each forces layout: without this guard a single docs page load measured 214\n * times across seven pickers. */\n let lastWidth = -1;\n let lastCount = -1;\n\n const measure = (row: HTMLElement): void => {\n const trigger = row.parentElement;\n if (!trigger) {\n return;\n }\n\n // A trigger that hugs its content (`width: fit-content`, which both compact\n // modes set) has a width decided by the chips this cut removes, so reading it\n // feeds the result back into its own input. The parent's content box is the\n // space actually available and does not move when the chips do; for a `fill`\n // trigger the two are the same number.\n //\n // The fallback is that same feedback loop, so it is a last resort, not a default: it runs\n // only when the host cannot answer at all.\n const host = trigger.parentElement;\n const budget = hostContentWidth(host, trigger) ?? trigger.clientWidth;\n\n const width = budget;\n const currentCount = untracked(count);\n const cacheIsCurrent = untracked(measuredFor) === currentCount;\n if (width === lastWidth && currentCount === lastCount && cacheIsCurrent) {\n return;\n }\n lastWidth = width;\n lastCount = currentCount;\n\n const triggerStyles = getComputedStyle(trigger);\n const columnGap = parseFloat(triggerStyles.columnGap) || 0;\n let free =\n budget -\n parseFloat(triggerStyles.paddingLeft) -\n parseFloat(triggerStyles.paddingRight) -\n parseFloat(triggerStyles.borderLeftWidth) -\n parseFloat(triggerStyles.borderRightWidth);\n for (const sibling of trigger.children) {\n if (sibling !== row) {\n free -= reservedWidth(sibling as HTMLElement) + columnGap;\n }\n }\n\n gap.set(columnGap);\n available.set(free);\n markerReserve.set(\n MARKER_RESERVE_EM * parseFloat(getComputedStyle(row).fontSize),\n );\n\n const chips = row.querySelectorAll<HTMLElement>('[data-chip]');\n // A partial render is the previous cut, not the selection: caching it would\n // keep only the survivors' widths, and the row could never grow back.\n if (chips.length === untracked(count)) {\n chipWidths.set([...chips].map((chip) => chip.offsetWidth));\n measuredFor.set(untracked(count));\n }\n };\n\n afterRenderEffect((onCleanup) => {\n const row = chipRow()?.nativeElement;\n if (!enabled() || !row) {\n return;\n }\n const observer = new ResizeObserver(() => measure(row));\n // The trigger, not the row: the row's box follows the cut, so observing it\n // would report this function's own output back to it.\n observer.observe(row.parentElement ?? row);\n onCleanup(() => observer.disconnect());\n });\n\n // A selection change does not resize the trigger, so it drives its own measure.\n afterRenderEffect(() => {\n count();\n const row = chipRow()?.nativeElement;\n if (enabled() && row) {\n measure(row);\n }\n });\n\n return computed<number>(() => {\n const total = count();\n if (!enabled()) {\n return total;\n }\n const widths = chipWidths();\n // Until the widths for THIS selection are in, render all of them: that render\n // is what gets measured, and the row clips it until the cut lands.\n if (measuredFor() !== total || available() <= 0) {\n return total;\n }\n\n let used = 0;\n for (let index = 0; index < widths.length; index++) {\n const next = used + widths[index] + (index > 0 ? gap() : 0);\n // The marker is only owed room once something is actually hidden, so the\n // last chip may spend what the marker would have taken — but only if this\n // really is the end of the selection, not the end of a capped slice.\n const isLast =\n index === widths.length - 1 && selectionSize() <= widths.length;\n const budget = isLast\n ? available()\n : available() - markerReserve() - gap();\n if (next > budget) {\n // One chip always shows: a trigger too narrow for even that is a layout\n // bug upstream, and 0 would render a bare \"+N\" with nothing to anchor it.\n return Math.max(1, index);\n }\n used = next;\n }\n\n return total;\n });\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills a selected chip's content in the trigger of `ds-multi-select` and\n * `ds-autocomplete`, so a picker whose rows carry an avatar does not lose it the\n * moment the option is chosen.\n *\n * The chip is still a `ds-tag` owned by the library: its close button, its\n * accessible remove label and the measured overflow cap are not projected.\n */\n@Directive({\n selector: '[dsChipTemplate]',\n standalone: true,\n})\nexport class DsChipTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { Signal, computed, inject } from '@angular/core';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\n\n/**\n * Resolve a field's `reserveMessage` against the app-level default.\n *\n * Fields declare the input as `boolean | null` with a `null` default so \"not set\"\n * stays distinguishable from an explicit `true` — a signal input cannot report\n * whether it was bound. Precedence: the component input, then\n * `DS_CONFIG.field.reserveMessage`, then `false`.\n *\n * Call from a field initializer (an injection context), e.g.\n * `protected readonly reserve = resolveReserveMessage(this.reserveMessage);`\n */\nexport function resolveReserveMessage(\n reserveMessage: Signal<boolean | null>,\n): Signal<boolean> {\n const config = inject(DS_CONFIG);\n\n return computed(\n () => reserveMessage() ?? config.field?.reserveMessage ?? false,\n );\n}\n","import {\n DestroyRef,\n Injector,\n Signal,\n afterNextRender,\n computed,\n inject,\n isDevMode,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n FormGroupDirective,\n NgControl,\n NgForm,\n type ValidationErrors,\n} from '@angular/forms';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\nimport type { FieldMessageState } from '@ids-group-ltd/ids-design-system/components/field-message';\n\n/**\n * One validation error, structurally identical to Angular's signal-forms\n * `ValidationError`.\n *\n * Declared here rather than imported from `@angular/forms/signals` on purpose:\n * that module is `@experimental`, and a public DS type must not carry a\n * dependency that can be renamed out from under consumers. Structural\n * compatibility is all the interop needs — signal forms binds by input NAME and\n * assigns its own `ValidationError[]`, which this shape accepts.\n */\nexport interface DsFieldError {\n /** Identifies the kind of error, e.g. `required`, `minlength`, `server`. */\n readonly kind: string;\n /** Human-readable text. Authored by the consumer, at the validator. */\n readonly message?: string;\n}\n\n/** What a field's `errors` input accepts before normalization. */\nexport type DsFieldErrorsInput =\n | string\n | DsFieldError\n | readonly DsFieldError[]\n | null\n | undefined;\n\nconst NO_ERRORS: readonly DsFieldError[] = [];\n\n/**\n * The one reserved `DsFieldError.kind`. An error carrying it is advisory: it shows\n * in the warning state and does NOT make the control invalid, which is how a form\n * model can raise a non-blocking remark — Angular's own `AbstractControl` has no\n * channel for one, only `errors` and the validity derived from it.\n */\nexport const DS_FIELD_WARNING_KIND = 'warning';\n\n/**\n * `errors` input transform. Accepts a bare string (so a consumer that already\n * has the text can pass it directly), a single error, or the array signal forms\n * assigns.\n */\nexport function normalizeFieldErrors(\n value: DsFieldErrorsInput,\n): readonly DsFieldError[] {\n if (!value) {\n return NO_ERRORS;\n }\n if (typeof value === 'string') {\n return value.trim() ? [{ kind: 'custom', message: value }] : NO_ERRORS;\n }\n\n return Array.isArray(value) ? value : [value as DsFieldError];\n}\n\n/** @internal */\nexport function trimmedText(value: string | null | undefined): string {\n return value?.trim() ?? '';\n}\n\n/** The single line a field shows below itself, already resolved.\n * @internal\n */\nexport interface DsFieldMessage {\n readonly text: string;\n readonly state: FieldMessageState;\n}\n\nexport interface DsFieldMessageSources {\n hint: Signal<string>;\n warning: Signal<string>;\n error: Signal<string>;\n errors: Signal<readonly DsFieldError[]>;\n invalid: Signal<boolean>;\n /** The control's own disabled state. A disabled control is neither submitted nor validated, so\n * it is not announced as invalid — the same reasoning `_field-state.scss` uses to keep the error\n * paint off it. Optional only because a host without a disabled state has nothing to pass.\n * A plain getter rather than a `Signal` so a caller can hand it over before its own\n * `isDisabled` field is initialised — this resolver is usually assigned near the top of a\n * component and the disabled computed near the bottom. */\n disabled?: () => boolean;\n success?: Signal<string>;\n /** The field's own touched state, if it tracks one (CVA blur). */\n touchedSelf?: Signal<boolean>;\n /** Bound by signal forms as part of the `FormUiControl` contract. */\n touched?: Signal<boolean>;\n}\n\nexport interface DsFieldMessageResolution {\n readonly message: Signal<DsFieldMessage>;\n /** `invalid` folded together with whatever the control reports. */\n readonly invalid: Signal<boolean>;\n /**\n * The state the CONTROL paints, for `[attr.data-field-state]`. Deliberately not\n * `message().state`: a field can be in a state with nothing to say, and can have\n * text in a state the box does not paint.\n */\n readonly controlState: Signal<FieldMessageState | null>;\n}\n\nconst EMPTY_MESSAGE: DsFieldMessage = { text: '', state: 'default' };\n\ninterface ControlState {\n readonly errors: readonly DsFieldError[];\n readonly touched: boolean;\n}\n\nconst NO_CONTROL: ControlState = { errors: NO_ERRORS, touched: false };\n\n/**\n * Resolve the one message a field shows, from every source that can supply one.\n *\n * Precedence, highest first — the ladder Carbon uses (`invalidText` →\n * `warnText` → `helperText`) and Material's subscript follows, so only ONE line\n * ever shows and the field's height does not depend on how many sources are\n * populated:\n *\n * 1. `error` — an explicit string. Shown immediately: the consumer decided.\n * 2. `errors` — validation errors. Shown once the user has interacted, so a\n * `required` error does not greet an untouched form.\n * 3. `warning` — advisory, not blocking.\n * 4. `errors` whose kind is `DS_FIELD_WARNING_KIND` — the same, raised by the form model.\n * 5. `success` — confirmation.\n * 6. `hint` — helper text.\n *\n * Both form systems feed step 2 and neither needs the other. Signal forms binds\n * `errors` and `touched` by input name (`FormUiControl`); reactive and\n * template-driven forms expose the same through `NgControl`, read here. A given\n * field instance is driven by exactly one of them, so they cannot disagree.\n *\n * Every rung carries its OWN text, and `hint` is never recoloured into somebody\n * else's state. `invalid` is the one input with no text on purpose: it paints the\n * control and sets `aria-invalid` for when the message lives elsewhere — a\n * form-level error summary, or one message for a whole field group.\n *\n * Call from a field initializer (an injection context).\n * @internal\n */\nexport function resolveFieldMessage(\n sources: DsFieldMessageSources,\n): DsFieldMessageResolution {\n const config = inject(DS_CONFIG);\n const controlState = watchNgControl();\n\n const errors = computed(() => {\n const own = sources.errors();\n\n return own.length ? own : controlState().errors;\n });\n\n const interacted = computed(\n () =>\n (sources.touched?.() ?? false) ||\n (sources.touchedSelf?.() ?? false) ||\n controlState().touched,\n );\n\n // Both form systems land here, so one reserved kind serves both: signal forms\n // assigns its own ValidationError[] (which already carries `kind`), and\n // fromValidationErrors turns a reactive validator's `{ warning: 'text' }` KEY\n // into the same kind.\n const blocking = computed(() =>\n errors().filter((error) => error.kind !== DS_FIELD_WARNING_KIND),\n );\n const advisory = computed(() =>\n errors().filter((error) => error.kind === DS_FIELD_WARNING_KIND),\n );\n\n const errorText = computed(() => {\n const current = blocking();\n if (!current.length || !interacted()) {\n return '';\n }\n\n return textFor(current, config.field?.errorMessages);\n });\n\n const advisoryText = computed(() => {\n const current = advisory();\n if (!current.length || !interacted()) {\n return '';\n }\n\n return textFor(current, config.field?.errorMessages);\n });\n\n // Advisory errors are deliberately absent: a warning does not make a control\n // invalid, so it never sets aria-invalid and never blocks a submit guard.\n // Disabled wins over every source of invalidity. Measured in Chrome's accessibility tree:\n // `aria-invalid` on a NATIVELY disabled input still reports invalid=true and the node is not\n // ignored, so disabling does not make the attribute inert — the reader still hears \"invalid\" on\n // a control they cannot act on.\n const invalid = computed(\n () =>\n !(sources.disabled?.() ?? false) &&\n (sources.invalid() ||\n sources.error().length > 0 ||\n (blocking().length > 0 && interacted())),\n );\n\n // Message inputs trim via `trimmedText`, so a non-empty string here is real\n // text — a new one declared without that transform breaks this quietly.\n const message = computed<DsFieldMessage>(() => {\n const explicit = sources.error();\n if (explicit) {\n return { text: explicit, state: 'error' };\n }\n const fromErrors = errorText();\n if (fromErrors) {\n return { text: fromErrors, state: 'error' };\n }\n const warning = sources.warning();\n if (warning) {\n return { text: warning, state: 'warning' };\n }\n const fromAdvisory = advisoryText();\n if (fromAdvisory) {\n return { text: fromAdvisory, state: 'warning' };\n }\n const success = sources.success?.();\n if (success) {\n return { text: success, state: 'success' };\n }\n const hint = sources.hint();\n\n return hint ? { text: hint, state: 'default' } : EMPTY_MESSAGE;\n });\n\n const paintedState = computed<FieldMessageState | null>(() => {\n if (invalid()) {\n return 'error';\n }\n if (sources.warning() || advisoryText()) {\n return 'warning';\n }\n\n return sources.success?.() ? 'success' : null;\n });\n\n return { message, invalid, controlState: paintedState };\n}\n\n/**\n * Reactive- and template-driven forms channel. `NgControl` cannot be injected\n * directly: a field provides `NG_VALUE_ACCESSOR` pointing at itself, so asking\n * for `NgControl` in the same constructor is a DI cycle. Resolving it after the\n * first render is the documented way around that.\n *\n * `events` (not `statusChanges`) is the subscription, because touching a control\n * does NOT emit a status change — it emits `TouchedChangeEvent`, and touched is\n * half of the decision to show an error at all.\n */\nfunction watchNgControl(): Signal<ControlState> {\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n // Submitting a form does not reach the child control's own `events` — the\n // event is pushed onto the ROOT form's stream — so the parent is read\n // directly, as Angular Material's ErrorStateMatcher does.\n const parentForm = inject(NgForm, { optional: true });\n const parentFormGroup = inject(FormGroupDirective, { optional: true });\n const state = signal<ControlState>(NO_CONTROL);\n\n afterNextRender(() => {\n const control = injector.get(NgControl, null)?.control;\n if (!control) {\n return;\n }\n const submitted = (): boolean =>\n parentFormGroup?.submitted || parentForm?.submitted || false;\n const sync = (): void =>\n state.set({\n errors: fromValidationErrors(control.errors),\n touched: control.touched || submitted(),\n });\n\n // Signal forms bridges an NgControl whose `control` has no `events` stream, so\n // there is nothing to subscribe to. Staying at NO_CONTROL is deliberate: on that\n // path the component's own inputs carry errors and touched, and a snapshot that\n // froze at first render would keep serving a stale error after the field went valid.\n if (typeof control.events?.pipe !== 'function') {\n return;\n }\n\n sync();\n control.events.pipe(takeUntilDestroyed(destroyRef)).subscribe(sync);\n const parentSubmit = parentFormGroup?.ngSubmit ?? parentForm?.ngSubmit;\n parentSubmit?.pipe(takeUntilDestroyed(destroyRef)).subscribe(sync);\n });\n\n return state;\n}\n\n/**\n * `ValidationErrors` is an untyped bag, so a message is picked up from the two\n * shapes consumers actually write: `{ myError: 'text' }` and\n * `{ myError: { message: 'text' } }`. Angular's own built-ins carry detail\n * objects with no message (`{ minlength: { requiredLength, actualLength } }`) —\n * those resolve through `DS_CONFIG.field.errorMessages` instead.\n */\nfunction fromValidationErrors(\n errors: ValidationErrors | null,\n): readonly DsFieldError[] {\n if (!errors) {\n return NO_ERRORS;\n }\n\n return Object.keys(errors).map((kind) => {\n const detail: unknown = errors[kind];\n if (typeof detail === 'string') {\n return { kind, message: detail };\n }\n const message = (detail as { message?: unknown } | null)?.message;\n\n return typeof message === 'string' ? { kind, message } : { kind };\n });\n}\n\nfunction textFor(\n errors: readonly DsFieldError[],\n messages: Record<string, string> | undefined,\n): string {\n for (const error of errors) {\n const text = error.message ?? messages?.[error.kind];\n if (text) {\n return text;\n }\n }\n if (isDevMode()) {\n console.warn(\n `[ds-field] The control is invalid but no message could be resolved for ${errors\n .map((error) => `\"${error.kind}\"`)\n .join(\n ', ',\n )}, so the field paints the state with NO message under it. Give the validator a message — required(path, { message: '…' }) or { myError: 'text' } — or map the kind in provideDsConfig({ field: { errorMessages: … } }).`,\n );\n }\n\n return '';\n}\n","import { Directive, booleanAttribute, input } from '@angular/core';\nimport { resolveReserveMessage } from './field-defaults';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { trimmedText } from './field-errors';\n\n/**\n * The inputs of anything that renders a `ds-field-message` line — the message half\n * of a field, split out so `ds-button` can take it without also taking `errors`,\n * `invalid` and `touched`, which describe a form control's validation state and\n * mean nothing on a button.\n *\n * `@Directive()` is required, not decoration: Angular refuses to compile a base\n * class that declares inputs without it.\n * @internal\n */\n@Directive()\nexport abstract class DsMessageBase {\n /** Helper text shown below the control. */\n readonly hint = input<string, string | null | undefined>('', {\n transform: trimmedText,\n });\n /** Error text. Shown immediately — binding it says the consumer has already\n * decided this is in error. Takes precedence over `errors`. */\n readonly error = input<string, string | null | undefined>('', {\n transform: trimmedText,\n });\n /** Advisory text, shown when there is no error. */\n readonly warning = input<string, string | null | undefined>('', {\n transform: trimmedText,\n });\n /** Reserve the message-row height even when empty, so the control doesn't shift\n * the layout below it when a hint/error appears. Falls back to\n * `DS_CONFIG.field.reserveMessage`, then off. */\n readonly reserveMessage = input<boolean | null, unknown>(null, {\n transform: (value) => (value == null ? null : booleanAttribute(value)),\n });\n\n /** Glyph on the message line, overriding what the state resolves to. Unset\n * follows `DS_CONFIG.field.stateIcons`; `false` removes the glyph here alone. */\n readonly messageIcon = input<IconName | false | null>(null);\n\n readonly reserveMessageResolved = resolveReserveMessage(this.reserveMessage);\n}\n","import { Directive, booleanAttribute, input } from '@angular/core';\nimport { DsMessageBase } from './message-base';\nimport {\n normalizeFieldErrors,\n type DsFieldError,\n type DsFieldErrorsInput,\n} from './field-errors';\n\n/**\n * The inputs every DS form field has, declared once.\n *\n * Only the UNIVERSAL ones belong here. `success`, `label`, `required` and\n * `optional` stay on the components: they exist on some fields and not others, so\n * lifting them would hand a checkbox a `success` or a slider a `label` it never\n * had — a silent public-API addition.\n *\n * The message half lives one level up in `DsMessageBase`, which anything with a\n * message line can take. What stays here is the validation state a form control\n * has and a plain control does not.\n * @internal\n */\n@Directive()\nexport abstract class DsFieldBase extends DsMessageBase {\n /** Validation errors, shown once the user has interacted. Bound automatically\n * by signal forms; reactive and template-driven forms are read through\n * `NgControl` and need nothing here. Accepts a string, one error, or an array. */\n readonly errors = input<readonly DsFieldError[], DsFieldErrorsInput>([], {\n transform: normalizeFieldErrors,\n });\n /** Paints the error state and sets `aria-invalid`, WITHOUT a message of its own\n * — for when the text lives elsewhere, such as a form-level error summary or\n * one message covering a whole field group. Use `error` to show text. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /** Whether the user has interacted with the field. Bound by signal forms; gates\n * `errors`, so a `required` error does not greet an untouched form. */\n readonly touched = input(false, { transform: booleanAttribute });\n}\n","import {\n Directive,\n ElementRef,\n booleanAttribute,\n effect,\n inject,\n input,\n signal,\n type ModelSignal,\n type WritableSignal,\n} from '@angular/core';\nimport type { ControlValueAccessor } from '@angular/forms';\nimport { DsFieldBase } from './field-base';\n\n/**\n * Value-bearing elements come FIRST, and that ordering is the whole point: the\n * number stepper renders its decrement button before its input, so \"the first\n * focusable descendant\" would land on minus. `tabindex=\"-1\"` is excluded from\n * both passes so a roving-tabindex group (ds-radio-group) yields the radio that\n * is actually tabbable rather than the first one in the DOM. Portaled panels are\n * outside the host, so a closed picker cannot be focused by accident.\n */\nconst NOT_ROVED = ':not([tabindex=\"-1\"]):not([disabled])';\nconst VALUE_ELEMENTS = `input:not([type=\"hidden\"])${NOT_ROVED}, textarea${NOT_ROVED}`;\nconst TRIGGER_ELEMENTS = `button${NOT_ROVED}, [tabindex=\"0\"]${NOT_ROVED}`;\n\n/**\n * The `ControlValueAccessor` half of a DS value control, with no message API\n * attached. `DsControlValueAccessor` is this plus `DsFieldBase`; a control that\n * holds a value and renders no message row — `ds-search`, a toolbar filter rather\n * than a validated field — takes this directly and gets no message inputs with it.\n *\n * The model arrives as a THUNK, not a signal: on a base class `value` is abstract\n * and on a component it is a field initialiser, so it does not exist yet when this\n * runs. Every read defers to call time, which is also when the effect first runs.\n *\n * Must be called from an injection context (it owns an `effect`).\n * @internal\n */\nexport function valueControlBridge<T>(model: () => ModelSignal<T>): {\n readonly formDisabled: WritableSignal<boolean>;\n readonly touchedSelf: WritableSignal<boolean>;\n markTouched(): void;\n writeValue(next: T): void;\n registerOnChange(fn: (next: T) => void): void;\n registerOnTouched(fn: () => void): void;\n setDisabledState(isDisabled: boolean): void;\n} {\n const formDisabled = signal(false);\n const touchedSelf = signal(false);\n let onChange: (next: T) => void = () => {};\n let onTouched: () => void = () => {};\n // Last value synced with the forms API. Guards the watching effect from echoing\n // a form-driven write back as a user change (which would dirty the control or\n // loop), while still emitting every genuine model change.\n let synced: T | undefined;\n let hasSynced = false;\n\n effect(() => {\n const next = model()();\n if (!hasSynced) {\n // Adopt the initial value once, silently — never emit on init.\n hasSynced = true;\n synced = next;\n\n return;\n }\n if (Object.is(next, synced)) {\n return;\n }\n synced = next;\n onChange(next);\n });\n\n return {\n formDisabled,\n touchedSelf,\n markTouched: () => {\n touchedSelf.set(true);\n onTouched();\n },\n writeValue: (next: T) => {\n hasSynced = true;\n synced = next;\n model().set(next);\n },\n registerOnChange: (fn: (next: T) => void) => {\n onChange = fn;\n },\n registerOnTouched: (fn: () => void) => {\n onTouched = fn;\n },\n setDisabledState: (isDisabled: boolean) => {\n formDisabled.set(isDisabled);\n },\n };\n}\n\nfunction focusOwnControl(host: HTMLElement, options?: FocusOptions): void {\n const target =\n host.querySelector<HTMLElement>(VALUE_ELEMENTS) ??\n host.querySelector<HTMLElement>(TRIGGER_ELEMENTS);\n target?.focus(options);\n}\n\n/**\n * Shared `ControlValueAccessor` for DS form controls whose value is a signal\n * `model()`. Bridges that model with Angular forms (reactive `formControl` /\n * `formControlName` and template `ngModel`) in both directions, WITHOUT\n * touching the existing `[(value)]` signal API — both keep working.\n *\n * A subclass must expose the `value` model and OR `formDisabled()` into its\n * effective disabled state so `FormControl.disable()` actually reaches the\n * control; it should also call `markTouched()` from a blur handler.\n * @internal\n */\n@Directive({\n host: { '[style.display]': 'hidden() ? \"none\" : null' },\n})\nexport abstract class DsControlValueAccessor<T>\n extends DsFieldBase\n implements ControlValueAccessor\n{\n /** The component's two-way value model. */\n abstract readonly value: ModelSignal<T>;\n\n /**\n * Hides the control. On the base so signal forms reaches every control at once.\n * Inline `display`, not the `hidden` attribute — each control sets its own\n * `:host` display, which the attribute's weaker UA rule would lose to.\n */\n readonly hidden = input(false, { transform: booleanAttribute });\n private readonly hostElement = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Signal forms calls this through `focusBoundControl()` — typically to reach\n * the first invalid field after a failed submit. Without it the default is to\n * focus the HOST, and a `<ds-*>` element is not focusable, so focus went\n * nowhere. A control with a more precise target overrides this.\n */\n focus(options?: FocusOptions): void {\n focusOwnControl(this.hostElement.nativeElement, options);\n }\n\n private readonly bridge = valueControlBridge<T>(() => this.value);\n\n /** Driven by the forms API via `setDisabledState`. */\n protected readonly formDisabled = this.bridge.formDisabled;\n\n // Separate from the control's `touched`, which only exists once `NgControl`\n // resolves — too late to gate the first blur.\n protected readonly touchedSelf = this.bridge.touchedSelf;\n\n /** Call from a blur handler so the control reports `ng-touched`. */\n protected markTouched(): void {\n this.bridge.markTouched();\n }\n\n writeValue(value: T): void {\n this.bridge.writeValue(value);\n }\n\n registerOnChange(fn: (value: T) => void): void {\n this.bridge.registerOnChange(fn);\n }\n\n registerOnTouched(fn: () => void): void {\n this.bridge.registerOnTouched(fn);\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.bridge.setDisabledState(isDisabled);\n }\n}\n\n/**\n * Shared `ControlValueAccessor` for DS boolean controls (checkbox, switch)\n * whose state lives in a `checked` model signal rather than `value`. Bridges\n * with Angular forms in both directions without affecting the `[(checked)]`\n * signal API. Subclasses must OR `formDisabled()` into their effective disabled\n * state and call `markTouched()` from a blur handler.\n * @internal\n */\n@Directive({\n host: { '[style.display]': 'hidden() ? \"none\" : null' },\n})\nexport abstract class DsBooleanControlValueAccessor\n extends DsFieldBase\n implements ControlValueAccessor\n{\n /** The component's two-way checked model. */\n abstract readonly checked: ModelSignal<boolean>;\n\n /** Hides the control — see the note on `DsControlValueAccessor.hidden`. */\n readonly hidden = input(false, { transform: booleanAttribute });\n private readonly hostElement = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Signal forms calls this through `focusBoundControl()` — typically to reach\n * the first invalid field after a failed submit. Without it the default is to\n * focus the HOST, and a `<ds-*>` element is not focusable, so focus went\n * nowhere. A control with a more precise target overrides this.\n */\n focus(options?: FocusOptions): void {\n focusOwnControl(this.hostElement.nativeElement, options);\n }\n\n /** Driven by the forms API via `setDisabledState`. */\n protected readonly formDisabled = signal(false);\n\n // Separate from the control's `touched`, which only exists once `NgControl`\n // resolves — too late to gate the first blur.\n protected readonly touchedSelf = signal(false);\n\n private onChange: (value: boolean) => void = () => {};\n private onTouched: () => void = () => {};\n\n private synced: boolean | undefined;\n private hasSynced = false;\n\n constructor() {\n super();\n effect(() => {\n const next = this.checked();\n if (!this.hasSynced) {\n this.hasSynced = true;\n this.synced = next;\n\n return;\n }\n if (Object.is(next, this.synced)) {\n return;\n }\n this.synced = next;\n this.onChange(next);\n });\n }\n\n /** Call from a blur handler so the control reports `ng-touched`. */\n protected markTouched(): void {\n this.touchedSelf.set(true);\n this.onTouched();\n }\n\n writeValue(value: boolean): void {\n this.hasSynced = true;\n this.synced = value;\n this.checked.set(value);\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Replaces `ds-autocomplete`'s \"Create «…»\" row.\n *\n * Context: `query` is the typed text the row would create.\n *\n * The row stays a `role=\"option\"` the keyboard can reach, and picking it still\n * emits `create` — the template fills the row, it does not become the action.\n */\n@Directive({\n selector: '[dsCreateTemplate]',\n standalone: true,\n})\nexport class DsCreateTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { computed, inject, type Signal } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n UrlTree,\n type IsActiveMatchOptions,\n type Params,\n type QueryParamsHandling,\n} from '@angular/router';\n\nexport type DsDestination = 'routerLink' | 'href' | 'button';\n\n// The query string is a subset match and the fragment is ignored in both: a sort order, a page\n// number or an open accordion does not make it a different page.\nconst EXACT_PATH: Partial<IsActiveMatchOptions> = {\n paths: 'exact',\n queryParams: 'subset',\n fragment: 'ignored',\n matrixParams: 'ignored',\n};\nconst PREFIX_PATH: Partial<IsActiveMatchOptions> = {\n ...EXACT_PATH,\n paths: 'subset',\n};\n\n/** What a `routerLink` input accepts. A `UrlTree` carries the fragment, query and relative base\n * the string and command-array forms cannot, so a caller that needs them can build one with\n * `Router.createUrlTree` instead of reaching for more inputs. */\nexport type DsRouterLink = string | readonly unknown[] | UrlTree | null;\n\n/** The values `aria-current` is allowed to take, plus `null` for \"say nothing\". `true` rather than\n * `'true'` so it drops straight into `RouterLinkActive.ariaCurrentWhenActive`, which is the only\n * writer of this attribute on a routed link. */\nexport type DsAriaCurrent =\n | 'page'\n | 'step'\n | 'location'\n | 'date'\n | 'time'\n | true;\n\n/** The `UrlCreationOptions` a navigating control forwards. */\nexport interface DsLinkModifiers {\n fragment?: string;\n queryParams?: Params | null;\n queryParamsHandling?: QueryParamsHandling | null;\n}\n\n/**\n * No destination is a `<button>`, never an `<a href=\"#\">`: a `#` href navigates, rewriting the URL\n * and discarding the scroll position. Only the decision is shared — each control keeps its own\n * template branches, because a shared one would need a wrapper that changes the control's box.\n *\n * @internal\n */\nexport function dsDestination(\n routerLink: Signal<DsRouterLink>,\n href: Signal<string>,\n): Signal<DsDestination> {\n return computed(() => {\n if (routerLink() !== null) {\n return 'routerLink';\n }\n\n return href() ? 'href' : 'button';\n });\n}\n\n/**\n * What a navigating control should announce, distinguishing the two things `routerLinkActive`\n * cannot tell apart.\n *\n * `routerLinkActive` matches by PREFIX, so deriving `aria-current=\"page\"` from it makes a\n * \"back to the section\" link claim to be the page the reader is already on. ARIA separates the\n * two: `page` is the page you are on, `true` is the current section or an ancestor of it. So an\n * exact match announces `page`, a prefix match announces `true`, and anything else stays silent —\n * which is correct for a button and for a sidenav item without a branch between them.\n *\n * Feed the result to `RouterLinkActive.ariaCurrentWhenActive`, never to `[attr.aria-current]`: the\n * directive removes that attribute from its host in a microtask whenever its own input is unset,\n * so a template binding is written and then silently wiped. Consequence worth knowing — a narrowed\n * `routerLinkActiveOptions` narrows the announcement with it, because the directive writes nothing\n * while it considers the link inactive.\n *\n * Must be called from an injection context. Outside a router it returns the override or `null`,\n * so a control can render with no router present.\n *\n * @internal\n */\nexport function dsAriaCurrent(\n routerLink: Signal<DsRouterLink>,\n modifiers: Signal<DsLinkModifiers>,\n override: Signal<DsAriaCurrent | null | undefined>,\n): Signal<DsAriaCurrent | undefined> {\n const router = inject(Router, { optional: true });\n // `RouterLink` resolves its commands against the route it sits on, so a relative destination\n // (`routerLink=\".\"`, `['..', 'sibling']`) means something different from the root. Resolving it\n // here without the same base would make `.` land on `/` — a prefix of every page, so the item\n // that IS the current page would announce `true` instead of `page`.\n const route = inject(ActivatedRoute, { optional: true });\n\n return computed<DsAriaCurrent | undefined>(() => {\n // `null` is the consumer's way of saying \"announce nothing\"; the directive spells that\n // `undefined`, so the two meet here rather than at every call site.\n const explicit = override();\n if (explicit !== undefined) {\n return explicit ?? undefined;\n }\n\n const link = routerLink();\n if (!router || link === null) {\n return undefined;\n }\n\n const tree =\n link instanceof UrlTree\n ? link\n : router.createUrlTree(Array.isArray(link) ? [...link] : [link], {\n relativeTo: route ?? undefined,\n ...modifiers(),\n });\n\n // `lastSuccessfulNavigation` is only the reactive trigger. The comparison goes through\n // `Router.isActive`, which reads the LIVE url: the standalone `isActive()` helper compares\n // against that navigation's `finalUrl` instead, and an app that rewrites its path without\n // navigating — a docs page tracking the section under the reader, a wizard naming its step —\n // then keeps announcing the page it landed on. Deprecated in 21.1, and nothing public replaces\n // the live-url comparison.\n router.lastSuccessfulNavigation();\n\n return router.isActive(tree, EXACT_PATH)\n ? 'page'\n : router.isActive(tree, PREFIX_PATH)\n ? true\n : undefined;\n });\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Replaces a picker panel's \"no matches\" row — an icon, a sentence in the app's\n * own language, a \"clear the filter\" button.\n *\n * Context: `query` is the text that matched nothing.\n *\n * The row keeps `role=\"status\"`, so a reader is told the list emptied whatever\n * the template puts inside it.\n */\n@Directive({\n selector: '[dsEmptyTemplate]',\n standalone: true,\n})\nexport class DsEmptyTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\n/**\n * Focuses the field's inner `input`/`textarea` when the click lands on the\n * frame chrome — padding, a leading/trailing icon, an addon slot — instead of\n * the control itself. Applied to a field's wrapper element.\n *\n * `preventDefault` on that mousedown stops focus from bouncing off the\n * non-focusable chrome; clicks that land on the control, or on a nested\n * button/link/other input, are left untouched so caret placement, toggles and\n * projected controls keep working.\n */\n@Directive({\n selector: '[dsFieldClickFocus]',\n standalone: true,\n host: {\n '(mousedown)': 'onMousedown($event)',\n },\n})\nexport class FieldClickFocusDirective {\n private readonly host: HTMLElement = inject(ElementRef).nativeElement;\n\n protected onMousedown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n if (\n target.closest('input, textarea, button, a, select, [contenteditable]')\n ) {\n return;\n }\n const field = this.host.querySelector<\n HTMLInputElement | HTMLTextAreaElement\n >('input, textarea');\n if (field && !field.disabled && !field.readOnly) {\n event.preventDefault();\n field.focus();\n }\n }\n}\n","let nextId = 0;\n\n/** Process-wide counter for stable, SSR-safe control ids (no DOM dependency).\n * Replaces the per-component `let nextId = 0` pattern.\n * @internal\n */\nexport function nextControlId(prefix: string): string {\n return `${prefix}-${++nextId}`;\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills an option group's heading — a count beside the name, a team glyph, a\n * secondary line.\n *\n * Context: `$implicit` and `group` are the group itself, `count` how many of its\n * options survived the filter.\n *\n * The heading element stays the library's: it keeps the id that the group's\n * `aria-labelledby` points at, so replacing the text cannot detach a group from\n * its name.\n */\n@Directive({\n selector: '[dsGroupLabelTemplate]',\n standalone: true,\n})\nexport class DsGroupLabelTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills an option row's LABEL AREA in `ds-select`, `ds-multi-select` and\n * `ds-autocomplete` — an avatar, a colour dot, a second line of metadata.\n *\n * ```html\n * <ds-multi-select [options]=\"assignees()\">\n * <ng-template dsOptionTemplate let-option>\n * <ds-avatar size=\"xs\" [seed]=\"option.label\" /> {{ option.label }}\n * </ng-template>\n * </ds-multi-select>\n * ```\n *\n * The row itself stays library-owned: `role=\"option\"`, `aria-selected`, the\n * active-row class, the checkbox and the check glyph are not projected, so a\n * template cannot take the listbox semantics with it.\n */\n@Directive({\n selector: '[dsOptionTemplate]',\n standalone: true,\n})\nexport class DsOptionTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import type {\n FlexibleConnectedPositionStrategy,\n Overlay,\n OverlayConfig,\n OverlayRef,\n} from '@angular/cdk/overlay';\n\n/** Where a connected panel sits relative to its trigger. `_overlay-motion.scss`\n * maps this onto the enter direction, so the panel moves in FROM the trigger. */\nexport type DsOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\n/** The theme's role layer, forwarded onto every portaled pane alongside whatever\n * tokens the component names for itself. */\nconst ROLE_TOKENS = [\n '--ds-radius-inner',\n '--ds-radius-control',\n '--ds-radius-panel',\n '--ds-radius-pill',\n '--ds-elevation-raised',\n '--ds-elevation-overlay',\n '--ds-elevation-floating',\n '--ds-elevation-modal',\n] as const;\n\n/** Public enter-motion tokens read by every `ds-overlay-pane`\n * (styles/_overlay-motion.scss). */\nconst OVERLAY_MOTION_TOKENS = [\n '--ds-overlay-enter-keyframes',\n '--ds-overlay-enter-duration',\n '--ds-overlay-enter-easing',\n '--ds-overlay-enter-offset',\n '--ds-overlay-enter-scale',\n] as const;\n\n/** Styles `dropdownOverlay()`'s default panel class, so every connected picker\n * gets it whether or not it names panel tokens of its own. */\nconst DROPDOWN_PANEL_TOKENS = [\n '--ds-dropdown-panel-radius',\n '--ds-dropdown-panel-maxh',\n '--ds-option-padding',\n '--ds-option-gap',\n '--ds-option-radius',\n '--ds-option-row-gap',\n '--ds-option-bg-color-active',\n] as const;\n\n/**\n * Why a panel is closing. `'select'` is a deliberate action that produced a\n * result — an option chosen, a date picked, the trigger pressed again, Tab moving\n * on; `'dismiss'` is ambient — Escape, a press outside, the page scrolling away.\n * @internal\n */\nexport type DsOverlayCloseCause = 'select' | 'dismiss';\n\nconst DROPDOWN_GAP = 4;\n\n/**\n * The geometry every DS dropdown shares. Width is deliberately NOT set here —\n * each caller has its own policy (the exact trigger width, or the trigger as a\n * floor).\n * @internal\n */\nexport function dropdownOverlay(\n overlay: Overlay,\n trigger: HTMLElement,\n panelClass: string | string[] = ['ds-dropdown-panel', 'ds-overlay-pane'],\n): {\n positionStrategy: FlexibleConnectedPositionStrategy;\n config: OverlayConfig;\n} {\n const positionStrategy = overlay\n .position()\n .flexibleConnectedTo(trigger)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: DROPDOWN_GAP,\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetY: -DROPDOWN_GAP,\n },\n ]);\n\n return {\n positionStrategy,\n config: {\n positionStrategy,\n hasBackdrop: false,\n // The global panel skin lives in styles/_dropdown-overlay.scss: a portaled\n // node sits outside the host's DOM tree, so `:host ::ng-deep` cannot reach it.\n panelClass,\n scrollStrategy: overlay.scrollStrategies.reposition(),\n },\n };\n}\n\n// Backstop for the leave animation: if the class never produces an animation\n// (a pane that is display:none, a consumer stylesheet that removed it), the\n// panel must still go away. Comfortably past --ds-motion-exit-duration.\nconst LEAVE_TIMEOUT_MS = 400;\n\n/**\n * Close a DS overlay panel — instantly on a `'select'`, with a short fade on a\n * `'dismiss'`. A fade after a deliberate pick reads as the panel lagging behind a\n * decision already made; on a dismissal nothing was chosen, so the same fade reads\n * as the panel backing out.\n *\n * NOTE: teardown paths dispose directly instead — a destroyed host has no time to\n * animate, and `ModalService` owns its own scrim-and-card leave.\n * @internal\n */\nexport function disposeWithLeave(\n overlayRef: OverlayRef | null | undefined,\n cause: DsOverlayCloseCause = 'select',\n): void {\n if (!overlayRef) {\n return;\n }\n if (cause === 'select') {\n overlayRef.dispose();\n\n return;\n }\n\n const pane = overlayRef.overlayElement;\n let disposed = false;\n const finish = (): void => {\n if (disposed) {\n return;\n }\n disposed = true;\n clearTimeout(timer);\n pane.removeEventListener('animationend', onAnimationEnd);\n overlayRef.dispose();\n };\n // The pane's ROOT CHILD is what animates (CDK owns transforms on the pane\n // itself), so the event arrives from a descendant and bubbles up to here.\n const onAnimationEnd = (event: AnimationEvent): void => {\n if (event.animationName.endsWith('ds-overlay-out')) {\n finish();\n }\n };\n const timer = setTimeout(finish, LEAVE_TIMEOUT_MS);\n pane.addEventListener('animationend', onAnimationEnd);\n pane.classList.add('ds-leaving');\n}\n\n/**\n * Forward a portaled panel's public `--ds-*` override tokens from the component\n * host onto the overlay pane. The pane is portaled into `document.body`, outside\n * `:host`, so custom properties a consumer sets via `ds-x { … }` never inherit\n * down to it. Only non-empty values are set, so an unset token still falls\n * through to the panel's own `var(--ds-*, <default>)`. Call once per open, right\n * after `overlay.create()`.\n * @internal\n */\nexport function forwardOverlayTokens(\n overlayRef: OverlayRef,\n host: HTMLElement,\n tokens: readonly string[],\n): void {\n const hostStyle = getComputedStyle(host);\n const paneStyle = overlayRef.overlayElement.style;\n for (const token of tokens) {\n const value = hostStyle.getPropertyValue(token).trim();\n if (value) {\n paneStyle.setProperty(token, value);\n }\n }\n\n // Roles resolve at :root, so every host has a value for them and copying it\n // unconditionally would PIN it inline on the pane — an open panel would then\n // ignore a theme switch until it was reopened. Forward only where the host\n // actually overrides the root, which is the case the pane cannot see.\n const rootStyle = getComputedStyle(host.ownerDocument.documentElement);\n for (const token of ROLE_TOKENS) {\n const value = hostStyle.getPropertyValue(token).trim();\n if (value && value !== rootStyle.getPropertyValue(token).trim()) {\n paneStyle.setProperty(token, value);\n }\n }\n}\n\n/** Read a CDK connection pair as the panel's placement. `overlayY` is the panel\n * edge pinned to the trigger, so `top` means the panel hangs BELOW the trigger.\n * @internal\n */\nexport function overlayPlacementOf(\n overlayY: string,\n overlayX: string,\n): DsOverlayPlacement {\n if (overlayY === 'top') {\n return 'bottom';\n }\n if (overlayY === 'bottom') {\n return 'top';\n }\n if (overlayX === 'start') {\n return 'right';\n }\n\n return 'left';\n}\n\n/**\n * Prime a `ds-overlay-pane` for its enter animation. Call right after\n * `overlay.create()` — CDK applies the position in `afterNextRender`, so the\n * placement stamp still lands before the first painted frame. Until it does (or\n * with no strategy passed) the CSS default applies: entering from above.\n *\n * The subscription needs no teardown — disposing the overlay disposes the\n * strategy, which completes `positionChanges`.\n * @internal\n */\nexport function prepareOverlayEnter(\n overlayRef: OverlayRef,\n host: HTMLElement,\n positionStrategy?: FlexibleConnectedPositionStrategy,\n): void {\n forwardOverlayTokens(overlayRef, host, OVERLAY_MOTION_TOKENS);\n forwardOverlayTokens(overlayRef, host, DROPDOWN_PANEL_TOKENS);\n positionStrategy?.positionChanges.subscribe(({ connectionPair }) => {\n overlayRef.overlayElement.dataset['dsPlacement'] = overlayPlacementOf(\n connectionPair.overlayY,\n connectionPair.overlayX,\n );\n });\n}\n\n/** Close a non-modal overlay on a pointer press outside it, EXCEPT when the press\n * lands on its trigger — so the trigger stays interactive (caret, re-focus) while\n * open. Use with `hasBackdrop: false` so hover/cursor/pointer reach the live page.\n * @internal\n */\nexport function closeOnOutsidePointer(\n overlayRef: OverlayRef,\n isInsideTrigger: (target: Node) => boolean,\n close: () => void,\n): void {\n overlayRef.outsidePointerEvents().subscribe((event) => {\n const target = event.target as Node | null;\n if (target && isInsideTrigger(target)) {\n return;\n }\n close();\n });\n}\n\n/** Close a non-modal overlay when the page scrolls. CDK's scroll strategies only\n * observe `window` + registered `cdkScrollable`s, so they miss a plain\n * `overflow:auto` container (e.g. an app's scrolling `<main>`); this listens on\n * the document in the CAPTURE phase, which catches the non-bubbling `scroll`\n * event from ANY nested container. A scroll inside the panel itself is ignored.\n * @internal\n */\nexport function closeOnScroll(\n overlayRef: OverlayRef,\n close: () => void,\n): () => void {\n const onScroll = (event: Event): void => {\n const target = event.target as Node | null;\n if (target && overlayRef.overlayElement.contains(target)) {\n return;\n }\n // A form control scrolling its own text (e.g. typing past the visible edge\n // of a host-side filter input) never moves the panel's anchor — ignore it.\n if (\n target instanceof HTMLElement &&\n (target.tagName === 'INPUT' ||\n target.tagName === 'TEXTAREA' ||\n target.tagName === 'SELECT')\n ) {\n return;\n }\n close();\n };\n const doc = overlayRef.overlayElement.ownerDocument;\n doc.addEventListener('scroll', onScroll, true);\n\n return () => doc.removeEventListener('scroll', onScroll, true);\n}\n\n/**\n * Sync a component's \"which overlay is mine, and is it open\" state when THIS overlay detaches,\n * skipping the write when a newer one has already taken over.\n *\n * `disposeWithLeave` defers the dispose of a dismissed overlay until its exit animation ends, so a\n * dismiss followed by a re-open inside that window makes the OLD overlay's detachment arrive while\n * the NEW one is live. Clearing unconditionally then left that new panel on screen with its\n * component believing it was closed — no `aria-expanded`, and `close()` declining to run because\n * the ref it checks was already null, which is to say the panel could not be dismissed at all.\n * Measured in ds-date-picker, ds-color-picker, ds-time-picker and ds-popover; ds-select,\n * ds-autocomplete and ds-multi-select each carried the check by hand, and the four that did not\n * are why it lives here instead.\n *\n * A detachment of the CURRENT overlay always clears, whatever caused it — so a stray CDK detach\n * still releases a reopen guard that keys off the stored ref rather than wedging it.\n * @internal\n */\nexport function clearOnDetach(\n overlayRef: OverlayRef,\n {\n current,\n clear,\n always,\n }: {\n /** Reads the ref the component considers live right now. */\n current: () => OverlayRef | null;\n /** Drops the stored ref and marks the component closed. */\n clear: () => void;\n /** Teardown that must run for every detachment, current or superseded. */\n always?: () => void;\n },\n): void {\n overlayRef.detachments().subscribe(() => {\n always?.();\n if (current() !== overlayRef) {\n return;\n }\n clear();\n });\n}\n\n/** True when keyboard focus currently sits inside the overlay pane. Read it\n * BEFORE disposing, to decide whether the close has to refocus the trigger\n * rather than strand focus on `<body>`. An outside-pointer close leaves focus on\n * the clicked element (mousedown moved it out of the pane first), so this\n * returns false there and focus is correctly left alone.\n * @internal\n */\nexport function focusIsInside(overlayRef: OverlayRef): boolean {\n const doc = overlayRef.overlayElement.ownerDocument;\n\n return overlayRef.overlayElement.contains(doc.activeElement);\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills a strip below a picker panel's option list — a \"create new\" affordance\n * of your own, a count, a link, an apply button for a panel the user batches\n * choices in.\n *\n * Context: the same as the header slot — `count`, `total`, `query`.\n *\n * Like the header it sits OUTSIDE the `listbox` and does not scroll with the\n * options. Anything focusable you put here is reached by Tab from the panel, so\n * give it an accessible name.\n */\n@Directive({\n selector: '[dsPanelFooterTemplate]',\n standalone: true,\n})\nexport class DsPanelFooterTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills a strip above a picker panel's option list — \"3 of 40 selected\", a\n * \"clear all\" button, a hint, a link to a fuller search.\n *\n * Context: `count` is how many options are visible after filtering, `total` how\n * many were given, and `query` the text that narrowed them.\n *\n * It sits OUTSIDE the `listbox`, so whatever you put here is not counted as an\n * option and does not break a screen reader's \"N of M\" position reporting. It\n * also stays put while the list scrolls under it — the panel clips and the list\n * is the scroller.\n */\n@Directive({\n selector: '[dsPanelHeaderTemplate]',\n standalone: true,\n})\nexport class DsPanelHeaderTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { type Signal, effect, inject, DOCUMENT } from '@angular/core';\n\n/**\n * Announces how many options survived the filter.\n *\n * Deliberately NOT a row inside the listbox. A live region there is an invalid\n * child and, worse, a region created together with its text is the case screen\n * readers reliably do not announce — there is no content CHANGE to fire on. The\n * node here is created once, empty, and only its text changes.\n *\n * The text is English, which is the same debt every other library-invented string\n * in this package carries (see the localization item in `docs/todo.md`). It is a\n * count, so it is the cheapest of them to swap once a provider lands.\n * @internal\n */\nexport function announceOptionCount(\n count: Signal<number>,\n active: Signal<boolean>,\n): void {\n const documentRef = inject(DOCUMENT);\n const region = documentRef.createElement('div');\n region.setAttribute('aria-live', 'polite');\n region.setAttribute('aria-atomic', 'true');\n // Off-screen rather than `display: none`, which would take it out of the\n // accessibility tree and announce nothing at all.\n region.style.cssText =\n 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;margin:-1px;padding:0';\n documentRef.body.appendChild(region);\n\n effect((onCleanup) => {\n onCleanup(() => region.remove());\n if (!active()) {\n region.textContent = '';\n\n return;\n }\n const total = count();\n region.textContent =\n total === 0\n ? 'No results'\n : total === 1\n ? '1 result'\n : `${total} results`;\n });\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Replaces the CONTENTS of a picker's trigger — the chips, the value, the\n * placeholder — with your own markup. The trigger ELEMENT stays library-owned,\n * so `aria-haspopup`, `aria-expanded`, `aria-controls`, the roving\n * `aria-activedescendant` and the Enter/Space/ArrowDown/Escape handling cannot\n * be lost with it.\n *\n * ```html\n * <ds-multi-select [options]=\"labels()\" [(value)]=\"picked\">\n * <ng-template dsPickerTrigger let-count=\"count\">\n * Labels @if (count) { <ds-badge [count]=\"count\" /> }\n * </ng-template>\n * </ds-multi-select>\n * ```\n *\n * Context: `$implicit` and `selected` are the selected options, `count` their\n * number, `open` whether the panel is showing, `disabled` the control's state.\n *\n * A projected template WINS over `triggerDisplay` — that input is then not read\n * at all, so there is no \"compact plus a template\" combination to explain.\n */\n@Directive({\n selector: '[dsPickerTrigger]',\n standalone: true,\n})\nexport class DsPickerTriggerDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import {\n Directive,\n ElementRef,\n afterNextRender,\n inject,\n input,\n} from '@angular/core';\n\n/**\n * Dev-only guard for a component that DROPS whatever is projected into it, so the\n * author gets a warning instead of silence — there is no compile-time signal for\n * content a component chooses to ignore. Put it on a probe around the\n * `<ng-content>`, gated on dev mode so production renders no extra node:\n *\n * ```html\n * @if (devMode) {\n * <span dsProjectionDropped=\"ds-filter-bar\"><ng-content></ng-content></span>\n * }\n * ```\n *\n * It is NOT projection support: the probe exists so the warning can see that\n * content arrived, and then hides it.\n *\n * `ds-filter-bar` is the only host today.\n *\n * `reason` replaces the default `[label]` wording for a host that drops content\n * for a different reason — `ds-filter-bar` drops anything that carries neither of\n * its slot attributes.\n * @internal\n */\n@Directive({\n selector: '[dsProjectionDropped]',\n standalone: true,\n host: { style: 'display: none' },\n})\nexport class ProjectionDroppedDirective {\n /** The host component's selector, named in the warning. */\n readonly dsProjectionDropped = input.required<string>();\n /** Overrides the `[label]` explanation for a host that drops content for\n * another reason. Ends up after \"renders nothing — \". */\n readonly reason = input<string>('');\n\n private readonly probe = inject(ElementRef<HTMLElement>);\n\n constructor() {\n afterNextRender(() => {\n if (!this.probe.nativeElement.textContent?.trim()) {\n return;\n }\n const selector = this.dsProjectionDropped();\n const reason =\n this.reason() ||\n `the caption comes from the [label] input only, so \\`<${selector}>Some text</${selector}>\\` shows no caption at all. Move the text into [label].`;\n console.warn(\n `[${selector}] Projected content renders nothing — ${reason}`,\n );\n });\n }\n}\n","import {\n type Signal,\n afterRenderEffect,\n inject,\n DOCUMENT,\n} from '@angular/core';\n\n/**\n * Keeps the keyboard cursor's row visible inside a scrolling panel.\n *\n * KEYBOARD ONLY, and that is the load-bearing part. The option rows also set the\n * active index on `mouseenter`, so a version that reacted to every change pulled\n * a partially visible row up under the pointer while the user was reading with\n * the mouse.\n *\n * Rows are looked up by id rather than through a `viewChildren` query because they\n * live in a portaled template — and the id is the one `aria-activedescendant`\n * already points at, so a failed lookup means that reference is broken too.\n * @internal\n */\nexport function scrollActiveOptionIntoView(\n activeDescendantId: Signal<string | null>,\n enabled: Signal<boolean>,\n armed: Signal<boolean>,\n): void {\n const documentRef = inject(DOCUMENT);\n\n afterRenderEffect(() => {\n const id = activeDescendantId();\n if (!enabled() || !armed() || !id) {\n return;\n }\n documentRef\n .getElementById(id)\n ?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n });\n}\n","import { Directive, booleanAttribute, input } from '@angular/core';\n\n/** Showcase-only: renders the component's open/overlay surface inline in normal\n * flow instead of its real overlay mechanics (for static docs specimens).\n * Not part of the production contract. */\n@Directive({ standalone: true })\nexport class DsStaticPreview {\n readonly staticPreview = input(false, { transform: booleanAttribute });\n}\n","/**\n * The jump-to-option-by-typing that a native `<select>` has and ours did not.\n *\n * Typing \"ba\" on a closed control moves to the first option starting with \"ba\",\n * and keeps extending the buffer while the user keeps typing. The timeout is what\n * separates \"ba\" from two separate \"b\" and \"a\" presses; 500ms is the interval\n * every native control and APG example uses.\n */\nconst RESET_AFTER_MS = 500;\n\nexport interface DsTypeAhead {\n /** Feed it a keypress. Returns the index to move to, or -1 when the key is not\n * a character or nothing matches. */\n match: (key: string, labels: readonly string[], from: number) => number;\n}\n\n/** @internal */\nexport function createTypeAhead(): DsTypeAhead {\n let buffer = '';\n let last = 0;\n\n return {\n match(key, labels, from) {\n // A modifier combination and any named key (\"Enter\", \"ArrowDown\") are not\n // text; only a single printable character extends the buffer.\n if (key.length !== 1 || !/\\S/.test(key)) {\n return -1;\n }\n\n const now = Date.now();\n buffer = now - last > RESET_AFTER_MS ? key : buffer + key;\n last = now;\n\n const query = buffer.toLowerCase();\n const cycling =\n buffer.length > 1 &&\n [...buffer].every((character) => character === buffer[0]);\n const needle = cycling ? buffer[0].toLowerCase() : query;\n const start = cycling || buffer.length === 1 ? from + 1 : 0;\n\n for (let offset = 0; offset < labels.length; offset += 1) {\n const index = (start + offset + labels.length) % labels.length;\n if (labels[index].toLowerCase().startsWith(needle)) {\n return index;\n }\n }\n\n return -1;\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;;;;;;AASG;AACG,SAAU,iBAAiB,CAC/B,KAA4B,EAC5B,GAAsC,EAAA;AAEtC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAEhC,IAAA,OAAO,QAAQ,CAAC,MAAM,KAAK,EAAE,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;AAC7D;;ACpBA;AACA;AACA;AAEA;AACuC;AAChC,MAAM,WAAW,GAAG;AACzB,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,aAAa,EAAE,sCAAsC;AACrD,IAAA,YAAY,EAAE,qCAAqC;AACnD,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;;AAGvC;AACO,MAAM,mBAAmB,GAAsB;AACpD,IAAA,WAAW,CAAC,OAAO;AACnB,IAAA,WAAW,CAAC,OAAO;AACnB,IAAA,WAAW,CAAC,OAAO;AACnB,IAAA,WAAW,CAAC,OAAO;AACnB,IAAA,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AAA,MAAM,GAAG,GAAG,GAAG,IAAI,GAAG,cAAc,GAAG,GAAG,GAAG,MAAM,GAAG,GAAG;YACzD,IAAI,GAAG,GAAG;AAEV,YAAA,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,EAAE;AAClC,YAAA,MAAM,OAAO,GACX,MAAM,CAAC,MAAM,GAAG,CAAC;AACjB,gBAAA,CAAC,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,SAAS,KAAK,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;AAC3D,YAAA,MAAM,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK;AACxD,YAAA,MAAM,KAAK,GAAG,OAAO,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC;AAE3D,YAAA,KAAK,IAAI,MAAM,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,EAAE;AACxD,gBAAA,MAAM,KAAK,GAAG,CAAC,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM;AAC9D,gBAAA,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE;AAClD,oBAAA,OAAO,KAAK;gBACd;YACF;YAEA,OAAO,CAAC,CAAC;QACX,CAAC;KACF;AACH;;AClDA;;AAEG;;;;"}
1
+ {"version":3,"file":"ids-group-ltd-ids-design-system-components.mjs","sources":["../../../src/lib/components/brand-defaults.ts","../../../src/lib/components/chart-palette.generated.ts","../../../src/lib/components/charts-format.ts","../../../src/lib/components/charts-measure.ts","../../../src/lib/components/charts-scale.ts","../../../src/lib/components/charts-motion.ts","../../../src/lib/components/charts-roving.ts","../../../src/lib/components/charts-summary.ts","../../../src/lib/components/chip-overflow.ts","../../../src/lib/components/chip-template.directive.ts","../../../src/lib/components/field-defaults.ts","../../../src/lib/components/field-errors.ts","../../../src/lib/components/message-base.ts","../../../src/lib/components/field-base.ts","../../../src/lib/components/control-value-accessor.ts","../../../src/lib/components/create-template.directive.ts","../../../src/lib/components/destination.ts","../../../src/lib/components/empty-template.directive.ts","../../../src/lib/components/field-click-focus.directive.ts","../../../src/lib/components/field-ids.ts","../../../src/lib/components/group-label-template.directive.ts","../../../src/lib/components/option-template.directive.ts","../../../src/lib/components/overlay-motion.ts","../../../src/lib/components/panel-footer-template.directive.ts","../../../src/lib/components/panel-header-template.directive.ts","../../../src/lib/components/picker-announcer.ts","../../../src/lib/components/picker-trigger.directive.ts","../../../src/lib/components/projection-dropped.directive.ts","../../../src/lib/components/scroll-active-option.ts","../../../src/lib/components/static-preview.directive.ts","../../../src/lib/components/type-ahead.ts","../../../src/lib/components/ids-group-ltd-ids-design-system-components.ts"],"sourcesContent":["import { Signal, computed, inject } from '@angular/core';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\n\n/**\n * Resolve one brand string against the app-level default. `ds-sidenav` and\n * `ds-auth-layout` ask the same three questions and an app answers them\n * identically on every screen, so the answer belongs in one provider rather than\n * in four bindings per template.\n *\n * Same `null`-means-unset shape as `resolveReserveMessage` — here `''` is an\n * explicit \"this screen has no brand\", and each field resolves on its own.\n * @internal\n */\nexport function resolveBrandValue(\n value: Signal<string | null>,\n key: 'name' | 'logoLetter' | 'tagline',\n): Signal<string> {\n const config = inject(DS_CONFIG);\n\n return computed(() => value() ?? config.brand?.[key] ?? '');\n}\n","// GENERATED by tools/generate-chart-palette.mjs. Do not edit. Values are var()\n// references, not resolved colours, so a consumer overriding the token still wins\n// at runtime.\n\n/** @internal Exported for the chart entry points that import it across the boundary;\n * not part of the package surface. */\nexport const chartColors = {\n series1: 'var(--ds-chart-series-1-color)',\n series2: 'var(--ds-chart-series-2-color)',\n series3: 'var(--ds-chart-series-3-color)',\n series4: 'var(--ds-chart-series-4-color)',\n series5: 'var(--ds-chart-series-5-color)',\n series6: 'var(--ds-chart-series-6-color)',\n series7: 'var(--ds-chart-series-7-color)',\n series8: 'var(--ds-chart-series-8-color)',\n seriesDefault: 'var(--ds-chart-series-default-color)',\n seriesAccent: 'var(--ds-chart-series-accent-color)',\n ramp1: 'var(--ds-chart-ramp-1-color)',\n ramp2: 'var(--ds-chart-ramp-2-color)',\n ramp3: 'var(--ds-chart-ramp-3-color)',\n ramp4: 'var(--ds-chart-ramp-4-color)',\n ramp5: 'var(--ds-chart-ramp-5-color)',\n ramp6: 'var(--ds-chart-ramp-6-color)',\n ramp7: 'var(--ds-chart-ramp-7-color)',\n ramp8: 'var(--ds-chart-ramp-8-color)',\n} as const;\n\n/** @internal See chartColors. */\nexport const CHART_SERIES_COLORS: readonly string[] = [\n chartColors.series1,\n chartColors.series2,\n chartColors.series3,\n chartColors.series4,\n chartColors.series5,\n chartColors.series6,\n chartColors.series7,\n chartColors.series8,\n];\n\n/** @internal See chartColors. */\nexport const CHART_RAMP_COLORS: readonly string[] = [\n chartColors.ramp1,\n chartColors.ramp2,\n chartColors.ramp3,\n chartColors.ramp4,\n chartColors.ramp5,\n chartColors.ramp6,\n chartColors.ramp7,\n chartColors.ramp8,\n];\n","const numberFormatters = new Map<string, Intl.NumberFormat>();\n\nfunction numberFormatter(locale: string | undefined): Intl.NumberFormat {\n const key = locale ?? 'default';\n let formatter = numberFormatters.get(key);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale);\n numberFormatters.set(key, formatter);\n }\n\n return formatter;\n}\n\n/** @internal */\nexport function formatValue(value: number, locale?: string): string {\n if (!Number.isFinite(value)) {\n return '—';\n }\n\n return numberFormatter(locale).format(value);\n}\n\n/** @internal */\nexport function formatPercent(value: number, total: number): string {\n if (!total || !Number.isFinite(value) || !Number.isFinite(total)) {\n return '—';\n }\n\n const percent = (value / total) * 100;\n // A real share must never print as an exact zero: at one decimal, 214 of 987,654,321 rounds to\n // \"0.0%\" beside a bar too short to see, and the row reads as nothing when it is not nothing.\n if (percent !== 0 && Math.abs(percent) < 0.05) {\n return percent > 0 ? '<0.1%' : '>-0.1%';\n }\n\n return `${percent.toFixed(1)}%`;\n}\n\n/** Whole percentages that sum to exactly 100. Rounding each share on its own\n * gives 33/33/33 for three equal parts, and a legend that visibly loses 1%.\n *\n * @internal Exported for the chart entry points; not part of the package surface. */\nexport function largestRemainder(values: readonly number[]): number[] {\n const total = values.reduce((sum, value) => sum + value, 0);\n if (!total) {\n return values.map(() => 0);\n }\n const exact = values.map((value) => (value / total) * 100);\n const floors = exact.map(Math.floor);\n let remaining = 100 - floors.reduce((sum, value) => sum + value, 0);\n const order = exact\n .map((value, index) => ({ index, fraction: value - Math.floor(value) }))\n .sort((a, b) => b.fraction - a.fraction);\n const result = [...floors];\n for (const { index } of order) {\n if (remaining <= 0) {\n break;\n }\n result[index]++;\n remaining--;\n }\n\n return result;\n}\n\n/** @internal */\nexport function formatTick(value: number, step: number): string {\n if (!Number.isFinite(value)) {\n return '';\n }\n if (Math.abs(value) < 1000) {\n return String(value);\n }\n\n // The unit follows the STEP, not the value, so every label on one axis carries the same suffix:\n // a step of 200M labels 1e9 as 1000M, never 1B beside 800M.\n const units = [\n { suffix: 'B', scale: 1e9 },\n { suffix: 'M', scale: 1e6 },\n { suffix: 'K', scale: 1e3 },\n ];\n const unit =\n units.find((candidate) => Math.abs(step) >= candidate.scale) ?? units[2];\n const scaled = value / unit.scale;\n\n // A step that divides its unit evenly needs no decimal; one that does not needs exactly one on\n // EVERY label, so an axis reads 1.0K · 1.5K · 2.0K rather than mixing 1K with 1.5K. Rounding the\n // whole branch matters too: a caller passing a raw datum instead of a tick would otherwise print\n // every digit of the division, as 987.654321M.\n return step % unit.scale === 0\n ? `${Math.round(scaled)}${unit.suffix}`\n : `${scaled.toFixed(1)}${unit.suffix}`;\n}\n\n/** One mark's share of the total its siblings add up to.\n *\n * A single-series category chart prints every mark's own value beside it, so a tooltip repeating\n * that number tells the reader nothing they are not already looking at. The share is arithmetic\n * the reader should not have to do. Empty for a lone mark, and empty for a reading that is not\n * part of a total anyone can see: negatives and non-finite values are excluded from the total\n * rather than subtracted from it.\n *\n * @internal */\nexport function describeShare(\n values: readonly number[],\n index: number,\n): string {\n const value = values[index];\n if (values.length < 2 || !Number.isFinite(value) || value <= 0) {\n return '';\n }\n const total = values\n .filter((entry) => Number.isFinite(entry) && entry > 0)\n .reduce((sum, entry) => sum + entry, 0);\n\n return total > 0 ? `${formatPercent(value, total)} of total` : '';\n}\n","import {\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n Signal,\n inject,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\n\n/** Container width as a signal. It is 0 under SSR, while the container is\n * `display: none`, and before the first observation.\n *\n * @internal */\nexport function elementWidth(host: ElementRef<HTMLElement>): Signal<number> {\n const width = signal(0);\n if (!isPlatformBrowser(inject(PLATFORM_ID))) {\n return width.asReadonly();\n }\n\n const observer = new ResizeObserver((entries) => {\n width.set(Math.round(entries[0]?.contentRect.width ?? 0));\n });\n observer.observe(host.nativeElement);\n inject(DestroyRef).onDestroy(() => observer.disconnect());\n\n return width.asReadonly();\n}\n","const E10 = Math.sqrt(50);\nconst E5 = Math.sqrt(10);\nconst E2 = Math.sqrt(2);\n\n/** d3's tick-increment rule. A naive `max / count` produces steps like 482, which\n * no reader parses; this snaps to 1, 2, 5 or 10 times a power of ten. */\nfunction tickIncrement(domainMax: number, targetCount: number): number {\n const step = domainMax / Math.max(1, targetCount);\n const power = Math.floor(Math.log10(step));\n const error = step / Math.pow(10, power);\n const factor = error >= E10 ? 10 : error >= E5 ? 5 : error >= E2 ? 2 : 1;\n\n return factor * Math.pow(10, power);\n}\n\n/** @internal */\nexport function tickValues(domainMax: number, targetCount: number): number[] {\n if (!Number.isFinite(domainMax) || domainMax <= 0) {\n return [0];\n }\n const step = tickIncrement(domainMax, targetCount);\n const out: number[] = [];\n for (let i = 0; i <= Math.ceil(domainMax / step); i++) {\n out.push(i * step);\n }\n\n return out;\n}\n\n/** @internal */\nexport function niceMax(domainMax: number, targetCount: number): number {\n if (!Number.isFinite(domainMax) || domainMax <= 0) {\n return 0;\n }\n const step = tickIncrement(domainMax, targetCount);\n\n return Math.ceil(domainMax / step) * step;\n}\n\n/** Distance between two ticks, which `formatTick` needs to pick a precision. A\n * degenerate series yields a single tick and therefore no step.\n *\n * @internal */\nexport function tickStep(ticks: readonly number[]): number {\n return ticks.length > 1 ? ticks[1] - ticks[0] : 0;\n}\n\n/** @internal */\nexport function linearScale(\n domainMax: number,\n rangeSize: number,\n): (value: number) => number {\n if (!Number.isFinite(domainMax) || domainMax <= 0) {\n return () => 0;\n }\n\n return (value) => (value / domainMax) * rangeSize;\n}\n\n/** @internal */\nexport interface BandScale {\n readonly bandWidth: number;\n /** Centre to centre, so it exceeds `bandWidth` by the padding. */\n readonly step: number;\n readonly count: number;\n position(index: number): number;\n /** The band an offset falls in, clamped at both ends so a pointer leaving the plot\n * keeps the band it left from. `-1` when there are no bands, which is the one case\n * a caller branches on rather than clamps. */\n indexAt(offset: number): number;\n}\n\n/** @internal */\nexport function bandScale(\n count: number,\n rangeSize: number,\n paddingRatio: number,\n): BandScale {\n if (count <= 0) {\n return {\n bandWidth: 0,\n step: 0,\n count: 0,\n position: () => 0,\n indexAt: () => -1,\n };\n }\n const step = rangeSize / count;\n const bandWidth = step * (1 - paddingRatio);\n\n return {\n bandWidth,\n step,\n count,\n position: (index) => step * index + (step - bandWidth) / 2,\n indexAt: (offset) =>\n Math.min(count - 1, Math.max(0, Math.floor(offset / step))),\n };\n}\n","// Past this the entrance stops reading as one gesture and starts reading as a queue: at 40ms a\n// 100-mark series would otherwise take four seconds to finish arriving.\nconst STAGGER_CAP_MS = 300;\n\n/** Entrance delay for the mark at `index`, in milliseconds. `stepMs` of `0` is the default and\n * means no stagger at all.\n *\n * @internal */\nexport function staggerDelay(index: number, stepMs: number): number {\n if (!(stepMs > 0) || !Number.isFinite(index) || index <= 0) {\n return 0;\n }\n\n return Math.min(index * stepMs, STAGGER_CAP_MS);\n}\n","/** Where a roving tabindex lands after `key`, or `null` when the key does not traverse.\n *\n * The ends wrap, as they do in `ds-radio-group`: a chart's marks are a closed set, and Home and\n * End are the direct way to either extreme.\n *\n * @internal */\nexport function nextRovingIndex(\n key: string,\n current: number,\n count: number,\n): number | null {\n if (!Number.isFinite(count) || count <= 0) {\n return null;\n }\n switch (key) {\n case 'ArrowRight':\n case 'ArrowDown':\n return (current + 1) % count;\n case 'ArrowLeft':\n case 'ArrowUp':\n return (current - 1 + count) % count;\n case 'Home':\n return 0;\n case 'End':\n return count - 1;\n default:\n return null;\n }\n}\n\n/** Moves DOM focus to the mark `index` within `scope`, which is what makes the roving tabindex a\n * traversal rather than a state change nobody can see. `within` narrows the search for a chart\n * whose marks repeat the same index once per series.\n *\n * @internal */\nexport function focusMark(\n scope: Element | null,\n index: number,\n within = '',\n): void {\n const target = scope?.querySelector(`${within}[data-mark-index=\"${index}\"]`);\n if (target instanceof HTMLElement || target instanceof SVGElement) {\n target.focus();\n }\n}\n","import { formatValue } from './charts-format';\n\n/** @internal */\nexport interface SummaryPoint {\n readonly label: string;\n readonly value: number;\n}\n\nfunction trendOf(values: readonly number[]): string {\n const first = values[0];\n const last = values[values.length - 1];\n const rose = values.every(\n (value, index) => index === 0 || value > values[index - 1],\n );\n const fell = values.every(\n (value, index) => index === 0 || value < values[index - 1],\n );\n if (rose) {\n return 'Rising throughout';\n }\n if (fell) {\n return 'Falling throughout';\n }\n if (last > first) {\n return 'Rising overall';\n }\n if (last < first) {\n return 'Falling overall';\n }\n\n return 'Ending where it started';\n}\n\n/** The sentence a screen reader gets as the chart's accessible name. Generated rather than\n * required, because a required one is a field that gets left at the component's default and then\n * lies.\n *\n * The ORDER is the contract: what the chart is and its scale, then the trend, then the extremes,\n * then where the numbers are. Blind readers rank a recital of the encoding lowest of the four\n * levels of chart description, and the encoding is the one thing a screen-reader user cannot use.\n *\n * @internal */\nexport function describeSeries(\n label: string,\n points: readonly SummaryPoint[],\n format: (value: number) => string = formatValue,\n tableFollows = true,\n): string {\n const pointer = tableFollows ? ' Full values in the table below.' : '';\n if (points.length === 0) {\n return `${label}. No data.`;\n }\n if (points.length === 1) {\n return `${label}, one point: ${format(points[0].value)} at ${points[0].label}.${pointer}`;\n }\n const lowest = points.reduce((min, point) =>\n point.value < min.value ? point : min,\n );\n const highest = points.reduce((max, point) =>\n point.value > max.value ? point : max,\n );\n\n return (\n `${label}, ${points.length} points, ` +\n `${format(lowest.value)} to ${format(highest.value)}. ` +\n `${trendOf(points.map((point) => point.value))}. ` +\n `Highest in ${highest.label} at ${format(highest.value)}, ` +\n `lowest in ${lowest.label} at ${format(lowest.value)}.${pointer}`\n );\n}\n","import {\n ElementRef,\n Signal,\n afterRenderEffect,\n computed,\n signal,\n untracked,\n} from '@angular/core';\n\n/**\n * @fileoverview How many chips fit one line of a trigger, measured rather than\n * guessed.\n *\n * INVARIANT: nothing here may measure something the cut itself changes, or the\n * measurement feeds back into its own input and the split never settles — a hung\n * page, not a wrong number. Hence the budget comes off the trigger's PARENT\n * content box (the trigger's own width is the fallback for when there is no usable\n * parent), never the row, and the \"+N more\" marker gets a fixed reserve rather\n * than a measurement.\n *\n * The caller owes two things: chips carry `data-chip`, and they sit in a row of\n * their own that is a direct child of the trigger. `enabled` gates the whole thing\n * because measuring forces layout.\n */\n\n/**\n * Null when the host cannot supply a budget: a detached node, an inline one with no content box,\n * or one whose own width DEPENDS on the trigger — which would feed the cut back into its own\n * input.\n *\n * That last one is asked of layout, not read off a style: `getComputedStyle().width` is a used\n * pixel value, so the `fit-content` a consumer wrote is not readable back. Pinning the trigger to\n * zero and re-reading the host tests it directly — a host sized by its own parent does not move,\n * one sized by its content collapses — at the cost of a second forced layout.\n */\nfunction hostContentWidth(\n host: HTMLElement | null,\n trigger: HTMLElement,\n): number | null {\n if (!host || host.clientWidth === 0) {\n return null;\n }\n const styles = getComputedStyle(host);\n if (styles.display === 'inline') {\n return null;\n }\n\n const before = host.clientWidth;\n const pinned = trigger.style.width;\n trigger.style.width = '0px';\n const dependsOnTrigger = host.clientWidth !== before;\n trigger.style.width = pinned;\n if (dependsOnTrigger) {\n return null;\n }\n\n return (\n before - parseFloat(styles.paddingLeft) - parseFloat(styles.paddingRight)\n );\n}\n\n/** Room held for \"+N more\", in em so a retuned type scale carries. Measured at\n * 4.5em wide with three digits; 5em keeps a chip from being dropped for a pixel. */\nconst MARKER_RESERVE_EM = 5;\n\n/** What a sibling of the chip row costs the chips. One that can grow gives back\n * what it does not use, so only its floor is owed; anything else owes its box. */\nfunction reservedWidth(element: HTMLElement): number {\n const styles = getComputedStyle(element);\n\n return parseFloat(styles.flexGrow) > 0\n ? parseFloat(styles.minWidth) || 0\n : element.offsetWidth;\n}\n\n/** @internal */\nexport function chipFit(\n count: Signal<number>,\n chipRow: Signal<ElementRef<HTMLElement> | undefined>,\n enabled: Signal<boolean>,\n /** The whole selection, which `count` may already cap. */\n selectionSize: Signal<number> = count,\n): Signal<number> {\n const available = signal(0);\n const gap = signal(0);\n const markerReserve = signal(0);\n /** Widths of ALL chips, from the last render that held all of them. */\n const chipWidths = signal<readonly number[]>([]);\n /** `count` at that render, so a stale cache is never trusted. */\n const measuredFor = signal(-1);\n /** Geometry the last measure ran against, to skip one that would repeat it.\n * Each forces layout: without this guard a single docs page load measured 214\n * times across seven pickers. */\n let lastWidth = -1;\n let lastCount = -1;\n\n const measure = (row: HTMLElement): void => {\n const trigger = row.parentElement;\n if (!trigger) {\n return;\n }\n\n // A trigger that hugs its content (`width: fit-content`, which both compact\n // modes set) has a width decided by the chips this cut removes, so reading it\n // feeds the result back into its own input. The parent's content box is the\n // space actually available and does not move when the chips do; for a `fill`\n // trigger the two are the same number.\n //\n // The fallback is that same feedback loop, so it is a last resort, not a default: it runs\n // only when the host cannot answer at all.\n const host = trigger.parentElement;\n const budget = hostContentWidth(host, trigger) ?? trigger.clientWidth;\n\n const width = budget;\n const currentCount = untracked(count);\n const cacheIsCurrent = untracked(measuredFor) === currentCount;\n if (width === lastWidth && currentCount === lastCount && cacheIsCurrent) {\n return;\n }\n lastWidth = width;\n lastCount = currentCount;\n\n const triggerStyles = getComputedStyle(trigger);\n const columnGap = parseFloat(triggerStyles.columnGap) || 0;\n let free =\n budget -\n parseFloat(triggerStyles.paddingLeft) -\n parseFloat(triggerStyles.paddingRight) -\n parseFloat(triggerStyles.borderLeftWidth) -\n parseFloat(triggerStyles.borderRightWidth);\n for (const sibling of trigger.children) {\n if (sibling !== row) {\n free -= reservedWidth(sibling as HTMLElement) + columnGap;\n }\n }\n\n gap.set(columnGap);\n available.set(free);\n markerReserve.set(\n MARKER_RESERVE_EM * parseFloat(getComputedStyle(row).fontSize),\n );\n\n const chips = row.querySelectorAll<HTMLElement>('[data-chip]');\n // A partial render is the previous cut, not the selection: caching it would\n // keep only the survivors' widths, and the row could never grow back.\n if (chips.length === untracked(count)) {\n chipWidths.set([...chips].map((chip) => chip.offsetWidth));\n measuredFor.set(untracked(count));\n }\n };\n\n afterRenderEffect((onCleanup) => {\n const row = chipRow()?.nativeElement;\n if (!enabled() || !row) {\n return;\n }\n const observer = new ResizeObserver(() => measure(row));\n // The trigger, not the row: the row's box follows the cut, so observing it\n // would report this function's own output back to it.\n observer.observe(row.parentElement ?? row);\n onCleanup(() => observer.disconnect());\n });\n\n // A selection change does not resize the trigger, so it drives its own measure.\n afterRenderEffect(() => {\n count();\n const row = chipRow()?.nativeElement;\n if (enabled() && row) {\n measure(row);\n }\n });\n\n return computed<number>(() => {\n const total = count();\n if (!enabled()) {\n return total;\n }\n const widths = chipWidths();\n // Until the widths for THIS selection are in, render all of them: that render\n // is what gets measured, and the row clips it until the cut lands.\n if (measuredFor() !== total || available() <= 0) {\n return total;\n }\n\n let used = 0;\n for (let index = 0; index < widths.length; index++) {\n const next = used + widths[index] + (index > 0 ? gap() : 0);\n // The marker is only owed room once something is actually hidden, so the\n // last chip may spend what the marker would have taken — but only if this\n // really is the end of the selection, not the end of a capped slice.\n const isLast =\n index === widths.length - 1 && selectionSize() <= widths.length;\n const budget = isLast\n ? available()\n : available() - markerReserve() - gap();\n if (next > budget) {\n // One chip always shows: a trigger too narrow for even that is a layout\n // bug upstream, and 0 would render a bare \"+N\" with nothing to anchor it.\n return Math.max(1, index);\n }\n used = next;\n }\n\n return total;\n });\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills a selected chip's content in the trigger of `ds-multi-select` and\n * `ds-autocomplete`, so a picker whose rows carry an avatar does not lose it the\n * moment the option is chosen.\n *\n * The chip is still a `ds-tag` owned by the library: its close button, its\n * accessible remove label and the measured overflow cap are not projected.\n */\n@Directive({\n selector: '[dsChipTemplate]',\n standalone: true,\n})\nexport class DsChipTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { Signal, computed, inject } from '@angular/core';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\n\n/**\n * Resolve a field's `reserveMessage` against the app-level default.\n *\n * Fields declare the input as `boolean | null` with a `null` default so \"not set\"\n * stays distinguishable from an explicit `true` — a signal input cannot report\n * whether it was bound. Precedence: the component input, then\n * `DS_CONFIG.field.reserveMessage`, then `false`.\n *\n * Call from a field initializer (an injection context), e.g.\n * `protected readonly reserve = resolveReserveMessage(this.reserveMessage);`\n */\nexport function resolveReserveMessage(\n reserveMessage: Signal<boolean | null>,\n): Signal<boolean> {\n const config = inject(DS_CONFIG);\n\n return computed(\n () => reserveMessage() ?? config.field?.reserveMessage ?? false,\n );\n}\n","import {\n DestroyRef,\n Injector,\n Signal,\n afterNextRender,\n computed,\n inject,\n isDevMode,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n FormGroupDirective,\n NgControl,\n NgForm,\n type ValidationErrors,\n} from '@angular/forms';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\nimport type { FieldMessageState } from '@ids-group-ltd/ids-design-system/components/field-message';\n\n/**\n * One validation error, structurally identical to Angular's signal-forms\n * `ValidationError`.\n *\n * Declared here rather than imported from `@angular/forms/signals` on purpose:\n * that module is `@experimental`, and a public DS type must not carry a\n * dependency that can be renamed out from under consumers. Structural\n * compatibility is all the interop needs — signal forms binds by input NAME and\n * assigns its own `ValidationError[]`, which this shape accepts.\n */\nexport interface DsFieldError {\n /** Identifies the kind of error, e.g. `required`, `minlength`, `server`. */\n readonly kind: string;\n /** Human-readable text. Authored by the consumer, at the validator. */\n readonly message?: string;\n}\n\n/** What a field's `errors` input accepts before normalization. */\nexport type DsFieldErrorsInput =\n | string\n | DsFieldError\n | readonly DsFieldError[]\n | null\n | undefined;\n\nconst NO_ERRORS: readonly DsFieldError[] = [];\n\n/**\n * The one reserved `DsFieldError.kind`. An error carrying it is advisory: it shows\n * in the warning state and does NOT make the control invalid, which is how a form\n * model can raise a non-blocking remark — Angular's own `AbstractControl` has no\n * channel for one, only `errors` and the validity derived from it.\n */\nexport const DS_FIELD_WARNING_KIND = 'warning';\n\n/**\n * `errors` input transform. Accepts a bare string (so a consumer that already\n * has the text can pass it directly), a single error, or the array signal forms\n * assigns.\n */\nexport function normalizeFieldErrors(\n value: DsFieldErrorsInput,\n): readonly DsFieldError[] {\n if (!value) {\n return NO_ERRORS;\n }\n if (typeof value === 'string') {\n return value.trim() ? [{ kind: 'custom', message: value }] : NO_ERRORS;\n }\n\n return Array.isArray(value) ? value : [value as DsFieldError];\n}\n\n/** @internal */\nexport function trimmedText(value: string | null | undefined): string {\n return value?.trim() ?? '';\n}\n\n/** The single line a field shows below itself, already resolved.\n * @internal\n */\nexport interface DsFieldMessage {\n readonly text: string;\n readonly state: FieldMessageState;\n}\n\nexport interface DsFieldMessageSources {\n hint: Signal<string>;\n warning: Signal<string>;\n error: Signal<string>;\n errors: Signal<readonly DsFieldError[]>;\n invalid: Signal<boolean>;\n /** The control's own disabled state. A disabled control is neither submitted nor validated, so\n * it is not announced as invalid — the same reasoning `_field-state.scss` uses to keep the error\n * paint off it. Optional only because a host without a disabled state has nothing to pass.\n * A plain getter rather than a `Signal` so a caller can hand it over before its own\n * `isDisabled` field is initialised — this resolver is usually assigned near the top of a\n * component and the disabled computed near the bottom. */\n disabled?: () => boolean;\n success?: Signal<string>;\n /** The field's own touched state, if it tracks one (CVA blur). */\n touchedSelf?: Signal<boolean>;\n /** Bound by signal forms as part of the `FormUiControl` contract. */\n touched?: Signal<boolean>;\n}\n\nexport interface DsFieldMessageResolution {\n readonly message: Signal<DsFieldMessage>;\n /** `invalid` folded together with whatever the control reports. */\n readonly invalid: Signal<boolean>;\n /**\n * The state the CONTROL paints, for `[attr.data-field-state]`. Deliberately not\n * `message().state`: a field can be in a state with nothing to say, and can have\n * text in a state the box does not paint.\n */\n readonly controlState: Signal<FieldMessageState | null>;\n}\n\nconst EMPTY_MESSAGE: DsFieldMessage = { text: '', state: 'default' };\n\ninterface ControlState {\n readonly errors: readonly DsFieldError[];\n readonly touched: boolean;\n}\n\nconst NO_CONTROL: ControlState = { errors: NO_ERRORS, touched: false };\n\n/**\n * Resolve the one message a field shows, from every source that can supply one.\n *\n * Precedence, highest first — the ladder Carbon uses (`invalidText` →\n * `warnText` → `helperText`) and Material's subscript follows, so only ONE line\n * ever shows and the field's height does not depend on how many sources are\n * populated:\n *\n * 1. `error` — an explicit string. Shown immediately: the consumer decided.\n * 2. `errors` — validation errors. Shown once the user has interacted, so a\n * `required` error does not greet an untouched form.\n * 3. `warning` — advisory, not blocking.\n * 4. `errors` whose kind is `DS_FIELD_WARNING_KIND` — the same, raised by the form model.\n * 5. `success` — confirmation.\n * 6. `hint` — helper text.\n *\n * Both form systems feed step 2 and neither needs the other. Signal forms binds\n * `errors` and `touched` by input name (`FormUiControl`); reactive and\n * template-driven forms expose the same through `NgControl`, read here. A given\n * field instance is driven by exactly one of them, so they cannot disagree.\n *\n * Every rung carries its OWN text, and `hint` is never recoloured into somebody\n * else's state. `invalid` is the one input with no text on purpose: it paints the\n * control and sets `aria-invalid` for when the message lives elsewhere — a\n * form-level error summary, or one message for a whole field group.\n *\n * Call from a field initializer (an injection context).\n * @internal\n */\nexport function resolveFieldMessage(\n sources: DsFieldMessageSources,\n): DsFieldMessageResolution {\n const config = inject(DS_CONFIG);\n const controlState = watchNgControl();\n\n const errors = computed(() => {\n const own = sources.errors();\n\n return own.length ? own : controlState().errors;\n });\n\n const interacted = computed(\n () =>\n (sources.touched?.() ?? false) ||\n (sources.touchedSelf?.() ?? false) ||\n controlState().touched,\n );\n\n // Both form systems land here, so one reserved kind serves both: signal forms\n // assigns its own ValidationError[] (which already carries `kind`), and\n // fromValidationErrors turns a reactive validator's `{ warning: 'text' }` KEY\n // into the same kind.\n const blocking = computed(() =>\n errors().filter((error) => error.kind !== DS_FIELD_WARNING_KIND),\n );\n const advisory = computed(() =>\n errors().filter((error) => error.kind === DS_FIELD_WARNING_KIND),\n );\n\n const errorText = computed(() => {\n const current = blocking();\n if (!current.length || !interacted()) {\n return '';\n }\n\n return textFor(current, config.field?.errorMessages);\n });\n\n const advisoryText = computed(() => {\n const current = advisory();\n if (!current.length || !interacted()) {\n return '';\n }\n\n return textFor(current, config.field?.errorMessages);\n });\n\n // Advisory errors are deliberately absent: a warning does not make a control\n // invalid, so it never sets aria-invalid and never blocks a submit guard.\n // Disabled wins over every source of invalidity. Measured in Chrome's accessibility tree:\n // `aria-invalid` on a NATIVELY disabled input still reports invalid=true and the node is not\n // ignored, so disabling does not make the attribute inert — the reader still hears \"invalid\" on\n // a control they cannot act on.\n const invalid = computed(\n () =>\n !(sources.disabled?.() ?? false) &&\n (sources.invalid() ||\n sources.error().length > 0 ||\n (blocking().length > 0 && interacted())),\n );\n\n // Message inputs trim via `trimmedText`, so a non-empty string here is real\n // text — a new one declared without that transform breaks this quietly.\n const message = computed<DsFieldMessage>(() => {\n const explicit = sources.error();\n if (explicit) {\n return { text: explicit, state: 'error' };\n }\n const fromErrors = errorText();\n if (fromErrors) {\n return { text: fromErrors, state: 'error' };\n }\n const warning = sources.warning();\n if (warning) {\n return { text: warning, state: 'warning' };\n }\n const fromAdvisory = advisoryText();\n if (fromAdvisory) {\n return { text: fromAdvisory, state: 'warning' };\n }\n const success = sources.success?.();\n if (success) {\n return { text: success, state: 'success' };\n }\n const hint = sources.hint();\n\n return hint ? { text: hint, state: 'default' } : EMPTY_MESSAGE;\n });\n\n const paintedState = computed<FieldMessageState | null>(() => {\n if (invalid()) {\n return 'error';\n }\n if (sources.warning() || advisoryText()) {\n return 'warning';\n }\n\n return sources.success?.() ? 'success' : null;\n });\n\n return { message, invalid, controlState: paintedState };\n}\n\n/**\n * Reactive- and template-driven forms channel. `NgControl` cannot be injected\n * directly: a field provides `NG_VALUE_ACCESSOR` pointing at itself, so asking\n * for `NgControl` in the same constructor is a DI cycle. Resolving it after the\n * first render is the documented way around that.\n *\n * `events` (not `statusChanges`) is the subscription, because touching a control\n * does NOT emit a status change — it emits `TouchedChangeEvent`, and touched is\n * half of the decision to show an error at all.\n */\nfunction watchNgControl(): Signal<ControlState> {\n const injector = inject(Injector);\n const destroyRef = inject(DestroyRef);\n // Submitting a form does not reach the child control's own `events` — the\n // event is pushed onto the ROOT form's stream — so the parent is read\n // directly, as Angular Material's ErrorStateMatcher does.\n const parentForm = inject(NgForm, { optional: true });\n const parentFormGroup = inject(FormGroupDirective, { optional: true });\n const state = signal<ControlState>(NO_CONTROL);\n\n afterNextRender(() => {\n const control = injector.get(NgControl, null)?.control;\n if (!control) {\n return;\n }\n const submitted = (): boolean =>\n parentFormGroup?.submitted || parentForm?.submitted || false;\n const sync = (): void =>\n state.set({\n errors: fromValidationErrors(control.errors),\n touched: control.touched || submitted(),\n });\n\n // Signal forms bridges an NgControl whose `control` has no `events` stream, so\n // there is nothing to subscribe to. Staying at NO_CONTROL is deliberate: on that\n // path the component's own inputs carry errors and touched, and a snapshot that\n // froze at first render would keep serving a stale error after the field went valid.\n if (typeof control.events?.pipe !== 'function') {\n return;\n }\n\n sync();\n control.events.pipe(takeUntilDestroyed(destroyRef)).subscribe(sync);\n const parentSubmit = parentFormGroup?.ngSubmit ?? parentForm?.ngSubmit;\n parentSubmit?.pipe(takeUntilDestroyed(destroyRef)).subscribe(sync);\n });\n\n return state;\n}\n\n/**\n * `ValidationErrors` is an untyped bag, so a message is picked up from the two\n * shapes consumers actually write: `{ myError: 'text' }` and\n * `{ myError: { message: 'text' } }`. Angular's own built-ins carry detail\n * objects with no message (`{ minlength: { requiredLength, actualLength } }`) —\n * those resolve through `DS_CONFIG.field.errorMessages` instead.\n */\nfunction fromValidationErrors(\n errors: ValidationErrors | null,\n): readonly DsFieldError[] {\n if (!errors) {\n return NO_ERRORS;\n }\n\n return Object.keys(errors).map((kind) => {\n const detail: unknown = errors[kind];\n if (typeof detail === 'string') {\n return { kind, message: detail };\n }\n const message = (detail as { message?: unknown } | null)?.message;\n\n return typeof message === 'string' ? { kind, message } : { kind };\n });\n}\n\nfunction textFor(\n errors: readonly DsFieldError[],\n messages: Record<string, string> | undefined,\n): string {\n for (const error of errors) {\n const text = error.message ?? messages?.[error.kind];\n if (text) {\n return text;\n }\n }\n if (isDevMode()) {\n console.warn(\n `[ds-field] The control is invalid but no message could be resolved for ${errors\n .map((error) => `\"${error.kind}\"`)\n .join(\n ', ',\n )}, so the field paints the state with NO message under it. Give the validator a message — required(path, { message: '…' }) or { myError: 'text' } — or map the kind in provideDsConfig({ field: { errorMessages: … } }).`,\n );\n }\n\n return '';\n}\n","import { Directive, booleanAttribute, input } from '@angular/core';\nimport { resolveReserveMessage } from './field-defaults';\nimport type { IconName } from '@ids-group-ltd/ids-design-system/core';\nimport { trimmedText } from './field-errors';\n\n/**\n * The inputs of anything that renders a `ds-field-message` line — the message half\n * of a field, split out so `ds-button` can take it without also taking `errors`,\n * `invalid` and `touched`, which describe a form control's validation state and\n * mean nothing on a button.\n *\n * `@Directive()` is required, not decoration: Angular refuses to compile a base\n * class that declares inputs without it.\n * @internal\n */\n@Directive()\nexport abstract class DsMessageBase {\n /** Helper text shown below the control. */\n readonly hint = input<string, string | null | undefined>('', {\n transform: trimmedText,\n });\n /** Error text. Shown immediately — binding it says the consumer has already\n * decided this is in error. Takes precedence over `errors`. */\n readonly error = input<string, string | null | undefined>('', {\n transform: trimmedText,\n });\n /** Advisory text, shown when there is no error. */\n readonly warning = input<string, string | null | undefined>('', {\n transform: trimmedText,\n });\n /** Reserve the message-row height even when empty, so the control doesn't shift\n * the layout below it when a hint/error appears. Falls back to\n * `DS_CONFIG.field.reserveMessage`, then off. */\n readonly reserveMessage = input<boolean | null, unknown>(null, {\n transform: (value) => (value == null ? null : booleanAttribute(value)),\n });\n\n /** Glyph on the message line, overriding what the state resolves to. Unset\n * follows `DS_CONFIG.field.stateIcons`; `false` removes the glyph here alone. */\n readonly messageIcon = input<IconName | false | null>(null);\n\n readonly reserveMessageResolved = resolveReserveMessage(this.reserveMessage);\n}\n","import { Directive, booleanAttribute, input } from '@angular/core';\nimport { DsMessageBase } from './message-base';\nimport {\n normalizeFieldErrors,\n type DsFieldError,\n type DsFieldErrorsInput,\n} from './field-errors';\n\n/**\n * The inputs every DS form field has, declared once.\n *\n * Only the UNIVERSAL ones belong here. `success`, `label`, `required` and\n * `optional` stay on the components: they exist on some fields and not others, so\n * lifting them would hand a checkbox a `success` or a slider a `label` it never\n * had — a silent public-API addition.\n *\n * The message half lives one level up in `DsMessageBase`, which anything with a\n * message line can take. What stays here is the validation state a form control\n * has and a plain control does not.\n * @internal\n */\n@Directive()\nexport abstract class DsFieldBase extends DsMessageBase {\n /** Validation errors, shown once the user has interacted. Bound automatically\n * by signal forms; reactive and template-driven forms are read through\n * `NgControl` and need nothing here. Accepts a string, one error, or an array. */\n readonly errors = input<readonly DsFieldError[], DsFieldErrorsInput>([], {\n transform: normalizeFieldErrors,\n });\n /** Paints the error state and sets `aria-invalid`, WITHOUT a message of its own\n * — for when the text lives elsewhere, such as a form-level error summary or\n * one message covering a whole field group. Use `error` to show text. */\n readonly invalid = input(false, { transform: booleanAttribute });\n /** Whether the user has interacted with the field. Bound by signal forms; gates\n * `errors`, so a `required` error does not greet an untouched form. */\n readonly touched = input(false, { transform: booleanAttribute });\n}\n","import {\n Directive,\n ElementRef,\n booleanAttribute,\n effect,\n inject,\n input,\n signal,\n type ModelSignal,\n type WritableSignal,\n} from '@angular/core';\nimport type { ControlValueAccessor } from '@angular/forms';\nimport { DsFieldBase } from './field-base';\n\n/**\n * Value-bearing elements come FIRST, and that ordering is the whole point: the\n * number stepper renders its decrement button before its input, so \"the first\n * focusable descendant\" would land on minus. `tabindex=\"-1\"` is excluded from\n * both passes so a roving-tabindex group (ds-radio-group) yields the radio that\n * is actually tabbable rather than the first one in the DOM. Portaled panels are\n * outside the host, so a closed picker cannot be focused by accident.\n */\nconst NOT_ROVED = ':not([tabindex=\"-1\"]):not([disabled])';\nconst VALUE_ELEMENTS = `input:not([type=\"hidden\"])${NOT_ROVED}, textarea${NOT_ROVED}`;\nconst TRIGGER_ELEMENTS = `button${NOT_ROVED}, [tabindex=\"0\"]${NOT_ROVED}`;\n\n/**\n * The `ControlValueAccessor` half of a DS value control, with no message API\n * attached. `DsControlValueAccessor` is this plus `DsFieldBase`; a control that\n * holds a value and renders no message row — `ds-search`, a toolbar filter rather\n * than a validated field — takes this directly and gets no message inputs with it.\n *\n * The model arrives as a THUNK, not a signal: on a base class `value` is abstract\n * and on a component it is a field initialiser, so it does not exist yet when this\n * runs. Every read defers to call time, which is also when the effect first runs.\n *\n * Must be called from an injection context (it owns an `effect`).\n * @internal\n */\nexport function valueControlBridge<T>(model: () => ModelSignal<T>): {\n readonly formDisabled: WritableSignal<boolean>;\n readonly touchedSelf: WritableSignal<boolean>;\n markTouched(): void;\n writeValue(next: T): void;\n registerOnChange(fn: (next: T) => void): void;\n registerOnTouched(fn: () => void): void;\n setDisabledState(isDisabled: boolean): void;\n} {\n const formDisabled = signal(false);\n const touchedSelf = signal(false);\n let onChange: (next: T) => void = () => {};\n let onTouched: () => void = () => {};\n // Last value synced with the forms API. Guards the watching effect from echoing\n // a form-driven write back as a user change (which would dirty the control or\n // loop), while still emitting every genuine model change.\n let synced: T | undefined;\n let hasSynced = false;\n\n effect(() => {\n const next = model()();\n if (!hasSynced) {\n // Adopt the initial value once, silently — never emit on init.\n hasSynced = true;\n synced = next;\n\n return;\n }\n if (Object.is(next, synced)) {\n return;\n }\n synced = next;\n onChange(next);\n });\n\n return {\n formDisabled,\n touchedSelf,\n markTouched: () => {\n touchedSelf.set(true);\n onTouched();\n },\n writeValue: (next: T) => {\n hasSynced = true;\n synced = next;\n model().set(next);\n },\n registerOnChange: (fn: (next: T) => void) => {\n onChange = fn;\n },\n registerOnTouched: (fn: () => void) => {\n onTouched = fn;\n },\n setDisabledState: (isDisabled: boolean) => {\n formDisabled.set(isDisabled);\n },\n };\n}\n\nfunction focusOwnControl(host: HTMLElement, options?: FocusOptions): void {\n const target =\n host.querySelector<HTMLElement>(VALUE_ELEMENTS) ??\n host.querySelector<HTMLElement>(TRIGGER_ELEMENTS);\n target?.focus(options);\n}\n\n/**\n * Shared `ControlValueAccessor` for DS form controls whose value is a signal\n * `model()`. Bridges that model with Angular forms (reactive `formControl` /\n * `formControlName` and template `ngModel`) in both directions, WITHOUT\n * touching the existing `[(value)]` signal API — both keep working.\n *\n * A subclass must expose the `value` model and OR `formDisabled()` into its\n * effective disabled state so `FormControl.disable()` actually reaches the\n * control; it should also call `markTouched()` from a blur handler.\n * @internal\n */\n@Directive({\n host: { '[style.display]': 'hidden() ? \"none\" : null' },\n})\nexport abstract class DsControlValueAccessor<T>\n extends DsFieldBase\n implements ControlValueAccessor\n{\n /** The component's two-way value model. */\n abstract readonly value: ModelSignal<T>;\n\n /**\n * Hides the control. On the base so signal forms reaches every control at once.\n * Inline `display`, not the `hidden` attribute — each control sets its own\n * `:host` display, which the attribute's weaker UA rule would lose to.\n */\n readonly hidden = input(false, { transform: booleanAttribute });\n private readonly hostElement = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Signal forms calls this through `focusBoundControl()` — typically to reach\n * the first invalid field after a failed submit. Without it the default is to\n * focus the HOST, and a `<ds-*>` element is not focusable, so focus went\n * nowhere. A control with a more precise target overrides this.\n */\n focus(options?: FocusOptions): void {\n focusOwnControl(this.hostElement.nativeElement, options);\n }\n\n private readonly bridge = valueControlBridge<T>(() => this.value);\n\n /** Driven by the forms API via `setDisabledState`. */\n protected readonly formDisabled = this.bridge.formDisabled;\n\n // Separate from the control's `touched`, which only exists once `NgControl`\n // resolves — too late to gate the first blur.\n protected readonly touchedSelf = this.bridge.touchedSelf;\n\n /** Call from a blur handler so the control reports `ng-touched`. */\n protected markTouched(): void {\n this.bridge.markTouched();\n }\n\n writeValue(value: T): void {\n this.bridge.writeValue(value);\n }\n\n registerOnChange(fn: (value: T) => void): void {\n this.bridge.registerOnChange(fn);\n }\n\n registerOnTouched(fn: () => void): void {\n this.bridge.registerOnTouched(fn);\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.bridge.setDisabledState(isDisabled);\n }\n}\n\n/**\n * Shared `ControlValueAccessor` for DS boolean controls (checkbox, switch)\n * whose state lives in a `checked` model signal rather than `value`. Bridges\n * with Angular forms in both directions without affecting the `[(checked)]`\n * signal API. Subclasses must OR `formDisabled()` into their effective disabled\n * state and call `markTouched()` from a blur handler.\n * @internal\n */\n@Directive({\n host: { '[style.display]': 'hidden() ? \"none\" : null' },\n})\nexport abstract class DsBooleanControlValueAccessor\n extends DsFieldBase\n implements ControlValueAccessor\n{\n /** The component's two-way checked model. */\n abstract readonly checked: ModelSignal<boolean>;\n\n /** Hides the control — see the note on `DsControlValueAccessor.hidden`. */\n readonly hidden = input(false, { transform: booleanAttribute });\n private readonly hostElement = inject<ElementRef<HTMLElement>>(ElementRef);\n\n /**\n * Signal forms calls this through `focusBoundControl()` — typically to reach\n * the first invalid field after a failed submit. Without it the default is to\n * focus the HOST, and a `<ds-*>` element is not focusable, so focus went\n * nowhere. A control with a more precise target overrides this.\n */\n focus(options?: FocusOptions): void {\n focusOwnControl(this.hostElement.nativeElement, options);\n }\n\n /** Driven by the forms API via `setDisabledState`. */\n protected readonly formDisabled = signal(false);\n\n // Separate from the control's `touched`, which only exists once `NgControl`\n // resolves — too late to gate the first blur.\n protected readonly touchedSelf = signal(false);\n\n private onChange: (value: boolean) => void = () => {};\n private onTouched: () => void = () => {};\n\n private synced: boolean | undefined;\n private hasSynced = false;\n\n constructor() {\n super();\n effect(() => {\n const next = this.checked();\n if (!this.hasSynced) {\n this.hasSynced = true;\n this.synced = next;\n\n return;\n }\n if (Object.is(next, this.synced)) {\n return;\n }\n this.synced = next;\n this.onChange(next);\n });\n }\n\n /** Call from a blur handler so the control reports `ng-touched`. */\n protected markTouched(): void {\n this.touchedSelf.set(true);\n this.onTouched();\n }\n\n writeValue(value: boolean): void {\n this.hasSynced = true;\n this.synced = value;\n this.checked.set(value);\n }\n\n registerOnChange(fn: (value: boolean) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.formDisabled.set(isDisabled);\n }\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Replaces `ds-autocomplete`'s \"Create «…»\" row.\n *\n * Context: `query` is the typed text the row would create.\n *\n * The row stays a `role=\"option\"` the keyboard can reach, and picking it still\n * emits `create` — the template fills the row, it does not become the action.\n */\n@Directive({\n selector: '[dsCreateTemplate]',\n standalone: true,\n})\nexport class DsCreateTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { computed, inject, type Signal } from '@angular/core';\nimport {\n ActivatedRoute,\n Router,\n UrlTree,\n type IsActiveMatchOptions,\n type Params,\n type QueryParamsHandling,\n} from '@angular/router';\n\nexport type DsDestination = 'routerLink' | 'href' | 'button';\n\n// The query string is a subset match and the fragment is ignored in both: a sort order, a page\n// number or an open accordion does not make it a different page.\nconst EXACT_PATH: Partial<IsActiveMatchOptions> = {\n paths: 'exact',\n queryParams: 'subset',\n fragment: 'ignored',\n matrixParams: 'ignored',\n};\nconst PREFIX_PATH: Partial<IsActiveMatchOptions> = {\n ...EXACT_PATH,\n paths: 'subset',\n};\n\n/** What a `routerLink` input accepts. A `UrlTree` carries the fragment, query and relative base\n * the string and command-array forms cannot, so a caller that needs them can build one with\n * `Router.createUrlTree` instead of reaching for more inputs. */\nexport type DsRouterLink = string | readonly unknown[] | UrlTree | null;\n\n/** The values `aria-current` is allowed to take, plus `null` for \"say nothing\". `true` rather than\n * `'true'` so it drops straight into `RouterLinkActive.ariaCurrentWhenActive`, which is the only\n * writer of this attribute on a routed link. */\nexport type DsAriaCurrent =\n | 'page'\n | 'step'\n | 'location'\n | 'date'\n | 'time'\n | true;\n\n/** The `UrlCreationOptions` a navigating control forwards. */\nexport interface DsLinkModifiers {\n fragment?: string;\n queryParams?: Params | null;\n queryParamsHandling?: QueryParamsHandling | null;\n}\n\n/**\n * No destination is a `<button>`, never an `<a href=\"#\">`: a `#` href navigates, rewriting the URL\n * and discarding the scroll position. Only the decision is shared — each control keeps its own\n * template branches, because a shared one would need a wrapper that changes the control's box.\n *\n * @internal\n */\nexport function dsDestination(\n routerLink: Signal<DsRouterLink>,\n href: Signal<string>,\n): Signal<DsDestination> {\n return computed(() => {\n if (routerLink() !== null) {\n return 'routerLink';\n }\n\n return href() ? 'href' : 'button';\n });\n}\n\n/**\n * What a navigating control should announce, distinguishing the two things `routerLinkActive`\n * cannot tell apart.\n *\n * `routerLinkActive` matches by PREFIX, so deriving `aria-current=\"page\"` from it makes a\n * \"back to the section\" link claim to be the page the reader is already on. ARIA separates the\n * two: `page` is the page you are on, `true` is the current section or an ancestor of it. So an\n * exact match announces `page`, a prefix match announces `true`, and anything else stays silent —\n * which is correct for a button and for a sidenav item without a branch between them.\n *\n * Feed the result to `RouterLinkActive.ariaCurrentWhenActive`, never to `[attr.aria-current]`: the\n * directive removes that attribute from its host in a microtask whenever its own input is unset,\n * so a template binding is written and then silently wiped. Consequence worth knowing — a narrowed\n * `routerLinkActiveOptions` narrows the announcement with it, because the directive writes nothing\n * while it considers the link inactive.\n *\n * Must be called from an injection context. Outside a router it returns the override or `null`,\n * so a control can render with no router present.\n *\n * @internal\n */\nexport function dsAriaCurrent(\n routerLink: Signal<DsRouterLink>,\n modifiers: Signal<DsLinkModifiers>,\n override: Signal<DsAriaCurrent | null | undefined>,\n): Signal<DsAriaCurrent | undefined> {\n const router = inject(Router, { optional: true });\n // `RouterLink` resolves its commands against the route it sits on, so a relative destination\n // (`routerLink=\".\"`, `['..', 'sibling']`) means something different from the root. Resolving it\n // here without the same base would make `.` land on `/` — a prefix of every page, so the item\n // that IS the current page would announce `true` instead of `page`.\n const route = inject(ActivatedRoute, { optional: true });\n\n return computed<DsAriaCurrent | undefined>(() => {\n // `null` is the consumer's way of saying \"announce nothing\"; the directive spells that\n // `undefined`, so the two meet here rather than at every call site.\n const explicit = override();\n if (explicit !== undefined) {\n return explicit ?? undefined;\n }\n\n const link = routerLink();\n if (!router || link === null) {\n return undefined;\n }\n\n const tree =\n link instanceof UrlTree\n ? link\n : router.createUrlTree(Array.isArray(link) ? [...link] : [link], {\n relativeTo: route ?? undefined,\n ...modifiers(),\n });\n\n // `lastSuccessfulNavigation` is only the reactive trigger. The comparison goes through\n // `Router.isActive`, which reads the LIVE url: the standalone `isActive()` helper compares\n // against that navigation's `finalUrl` instead, and an app that rewrites its path without\n // navigating — a docs page tracking the section under the reader, a wizard naming its step —\n // then keeps announcing the page it landed on. Deprecated in 21.1, and nothing public replaces\n // the live-url comparison.\n router.lastSuccessfulNavigation();\n\n return router.isActive(tree, EXACT_PATH)\n ? 'page'\n : router.isActive(tree, PREFIX_PATH)\n ? true\n : undefined;\n });\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Replaces a picker panel's \"no matches\" row — an icon, a sentence in the app's\n * own language, a \"clear the filter\" button.\n *\n * Context: `query` is the text that matched nothing.\n *\n * The row keeps `role=\"status\"`, so a reader is told the list emptied whatever\n * the template puts inside it.\n */\n@Directive({\n selector: '[dsEmptyTemplate]',\n standalone: true,\n})\nexport class DsEmptyTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { Directive, ElementRef, inject } from '@angular/core';\n\n/**\n * Focuses the field's inner `input`/`textarea` when the click lands on the\n * frame chrome — padding, a leading/trailing icon, an addon slot — instead of\n * the control itself. Applied to a field's wrapper element.\n *\n * `preventDefault` on that mousedown stops focus from bouncing off the\n * non-focusable chrome; clicks that land on the control, or on a nested\n * button/link/other input, are left untouched so caret placement, toggles and\n * projected controls keep working.\n */\n@Directive({\n selector: '[dsFieldClickFocus]',\n standalone: true,\n host: {\n '(mousedown)': 'onMousedown($event)',\n },\n})\nexport class FieldClickFocusDirective {\n private readonly host: HTMLElement = inject(ElementRef).nativeElement;\n\n protected onMousedown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n if (\n target.closest('input, textarea, button, a, select, [contenteditable]')\n ) {\n return;\n }\n const field = this.host.querySelector<\n HTMLInputElement | HTMLTextAreaElement\n >('input, textarea');\n if (field && !field.disabled && !field.readOnly) {\n event.preventDefault();\n field.focus();\n }\n }\n}\n","let nextId = 0;\n\n/** Process-wide counter for stable, SSR-safe control ids (no DOM dependency).\n * Replaces the per-component `let nextId = 0` pattern.\n * @internal\n */\nexport function nextControlId(prefix: string): string {\n return `${prefix}-${++nextId}`;\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills an option group's heading — a count beside the name, a team glyph, a\n * secondary line.\n *\n * Context: `$implicit` and `group` are the group itself, `count` how many of its\n * options survived the filter.\n *\n * The heading element stays the library's: it keeps the id that the group's\n * `aria-labelledby` points at, so replacing the text cannot detach a group from\n * its name.\n */\n@Directive({\n selector: '[dsGroupLabelTemplate]',\n standalone: true,\n})\nexport class DsGroupLabelTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills an option row's LABEL AREA in `ds-select`, `ds-multi-select` and\n * `ds-autocomplete` — an avatar, a colour dot, a second line of metadata.\n *\n * ```html\n * <ds-multi-select [options]=\"assignees()\">\n * <ng-template dsOptionTemplate let-option>\n * <ds-avatar size=\"xs\" [seed]=\"option.label\" /> {{ option.label }}\n * </ng-template>\n * </ds-multi-select>\n * ```\n *\n * The row itself stays library-owned: `role=\"option\"`, `aria-selected`, the\n * active-row class, the checkbox and the check glyph are not projected, so a\n * template cannot take the listbox semantics with it.\n */\n@Directive({\n selector: '[dsOptionTemplate]',\n standalone: true,\n})\nexport class DsOptionTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import type {\n FlexibleConnectedPositionStrategy,\n Overlay,\n OverlayConfig,\n OverlayRef,\n} from '@angular/cdk/overlay';\n\n/** Where a connected panel sits relative to its trigger. `_overlay-motion.scss`\n * maps this onto the enter direction, so the panel moves in FROM the trigger. */\nexport type DsOverlayPlacement = 'top' | 'bottom' | 'left' | 'right';\n\n/** The theme's role layer, forwarded onto every portaled pane alongside whatever\n * tokens the component names for itself. */\nconst ROLE_TOKENS = [\n '--ds-radius-inner',\n '--ds-radius-control',\n '--ds-radius-panel',\n '--ds-radius-pill',\n '--ds-elevation-raised',\n '--ds-elevation-overlay',\n '--ds-elevation-floating',\n '--ds-elevation-modal',\n] as const;\n\n/** Public enter-motion tokens read by every `ds-overlay-pane`\n * (styles/_overlay-motion.scss). */\nconst OVERLAY_MOTION_TOKENS = [\n '--ds-overlay-enter-keyframes',\n '--ds-overlay-enter-duration',\n '--ds-overlay-enter-easing',\n '--ds-overlay-enter-offset',\n '--ds-overlay-enter-scale',\n] as const;\n\n/** Styles the `ds-dropdown-panel` class every `dropdownOverlay()` pane carries, so\n * every connected picker gets it whether or not it names panel tokens of its own. */\nconst DROPDOWN_PANEL_TOKENS = [\n '--ds-dropdown-panel-radius',\n '--ds-dropdown-panel-maxh',\n '--ds-dropdown-panel-border-color',\n '--ds-dropdown-panel-shadow',\n '--ds-option-padding',\n '--ds-option-gap',\n '--ds-option-radius',\n '--ds-option-row-gap',\n '--ds-option-bg-color-active',\n '--ds-option-weight',\n '--ds-option-font-size',\n '--ds-option-line-height',\n '--ds-option-font-family',\n] as const;\n\n/**\n * Why a panel is closing. `'select'` is a deliberate action that produced a\n * result — an option chosen, a date picked, the trigger pressed again, Tab moving\n * on; `'dismiss'` is ambient — Escape, a press outside, the page scrolling away.\n * @internal\n */\nexport type DsOverlayCloseCause = 'select' | 'dismiss';\n\nconst DROPDOWN_GAP = 4;\n\n/**\n * One panel-class input as an array. Spreading the raw input would scatter a\n * string into its characters, which is a silent per-letter class list.\n * @internal\n */\nexport function panelClassesOf(\n panelClass: string | readonly string[],\n): readonly string[] {\n return typeof panelClass === 'string'\n ? panelClass.split(' ').filter((className) => className.length > 0)\n : panelClass;\n}\n\n/**\n * The geometry every DS dropdown shares. Width is deliberately NOT set here —\n * each caller has its own policy (the exact trigger width, or the trigger as a\n * floor).\n * @internal\n */\nexport function dropdownOverlay(\n overlay: Overlay,\n trigger: HTMLElement,\n extraPanelClass: string | readonly string[] = [],\n): {\n positionStrategy: FlexibleConnectedPositionStrategy;\n config: OverlayConfig;\n} {\n const positionStrategy = overlay\n .position()\n .flexibleConnectedTo(trigger)\n .withPositions([\n {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: DROPDOWN_GAP,\n },\n {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetY: -DROPDOWN_GAP,\n },\n ]);\n\n return {\n positionStrategy,\n config: {\n positionStrategy,\n hasBackdrop: false,\n // The global panel skin lives in styles/_dropdown-overlay.scss: a portaled\n // node sits outside the host's DOM tree, so `:host ::ng-deep` cannot reach it.\n // The shared pair is never optional — a caller adds to it, so its own class\n // and a consumer's survive together and a rule can name one picker.\n panelClass: [\n 'ds-dropdown-panel',\n 'ds-overlay-pane',\n ...panelClassesOf(extraPanelClass),\n ],\n scrollStrategy: overlay.scrollStrategies.reposition(),\n },\n };\n}\n\n// Backstop for the leave animation: if the class never produces an animation\n// (a pane that is display:none, a consumer stylesheet that removed it), the\n// panel must still go away. Comfortably past --ds-motion-exit-duration.\nconst LEAVE_TIMEOUT_MS = 400;\n\n/**\n * Close a DS overlay panel — instantly on a `'select'`, with a short fade on a\n * `'dismiss'`. A fade after a deliberate pick reads as the panel lagging behind a\n * decision already made; on a dismissal nothing was chosen, so the same fade reads\n * as the panel backing out.\n *\n * NOTE: teardown paths dispose directly instead — a destroyed host has no time to\n * animate, and `ModalService` owns its own scrim-and-card leave.\n * @internal\n */\nexport function disposeWithLeave(\n overlayRef: OverlayRef | null | undefined,\n cause: DsOverlayCloseCause = 'select',\n): void {\n if (!overlayRef) {\n return;\n }\n if (cause === 'select') {\n overlayRef.dispose();\n\n return;\n }\n\n const pane = overlayRef.overlayElement;\n let disposed = false;\n const finish = (): void => {\n if (disposed) {\n return;\n }\n disposed = true;\n clearTimeout(timer);\n pane.removeEventListener('animationend', onAnimationEnd);\n overlayRef.dispose();\n };\n // The pane's ROOT CHILD is what animates (CDK owns transforms on the pane\n // itself), so the event arrives from a descendant and bubbles up to here.\n const onAnimationEnd = (event: AnimationEvent): void => {\n if (event.animationName.endsWith('ds-overlay-out')) {\n finish();\n }\n };\n const timer = setTimeout(finish, LEAVE_TIMEOUT_MS);\n pane.addEventListener('animationend', onAnimationEnd);\n pane.classList.add('ds-leaving');\n}\n\n/**\n * Forward a portaled panel's public `--ds-*` override tokens from the component\n * host onto the overlay pane. The pane is portaled into `document.body`, outside\n * `:host`, so custom properties a consumer sets via `ds-x { … }` never inherit\n * down to it. Only non-empty values are set, so an unset token still falls\n * through to the panel's own `var(--ds-*, <default>)`. Call once per open, right\n * after `overlay.create()`.\n * @internal\n */\nexport function forwardOverlayTokens(\n overlayRef: OverlayRef,\n host: HTMLElement,\n tokens: readonly string[],\n): void {\n const hostStyle = getComputedStyle(host);\n const paneStyle = overlayRef.overlayElement.style;\n for (const token of tokens) {\n const value = hostStyle.getPropertyValue(token).trim();\n if (value) {\n paneStyle.setProperty(token, value);\n }\n }\n\n // Roles resolve at :root, so every host has a value for them and copying it\n // unconditionally would PIN it inline on the pane — an open panel would then\n // ignore a theme switch until it was reopened. Forward only where the host\n // declares the role ITSELF, which is the case the pane cannot see.\n //\n // Compared against the PARENT, not against :root. Custom properties inherit, so a\n // shell that sets a role for its own chrome makes every component under it differ\n // from the root — each would pin the shell's value inline, where it outranks the\n // `.ds-overlay-pane` rule that is a consumer's only route to a portaled panel. An\n // ancestor's value reaches one panel through that component's own `--ds-*` hook,\n // which the loop above forwards with no such test.\n const inheritedStyle = getComputedStyle(\n host.parentElement ?? host.ownerDocument.documentElement,\n );\n for (const token of ROLE_TOKENS) {\n const value = hostStyle.getPropertyValue(token).trim();\n if (value && value !== inheritedStyle.getPropertyValue(token).trim()) {\n paneStyle.setProperty(token, value);\n }\n }\n}\n\n/** Read a CDK connection pair as the panel's placement. `overlayY` is the panel\n * edge pinned to the trigger, so `top` means the panel hangs BELOW the trigger.\n * @internal\n */\nexport function overlayPlacementOf(\n overlayY: string,\n overlayX: string,\n): DsOverlayPlacement {\n if (overlayY === 'top') {\n return 'bottom';\n }\n if (overlayY === 'bottom') {\n return 'top';\n }\n if (overlayX === 'start') {\n return 'right';\n }\n\n return 'left';\n}\n\n/**\n * Prime a `ds-overlay-pane` for its enter animation. Call right after\n * `overlay.create()` — CDK applies the position in `afterNextRender`, so the\n * placement stamp still lands before the first painted frame. Until it does (or\n * with no strategy passed) the CSS default applies: entering from above.\n *\n * The subscription needs no teardown — disposing the overlay disposes the\n * strategy, which completes `positionChanges`.\n * @internal\n */\nexport function prepareOverlayEnter(\n overlayRef: OverlayRef,\n host: HTMLElement,\n positionStrategy?: FlexibleConnectedPositionStrategy,\n): void {\n forwardOverlayTokens(overlayRef, host, OVERLAY_MOTION_TOKENS);\n forwardOverlayTokens(overlayRef, host, DROPDOWN_PANEL_TOKENS);\n positionStrategy?.positionChanges.subscribe(({ connectionPair }) => {\n overlayRef.overlayElement.dataset['dsPlacement'] = overlayPlacementOf(\n connectionPair.overlayY,\n connectionPair.overlayX,\n );\n });\n}\n\n/** Close a non-modal overlay on a pointer press outside it, EXCEPT when the press\n * lands on its trigger — so the trigger stays interactive (caret, re-focus) while\n * open. Use with `hasBackdrop: false` so hover/cursor/pointer reach the live page.\n * @internal\n */\nexport function closeOnOutsidePointer(\n overlayRef: OverlayRef,\n isInsideTrigger: (target: Node) => boolean,\n close: () => void,\n): void {\n overlayRef.outsidePointerEvents().subscribe((event) => {\n const target = event.target as Node | null;\n if (target && isInsideTrigger(target)) {\n return;\n }\n close();\n });\n}\n\n/** Close a non-modal overlay when the page scrolls. CDK's scroll strategies only\n * observe `window` + registered `cdkScrollable`s, so they miss a plain\n * `overflow:auto` container (e.g. an app's scrolling `<main>`); this listens on\n * the document in the CAPTURE phase, which catches the non-bubbling `scroll`\n * event from ANY nested container. A scroll inside the panel itself is ignored.\n * @internal\n */\nexport function closeOnScroll(\n overlayRef: OverlayRef,\n close: () => void,\n): () => void {\n const onScroll = (event: Event): void => {\n const target = event.target as Node | null;\n if (target && overlayRef.overlayElement.contains(target)) {\n return;\n }\n // A form control scrolling its own text (e.g. typing past the visible edge\n // of a host-side filter input) never moves the panel's anchor — ignore it.\n if (\n target instanceof HTMLElement &&\n (target.tagName === 'INPUT' ||\n target.tagName === 'TEXTAREA' ||\n target.tagName === 'SELECT')\n ) {\n return;\n }\n close();\n };\n const doc = overlayRef.overlayElement.ownerDocument;\n doc.addEventListener('scroll', onScroll, true);\n\n return () => doc.removeEventListener('scroll', onScroll, true);\n}\n\n/**\n * Sync a component's \"which overlay is mine, and is it open\" state when THIS overlay detaches,\n * skipping the write when a newer one has already taken over.\n *\n * `disposeWithLeave` defers the dispose of a dismissed overlay until its exit animation ends, so a\n * dismiss followed by a re-open inside that window makes the OLD overlay's detachment arrive while\n * the NEW one is live. Clearing unconditionally then left that new panel on screen with its\n * component believing it was closed — no `aria-expanded`, and `close()` declining to run because\n * the ref it checks was already null, which is to say the panel could not be dismissed at all.\n * Measured in ds-date-picker, ds-color-picker, ds-time-picker and ds-popover; ds-select,\n * ds-autocomplete and ds-multi-select each carried the check by hand, and the four that did not\n * are why it lives here instead.\n *\n * A detachment of the CURRENT overlay always clears, whatever caused it — so a stray CDK detach\n * still releases a reopen guard that keys off the stored ref rather than wedging it.\n * @internal\n */\nexport function clearOnDetach(\n overlayRef: OverlayRef,\n {\n current,\n clear,\n always,\n }: {\n /** Reads the ref the component considers live right now. */\n current: () => OverlayRef | null;\n /** Drops the stored ref and marks the component closed. */\n clear: () => void;\n /** Teardown that must run for every detachment, current or superseded. */\n always?: () => void;\n },\n): void {\n overlayRef.detachments().subscribe(() => {\n always?.();\n if (current() !== overlayRef) {\n return;\n }\n clear();\n });\n}\n\n/** True when keyboard focus currently sits inside the overlay pane. Read it\n * BEFORE disposing, to decide whether the close has to refocus the trigger\n * rather than strand focus on `<body>`. An outside-pointer close leaves focus on\n * the clicked element (mousedown moved it out of the pane first), so this\n * returns false there and focus is correctly left alone.\n * @internal\n */\nexport function focusIsInside(overlayRef: OverlayRef): boolean {\n const doc = overlayRef.overlayElement.ownerDocument;\n\n return overlayRef.overlayElement.contains(doc.activeElement);\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills a strip below a picker panel's option list — a \"create new\" affordance\n * of your own, a count, a link, an apply button for a panel the user batches\n * choices in.\n *\n * Context: the same as the header slot — `count`, `total`, `query`.\n *\n * Like the header it sits OUTSIDE the `listbox` and does not scroll with the\n * options. Anything focusable you put here is reached by Tab from the panel, so\n * give it an accessible name.\n */\n@Directive({\n selector: '[dsPanelFooterTemplate]',\n standalone: true,\n})\nexport class DsPanelFooterTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Fills a strip above a picker panel's option list — \"3 of 40 selected\", a\n * \"clear all\" button, a hint, a link to a fuller search.\n *\n * Context: `count` is how many options are visible after filtering, `total` how\n * many were given, and `query` the text that narrowed them.\n *\n * It sits OUTSIDE the `listbox`, so whatever you put here is not counted as an\n * option and does not break a screen reader's \"N of M\" position reporting. It\n * also stays put while the list scrolls under it — the panel clips and the list\n * is the scroller.\n */\n@Directive({\n selector: '[dsPanelHeaderTemplate]',\n standalone: true,\n})\nexport class DsPanelHeaderTemplateDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import { type Signal, effect, inject, DOCUMENT } from '@angular/core';\n\n/**\n * Announces how many options survived the filter.\n *\n * Deliberately NOT a row inside the listbox. A live region there is an invalid\n * child and, worse, a region created together with its text is the case screen\n * readers reliably do not announce — there is no content CHANGE to fire on. The\n * node here is created once, empty, and only its text changes.\n *\n * The text is English, which is the same debt every other library-invented string\n * in this package carries (see the localization item in `docs/todo.md`). It is a\n * count, so it is the cheapest of them to swap once a provider lands.\n * @internal\n */\nexport function announceOptionCount(\n count: Signal<number>,\n active: Signal<boolean>,\n): void {\n const documentRef = inject(DOCUMENT);\n const region = documentRef.createElement('div');\n region.setAttribute('aria-live', 'polite');\n region.setAttribute('aria-atomic', 'true');\n // Off-screen rather than `display: none`, which would take it out of the\n // accessibility tree and announce nothing at all.\n region.style.cssText =\n 'position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;margin:-1px;padding:0';\n documentRef.body.appendChild(region);\n\n effect((onCleanup) => {\n onCleanup(() => region.remove());\n if (!active()) {\n region.textContent = '';\n\n return;\n }\n const total = count();\n region.textContent =\n total === 0\n ? 'No results'\n : total === 1\n ? '1 result'\n : `${total} results`;\n });\n}\n","import { Directive, TemplateRef, inject } from '@angular/core';\n\n/**\n * Replaces the CONTENTS of a picker's trigger — the chips, the value, the\n * placeholder — with your own markup. The trigger ELEMENT stays library-owned,\n * so `aria-haspopup`, `aria-expanded`, `aria-controls`, the roving\n * `aria-activedescendant` and the Enter/Space/ArrowDown/Escape handling cannot\n * be lost with it.\n *\n * ```html\n * <ds-multi-select [options]=\"labels()\" [(value)]=\"picked\">\n * <ng-template dsPickerTrigger let-count=\"count\">\n * Labels @if (count) { <ds-badge [count]=\"count\" /> }\n * </ng-template>\n * </ds-multi-select>\n * ```\n *\n * Context: `$implicit` and `selected` are the selected options, `count` their\n * number, `open` whether the panel is showing, `disabled` the control's state.\n *\n * A projected template WINS over `triggerDisplay` — that input is then not read\n * at all, so there is no \"compact plus a template\" combination to explain.\n */\n@Directive({\n selector: '[dsPickerTrigger]',\n standalone: true,\n})\nexport class DsPickerTriggerDirective {\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\n}\n","import {\n Directive,\n ElementRef,\n afterNextRender,\n inject,\n input,\n} from '@angular/core';\n\n/**\n * Dev-only guard for a component that DROPS whatever is projected into it, so the\n * author gets a warning instead of silence — there is no compile-time signal for\n * content a component chooses to ignore. Put it on a probe around the\n * `<ng-content>`, gated on dev mode so production renders no extra node:\n *\n * ```html\n * @if (devMode) {\n * <span dsProjectionDropped=\"ds-filter-bar\"><ng-content></ng-content></span>\n * }\n * ```\n *\n * It is NOT projection support: the probe exists so the warning can see that\n * content arrived, and then hides it.\n *\n * `ds-filter-bar` is the only host today.\n *\n * `reason` replaces the default `[label]` wording for a host that drops content\n * for a different reason — `ds-filter-bar` drops anything that carries neither of\n * its slot attributes.\n * @internal\n */\n@Directive({\n selector: '[dsProjectionDropped]',\n standalone: true,\n host: { style: 'display: none' },\n})\nexport class ProjectionDroppedDirective {\n /** The host component's selector, named in the warning. */\n readonly dsProjectionDropped = input.required<string>();\n /** Overrides the `[label]` explanation for a host that drops content for\n * another reason. Ends up after \"renders nothing — \". */\n readonly reason = input<string>('');\n\n private readonly probe = inject(ElementRef<HTMLElement>);\n\n constructor() {\n afterNextRender(() => {\n if (!this.probe.nativeElement.textContent?.trim()) {\n return;\n }\n const selector = this.dsProjectionDropped();\n const reason =\n this.reason() ||\n `the caption comes from the [label] input only, so \\`<${selector}>Some text</${selector}>\\` shows no caption at all. Move the text into [label].`;\n console.warn(\n `[${selector}] Projected content renders nothing — ${reason}`,\n );\n });\n }\n}\n","import {\n type Signal,\n afterRenderEffect,\n inject,\n DOCUMENT,\n} from '@angular/core';\n\n/**\n * Keeps the keyboard cursor's row visible inside a scrolling panel.\n *\n * KEYBOARD ONLY, and that is the load-bearing part. The option rows also set the\n * active index on `mouseenter`, so a version that reacted to every change pulled\n * a partially visible row up under the pointer while the user was reading with\n * the mouse.\n *\n * Rows are looked up by id rather than through a `viewChildren` query because they\n * live in a portaled template — and the id is the one `aria-activedescendant`\n * already points at, so a failed lookup means that reference is broken too.\n * @internal\n */\nexport function scrollActiveOptionIntoView(\n activeDescendantId: Signal<string | null>,\n enabled: Signal<boolean>,\n armed: Signal<boolean>,\n): void {\n const documentRef = inject(DOCUMENT);\n\n afterRenderEffect(() => {\n const id = activeDescendantId();\n if (!enabled() || !armed() || !id) {\n return;\n }\n documentRef\n .getElementById(id)\n ?.scrollIntoView({ block: 'nearest', inline: 'nearest' });\n });\n}\n","import { Directive, booleanAttribute, input } from '@angular/core';\n\n/** Showcase-only: renders the component's open/overlay surface inline in normal\n * flow instead of its real overlay mechanics (for static docs specimens).\n * Not part of the production contract. */\n@Directive({ standalone: true })\nexport class DsStaticPreview {\n readonly staticPreview = input(false, { transform: booleanAttribute });\n}\n","/**\n * The jump-to-option-by-typing that a native `<select>` has and ours did not.\n *\n * Typing \"ba\" on a closed control moves to the first option starting with \"ba\",\n * and keeps extending the buffer while the user keeps typing. The timeout is what\n * separates \"ba\" from two separate \"b\" and \"a\" presses; 500ms is the interval\n * every native control and APG example uses.\n */\nconst RESET_AFTER_MS = 500;\n\nexport interface DsTypeAhead {\n /** Feed it a keypress. Returns the index to move to, or -1 when the key is not\n * a character or nothing matches. */\n match: (key: string, labels: readonly string[], from: number) => number;\n}\n\n/** @internal */\nexport function createTypeAhead(): DsTypeAhead {\n let buffer = '';\n let last = 0;\n\n return {\n match(key, labels, from) {\n // A modifier combination and any named key (\"Enter\", \"ArrowDown\") are not\n // text; only a single printable character extends the buffer.\n if (key.length !== 1 || !/\\S/.test(key)) {\n return -1;\n }\n\n const now = Date.now();\n buffer = now - last > RESET_AFTER_MS ? key : buffer + key;\n last = now;\n\n const query = buffer.toLowerCase();\n const cycling =\n buffer.length > 1 &&\n [...buffer].every((character) => character === buffer[0]);\n const needle = cycling ? buffer[0].toLowerCase() : query;\n const start = cycling || buffer.length === 1 ? from + 1 : 0;\n\n for (let offset = 0; offset < labels.length; offset += 1) {\n const index = (start + offset + labels.length) % labels.length;\n if (labels[index].toLowerCase().startsWith(needle)) {\n return index;\n }\n }\n\n return -1;\n },\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGA;;;;;;;;;AASG;AACG,SAAU,iBAAiB,CAC/B,KAA4B,EAC5B,GAAsC,EAAA;AAEtC,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC;AAEhC,IAAA,OAAO,QAAQ,CAAC,MAAM,KAAK,EAAE,IAAI,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;AAC7D;;ACpBA;AACA;AACA;AAEA;AACuC;AAChC,MAAM,WAAW,GAAG;AACzB,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,OAAO,EAAE,gCAAgC;AACzC,IAAA,aAAa,EAAE,sCAAsC;AACrD,IAAA,YAAY,EAAE,qCAAqC;AACnD,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B;AACrC,IAAA,KAAK,EAAE,8BAA8B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