@ids-group-ltd/ids-design-system 0.14.2 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +212 -0
- package/components.md +26 -26
- package/docs/agent/charts/column-series-component.md +1 -1
- package/docs/agent/charts/ds-bar-chart.md +1 -1
- package/docs/agent/charts/ds-chart.md +1 -1
- package/docs/agent/charts/ds-column-chart.md +1 -1
- package/docs/agent/charts/ds-funnel-chart.md +1 -1
- package/docs/agent/charts/ds-heatmap-chart.md +1 -1
- package/docs/agent/charts/ds-line-chart.md +1 -1
- package/docs/agent/charts/ds-pie-chart.md +1 -1
- package/docs/agent/charts/ds-scatter-chart.md +1 -1
- package/docs/agent/charts/ds-waterfall-chart.md +1 -1
- package/docs/agent/charts/line-series-component.md +1 -1
- package/docs/agent/forms/ds-color-picker.md +1 -1
- package/docs/agent/forms/ds-date-picker.md +1 -1
- package/docs/agent/forms/ds-select.md +1 -1
- package/docs/agent/forms/ds-textarea.md +1 -1
- package/docs/agent/forms/ds-time-picker.md +1 -1
- package/docs/agent/forms/the-picker-family-ds-select-ds-multi-select-ds-autocomplete.md +1 -1
- package/docs/agent/foundations/tokens.md +1 -1
- package/docs/agent/navigation/ds-tabs.md +1 -1
- package/docs/agent/overlays/ds-bottom-sheet.md +1 -1
- package/docs/agent/overlays/ds-drawer.md +1 -1
- package/docs/agent/overlays/ds-modal.md +1 -1
- package/docs/agent/overlays/ds-popover.md +1 -1
- package/docs/agent/overlays/ds-tooltip.md +3 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-autocomplete.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs +10 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-bar-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs +16 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-bottom-sheet.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs +69 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs +27 -26
- package/fesm2022/ids-group-ltd-ids-design-system-components-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs +25 -10
- package/fesm2022/ids-group-ltd-ids-design-system-components-color-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs +10 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-column-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs +28 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-date-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs +13 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-drawer.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs +10 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-funnel-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs +9 -6
- package/fesm2022/ids-group-ltd-ids-design-system-components-heatmap-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs +15 -13
- package/fesm2022/ids-group-ltd-ids-design-system-components-line-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs +3 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-multi-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs +10 -11
- package/fesm2022/ids-group-ltd-ids-design-system-components-pie-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs +48 -16
- package/fesm2022/ids-group-ltd-ids-design-system-components-scatter-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs +3 -4
- package/fesm2022/ids-group-ltd-ids-design-system-components-select.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sidenav.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs +147 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-sparkline.mjs.map +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-stat.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-table.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs +2 -2
- package/fesm2022/ids-group-ltd-ids-design-system-components-tabs.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs +31 -9
- package/fesm2022/ids-group-ltd-ids-design-system-components-textarea.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs +16 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components-time-picker.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs +74 -18
- package/fesm2022/ids-group-ltd-ids-design-system-components-tooltip.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs +6 -3
- package/fesm2022/ids-group-ltd-ids-design-system-components-waterfall-chart.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs +13 -5
- package/fesm2022/ids-group-ltd-ids-design-system-components.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system-core.mjs.map +1 -1
- package/fesm2022/ids-group-ltd-ids-design-system.mjs +1 -0
- package/fesm2022/ids-group-ltd-ids-design-system.mjs.map +1 -1
- package/migrations/0.14.3.json +71 -0
- package/migrations/0.14.4.json +231 -0
- package/package.json +9 -1
- package/schematics/check-overrides/surface.json +19 -1
- package/styles/_chart-frame.scss +4 -6
- package/styles/_toast-overlay.scss +9 -0
- package/styles/_tokens.scss +6 -0
- package/themes/_semantic.scss +1 -0
- package/themes/dark/_theme.scss +1 -0
- package/types/ids-group-ltd-ids-design-system-components-bar-chart.d.ts +9 -9
- package/types/ids-group-ltd-ids-design-system-components-bottom-sheet.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components-chart-tooltip.d.ts +5 -1
- package/types/ids-group-ltd-ids-design-system-components-chart.d.ts +15 -8
- package/types/ids-group-ltd-ids-design-system-components-color-picker.d.ts +4 -2
- package/types/ids-group-ltd-ids-design-system-components-column-chart.d.ts +8 -9
- package/types/ids-group-ltd-ids-design-system-components-date-picker.d.ts +4 -2
- package/types/ids-group-ltd-ids-design-system-components-drawer.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components-funnel-chart.d.ts +9 -9
- package/types/ids-group-ltd-ids-design-system-components-heatmap-chart.d.ts +7 -3
- package/types/ids-group-ltd-ids-design-system-components-line-chart.d.ts +11 -11
- package/types/ids-group-ltd-ids-design-system-components-pie-chart.d.ts +9 -9
- package/types/ids-group-ltd-ids-design-system-components-scatter-chart.d.ts +9 -3
- package/types/ids-group-ltd-ids-design-system-components-sparkline.d.ts +54 -0
- package/types/ids-group-ltd-ids-design-system-components-textarea.d.ts +11 -3
- package/types/ids-group-ltd-ids-design-system-components-time-picker.d.ts +3 -2
- package/types/ids-group-ltd-ids-design-system-components-tooltip.d.ts +10 -1
- package/types/ids-group-ltd-ids-design-system-components-waterfall-chart.d.ts +4 -1
- package/types/ids-group-ltd-ids-design-system-components.d.ts +11 -2
- package/types/ids-group-ltd-ids-design-system-core.d.ts +6 -4
- package/types/ids-group-ltd-ids-design-system.d.ts +1 -0
|
@@ -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-render-gate.ts","../../../src/lib/components/charts-label-fit.ts","../../../src/lib/components/charts-decimate.ts","../../../src/lib/components/charts-path.ts","../../../src/lib/components/charts-scale.ts","../../../src/lib/components/charts-motion.ts","../../../src/lib/components/charts-dwell.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/charts-defaults.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 heat1: 'var(--ds-chart-heat-1-color)',\n heat2: 'var(--ds-chart-heat-2-color)',\n heat3: 'var(--ds-chart-heat-3-color)',\n heat4: 'var(--ds-chart-heat-4-color)',\n heat5: 'var(--ds-chart-heat-5-color)',\n heat6: 'var(--ds-chart-heat-6-color)',\n heat7: 'var(--ds-chart-heat-7-color)',\n heat8: 'var(--ds-chart-heat-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\n/** @internal See chartColors. */\nexport const CHART_HEAT_COLORS: readonly string[] = [\n chartColors.heat1,\n chartColors.heat2,\n chartColors.heat3,\n chartColors.heat4,\n chartColors.heat5,\n chartColors.heat6,\n chartColors.heat7,\n chartColors.heat8,\n];\n","import type { ChartValueFormat } from '@ids-group-ltd/ids-design-system/core';\n\nconst 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\nconst chartFormats = new Map<string, ChartValueFormat>();\n\n/** The built-in `valueFormat` in one locale: compact on a tick (`1.2M`), spelled out everywhere\n * else (`1,248,392`). A caller-supplied formatter receives the same `location` and decides for\n * itself; this is only the default.\n *\n * @internal */\nexport function chartValueFormat(locale: string): ChartValueFormat {\n let format = chartFormats.get(locale);\n if (!format) {\n const compact = new Intl.NumberFormat(locale, {\n notation: 'compact',\n maximumFractionDigits: 1,\n });\n const full = new Intl.NumberFormat(locale);\n format = (value, location) =>\n !Number.isFinite(value)\n ? '—'\n : location === 'tick'\n ? compact.format(value)\n : full.format(value);\n chartFormats.set(locale, format);\n }\n\n return format;\n}\n\nconst percentFormatters = new Map<string, Intl.NumberFormat>();\n\nfunction percentFormatter(locale: string, digits: 0 | 1): Intl.NumberFormat {\n const key = `${locale}|${digits}`;\n let formatter = percentFormatters.get(key);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n });\n percentFormatters.set(key, formatter);\n }\n\n return formatter;\n}\n\n/** @internal */\nexport function formatPercent(\n value: number,\n total: number,\n locale: string,\n): string {\n if (!total || !Number.isFinite(value) || !Number.isFinite(total)) {\n return '—';\n }\n const fraction = value / total;\n const formatter = percentFormatter(locale, 1);\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 (fraction !== 0 && Math.abs(fraction) < 0.0005) {\n return fraction > 0\n ? `<${formatter.format(0.001)}`\n : `>${formatter.format(-0.001)}`;\n }\n\n return formatter.format(fraction);\n}\n\n/** A whole-number percentage (the pie's largest-remainder shares), in `locale`.\n *\n * @internal */\nexport function formatWholePercent(percent: number, locale: string): string {\n return percentFormatter(locale, 0).format(percent / 100);\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, as a bare percentage.\n *\n * Empty for a lone mark, which is the whole of its own total, 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, so a negative mark has no share rather than a misleading one.\n *\n * @internal */\nexport function shareOfTotal(\n values: readonly number[],\n index: number,\n locale: string,\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, locale) : '';\n}\n\n/** The same share, phrased for a tooltip line, where no column header stands above it to say what\n * the percentage is OF.\n *\n * @internal */\nexport function describeShare(\n values: readonly number[],\n index: number,\n locale: string,\n phrase: (share: string) => string,\n): string {\n const share = shareOfTotal(values, index, locale);\n\n return share ? phrase(share) : '';\n}\n","import {\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n Signal,\n WritableSignal,\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 element = host.nativeElement;\n widths.set(element, width);\n sharedObserver().observe(element);\n inject(DestroyRef).onDestroy(() => {\n sharedObserver().unobserve(element);\n widths.delete(element);\n });\n\n return width.asReadonly();\n}\n\nconst widths = new WeakMap<Element, WritableSignal<number>>();\nlet observer: ResizeObserver | null = null;\n\n// One observer for every chart on the page, so a resize is one callback with every entry in it\n// rather than one callback per chart.\nfunction sharedObserver(): ResizeObserver {\n observer ??= new ResizeObserver((entries) => {\n for (const entry of entries) {\n widths.get(entry.target)?.set(Math.round(entry.contentRect.width));\n }\n });\n\n return observer;\n}\n","import {\n DestroyRef,\n ElementRef,\n InjectionToken,\n PLATFORM_ID,\n Signal,\n afterNextRender,\n inject,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\n\n/** Provided by a chart that has already waited for the viewport, so the `ds-chart` it draws\n * through builds at once instead of waiting a second time.\n *\n * @internal */\nexport const CHART_RENDER_GATE_PASSED = new InjectionToken<boolean>(\n 'CHART_RENDER_GATE_PASSED',\n);\n\ntype Build = () => void;\n\nconst builders = new WeakMap<Element, Build>();\nconst near = new Map<Element, Build>();\nconst ahead = new Map<Element, Build>();\nconst observers = new Map<Element | null, Map<string, IntersectionObserver>>();\nlet draining = false;\nlet idleScheduled = false;\nlet budgetMs = 8;\n\nfunction drain(): void {\n const start = performance.now();\n for (const [host, build] of near) {\n if (performance.now() - start > budgetMs) {\n setTimeout(drain);\n\n return;\n }\n near.delete(host);\n build();\n }\n draining = false;\n}\n\n// An idle period with less than this left would run a chart's build into the next frame.\nconst IDLE_ROOM_MS = 12;\n\nfunction buildWhileIdle(deadline: IdleDeadline): void {\n idleScheduled = false;\n for (const [host, build] of ahead) {\n if (deadline.timeRemaining() < IDLE_ROOM_MS) {\n break;\n }\n ahead.delete(host);\n build();\n }\n scheduleIdle();\n}\n\nfunction scheduleIdle(): void {\n if (\n idleScheduled ||\n !ahead.size ||\n typeof requestIdleCallback === 'undefined'\n ) {\n return;\n }\n idleScheduled = true;\n requestIdleCallback(buildWhileIdle);\n}\n\nfunction observer(\n root: Element | null,\n margin: string,\n queue: Map<Element, Build>,\n schedule: () => void,\n): IntersectionObserver {\n let byMargin = observers.get(root);\n if (!byMargin) {\n byMargin = new Map();\n observers.set(root, byMargin);\n }\n const key = `${queue === near ? 'near' : 'ahead'} ${margin}`;\n let found = byMargin.get(key);\n if (!found) {\n found = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const build = builders.get(entry.target);\n // A chart the reader has already scrolled past leaves the queue instead of being built\n // behind them.\n if (build && entry.isIntersecting) {\n queue.set(entry.target, build);\n } else {\n queue.delete(entry.target);\n }\n }\n schedule();\n },\n { root, rootMargin: margin },\n );\n byMargin.set(key, found);\n }\n\n return found;\n}\n\nfunction scheduleDrain(): void {\n if (near.size && !draining) {\n draining = true;\n setTimeout(drain);\n }\n}\n\n// A margin on the root only widens the root: an element inside a scrolling container is clipped by\n// that container first, so the container has to BE the root for the margin to reach past its edge.\n// The overflow test alone is not enough - a box that only scrolls sideways computes `overflow-y:\n// auto` too - so the container also has to be taller inside than out.\nfunction scrollRoot(host: Element): Element | null {\n for (let node = host.parentElement; node; node = node.parentElement) {\n const overflow = getComputedStyle(node).overflowY;\n if (\n (overflow === 'auto' ||\n overflow === 'scroll' ||\n overflow === 'overlay') &&\n node.scrollHeight > node.clientHeight\n ) {\n return node;\n }\n }\n\n return null;\n}\n\n/** Whether a chart may build its plot yet, under `DS_CONFIG.chart.rendering`. `true` from the\n * start unless `deferUntilVisible` is on; with it on, `true` once the chart nears the viewport or\n * is built ahead while the page is idle, and it stays `true`. Call from an injection context.\n *\n * @internal */\nexport function chartRenderGate(): Signal<boolean> {\n const rendering = inject(DS_CONFIG).chart?.rendering;\n // `skipSelf`: a preset provides the token to its own view, and must not read it back itself.\n const passed = inject(CHART_RENDER_GATE_PASSED, {\n optional: true,\n skipSelf: true,\n });\n if (\n !rendering?.deferUntilVisible ||\n passed ||\n !isPlatformBrowser(inject(PLATFORM_ID)) ||\n typeof IntersectionObserver === 'undefined'\n ) {\n return signal(true).asReadonly();\n }\n\n const ready = signal(false);\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n budgetMs = rendering.frameBudgetMs ?? budgetMs;\n const skipWhileOffscreen = rendering.skipWhileOffscreen ?? true;\n let release: () => void = () => undefined;\n\n afterNextRender(() => {\n const root = scrollRoot(host);\n const watchers = [\n observer(root, rendering.visibleMargin ?? '10% 0px', near, scheduleDrain),\n ];\n if (rendering.buildAheadWhileIdle ?? true) {\n watchers.push(\n observer(\n root,\n rendering.buildAheadMargin ?? '100% 0px',\n ahead,\n scheduleIdle,\n ),\n );\n }\n release = () => {\n for (const watcher of watchers) {\n watcher.unobserve(host);\n }\n near.delete(host);\n ahead.delete(host);\n };\n builders.set(host, () => {\n release();\n if (skipWhileOffscreen) {\n // `auto` remembers the height the chart last rendered at, so skipping it moves nothing.\n host.style.contentVisibility = 'auto';\n host.style.containIntrinsicBlockSize = 'auto 300px';\n }\n ready.set(true);\n });\n for (const watcher of watchers) {\n watcher.observe(host);\n }\n });\n inject(DestroyRef).onDestroy(() => release());\n\n return ready.asReadonly();\n}\n","/** A label turned 45 degrees takes this fraction of its width across the axis. 45 is where the\n * policy stops: past it the eye has to tilt rather than glance. */\nconst ROTATED_FOOTPRINT = Math.sin(Math.PI / 4);\n\n/** Two labels that merely fail to overlap still read as one run of text, so a label's footprint is\n * its width PLUS this. 16 sits in the middle of the 12-36 band the probe's cases allow, so a later\n * nudge does not flip an interval. */\nconst LABEL_GAP = 16;\n\n/** The WIDEST label decides for all of them: an axis that thins on the average still collides on\n * the one long month name, and a reader meets the collision rather than the average.\n *\n * @internal */\nexport function labelInterval(\n labelWidths: readonly number[],\n step: number,\n rotated: boolean,\n): number {\n const usable = labelWidths.filter((width) => Number.isFinite(width));\n if (usable.length === 0 || !Number.isFinite(step) || step <= 0) {\n return 1;\n }\n const widest = usable.reduce((max, width) => Math.max(max, width), 0);\n const footprint = (rotated ? widest * ROTATED_FOOTPRINT : widest) + LABEL_GAP;\n\n return Math.max(1, Math.ceil(footprint / step));\n}\n\n/** Asked before thinning, so the axis spends a tilt before it spends a reading.\n *\n * @internal */\nexport function rotationWouldFit(\n labelWidths: readonly number[],\n step: number,\n): boolean {\n return (\n labelInterval(labelWidths, step, false) > 1 &&\n labelInterval(labelWidths, step, true) === 1\n );\n}\n","/** One reading on two continuous scales. Structural and local: the decimators work on any pair\n * of continuous coordinates, and naming the published type here would put a chart's own type in\n * the shared entry point. */\ninterface Reading {\n readonly x: number;\n readonly y: number;\n}\n\n/** A series only decimates past FOUR times the target, not two: at two the saving is invisible on\n * any profile and the loss of detail is not, so the trade is the wrong way round. */\nconst DECIMATION_HEADROOM = 4;\n\n/** How many marks the plot can carry: one per pixel of its own width. Drawing two marks where the\n * screen has one pixel is two DOM nodes the reader cannot tell apart.\n *\n * @internal */\nexport function decimationTarget(plotWidth: number): number {\n return Number.isFinite(plotWidth) && plotWidth > 0\n ? Math.floor(plotWidth)\n : 0;\n}\n\n/** @internal */\nexport function needsDecimating(count: number, target: number): boolean {\n return target > 0 && count > target * DECIMATION_HEADROOM;\n}\n\n/** Buckets the series by position and keeps each bucket's highest and lowest reading.\n *\n * The default, because it is the only one of the two that can PROMISE something: a bucket's\n * extremum is in the output by construction, so a spike the reader is looking for cannot be the\n * point that was dropped. It also parallelises and stays stable while the reader pans, since a\n * bucket's answer does not depend on the buckets around it.\n *\n * @internal */\nexport function minMaxDecimate(\n points: readonly Reading[],\n target: number,\n): readonly Reading[] {\n if (target <= 0 || points.length <= target) {\n return points;\n }\n // Two points leave each bucket, so the bucket count is half the budget.\n const buckets = Math.max(1, Math.floor(target / 2));\n const size = points.length / buckets;\n const kept: Reading[] = [];\n\n for (let bucket = 0; bucket < buckets; bucket++) {\n const from = Math.floor(bucket * size);\n const to = Math.min(points.length, Math.floor((bucket + 1) * size));\n if (from >= to) {\n continue;\n }\n let lowest = points[from];\n let highest = points[from];\n for (let index = from + 1; index < to; index++) {\n if (points[index].y < lowest.y) {\n lowest = points[index];\n }\n if (points[index].y > highest.y) {\n highest = points[index];\n }\n }\n // In the order they occur, so the output still reads left to right.\n const [first, second] =\n lowest.x <= highest.x ? [lowest, highest] : [highest, lowest];\n kept.push(first);\n if (second !== first) {\n kept.push(second);\n }\n }\n\n return kept;\n}\n\n/** Largest Triangle Three Buckets: keeps the reading in each bucket that makes the biggest triangle\n * with the point already kept and the next bucket's centre of mass.\n *\n * It draws a truer SHAPE than MinMax at the same budget, and it makes no promise about the\n * extremum - a spike is dropped whenever a different point describes the silhouette better. Reach\n * for it where the outline is the reading and an individual point is not.\n *\n * @internal */\nexport function lttbDecimate(\n points: readonly Reading[],\n target: number,\n): readonly Reading[] {\n if (target <= 2 || points.length <= target) {\n return points;\n }\n const kept: Reading[] = [points[0]];\n // The first and the last are fixed, so the buckets divide what is between them.\n const size = (points.length - 2) / (target - 2);\n let previous = points[0];\n\n for (let bucket = 0; bucket < target - 2; bucket++) {\n const from = Math.floor(bucket * size) + 1;\n const to = Math.min(points.length - 1, Math.floor((bucket + 1) * size) + 1);\n const nextFrom = to;\n const nextTo = Math.min(\n points.length - 1,\n Math.floor((bucket + 2) * size) + 1,\n );\n\n let averageX = 0;\n let averageY = 0;\n const span = Math.max(1, nextTo - nextFrom);\n for (let index = nextFrom; index < nextTo; index++) {\n averageX += points[index].x;\n averageY += points[index].y;\n }\n averageX /= span;\n averageY /= span;\n\n let best = points[from];\n let bestArea = -1;\n for (let index = from; index < to; index++) {\n const area = Math.abs(\n (previous.x - averageX) * (points[index].y - previous.y) -\n (previous.x - points[index].x) * (averageY - previous.y),\n );\n if (area > bestArea) {\n bestArea = area;\n best = points[index];\n }\n }\n kept.push(best);\n previous = best;\n }\n\n kept.push(points[points.length - 1]);\n\n return kept;\n}\n","import type { ChartCurve } from '@ids-group-ltd/ids-design-system/core';\n\n/** One plotted reading, in the canvas's own coordinates.\n *\n * @internal */\nexport interface LinePoint {\n readonly categoryIndex: number;\n readonly x: number;\n readonly y: number;\n readonly value: number;\n}\n\nconst COORDINATE_DECIMALS = 2;\n\nfunction roundTo(value: number, decimals: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Number(value.toFixed(decimals));\n}\n\nfunction isPlottable(point: LinePoint): boolean {\n return Number.isFinite(point.x) && Number.isFinite(point.y);\n}\n\nfunction coordinatePair(point: LinePoint): string {\n return `${roundTo(point.x, COORDINATE_DECIMALS)},${roundTo(point.y, COORDINATE_DECIMALS)}`;\n}\n\n/** The unbroken runs of a series: a missing reading ends one run and starts the next.\n *\n * @internal */\nexport function lineSegments(\n points: readonly (LinePoint | null)[],\n): LinePoint[][] {\n const segments: LinePoint[][] = [];\n let current: LinePoint[] = [];\n for (const point of points) {\n if (point === null) {\n if (current.length > 0) {\n segments.push(current);\n }\n current = [];\n } else {\n current.push(point);\n }\n }\n if (current.length > 0) {\n segments.push(current);\n }\n\n return segments;\n}\n\n/** `''` rather than a partial list when a coordinate is unplottable: one `NaN` in a\n * `points` list or a path `d` voids the whole attribute, and the line then vanishes\n * with nothing logged.\n *\n * @internal */\nexport function polylinePoints(segment: readonly LinePoint[]): string {\n if (segment.length === 0 || !segment.every(isPlottable)) {\n return '';\n }\n\n return segment.map((point) => coordinatePair(point)).join(' ');\n}\n\n/** Fritsch-Carlson tangents: the slope at each reading, clamped so no segment can turn back on\n * itself. A zero slope on either side of a reading pins the tangent flat, which is what keeps a\n * plateau flat instead of bulging through it. */\nfunction monotoneTangents(segment: readonly LinePoint[]): number[] {\n const count = segment.length;\n const secants: number[] = [];\n for (let index = 0; index < count - 1; index++) {\n const run = segment[index + 1].x - segment[index].x;\n secants.push(\n run === 0 ? 0 : (segment[index + 1].y - segment[index].y) / run,\n );\n }\n\n const tangents = [secants[0]];\n for (let index = 1; index < count - 1; index++) {\n const before = secants[index - 1];\n const after = secants[index];\n tangents.push(before * after <= 0 ? 0 : (before + after) / 2);\n }\n tangents.push(secants[count - 2]);\n\n for (let index = 0; index < count - 1; index++) {\n const secant = secants[index];\n if (secant === 0) {\n tangents[index] = 0;\n tangents[index + 1] = 0;\n continue;\n }\n // Fritsch-Carlson's circle condition: keeping each tangent within three times the secant it\n // sits on is what makes the cubic monotone on that span.\n const alpha = tangents[index] / secant;\n const beta = tangents[index + 1] / secant;\n const magnitude = Math.hypot(alpha, beta);\n if (magnitude > 3) {\n tangents[index] = (3 / magnitude) * alpha * secant;\n tangents[index + 1] = (3 / magnitude) * beta * secant;\n }\n }\n\n return tangents;\n}\n\nfunction smoothPath(segment: readonly LinePoint[]): string {\n const tangents = monotoneTangents(segment);\n let path = `M ${coordinatePair(segment[0])}`;\n for (let index = 0; index < segment.length - 1; index++) {\n const from = segment[index];\n const to = segment[index + 1];\n const third = (to.x - from.x) / 3;\n const firstControl = {\n x: from.x + third,\n y: from.y + tangents[index] * third,\n };\n const secondControl = {\n x: to.x - third,\n y: to.y - tangents[index + 1] * third,\n };\n path +=\n ` C ${roundTo(firstControl.x, COORDINATE_DECIMALS)},${roundTo(firstControl.y, COORDINATE_DECIMALS)}` +\n ` ${roundTo(secondControl.x, COORDINATE_DECIMALS)},${roundTo(secondControl.y, COORDINATE_DECIMALS)}` +\n ` ${coordinatePair(to)}`;\n }\n\n return path;\n}\n\n/** One unbroken run as a path `d`. `''` rather than a partial path when a coordinate is\n * unplottable: one `NaN` voids the whole attribute and the line vanishes with nothing logged.\n *\n * @internal */\nexport function linePath(\n segment: readonly LinePoint[],\n curve: ChartCurve = 'linear',\n): string {\n if (segment.length === 0 || !segment.every(isPlottable)) {\n return '';\n }\n if (segment.length === 1 || curve === 'linear') {\n return `M ${segment.map((point) => coordinatePair(point)).join(' L ')}`;\n }\n if (curve === 'step') {\n let path = `M ${coordinatePair(segment[0])}`;\n for (const point of segment.slice(1)) {\n path += ` H ${roundTo(point.x, COORDINATE_DECIMALS)} V ${roundTo(point.y, COORDINATE_DECIMALS)}`;\n }\n\n return path;\n }\n\n return smoothPath(segment);\n}\n\n/** The filled band between two edges - a stacked area sitting on the series below it, or a\n * confidence band around a line. The lower edge is walked BACKWARDS, so its curve is rebuilt from\n * the reversed points rather than reused: a monotone cubic is not symmetric, and closing the shape\n * along the forward path would bend the bottom of the band the wrong way.\n *\n * @internal */\nexport function bandPath(\n upper: readonly LinePoint[],\n lower: readonly LinePoint[],\n curve: ChartCurve = 'linear',\n): string {\n if (\n upper.length < 2 ||\n upper.length !== lower.length ||\n !upper.every(isPlottable) ||\n !lower.every(isPlottable)\n ) {\n return '';\n }\n const back = linePath([...lower].reverse(), curve);\n\n return `${linePath(upper, curve)} L ${back.slice('M '.length)} Z`;\n}\n\n/** The same run as `linePath`, closed down to the baseline. It takes the curve so a filled series\n * and its own line share one edge - drawn apart, a smooth line floats off a straight-edged fill.\n *\n * @internal */\nexport function areaPath(\n segment: readonly LinePoint[],\n baselineY: number,\n curve: ChartCurve = 'linear',\n): string {\n if (\n segment.length < 2 ||\n !Number.isFinite(baselineY) ||\n !segment.every(isPlottable)\n ) {\n return '';\n }\n const first = segment[0];\n const last = segment[segment.length - 1];\n const baseline = roundTo(baselineY, COORDINATE_DECIMALS);\n\n return `${linePath(segment, curve)} L ${roundTo(last.x, COORDINATE_DECIMALS)},${baseline} L ${roundTo(first.x, COORDINATE_DECIMALS)},${baseline} Z`;\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 `span / 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(span: number, targetCount: number): number {\n const step = span / 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/** The floor of a domain that has to include zero: zero itself for an all-positive\n * series, and the most negative reading otherwise.\n *\n * @internal */\nexport function domainMinOf(values: readonly number[]): number {\n return values.reduce((min, value) => Math.min(min, value), 0);\n}\n\n/** @internal */\nexport function tickValues(\n domainMin: number,\n domainMax: number,\n targetCount: number,\n): number[] {\n const span = domainMax - domainMin;\n if (!Number.isFinite(span) || span <= 0) {\n return [0];\n }\n const step = tickIncrement(span, targetCount);\n const first = Math.floor(domainMin / step);\n const last = Math.ceil(domainMax / step);\n const out: number[] = [];\n for (let i = first; i <= last; i++) {\n out.push(i * step);\n }\n\n return out;\n}\n\n/** @internal */\nexport interface NiceDomain {\n readonly min: number;\n readonly max: number;\n}\n\n/** @internal */\nexport function niceDomain(\n domainMin: number,\n domainMax: number,\n targetCount: number,\n): NiceDomain {\n const span = domainMax - domainMin;\n if (!Number.isFinite(span) || span <= 0) {\n return { min: 0, max: 0 };\n }\n const step = tickIncrement(span, targetCount);\n\n return {\n min: Math.floor(domainMin / step) * step,\n max: Math.ceil(domainMax / step) * step,\n };\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 domainMin: number,\n domainMax: number,\n rangeSize: number,\n): (value: number) => number {\n const span = domainMax - domainMin;\n if (!Number.isFinite(span) || span <= 0) {\n return () => 0;\n }\n\n return (value) => ((value - domainMin) / span) * rangeSize;\n}\n\n/** @internal */\nexport interface PointScale {\n readonly step: number;\n readonly count: number;\n position(index: number): number;\n indexAt(offset: number): number;\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/** Positions for marks that sit AT a category rather than inside it — the readings of a line.\n * The first is at the plot's start and the last at its end, so the run fills the axis rather than\n * floating half a slot inside it. A single reading has no run to fill and takes the middle.\n *\n * `step` is the distance between neighbours, which is what a crosshair band is a slot of; at the\n * two ends that slot is half outside the plot and the caller clamps it.\n *\n * @internal */\nexport function pointScale(count: number, rangeSize: number): PointScale {\n const total = Number.isFinite(count) && count > 0 ? Math.floor(count) : 0;\n const size = Number.isFinite(rangeSize) && rangeSize > 0 ? rangeSize : 0;\n if (total === 0) {\n return { step: 0, count: 0, position: () => 0, indexAt: () => -1 };\n }\n if (total === 1) {\n return {\n step: size,\n count: 1,\n position: () => size / 2,\n indexAt: () => 0,\n };\n }\n const step = size / (total - 1);\n\n return {\n step,\n count: total,\n position: (index) => Math.min(Math.max(index, 0), total - 1) * step,\n // Nearest reading, not the slot the pointer is over: with the ends on the axes the first and\n // last slots are half-width, and rounding is what makes both of them reachable.\n indexAt: (offset) => {\n if (!Number.isFinite(offset) || step === 0) {\n return -1;\n }\n const index = Math.round(offset / step);\n\n return Math.min(Math.max(index, 0), total - 1);\n },\n };\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\nconst ROUND_STEP_FACTORS = [1, 2, 5, 10];\n// A step divided out of a domain and multiplied back rarely lands on itself, so a\n// candidate equal to the minimum can compare as smaller by one bit and push the\n// whole axis up a rung.\nconst ROUND_STEP_TOLERANCE = 1 - 1e-12;\n\n/** The smallest 1/2/5/10 x power-of-ten step that is not below `minimumStep`.\n * `niceDomain` picks its own number of intervals, so it cannot answer this: a second\n * axis drawn against the first's gridlines has to reach its data within the intervals\n * the first already drew.\n *\n * @internal */\nexport function roundStepAtLeast(minimumStep: number): number {\n if (!Number.isFinite(minimumStep) || minimumStep <= 0) {\n return 0;\n }\n const base = Math.pow(10, Math.floor(Math.log10(minimumStep)));\n for (const factor of ROUND_STEP_FACTORS) {\n const candidate = factor * base;\n if (candidate >= minimumStep * ROUND_STEP_TOLERANCE) {\n return candidate;\n }\n }\n\n return 10 * base;\n}\n","import type { AnimationCallbackEvent } from '@angular/core';\n\n// The whole spread of a series' arrival. Past it the entrance stops reading as one gesture and\n// starts reading as a queue.\nconst STAGGER_BUDGET_MS = 260;\n\n/** Entrance delay for the mark at `index` of `count`, in milliseconds: `stepMs` apart, narrowed so\n * the last mark starts within the budget. Spread evenly rather than capped, so a long series still\n * arrives in order instead of landing all at once past the cap. `stepMs` of `0` means no stagger.\n *\n * @internal */\nexport function staggerDelay(\n index: number,\n count: number,\n stepMs: number,\n): number {\n if (!(stepMs > 0) || !Number.isFinite(index) || index <= 0 || count <= 1) {\n return 0;\n }\n\n return index * Math.min(stepMs, STAGGER_BUDGET_MS / (count - 1));\n}\n\n/** Starts a mark's exit, bound as `(animate.leave)=\"leaveMark($event)\"`: `_chart-motion.scss`\n * animates `.mark-leave`, and Angular removes the mark on its `animationend`. The function form,\n * not `animate.leave=\"mark-leave\"`: the class form calls `getAnimations()` once per leaving mark,\n * and in Chrome that call costs more the more animations are running.\n *\n * @internal */\nexport function leaveMark(event: AnimationCallbackEvent): void {\n event.target.classList.add('mark-leave');\n}\n","/** Delays a chart's answer to a resting pointer.\n *\n * @internal */\nexport interface ChartDwell {\n /** Runs `answer` once the pointer has rested on `target` for the delay. Focus, touch and a chart\n * that has already answered the pointer run it at once. Asking again for the same `target`\n * keeps the running wait and swaps in the newer `answer`. */\n schedule(target: unknown, answer: () => void, event: Event): void;\n /** Drops a wait that has not run yet. */\n cancel(): void;\n}\n\n// A chart stays warm from its first answer until the pointer leaves it, so a reader moving along\n// the marks is answered at once rather than waiting at every mark. One set for the whole page:\n// a legend and the plot beside it are one chart.\nconst warmCharts = new WeakSet<Element>();\n\nfunction chartOf(event: Event): Element | null {\n const node = event.currentTarget ?? event.target;\n\n return node instanceof Element ? node.closest('figure') : null;\n}\n\nfunction warmUp(chart: Element): void {\n if (warmCharts.has(chart)) {\n return;\n }\n warmCharts.add(chart);\n const coolOnLeave = (event: PointerEvent): void => {\n if (!(event.target instanceof Node) || !chart.contains(event.target)) {\n warmCharts.delete(chart);\n document.removeEventListener('pointerover', coolOnLeave, true);\n }\n };\n document.addEventListener('pointerover', coolOnLeave, true);\n}\n\n/** Call from anywhere; the wait is cancelled by the caller's own `leave`. `delayMs` is read at each\n * `schedule`, so a config that changes is picked up on the next rest.\n *\n * @internal */\nexport function chartDwell(delayMs: () => number): ChartDwell {\n let waiting: {\n readonly target: unknown;\n answer: () => void;\n readonly timer: ReturnType<typeof setTimeout>;\n } | null = null;\n\n const cancel = (): void => {\n if (waiting) {\n clearTimeout(waiting.timer);\n waiting = null;\n }\n };\n\n return {\n schedule(target, answer, event) {\n const pointer =\n typeof PointerEvent !== 'undefined' &&\n event instanceof PointerEvent &&\n event.pointerType !== 'touch';\n const chart = chartOf(event);\n const delay = Math.max(delayMs(), 0);\n if (!pointer || delay === 0 || (chart && warmCharts.has(chart))) {\n cancel();\n answer();\n if (pointer && chart) {\n warmUp(chart);\n }\n\n return;\n }\n if (waiting && waiting.target === target) {\n waiting.answer = answer;\n\n return;\n }\n cancel();\n const timer = setTimeout(() => {\n const ready = waiting;\n waiting = null;\n ready?.answer();\n if (chart) {\n warmUp(chart);\n }\n }, delay);\n waiting = { target, answer, timer };\n },\n cancel,\n };\n}\n","import {\n DestroyRef,\n NgZone,\n afterNextRender,\n computed,\n inject,\n signal,\n} from '@angular/core';\nimport type { ElementRef, Signal } from '@angular/core';\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/** The mark `index` within `scope`. `within` narrows the search for a chart whose marks repeat the\n * same index once per series.\n *\n * @internal */\nexport function markAt(\n scope: Element | null,\n index: number,\n within = '',\n): Element | null {\n return scope?.querySelector(`${within}[data-mark-index=\"${index}\"]`) ?? null;\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.\n *\n * @internal */\nexport function focusMark(\n scope: Element | null,\n index: number,\n within = '',\n): void {\n const target = markAt(scope, index, within);\n if (target instanceof HTMLElement || target instanceof SVGElement) {\n target.focus();\n }\n}\n\n/** A chart's roving tab stop.\n *\n * One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not every\n * mouse-operable control has to be separately focusable, and that is what keeps a twenty-five\n * mark chart from being twenty-five stops in the page's tab order.\n *\n * @internal */\nexport interface RovingMarks {\n /** The index of the one mark that carries `tabindex=\"0\"`. */\n readonly tabStop: Signal<number>;\n /** Makes `index` the tab stop, for a mark that has taken focus. */\n focus(index: number): void;\n /** Handles an arrow, Home or End pressed on the mark at `index`: moves the tab stop and DOM focus\n * to the next mark inside `scope`. Any other key is left alone. */\n navigate(event: KeyboardEvent, index: number, scope: Element | null): void;\n}\n\n/** @internal */\nexport function rovingMarks(count: () => number): RovingMarks {\n const roving = signal(0);\n\n return {\n tabStop: computed(() => Math.min(roving(), Math.max(0, count() - 1))),\n focus: (index) => roving.set(index),\n navigate(event, index, scope) {\n const next = nextRovingIndex(event.key, index, count());\n if (next === null) {\n return;\n }\n event.preventDefault();\n roving.set(next);\n focusMark(scope, next);\n },\n };\n}\n\n/** @internal */\nexport interface MarkHit {\n readonly element: Element;\n readonly index: number;\n}\n\n/** The mark an event on the marks' parent came from - the nearest `[data-mark-index]` inside that\n * parent - for a chart that listens once per series rather than once per mark. `null` when the\n * event did not start on a mark.\n *\n * @internal */\nexport function markOf(\n event: Event,\n scope: EventTarget | null = event.currentTarget,\n): MarkHit | null {\n const target = event.target;\n if (!(scope instanceof Element) || !(target instanceof Element)) {\n return null;\n }\n const element = target.closest('[data-mark-index]');\n if (!element || !scope.contains(element)) {\n return null;\n }\n\n return { element, index: Number(element.getAttribute('data-mark-index')) };\n}\n\n/** Focus arriving on and leaving a mark inside `scope`, heard from the document rather than from\n * the marks' group: Chromium makes an SVG element focusable once it has a `focus`, `blur`,\n * `focusin` or `focusout` listener, so a group that listened would take focus on a click and\n * ring every mark it holds. Call from an injection context.\n *\n * @internal */\nexport function listenForMarkFocus(\n scope: ElementRef<Element>,\n onFocus: (event: FocusEvent, mark: MarkHit) => void,\n onBlur?: (event: FocusEvent, mark: MarkHit) => void,\n): void {\n const zone = inject(NgZone);\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const host = scope.nativeElement;\n const document = host.ownerDocument;\n const forward =\n (handler?: (event: FocusEvent, mark: MarkHit) => void) =>\n (event: FocusEvent): void => {\n const hit = handler && markOf(event, host);\n if (hit) {\n handler(event, hit);\n }\n };\n const focusIn = forward(onFocus);\n const focusOut = forward(onBlur);\n // Outside the zone: every focus change on the page reaches every series, and the handlers\n // write signals, which schedule the render they need.\n zone.runOutsideAngular(() => {\n document.addEventListener('focusin', focusIn);\n document.addEventListener('focusout', focusOut);\n });\n destroyRef.onDestroy(() => {\n document.removeEventListener('focusin', focusIn);\n document.removeEventListener('focusout', focusOut);\n });\n });\n}\n","import type {\n ChartThreshold,\n DsIntl,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { 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[], words: DsIntl['chart']): 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 words.trendRisingThroughout;\n }\n if (fell) {\n return words.trendFallingThroughout;\n }\n if (last > first) {\n return words.trendRisingOverall;\n }\n if (last < first) {\n return words.trendFallingOverall;\n }\n\n return words.trendFlat;\n}\n\n/** Where the readings sit against each reference line, appended to the description. A line the\n * reader cannot see is a line that does not exist for them, and its whole point is the\n * comparison, not its position. */\nfunction describeThresholds(\n thresholds: readonly ChartThreshold[],\n points: readonly SummaryPoint[],\n format: (value: number) => string,\n words: DsIntl['chart'],\n): string {\n const total = points.length;\n\n return thresholds\n .map((threshold) => {\n const name = threshold.label ?? words.threshold;\n if (threshold.to == null) {\n const above = points.filter(\n (point) => point.value > threshold.value,\n ).length;\n\n return ` ${words.thresholdAbove(name, format(threshold.value), above, total)}`;\n }\n const low = Math.min(threshold.value, threshold.to);\n const high = Math.max(threshold.value, threshold.to);\n const inside = points.filter(\n (point) => point.value >= low && point.value <= high,\n ).length;\n\n return ` ${words.thresholdInside(name, format(low), format(high), inside, total)}`;\n })\n .join('');\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 words: DsIntl['chart'],\n label: string,\n points: readonly SummaryPoint[],\n format: (value: number) => string = formatValue,\n tableFollows = true,\n thresholds: readonly ChartThreshold[] = [],\n): string {\n if (points.length === 0) {\n return words.noData(label);\n }\n const pointer =\n describeThresholds(thresholds, points, format, words) +\n (tableFollows ? ` ${words.tableFollows}` : '');\n if (points.length === 1) {\n return `${words.onePoint(label, format(points[0].value), 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 `${words.range(label, points.length, format(lowest.value), format(highest.value))} ` +\n `${trendOf(\n points.map((point) => point.value),\n words,\n )}. ` +\n `${words.extremes(highest.label, format(highest.value), lowest.label, 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 * `appWideDefaultApplies` is read lazily and drops the middle step for a control that\n * is not a form row: `ds-button` renders the same message line but does not sit in a\n * field column, so an app-wide field setting must not give it an empty row.\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 appWideDefaultApplies: () => boolean = () => true,\n): Signal<boolean> {\n const config = inject(DS_CONFIG);\n\n return computed(\n () =>\n reserveMessage() ??\n (appWideDefaultApplies()\n ? (config.field?.reserveMessage ?? false)\n : 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. What an unset value falls back\n * to is the subclass's call, in `reserveMessageResolved`: a field takes\n * `DS_CONFIG.field.reserveMessage`, a button does not. */\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 /** Whether an unset `reserveMessage` falls back to `DS_CONFIG.field.reserveMessage`.\n * True for a field, whose row reserves so its neighbours do not shift; `ds-button`\n * turns it off, because a button is not in that column and an app-wide field\n * setting would otherwise give every button an empty message row. Read lazily, so\n * a subclass initializer running after this one still decides it. */\n protected readonly reserveFollowsFieldDefault: boolean = true;\n\n readonly reserveMessageResolved = resolveReserveMessage(\n this.reserveMessage,\n () => this.reserveFollowsFieldDefault,\n );\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\nfunction blurOwnControl(host: HTMLElement): void {\n const active = host.ownerDocument.activeElement;\n if (active instanceof HTMLElement && host.contains(active)) {\n active.blur();\n }\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 /**\n * The counterpart of `focus()`: drops focus if it sits anywhere inside this\n * control - the input, a picker trigger, the OTP cell that has it - so no\n * subclass overrides it. A portaled panel is outside the host and is left alone.\n * For a host that navigates away after `clear()`, which keeps focus on purpose.\n */\n blur(): void {\n blurOwnControl(this.hostElement.nativeElement);\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 /** The counterpart of `focus()` - see `DsControlValueAccessor.blur`. */\n blur(): void {\n blurOwnControl(this.hostElement.nativeElement);\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-max-height',\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-font-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// The teardown guarantee for the leave: a pane that is display:none, a consumer stylesheet\n// that removed the animation, and a 0s reduced-motion duration (whose animationend is not\n// reliably delivered) all end here. 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';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/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 * @internal\n */\nexport function announceOptionCount(\n count: Signal<number>,\n active: Signal<boolean>,\n): void {\n const documentRef = inject(DOCUMENT);\n const intl = inject(DS_INTL);\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 region.textContent = intl().picker.resultCount(count());\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","import { computed, inject, signal, type Signal } from '@angular/core';\nimport {\n DS_INTL,\n injectDsLocale,\n resolveWithConfig,\n} from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { chartValueFormat } from './charts-format';\n\n/** The inputs every chart carries for the decisions an app makes once rather than per plot.\n *\n * @internal */\nexport interface ChartDefaultInputs {\n readonly frame: Signal<ChartFrame | null>;\n /** Absent on a chart with no annex table of its own - the container, the heat map. */\n readonly dataTable?: Signal<ChartDataTable | null>;\n readonly emptyText: Signal<string | null>;\n readonly errorText: Signal<string | null>;\n readonly valueFormat: Signal<ChartValueFormat | null>;\n /** Absent on a chart with no tooltip of its own. */\n readonly tooltipLingerMs?: Signal<number | null>;\n /** Absent on a chart with nothing to pin. */\n readonly pinOnClick?: Signal<boolean | null>;\n readonly hoverDelayMs?: Signal<number | null>;\n}\n\nconst NO_DATA_TABLE = signal<ChartDataTable | null>(null);\nconst NO_LINGER = signal<number | null>(null);\nconst NO_PIN = signal<boolean | null>(null);\nconst NO_DELAY = signal<number | null>(null);\n\n/** How long a resting pointer waits before a chart answers it, when nothing sets it.\n *\n * @internal */\nexport const CHART_HOVER_DELAY_MS = 500;\n\n/** Each resolved input → `DS_CONFIG.chart` → the built-in; copy resolves input → `DS_INTL.chart`.\n * Call from an injection context.\n *\n * @internal */\nexport function resolveChartDefaults(inputs: ChartDefaultInputs) {\n const locale = injectDsLocale();\n const intl = inject(DS_INTL);\n\n return {\n locale,\n frame: resolveWithConfig(\n inputs.frame,\n (config) => config.chart?.frame,\n 'auto' as ChartFrame,\n ),\n dataTable: resolveWithConfig(\n inputs.dataTable ?? NO_DATA_TABLE,\n (config) => config.chart?.dataTable,\n 'none' as ChartDataTable,\n ),\n emptyText: computed(() => inputs.emptyText() ?? intl().chart.empty),\n errorText: computed(() => inputs.errorText() ?? intl().chart.error),\n valueFormat: resolveWithConfig(\n inputs.valueFormat,\n (config) => config.chart?.valueFormat,\n chartValueFormat(locale),\n ),\n tooltipLingerMs: resolveWithConfig(\n inputs.tooltipLingerMs ?? NO_LINGER,\n (config) => config.chart?.tooltipLingerMs,\n 0,\n ),\n pinOnClick: resolveWithConfig(\n inputs.pinOnClick ?? NO_PIN,\n (config) => config.chart?.pinOnClick,\n true,\n ),\n hoverDelayMs: resolveWithConfig(\n inputs.hoverDelayMs ?? NO_DELAY,\n (config) => config.chart?.hoverDelayMs,\n CHART_HOVER_DELAY_MS,\n ),\n };\n}\n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AAK,MAAM,CAAC,KAAK,EAAE,YAAY,EACtC,oBAAoB,CACrB;KACF;AACH;;ACnFA;;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-render-gate.ts","../../../src/lib/components/charts-label-fit.ts","../../../src/lib/components/charts-decimate.ts","../../../src/lib/components/charts-path.ts","../../../src/lib/components/charts-scale.ts","../../../src/lib/components/charts-motion.ts","../../../src/lib/components/charts-dwell.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/charts-defaults.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 heat1: 'var(--ds-chart-heat-1-color)',\n heat2: 'var(--ds-chart-heat-2-color)',\n heat3: 'var(--ds-chart-heat-3-color)',\n heat4: 'var(--ds-chart-heat-4-color)',\n heat5: 'var(--ds-chart-heat-5-color)',\n heat6: 'var(--ds-chart-heat-6-color)',\n heat7: 'var(--ds-chart-heat-7-color)',\n heat8: 'var(--ds-chart-heat-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\n/** @internal See chartColors. */\nexport const CHART_HEAT_COLORS: readonly string[] = [\n chartColors.heat1,\n chartColors.heat2,\n chartColors.heat3,\n chartColors.heat4,\n chartColors.heat5,\n chartColors.heat6,\n chartColors.heat7,\n chartColors.heat8,\n];\n","import type { ChartValueFormat } from '@ids-group-ltd/ids-design-system/core';\n\nconst 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\nconst chartFormats = new Map<string, ChartValueFormat>();\n\n/** The built-in `valueFormat` in one locale: compact on a tick (`1.2M`), spelled out everywhere\n * else (`1,248,392`). A caller-supplied formatter receives the same `location` and decides for\n * itself; this is only the default.\n *\n * @internal */\nexport function chartValueFormat(locale: string): ChartValueFormat {\n let format = chartFormats.get(locale);\n if (!format) {\n const compact = new Intl.NumberFormat(locale, {\n notation: 'compact',\n maximumFractionDigits: 1,\n });\n const full = new Intl.NumberFormat(locale);\n format = (value, location) =>\n !Number.isFinite(value)\n ? '—'\n : location === 'tick'\n ? compact.format(value)\n : full.format(value);\n chartFormats.set(locale, format);\n }\n\n return format;\n}\n\nconst percentFormatters = new Map<string, Intl.NumberFormat>();\n\nfunction percentFormatter(locale: string, digits: 0 | 1): Intl.NumberFormat {\n const key = `${locale}|${digits}`;\n let formatter = percentFormatters.get(key);\n if (!formatter) {\n formatter = new Intl.NumberFormat(locale, {\n style: 'percent',\n minimumFractionDigits: digits,\n maximumFractionDigits: digits,\n });\n percentFormatters.set(key, formatter);\n }\n\n return formatter;\n}\n\n/** @internal */\nexport function formatPercent(\n value: number,\n total: number,\n locale: string,\n): string {\n if (!total || !Number.isFinite(value) || !Number.isFinite(total)) {\n return '—';\n }\n const fraction = value / total;\n const formatter = percentFormatter(locale, 1);\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 (fraction !== 0 && Math.abs(fraction) < 0.0005) {\n return fraction > 0\n ? `<${formatter.format(0.001)}`\n : `>${formatter.format(-0.001)}`;\n }\n\n return formatter.format(fraction);\n}\n\n/** A whole-number percentage (the pie's largest-remainder shares), in `locale`.\n *\n * @internal */\nexport function formatWholePercent(percent: number, locale: string): string {\n return percentFormatter(locale, 0).format(percent / 100);\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, as a bare percentage.\n *\n * Empty for a lone mark, which is the whole of its own total, 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, so a negative mark has no share rather than a misleading one.\n *\n * @internal */\nexport function shareOfTotal(\n values: readonly number[],\n index: number,\n locale: string,\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, locale) : '';\n}\n\n/** The same share, phrased for a tooltip line, where no column header stands above it to say what\n * the percentage is OF.\n *\n * @internal */\nexport function describeShare(\n values: readonly number[],\n index: number,\n locale: string,\n phrase: (share: string) => string,\n): string {\n const share = shareOfTotal(values, index, locale);\n\n return share ? phrase(share) : '';\n}\n","import {\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n Signal,\n WritableSignal,\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 element = host.nativeElement;\n widths.set(element, width);\n sharedObserver().observe(element);\n inject(DestroyRef).onDestroy(() => {\n sharedObserver().unobserve(element);\n widths.delete(element);\n });\n\n return width.asReadonly();\n}\n\nconst widths = new WeakMap<Element, WritableSignal<number>>();\nlet observer: ResizeObserver | null = null;\n\n// One observer for every chart on the page, so a resize is one callback with every entry in it\n// rather than one callback per chart.\nfunction sharedObserver(): ResizeObserver {\n observer ??= new ResizeObserver((entries) => {\n for (const entry of entries) {\n widths.get(entry.target)?.set(Math.round(entry.contentRect.width));\n }\n });\n\n return observer;\n}\n","import {\n DestroyRef,\n ElementRef,\n InjectionToken,\n PLATFORM_ID,\n Signal,\n afterNextRender,\n inject,\n signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { DS_CONFIG } from '@ids-group-ltd/ids-design-system/core';\n\n/** Provided by a chart that has already waited for the viewport, so the `ds-chart` it draws\n * through builds at once instead of waiting a second time.\n *\n * @internal */\nexport const CHART_RENDER_GATE_PASSED = new InjectionToken<boolean>(\n 'CHART_RENDER_GATE_PASSED',\n);\n\ntype Build = () => void;\n\nconst builders = new WeakMap<Element, Build>();\nconst near = new Map<Element, Build>();\nconst ahead = new Map<Element, Build>();\nconst observers = new Map<Element | null, Map<string, IntersectionObserver>>();\nlet draining = false;\nlet idleScheduled = false;\nlet budgetMs = 8;\n\nfunction drain(): void {\n const start = performance.now();\n for (const [host, build] of near) {\n if (performance.now() - start > budgetMs) {\n setTimeout(drain);\n\n return;\n }\n near.delete(host);\n build();\n }\n draining = false;\n}\n\n// An idle period with less than this left would run a chart's build into the next frame.\nconst IDLE_ROOM_MS = 12;\n\nfunction buildWhileIdle(deadline: IdleDeadline): void {\n idleScheduled = false;\n for (const [host, build] of ahead) {\n if (deadline.timeRemaining() < IDLE_ROOM_MS) {\n break;\n }\n ahead.delete(host);\n build();\n }\n scheduleIdle();\n}\n\nfunction scheduleIdle(): void {\n if (\n idleScheduled ||\n !ahead.size ||\n typeof requestIdleCallback === 'undefined'\n ) {\n return;\n }\n idleScheduled = true;\n requestIdleCallback(buildWhileIdle);\n}\n\nfunction observer(\n root: Element | null,\n margin: string,\n queue: Map<Element, Build>,\n schedule: () => void,\n): IntersectionObserver {\n let byMargin = observers.get(root);\n if (!byMargin) {\n byMargin = new Map();\n observers.set(root, byMargin);\n }\n const key = `${queue === near ? 'near' : 'ahead'} ${margin}`;\n let found = byMargin.get(key);\n if (!found) {\n found = new IntersectionObserver(\n (entries) => {\n for (const entry of entries) {\n const build = builders.get(entry.target);\n // A chart the reader has already scrolled past leaves the queue instead of being built\n // behind them.\n if (build && entry.isIntersecting) {\n queue.set(entry.target, build);\n } else {\n queue.delete(entry.target);\n }\n }\n schedule();\n },\n { root, rootMargin: margin },\n );\n byMargin.set(key, found);\n }\n\n return found;\n}\n\nfunction scheduleDrain(): void {\n if (near.size && !draining) {\n draining = true;\n setTimeout(drain);\n }\n}\n\n// A margin on the root only widens the root: an element inside a scrolling container is clipped by\n// that container first, so the container has to BE the root for the margin to reach past its edge.\n// The overflow test alone is not enough - a box that only scrolls sideways computes `overflow-y:\n// auto` too - so the container also has to be taller inside than out.\nfunction scrollRoot(host: Element): Element | null {\n for (let node = host.parentElement; node; node = node.parentElement) {\n const overflow = getComputedStyle(node).overflowY;\n if (\n (overflow === 'auto' ||\n overflow === 'scroll' ||\n overflow === 'overlay') &&\n node.scrollHeight > node.clientHeight\n ) {\n return node;\n }\n }\n\n return null;\n}\n\n/** Whether a chart may build its plot yet, under `DS_CONFIG.chart.rendering`. `true` from the\n * start unless `deferUntilVisible` is on; with it on, `true` once the chart nears the viewport or\n * is built ahead while the page is idle, and it stays `true`. Call from an injection context.\n *\n * @internal */\nexport function chartRenderGate(): Signal<boolean> {\n const rendering = inject(DS_CONFIG).chart?.rendering;\n // `skipSelf`: a preset provides the token to its own view, and must not read it back itself.\n const passed = inject(CHART_RENDER_GATE_PASSED, {\n optional: true,\n skipSelf: true,\n });\n if (\n !rendering?.deferUntilVisible ||\n passed ||\n !isPlatformBrowser(inject(PLATFORM_ID)) ||\n typeof IntersectionObserver === 'undefined'\n ) {\n return signal(true).asReadonly();\n }\n\n const ready = signal(false);\n const host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n budgetMs = rendering.frameBudgetMs ?? budgetMs;\n const skipWhileOffscreen = rendering.skipWhileOffscreen ?? true;\n let release: () => void = () => undefined;\n\n afterNextRender(() => {\n const root = scrollRoot(host);\n const watchers = [\n observer(root, rendering.visibleMargin ?? '10% 0px', near, scheduleDrain),\n ];\n if (rendering.buildAheadWhileIdle ?? true) {\n watchers.push(\n observer(\n root,\n rendering.buildAheadMargin ?? '100% 0px',\n ahead,\n scheduleIdle,\n ),\n );\n }\n release = () => {\n for (const watcher of watchers) {\n watcher.unobserve(host);\n }\n near.delete(host);\n ahead.delete(host);\n };\n builders.set(host, () => {\n release();\n if (skipWhileOffscreen) {\n // `auto` remembers the height the chart last rendered at, so skipping it moves nothing.\n host.style.contentVisibility = 'auto';\n host.style.containIntrinsicBlockSize = 'auto 300px';\n }\n ready.set(true);\n });\n for (const watcher of watchers) {\n watcher.observe(host);\n }\n });\n inject(DestroyRef).onDestroy(() => release());\n\n return ready.asReadonly();\n}\n","/** A label turned 45 degrees takes this fraction of its width across the axis. 45 is where the\n * policy stops: past it the eye has to tilt rather than glance. */\nconst ROTATED_FOOTPRINT = Math.sin(Math.PI / 4);\n\n/** Two labels that merely fail to overlap still read as one run of text, so a label's footprint is\n * its width PLUS this. 16 sits in the middle of the 12-36 band the probe's cases allow, so a later\n * nudge does not flip an interval. */\nconst LABEL_GAP = 16;\n\n/** The WIDEST label decides for all of them: an axis that thins on the average still collides on\n * the one long month name, and a reader meets the collision rather than the average.\n *\n * @internal */\nexport function labelInterval(\n labelWidths: readonly number[],\n step: number,\n rotated: boolean,\n): number {\n const usable = labelWidths.filter((width) => Number.isFinite(width));\n if (usable.length === 0 || !Number.isFinite(step) || step <= 0) {\n return 1;\n }\n const widest = usable.reduce((max, width) => Math.max(max, width), 0);\n const footprint = (rotated ? widest * ROTATED_FOOTPRINT : widest) + LABEL_GAP;\n\n return Math.max(1, Math.ceil(footprint / step));\n}\n\n/** Asked before thinning, so the axis spends a tilt before it spends a reading.\n *\n * @internal */\nexport function rotationWouldFit(\n labelWidths: readonly number[],\n step: number,\n): boolean {\n return (\n labelInterval(labelWidths, step, false) > 1 &&\n labelInterval(labelWidths, step, true) === 1\n );\n}\n","/** One reading on two continuous scales. Structural and local: the decimators work on any pair\n * of continuous coordinates, and naming the published type here would put a chart's own type in\n * the shared entry point. */\ninterface Reading {\n readonly x: number;\n readonly y: number;\n}\n\n/** A series only decimates past FOUR times the target, not two: at two the saving is invisible on\n * any profile and the loss of detail is not, so the trade is the wrong way round. */\nconst DECIMATION_HEADROOM = 4;\n\n/** How many marks the plot can carry: one per pixel of its own width. Drawing two marks where the\n * screen has one pixel is two DOM nodes the reader cannot tell apart.\n *\n * @internal */\nexport function decimationTarget(plotWidth: number): number {\n return Number.isFinite(plotWidth) && plotWidth > 0\n ? Math.floor(plotWidth)\n : 0;\n}\n\n/** @internal */\nexport function needsDecimating(count: number, target: number): boolean {\n return target > 0 && count > target * DECIMATION_HEADROOM;\n}\n\n/** Buckets the series by position and keeps each bucket's highest and lowest reading.\n *\n * The default, because it is the only one of the two that can PROMISE something: a bucket's\n * extremum is in the output by construction, so a spike the reader is looking for cannot be the\n * point that was dropped. It also parallelises and stays stable while the reader pans, since a\n * bucket's answer does not depend on the buckets around it.\n *\n * @internal */\nexport function minMaxDecimate(\n points: readonly Reading[],\n target: number,\n): readonly Reading[] {\n if (target <= 0 || points.length <= target) {\n return points;\n }\n // Two points leave each bucket, so the bucket count is half the budget.\n const buckets = Math.max(1, Math.floor(target / 2));\n const size = points.length / buckets;\n const kept: Reading[] = [];\n\n for (let bucket = 0; bucket < buckets; bucket++) {\n const from = Math.floor(bucket * size);\n const to = Math.min(points.length, Math.floor((bucket + 1) * size));\n if (from >= to) {\n continue;\n }\n let lowest = points[from];\n let highest = points[from];\n for (let index = from + 1; index < to; index++) {\n if (points[index].y < lowest.y) {\n lowest = points[index];\n }\n if (points[index].y > highest.y) {\n highest = points[index];\n }\n }\n // In the order they occur, so the output still reads left to right.\n const [first, second] =\n lowest.x <= highest.x ? [lowest, highest] : [highest, lowest];\n kept.push(first);\n if (second !== first) {\n kept.push(second);\n }\n }\n\n return kept;\n}\n\n/** Largest Triangle Three Buckets: keeps the reading in each bucket that makes the biggest triangle\n * with the point already kept and the next bucket's centre of mass.\n *\n * It draws a truer SHAPE than MinMax at the same budget, and it makes no promise about the\n * extremum - a spike is dropped whenever a different point describes the silhouette better. Reach\n * for it where the outline is the reading and an individual point is not.\n *\n * @internal */\nexport function lttbDecimate(\n points: readonly Reading[],\n target: number,\n): readonly Reading[] {\n if (target <= 2 || points.length <= target) {\n return points;\n }\n const kept: Reading[] = [points[0]];\n // The first and the last are fixed, so the buckets divide what is between them.\n const size = (points.length - 2) / (target - 2);\n let previous = points[0];\n\n for (let bucket = 0; bucket < target - 2; bucket++) {\n const from = Math.floor(bucket * size) + 1;\n const to = Math.min(points.length - 1, Math.floor((bucket + 1) * size) + 1);\n const nextFrom = to;\n const nextTo = Math.min(\n points.length - 1,\n Math.floor((bucket + 2) * size) + 1,\n );\n\n let averageX = 0;\n let averageY = 0;\n const span = Math.max(1, nextTo - nextFrom);\n for (let index = nextFrom; index < nextTo; index++) {\n averageX += points[index].x;\n averageY += points[index].y;\n }\n averageX /= span;\n averageY /= span;\n\n let best = points[from];\n let bestArea = -1;\n for (let index = from; index < to; index++) {\n const area = Math.abs(\n (previous.x - averageX) * (points[index].y - previous.y) -\n (previous.x - points[index].x) * (averageY - previous.y),\n );\n if (area > bestArea) {\n bestArea = area;\n best = points[index];\n }\n }\n kept.push(best);\n previous = best;\n }\n\n kept.push(points[points.length - 1]);\n\n return kept;\n}\n","import type { ChartCurve } from '@ids-group-ltd/ids-design-system/core';\n\n/** One plotted reading, in the canvas's own coordinates.\n *\n * @internal */\nexport interface LinePoint {\n readonly categoryIndex: number;\n readonly x: number;\n readonly y: number;\n readonly value: number;\n}\n\nconst COORDINATE_DECIMALS = 2;\n\nfunction roundTo(value: number, decimals: number): number {\n if (!Number.isFinite(value)) {\n return 0;\n }\n\n return Number(value.toFixed(decimals));\n}\n\nfunction isPlottable(point: LinePoint): boolean {\n return Number.isFinite(point.x) && Number.isFinite(point.y);\n}\n\nfunction coordinatePair(point: LinePoint): string {\n return `${roundTo(point.x, COORDINATE_DECIMALS)},${roundTo(point.y, COORDINATE_DECIMALS)}`;\n}\n\n/** The unbroken runs of a series: a missing reading ends one run and starts the next.\n *\n * @internal */\nexport function lineSegments(\n points: readonly (LinePoint | null)[],\n): LinePoint[][] {\n const segments: LinePoint[][] = [];\n let current: LinePoint[] = [];\n for (const point of points) {\n if (point === null) {\n if (current.length > 0) {\n segments.push(current);\n }\n current = [];\n } else {\n current.push(point);\n }\n }\n if (current.length > 0) {\n segments.push(current);\n }\n\n return segments;\n}\n\n/** `''` rather than a partial list when a coordinate is unplottable: one `NaN` in a\n * `points` list or a path `d` voids the whole attribute, and the line then vanishes\n * with nothing logged.\n *\n * @internal */\nexport function polylinePoints(segment: readonly LinePoint[]): string {\n if (segment.length === 0 || !segment.every(isPlottable)) {\n return '';\n }\n\n return segment.map((point) => coordinatePair(point)).join(' ');\n}\n\n/** Fritsch-Carlson tangents: the slope at each reading, clamped so no segment can turn back on\n * itself. A zero slope on either side of a reading pins the tangent flat, which is what keeps a\n * plateau flat instead of bulging through it. */\nfunction monotoneTangents(segment: readonly LinePoint[]): number[] {\n const count = segment.length;\n const secants: number[] = [];\n for (let index = 0; index < count - 1; index++) {\n const run = segment[index + 1].x - segment[index].x;\n secants.push(\n run === 0 ? 0 : (segment[index + 1].y - segment[index].y) / run,\n );\n }\n\n const tangents = [secants[0]];\n for (let index = 1; index < count - 1; index++) {\n const before = secants[index - 1];\n const after = secants[index];\n tangents.push(before * after <= 0 ? 0 : (before + after) / 2);\n }\n tangents.push(secants[count - 2]);\n\n for (let index = 0; index < count - 1; index++) {\n const secant = secants[index];\n if (secant === 0) {\n tangents[index] = 0;\n tangents[index + 1] = 0;\n continue;\n }\n // Fritsch-Carlson's circle condition: keeping each tangent within three times the secant it\n // sits on is what makes the cubic monotone on that span.\n const alpha = tangents[index] / secant;\n const beta = tangents[index + 1] / secant;\n const magnitude = Math.hypot(alpha, beta);\n if (magnitude > 3) {\n tangents[index] = (3 / magnitude) * alpha * secant;\n tangents[index + 1] = (3 / magnitude) * beta * secant;\n }\n }\n\n return tangents;\n}\n\nfunction smoothPath(segment: readonly LinePoint[]): string {\n const tangents = monotoneTangents(segment);\n let path = `M ${coordinatePair(segment[0])}`;\n for (let index = 0; index < segment.length - 1; index++) {\n const from = segment[index];\n const to = segment[index + 1];\n const third = (to.x - from.x) / 3;\n const firstControl = {\n x: from.x + third,\n y: from.y + tangents[index] * third,\n };\n const secondControl = {\n x: to.x - third,\n y: to.y - tangents[index + 1] * third,\n };\n path +=\n ` C ${roundTo(firstControl.x, COORDINATE_DECIMALS)},${roundTo(firstControl.y, COORDINATE_DECIMALS)}` +\n ` ${roundTo(secondControl.x, COORDINATE_DECIMALS)},${roundTo(secondControl.y, COORDINATE_DECIMALS)}` +\n ` ${coordinatePair(to)}`;\n }\n\n return path;\n}\n\n/** One unbroken run as a path `d`. `''` rather than a partial path when a coordinate is\n * unplottable: one `NaN` voids the whole attribute and the line vanishes with nothing logged.\n *\n * @internal */\nexport function linePath(\n segment: readonly LinePoint[],\n curve: ChartCurve = 'linear',\n): string {\n if (segment.length === 0 || !segment.every(isPlottable)) {\n return '';\n }\n if (segment.length === 1 || curve === 'linear') {\n return `M ${segment.map((point) => coordinatePair(point)).join(' L ')}`;\n }\n if (curve === 'step') {\n let path = `M ${coordinatePair(segment[0])}`;\n for (const point of segment.slice(1)) {\n path += ` H ${roundTo(point.x, COORDINATE_DECIMALS)} V ${roundTo(point.y, COORDINATE_DECIMALS)}`;\n }\n\n return path;\n }\n\n return smoothPath(segment);\n}\n\n/** The filled band between two edges - a stacked area sitting on the series below it, or a\n * confidence band around a line. The lower edge is walked BACKWARDS, so its curve is rebuilt from\n * the reversed points rather than reused: a monotone cubic is not symmetric, and closing the shape\n * along the forward path would bend the bottom of the band the wrong way.\n *\n * @internal */\nexport function bandPath(\n upper: readonly LinePoint[],\n lower: readonly LinePoint[],\n curve: ChartCurve = 'linear',\n): string {\n if (\n upper.length < 2 ||\n upper.length !== lower.length ||\n !upper.every(isPlottable) ||\n !lower.every(isPlottable)\n ) {\n return '';\n }\n const back = linePath([...lower].reverse(), curve);\n\n return `${linePath(upper, curve)} L ${back.slice('M '.length)} Z`;\n}\n\n/** The same run as `linePath`, closed down to the baseline. It takes the curve so a filled series\n * and its own line share one edge - drawn apart, a smooth line floats off a straight-edged fill.\n *\n * @internal */\nexport function areaPath(\n segment: readonly LinePoint[],\n baselineY: number,\n curve: ChartCurve = 'linear',\n): string {\n if (\n segment.length < 2 ||\n !Number.isFinite(baselineY) ||\n !segment.every(isPlottable)\n ) {\n return '';\n }\n const first = segment[0];\n const last = segment[segment.length - 1];\n const baseline = roundTo(baselineY, COORDINATE_DECIMALS);\n\n return `${linePath(segment, curve)} L ${roundTo(last.x, COORDINATE_DECIMALS)},${baseline} L ${roundTo(first.x, COORDINATE_DECIMALS)},${baseline} Z`;\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 `span / 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(span: number, targetCount: number): number {\n const step = span / 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/** The floor of a domain that has to include zero: zero itself for an all-positive\n * series, and the most negative reading otherwise.\n *\n * @internal */\nexport function domainMinOf(values: readonly number[]): number {\n return values.reduce((min, value) => Math.min(min, value), 0);\n}\n\n/** @internal */\nexport function tickValues(\n domainMin: number,\n domainMax: number,\n targetCount: number,\n): number[] {\n const span = domainMax - domainMin;\n if (!Number.isFinite(span) || span <= 0) {\n return [0];\n }\n const step = tickIncrement(span, targetCount);\n const first = Math.floor(domainMin / step);\n const last = Math.ceil(domainMax / step);\n const out: number[] = [];\n for (let i = first; i <= last; i++) {\n out.push(i * step);\n }\n\n return out;\n}\n\n/** @internal */\nexport interface NiceDomain {\n readonly min: number;\n readonly max: number;\n}\n\n/** @internal */\nexport function niceDomain(\n domainMin: number,\n domainMax: number,\n targetCount: number,\n): NiceDomain {\n const span = domainMax - domainMin;\n if (!Number.isFinite(span) || span <= 0) {\n return { min: 0, max: 0 };\n }\n const step = tickIncrement(span, targetCount);\n\n return {\n min: Math.floor(domainMin / step) * step,\n max: Math.ceil(domainMax / step) * step,\n };\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 domainMin: number,\n domainMax: number,\n rangeSize: number,\n): (value: number) => number {\n const span = domainMax - domainMin;\n if (!Number.isFinite(span) || span <= 0) {\n return () => 0;\n }\n\n return (value) => ((value - domainMin) / span) * rangeSize;\n}\n\n/** @internal */\nexport interface PointScale {\n readonly step: number;\n readonly count: number;\n position(index: number): number;\n indexAt(offset: number): number;\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/** Positions for marks that sit AT a category rather than inside it — the readings of a line.\n * The first is at the plot's start and the last at its end, so the run fills the axis rather than\n * floating half a slot inside it. A single reading has no run to fill and takes the middle.\n *\n * `step` is the distance between neighbours, which is what a crosshair band is a slot of; at the\n * two ends that slot is half outside the plot and the caller clamps it.\n *\n * @internal */\nexport function pointScale(count: number, rangeSize: number): PointScale {\n const total = Number.isFinite(count) && count > 0 ? Math.floor(count) : 0;\n const size = Number.isFinite(rangeSize) && rangeSize > 0 ? rangeSize : 0;\n if (total === 0) {\n return { step: 0, count: 0, position: () => 0, indexAt: () => -1 };\n }\n if (total === 1) {\n return {\n step: size,\n count: 1,\n position: () => size / 2,\n indexAt: () => 0,\n };\n }\n const step = size / (total - 1);\n\n return {\n step,\n count: total,\n position: (index) => Math.min(Math.max(index, 0), total - 1) * step,\n // Nearest reading, not the slot the pointer is over: with the ends on the axes the first and\n // last slots are half-width, and rounding is what makes both of them reachable.\n indexAt: (offset) => {\n if (!Number.isFinite(offset) || step === 0) {\n return -1;\n }\n const index = Math.round(offset / step);\n\n return Math.min(Math.max(index, 0), total - 1);\n },\n };\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\nconst ROUND_STEP_FACTORS = [1, 2, 5, 10];\n// A step divided out of a domain and multiplied back rarely lands on itself, so a\n// candidate equal to the minimum can compare as smaller by one bit and push the\n// whole axis up a rung.\nconst ROUND_STEP_TOLERANCE = 1 - 1e-12;\n\n/** The smallest 1/2/5/10 x power-of-ten step that is not below `minimumStep`.\n * `niceDomain` picks its own number of intervals, so it cannot answer this: a second\n * axis drawn against the first's gridlines has to reach its data within the intervals\n * the first already drew.\n *\n * @internal */\nexport function roundStepAtLeast(minimumStep: number): number {\n if (!Number.isFinite(minimumStep) || minimumStep <= 0) {\n return 0;\n }\n const base = Math.pow(10, Math.floor(Math.log10(minimumStep)));\n for (const factor of ROUND_STEP_FACTORS) {\n const candidate = factor * base;\n if (candidate >= minimumStep * ROUND_STEP_TOLERANCE) {\n return candidate;\n }\n }\n\n return 10 * base;\n}\n","import type { AnimationCallbackEvent } from '@angular/core';\n\n// The whole spread of a series' arrival. Past it the entrance stops reading as one gesture and\n// starts reading as a queue.\nconst STAGGER_BUDGET_MS = 260;\n\n/** Entrance delay for the mark at `index` of `count`, in milliseconds: `stepMs` apart, narrowed so\n * the last mark starts within the budget. Spread evenly rather than capped, so a long series still\n * arrives in order instead of landing all at once past the cap. `stepMs` of `0` means no stagger.\n *\n * @internal */\nexport function staggerDelay(\n index: number,\n count: number,\n stepMs: number,\n): number {\n if (!(stepMs > 0) || !Number.isFinite(index) || index <= 0 || count <= 1) {\n return 0;\n }\n\n return index * Math.min(stepMs, STAGGER_BUDGET_MS / (count - 1));\n}\n\n/** Starts a mark's exit, bound as `(animate.leave)=\"leaveMark($event)\"`: `_chart-motion.scss`\n * animates `.mark-leave`, and Angular removes the mark on its `animationend`. The function form,\n * not `animate.leave=\"mark-leave\"`: the class form calls `getAnimations()` once per leaving mark,\n * and in Chrome that call costs more the more animations are running.\n *\n * @internal */\nexport function leaveMark(event: AnimationCallbackEvent): void {\n event.target.classList.add('mark-leave');\n}\n","/** Delays a chart's answer to a resting pointer.\n *\n * @internal */\nexport interface ChartDwell {\n /** Runs `answer` once the pointer has rested on `target` for the delay. Focus, touch and a chart\n * that has already answered the pointer run it at once. Asking again for the same `target`\n * keeps the running wait and swaps in the newer `answer`. */\n schedule(target: unknown, answer: () => void, event: Event): void;\n /** Drops a wait that has not run yet. */\n cancel(): void;\n}\n\n// A chart stays warm from its first answer until the pointer leaves it, so a reader moving along\n// the marks is answered at once rather than waiting at every mark. One set for the whole page:\n// a legend and the plot beside it are one chart.\nconst warmCharts = new WeakSet<Element>();\n\nfunction chartOf(event: Event): Element | null {\n const node = event.currentTarget ?? event.target;\n\n return node instanceof Element ? node.closest('figure') : null;\n}\n\nfunction warmUp(chart: Element): void {\n if (warmCharts.has(chart)) {\n return;\n }\n warmCharts.add(chart);\n const coolOnLeave = (event: PointerEvent): void => {\n if (!(event.target instanceof Node) || !chart.contains(event.target)) {\n warmCharts.delete(chart);\n document.removeEventListener('pointerover', coolOnLeave, true);\n }\n };\n document.addEventListener('pointerover', coolOnLeave, true);\n}\n\n/** Call from anywhere; the wait is cancelled by the caller's own `leave`. `delayMs` is read at each\n * `schedule`, so a config that changes is picked up on the next rest.\n *\n * @internal */\nexport function chartDwell(delayMs: () => number): ChartDwell {\n let waiting: {\n readonly target: unknown;\n answer: () => void;\n readonly timer: ReturnType<typeof setTimeout>;\n } | null = null;\n\n const cancel = (): void => {\n if (waiting) {\n clearTimeout(waiting.timer);\n waiting = null;\n }\n };\n\n return {\n schedule(target, answer, event) {\n const pointer =\n typeof PointerEvent !== 'undefined' &&\n event instanceof PointerEvent &&\n event.pointerType !== 'touch';\n const chart = chartOf(event);\n const delay = Math.max(delayMs(), 0);\n if (!pointer || delay === 0 || (chart && warmCharts.has(chart))) {\n cancel();\n answer();\n if (pointer && chart) {\n warmUp(chart);\n }\n\n return;\n }\n if (waiting && waiting.target === target) {\n waiting.answer = answer;\n\n return;\n }\n cancel();\n const timer = setTimeout(() => {\n const ready = waiting;\n waiting = null;\n ready?.answer();\n if (chart) {\n warmUp(chart);\n }\n }, delay);\n waiting = { target, answer, timer };\n },\n cancel,\n };\n}\n","import {\n DestroyRef,\n NgZone,\n afterNextRender,\n computed,\n inject,\n signal,\n} from '@angular/core';\nimport type { ElementRef, Signal } from '@angular/core';\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/** The mark `index` within `scope`. `within` narrows the search for a chart whose marks repeat the\n * same index once per series.\n *\n * @internal */\nexport function markAt(\n scope: Element | null,\n index: number,\n within = '',\n): Element | null {\n return scope?.querySelector(`${within}[data-mark-index=\"${index}\"]`) ?? null;\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.\n *\n * @internal */\nexport function focusMark(\n scope: Element | null,\n index: number,\n within = '',\n): void {\n const target = markAt(scope, index, within);\n if (target instanceof HTMLElement || target instanceof SVGElement) {\n target.focus();\n }\n}\n\n/** A chart's roving tab stop.\n *\n * One tab stop per chart, not one per mark: WCAG 2.1.1's Understanding is explicit that not every\n * mouse-operable control has to be separately focusable, and that is what keeps a twenty-five\n * mark chart from being twenty-five stops in the page's tab order.\n *\n * @internal */\nexport interface RovingMarks {\n /** The index of the one mark that carries `tabindex=\"0\"`. */\n readonly tabStop: Signal<number>;\n /** Makes `index` the tab stop, for a mark that has taken focus. */\n focus(index: number): void;\n /** Handles an arrow, Home or End pressed on the mark at `index`: moves the tab stop and DOM focus\n * to the next mark inside `scope`. Any other key is left alone. */\n navigate(event: KeyboardEvent, index: number, scope: Element | null): void;\n}\n\n/** @internal */\nexport function rovingMarks(count: () => number): RovingMarks {\n const roving = signal(0);\n\n return {\n tabStop: computed(() => Math.min(roving(), Math.max(0, count() - 1))),\n focus: (index) => roving.set(index),\n navigate(event, index, scope) {\n const next = nextRovingIndex(event.key, index, count());\n if (next === null) {\n return;\n }\n event.preventDefault();\n roving.set(next);\n focusMark(scope, next);\n },\n };\n}\n\n/** @internal */\nexport interface MarkHit {\n readonly element: Element;\n readonly index: number;\n}\n\n/** The mark an event on the marks' parent came from - the nearest `[data-mark-index]` inside that\n * parent - for a chart that listens once per series rather than once per mark. `null` when the\n * event did not start on a mark.\n *\n * @internal */\nexport function markOf(\n event: Event,\n scope: EventTarget | null = event.currentTarget,\n): MarkHit | null {\n const target = event.target;\n if (!(scope instanceof Element) || !(target instanceof Element)) {\n return null;\n }\n const element = target.closest('[data-mark-index]');\n if (!element || !scope.contains(element)) {\n return null;\n }\n\n return { element, index: Number(element.getAttribute('data-mark-index')) };\n}\n\n/** Focus arriving on and leaving a mark inside `scope`, heard from the document rather than from\n * the marks' group: Chromium makes an SVG element focusable once it has a `focus`, `blur`,\n * `focusin` or `focusout` listener, so a group that listened would take focus on a click and\n * ring every mark it holds. Call from an injection context.\n *\n * @internal */\nexport function listenForMarkFocus(\n scope: ElementRef<Element>,\n onFocus: (event: FocusEvent, mark: MarkHit) => void,\n onBlur?: (event: FocusEvent, mark: MarkHit) => void,\n): void {\n const zone = inject(NgZone);\n const destroyRef = inject(DestroyRef);\n afterNextRender(() => {\n const host = scope.nativeElement;\n const document = host.ownerDocument;\n const forward =\n (handler?: (event: FocusEvent, mark: MarkHit) => void) =>\n (event: FocusEvent): void => {\n const hit = handler && markOf(event, host);\n if (hit) {\n handler(event, hit);\n }\n };\n const focusIn = forward(onFocus);\n const focusOut = forward(onBlur);\n // Outside the zone: every focus change on the page reaches every series, and the handlers\n // write signals, which schedule the render they need.\n zone.runOutsideAngular(() => {\n document.addEventListener('focusin', focusIn);\n document.addEventListener('focusout', focusOut);\n });\n destroyRef.onDestroy(() => {\n document.removeEventListener('focusin', focusIn);\n document.removeEventListener('focusout', focusOut);\n });\n });\n}\n","import type {\n ChartThreshold,\n DsIntl,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { 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[], words: DsIntl['chart']): 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 words.trendRisingThroughout;\n }\n if (fell) {\n return words.trendFallingThroughout;\n }\n if (last > first) {\n return words.trendRisingOverall;\n }\n if (last < first) {\n return words.trendFallingOverall;\n }\n\n return words.trendFlat;\n}\n\n/** Where the readings sit against each reference line, appended to the description. A line the\n * reader cannot see is a line that does not exist for them, and its whole point is the\n * comparison, not its position. */\nfunction describeThresholds(\n thresholds: readonly ChartThreshold[],\n points: readonly SummaryPoint[],\n format: (value: number) => string,\n words: DsIntl['chart'],\n): string {\n const total = points.length;\n\n return thresholds\n .map((threshold) => {\n const name = threshold.label ?? words.threshold;\n if (threshold.to == null) {\n const above = points.filter(\n (point) => point.value > threshold.value,\n ).length;\n\n return ` ${words.thresholdAbove(name, format(threshold.value), above, total)}`;\n }\n const low = Math.min(threshold.value, threshold.to);\n const high = Math.max(threshold.value, threshold.to);\n const inside = points.filter(\n (point) => point.value >= low && point.value <= high,\n ).length;\n\n return ` ${words.thresholdInside(name, format(low), format(high), inside, total)}`;\n })\n .join('');\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 words: DsIntl['chart'],\n label: string,\n points: readonly SummaryPoint[],\n format: (value: number) => string = formatValue,\n tableFollows = true,\n thresholds: readonly ChartThreshold[] = [],\n): string {\n if (points.length === 0) {\n return words.noData(label);\n }\n const pointer =\n describeThresholds(thresholds, points, format, words) +\n (tableFollows ? ` ${words.tableFollows}` : '');\n if (points.length === 1) {\n return `${words.onePoint(label, format(points[0].value), 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 `${words.range(label, points.length, format(lowest.value), format(highest.value))} ` +\n `${trendOf(\n points.map((point) => point.value),\n words,\n )}. ` +\n `${words.extremes(highest.label, format(highest.value), lowest.label, 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 * `appWideDefaultApplies` is read lazily and drops the middle step for a control that\n * is not a form row: `ds-button` renders the same message line but does not sit in a\n * field column, so an app-wide field setting must not give it an empty row.\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 appWideDefaultApplies: () => boolean = () => true,\n): Signal<boolean> {\n const config = inject(DS_CONFIG);\n\n return computed(\n () =>\n reserveMessage() ??\n (appWideDefaultApplies()\n ? (config.field?.reserveMessage ?? false)\n : 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. What an unset value falls back\n * to is the subclass's call, in `reserveMessageResolved`: a field takes\n * `DS_CONFIG.field.reserveMessage`, a button does not. */\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 /** Whether an unset `reserveMessage` falls back to `DS_CONFIG.field.reserveMessage`.\n * True for a field, whose row reserves so its neighbours do not shift; `ds-button`\n * turns it off, because a button is not in that column and an app-wide field\n * setting would otherwise give every button an empty message row. Read lazily, so\n * a subclass initializer running after this one still decides it. */\n protected readonly reserveFollowsFieldDefault: boolean = true;\n\n readonly reserveMessageResolved = resolveReserveMessage(\n this.reserveMessage,\n () => this.reserveFollowsFieldDefault,\n );\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\nfunction blurOwnControl(host: HTMLElement): void {\n const active = host.ownerDocument.activeElement;\n if (active instanceof HTMLElement && host.contains(active)) {\n active.blur();\n }\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 /**\n * The counterpart of `focus()`: drops focus if it sits anywhere inside this\n * control - the input, a picker trigger, the OTP cell that has it - so no\n * subclass overrides it. A portaled panel is outside the host and is left alone.\n * For a host that navigates away after `clear()`, which keeps focus on purpose.\n */\n blur(): void {\n blurOwnControl(this.hostElement.nativeElement);\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 /** The counterpart of `focus()` - see `DsControlValueAccessor.blur`. */\n blur(): void {\n blurOwnControl(this.hostElement.nativeElement);\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-max-height',\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-font-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// The teardown guarantee for the leave: a pane that is display:none, a consumer stylesheet\n// that removed the animation, and a 0s reduced-motion duration (whose animationend is not\n// reliably delivered) all end here. 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 {\n type Signal,\n DestroyRef,\n effect,\n inject,\n DOCUMENT,\n} from '@angular/core';\nimport { DS_INTL } from '@ids-group-ltd/ids-design-system/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 * @internal\n */\nexport function announceOptionCount(\n count: Signal<number>,\n active: Signal<boolean>,\n): void {\n const documentRef = inject(DOCUMENT);\n const intl = inject(DS_INTL);\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 inject(DestroyRef).onDestroy(() => region.remove());\n\n effect(() => {\n if (!active()) {\n region.textContent = '';\n\n return;\n }\n region.textContent = intl().picker.resultCount(count());\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","import { computed, inject, signal, type Signal } from '@angular/core';\nimport {\n DS_INTL,\n injectDsLocale,\n resolveWithConfig,\n} from '@ids-group-ltd/ids-design-system/core';\nimport type {\n ChartDataTable,\n ChartFrame,\n ChartValueFormat,\n} from '@ids-group-ltd/ids-design-system/core';\nimport { chartValueFormat } from './charts-format';\n\n/** The inputs every chart carries for the decisions an app makes once rather than per plot.\n *\n * @internal */\nexport interface ChartDefaultInputs {\n readonly frame: Signal<ChartFrame | null>;\n /** Absent on a chart with no annex table of its own - the container, the heat map. */\n readonly dataTable?: Signal<ChartDataTable | null>;\n readonly emptyText: Signal<string | null>;\n readonly errorText: Signal<string | null>;\n readonly valueFormat: Signal<ChartValueFormat | null>;\n /** Absent on a chart with no tooltip of its own. */\n readonly tooltipLingerMs?: Signal<number | null>;\n /** Absent on a chart with nothing to pin. */\n readonly pinOnClick?: Signal<boolean | null>;\n readonly hoverDelayMs?: Signal<number | null>;\n /** Absent on a chart with no tooltip of its own. */\n readonly tooltipSwatches?: Signal<boolean | null>;\n}\n\nconst NO_DATA_TABLE = signal<ChartDataTable | null>(null);\nconst NO_LINGER = signal<number | null>(null);\nconst NO_PIN = signal<boolean | null>(null);\nconst NO_DELAY = signal<number | null>(null);\nconst NO_SWATCHES = signal<boolean | null>(null);\n\n/** How long a resting pointer waits before a chart answers it, when nothing sets it.\n *\n * @internal */\nexport const CHART_HOVER_DELAY_MS = 0;\n\n/** How long a tooltip outlives the pointer leaving its mark, when nothing sets it. Long enough\n * that the pointer crossing the gap to the next mark finds the same panel and it glides there,\n * where a shorter wait closes it and opens a new one.\n *\n * @internal */\nexport const CHART_TOOLTIP_LINGER_MS = 500;\n\n/** Each resolved input → `DS_CONFIG.chart` → the built-in; copy resolves input → `DS_INTL.chart`.\n * Call from an injection context.\n *\n * @internal */\nexport function resolveChartDefaults(inputs: ChartDefaultInputs) {\n const locale = injectDsLocale();\n const intl = inject(DS_INTL);\n\n return {\n locale,\n frame: resolveWithConfig(\n inputs.frame,\n (config) => config.chart?.frame,\n 'auto' as ChartFrame,\n ),\n dataTable: resolveWithConfig(\n inputs.dataTable ?? NO_DATA_TABLE,\n (config) => config.chart?.dataTable,\n 'none' as ChartDataTable,\n ),\n emptyText: computed(() => inputs.emptyText() ?? intl().chart.empty),\n errorText: computed(() => inputs.errorText() ?? intl().chart.error),\n valueFormat: resolveWithConfig(\n inputs.valueFormat,\n (config) => config.chart?.valueFormat,\n chartValueFormat(locale),\n ),\n tooltipLingerMs: resolveWithConfig(\n inputs.tooltipLingerMs ?? NO_LINGER,\n (config) => config.chart?.tooltipLingerMs,\n CHART_TOOLTIP_LINGER_MS,\n ),\n pinOnClick: resolveWithConfig(\n inputs.pinOnClick ?? NO_PIN,\n (config) => config.chart?.pinOnClick,\n true,\n ),\n hoverDelayMs: resolveWithConfig(\n inputs.hoverDelayMs ?? NO_DELAY,\n (config) => config.chart?.hoverDelayMs,\n CHART_HOVER_DELAY_MS,\n ),\n tooltipSwatches: resolveWithConfig<boolean | 'auto'>(\n inputs.tooltipSwatches ?? NO_SWATCHES,\n (config) => config.chart?.tooltipSwatches,\n 'auto',\n ),\n };\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["observer"],"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,8BAA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