@cngx/common 0.1.0-rc.1 → 0.1.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/cngx-common-data.mjs +64 -48
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +318 -5
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +532 -151
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/package.json +2 -2
- package/stepper/README.md +0 -13
- package/types/cngx-common-data.d.ts +46 -33
- package/types/cngx-common-stepper.d.ts +350 -6
- package/types/cngx-common-tabs.d.ts +586 -191
- package/tabs/README.md +0 -32
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cngx-common-tabs.mjs","sources":["../../../projects/common/tabs/commit-action.token.ts","../../../projects/common/tabs/commit-handler.ts","../../../projects/common/tabs/tab-group-host.token.ts","../../../projects/common/tabs/presenter.directive.ts","../../../projects/common/tabs/tab-panel-host.token.ts","../../../projects/common/tabs/tab-content.directive.ts","../../../projects/common/tabs/tab-label.directive.ts","../../../projects/common/tabs/slots/tab-sub-label.directive.ts","../../../projects/common/tabs/tab.directive.ts","../../../projects/common/tabs/router-absent-warning.ts","../../../projects/common/tabs/router-sync.directive.ts","../../../projects/common/tabs/router-commit.ts","../../../projects/common/tabs/route-sync.directive.ts","../../../projects/common/tabs/tabs-config.ts","../../../projects/common/tabs/tabs-host-attrs.ts","../../../projects/common/tabs/i18n/tabs-i18n.ts","../../../projects/common/tabs/provide-cngx-tabs.ts","../../../projects/common/tabs/overflow/dom-adapter.ts","../../../projects/common/tabs/overflow/dom-anchor-retry.ts","../../../projects/common/tabs/overflow/tab-overflow-trigger.directive.ts","../../../projects/common/tabs/overflow/tab-overflow-item.directive.ts","../../../projects/common/tabs/slots/tab-error-badge.directive.ts","../../../projects/common/tabs/slots/tab-rejection-icon.directive.ts","../../../projects/common/tabs/slots/tab-busy-spinner.directive.ts","../../../projects/common/tabs/slots/tab-icon.directive.ts","../../../projects/common/tabs/slots/tab-close-icon.directive.ts","../../../projects/common/tabs/slots/tab-add-icon.directive.ts","../../../projects/common/tabs/dismissals/tab-dismissals.ts","../../../projects/common/tabs/keyboard/tab-keyboard-nav.ts","../../../projects/common/tabs/slots/tab-group-template-cascade.ts","../../../projects/common/tabs/announcements/tab-group-announcements.ts","../../../projects/common/tabs/glyphs.ts","../../../projects/common/tabs/overflow/overflow-template-cascade.ts","../../../projects/common/tabs/scroll-sync/organism-scroll-sync.ts","../../../projects/common/tabs/registry/directive-by-id-map.ts","../../../projects/common/tabs/public-api.ts","../../../projects/common/tabs/cngx-common-tabs.ts"],"sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { CngxTabsCommitAction } from './presenter.directive';\n\n/**\n * Source supplied through {@link CNGX_TABS_COMMIT_ACTION}. A sync\n * directive (e.g. `[cngxTabsRouteSync]`) provides one so the presenter\n * picks up a commit-action without the consumer hand-binding\n * `[commitAction]`. Carries `mode` alongside `action` so the routed\n * path can pin pessimistic - the active tab must follow the *resolved*\n * route, and a stray `[commitMode]=\"'optimistic'\"` must not override\n * that invariant.\n *\n * @category common/tabs\n */\nexport interface CngxTabsCommitActionSource {\n readonly action: Signal<CngxTabsCommitAction | null>;\n readonly mode: Signal<'optimistic' | 'pessimistic'>;\n}\n\n/**\n * DI fallback the presenter reads when its `[commitAction]` input is\n * unbound. Directives compose via DI tokens, not by hand-binding\n * another directive's input (Pillar 3). When a source is present and\n * exposes a non-null `action()`, its `mode()` wins over the\n * `[commitMode]` input.\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/commit-action.token.ts\n * @since 0.1.0\n */\nexport const CNGX_TABS_COMMIT_ACTION = new InjectionToken<CngxTabsCommitActionSource>(\n 'CngxTabsCommitAction',\n);\n","import { InjectionToken, type Signal } from '@angular/core';\nimport { isObservable, type Observable, type Subscription } from 'rxjs';\n\nimport { type CngxCommitController, type CngxCommitHandle } from '@cngx/common/data';\n\nimport type { CngxTabsCommitAction } from './presenter.directive';\n\n/**\n * Adapts the shared commit-controller to the tabs action shape. The\n * presenter delegates to {@link beginTransition} when `commitAction`\n * is bound.\n *\n * @category common/tabs\n */\nexport interface CngxTabsCommitHandler {\n /**\n * Start a tab-transition commit. Returns synchronously - read the\n * controller's `state` signal for in-flight status. `onResolve`\n * fires once with `accept = true` on success or `false` on\n * rejection; skipped on supersede.\n */\n beginTransition(\n fromIndex: number,\n toIndex: number,\n action: CngxTabsCommitAction,\n onResolve: (accept: boolean) => void,\n ): void;\n\n /** Cancel the in-flight transition without firing callbacks. */\n cancel(): void;\n\n /** Live `pending` flag from the controller. */\n readonly isCommitting: Signal<boolean>;\n}\n\n/**\n * Options for {@link createTabsCommitHandler}.\n *\n * @category common/tabs\n */\nexport interface CngxTabsCommitHandlerOptions {\n readonly controller: CngxCommitController<number>;\n}\n\n/**\n * Wraps a {@link CngxCommitController} with the action-shape adapter\n * that collapses `Observable<boolean>` / `Promise<boolean>` /\n * `boolean` returns into a single `accept: boolean` outcome.\n *\n * @category common/tabs\n */\nexport function createTabsCommitHandler(opts: CngxTabsCommitHandlerOptions): CngxTabsCommitHandler {\n const { controller } = opts;\n return {\n isCommitting: controller.isCommitting,\n\n beginTransition(fromIndex, toIndex, action, onResolve) {\n controller.begin(\n (handlers) => runTabsAction(action, fromIndex, toIndex, handlers),\n toIndex,\n fromIndex,\n {\n onSuccess: () => onResolve(true),\n onError: () => onResolve(false),\n },\n );\n },\n\n cancel() {\n controller.cancel();\n },\n };\n}\n\nfunction runTabsAction(\n action: CngxTabsCommitAction,\n fromIndex: number,\n toIndex: number,\n handlers: {\n readonly onSuccess: (committed: number | undefined) => void;\n readonly onError: (err: unknown) => void;\n },\n): CngxCommitHandle {\n let cancelled = false;\n let unsubscribe: (() => void) | null = null;\n\n const safeSuccess = (accept: boolean): void => {\n if (cancelled) {\n return;\n }\n if (accept) {\n handlers.onSuccess(toIndex);\n } else {\n handlers.onError(new Error('Tab transition refused by commitAction'));\n }\n };\n const safeError = (err: unknown): void => {\n if (cancelled) {\n return;\n }\n handlers.onError(err);\n };\n\n let result: boolean | Promise<boolean> | Observable<boolean>;\n try {\n result = action(fromIndex, toIndex);\n } catch (err: unknown) {\n safeError(err);\n return {\n cancel: () => {\n cancelled = true;\n },\n };\n }\n\n if (isObservable(result)) {\n // Synchronous Observables (`of(true)`) emit inside `.subscribe` before\n // the assignment binds - close over a pre-declared `let` to avoid TDZ.\n let sub: Subscription | null = null;\n sub = result.subscribe({\n next: (accept) => {\n safeSuccess(accept);\n sub?.unsubscribe();\n },\n error: (err: unknown) => safeError(err),\n });\n unsubscribe = () => sub?.unsubscribe();\n } else if (result != null && typeof (result as { then?: unknown }).then === 'function') {\n (result as Promise<boolean>).then(safeSuccess, safeError);\n } else {\n safeSuccess(result as boolean);\n }\n\n return {\n cancel: () => {\n cancelled = true;\n unsubscribe?.();\n },\n };\n}\n\n/**\n * Factory signature for {@link CNGX_TABS_COMMIT_HANDLER_FACTORY}.\n * Override to wrap the default with retry-with-backoff, telemetry,\n * or offline queues.\n *\n * @category common/tabs\n */\nexport type CngxTabsCommitHandlerFactory = (\n opts: CngxTabsCommitHandlerOptions,\n) => CngxTabsCommitHandler;\n\n/**\n * DI token for the commit-handler factory. Defaults to\n * {@link createTabsCommitHandler}. Sibling to\n * `CNGX_ARRAY_COMMIT_HANDLER_FACTORY` (select) and\n * `CNGX_STEPPER_COMMIT_HANDLER_FACTORY`.\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/commit-handler.ts\n * @since 0.1.0\n */\nexport const CNGX_TABS_COMMIT_HANDLER_FACTORY = new InjectionToken<CngxTabsCommitHandlerFactory>(\n 'CngxTabsCommitHandlerFactory',\n {\n providedIn: 'root',\n factory: () => createTabsCommitHandler,\n },\n);\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\nimport type { CngxAsyncState, StatusTransition } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\n/**\n * Registration handle a `CngxTab` atom passes to its presenter via\n * {@link CngxTabGroupHost.register}. Fields are exposed by reference\n * so subsequent input changes propagate without re-registration.\n * `errorAggregator` is a `Signal<...>` slot so consumer aggregators\n * resolved via `viewChild` after first registration still bind.\n *\n * @category common/tabs\n */\nexport interface CngxTabHandle {\n readonly id: string;\n readonly label: Signal<string | undefined>;\n /**\n * Optional secondary label line. Rendered stacked under the primary\n * label by the organism and folded into the tab's accessible name.\n * `undefined` (default) renders byte-identically to a single-line\n * tab. `[cngxMatTabs]` pins this to `undefined` - Material owns its\n * own tab chrome.\n */\n readonly subLabel: Signal<string | undefined>;\n readonly disabled: Signal<boolean>;\n readonly errorAggregator: Signal<CngxErrorAggregatorContract | undefined>;\n /**\n * Folded per-tab error state, exposed by reference. `true` when the\n * direct `[error]` flag is set OR the aggregator wants to reveal\n * (`shouldShow()`, so deferred-reveal validation stays silent until\n * revealed). The organism gates the error badge + SR descriptor on\n * this; both handle producers (`CngxTab`, `createMatTabHandle`)\n * carry it.\n */\n readonly hasError: Signal<boolean>;\n /**\n * Resolved direct-error message - the `[error]` string when non-empty,\n * else `undefined`. Rides the handle so the error badge slot can render\n * it via `ctx.tab.errorMessage()`. `[cngxMatTabs]` pins this to\n * `undefined` - Material owns its own tab chrome.\n */\n readonly errorMessage: Signal<string | undefined>;\n /**\n * Per-tab closable override. `undefined` (default) inherits the\n * group-level `closable` resolution; `true`/`false` pin this tab's\n * close affordance regardless of the group default (e.g. a\n * non-closable \"Home\" tab inside an otherwise dismissable group).\n */\n readonly closable: Signal<boolean | undefined>;\n}\n\n/**\n * Payload of {@link CngxTabGroupHost.tabClose}. Carries the closed\n * tab's id and its index at close time. The consumer removes the tab\n * from its own data in response; the presenter has already moved the\n * active index to the surviving neighbour.\n *\n * @category common/tabs\n */\nexport interface CngxTabCloseEvent {\n readonly id: string;\n readonly index: number;\n}\n\n/**\n * Contract atoms see when they inject the presenter via\n * {@link CNGX_TAB_GROUP_HOST}. Atoms never reach into the concrete\n * class - keeps layering cycle-free and the decompose schematic clean.\n *\n * @category common/tabs\n */\nexport interface CngxTabGroupHost {\n readonly tabs: Signal<readonly CngxTabHandle[]>;\n readonly activeIndex: ModelSignal<number>;\n readonly activeId: Signal<string | null>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n readonly loop: Signal<boolean>;\n readonly commitState: CngxAsyncState<number | undefined>;\n readonly intendedIndex: Signal<number | undefined>;\n /**\n * Reactive current/previous pair for the commit-state status. Lets\n * organisms and skin sub-components derive transition-driven\n * announcements (`pending` → `success`, `pending` → `error`, sync\n * `idle` → `error`) from a single tracker.\n */\n readonly commitTransition: StatusTransition;\n\n /**\n * Tab index of the last refused commit (both optimistic and\n * pessimistic modes). Cleared on next successful re-pick of the\n * same index or via {@link clearLastFailed}. Drives the persistent\n * rejection-icon decoration.\n *\n * @remarks\n * The `pending → error` pulse keyframe (`cngx-tab-pulse-error`)\n * does not retrigger on rapid supersede sequences - CSS animations\n * only fire on fresh class application. See `tabs-accepted-debt §3`;\n * the persistent icon plus static red outline carry the durable\n * signal in the no-pulse case.\n */\n readonly lastFailedIndex: Signal<number | undefined>;\n\n /**\n * Safe-harbour origin index captured at the start of an active\n * commit window. Written when `select()` opens a transition under\n * `commitAction`; retained on `error` so the live-region phrase\n * can resolve the origin label; cleared on `success`. Outside the\n * commit window the slot may carry a stale value - consumers must\n * gate reads by joining with `lastFailedIndex`. The origin is\n * meaningful only when `lastFailedIndex !== undefined`.\n */\n readonly originIndexDuringCommit: Signal<number | undefined>;\n\n register(handle: CngxTabHandle): void;\n unregister(id: string): void;\n\n select(index: number): void;\n selectNext(): void;\n selectPrevious(): void;\n selectById(id: string): void;\n\n /**\n * Request closing the tab with the given id. The presenter moves the\n * active index onto the surviving neighbour (APG: next tab, or the\n * previous one when closing the last tab) and emits `tabClose`; the\n * consumer performs the actual removal from its data. No-op for an\n * unknown id.\n */\n requestClose(id: string): void;\n\n /**\n * Request adding a new tab. Emits `tabAdd`; the consumer appends to\n * its data. The presenter owns no tab-creation logic - tabs are\n * derived from consumer data (Ableitung statt Verwaltung).\n */\n requestAdd(): void;\n\n /**\n * Clear {@link lastFailedIndex} without unwinding\n * {@link originIndexDuringCommit} (consumers gate reads on\n * `lastFailedIndex` anyway). Call when the bound data source\n * changes and the rollback marker is no longer meaningful.\n */\n clearLastFailed(): void;\n}\n\n/**\n * DI token for the tab presenter's contract. Presenter provides via\n * `useExisting`; `CngxTab` injects to register; the organism injects\n * to drive the APG tablist keyboard model (automatic activation via\n * `select()`, roving stop derived from `activeId`) through\n * `createTabKeyboardNav`.\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-group-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_TAB_GROUP_HOST = new InjectionToken<CngxTabGroupHost>('CngxTabGroupHost');\n","import {\n computed,\n Directive,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n type Signal,\n} from '@angular/core';\n\nimport { CNGX_COMMIT_CONTROLLER_FACTORY, type CngxCommitController } from '@cngx/common/data';\nimport {\n CNGX_STATEFUL,\n createTransitionTracker,\n type CngxAsyncState,\n type StatusTransition,\n} from '@cngx/core/utils';\nimport type { Observable } from 'rxjs';\n\nimport { CNGX_TABS_COMMIT_ACTION, type CngxTabsCommitActionSource } from './commit-action.token';\nimport { CNGX_TABS_COMMIT_HANDLER_FACTORY, type CngxTabsCommitHandler } from './commit-handler';\nimport {\n CNGX_TAB_GROUP_HOST,\n type CngxTabCloseEvent,\n type CngxTabGroupHost,\n type CngxTabHandle,\n} from './tab-group-host.token';\n\n/**\n * Async-commit action shape for tab transitions. Receives origin\n * and target indices; resolves `true` to commit, `false` to refuse.\n * `Observable | Promise | sync` union mirrors the rest of the cngx\n * commit-action family.\n *\n * @category common/tabs\n */\nexport type CngxTabsCommitAction = (\n fromIndex: number,\n toIndex: number,\n) => boolean | Promise<boolean> | Observable<boolean>;\n\n/**\n * Tab-group presenter - brain of every cngx tab flow. Owns the\n * active-index model, the tab registry, orientation, loop policy,\n * and the commit-controller lifecycle. Provides\n * {@link CNGX_TAB_GROUP_HOST} for atoms and {@link CNGX_STATEFUL}\n * so `<cngx-toast-on />` / `<cngx-banner-on />` compose without\n * `[state]` wiring.\n *\n * **Layer:** `@cngx/common/tabs` (Level 2). Directive-only -\n * organisms compose via `hostDirectives`, consumers attach\n * `[cngxTabGroup]` directly.\n *\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/presenter.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTab, CngxTabContent, CngxTabLabel, CngxTabsFragmentSync\n * <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>\n */\n@Directive({\n selector: '[cngxTabGroup]',\n exportAs: 'cngxTabGroup',\n standalone: true,\n providers: [\n { provide: CNGX_TAB_GROUP_HOST, useExisting: CngxTabGroupPresenter },\n { provide: CNGX_STATEFUL, useExisting: CngxTabGroupPresenter },\n ],\n})\nexport class CngxTabGroupPresenter implements CngxTabGroupHost {\n readonly activeIndex = model<number>(0);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly loop = input<boolean>(true);\n\n /**\n * Async-commit action gating the transition. When non-null,\n * `select(...)` routes through {@link CngxTabsCommitHandler}; the\n * action's resolution decides whether the change lands. Supersede\n * semantics come from the commit-controller - a rapid second\n * `select(...)` cancels the in-flight runner.\n *\n * @internal Two-field alias - bind the public `[commitAction]`; read\n * the resolved {@link commitAction} computed (input ?? DI fallback).\n */\n readonly commitActionInput = input<CngxTabsCommitAction | null>(null, {\n alias: 'commitAction',\n });\n /**\n * Default `'optimistic'` - tab change is navigation, not a save,\n * so eager visual feedback matches the user's mental model.\n * Switch to `'pessimistic'` when the new tab must wait for the\n * action to confirm.\n *\n * @internal Two-field alias - bind the public `[commitMode]`; read\n * the resolved {@link commitMode} computed (DI fallback mode wins\n * when a routed action is active).\n */\n readonly commitModeInput = input<'optimistic' | 'pessimistic'>('optimistic', {\n alias: 'commitMode',\n });\n\n private readonly injector = inject(Injector);\n // Resolved lazily, never in a field initialiser: a sync directive\n // (e.g. [cngxTabsRouteSync]) provides CNGX_TABS_COMMIT_ACTION via\n // useExisting and itself injects this presenter as its host, so\n // eager injection here would close a construction cycle (NG0200).\n // First read happens at select()/template time - after both\n // directives exist. The source is static per element, so memoising\n // the resolution is safe.\n private injectedActionSource: CngxTabsCommitActionSource | null | undefined;\n\n private resolveInjectedAction(): CngxTabsCommitActionSource | null {\n if (this.injectedActionSource === undefined) {\n this.injectedActionSource = this.injector.get(CNGX_TABS_COMMIT_ACTION, null);\n }\n return this.injectedActionSource;\n }\n\n /**\n * Resolved commit-action: the `[commitAction]` input when bound, else\n * the {@link CNGX_TABS_COMMIT_ACTION} DI fallback (routed path), else\n * `null`. `select()` reads this.\n */\n readonly commitAction = computed<CngxTabsCommitAction | null>(\n () => this.commitActionInput() ?? this.resolveInjectedAction()?.action() ?? null,\n );\n /**\n * Resolved commit mode. When the DI fallback supplies an active\n * action its `mode` wins - the routed path pins `'pessimistic'` so a\n * stray `[commitMode]=\"'optimistic'\"` cannot break the\n * route-follows-resolution invariant. Otherwise the `[commitMode]`\n * input drives.\n */\n readonly commitMode = computed<'optimistic' | 'pessimistic'>(() => {\n const source = this.resolveInjectedAction();\n return source?.action() ? source.mode() : this.commitModeInput();\n });\n\n /**\n * Emitted when a tab's close affordance is activated (the close\n * button or Delete/Backspace on the focused tab). The presenter has\n * already moved the active index onto the surviving neighbour; the\n * consumer removes the tab from its own data in the handler.\n */\n readonly tabClose = output<CngxTabCloseEvent>();\n /**\n * Emitted when the add-tab affordance is activated. The consumer\n * appends a tab to its own data; the presenter owns no creation logic.\n */\n readonly tabAdd = output<void>();\n\n private readonly genericFactory = inject(CNGX_COMMIT_CONTROLLER_FACTORY);\n private readonly commitController: CngxCommitController<number> = this.genericFactory<number>();\n private readonly commitHandler: CngxTabsCommitHandler = inject(CNGX_TABS_COMMIT_HANDLER_FACTORY)({\n controller: this.commitController,\n });\n\n /** Producer surface for the `CNGX_STATEFUL` bridge contract. */\n readonly state: CngxAsyncState<number | undefined> = this.commitController.state;\n readonly commitState: CngxAsyncState<number | undefined> = this.commitController.state;\n /**\n * Index the user is currently trying to commit to. Tracked\n * separately from `state.data()` (which only updates on success)\n * to drive per-tab `aria-busy`.\n */\n readonly intendedIndex: Signal<number | undefined> = this.commitController.intendedValue;\n\n /**\n * Current/previous pair for `commitState.status()`. Skin\n * sub-components feed `<span cngxLiveRegion>` from this tracker\n * for declarative SR announcements. Shared across consumers so\n * the tracker's `linkedSignal` is allocated once per presenter.\n */\n readonly commitTransition: StatusTransition = createTransitionTracker(() =>\n this.commitController.state.status(),\n );\n\n // Persistence-of-error surface - see `CngxTabGroupHost.lastFailedIndex`\n // and `originIndexDuringCommit` for the contract.\n private readonly lastFailedIndexState = signal<number | undefined>(undefined);\n private readonly originIndexDuringCommitState = signal<number | undefined>(undefined);\n /** {@inheritDoc CngxTabGroupHost.lastFailedIndex} */\n readonly lastFailedIndex: Signal<number | undefined> = this.lastFailedIndexState.asReadonly();\n /** {@inheritDoc CngxTabGroupHost.originIndexDuringCommit} */\n readonly originIndexDuringCommit: Signal<number | undefined> =\n this.originIndexDuringCommitState.asReadonly();\n\n private readonly tabsState = signal<readonly CngxTabHandle[]>([], {\n equal: tabsEqual,\n });\n readonly tabs: Signal<readonly CngxTabHandle[]> = this.tabsState.asReadonly();\n\n private readonly clampedIndex = computed(() => {\n const count = this.tabs().length;\n if (count === 0) {\n return 0;\n }\n return Math.max(0, Math.min(this.activeIndex(), count - 1));\n });\n\n readonly activeId: Signal<string | null> = computed(\n () => this.tabs()[this.clampedIndex()]?.id ?? null,\n { equal: Object.is },\n );\n\n register(handle: CngxTabHandle): void {\n const current = this.tabsState();\n const idx = current.findIndex((h) => h.id === handle.id);\n if (idx >= 0) {\n const next = current.slice();\n next[idx] = handle;\n this.tabsState.set(next);\n return;\n }\n this.tabsState.set([...current, handle]);\n }\n\n unregister(id: string): void {\n const current = this.tabsState();\n const next = current.filter((h) => h.id !== id);\n if (next.length !== current.length) {\n this.tabsState.set(next);\n }\n }\n\n /** {@inheritDoc CngxTabGroupHost.clearLastFailed} */\n clearLastFailed(): void {\n this.lastFailedIndexState.set(undefined);\n }\n\n select(index: number): void {\n const tabs = this.tabs();\n if (tabs.length === 0) {\n return;\n }\n const target = Math.max(0, Math.min(index, tabs.length - 1));\n if (tabs[target].disabled()) {\n return;\n }\n const previous = this.activeIndex();\n if (target === previous) {\n return;\n }\n\n const action = this.commitAction();\n if (!action) {\n // No-action fast path - `originIndexDuringCommit` stays\n // untouched, so a stale origin can never leak into the\n // live-region announcement.\n this.activeIndex.set(target);\n if (this.lastFailedIndexState() === target) {\n this.lastFailedIndexState.set(undefined);\n }\n return;\n }\n\n // Open the commit window - origin is captured ONLY here so a\n // stale value never lingers into a non-commit navigation.\n this.originIndexDuringCommitState.set(previous);\n const mode = this.commitMode();\n if (mode === 'optimistic') {\n this.activeIndex.set(target);\n }\n this.commitHandler.beginTransition(previous, target, action, (accept) => {\n if (accept) {\n // Window closes on success - origin label no longer needed;\n // clear the rejection flag if the user re-picked the failed\n // target successfully.\n this.originIndexDuringCommitState.set(undefined);\n if (this.lastFailedIndexState() === target) {\n this.lastFailedIndexState.set(undefined);\n }\n if (mode === 'pessimistic') {\n this.activeIndex.set(target);\n }\n } else {\n // Reject - flag the refused target; RETAIN the origin so\n // the organism's `liveAnnouncement` computed can resolve\n // the origin label for the rich rollback phrase. Optimistic\n // rolls back; pessimistic never moved.\n this.lastFailedIndexState.set(target);\n if (mode === 'optimistic') {\n this.activeIndex.set(previous);\n }\n }\n });\n }\n\n selectNext(): void {\n const tabs = this.tabs();\n if (tabs.length === 0) {\n return;\n }\n let next = this.activeIndex() + 1;\n while (next < tabs.length && tabs[next].disabled()) {\n next++;\n }\n if (next < tabs.length) {\n this.select(next);\n return;\n }\n if (this.loop()) {\n let i = 0;\n while (i < tabs.length && tabs[i].disabled()) {\n i++;\n }\n if (i < tabs.length && i !== this.activeIndex()) {\n this.select(i);\n }\n }\n }\n\n selectPrevious(): void {\n const tabs = this.tabs();\n if (tabs.length === 0) {\n return;\n }\n let prev = this.activeIndex() - 1;\n while (prev >= 0 && tabs[prev].disabled()) {\n prev--;\n }\n if (prev >= 0) {\n this.select(prev);\n return;\n }\n if (this.loop()) {\n let i = tabs.length - 1;\n while (i >= 0 && tabs[i].disabled()) {\n i--;\n }\n if (i >= 0 && i !== this.activeIndex()) {\n this.select(i);\n }\n }\n }\n\n selectById(id: string): void {\n const tabs = this.tabs();\n const idx = tabs.findIndex((h) => h.id === id);\n if (idx >= 0) {\n this.select(idx);\n }\n }\n\n requestClose(id: string): void {\n const tabs = this.tabs();\n const index = tabs.findIndex((h) => h.id === id);\n if (index < 0) {\n return;\n }\n const active = this.clampedIndex();\n // Only closing a tab BEFORE the active one needs a pre-emptive\n // index shift: the active tab moves down one slot once the consumer\n // removes the closed tab, so decrement to keep the same tab active.\n // Closing the active tab (or one after it) needs no write -\n // `clampedIndex` re-derives against the shorter array and lands on\n // the next tab (or the new last when the closed tab was last).\n if (index < active) {\n this.activeIndex.set(active - 1);\n }\n this.tabClose.emit({ id, index });\n }\n\n requestAdd(): void {\n this.tabAdd.emit();\n }\n}\n\n/**\n * Structural equality for the tab registry. Compares length and\n * per-entry `id`, `disabled()`, `label()`, `subLabel()`, and\n * `closable()`.\n *\n * `errorAggregator`, `hasError`, and `errorMessage` are left out on\n * purpose. The handle is a stable per-tab reference injected once, and\n * the organism reads `tab.hasError()` / `tab.errorMessage()` reactively\n * off that handle (not off array identity), so the badge + descriptor\n * update on error-state changes without the registry array re-emitting.\n * Comparing them here would push the memoisation burden onto consumers\n * and break the structural-equal contract.\n *\n * Reading the signals here doesn't subscribe - the comparator runs\n * synchronously inside `signal.set()`, outside any tracking context.\n *\n * @internal\n */\nexport function tabsEqual(a: readonly CngxTabHandle[], b: readonly CngxTabHandle[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (\n a[i].id !== b[i].id ||\n a[i].disabled() !== b[i].disabled() ||\n a[i].label() !== b[i].label() ||\n a[i].subLabel() !== b[i].subLabel() ||\n a[i].closable() !== b[i].closable()\n ) {\n return false;\n }\n }\n return true;\n}\n","import { InjectionToken, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from './tab-group-host.token';\n\n/**\n * Read-mostly panel-surface contract for the overflow molecule, skin\n * sub-components, and future panel-level helpers. Narrower than\n * {@link CngxTabGroupHost} - register / unregister stay on the brain.\n *\n * The single write path is `selectById`; routing back through the\n * presenter preserves clamping, disabled-skip, and commit-action\n * gating. Template resolvers let skin sub-components project the\n * `*cngxTabLabel` / `*cngxTabContent` slots without depending on the\n * concrete `CngxTabGroup` class.\n *\n * @category common/tabs\n */\nexport interface CngxTabPanelHost {\n readonly tabs: Signal<readonly CngxTabHandle[]>;\n readonly activeId: Signal<string | null>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n\n selectById(id: string): void;\n\n /** Resolves a tab id to its `*cngxTabLabel` template (consumer-supplied). */\n labelTemplateFor(id: string): TemplateRef<unknown> | null;\n /** Resolves a tab id to its `*cngxTabContent` template (consumer-supplied). */\n contentTemplateFor(id: string): TemplateRef<unknown> | null;\n}\n\n/**\n * DI token the organism provides via `useExisting`. The overflow\n * molecule and consumer-authored skin sub-components inject this\n * instead of the concrete component class.\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-panel-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_TAB_PANEL_HOST = new InjectionToken<CngxTabPanelHost>('CngxTabPanelHost');\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot directive marking the per-tab panel-body template.\n * Discovered by `<cngx-tab-group>` via `contentChild` on each\n * `CngxTab` and projected into the matching `role=\"tabpanel\"`.\n *\n * ```html\n * <div cngxTab id=\"settings\">\n * <ng-template cngxTabLabel>Settings</ng-template>\n * <ng-template cngxTabContent>\n * <p>Settings panel body…</p>\n * </ng-template>\n * </div>\n * ```\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTab, CngxTabLabel\n * <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-group-vertical/vertical-sidebar-tabs</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-group/three-tab-navigation</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/8-tabs-in-a-narrow-container</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-busy-spinner-via-code-cngxtabbusyspinner-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-error-badge-via-code-cngxtaberrorbadge-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/rejection-decoration-via-code-cngxtabrejectionicon-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabContent]',\n exportAs: 'cngxTabContent',\n standalone: true,\n})\nexport class CngxTabContent {\n readonly templateRef = inject(TemplateRef<unknown>);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot directive marking the per-tab label template.\n * Discovered by `<cngx-tab-group>` via `contentChild` on each\n * `CngxTab` and projected into the tab strip.\n *\n * ```html\n * <div cngxTab id=\"settings\">\n * <ng-template cngxTabLabel>Settings</ng-template>\n * <ng-template cngxTabContent>...</ng-template>\n * </div>\n * ```\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-label.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTab, CngxTabContent\n * <example-url>http://localhost:4200/#/ui/tabs/tab-group-vertical/vertical-sidebar-tabs</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-group/three-tab-navigation</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabLabel]',\n exportAs: 'cngxTabLabel',\n standalone: true,\n})\nexport class CngxTabLabel {\n readonly templateRef = inject(TemplateRef<unknown>);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot directive marking a tab's secondary label template.\n * Discovered by `<cngx-tab-group>` via `contentChild` on each\n * `CngxTab` and rendered as a stacked second line under the primary\n * label. Per-tab content, mirroring `CngxTabLabel` - the convenience\n * `[subLabel]` string input on `CngxTab` covers the plain-text case.\n *\n * ```html\n * <div cngxTab id=\"bookmarks\">\n * <ng-template cngxTabLabel>Bookmarks</ng-template>\n * <ng-template cngxTabSubLabel>45 saved</ng-template>\n * <ng-template cngxTabContent>...</ng-template>\n * </div>\n * ```\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-sub-label.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTab, CngxTabLabel, CngxTabContent\n * <example-url>http://localhost:4200/#/ui/tabs/tab-sub-label/label-with-count</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabSubLabel]',\n exportAs: 'cngxTabSubLabel',\n standalone: true,\n})\nexport class CngxTabSubLabel {\n readonly templateRef = inject(TemplateRef<unknown>);\n}\n","import {\n computed,\n contentChild,\n DestroyRef,\n Directive,\n inject,\n input,\n type OnInit,\n type Signal,\n} from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { CngxTabContent } from './tab-content.directive';\nimport { CngxTabLabel } from './tab-label.directive';\nimport { CngxTabSubLabel } from './slots/tab-sub-label.directive';\nimport { CNGX_TAB_GROUP_HOST } from './tab-group-host.token';\n\n/**\n * Single-tab atom. Registers with the enclosing presenter via\n * {@link CNGX_TAB_GROUP_HOST} on construction; deregisters via\n * {@link DestroyRef} on teardown. The presenter holds the atom's\n * input signals by reference, so input changes propagate without\n * re-registration. `labelTemplate` / `contentTemplate` are projected\n * by the organism - the atom carries no rendering logic.\n *\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroupPresenter, CngxTabLabel, CngxTabContent, CngxTabErrorBadge\n * <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-group-vertical/vertical-sidebar-tabs</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-group/three-tab-navigation</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/8-tabs-in-a-narrow-container</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-busy-spinner-via-code-cngxtabbusyspinner-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-error-badge-via-code-cngxtaberrorbadge-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/rejection-decoration-via-code-cngxtabrejectionicon-code</example-url>\n */\n@Directive({\n selector: '[cngxTab]',\n exportAs: 'cngxTab',\n standalone: true,\n})\nexport class CngxTab implements OnInit {\n readonly id = input<string>(nextUid('cngx-tab-'));\n readonly disabled = input<boolean>(false);\n readonly label = input<string | undefined>(undefined);\n /**\n * Optional secondary text line under the primary label (a count, a\n * status word, a short detail). Convenience for the common text\n * case, parallel to `[label]`; the `*cngxTabSubLabel` slot covers\n * richer content. Folds into the tab's accessible name.\n */\n readonly subLabel = input<string | undefined>(undefined);\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n\n /**\n * Direct error flag for the common \"this tab is invalid\" case - no\n * `errorAggregator` boilerplate required. `true` or a non-empty string\n * drives the error state; a string doubles as the inline message\n * (surfaced via the `*cngxTabErrorBadge` slot context). `false` / `''`\n * clear it. The aggregator stays the rich multi-source forms path; the\n * two channels compose (either errors). Mirrors `CngxStep.error`.\n */\n readonly error = input<string | boolean>(false);\n\n /**\n * Resolved direct-error message: the `[error]` string when non-empty,\n * else `undefined`. Carried onto the registration handle so the error\n * badge slot can render it. `computed` over the input - never written.\n */\n readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n /**\n * Per-tab error fold driving the badge + SR descriptor. `true` when\n * the direct `[error]` flag is set OR the optional aggregator wants to\n * reveal (`shouldShow()` = `hasError` AND scope reveal-state). The\n * aggregator arm reads `shouldShow`, not `hasError`, so deferred-reveal\n * validation stays silent until revealed - the direct flag has no\n * reveal concept (the consumer sets it when it wants it shown). A\n * boolean, not a status enum: tabs carry no success/completed/disabled\n * model (Pillar 3).\n */\n readonly hasError: Signal<boolean> = computed(\n () => {\n const directError = this.error();\n return (\n (directError !== false && directError !== '') ||\n (this.errorAggregator()?.shouldShow?.() ?? false)\n );\n },\n { equal: Object.is },\n );\n\n /**\n * Per-tab close-affordance override. `undefined` (default) inherits\n * the group-level `[closable]` resolution; set `false` to pin this\n * tab open inside a dismissable group, or `true` to make a single tab\n * closable while the group default is off.\n */\n readonly closable = input<boolean | undefined>(undefined);\n\n readonly labelTemplate = contentChild(CngxTabLabel);\n readonly subLabelTemplate = contentChild(CngxTabSubLabel);\n readonly contentTemplate = contentChild(CngxTabContent);\n\n private readonly host = inject(CNGX_TAB_GROUP_HOST, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n /** `true` when the presenter's `activeId` equals this tab's id. */\n readonly selected: Signal<boolean> = computed(() => this.host?.activeId() === this.id(), {\n equal: Object.is,\n });\n\n constructor() {\n if (!this.host) {\n throw new Error(\n 'CngxTab: no enclosing CngxTabGroupPresenter found. Wrap the tab inside an element carrying [cngxTabGroup] (or place it inside <cngx-tab-group>).',\n );\n }\n }\n\n ngOnInit(): void {\n // Register in ngOnInit, NOT the constructor: a dynamically-bound\n // `[id]` (or `[label]`) signal input is not applied until the first\n // change detection, so a constructor read would capture the default\n // auto-id. The handle id is the stable key consumers map `(tabClose)`\n // back to their data with, so it must reflect the bound `[id]`.\n const host = this.host!;\n const tabId = this.id();\n host.register({\n id: tabId,\n label: this.label,\n subLabel: this.subLabel,\n disabled: this.disabled,\n errorAggregator: this.errorAggregator,\n hasError: this.hasError,\n errorMessage: this.errorMessage,\n closable: this.closable,\n });\n this.destroyRef.onDestroy(() => host.unregister(tabId));\n }\n}\n","/**\n * Single dev-warning both tab sync directives emit when `@angular/router`\n * is not provided. Shared so the message stays identical across\n * {@link CngxTabsFragmentSync} (deep-linking) and {@link CngxTabsRouteSync}\n * (router-outlet); only the `enables` clause differs. The URL readers\n * themselves stay separate - they target different surfaces (fragment /\n * query-param vs route path) and must not converge.\n *\n * @internal\n */\nexport function warnTabsRouterAbsent(directive: string, enables: string): void {\n console.warn(\n `${directive}: no Router available - directive is a no-op. ` +\n `Provide @angular/router via provideRouter(...) to enable ${enables}.`,\n );\n}\n","import {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nimport { warnTabsRouterAbsent } from './router-absent-warning';\nimport { CNGX_TAB_GROUP_HOST } from './tab-group-host.token';\n\n/**\n * URL deep-linking for tab groups. Bidirectional sync between\n * `activeId` and a URL fragment or query-param. Opt-in via\n * `[cngxTabsFragmentSync]` on the presenter element.\n *\n * - `mode = 'fragment'` (default) → `#tab=settings`\n * - `mode = 'queryParam'` with `paramName = 'tab'` → `?tab=settings`\n *\n * `Router` is optional - without it the directive logs a dev warning\n * via `afterNextRender` and becomes a no-op. Every `router.navigate`\n * and `host.selectById` inside the effects sits in `untracked()`.\n *\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/router-sync.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroupPresenter, CngxTab\n */\n@Directive({\n selector: '[cngxTabsFragmentSync]',\n exportAs: 'cngxTabsFragmentSync',\n standalone: true,\n})\nexport class CngxTabsFragmentSync {\n readonly mode = input<'fragment' | 'queryParam'>('fragment');\n readonly paramName = input<string>('tab');\n\n private readonly host = inject(CNGX_TAB_GROUP_HOST, { host: true });\n private readonly router = inject(Router, { optional: true });\n\n constructor() {\n if (!this.router) {\n afterNextRender(() => warnTabsRouterAbsent('CngxTabsFragmentSync', 'deep-linking'));\n return;\n }\n const router = this.router;\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n const initial = this.readUrlValue(router);\n if (initial) {\n untracked(() => this.host.selectById(initial));\n }\n });\n\n effect(() => {\n const id = this.host.activeId();\n if (!id) {\n return;\n }\n untracked(() => {\n const navigation =\n this.mode() === 'fragment'\n ? router.navigate([], {\n fragment: `${this.paramName()}=${id}`,\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n : router.navigate([], {\n queryParams: { [this.paramName()]: id },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n // Router rejection (e.g. cancelled navigation) has no recovery path.\n navigation.catch?.(() => undefined);\n });\n });\n\n const navEnd = toSignal(\n router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n takeUntilDestroyed(destroyRef),\n ),\n { initialValue: null },\n );\n effect(() => {\n const e = navEnd();\n if (!e) {\n return;\n }\n untracked(() => {\n const next = this.readUrlValue(router);\n if (next && next !== this.host.activeId()) {\n this.host.selectById(next);\n }\n });\n });\n }\n\n private readUrlValue(router: Router): string | null {\n if (this.mode() === 'fragment') {\n const fragment = router.routerState.snapshot.root.fragment ?? '';\n return this.parseFragment(fragment);\n }\n return router.routerState.snapshot.root.queryParamMap.get(this.paramName()) ?? null;\n }\n\n private parseFragment(fragment: string): string | null {\n const param = this.paramName();\n const segments = fragment.split('&');\n for (const seg of segments) {\n const [key, val] = seg.split('=');\n if (key === param && val) {\n return val;\n }\n }\n return null;\n }\n}\n","import { Observable } from 'rxjs';\nimport { NavigationCancel, NavigationEnd, NavigationError, type Router } from '@angular/router';\nimport { filter, take } from 'rxjs/operators';\n\nimport type { CngxTabsCommitAction } from './presenter.directive';\nimport type { CngxTabHandle } from './tab-group-host.token';\n\n/**\n * Options for {@link createTabRouterCommit}.\n *\n * `tabs` is the presenter's live handle list - the action receives the\n * target *index*, so it needs the registry to resolve the matching\n * {@link CngxTabHandle} before computing its route. `[cngxTabsRouteSync]`\n * passes the host's `tabs` signal straight through.\n *\n * @category common/tabs\n */\nexport interface CngxTabRouterCommitOptions {\n readonly router: Router;\n readonly tabs: () => readonly CngxTabHandle[];\n /**\n * Maps a tab handle to its router command array. Default\n * `(handle) => [handle.id]` - the tab id is the child segment.\n * Override for real route paths (`(h) => ['settings', h.id]`).\n */\n readonly routeFor?: (handle: CngxTabHandle) => unknown[];\n}\n\n/**\n * Default tab-to-route mapping: the tab id is the child segment.\n * Shared so the factory and `[cngxTabsRouteSync]` reference one\n * definition instead of inlining the closure twice.\n *\n * @internal\n */\nexport const cngxDefaultTabRoute = (handle: CngxTabHandle): unknown[] => [handle.id];\n\n/**\n * Builds a {@link CngxTabsCommitAction} that gates a tab switch through\n * `@angular/router`. The action navigates to the target tab's route and\n * resolves on the router's own outcome:\n *\n * - `NavigationEnd` → `true` (commit the switch)\n * - `NavigationCancel` (a `CanDeactivate` guard blocked) → `false`\n * - `NavigationError` (guard/resolver threw) → `false`\n *\n * Routed tabs reuse the presenter's commit lifecycle verbatim - the\n * router navigation is simply the async op. In pessimistic mode the\n * active tab follows the *resolved* route, so a cancelled guard keeps\n * the old tab with zero extra gate machinery. The events subscription\n * is opened *before* `navigate(...)` so a synchronously-resolving\n * navigation cannot emit before the action is listening; the commit\n * controller's `cancel()` unsubscribes on supersede.\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/router-commit.ts\n * @since 0.1.0\n */\nexport function createTabRouterCommit(opts: CngxTabRouterCommitOptions): CngxTabsCommitAction {\n const routeFor = opts.routeFor ?? cngxDefaultTabRoute;\n return (_fromIndex, toIndex) =>\n new Observable<boolean>((subscriber) => {\n const target = opts.tabs()[toIndex];\n if (!target) {\n subscriber.next(false);\n subscriber.complete();\n return;\n }\n const sub = opts.router.events\n .pipe(\n filter(\n (e): e is NavigationEnd | NavigationCancel | NavigationError =>\n e instanceof NavigationEnd ||\n e instanceof NavigationCancel ||\n e instanceof NavigationError,\n ),\n take(1),\n )\n .subscribe((event) => {\n subscriber.next(event instanceof NavigationEnd);\n subscriber.complete();\n });\n // A rejected promise surfaces on the events stream as\n // NavigationError, so the subscription above is the single\n // resolution path; swallow the promise rejection to avoid an\n // unhandled-rejection warning.\n opts.router.navigate(routeFor(target)).catch(() => undefined);\n return () => sub.unsubscribe();\n });\n}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n signal,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nimport { CNGX_TABS_COMMIT_ACTION, type CngxTabsCommitActionSource } from './commit-action.token';\nimport { cngxDefaultTabRoute, createTabRouterCommit } from './router-commit';\nimport { warnTabsRouterAbsent } from './router-absent-warning';\nimport { CNGX_TAB_GROUP_HOST, type CngxTabHandle } from './tab-group-host.token';\nimport type { CngxTabsCommitAction } from './presenter.directive';\n\n/**\n * Router-outlet integration for tab groups. Opt-in via\n * `[cngxTabsRouteSync]` on the presenter element. Each tab is an\n * Angular child route whose component renders into a `<router-outlet>`;\n * switching tabs navigates, and a `CanDeactivate` guard can gate the\n * leave.\n *\n * Supplies the presenter's commit-action through the\n * {@link CNGX_TABS_COMMIT_ACTION} DI fallback (no consumer\n * `[commitAction]` hand-binding) and pins **pessimistic** mode so the\n * active tab follows the *resolved* route - a guard-cancelled switch\n * keeps the old tab. The routing gate reuses the presenter's commit\n * lifecycle verbatim; the router navigation is the async op.\n *\n * Seeds the active tab from the current URL on mount and reflects\n * external navigations (back/forward, direct URL) into `activeIndex`\n * *without* re-navigating - those writes bypass the commit-action,\n * since the router is already at the resolved route.\n *\n * `Router` is optional - without it the directive logs a single dev\n * warning via `afterNextRender`, exposes a null action, and becomes a\n * no-op. Mirrors {@link CngxTabsFragmentSync}; every `activeIndex`\n * write inside an effect sits in `untracked()`.\n *\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/route-sync.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroupPresenter, CngxTabsFragmentSync, createTabRouterCommit\n */\n@Directive({\n selector: '[cngxTabsRouteSync]',\n exportAs: 'cngxTabsRouteSync',\n standalone: true,\n providers: [{ provide: CNGX_TABS_COMMIT_ACTION, useExisting: CngxTabsRouteSync }],\n})\nexport class CngxTabsRouteSync implements CngxTabsCommitActionSource {\n /**\n * Maps a tab handle to its router command array. Default\n * `(handle) => [handle.id]` - the tab id is the child segment.\n * Override for real route paths.\n */\n readonly routeFor = input<(handle: CngxTabHandle) => unknown[]>(cngxDefaultTabRoute);\n\n private readonly host = inject(CNGX_TAB_GROUP_HOST, { host: true });\n private readonly router = inject(Router, { optional: true });\n\n /**\n * Pessimistic-only - not exposed as an input. The route-sync owns the\n * mode so optimistic (show-then-revert) can never flash the target\n * tab before a `CanDeactivate` guard decides.\n */\n readonly mode: Signal<'optimistic' | 'pessimistic'> = signal('pessimistic');\n\n /**\n * Router commit-action read by the presenter via the DI fallback.\n * `null` when no `Router` is available (graceful no-op). Rebuilt only\n * when `routeFor` changes; the navigation gate itself is the async\n * op inside the action.\n */\n readonly action: Signal<CngxTabsCommitAction | null> = computed(() => {\n const router = this.router;\n if (!router) {\n return null;\n }\n return createTabRouterCommit({\n router,\n tabs: this.host.tabs,\n routeFor: this.routeFor(),\n });\n });\n\n constructor() {\n if (!this.router) {\n afterNextRender(() => warnTabsRouterAbsent('CngxTabsRouteSync', 'routed tabs'));\n return;\n }\n const router = this.router;\n const destroyRef = inject(DestroyRef);\n\n // Seed from the current URL once the registry has populated.\n afterNextRender(() => {\n untracked(() => this.reflectFromUrl(router));\n });\n\n const navEnd = toSignal(\n router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n takeUntilDestroyed(destroyRef),\n ),\n { initialValue: null },\n );\n effect(() => {\n const e = navEnd();\n if (!e) {\n return;\n }\n untracked(() => this.reflectFromUrl(router));\n });\n }\n\n /**\n * Mirror the URL's active tab onto `activeIndex` without navigating.\n * Writing the index directly (not via `select()`) is the re-entry\n * guard: `select()` would re-run the commit-action and navigate to\n * the route the router is already on, leaving the commit pending\n * forever.\n */\n private reflectFromUrl(router: Router): void {\n const next = this.readActiveId(router);\n if (!next || next === this.host.activeId()) {\n return;\n }\n const index = this.host.tabs().findIndex((t) => t.id === next);\n if (index >= 0) {\n this.host.activeIndex.set(index);\n }\n }\n\n /**\n * Find the tab whose route is the trailing segment(s) of the current\n * URL path. Anchors on position (a suffix match), not a loose\n * \"appears anywhere\" scan - a tab id that happens to equal an\n * unrelated parent segment cannot win. The path is taken before any\n * query/fragment. If two tabs produce the same trailing segment(s)\n * (only possible with a custom `routeFor` that collides), the first\n * registered tab wins - the default id-based mapping never collides.\n */\n private readActiveId(router: Router): string | null {\n const path = router.url.split(/[?#]/)[0];\n const segments = path.split('/').filter(Boolean);\n const routeFor = this.routeFor();\n for (const tab of this.host.tabs()) {\n const route = routeFor(tab).map((command) => String(command));\n if (route.length === 0 || route.length > segments.length) {\n continue;\n }\n const tail = segments.slice(-route.length);\n if (tail.every((segment, i) => segment === route[i])) {\n return tab.id;\n }\n }\n return null;\n }\n}\n","import {\n type EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n type Provider,\n type TemplateRef,\n} from '@angular/core';\n\nimport type { CngxTabOverflowItemContext } from './overflow/tab-overflow-item.directive';\nimport type { CngxTabOverflowTriggerContext } from './overflow/tab-overflow-trigger.directive';\nimport type { CngxTabBusySpinnerContext } from './slots/tab-busy-spinner.directive';\nimport type { CngxTabCloseIconContext } from './slots/tab-close-icon.directive';\nimport type { CngxTabErrorBadgeContext } from './slots/tab-error-badge.directive';\nimport type { CngxTabIconContext } from './slots/tab-icon.directive';\nimport type { CngxTabRejectionIconContext } from './slots/tab-rejection-icon.directive';\n\n/**\n * Aria-label overrides for the tab-group landmark region. Library\n * defaults are English; consumers override via\n * {@link withTabsAriaLabels}.\n *\n * Per-tab nav phrasing (`previousTab`, `nextTab`) lives in\n * {@link CngxTabsI18n}, not here - landmark naming and SR phrasing\n * stay on separate override paths.\n *\n * @category common/tabs\n */\nexport interface CngxTabsAriaLabels {\n readonly tabsRegion?: string;\n}\n\n/**\n * Fallback labels for derived strings (role descriptions, badge SR\n * announcements). Library defaults are English; consumers override\n * per locale.\n *\n * @category common/tabs\n */\nexport interface CngxTabsFallbackLabels {\n readonly tabRoleDescription?: string;\n readonly tabPanelRoleDescription?: string;\n}\n\n/**\n * App-wide template overrides for `<cngx-tab-group>` and\n * `<cngx-tab-overflow>` skin regions. Middle tier of the 3-stage\n * cascade - per-instance directive > this field > built-in markup.\n * Apply via the matching `with*Template` builders. Shape mirrors\n * `CngxStepperTemplates` so consumer templates port across\n * families.\n *\n * @category common/tabs\n */\nexport interface CngxTabsTemplates {\n readonly overflowTrigger?: TemplateRef<CngxTabOverflowTriggerContext>;\n readonly overflowItem?: TemplateRef<CngxTabOverflowItemContext>;\n readonly errorBadge?: TemplateRef<CngxTabErrorBadgeContext>;\n readonly rejectionIcon?: TemplateRef<CngxTabRejectionIconContext>;\n readonly busySpinner?: TemplateRef<CngxTabBusySpinnerContext>;\n readonly icon?: TemplateRef<CngxTabIconContext>;\n readonly closeIcon?: TemplateRef<CngxTabCloseIconContext>;\n readonly addIcon?: TemplateRef<void>;\n}\n\n/**\n * Selectable visual skin for `<cngx-tab-group>`. The skin is a pure\n * thematic concern - every value renders the same `tablist` / `tab` /\n * `tabpanel` structure, slots, ARIA, and keyboard behaviour, and only\n * redirects CSS via the `[data-skin]` host attribute. `'line'`\n * (default) is the underline indicator; `'contained'` fuses the active\n * tab with the panel surface; `'segmented'` sits the tabs in a muted\n * track and lifts the active tab onto a raised surface; `'pill'`\n * renders rounded solid fills; `'pill-outline'` renders the same pill\n * geometry with a tinted, outlined active state instead of a solid\n * fill. Sized to the tab use cases - not a 1:1 copy of the stepper's\n * seven skins. The Material twin (`[cngxMatTabs]`) ignores this setting.\n *\n * @category common/tabs\n */\nexport type CngxTabsSkin = 'line' | 'contained' | 'segmented' | 'pill' | 'pill-outline';\n\n/**\n * Icon-layout axis for `<cngx-tab-group>`, orthogonal to both skin and\n * orientation. Positions the `*cngxTabIcon` slot relative to the tab\n * label: `'start'` (default) places the icon before the label in a row;\n * `'end'` places it after the label in a row; `'top'` stacks the icon\n * above the label in a column; `'only'` hides the label visually while\n * keeping it in the DOM as the accessible name. Redirected purely via\n * the `[data-icon-layout]` host attribute.\n *\n * @category common/tabs\n */\nexport type CngxTabIconLayout = 'start' | 'end' | 'top' | 'only';\n\n/**\n * Panel render strategy for `<cngx-tab-group>`. The panel `<div>` (the\n * `aria-controls` target) always stays in the DOM; only its content is\n * rendered per mode. `'eager'` (default) renders every panel's content\n * up front and toggles visibility via `[hidden]` - today's behaviour,\n * byte-identical. `'lazy'` renders a panel's content the first time it\n * is activated and keeps it (keep-alive). `'lazy-destroy'` renders only\n * the active panel's content and destroys it on leave.\n *\n * @category common/tabs\n */\nexport type CngxTabsPanelMode = 'eager' | 'lazy' | 'lazy-destroy';\n\n/**\n * Horizontal alignment of the tab cluster along the strip, set via the\n * `[tabAlign]` Input and reflected onto `[data-tab-align]`. `'start'`\n * (default), `'center'`, or `'end'`. Horizontal only - ignored under\n * `orientation=\"vertical\"` (tabs fill the column) and when `[fitted]`\n * stretches them to the full width.\n *\n * @category common/tabs\n */\nexport type CngxTabAlign = 'start' | 'center' | 'end';\n\n/**\n * Tab-group config surface. Resolution priority: per-instance Input\n * → `provideTabsConfigAt` (viewProviders) → `provideTabsConfig`\n * (root) → library default.\n *\n * @category common/tabs\n */\nexport interface CngxTabsConfig {\n readonly defaultOrientation?: 'horizontal' | 'vertical';\n readonly defaultLoop?: boolean;\n readonly defaultCommitMode?: 'optimistic' | 'pessimistic';\n readonly fragmentSyncMode?: 'fragment' | 'queryParam';\n readonly fragmentSyncParam?: string;\n /**\n * App-wide default visual skin. Default `'line'`. Per-instance\n * `[skin]` Input still wins; the cascade default itself lives in\n * `createTabsHostAttrs`, not here (mirrors the stepper). Override via\n * {@link withTabsSkin}.\n */\n readonly skin?: CngxTabsSkin;\n /**\n * App-wide default icon layout. Default `'start'`. Per-instance\n * `[iconLayout]` Input still wins; the cascade default lives in\n * `createTabsHostAttrs`. Override via {@link withTabsIconLayout}.\n */\n readonly iconLayout?: CngxTabIconLayout;\n /**\n * App-wide default panel render strategy. Default `'eager'`.\n * Per-instance `[panelMode]` Input still wins; the cascade default\n * lives in `createTabsHostAttrs`. Override via\n * {@link withTabsPanelMode}.\n */\n readonly panelMode?: CngxTabsPanelMode;\n /**\n * App-wide default for stretching tabs to the full strip width\n * (horizontal only). Default `false`. Per-instance `[fitted]` Input\n * wins; the cascade default lives in `createTabsHostAttrs`. Override\n * via {@link withTabsFitted}.\n */\n readonly fitted?: boolean;\n /**\n * App-wide default tab-cluster alignment (horizontal only). Default\n * `'start'`. Per-instance `[tabAlign]` Input wins; the cascade default\n * lives in `createTabsHostAttrs`. Override via {@link withTabsAlign}.\n */\n readonly tabAlign?: CngxTabAlign;\n /**\n * App-wide default for whether tabs render a close affordance.\n * Default `false`. Per-instance `[closable]` Input wins, and a\n * per-`CngxTab` `[closable]` override wins over both. The cascade\n * default lives in the organism. Override via {@link withTabsClosable}.\n */\n readonly closable?: boolean;\n /**\n * App-wide default for whether the group renders an add-tab button.\n * Default `false`. Per-instance `[addable]` Input wins. Override via\n * {@link withTabsAddable}.\n */\n readonly addable?: boolean;\n readonly ariaLabels?: CngxTabsAriaLabels;\n readonly fallbackLabels?: CngxTabsFallbackLabels;\n /**\n * Quiescence window (ms) for the overflow IO debounce. Burst\n * emissions during strip animations collapse to one write; the\n * More counter re-renders once IO has been quiet this long.\n * Default 100ms. Capped by {@link overflowMaxDeferMs}.\n */\n readonly overflowStabilizeMs?: number;\n /**\n * Hard ceiling (ms) on commit deferral while IO bursts keep\n * arriving - without it, sustained churn (momentum scroll,\n * continuous resize) would clear the stabilize timer forever and\n * the More counter would freeze on a stale value, breaking\n * Pillar 2. Default 250ms.\n */\n readonly overflowMaxDeferMs?: number;\n /**\n * App-wide template overrides for `<cngx-tab-overflow>` regions.\n * Middle tier of the family-standard 3-stage cascade. See\n * {@link CngxTabsTemplates}.\n */\n readonly templates?: CngxTabsTemplates;\n}\n\nconst TABS_CONFIG_DEFAULTS: Required<\n Omit<\n CngxTabsConfig,\n | 'ariaLabels'\n | 'fallbackLabels'\n | 'templates'\n | 'skin'\n | 'iconLayout'\n | 'panelMode'\n | 'fitted'\n | 'tabAlign'\n | 'closable'\n | 'addable'\n >\n> & {\n ariaLabels: CngxTabsAriaLabels;\n fallbackLabels: CngxTabsFallbackLabels;\n templates: CngxTabsTemplates;\n} = {\n defaultOrientation: 'horizontal',\n defaultLoop: true,\n defaultCommitMode: 'optimistic',\n fragmentSyncMode: 'fragment',\n fragmentSyncParam: 'tab',\n ariaLabels: {\n tabsRegion: 'Tabs',\n },\n fallbackLabels: {\n // W3C ARIA tablist convention - kept distinct from\n // `i18n.tabsLabel` so AT doesn't read the same string twice\n // back-to-back across `aria-roledescription` and `aria-label`.\n tabRoleDescription: 'tab list',\n tabPanelRoleDescription: 'tab panel',\n },\n overflowStabilizeMs: 100,\n overflowMaxDeferMs: 250,\n templates: {},\n};\n\n/**\n * DI token for the resolved tabs config. `providedIn: 'root'` with\n * the library defaults; override via {@link provideTabsConfig}\n * (root) or {@link provideTabsConfigAt} (component scope).\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tabs-config.ts\n * @since 0.1.0\n */\nexport const CNGX_TABS_CONFIG = new InjectionToken<CngxTabsConfig>('CngxTabsConfig', {\n providedIn: 'root',\n factory: () => TABS_CONFIG_DEFAULTS,\n});\n\n/**\n * Feature signature for `with*` config builders. The hidden\n * `_target` discriminator lets {@link provideCngxTabs} dispatch\n * config features to {@link provideTabsConfig} while i18n features\n * route to {@link provideTabsI18n}.\n *\n * @category common/tabs\n */\nexport type CngxTabsConfigFeature = ((config: CngxTabsConfig) => CngxTabsConfig) & {\n readonly _target: 'config';\n};\n\n/**\n * Internal helper that brands a config-mutator function with the\n * `_target` discriminator. Every `with*` config feature returns one\n * of these.\n *\n * @internal\n */\nfunction defineTabsConfigFeature(\n fn: (config: CngxTabsConfig) => CngxTabsConfig,\n): CngxTabsConfigFeature {\n return Object.assign(fn, { _target: 'config' as const });\n}\n\n/**\n * Override the default orientation. Per-instance `[orientation]`\n * still wins; this changes the cascade default only.\n *\n * @category common/tabs\n */\nexport function withTabsDefaultOrientation(\n orientation: 'horizontal' | 'vertical',\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n defaultOrientation: orientation,\n }));\n}\n\n/**\n * @deprecated Use {@link withTabsDefaultOrientation}. The unprefixed name\n * collides with the stepper family's identical symbol when both libs\n * are auto-imported. The alias stays for one minor release before\n * removal.\n *\n * @category common/tabs\n */\nexport const withDefaultOrientation = withTabsDefaultOrientation;\n\n/**\n * Override whether roving-tabindex navigation loops from last back to\n * first (and vice versa). Per-instance `[loop]` Input still wins.\n *\n * @category common/tabs\n */\nexport function withTabsRovingLoop(loop: boolean): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, defaultLoop: loop }));\n}\n\n/**\n * Override the default commit mode for async tab transitions.\n * `'optimistic'` activates the tab on action dispatch and rolls back\n * on error; `'pessimistic'` waits for success. Per-instance\n * `[commitMode]` Input still wins.\n *\n * @category common/tabs\n */\nexport function withTabsCommitMode(mode: 'optimistic' | 'pessimistic'): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n defaultCommitMode: mode,\n }));\n}\n\n/**\n * Configure URL fragment / query-param deep-linking for the active tab\n * (the {@link CngxTabsFragmentSync} directive). `mode` chooses the URL\n * surface (URL fragment or query parameter); `param` names the key\n * (default `'tab'`).\n *\n * Not to be confused with `[cngxTabsRouteSync]`, the router-outlet\n * integration - this feature configures fragment deep-linking only.\n *\n * @category common/tabs\n */\nexport function withTabsFragmentSync(\n mode: 'fragment' | 'queryParam',\n param = 'tab',\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n fragmentSyncMode: mode,\n fragmentSyncParam: param,\n }));\n}\n\n/**\n * @deprecated Use {@link withTabsFragmentSync}. \"Router sync\" collided\n * with the new `[cngxTabsRouteSync]` router-outlet directive; this\n * feature only ever configured fragment / query-param deep-linking. The\n * alias stays for one minor release before removal.\n *\n * @category common/tabs\n */\nexport const withTabsRouterSync = withTabsFragmentSync;\n\n/**\n * Select the app-wide default visual skin for `<cngx-tab-group>`.\n * Default `'line'`. Per-instance `[skin]` Input still wins; this moves\n * the cascade default. Structure, slots, ARIA, and keyboard behaviour\n * are identical across skins - only the `[data-skin]` host attribute\n * changes the CSS layer. The Material twin (`[cngxMatTabs]`) ignores it.\n *\n * @category common/tabs\n */\nexport function withTabsSkin(skin: CngxTabsSkin): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, skin }));\n}\n\n/**\n * Set the app-wide default icon layout for `<cngx-tab-group>`. Default\n * `'start'`. Per-instance `[iconLayout]` Input still wins. Orthogonal to\n * skin and orientation - only the `[data-icon-layout]` host attribute\n * changes.\n *\n * @category common/tabs\n */\nexport function withTabsIconLayout(layout: CngxTabIconLayout): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, iconLayout: layout }));\n}\n\n/**\n * Set the app-wide default panel render strategy for `<cngx-tab-group>`.\n * Default `'eager'` (every panel's content rendered up front, toggled\n * via `[hidden]`). `'lazy'` keep-alives content after first activation;\n * `'lazy-destroy'` renders only the active panel's content. Per-instance\n * `[panelMode]` Input still wins. The panel `<div>` always stays in the\n * DOM regardless of mode (the `aria-controls` target).\n *\n * @category common/tabs\n */\nexport function withTabsPanelMode(mode: CngxTabsPanelMode): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, panelMode: mode }));\n}\n\n/**\n * Set the app-wide default for stretching tabs to the full strip width\n * (horizontal only). Default `false`. Per-instance `[fitted]` Input still\n * wins. No effect under `orientation=\"vertical\"`.\n *\n * @category common/tabs\n */\nexport function withTabsFitted(fitted: boolean): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, fitted }));\n}\n\n/**\n * Set the app-wide default tab-cluster alignment (horizontal only).\n * Default `'start'`. Per-instance `[tabAlign]` Input still wins. Ignored\n * under `orientation=\"vertical\"` and when the group is `fitted`.\n *\n * @category common/tabs\n */\nexport function withTabsAlign(align: CngxTabAlign): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, tabAlign: align }));\n}\n\n/**\n * Set the app-wide default for whether tabs render a close affordance.\n * Default `false`. Per-instance `[closable]` Input wins; a per-`CngxTab`\n * `[closable]` override wins over both.\n *\n * @category common/tabs\n */\nexport function withTabsClosable(closable: boolean): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, closable }));\n}\n\n/**\n * Set the app-wide default for whether the group renders an add-tab\n * button. Default `false`. Per-instance `[addable]` Input wins.\n *\n * @category common/tabs\n */\nexport function withTabsAddable(addable: boolean): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, addable }));\n}\n\n/**\n * Merge ARIA labels into the cascade. Keys not provided keep their\n * library defaults; per-instance overrides on the tab group still win.\n *\n * @category common/tabs\n */\nexport function withTabsAriaLabels(labels: CngxTabsAriaLabels): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n ariaLabels: { ...cfg.ariaLabels, ...labels },\n }));\n}\n\n/**\n * Merge text fallback labels (overflow trigger, busy / rejection text)\n * into the cascade. Used when a slot directive is not present.\n *\n * @category common/tabs\n */\nexport function withTabsFallbackLabels(labels: CngxTabsFallbackLabels): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n fallbackLabels: { ...cfg.fallbackLabels, ...labels },\n }));\n}\n\n/**\n * Override the IO-debounce window (ms). See\n * {@link CngxTabsConfig.overflowStabilizeMs}.\n *\n * @category common/tabs\n */\nexport function withTabOverflowStabilizeMs(ms: number): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n overflowStabilizeMs: ms,\n }));\n}\n\n/**\n * Override the worst-case staleness ceiling on the visibility-map\n * commit. See {@link CngxTabsConfig.overflowMaxDeferMs}.\n *\n * @category common/tabs\n */\nexport function withTabOverflowMaxDeferMs(ms: number): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n overflowMaxDeferMs: ms,\n }));\n}\n\n/**\n * App-wide override for the More-button label. Middle tier;\n * per-instance `*cngxTabOverflowTrigger` still wins.\n *\n * ```ts\n * @ViewChild('moreTrigger', { static: true, read: TemplateRef })\n * moreTrigger!: TemplateRef<CngxTabOverflowTriggerContext>;\n *\n * providers: [provideTabsConfig(withTabOverflowTriggerTemplate(this.moreTrigger))]\n * ```\n *\n * @category common/tabs\n */\nexport function withTabOverflowTriggerTemplate(\n template: TemplateRef<CngxTabOverflowTriggerContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, overflowTrigger: template },\n }));\n}\n\n/**\n * App-wide override for each row inside the overflow popover.\n * Middle tier; per-instance `*cngxTabOverflowItem` still wins.\n *\n * @category common/tabs\n */\nexport function withTabOverflowItemTemplate(\n template: TemplateRef<CngxTabOverflowItemContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, overflowItem: template },\n }));\n}\n\n/**\n * App-wide override for the error-badge decoration. Middle tier;\n * per-instance `*cngxTabErrorBadge` still wins. Sibling of the\n * stepper family's `withStepBadgeTemplate`.\n *\n * @category common/tabs\n */\nexport function withTabErrorBadgeTemplate(\n template: TemplateRef<CngxTabErrorBadgeContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, errorBadge: template },\n }));\n}\n\n/**\n * App-wide override for the rejection-icon decoration. Middle\n * tier; per-instance `*cngxTabRejectionIcon` still wins. Sibling\n * of {@link withStepRejectionTemplate}.\n *\n * @category common/tabs\n */\nexport function withTabRejectionIconTemplate(\n template: TemplateRef<CngxTabRejectionIconContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, rejectionIcon: template },\n }));\n}\n\n/**\n * App-wide override for the commit-pending busy-spinner overlay.\n * Middle tier; per-instance `*cngxTabBusySpinner` still wins.\n * Sibling of {@link withStepBusySpinnerTemplate}.\n *\n * @category common/tabs\n */\nexport function withTabBusySpinnerTemplate(\n template: TemplateRef<CngxTabBusySpinnerContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, busySpinner: template },\n }));\n}\n\n/**\n * App-wide override for the tab-icon slot. Middle tier of the 3-stage\n * cascade; per-instance `*cngxTabIcon` still wins. Sibling of\n * {@link withStepIndicatorTemplate}.\n *\n * @category common/tabs\n */\nexport function withTabIconTemplate(\n template: TemplateRef<CngxTabIconContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, icon: template },\n }));\n}\n\n/**\n * App-wide override for a tab's close-button glyph. Middle tier;\n * per-instance `*cngxTabCloseIcon` still wins.\n *\n * @category common/tabs\n */\nexport function withTabCloseIconTemplate(\n template: TemplateRef<CngxTabCloseIconContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, closeIcon: template },\n }));\n}\n\n/**\n * App-wide override for the add-tab button glyph. Middle tier;\n * per-instance `*cngxTabAddIcon` still wins.\n *\n * @category common/tabs\n */\nexport function withTabAddIconTemplate(template: TemplateRef<void>): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, addIcon: template },\n }));\n}\n\nfunction resolveFeatures(features: readonly CngxTabsConfigFeature[]): CngxTabsConfig {\n return features.reduce<CngxTabsConfig>((cfg, feat) => feat(cfg), TABS_CONFIG_DEFAULTS);\n}\n\n/**\n * Root-level provider. Apply once in `bootstrapApplication` /\n * `appConfig.providers`. Returns {@link EnvironmentProviders} per\n * the canonical cngx config-cascade signature.\n *\n * @category common/tabs\n */\nexport function provideTabsConfig(\n ...features: readonly CngxTabsConfigFeature[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CNGX_TABS_CONFIG, useValue: resolveFeatures(features) },\n ]);\n}\n\n/**\n * Component-scoped override. Returns `Provider[]` (not\n * {@link EnvironmentProviders}) because `viewProviders` rejects\n * opaque environment providers. Resolution priority: per-instance\n * Input > viewProviders (`At`) > root > default.\n *\n * ```ts\n * @Component({\n * viewProviders: [...provideTabsConfigAt(withTabsDefaultOrientation('vertical'))],\n * })\n * ```\n *\n * @category common/tabs\n */\nexport function provideTabsConfigAt(...features: readonly CngxTabsConfigFeature[]): Provider[] {\n return [{ provide: CNGX_TABS_CONFIG, useValue: resolveFeatures(features) }];\n}\n\n/**\n * Inject the resolved tabs config in an injection context.\n *\n * @category common/tabs\n */\nexport function injectTabsConfig(): CngxTabsConfig {\n return inject(CNGX_TABS_CONFIG);\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type {\n CngxTabAlign,\n CngxTabIconLayout,\n CngxTabsConfig,\n CngxTabsPanelMode,\n CngxTabsSkin,\n} from './tabs-config';\n\n/**\n * Input bundle for {@link createTabsHostAttrs}: the per-instance inputs\n * (each `Signal<T | undefined>`) and the resolved config (read\n * synchronously at construction). Each cascade collapses through\n * `input ?? config ?? library-default`.\n *\n * @internal\n */\nexport interface CngxTabsHostAttrsInputs {\n readonly skin: Signal<CngxTabsSkin | undefined>;\n readonly iconLayout: Signal<CngxTabIconLayout | undefined>;\n readonly panelMode: Signal<CngxTabsPanelMode | undefined>;\n readonly fitted: Signal<boolean | undefined>;\n readonly tabAlign: Signal<CngxTabAlign | undefined>;\n readonly config: CngxTabsConfig;\n}\n\n/**\n * Host-attribute signals for `<cngx-tab-group>`. Each is read by a\n * `[attr.data-*]` host binding on the organism.\n *\n * @internal\n */\nexport interface CngxTabsHostAttrs {\n readonly resolvedSkin: Signal<CngxTabsSkin>;\n readonly resolvedIconLayout: Signal<CngxTabIconLayout>;\n readonly resolvedPanelMode: Signal<CngxTabsPanelMode>;\n readonly resolvedFitted: Signal<boolean>;\n readonly resolvedTabAlign: Signal<CngxTabAlign>;\n}\n\n/**\n * Level-2 helper resolving the host-attribute cascades for\n * `<cngx-tab-group>` (skin / iconLayout). Keeps the organism class\n * under the LOC guard while making the cascade pattern reusable. Sibling\n * shape to `createStepperHostAttrs`; the resolved-type unions differ per\n * family, so the helpers are siblings, not shared code.\n *\n * Each computed honors Pillar 1 (Ableitung statt Verwaltung):\n * per-instance input wins over root config wins over library default. No\n * manual sync. The library defaults (`'line'` / `'start'`) live here,\n * not in `TABS_CONFIG_DEFAULTS` - mirroring the stepper.\n *\n * @internal\n */\nexport function createTabsHostAttrs(\n inputs: CngxTabsHostAttrsInputs,\n): CngxTabsHostAttrs {\n return {\n resolvedSkin: computed<CngxTabsSkin>(\n () => inputs.skin() ?? inputs.config.skin ?? 'line',\n ),\n resolvedIconLayout: computed<CngxTabIconLayout>(\n () => inputs.iconLayout() ?? inputs.config.iconLayout ?? 'start',\n ),\n resolvedPanelMode: computed<CngxTabsPanelMode>(\n () => inputs.panelMode() ?? inputs.config.panelMode ?? 'eager',\n ),\n resolvedFitted: computed<boolean>(\n () => inputs.fitted() ?? inputs.config.fitted ?? false,\n ),\n resolvedTabAlign: computed<CngxTabAlign>(\n () => inputs.tabAlign() ?? inputs.config.tabAlign ?? 'start',\n ),\n };\n}\n","import { inject, InjectionToken, type Provider } from '@angular/core';\n\n/**\n * Tabs i18n surface. Library defaults are English; consumers\n * override via {@link provideTabsI18n}. Sibling to\n * `CNGX_STEPPER_I18N` and `CNGX_CHART_I18N`.\n *\n * @category common/tabs/i18n\n */\nexport interface CngxTabsI18n {\n readonly tabsLabel: string;\n readonly selectedTab: (label: string, position: number, count: number) => string;\n /**\n * Folds a tab's optional secondary label into its accessible name.\n * Receives the primary label and the sub-label detail; the result\n * is passed to {@link selectedTab} as the label part, e.g.\n * `Tab 2 of 5: Bookmarks, 45`. Only invoked when a sub-label is\n * present.\n */\n readonly tabLabelWithDetail: (label: string, detail: string) => string;\n readonly tabHasErrors: (count: number) => string;\n readonly moreTabsLabel: (count: number) => string;\n readonly previousTab: string;\n readonly nextTab: string;\n /**\n * Accessible name for a tab's close button. Receives the tab label\n * (or a generic fallback when unlabeled) and yields the button's\n * `aria-label`, e.g. `Close \"Profile\"`.\n */\n readonly closeTab: (label: string) => string;\n /** Accessible name for the add-tab button. */\n readonly addTab: string;\n /**\n * @deprecated Superseded by {@link commitRolledBackTo}. Retained as\n * the defensive fallback in `liveAnnouncement` when the origin\n * label is unresolvable - fires for unlabeled tabs or programmatic\n * `commitState` writes that bypass `select()`. See\n * `tabs-accepted-debt §4`.\n */\n readonly commitFailedRetry: string;\n readonly commitInFlight: string;\n /**\n * Origin-aware rollback announcement. Receives the safe-harbour\n * tab label and yields the rollback phrase. Read on the\n * `pending → error` transition when both `lastFailedIndex` and\n * `originIndexDuringCommit` are set.\n */\n readonly commitRolledBackTo: (originLabel: string) => string;\n}\n\nconst TABS_I18N_DEFAULTS: CngxTabsI18n = {\n tabsLabel: 'Tabs',\n selectedTab: (label, position, count) => `Tab ${position} of ${count}: ${label}`,\n tabLabelWithDetail: (label, detail) => `${label}, ${detail}`,\n tabHasErrors: (count) => `${count} error${count === 1 ? '' : 's'}`,\n moreTabsLabel: (count) => `${count} more`,\n previousTab: 'Previous tab',\n nextTab: 'Next tab',\n closeTab: (label) => `Close \"${label}\"`,\n addTab: 'Add tab',\n commitFailedRetry: 'Tab change refused — retry?',\n commitInFlight: 'Switching tab…',\n commitRolledBackTo: (originLabel) => `Could not save changes — reverted to \"${originLabel}\".`,\n};\n\n/**\n * DI token for the tabs i18n bundle. `providedIn: 'root'` with\n * English defaults.\n *\n * @category common/tabs/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/i18n/tabs-i18n.ts\n * @since 0.1.0\n */\nexport const CNGX_TABS_I18N = new InjectionToken<CngxTabsI18n>('CngxTabsI18n', {\n providedIn: 'root',\n factory: () => TABS_I18N_DEFAULTS,\n});\n\n/**\n * Branded feature-fn for {@link provideTabsI18n} and\n * {@link provideCngxTabs}. The hidden `_target` discriminator routes\n * i18n features to `provideTabsI18n` and config features to\n * `provideTabsConfig` from the unified aggregator.\n *\n * @category common/tabs/i18n\n */\nexport type CngxTabsI18nFeature = ((bundle: CngxTabsI18n) => CngxTabsI18n) & {\n readonly _target: 'i18n';\n};\n\n/**\n * Brands an i18n-mutator with the `_target` discriminator.\n *\n * @internal\n */\nfunction defineTabsI18nFeature(fn: (bundle: CngxTabsI18n) => CngxTabsI18n): CngxTabsI18nFeature {\n return Object.assign(fn, { _target: 'i18n' as const });\n}\n\n/**\n * Override i18n labels via a partial bundle - unset keys keep the\n * English default. Same shape as `withTabsAriaLabels` /\n * `withTabsFallbackLabels` so `provideCngxTabs` composes both\n * surfaces uniformly.\n *\n * @category common/tabs/i18n\n */\nexport function withTabsI18nLabels(overrides: Partial<CngxTabsI18n>): CngxTabsI18nFeature {\n return defineTabsI18nFeature((bundle) => ({ ...bundle, ...overrides }));\n}\n\nfunction resolveI18nFeatures(features: readonly CngxTabsI18nFeature[]): CngxTabsI18n {\n return features.reduce<CngxTabsI18n>((bundle, feat) => feat(bundle), TABS_I18N_DEFAULTS);\n}\n\n/**\n * Provider for the tabs i18n bundle. Compose `withTabsI18nLabels(...)`\n * (and future i18n `with*` features); unset keys fall back to the\n * English default.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideTabsI18n(\n * withTabsI18nLabels({ tabsLabel: 'Reiter', previousTab: 'Vorheriger' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/tabs/i18n\n */\nexport function provideTabsI18n(...features: readonly CngxTabsI18nFeature[]): Provider {\n return {\n provide: CNGX_TABS_I18N,\n useValue: resolveI18nFeatures(features),\n };\n}\n\n/**\n * Inject the resolved tabs i18n bundle.\n *\n * @category common/tabs/i18n\n */\nexport function injectTabsI18n(): CngxTabsI18n {\n return inject(CNGX_TABS_I18N);\n}\n","import {\n type EnvironmentProviders,\n isDevMode,\n makeEnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport {\n provideTabsI18n,\n type CngxTabsI18nFeature,\n} from './i18n/tabs-i18n';\nimport {\n provideTabsConfig,\n provideTabsConfigAt,\n type CngxTabsConfigFeature,\n} from './tabs-config';\n\n/**\n * Union of feature kinds the tabs aggregator accepts. Today: config\n * + i18n; future surfaces widen the union and dispatch via the\n * hidden `_target` discriminator.\n *\n * @category common/tabs\n */\nexport type CngxTabsFeature = CngxTabsConfigFeature | CngxTabsI18nFeature;\n\n/** @internal */\ninterface PartitionedFeatures {\n readonly config: CngxTabsConfigFeature[];\n readonly i18n: CngxTabsI18nFeature[];\n}\n\nfunction partitionFeatures(\n features: readonly CngxTabsFeature[],\n): PartitionedFeatures {\n const config: CngxTabsConfigFeature[] = [];\n const i18n: CngxTabsI18nFeature[] = [];\n for (const feat of features) {\n if (feat._target === 'i18n') {\n i18n.push(feat);\n continue;\n }\n if (feat._target === 'config') {\n config.push(feat);\n continue;\n }\n // Unbranded feature — runtime escape from the `_target` type.\n // Drop with dev-warn so an i18n-shaped override never lands\n // silently in `CNGX_TABS_CONFIG`.\n if (isDevMode()) {\n console.warn(\n '[provideCngxTabs] Dropped feature without a `_target` ' +\n 'discriminator. Brand config-side mutators with ' +\n '`defineTabsConfigFeature(...)` (or use a `with*` helper) ' +\n 'and i18n-side mutators with `withTabsI18nLabels(...)`.',\n );\n }\n }\n return { config, i18n };\n}\n\n/**\n * Unified aggregator for tabs configuration. Routes features by\n * `_target` to {@link provideTabsConfig} and {@link provideTabsI18n}.\n * Sibling to `provideCngxMenu` and `provideCngxSelect`; apply once in\n * the app providers array. Returns {@link EnvironmentProviders}; for\n * `viewProviders` use {@link provideCngxTabsAt} — opaque\n * `EnvironmentProviders` cannot live there.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideCngxTabs(\n * withTabsDefaultOrientation('vertical'),\n * withTabsAriaLabels({ tabsRegion: 'Bereiche' }),\n * withTabsI18nLabels({ tabsLabel: 'Bereiche', moreTabsLabel: (n) => `${n} mehr` }),\n * withTabOverflowStabilizeMs(150),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/tabs\n */\nexport function provideCngxTabs(\n ...features: readonly CngxTabsFeature[]\n): EnvironmentProviders {\n const { config, i18n } = partitionFeatures(features);\n return makeEnvironmentProviders([\n provideTabsConfig(...config),\n ...(i18n.length > 0 ? [provideTabsI18n(...i18n)] : []),\n ]);\n}\n\n/**\n * Component-scoped twin of {@link provideCngxTabs}. Returns\n * `Provider[]` for `viewProviders`/`providers`; same dispatch\n * semantics, different scope.\n *\n * ```ts\n * @Component({\n * viewProviders: [\n * ...provideCngxTabsAt(\n * withTabsDefaultOrientation('vertical'),\n * withTabsI18nLabels({ tabsLabel: 'Bereiche' }),\n * ),\n * ],\n * })\n * ```\n *\n * @category common/tabs\n */\nexport function provideCngxTabsAt(\n ...features: readonly CngxTabsFeature[]\n): Provider[] {\n const { config, i18n } = partitionFeatures(features);\n return [\n ...provideTabsConfigAt(...config),\n ...(i18n.length > 0 ? [provideTabsI18n(...i18n)] : []),\n ];\n}\n","import { InjectionToken } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\nimport type { CngxTabPanelHost } from '../tab-panel-host.token';\n\n/**\n * Resolves the DOM elements `<cngx-tab-overflow>` observes. cngx-native\n * keys by `[id=\"${handle.id}-header\"]`; the Material twin keys by\n * positional index into `.mat-mdc-tab` (handle ids never appear on\n * Material's rendered DOM). The molecule is variant-agnostic and\n * consumes whichever adapter\n * {@link CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY} provides.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowDomAdapter {\n /**\n * Resolve the IntersectionObserver root - the scroll viewport the\n * molecule observes. Returning `null` short-circuits the attach;\n * the molecule's rAF retry loop polls again next frame.\n */\n resolveStripRoot(panelHost: CngxTabPanelHost, host: HTMLElement): HTMLElement | null;\n\n /**\n * Resolve the rendered button for `handle` inside `root`. cngx-native\n * keys by `handle.id`; Material adapters key by `idx`.\n */\n resolveTabButton(handle: CngxTabHandle, root: HTMLElement, idx: number): HTMLElement | null;\n}\n\n/**\n * Factory signature for {@link CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY}.\n *\n * @category common/tabs/overflow\n */\nexport type CngxTabOverflowDomAdapterFactory = () => CngxTabOverflowDomAdapter;\n\n/**\n * Default adapter for the cngx-native `<cngx-tab-group>` strip:\n * walks `host.closest('.cngx-tabs__strip-wrapper')` for the IO root,\n * then `[id=\"${handle.id}-header\"]` for each button.\n *\n * @category common/tabs/overflow\n */\nexport function createCngxTabOverflowDefaultDomAdapter(): CngxTabOverflowDomAdapter {\n return {\n resolveStripRoot(_panelHost, host) {\n const wrapper = host.closest<HTMLElement>('.cngx-tabs__strip-wrapper');\n return wrapper?.querySelector<HTMLElement>('.cngx-tabs__strip') ?? null;\n },\n resolveTabButton(handle, root, _idx) {\n return root.querySelector<HTMLElement>(`[id=\"${handle.id}-header\"]`);\n },\n };\n}\n\n/**\n * DI token for the overflow molecule's DOM-resolution strategy.\n * Override at directive `providers` or component `viewProviders` to\n * swap in a Material, custom-skin, or test-double adapter without\n * forking the molecule. Defaults to\n * {@link createCngxTabOverflowDefaultDomAdapter}.\n *\n * @category common/tabs/overflow\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/dom-adapter.ts\n * @since 0.1.0\n */\nexport const CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY =\n new InjectionToken<CngxTabOverflowDomAdapterFactory>('CngxTabOverflowDomAdapterFactory', {\n providedIn: 'root',\n factory: () => createCngxTabOverflowDefaultDomAdapter,\n });\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Outcome reported by an `attempt` callback. `true` halts the loop\n * (success); `false` or `null` schedules another tick.\n *\n * @category common/tabs/overflow\n */\nexport type CngxDomAnchorRetryResult = true | false | null;\n\n/**\n * Configuration for {@link createDomAnchorRetry}.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxDomAnchorRetryOptions {\n /**\n * Per-attempt callback. `true` halts; `false`/`null` schedules\n * another attempt.\n */\n readonly attempt: () => CngxDomAnchorRetryResult;\n /**\n * Cap on unsuccessful attempts before {@link onGiveUp} fires.\n * The first synchronous call counts as attempt #1 - `5` permits\n * four scheduled retries after the initial.\n */\n readonly maxAttempts: number;\n /**\n * Schedules the next attempt (rAF / `afterNextRender` /\n * `setTimeout` / `queueMicrotask`). Returns a cancellation\n * closure - return a noop when the scheduler doesn't expose one.\n */\n readonly schedule: (cb: () => void) => () => void;\n /** Fires once after the `maxAttempts`-th unsuccessful attempt. */\n readonly onGiveUp?: () => void;\n}\n\n/**\n * Imperative handle returned by {@link createDomAnchorRetry}.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxDomAnchorRetryHandle {\n /** Begin (or restart) the retry loop. Resets the attempt counter. */\n start(): void;\n /** Stop the retry loop and cancel any pending scheduled attempt. */\n cancel(): void;\n}\n\n/**\n * Bounded retry loop for DOM-anchoring patterns - shared\n * attempt-counter + give-up + cancellation contract. Used by\n * `<cngx-tab-overflow>`'s rAF strip-attach loop and `[cngxMatTabs]`'s\n * `afterNextRender` header-anchor loop. Consumer-supplied scheduler\n * lets different timing primitives flow through one counter.\n *\n * ```ts\n * const retry = createDomAnchorRetry({\n * attempt: () => {\n * const root = host.closest('.strip-wrapper');\n * if (!root) return null;\n * observer.observe(root);\n * return true;\n * },\n * maxAttempts: 60,\n * schedule: (cb) => {\n * const h = requestAnimationFrame(cb);\n * return () => cancelAnimationFrame(h);\n * },\n * onGiveUp: () => console.warn('strip wrapper not found'),\n * });\n * afterNextRender(() => retry.start());\n * destroyRef.onDestroy(() => retry.cancel());\n * ```\n *\n * @category common/tabs/overflow\n */\nexport function createDomAnchorRetry(options: CngxDomAnchorRetryOptions): CngxDomAnchorRetryHandle {\n let attempts = 0;\n let cancelLast: (() => void) | null = null;\n let stopped = false;\n const tick = (): void => {\n if (stopped) {\n cancelLast = null;\n return;\n }\n cancelLast = null;\n let result: CngxDomAnchorRetryResult;\n try {\n result = options.attempt();\n } catch {\n // Swallow + terminal stop - covers the test-runner teardown\n // race where a global (e.g. IntersectionObserver) is reset\n // between schedule and fire, before consumer DestroyRef can\n // call cancel(). Production callback bugs still surface via\n // their own console.error before they throw here.\n stopped = true;\n return;\n }\n if (result === true) {\n stopped = true;\n return;\n }\n attempts++;\n if (attempts >= options.maxAttempts) {\n stopped = true;\n options.onGiveUp?.();\n return;\n }\n cancelLast = options.schedule(tick);\n };\n return {\n start: () => {\n stopped = false;\n attempts = 0;\n tick();\n },\n cancel: () => {\n stopped = true;\n cancelLast?.();\n cancelLast = null;\n },\n };\n}\n\n/**\n * Factory signature for {@link CNGX_DOM_ANCHOR_RETRY_FACTORY} -\n * matches {@link createDomAnchorRetry} for drop-in overrides.\n *\n * @category common/tabs/overflow\n */\nexport type CngxDomAnchorRetryFactory = (\n options: CngxDomAnchorRetryOptions,\n) => CngxDomAnchorRetryHandle;\n\n/**\n * DI token for the DOM-anchor retry policy. Default\n * {@link createDomAnchorRetry}. Two real consumers today -\n * `<cngx-tab-overflow>`'s rAF strip-attach loop and\n * `[cngxMatTabs]`'s `afterNextRender` header-anchor loop. Override\n * via `providers` / `viewProviders` for retry-with-backoff,\n * telemetry on give-up, etc. Symmetric to\n * `CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY`,\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`, and\n * `CNGX_TABS_COMMIT_HANDLER_FACTORY`.\n *\n * @category common/tabs/overflow\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/dom-anchor-retry.ts\n * @since 0.1.0\n */\nexport const CNGX_DOM_ANCHOR_RETRY_FACTORY = new InjectionToken<CngxDomAnchorRetryFactory>(\n 'CngxDomAnchorRetryFactory',\n {\n providedIn: 'root',\n factory: () => createDomAnchorRetry,\n },\n);\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabOverflowTrigger` template. Replaces the\n * default `i18n.moreTabsLabel(count)` text on the More button; the\n * surrounding `<button cngxPopoverTrigger>` shell (`aria-haspopup`,\n * `aria-expanded`, click handler, hidden binding) stays library-owned.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowTriggerContext {\n /** Convenience alias for `count` - usable as `let-count` shorthand. */\n readonly $implicit: number;\n /** Number of hidden tabs currently surfaced through the overflow popover. */\n readonly count: number;\n /** Hidden tabs, in the order they appear in `presenter.tabs()`. */\n readonly hiddenTabs: readonly CngxTabHandle[];\n}\n\n/**\n * Structural slot for the More-button label. 3-stage cascade:\n * per-instance directive >\n * `CNGX_TABS_CONFIG.templates.overflowTrigger` >\n * `i18n.moreTabsLabel(count)`.\n *\n * ```html\n * <cngx-tab-overflow>\n * <ng-template cngxTabOverflowTrigger let-count>\n * <my-icon name=\"dots\" /> +{{ count }}\n * </ng-template>\n * </cngx-tab-overflow>\n * ```\n *\n * @category common/tabs/overflow\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/tab-overflow-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabOverflowItem, CngxTab\n */\n@Directive({\n selector: 'ng-template[cngxTabOverflowTrigger]',\n exportAs: 'cngxTabOverflowTrigger',\n standalone: true,\n})\nexport class CngxTabOverflowTrigger {\n readonly templateRef = inject<TemplateRef<CngxTabOverflowTriggerContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabOverflowItem` template. Replaces the\n * default `tab.label() ?? tab.id` text inside the More popover; the\n * surrounding `<li role=\"menuitem\">` shell (`aria-disabled`, click\n * handler, `data-tab-id`) stays library-owned.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowItemContext {\n /** Convenience alias for `tab` - usable as `let-tab` shorthand. */\n readonly $implicit: CngxTabHandle;\n /** The hidden tab the row represents. */\n readonly tab: CngxTabHandle;\n /**\n * Commit-aware select. Routes through `panelHost.selectById(tab.id)`\n * and dismisses the popover; no-op when `disabled`.\n */\n readonly pick: () => void;\n /** Mirrors `tab.disabled()` - pre-resolved for consumer convenience. */\n readonly disabled: boolean;\n /** Row index inside `hiddenTabs()`, starting at 0. */\n readonly index: number;\n}\n\n/**\n * Structural slot for the per-row body inside the More popover.\n * 3-stage cascade: per-instance directive >\n * `CNGX_TABS_CONFIG.templates.overflowItem` > built-in label text.\n *\n * ```html\n * <cngx-tab-overflow>\n * <ng-template cngxTabOverflowItem let-tab let-disabled=\"disabled\">\n * <my-icon [name]=\"tab.id\" />\n * <span class=\"row-label\" [class.is-muted]=\"disabled\">\n * {{ tab.label() }}\n * </span>\n * </ng-template>\n * </cngx-tab-overflow>\n * ```\n *\n * @category common/tabs/overflow\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/tab-overflow-item.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabOverflowTrigger, CngxTab\n */\n@Directive({\n selector: 'ng-template[cngxTabOverflowItem]',\n exportAs: 'cngxTabOverflowItem',\n standalone: true,\n})\nexport class CngxTabOverflowItem {\n readonly templateRef = inject<TemplateRef<CngxTabOverflowItemContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabErrorBadge` template. Renders only when\n * the tab's `errorAggregator?.shouldShow()` is `true`; the visibility\n * gate stays library-owned. Sibling shape to `CngxStepBadgeContext`.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabErrorBadgeContext {\n /** The tab handle carrying id / label / disabled / aggregator signals. */\n readonly tab: CngxTabHandle;\n}\n\n/**\n * Structural slot for the error-badge template. 3-stage cascade:\n * per-instance directive >\n * `CNGX_TABS_CONFIG.templates.errorBadge` >\n * `CNGX_TABS_GLYPHS.errorBadge`.\n *\n * ```html\n * <cngx-tab-group>\n * <ng-template cngxTabErrorBadge let-tab=\"tab\">\n * <span class=\"my-badge-pill\">\n * {{ tab.errorAggregator()?.count() }}\n * </span>\n * </ng-template>\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-error-badge.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabRejectionIcon, CngxTabBusySpinner, CngxTab\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-busy-spinner-via-code-cngxtabbusyspinner-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-error-badge-via-code-cngxtaberrorbadge-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/rejection-decoration-via-code-cngxtabrejectionicon-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabErrorBadge]',\n exportAs: 'cngxTabErrorBadge',\n standalone: true,\n})\nexport class CngxTabErrorBadge {\n readonly templateRef = inject<TemplateRef<CngxTabErrorBadgeContext>>(\n TemplateRef,\n );\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context for the `*cngxTabRejectionIcon` template. Renders only on\n * the tab matching `presenter.lastFailedIndex()`; the visibility\n * gate stays library-owned. `originLabel` is the safe-harbour tab,\n * derived from `presenter.originIndexDuringCommit()` - `undefined`\n * for the synchronous-rejection edge case. Sibling shape to\n * `CngxStepRejectionContext`.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabRejectionIconContext {\n /** Flat-index of the rejected tab (`presenter.lastFailedIndex()`). */\n readonly failedIndex: number;\n /** Resolved label of the safe-harbour tab, when derivable. */\n readonly originLabel: string | undefined;\n}\n\n/**\n * Structural slot for the rejection-decoration template. 3-stage\n * cascade: per-instance directive >\n * `CNGX_TABS_CONFIG.templates.rejectionIcon` >\n * `CNGX_TABS_GLYPHS.rejectionIcon`.\n *\n * ```html\n * <cngx-tab-group>\n * <ng-template\n * cngxTabRejectionIcon\n * let-failedIndex=\"failedIndex\"\n * let-originLabel=\"originLabel\"\n * >\n * <my-icon name=\"rollback\" />\n * @if (originLabel) {\n * <span class=\"cngx-sr-only\">Rolled back to {{ originLabel }}</span>\n * }\n * </ng-template>\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-rejection-icon.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabErrorBadge, CngxTabBusySpinner, CngxTab\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-busy-spinner-via-code-cngxtabbusyspinner-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-error-badge-via-code-cngxtaberrorbadge-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/rejection-decoration-via-code-cngxtabrejectionicon-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabRejectionIcon]',\n exportAs: 'cngxTabRejectionIcon',\n standalone: true,\n})\nexport class CngxTabRejectionIcon {\n readonly templateRef = inject<TemplateRef<CngxTabRejectionIconContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabBusySpinner` template. Renders only on\n * the in-flight commit target (matches `presenter.intendedIndex()`\n * with `commitState.status() === 'pending'`); the visibility gate\n * stays library-owned. `intendedIndex` is exposed so positional\n * variants (progress bars, step counters) read the same source.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabBusySpinnerContext {\n /** The tab handle carrying id / label / disabled / aggregator signals. */\n readonly tab: CngxTabHandle;\n /** The flat-index of the in-flight commit target. */\n readonly intendedIndex: number;\n}\n\n/**\n * Structural slot for the busy-spinner template. 3-stage cascade:\n * per-instance directive >\n * `CNGX_TABS_CONFIG.templates.busySpinner` > built-in pulse span.\n *\n * ```html\n * <cngx-tab-group>\n * <ng-template cngxTabBusySpinner>\n * <my-spinner size=\"sm\" />\n * </ng-template>\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-busy-spinner.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabErrorBadge, CngxTabRejectionIcon, CngxTab\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-busy-spinner-via-code-cngxtabbusyspinner-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-error-badge-via-code-cngxtaberrorbadge-code</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/rejection-decoration-via-code-cngxtabrejectionicon-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabBusySpinner]',\n exportAs: 'cngxTabBusySpinner',\n standalone: true,\n})\nexport class CngxTabBusySpinner {\n readonly templateRef = inject<TemplateRef<CngxTabBusySpinnerContext>>(\n TemplateRef,\n );\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabIcon` template. Rendered once per tab in the\n * header, ahead of the label. Carries the tab handle plus the two\n * per-tab signals a consumer icon usually keys off - whether the tab is\n * the active one and its positional index. Richer than\n * {@link CngxTabErrorBadgeContext} (which only needs `tab`) because an\n * icon commonly swaps glyph on the active tab.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabIconContext {\n /** The tab handle carrying id / label / disabled / aggregator signals. */\n readonly tab: CngxTabHandle;\n /** Whether this tab is the currently active one. */\n readonly active: boolean;\n /** Zero-based position of the tab in the strip. */\n readonly index: number;\n}\n\n/**\n * Structural slot for the tab-icon template. One group-level slot with\n * per-tab context (stepper-slot parity), not a per-`CngxTab` input.\n * 3-stage cascade: per-instance directive >\n * `CNGX_TABS_CONFIG.templates.icon` > none (no icon rendered).\n *\n * ```html\n * <cngx-tab-group iconLayout=\"start\">\n * <ng-template cngxTabIcon let-tab=\"tab\" let-active=\"active\">\n * <cngx-icon [name]=\"active ? 'folder-open' : 'folder'\" />\n * </ng-template>\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-icon.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabErrorBadge, CngxTab, CngxTabGroup\n */\n@Directive({\n selector: 'ng-template[cngxTabIcon]',\n exportAs: 'cngxTabIcon',\n standalone: true,\n})\nexport class CngxTabIcon {\n readonly templateRef = inject<TemplateRef<CngxTabIconContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabCloseIcon` template. Rendered inside each\n * closable tab's close button (the button itself owns the\n * `aria-label`); the template paints only the glyph, so it carries the\n * tab handle in case the visual varies per tab.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabCloseIconContext {\n /** The tab handle whose close button this icon paints. */\n readonly tab: CngxTabHandle;\n}\n\n/**\n * Structural slot for a tab's close-button glyph. 3-stage cascade:\n * per-instance directive > `CNGX_TABS_CONFIG.templates.closeIcon` >\n * `CNGX_TABS_GLYPHS.closeIcon`.\n *\n * ```html\n * <cngx-tab-group closable (tabClose)=\"remove($event.id)\">\n * <ng-template cngxTabCloseIcon><cngx-icon name=\"close\" /></ng-template>\n * ...\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-close-icon.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabAddIcon, CngxTabGroup\n */\n@Directive({\n selector: 'ng-template[cngxTabCloseIcon]',\n exportAs: 'cngxTabCloseIcon',\n standalone: true,\n})\nexport class CngxTabCloseIcon {\n readonly templateRef = inject<TemplateRef<CngxTabCloseIconContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot for the add-tab button glyph. 3-stage cascade:\n * per-instance directive > `CNGX_TABS_CONFIG.templates.addIcon` >\n * `CNGX_TABS_GLYPHS.addIcon`. The button owns its `aria-label`; the\n * template paints only the glyph, so its context is `void`.\n *\n * ```html\n * <cngx-tab-group addable (tabAdd)=\"add()\">\n * <ng-template cngxTabAddIcon><cngx-icon name=\"plus\" /></ng-template>\n * ...\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-add-icon.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabCloseIcon, CngxTabGroup\n */\n@Directive({\n selector: 'ng-template[cngxTabAddIcon]',\n exportAs: 'cngxTabAddIcon',\n standalone: true,\n})\nexport class CngxTabAddIcon {\n readonly templateRef = inject<TemplateRef<void>>(TemplateRef);\n}\n","import {\n afterNextRender,\n computed,\n type Injector,\n type Signal,\n} from '@angular/core';\n\nimport type { CngxTabsI18n } from '../i18n/tabs-i18n';\nimport type { CngxTabCloseIconContext } from '../slots/tab-close-icon.directive';\nimport type { CngxTabsConfig } from '../tabs-config';\nimport type { CngxTabGroupHost, CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Inputs to {@link createTabDismissals}. The organism owns the\n * `[closable]` / `[addable]` inputs and the DOM handle; the factory runs\n * the cascade + the close/add interaction so the organism class stays\n * under the LOC guard. Sibling shape to `createTabGroupAnnouncements`.\n *\n * @category common/tabs\n */\nexport interface CngxTabDismissalsOptions {\n readonly host: CngxTabGroupHost;\n readonly config: CngxTabsConfig;\n readonly i18n: CngxTabsI18n;\n readonly closable: Signal<boolean | undefined>;\n readonly addable: Signal<boolean | undefined>;\n readonly hostElement: HTMLElement;\n readonly injector: Injector;\n}\n\n/**\n * Resolved dismissable/addable surface for `<cngx-tab-group>`. The\n * organism holds this as one field and the template reads it.\n *\n * @category common/tabs\n */\nexport interface CngxTabDismissals {\n /** Effective group-level close affordance (`input ?? config ?? false`). */\n readonly resolvedClosable: Signal<boolean>;\n /** Effective group-level add affordance (`input ?? config ?? false`). */\n readonly resolvedAddable: Signal<boolean>;\n /** Per-tab closable: per-tab override > group resolution. */\n isTabClosable(tab: CngxTabHandle): boolean;\n /** i18n accessible name for a tab's close button. */\n closeButtonLabel(tab: CngxTabHandle): string;\n /** Stable `*cngxTabCloseIcon` context (`{ tab }`) per tab. */\n closeIconContextFor(tab: CngxTabHandle): CngxTabCloseIconContext;\n /** Close a tab and restore focus to the new active tab / add button. */\n handleClose(tab: CngxTabHandle, event?: Event): void;\n /** Delete on a focused closable tab requests its close (APG). */\n handleTabKeydown(tab: CngxTabHandle, event: KeyboardEvent): void;\n /** Request a new tab via the add button. */\n handleAdd(): void;\n}\n\n/**\n * Level-2 helper resolving the dismissable/addable affordances for\n * `<cngx-tab-group>`. Keeps the close/add cascade + interaction off the\n * organism class (LOC guard). Pillar 1: each cascade is one `computed()`.\n * The actual tab removal is the consumer's (Ableitung statt Verwaltung) -\n * `handleClose` only routes through the presenter's `requestClose`, which\n * moves the active index, and restores focus once the consumer's removal\n * has rendered.\n *\n * @category common/tabs\n */\nexport function createTabDismissals(\n opts: CngxTabDismissalsOptions,\n): CngxTabDismissals {\n const resolvedClosable = computed<boolean>(\n () => opts.closable() ?? opts.config.closable ?? false,\n );\n const resolvedAddable = computed<boolean>(\n () => opts.addable() ?? opts.config.addable ?? false,\n );\n\n const closeIconContextCache = new WeakMap<CngxTabHandle, CngxTabCloseIconContext>();\n\n const isTabClosable = (tab: CngxTabHandle): boolean =>\n tab.closable() ?? resolvedClosable();\n\n const handleClose = (tab: CngxTabHandle, event?: Event): void => {\n event?.stopPropagation();\n if (!isTabClosable(tab)) {\n return;\n }\n opts.host.requestClose(tab.id);\n // Restore focus once the consumer's removal has rendered: the new\n // active tab, then the add button, and finally the group element\n // itself (made programmatically focusable) so focus never falls to\n // `<body>` when the strip empties with no add button (APG).\n afterNextRender(\n () => {\n const active = opts.hostElement.querySelector<HTMLElement>(\n '.cngx-tabs__tab[aria-selected=\"true\"]',\n );\n const add = opts.hostElement.querySelector<HTMLElement>('.cngx-tabs__add');\n const target = active ?? add;\n if (target) {\n target.focus();\n return;\n }\n opts.hostElement.tabIndex = -1;\n opts.hostElement.focus();\n },\n { injector: opts.injector },\n );\n };\n\n return {\n resolvedClosable,\n resolvedAddable,\n isTabClosable,\n closeButtonLabel: (tab) => opts.i18n.closeTab(tab.label() ?? ''),\n closeIconContextFor: (tab) => {\n let ctx = closeIconContextCache.get(tab);\n if (!ctx) {\n ctx = { tab };\n closeIconContextCache.set(tab, ctx);\n }\n return ctx;\n },\n handleClose,\n handleTabKeydown: (tab, event) => {\n if (event.key === 'Delete' && isTabClosable(tab)) {\n event.preventDefault();\n handleClose(tab);\n }\n },\n handleAdd: () => opts.host.requestAdd(),\n };\n}\n","import type { CngxTabGroupHost, CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Inputs to {@link createTabKeyboardNav}. The organism owns the DOM\n * handle and the presenter contract; the factory runs the APG tablist\n * keyboard model so the organism class stays under the LOC guard.\n * Sibling shape to `createTabDismissals`.\n *\n * @category common/tabs\n */\nexport interface CngxTabKeyboardNavOptions {\n readonly host: CngxTabGroupHost;\n readonly hostElement: HTMLElement;\n}\n\n/**\n * Resolved keyboard surface for `<cngx-tab-group>`'s tablist. The\n * organism holds this as one field; the template reads `tabTabindex`\n * for the roving stop and routes the tab buttons' `(keydown)` through\n * `handleKeydown`.\n *\n * @category common/tabs\n */\nexport interface CngxTabKeyboardNav {\n /**\n * Roving `tabindex` for a tab button: `0` for the selected tab, `-1`\n * for every other. Derived from `host.activeId()` (Pillar 1: a single\n * source, never a second index to keep in sync) so the active tab is\n * the group's lone tab stop and `Tab` always lands on it.\n */\n tabTabindex(tab: CngxTabHandle): 0 | -1;\n /**\n * APG tablist navigation: arrow keys (axis from orientation), Home,\n * and End move between tabs with disabled-skip + loop, activate the\n * target through `host.select()` (automatic activation), and move DOM\n * focus to it. Returns silently for any other key so the caller can\n * chain further handlers (e.g. Delete-to-close).\n */\n handleKeydown(event: KeyboardEvent): void;\n}\n\n/**\n * Level-2 helper implementing the WAI-ARIA APG tabs keyboard model for\n * `<cngx-tab-group>` with **automatic activation**: an arrow press moves\n * focus AND activates the target tab in one step, so focus and selection\n * never diverge. Keeps the keyboard logic off the organism class (LOC\n * guard) and out of a competing roving-tabindex state machine.\n *\n * Pillar 1 (Ableitung statt Verwaltung): the tab stop is derived from the\n * presenter's `activeId`, not managed as a second index. Pillar 2\n * (Kommunikation): activation routes through `host.select()`, which owns\n * disabled-skip, loop, commit gating, and the live-region announcement -\n * the keyboard layer adds only focus movement (a DOM concern the\n * presenter, living in `@cngx/common`, must not own).\n *\n * Navigation always originates from the active tab: under automatic\n * activation the focused tab is always the active one, so the clamped\n * active index is the correct origin.\n *\n * @category common/tabs\n */\nexport function createTabKeyboardNav(\n opts: CngxTabKeyboardNavOptions,\n): CngxTabKeyboardNav {\n const clampedActive = (): number => {\n const len = opts.host.tabs().length;\n if (len === 0) {\n return 0;\n }\n return Math.max(0, Math.min(opts.host.activeIndex(), len - 1));\n };\n\n // Next enabled index in `direction`, honouring `loop`. Mirrors the\n // presenter's `selectNext`/`selectPrevious` geometry but returns the\n // resolved index so the caller can both activate and focus it.\n const step = (direction: 1 | -1): number | null => {\n const tabs = opts.host.tabs();\n const len = tabs.length;\n if (len === 0) {\n return null;\n }\n const loop = opts.host.loop();\n let idx = clampedActive() + direction;\n for (let i = 0; i < len; i++) {\n if (loop) {\n idx = ((idx % len) + len) % len;\n } else if (idx < 0 || idx >= len) {\n return null;\n }\n if (!tabs[idx].disabled()) {\n return idx;\n }\n idx += direction;\n }\n return null;\n };\n\n // First (direction 1) or last (direction -1) enabled tab, for Home/End.\n const edge = (direction: 1 | -1): number | null => {\n const tabs = opts.host.tabs();\n const len = tabs.length;\n if (direction === 1) {\n for (let i = 0; i < len; i++) {\n if (!tabs[i].disabled()) {\n return i;\n }\n }\n } else {\n for (let i = len - 1; i >= 0; i--) {\n if (!tabs[i].disabled()) {\n return i;\n }\n }\n }\n return null;\n };\n\n // Focus the tab button for the tab at `index`, keyed off the stable\n // tab id (the rendered `data-tab-id`) rather than a positional\n // `.cngx-tabs__tab[index]` lookup - so a skin that reorders or wraps\n // the tab buttons can't misdirect keyboard focus. `[role=\"tab\"]` is\n // the APG contract every skin must honour, so it survives a class\n // rename too. The button already exists regardless of pending CD, so\n // focus is immediate and never waits on the activation's render.\n const focusTabAt = (index: number): void => {\n const id = opts.host.tabs()[index]?.id;\n if (id == null) {\n return;\n }\n const buttons = Array.from(\n opts.hostElement.querySelectorAll<HTMLElement>('[role=\"tab\"]'),\n );\n buttons.find((button) => button.getAttribute('data-tab-id') === id)?.focus();\n };\n\n return {\n tabTabindex: (tab) => (tab.id === opts.host.activeId() ? 0 : -1),\n handleKeydown: (event) => {\n const horizontal = opts.host.orientation() === 'horizontal';\n let target: number | null;\n switch (event.key) {\n case 'ArrowRight':\n target = horizontal ? step(1) : null;\n break;\n case 'ArrowLeft':\n target = horizontal ? step(-1) : null;\n break;\n case 'ArrowDown':\n target = horizontal ? null : step(1);\n break;\n case 'ArrowUp':\n target = horizontal ? null : step(-1);\n break;\n case 'Home':\n target = edge(1);\n break;\n case 'End':\n target = edge(-1);\n break;\n default:\n return;\n }\n if (target === null) {\n return;\n }\n event.preventDefault();\n // Automatic activation: select first (content + aria-selected +\n // announcement follow), then move focus to the same tab button.\n opts.host.select(target);\n focusTabAt(target);\n },\n };\n}\n","import { computed, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxTabsConfig } from '../tabs-config';\nimport type {\n CngxTabAddIcon,\n} from './tab-add-icon.directive';\nimport type {\n CngxTabBusySpinner,\n CngxTabBusySpinnerContext,\n} from './tab-busy-spinner.directive';\nimport type {\n CngxTabCloseIcon,\n CngxTabCloseIconContext,\n} from './tab-close-icon.directive';\nimport type {\n CngxTabErrorBadge,\n CngxTabErrorBadgeContext,\n} from './tab-error-badge.directive';\nimport type { CngxTabIcon, CngxTabIconContext } from './tab-icon.directive';\nimport type {\n CngxTabRejectionIcon,\n CngxTabRejectionIconContext,\n} from './tab-rejection-icon.directive';\n\n/**\n * Inputs to {@link createTabGroupTemplateBindings}. The organism owns\n * the `contentChild()` queries (NG8110 — must run in component\n * injection context) and the resolved {@link CngxTabsConfig}; the\n * factory runs the 3-stage cascade per slot key. Sibling shape to\n * `createStepperTemplateBindings`.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabGroupTemplateBindingsOptions {\n readonly errorBadgeSlot: Signal<CngxTabErrorBadge | undefined>;\n readonly rejectionIconSlot: Signal<CngxTabRejectionIcon | undefined>;\n readonly busySpinnerSlot: Signal<CngxTabBusySpinner | undefined>;\n readonly iconSlot: Signal<CngxTabIcon | undefined>;\n /** Per-instance `*cngxTabCloseIcon` slot. Optional - close is opt-in. */\n readonly closeIconSlot?: Signal<CngxTabCloseIcon | undefined>;\n /** Per-instance `*cngxTabAddIcon` slot. Optional - add is opt-in. */\n readonly addIconSlot?: Signal<CngxTabAddIcon | undefined>;\n readonly config: CngxTabsConfig;\n}\n\n/**\n * Output of {@link createTabGroupTemplateBindings}. One resolved\n * `Signal<TemplateRef | null>` per slot; `null` means the organism\n * renders its built-in default.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabGroupTemplateBindings {\n readonly errorBadge: Signal<TemplateRef<CngxTabErrorBadgeContext> | null>;\n readonly rejectionIcon: Signal<\n TemplateRef<CngxTabRejectionIconContext> | null\n >;\n readonly busySpinner: Signal<TemplateRef<CngxTabBusySpinnerContext> | null>;\n readonly icon: Signal<TemplateRef<CngxTabIconContext> | null>;\n readonly closeIcon: Signal<TemplateRef<CngxTabCloseIconContext> | null>;\n readonly addIcon: Signal<TemplateRef<void> | null>;\n}\n\n/**\n * Wires the 3-stage template cascade for the `<cngx-tab-group>` skin\n * slots (errorBadge / rejectionIcon / busySpinner / icon / closeIcon /\n * addIcon):\n * per-instance directive >\n * `CNGX_TABS_CONFIG.templates.<key>` >\n * `null`.\n *\n * `null` means the organism renders its built-in default - a default\n * span for the state decorations, the `CNGX_TABS_GLYPHS` glyph for\n * `closeIcon` / `addIcon`, and nothing for `icon`.\n *\n * Pure — no DI, no side effects. Safe in field-init. Sibling to\n * `createStepperTemplateBindings` and `createTabOverflowTemplateBindings`.\n *\n * Single-consumer today: `[cngxMatTabs]` does not consume this —\n * Material owns the rendered tab-button chrome via its own MDC\n * template, leaving no DOM seam. See `tabs-accepted-debt §9`.\n *\n * @category common/tabs/slots\n */\nexport function createTabGroupTemplateBindings(\n opts: CngxTabGroupTemplateBindingsOptions,\n): CngxTabGroupTemplateBindings {\n return {\n errorBadge: computed<TemplateRef<CngxTabErrorBadgeContext> | null>(\n () =>\n opts.errorBadgeSlot()?.templateRef ??\n opts.config.templates?.errorBadge ??\n null,\n ),\n rejectionIcon: computed<TemplateRef<CngxTabRejectionIconContext> | null>(\n () =>\n opts.rejectionIconSlot()?.templateRef ??\n opts.config.templates?.rejectionIcon ??\n null,\n ),\n busySpinner: computed<TemplateRef<CngxTabBusySpinnerContext> | null>(\n () =>\n opts.busySpinnerSlot()?.templateRef ??\n opts.config.templates?.busySpinner ??\n null,\n ),\n icon: computed<TemplateRef<CngxTabIconContext> | null>(\n () => opts.iconSlot()?.templateRef ?? opts.config.templates?.icon ?? null,\n ),\n closeIcon: computed<TemplateRef<CngxTabCloseIconContext> | null>(\n () =>\n opts.closeIconSlot?.()?.templateRef ??\n opts.config.templates?.closeIcon ??\n null,\n ),\n addIcon: computed<TemplateRef<void> | null>(\n () => opts.addIconSlot?.()?.templateRef ?? opts.config.templates?.addIcon ?? null,\n ),\n };\n}\n","// Single-consumer factory — staged under family-uniformity\n// (`createTabGroupTemplateBindings` and `CngxMatTabAggregatorContent`).\n// Re-eval on second consumer or sibling debt closure.\nimport { computed, linkedSignal, type Signal } from '@angular/core';\n\nimport type { CngxTabsConfig } from '../tabs-config';\nimport type { CngxTabsI18n } from '../i18n/tabs-i18n';\nimport type { CngxTabGroupHost, CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Inputs the announcements bundle reads from the host organism.\n * Passing presenter / i18n / config in (instead of re-injecting)\n * keeps the factory pure — one call returns the bundle, no\n * injection context required.\n *\n * @category common/tabs/announcements\n */\nexport interface CngxTabGroupAnnouncementsOptions {\n readonly presenter: CngxTabGroupHost;\n readonly i18n: CngxTabsI18n;\n readonly config: CngxTabsConfig;\n /** Per-instance `aria-label` Input on the organism. */\n readonly ariaLabel: Signal<string | undefined>;\n /** Per-instance `aria-labelledby` Input on the organism. */\n readonly ariaLabelledBy: Signal<string | undefined>;\n}\n\n/**\n * Resolved bundle returned by {@link createTabGroupAnnouncements}.\n * Host bindings and template outlets read these directly. Owns one\n * internal `linkedSignal` slot (prior-active-index tracker driving\n * the success-arm direction prefix); consumers never touch it.\n *\n * @category common/tabs/announcements\n */\nexport interface CngxTabGroupAnnouncements {\n /**\n * Tablist `aria-roledescription`. Cascades through\n * `CngxTabsFallbackLabels.tabRoleDescription` → `'tab list'`.\n * Distinct from `i18n.tabsLabel` (which feeds `aria-label`) so\n * AT does not read the same word twice.\n */\n readonly tabsRoleDescription: Signal<string>;\n\n /**\n * Tab-panel `aria-roledescription`. Cascades through\n * `CngxTabsFallbackLabels.tabPanelRoleDescription` → `'tab panel'`.\n */\n readonly tabPanelRoleDescription: Signal<string>;\n\n /**\n * Wrapper `aria-label`. Resolution: per-instance Input →\n * `ariaLabels.tabsRegion` → `i18n.tabsLabel`. Returns `null` when\n * `aria-labelledby` is bound (mutually exclusive per WAI-ARIA).\n */\n readonly resolvedAriaLabel: Signal<string | null>;\n\n /**\n * Polite live-region content — declarative, never an imperative\n * `announce()`. Empty between transitions so the region stays\n * quiet on no-op ticks.\n *\n * Error arm: `commitRolledBackTo(originLabel)` when origin\n * resolves; otherwise `commitFailedRetry`.\n *\n * Success arm: `${previousTab|nextTab}: selectedTab(...)` when\n * the index moved; bare `selectedTab(...)` when it didn't (initial\n * mount, or commit-success that lands on the same tab).\n */\n readonly liveAnnouncement: Signal<string>;\n\n /**\n * SR descriptor phrase for a tab's `cngx-sr-only` span. Gated on the\n * folded `tab.hasError()` so a direct `[error]` tab announces without\n * an aggregator. Resolution: `aggregator.announcement()` →\n * `tab.errorMessage()` (the direct-channel message) →\n * `i18n.tabHasErrors(errorCount)`. Empty string when the tab has no\n * error. The span itself is always rendered (cngx ARIA-by-value\n * rule); this returns its content.\n */\n statusPhrase(tab: CngxTabHandle): string;\n\n /**\n * Verbose tab-button `aria-label` — `selectedTab(label, position,\n * count)` so AT hears \"Tab 2 of 5: Settings\" instead of inferring\n * position from tablist enumeration. The visual span keeps the\n * bare label.\n */\n tabAriaLabel(tab: CngxTabHandle, position: number): string;\n}\n\n/**\n * Pure factory bundling the `<cngx-tab-group>` AT-announcement +\n * descriptor surfaces. Owns one internal `linkedSignal`\n * (prior-active-index, drives the success-arm direction prefix) —\n * lazy by `linkedSignal` semantics, so the organism reads\n * `liveAnnouncement` once at construction to seed it.\n *\n * @category common/tabs/announcements\n */\nexport function createTabGroupAnnouncements(\n options: CngxTabGroupAnnouncementsOptions,\n): CngxTabGroupAnnouncements {\n const { presenter, i18n, config, ariaLabel, ariaLabelledBy } = options;\n\n const tabsRoleDescription = computed<string>(\n () => config.fallbackLabels?.tabRoleDescription ?? 'tab list',\n );\n\n const tabPanelRoleDescription = computed<string>(\n () => config.fallbackLabels?.tabPanelRoleDescription ?? 'tab panel',\n );\n\n const resolvedAriaLabel = computed<string | null>(() => {\n if (ariaLabelledBy()) {\n return null;\n }\n return ariaLabel() ?? config.ariaLabels?.tabsRegion ?? i18n.tabsLabel;\n });\n\n // `prev?.source` = source value before the most recent change —\n // prior activeIndex without an `effect`-driven slot (Pillar 1).\n // Coalesce to current on first emission.\n const priorActiveIndex = linkedSignal<number, number>({\n source: () => presenter.activeIndex(),\n computation: (curr, prev) => prev?.source ?? curr,\n equal: Object.is,\n });\n\n const liveAnnouncement = computed<string>(() => {\n const current = presenter.commitTransition.current();\n if (current === 'pending') {\n return i18n.commitInFlight;\n }\n if (current === 'error') {\n // No `previous === 'pending'` guard — sync rejections collapse\n // pending → error in one flush, so the tracker captures\n // `previous = 'idle'` and an unguarded read keeps the\n // announcement reachable for `commitAction = () => false`.\n const failedIdx = presenter.lastFailedIndex();\n const originIdx = presenter.originIndexDuringCommit();\n if (failedIdx !== undefined && originIdx !== undefined) {\n const originLabel = presenter.tabs()[originIdx]?.label();\n if (originLabel) {\n return i18n.commitRolledBackTo(originLabel);\n }\n }\n return i18n.commitFailedRetry;\n }\n if (current === 'success') {\n const tabs = presenter.tabs();\n const idx = presenter.activeIndex();\n const tab = tabs[idx];\n if (!tab) {\n return '';\n }\n const label = tab.label() ?? '';\n const positionPhrase = i18n.selectedTab(label, idx + 1, tabs.length);\n const prevIdx = priorActiveIndex();\n if (idx > prevIdx) {\n return `${i18n.nextTab}: ${positionPhrase}`;\n }\n if (idx < prevIdx) {\n return `${i18n.previousTab}: ${positionPhrase}`;\n }\n return positionPhrase;\n }\n return '';\n });\n\n function statusPhrase(tab: CngxTabHandle): string {\n if (!tab.hasError()) {\n return '';\n }\n const aggregator = tab.errorAggregator();\n const announcement = aggregator?.announcement();\n if (announcement) {\n return announcement;\n }\n const directMessage = tab.errorMessage();\n if (directMessage) {\n return directMessage;\n }\n return i18n.tabHasErrors(aggregator?.errorCount() ?? 1);\n }\n\n function tabAriaLabel(tab: CngxTabHandle, position: number): string {\n const tabs = presenter.tabs();\n const label = tab.label() ?? '';\n const detail = tab.subLabel();\n const labelPart = detail ? i18n.tabLabelWithDetail(label, detail) : label;\n return i18n.selectedTab(labelPart, position, tabs.length);\n }\n\n // Eager seed — `linkedSignal` is lazy and the success arm doesn't\n // touch the tracker at construction (commitTransition is `idle`),\n // so without this read `prev?.source` is undefined on the first\n // nav and the direction prefix is silently lost.\n priorActiveIndex();\n\n return {\n tabsRoleDescription,\n tabPanelRoleDescription,\n resolvedAriaLabel,\n liveAnnouncement,\n statusPhrase,\n tabAriaLabel,\n };\n}\n","/**\n * Default glyph fallbacks for `<cngx-tab-group>` skin slots. Read by\n * the organism when neither a per-instance slot directive nor\n * `CNGX_TABS_CONFIG.templates.<key>` is bound. Sibling to\n * `CNGX_SELECT_GLYPHS` and `CNGX_STEPPER_GLYPHS`. Exported because\n * Sheriff forbids deep-relative imports across library boundaries;\n * `@internal` enforces consumer intent. Consumers customise via slot\n * directives or `withTab*Template` config features.\n *\n * @internal\n * @category common/tabs\n */\nexport const CNGX_TABS_GLYPHS = {\n /** Default visual for `*cngxTabErrorBadge` when no override is bound. */\n errorBadge: '!',\n /** Default visual for `*cngxTabRejectionIcon` when no override is bound. */\n rejectionIcon: '!',\n /** Default visual for a tab's close button when no override is bound. */\n closeIcon: '×',\n /** Default visual for the add-tab button when no override is bound. */\n addIcon: '+',\n} as const;\n","import {\n effect,\n InjectionToken,\n untracked,\n type Signal,\n computed,\n type TemplateRef,\n} from '@angular/core';\n\nimport type { ActiveDescendantItem, CngxActiveDescendant } from '@cngx/common/a11y';\nimport type { CngxPopover } from '@cngx/common/popover';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\nimport type { CngxTabsConfig } from '../tabs-config';\nimport type {\n CngxTabOverflowItem,\n CngxTabOverflowItemContext,\n} from './tab-overflow-item.directive';\nimport type {\n CngxTabOverflowTrigger,\n CngxTabOverflowTriggerContext,\n} from './tab-overflow-trigger.directive';\n\n/**\n * DOM `id` for a hidden-tab option row in the overflow listbox.\n * Stable across CD passes so `aria-activedescendant` resolves to\n * the same `<li>`. `-overflow-option` suffix avoids collision with\n * the strip-button (`-header`) and per-tab descriptor (`-desc`).\n *\n * @category common/tabs/overflow\n */\nexport function tabOverflowOptionId(tab: CngxTabHandle): string {\n return `${tab.id}-overflow-option`;\n}\n\n/**\n * Inputs to {@link createTabOverflowTemplateBindings}. The molecule\n * runs the `contentChild()` queries (injection-context-only) and\n * supplies the reactive sources; the factory owns cascade\n * resolution and per-context builders.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowTemplateBindingsOptions {\n /** `contentChild(CngxTabOverflowTrigger)` from the molecule. */\n readonly triggerSlot: Signal<CngxTabOverflowTrigger | undefined>;\n /** `contentChild(CngxTabOverflowItem)` from the molecule. */\n readonly itemSlot: Signal<CngxTabOverflowItem | undefined>;\n /** Resolved {@link CngxTabsConfig} (the middle cascade tier). */\n readonly config: CngxTabsConfig;\n /** Live count of hidden tabs (drives `triggerContext.count`). */\n readonly hiddenCount: Signal<number>;\n /** Live hidden-tab list (drives `triggerContext.hiddenTabs`). */\n readonly hiddenTabs: Signal<readonly CngxTabHandle[]>;\n /** Commit-aware select callback - invoked from `itemContext.pick`. */\n readonly pickTab: (tab: CngxTabHandle) => void;\n}\n\n/**\n * Output of {@link createTabOverflowTemplateBindings}. Carries the two\n * resolved templates plus a stable trigger-context signal and an\n * imperative item-context builder.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowTemplateBindings {\n readonly triggerTemplate: Signal<TemplateRef<CngxTabOverflowTriggerContext> | null>;\n readonly itemTemplate: Signal<TemplateRef<CngxTabOverflowItemContext> | null>;\n readonly triggerContext: Signal<CngxTabOverflowTriggerContext>;\n readonly buildItemContext: (tab: CngxTabHandle, index: number) => CngxTabOverflowItemContext;\n /**\n * `ActiveDescendantItem[]` projection of `hiddenTabs()` for\n * `CngxActiveDescendant.items`. Each entry's `id` matches the\n * row's `<li>` (see {@link tabOverflowOptionId}); `value` carries\n * the tab handle so AD's `(activated)` payload casts back without\n * a registry lookup. Structural equal guards against no-op IO\n * cascades. Mutable array shape because\n * `CngxActiveDescendant.items` declares the input that way; the\n * array is rebuilt each computed run so callers can't mutate the\n * live source.\n */\n readonly adItems: Signal<ActiveDescendantItem[]>;\n}\n\n/**\n * Structural equal - same `count` + same `hiddenTabs` reference.\n * The upstream `hiddenTabs` signal already uses `tabIdListEqual`,\n * so this guard stops `ngTemplateOutlet` rebinding on shape-stable\n * IO emissions.\n *\n * @internal\n */\nfunction triggerContextEqual(\n a: CngxTabOverflowTriggerContext,\n b: CngxTabOverflowTriggerContext,\n): boolean {\n return a.count === b.count && a.hiddenTabs === b.hiddenTabs;\n}\n\n/**\n * Structural equal - same length + per-index `id` and `disabled`.\n * Without this, every IO emission yields fresh\n * `ActiveDescendantItem[]` references and AD's `resolvedItems`\n * cascade fires for an unchanged visible-tab set.\n *\n * @internal\n */\nfunction adItemsEqual(a: ActiveDescendantItem[], b: ActiveDescendantItem[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i].id !== b[i].id || a[i].disabled !== b[i].disabled) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Wires the 3-stage template cascade for the overflow molecule's\n * two visible regions: per-instance directive >\n * `CNGX_TABS_CONFIG.templates.overflow*` > built-in markup\n * (template-outlet returns `null`).\n *\n * Pure - no DI, no side effects, no destroy hooks. Safe to call\n * from a component's field-init block. Mirrors the select-family\n * `createTemplateRegistry` pattern.\n *\n * @category common/tabs/overflow\n */\nexport function createTabOverflowTemplateBindings(\n opts: CngxTabOverflowTemplateBindingsOptions,\n): CngxTabOverflowTemplateBindings {\n const triggerTemplate = computed<TemplateRef<CngxTabOverflowTriggerContext> | null>(\n () => opts.triggerSlot()?.templateRef ?? opts.config.templates?.overflowTrigger ?? null,\n );\n const itemTemplate = computed<TemplateRef<CngxTabOverflowItemContext> | null>(\n () => opts.itemSlot()?.templateRef ?? opts.config.templates?.overflowItem ?? null,\n );\n const triggerContext = computed<CngxTabOverflowTriggerContext>(\n () => {\n const count = opts.hiddenCount();\n const hiddenTabs = opts.hiddenTabs();\n return { $implicit: count, count, hiddenTabs };\n },\n { equal: triggerContextEqual },\n );\n // Per-row context cache - stable context + closure-captured `pick`\n // per `tab` so `ngTemplateOutlet` doesn't re-bind the embedded view\n // unless `index` or `disabled` actually changed. WeakMap so\n // detached handles GC. Mirrors `CngxTreeSelectPanel.nodeContext`.\n interface CachedRow {\n readonly context: CngxTabOverflowItemContext;\n readonly disabled: boolean;\n readonly index: number;\n }\n const itemContextCache = new WeakMap<CngxTabHandle, CachedRow>();\n const buildItemContext = (tab: CngxTabHandle, index: number): CngxTabOverflowItemContext => {\n const disabled = tab.disabled();\n const cached = itemContextCache.get(tab);\n if (cached?.disabled === disabled && cached?.index === index) {\n return cached.context;\n }\n const context: CngxTabOverflowItemContext = {\n $implicit: tab,\n tab,\n pick: () => opts.pickTab(tab),\n disabled,\n index,\n };\n itemContextCache.set(tab, { context, disabled, index });\n return context;\n };\n const adItems = computed<ActiveDescendantItem[]>(\n () =>\n opts.hiddenTabs().map((tab) => ({\n id: tabOverflowOptionId(tab),\n value: tab,\n label: tab.label() ?? tab.id,\n disabled: tab.disabled(),\n })),\n { equal: adItemsEqual },\n );\n return {\n triggerTemplate,\n itemTemplate,\n triggerContext,\n buildItemContext,\n adItems,\n };\n}\n\n/**\n * Resets the AD highlight on popover close. Keyboard-open paths\n * (ArrowDown / End / typeahead on the closed trigger) set\n * `activeIndex` via AD's own keydown listener before opening -\n * unaffected. Mouse-open leaves `activeIndex === -1` so the popover\n * renders unhighlighted. Without this reset, the next open would\n * inherit a stale index from the prior keyboard session.\n *\n * Must run in injection context.\n *\n * @category common/tabs/overflow\n */\nexport function createOverflowPopoverHighlightSync(\n popover: Signal<CngxPopover>,\n ad: Signal<CngxActiveDescendant>,\n): void {\n effect(() => {\n const visible = popover().isVisible();\n untracked(() => {\n if (!visible) {\n ad().resetHighlight();\n }\n });\n });\n}\n\n/**\n * Factory signature for {@link CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY}.\n *\n * @category common/tabs/overflow\n */\nexport type CngxOverflowPopoverHighlightSyncFactory = (\n popover: Signal<CngxPopover>,\n ad: Signal<CngxActiveDescendant>,\n) => void;\n\n/**\n * DI token for the overflow popover highlight-sync policy.\n * Default {@link createOverflowPopoverHighlightSync}. Override via\n * `providers` / `viewProviders` for last-index preservation,\n * telemetry on close, custom highlight rules. Symmetric to\n * `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` and\n * `CNGX_TABS_COMMIT_HANDLER_FACTORY`.\n *\n * @category common/tabs/overflow\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/overflow-template-cascade.ts\n * @since 0.1.0\n */\nexport const CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY =\n new InjectionToken<CngxOverflowPopoverHighlightSyncFactory>(\n 'CngxOverflowPopoverHighlightSyncFactory',\n {\n providedIn: 'root',\n factory: () => createOverflowPopoverHighlightSync,\n },\n );\n","import {\n effect,\n InjectionToken,\n type Injector,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Options for {@link createOrganismScrollSync}.\n *\n * @category common/tabs/scroll-sync\n */\nexport interface CngxOrganismScrollSyncOptions {\n /** Reactive source for the active item id; tracked by the effect. */\n readonly activeId: Signal<string | null>;\n /**\n * Host element containing the per-item buttons. Items must carry\n * `id=\"${itemId}-header\"` - the convention used by\n * `<cngx-tab-group>` and `<cngx-stepper>`.\n */\n readonly hostElement: HTMLElement;\n /**\n * Forwarded to `Element.scrollIntoView`. Default: smooth-center\n * along the inline axis. Override for vertical or instant scroll.\n */\n readonly scrollOptions?: ScrollIntoViewOptions;\n /** Injector for installing the effect. */\n readonly injector: Injector;\n}\n\nconst DEFAULT_SCROLL_OPTIONS: ScrollIntoViewOptions = {\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n};\n\n/**\n * Scroll-into-view effect for any strip-based organism (tabs,\n * stepper headers, future scrolling lists). Tracks `activeId` and\n * scrolls the matching `[id=\"<itemId>-header\"]` into view.\n *\n * The DOM call sits in `untracked()` (only `activeId` is tracked).\n * `scrollIntoView` is missing in jsdom - guarded with optional chain.\n *\n * @category common/tabs/scroll-sync\n */\nexport function createOrganismScrollSync(opts: CngxOrganismScrollSyncOptions): void {\n const { activeId, hostElement, scrollOptions, injector } = opts;\n const resolvedOptions = scrollOptions ?? DEFAULT_SCROLL_OPTIONS;\n\n runInInjectionContext(injector, () => {\n effect(() => {\n const id = activeId();\n if (!id) {\n return;\n }\n untracked(() => {\n const button = hostElement.querySelector<HTMLElement>(`[id=\"${id}-header\"]`);\n button?.scrollIntoView?.(resolvedOptions);\n });\n });\n });\n}\n\n/**\n * Factory signature for {@link CNGX_ORGANISM_SCROLL_SYNC_FACTORY}.\n *\n * @category common/tabs/scroll-sync\n */\nexport type CngxOrganismScrollSyncFactory = (opts: CngxOrganismScrollSyncOptions) => void;\n\n/**\n * DI token for the active-item scroll-into-view policy. Defaults to\n * {@link createOrganismScrollSync}. Override for instant scroll,\n * custom selector, telemetry, or `prefers-reduced-motion` opt-out.\n * Sibling to `CNGX_DOM_ANCHOR_RETRY_FACTORY` and\n * `CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY`.\n *\n * @category common/tabs/scroll-sync\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/scroll-sync/organism-scroll-sync.ts\n * @since 0.1.0\n */\nexport const CNGX_ORGANISM_SCROLL_SYNC_FACTORY = new InjectionToken<CngxOrganismScrollSyncFactory>(\n 'CngxOrganismScrollSyncFactory',\n {\n providedIn: 'root',\n factory: () => createOrganismScrollSync,\n },\n);\n","import { computed, InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Structural equal for `Map<string, T>` (size + same value reference\n * per key, via `Object.is`).\n *\n * @internal\n */\nfunction directiveMapEqual<T>(a: Map<string, T>, b: Map<string, T>): boolean {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const [id, dir] of a) {\n if (b.get(id) !== dir) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Options for {@link createDirectiveByIdMap}.\n *\n * @category common/tabs/registry\n */\nexport interface CngxDirectiveByIdMapOptions<T extends { id: () => string }> {\n /** Reactive source - typically `contentChildren(...)`. */\n readonly source: Signal<readonly T[]>;\n}\n\n/**\n * Build a `Signal<Map<string, T>>` from a `Signal<readonly T[]>` of\n * directives keyed by `id()`. Structural equal prevents cascade when\n * `contentChildren` re-emits an unchanged child set. Shared by\n * `<cngx-tab-group>`, `<cngx-stepper>`, and `<cngx-mat-stepper>`.\n *\n * @category common/tabs/registry\n */\nexport function createDirectiveByIdMap<T extends { id: () => string }>(\n opts: CngxDirectiveByIdMapOptions<T>,\n): Signal<Map<string, T>> {\n return computed<Map<string, T>>(\n () => {\n const map = new Map<string, T>();\n for (const dir of opts.source()) {\n map.set(dir.id(), dir);\n }\n return map;\n },\n { equal: directiveMapEqual },\n );\n}\n\n/**\n * Factory signature for {@link CNGX_DIRECTIVE_BY_ID_MAP_FACTORY}.\n *\n * @category common/tabs/registry\n */\nexport type CngxDirectiveByIdMapFactory = <T extends { id: () => string }>(\n opts: CngxDirectiveByIdMapOptions<T>,\n) => Signal<Map<string, T>>;\n\n/**\n * DI token for the per-id directive-resolution policy. Defaults to\n * {@link createDirectiveByIdMap}. Override for WeakMap resolution,\n * telemetry, or custom equality. Sibling to\n * `CNGX_DOM_ANCHOR_RETRY_FACTORY` and\n * `CNGX_ORGANISM_SCROLL_SYNC_FACTORY`.\n *\n * @category common/tabs/registry\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/registry/directive-by-id-map.ts\n * @since 0.1.0\n */\nexport const CNGX_DIRECTIVE_BY_ID_MAP_FACTORY = new InjectionToken<CngxDirectiveByIdMapFactory>(\n 'CngxDirectiveByIdMapFactory',\n {\n providedIn: 'root',\n factory: () => createDirectiveByIdMap,\n },\n);\n","/**\n * @module @cngx/common/tabs\n */\nexport {\n CngxTabGroupPresenter,\n type CngxTabsCommitAction,\n} from './presenter.directive';\nexport {\n CNGX_TAB_GROUP_HOST,\n type CngxTabCloseEvent,\n type CngxTabGroupHost,\n type CngxTabHandle,\n} from './tab-group-host.token';\nexport {\n CNGX_TAB_PANEL_HOST,\n type CngxTabPanelHost,\n} from './tab-panel-host.token';\nexport { CngxTab } from './tab.directive';\nexport { CngxTabLabel } from './tab-label.directive';\nexport { CngxTabSubLabel } from './slots/tab-sub-label.directive';\nexport { CngxTabContent } from './tab-content.directive';\nexport { CngxTabsFragmentSync } from './router-sync.directive';\nexport { CngxTabsRouteSync } from './route-sync.directive';\nexport {\n createTabRouterCommit,\n type CngxTabRouterCommitOptions,\n} from './router-commit';\nexport {\n CNGX_TABS_COMMIT_ACTION,\n type CngxTabsCommitActionSource,\n} from './commit-action.token';\nexport {\n CNGX_TABS_CONFIG,\n injectTabsConfig,\n provideTabsConfig,\n provideTabsConfigAt,\n withDefaultOrientation,\n withTabBusySpinnerTemplate,\n withTabErrorBadgeTemplate,\n withTabIconTemplate,\n withTabOverflowItemTemplate,\n withTabOverflowMaxDeferMs,\n withTabOverflowStabilizeMs,\n withTabOverflowTriggerTemplate,\n withTabRejectionIconTemplate,\n withTabsAriaLabels,\n withTabsCommitMode,\n withTabsDefaultOrientation,\n withTabAddIconTemplate,\n withTabCloseIconTemplate,\n withTabsAddable,\n withTabsAlign,\n withTabsClosable,\n withTabsFallbackLabels,\n withTabsFitted,\n withTabsIconLayout,\n withTabsPanelMode,\n withTabsFragmentSync,\n withTabsRouterSync,\n withTabsRovingLoop,\n withTabsSkin,\n type CngxTabAlign,\n type CngxTabIconLayout,\n type CngxTabsAriaLabels,\n type CngxTabsConfig,\n type CngxTabsConfigFeature,\n type CngxTabsFallbackLabels,\n type CngxTabsPanelMode,\n type CngxTabsSkin,\n type CngxTabsTemplates,\n} from './tabs-config';\n// This block ships `@internal` factory helpers. They are exported\n// through `public-api.ts` so the sibling `@cngx/ui/tabs` organism can\n// consume them across the secondary-entry boundary (ng-packagr has no\n// cross-entry private surface). `disableInternal: true` hides them from\n// generated docs; the LLM-md export honours the same tag. Precedent:\n// `CNGX_TABS_GLYPHS`, `tabsEqual`.\nexport {\n createTabsHostAttrs,\n type CngxTabsHostAttrs,\n type CngxTabsHostAttrsInputs,\n} from './tabs-host-attrs';\nexport {\n provideCngxTabs,\n provideCngxTabsAt,\n type CngxTabsFeature,\n} from './provide-cngx-tabs';\nexport {\n CNGX_TABS_I18N,\n injectTabsI18n,\n provideTabsI18n,\n withTabsI18nLabels,\n type CngxTabsI18n,\n type CngxTabsI18nFeature,\n} from './i18n/tabs-i18n';\nexport {\n createTabsCommitHandler,\n CNGX_TABS_COMMIT_HANDLER_FACTORY,\n type CngxTabsCommitHandler,\n type CngxTabsCommitHandlerFactory,\n type CngxTabsCommitHandlerOptions,\n} from './commit-handler';\nexport {\n CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n createCngxTabOverflowDefaultDomAdapter,\n type CngxTabOverflowDomAdapter,\n type CngxTabOverflowDomAdapterFactory,\n} from './overflow/dom-adapter';\nexport {\n CNGX_DOM_ANCHOR_RETRY_FACTORY,\n createDomAnchorRetry,\n type CngxDomAnchorRetryFactory,\n type CngxDomAnchorRetryHandle,\n type CngxDomAnchorRetryOptions,\n type CngxDomAnchorRetryResult,\n} from './overflow/dom-anchor-retry';\nexport {\n CngxTabOverflowTrigger,\n type CngxTabOverflowTriggerContext,\n} from './overflow/tab-overflow-trigger.directive';\nexport {\n CngxTabOverflowItem,\n type CngxTabOverflowItemContext,\n} from './overflow/tab-overflow-item.directive';\nexport {\n CngxTabErrorBadge,\n type CngxTabErrorBadgeContext,\n} from './slots/tab-error-badge.directive';\nexport {\n CngxTabRejectionIcon,\n type CngxTabRejectionIconContext,\n} from './slots/tab-rejection-icon.directive';\nexport {\n CngxTabBusySpinner,\n type CngxTabBusySpinnerContext,\n} from './slots/tab-busy-spinner.directive';\nexport {\n CngxTabIcon,\n type CngxTabIconContext,\n} from './slots/tab-icon.directive';\nexport {\n CngxTabCloseIcon,\n type CngxTabCloseIconContext,\n} from './slots/tab-close-icon.directive';\nexport { CngxTabAddIcon } from './slots/tab-add-icon.directive';\nexport {\n createTabDismissals,\n type CngxTabDismissals,\n type CngxTabDismissalsOptions,\n} from './dismissals/tab-dismissals';\nexport {\n createTabKeyboardNav,\n type CngxTabKeyboardNav,\n type CngxTabKeyboardNavOptions,\n} from './keyboard/tab-keyboard-nav';\nexport {\n createTabGroupTemplateBindings,\n type CngxTabGroupTemplateBindings,\n type CngxTabGroupTemplateBindingsOptions,\n} from './slots/tab-group-template-cascade';\nexport {\n createTabGroupAnnouncements,\n type CngxTabGroupAnnouncements,\n type CngxTabGroupAnnouncementsOptions,\n} from './announcements/tab-group-announcements';\nexport { CNGX_TABS_GLYPHS } from './glyphs';\nexport {\n CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY,\n createOverflowPopoverHighlightSync,\n createTabOverflowTemplateBindings,\n tabOverflowOptionId,\n type CngxOverflowPopoverHighlightSyncFactory,\n type CngxTabOverflowTemplateBindings,\n type CngxTabOverflowTemplateBindingsOptions,\n} from './overflow/overflow-template-cascade';\n\nexport {\n CNGX_ORGANISM_SCROLL_SYNC_FACTORY,\n createOrganismScrollSync,\n type CngxOrganismScrollSyncFactory,\n type CngxOrganismScrollSyncOptions,\n} from './scroll-sync/organism-scroll-sync';\nexport {\n CNGX_DIRECTIVE_BY_ID_MAP_FACTORY,\n createDirectiveByIdMap,\n type CngxDirectiveByIdMapFactory,\n type CngxDirectiveByIdMapOptions,\n} from './registry/directive-by-id-map';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAoBA;;;;;;;;;;AAUG;MACU,uBAAuB,GAAG,IAAI,cAAc,CACvD,sBAAsB;;ACYxB;;;;;;AAMG;AACG,SAAU,uBAAuB,CAAC,IAAkC,EAAA;AACxE,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAC3B,OAAO;QACL,YAAY,EAAE,UAAU,CAAC,YAAY;AAErC,QAAA,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAA;YACnD,UAAU,CAAC,KAAK,CACd,CAAC,QAAQ,KAAK,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EACjE,OAAO,EACP,SAAS,EACT;AACE,gBAAA,SAAS,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC;AAChC,gBAAA,OAAO,EAAE,MAAM,SAAS,CAAC,KAAK,CAAC;AAChC,aAAA,CACF;QACH,CAAC;QAED,MAAM,GAAA;YACJ,UAAU,CAAC,MAAM,EAAE;QACrB,CAAC;KACF;A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,OAAO,QAAQ,CACb,MAAK;AACH,QAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAa;QAChC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE;YAC/B,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC;QACxB;AACA,QAAA,OAAO,GAAG;AACZ,IAAA,CAAC,EACD,EAAE,KAAK,EAAE,iBAAiB,EAAE,CAC7B;AACH;AAWA;;;;;;;;;;AAUG;MACU,gCAAgC,GAAG,IAAI,cAAc,CAChE,6BAA6B,EAC7B;AACE,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,sBAAsB;AACtC,CAAA;;ACjFH;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cngx-common-tabs.mjs","sources":["../../../projects/common/tabs/commit-action.token.ts","../../../projects/common/tabs/commit-handler.ts","../../../projects/common/tabs/tab-group-host.token.ts","../../../projects/common/tabs/presenter.directive.ts","../../../projects/common/tabs/tab-panel-host.token.ts","../../../projects/common/tabs/tab-content.directive.ts","../../../projects/common/tabs/tab-label.directive.ts","../../../projects/common/tabs/slots/tab-sub-label.directive.ts","../../../projects/common/tabs/tab.directive.ts","../../../projects/common/tabs/tab-link.directive.ts","../../../projects/common/tabs/router-absent-warning.ts","../../../projects/common/tabs/router-sync.directive.ts","../../../projects/common/tabs/router-commit.ts","../../../projects/common/tabs/route-sync.directive.ts","../../../projects/common/tabs/tabs-config.ts","../../../projects/common/tabs/tabs-host-attrs.ts","../../../projects/common/tabs/i18n/tabs-i18n.ts","../../../projects/common/tabs/provide-cngx-tabs.ts","../../../projects/common/tabs/overflow/dom-adapter.ts","../../../projects/common/tabs/overflow/dom-anchor-retry.ts","../../../projects/common/tabs/overflow/tab-overflow-trigger.directive.ts","../../../projects/common/tabs/overflow/tab-overflow-item.directive.ts","../../../projects/common/tabs/slots/tab-error-badge.directive.ts","../../../projects/common/tabs/slots/tab-rejection-icon.directive.ts","../../../projects/common/tabs/slots/tab-busy-spinner.directive.ts","../../../projects/common/tabs/slots/tab-icon.directive.ts","../../../projects/common/tabs/slots/tab-close-icon.directive.ts","../../../projects/common/tabs/slots/tab-add-icon.directive.ts","../../../projects/common/tabs/dismissals/tab-dismissals.ts","../../../projects/common/tabs/keyboard/tab-keyboard-nav.ts","../../../projects/common/tabs/slots/tab-group-template-cascade.ts","../../../projects/common/tabs/announcements/tab-group-announcements.ts","../../../projects/common/tabs/glyphs.ts","../../../projects/common/tabs/overflow/overflow-template-cascade.ts","../../../projects/common/tabs/scroll-sync/organism-scroll-sync.ts","../../../projects/common/tabs/registry/directive-by-id-map.ts","../../../projects/common/tabs/public-api.ts","../../../projects/common/tabs/cngx-common-tabs.ts"],"sourcesContent":["import { InjectionToken, type Signal } from '@angular/core';\n\nimport type { CngxTabsCommitAction } from './presenter.directive';\n\n/**\n * Source supplied through {@link CNGX_TABS_COMMIT_ACTION}. \\\n * A sync directive (e.g. `[cngxTabsRouteSync]`) provides one so the presenter\n * picks up a commit-action without the consumer hand-binding\n * `[commitAction]`.\n *\n * Carries `mode` alongside `action` so the routed\n * path can pin pessimistic - the active tab must follow the *resolved*\n * route, and a stray `[commitMode]=\"'optimistic'\"` must not override\n * that invariant.\n *\n * @category common/tabs\n */\nexport interface CngxTabsCommitActionSource {\n /**\n * The commit-action the presenter runs on a tab switch, or `null` when\n * the source has nothing to gate with (e.g. a route-sync without a\n * `Router`). A non-null value activates this source over the\n * presenter's `[commitAction]` input.\n */\n readonly action: Signal<CngxTabsCommitAction | null>;\n /**\n * Commit semantics for this source. When `action()` is non-null, this\n * wins over the presenter's `[commitMode]` input - the route-sync pins\n * `'pessimistic'` so the active tab follows the resolved route.\n */\n readonly mode: Signal<'optimistic' | 'pessimistic'>;\n}\n\n/**\n * DI fallback the presenter reads when its `[commitAction]` input is\n * unbound. Directives compose via DI tokens, not by hand-binding\n * another directive's input (Pillar 3). When a source is present and\n * exposes a non-null `action()`, its `mode()` wins over the\n * `[commitMode]` input.\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/commit-action.token.ts\n * @since 0.1.0\n */\nexport const CNGX_TABS_COMMIT_ACTION = new InjectionToken<CngxTabsCommitActionSource>(\n 'CngxTabsCommitAction',\n);\n","import { InjectionToken, type Signal } from '@angular/core';\nimport { isObservable, type Observable, type Subscription } from 'rxjs';\n\nimport { type CngxCommitController, type CngxCommitHandle } from '@cngx/common/data';\n\nimport type { CngxTabsCommitAction } from './presenter.directive';\n\n/**\n * Adapts the shared commit-controller to the tabs action shape. \\\n * The presenter delegates to {@link beginTransition} when `commitAction`\n * is bound.\n *\n * @category common/tabs\n */\nexport interface CngxTabsCommitHandler {\n /**\n * Start a tab-transition commit. \\\n * Returns synchronously - read the\n * controller's `state` signal for in-flight status. `onResolve`\n * fires once with `accept = true` on success or `false` on\n * rejection; skipped on supersede.\n */\n beginTransition(\n fromIndex: number,\n toIndex: number,\n action: CngxTabsCommitAction,\n onResolve: (accept: boolean) => void,\n ): void;\n\n /** Cancel the in-flight transition without firing callbacks. */\n cancel(): void;\n\n /** Live `pending` flag from the controller. */\n readonly isCommitting: Signal<boolean>;\n}\n\n/**\n * Options for {@link createTabsCommitHandler}.\n *\n * @category common/tabs\n */\nexport interface CngxTabsCommitHandlerOptions {\n readonly controller: CngxCommitController<number>;\n}\n\n/**\n * Wraps a {@link CngxCommitController} with the action-shape adapter\n * that collapses `Observable<boolean>` / `Promise<boolean>` /\n * `boolean` returns into a single `accept: boolean` outcome.\n *\n * @category common/tabs\n */\nexport function createTabsCommitHandler(opts: CngxTabsCommitHandlerOptions): CngxTabsCommitHandler {\n const { controller } = opts;\n return {\n isCommitting: controller.isCommitting,\n\n beginTransition(fromIndex, toIndex, action, onResolve) {\n controller.begin(\n (handlers) => runTabsAction(action, fromIndex, toIndex, handlers),\n toIndex,\n fromIndex,\n {\n onSuccess: () => onResolve(true),\n onError: () => onResolve(false),\n },\n );\n },\n\n cancel() {\n controller.cancel();\n },\n };\n}\n\nfunction runTabsAction(\n action: CngxTabsCommitAction,\n fromIndex: number,\n toIndex: number,\n handlers: {\n readonly onSuccess: (committed: number | undefined) => void;\n readonly onError: (err: unknown) => void;\n },\n): CngxCommitHandle {\n let cancelled = false;\n let unsubscribe: (() => void) | null = null;\n\n const safeSuccess = (accept: boolean): void => {\n if (cancelled) {\n return;\n }\n if (accept) {\n handlers.onSuccess(toIndex);\n } else {\n handlers.onError(new Error('Tab transition refused by commitAction'));\n }\n };\n const safeError = (err: unknown): void => {\n if (cancelled) {\n return;\n }\n handlers.onError(err);\n };\n\n let result: boolean | Promise<boolean> | Observable<boolean>;\n try {\n result = action(fromIndex, toIndex);\n } catch (err: unknown) {\n safeError(err);\n return {\n cancel: () => {\n cancelled = true;\n },\n };\n }\n\n if (isObservable(result)) {\n // Synchronous Observables (`of(true)`) emit inside `.subscribe` before\n // the assignment binds - close over a pre-declared `let` to avoid TDZ.\n let sub: Subscription | null = null;\n sub = result.subscribe({\n next: (accept) => {\n safeSuccess(accept);\n sub?.unsubscribe();\n },\n error: (err: unknown) => safeError(err),\n });\n unsubscribe = () => sub?.unsubscribe();\n } else if (result != null && typeof (result as { then?: unknown }).then === 'function') {\n (result as Promise<boolean>).then(safeSuccess, safeError);\n } else {\n safeSuccess(result as boolean);\n }\n\n return {\n cancel: () => {\n cancelled = true;\n unsubscribe?.();\n },\n };\n}\n\n/**\n * Factory signature for {@link CNGX_TABS_COMMIT_HANDLER_FACTORY}.\n * Override to wrap the default with retry-with-backoff, telemetry,\n * or offline queues.\n *\n * @category common/tabs\n */\nexport type CngxTabsCommitHandlerFactory = (\n opts: CngxTabsCommitHandlerOptions,\n) => CngxTabsCommitHandler;\n\n/**\n * DI token for the commit-handler factory. \\\n * Defaults to {@link createTabsCommitHandler}. \\\n * Sibling to\n * - `CNGX_ARRAY_COMMIT_HANDLER_FACTORY` (select) and\n * - `CNGX_STEPPER_COMMIT_HANDLER_FACTORY`.\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/commit-handler.ts\n * @since 0.1.0\n */\nexport const CNGX_TABS_COMMIT_HANDLER_FACTORY = new InjectionToken<CngxTabsCommitHandlerFactory>(\n 'CngxTabsCommitHandlerFactory',\n {\n providedIn: 'root',\n factory: () => createTabsCommitHandler,\n },\n);\n","import { InjectionToken, type ModelSignal, type Signal } from '@angular/core';\n\nimport type { CngxAsyncState, StatusTransition } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\n/**\n * Registration handle a `CngxTab` atom passes to its presenter via\n * {@link CngxTabGroupHost.register}. Fields are exposed by reference\n * so subsequent input changes propagate without re-registration.\n * `errorAggregator` is a `Signal<...>` slot so consumer aggregators\n * resolved via `viewChild` after first registration still bind.\n *\n * @category common/tabs\n */\nexport interface CngxTabHandle {\n readonly id: string;\n readonly label: Signal<string | undefined>;\n /**\n * Optional secondary label line. Rendered stacked under the primary\n * label by the organism and folded into the tab's accessible name.\n * `undefined` (default) renders byte-identically to a single-line\n * tab. `[cngxMatTabs]` pins this to `undefined` - Material owns its\n * own tab chrome.\n */\n readonly subLabel: Signal<string | undefined>;\n readonly disabled: Signal<boolean>;\n readonly errorAggregator: Signal<CngxErrorAggregatorContract | undefined>;\n /**\n * Folded per-tab error state, exposed by reference. `true` when the\n * direct `[error]` flag is set OR the aggregator wants to reveal\n * (`shouldShow()`, so deferred-reveal validation stays silent until\n * revealed). The organism gates the error badge + SR descriptor on\n * this; both handle producers (`CngxTab`, `createMatTabHandle`)\n * carry it.\n */\n readonly hasError: Signal<boolean>;\n /**\n * Resolved direct-error message - the `[error]` string when non-empty,\n * else `undefined`. Rides the handle so the error badge slot can render\n * it via `ctx.tab.errorMessage()`. `[cngxMatTabs]` pins this to\n * `undefined` - Material owns its own tab chrome.\n */\n readonly errorMessage: Signal<string | undefined>;\n /**\n * Per-tab closable override. `undefined` (default) inherits the\n * group-level `closable` resolution; `true`/`false` pin this tab's\n * close affordance regardless of the group default (e.g. a\n * non-closable \"Home\" tab inside an otherwise dismissable group).\n */\n readonly closable: Signal<boolean | undefined>;\n}\n\n/**\n * Payload of {@link CngxTabGroupHost.tabClose}. Carries the closed\n * tab's id and its index at close time. The consumer removes the tab\n * from its own data in response; the presenter has already moved the\n * active index to the surviving neighbour.\n *\n * @category common/tabs\n */\nexport interface CngxTabCloseEvent {\n readonly id: string;\n readonly index: number;\n}\n\n/**\n * Contract atoms see when they inject the presenter via\n * {@link CNGX_TAB_GROUP_HOST}. Atoms never reach into the concrete\n * class - keeps layering cycle-free and the decompose schematic clean.\n *\n * @category common/tabs\n */\nexport interface CngxTabGroupHost {\n readonly tabs: Signal<readonly CngxTabHandle[]>;\n readonly activeIndex: ModelSignal<number>;\n readonly activeId: Signal<string | null>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n readonly loop: Signal<boolean>;\n readonly commitState: CngxAsyncState<number | undefined>;\n readonly intendedIndex: Signal<number | undefined>;\n /**\n * Reactive current/previous pair for the commit-state status. Lets\n * organisms and skin sub-components derive transition-driven\n * announcements (`pending` → `success`, `pending` → `error`, sync\n * `idle` → `error`) from a single tracker.\n */\n readonly commitTransition: StatusTransition;\n\n /**\n * Tab index of the last refused commit (both optimistic and\n * pessimistic modes). Cleared on next successful re-pick of the\n * same index or via {@link clearLastFailed}. Drives the persistent\n * rejection-icon decoration.\n *\n * @remarks\n * The `pending → error` pulse keyframe (`cngx-tab-pulse-error`)\n * does not retrigger on rapid supersede sequences - CSS animations\n * only fire on fresh class application. See `tabs-accepted-debt §3`;\n * the persistent icon plus static red outline carry the durable\n * signal in the no-pulse case.\n */\n readonly lastFailedIndex: Signal<number | undefined>;\n\n /**\n * Safe-harbour origin index captured at the start of an active\n * commit window. Written when `select()` opens a transition under\n * `commitAction`; retained on `error` so the live-region phrase\n * can resolve the origin label; cleared on `success`. Outside the\n * commit window the slot may carry a stale value - consumers must\n * gate reads by joining with `lastFailedIndex`. The origin is\n * meaningful only when `lastFailedIndex !== undefined`.\n */\n readonly originIndexDuringCommit: Signal<number | undefined>;\n\n register(handle: CngxTabHandle): void;\n unregister(id: string): void;\n\n select(index: number): void;\n selectNext(): void;\n selectPrevious(): void;\n selectById(id: string): void;\n\n /**\n * Request closing the tab with the given id. The presenter moves the\n * active index onto the surviving neighbour (APG: next tab, or the\n * previous one when closing the last tab) and emits `tabClose`; the\n * consumer performs the actual removal from its data. No-op for an\n * unknown id.\n */\n requestClose(id: string): void;\n\n /**\n * Request adding a new tab. Emits `tabAdd`; the consumer appends to\n * its data. The presenter owns no tab-creation logic - tabs are\n * derived from consumer data (Ableitung statt Verwaltung).\n */\n requestAdd(): void;\n\n /**\n * Clear {@link lastFailedIndex} without unwinding\n * {@link originIndexDuringCommit} (consumers gate reads on\n * `lastFailedIndex` anyway). Call when the bound data source\n * changes and the rollback marker is no longer meaningful.\n */\n clearLastFailed(): void;\n}\n\n/**\n * DI token for the tab presenter's contract. \\\n * Presenter provides via `useExisting`; `CngxTab` injects to register; the organism injects\n * to drive the APG tablist keyboard model (automatic activation via\n * `select()`, roving stop derived from `activeId`) through\n * `createTabKeyboardNav`.\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-group-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_TAB_GROUP_HOST = new InjectionToken<CngxTabGroupHost>('CngxTabGroupHost');\n","import {\n computed,\n Directive,\n inject,\n Injector,\n input,\n model,\n output,\n signal,\n type Signal,\n} from '@angular/core';\n\nimport { CNGX_COMMIT_CONTROLLER_FACTORY, type CngxCommitController } from '@cngx/common/data';\nimport {\n CNGX_STATEFUL,\n createTransitionTracker,\n type CngxAsyncState,\n type StatusTransition,\n} from '@cngx/core/utils';\nimport type { Observable } from 'rxjs';\n\nimport { CNGX_TABS_COMMIT_ACTION, type CngxTabsCommitActionSource } from './commit-action.token';\nimport { CNGX_TABS_COMMIT_HANDLER_FACTORY, type CngxTabsCommitHandler } from './commit-handler';\nimport {\n CNGX_TAB_GROUP_HOST,\n type CngxTabCloseEvent,\n type CngxTabGroupHost,\n type CngxTabHandle,\n} from './tab-group-host.token';\n\n/**\n * Async-commit action shape for tab transitions. \\\n * Receives origin and target indices; resolves `true` to commit, `false` to refuse.\n * `Observable | Promise | sync` union mirrors the rest of the CNGX\n * commit-action family.\n *\n * @category common/tabs\n */\nexport type CngxTabsCommitAction = (\n fromIndex: number,\n toIndex: number,\n) => boolean | Promise<boolean> | Observable<boolean>;\n\n/**\n * Tab-group presenter - brain of every CNGX tab flow. \\\n * Owns the active-index model, the tab registry, orientation, loop policy,\n * and the commit-controller lifecycle. \\\n * Provides {@link CNGX_TAB_GROUP_HOST} for atoms and {@link CNGX_STATEFUL}\n * so `<cngx-toast-on />` / `<cngx-banner-on />` compose without\n * `[state]` wiring.\n *\n * **Layer:** `@cngx/common/tabs`. \\\n * Directive-only - organisms compose via `hostDirectives`, consumers attach\n * `[cngxTabGroup]` directly.\n *\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/presenter.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTab, CngxTabContent, CngxTabLabel, CngxTabsFragmentSync\n * <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>\n */\n@Directive({\n selector: '[cngxTabGroup]',\n exportAs: 'cngxTabGroup',\n standalone: true,\n providers: [\n { provide: CNGX_TAB_GROUP_HOST, useExisting: CngxTabGroupPresenter },\n { provide: CNGX_STATEFUL, useExisting: CngxTabGroupPresenter },\n ],\n})\nexport class CngxTabGroupPresenter implements CngxTabGroupHost {\n readonly activeIndex = model<number>(0);\n readonly orientation = input<'horizontal' | 'vertical'>('horizontal');\n readonly loop = input<boolean>(true);\n\n /**\n * Async-commit action gating the transition.\n * When non-null, `select(...)` routes through {@link CngxTabsCommitHandler}; the\n * action's resolution decides whether the change lands. Supersede\n * semantics come from the commit-controller - a rapid second\n * `select(...)` cancels the in-flight runner.\n *\n * @internal Two-field alias - bind the public `[commitAction]`; read\n * the resolved {@link commitAction} computed (input ?? DI fallback).\n */\n readonly commitActionInput = input<CngxTabsCommitAction | null>(null, {\n alias: 'commitAction',\n });\n /**\n * Default `'optimistic'` - tab change is navigation, not a save,\n * so eager visual feedback matches the user's mental model.\n * Switch to `'pessimistic'` when the new tab must wait for the\n * action to confirm.\n *\n * @internal Two-field alias - bind the public `[commitMode]`; read\n * the resolved {@link commitMode} computed (DI fallback mode wins\n * when a routed action is active).\n */\n readonly commitModeInput = input<'optimistic' | 'pessimistic'>('optimistic', {\n alias: 'commitMode',\n });\n\n private readonly injector = inject(Injector);\n // Resolved lazily, never in a field initialiser: a sync directive\n // (e.g. [cngxTabsRouteSync]) provides CNGX_TABS_COMMIT_ACTION via\n // useExisting and itself injects this presenter as its host, so\n // eager injection here would close a construction cycle (NG0200).\n // First read happens at select()/template time - after both\n // directives exist. The source is static per element, so memoising\n // the resolution is safe.\n private injectedActionSource: CngxTabsCommitActionSource | null | undefined;\n\n private resolveInjectedAction(): CngxTabsCommitActionSource | null {\n if (this.injectedActionSource === undefined) {\n this.injectedActionSource = this.injector.get(CNGX_TABS_COMMIT_ACTION, null);\n }\n return this.injectedActionSource;\n }\n\n /**\n * Resolved commit-action: the `[commitAction]` input when bound, else\n * the {@link CNGX_TABS_COMMIT_ACTION} DI fallback (routed path), else\n * `null`. `select()` reads this.\n */\n readonly commitAction = computed<CngxTabsCommitAction | null>(\n () => this.commitActionInput() ?? this.resolveInjectedAction()?.action() ?? null,\n );\n /**\n * Resolved commit mode. When the DI fallback supplies an active\n * action its `mode` wins - the routed path pins `'pessimistic'` so a\n * stray `[commitMode]=\"'optimistic'\"` cannot break the\n * route-follows-resolution invariant. Otherwise the `[commitMode]`\n * input drives.\n */\n readonly commitMode = computed<'optimistic' | 'pessimistic'>(() => {\n const source = this.resolveInjectedAction();\n return source?.action() ? source.mode() : this.commitModeInput();\n });\n\n /**\n * Emitted when a tab's close affordance is activated (the close\n * button or Delete/Backspace on the focused tab). The presenter has\n * already moved the active index onto the surviving neighbour; the\n * consumer removes the tab from its own data in the handler.\n */\n readonly tabClose = output<CngxTabCloseEvent>();\n /**\n * Emitted when the add-tab affordance is activated. The consumer\n * appends a tab to its own data; the presenter owns no creation logic.\n */\n readonly tabAdd = output<void>();\n\n private readonly genericFactory = inject(CNGX_COMMIT_CONTROLLER_FACTORY);\n private readonly commitController: CngxCommitController<number> = this.genericFactory<number>();\n private readonly commitHandler: CngxTabsCommitHandler = inject(CNGX_TABS_COMMIT_HANDLER_FACTORY)({\n controller: this.commitController,\n });\n\n /** Producer surface for the `CNGX_STATEFUL` bridge contract. */\n readonly state: CngxAsyncState<number | undefined> = this.commitController.state;\n readonly commitState: CngxAsyncState<number | undefined> = this.commitController.state;\n /**\n * Index the user is currently trying to commit to. Tracked\n * separately from `state.data()` (which only updates on success)\n * to drive per-tab `aria-busy`.\n */\n readonly intendedIndex: Signal<number | undefined> = this.commitController.intendedValue;\n\n /**\n * Current/previous pair for `commitState.status()`. Skin\n * sub-components feed `<span cngxLiveRegion>` from this tracker\n * for declarative SR announcements. Shared across consumers so\n * the tracker's `linkedSignal` is allocated once per presenter.\n */\n readonly commitTransition: StatusTransition = createTransitionTracker(() =>\n this.commitController.state.status(),\n );\n\n // Persistence-of-error surface - see `CngxTabGroupHost.lastFailedIndex`\n // and `originIndexDuringCommit` for the contract.\n private readonly lastFailedIndexState = signal<number | undefined>(undefined);\n private readonly originIndexDuringCommitState = signal<number | undefined>(undefined);\n /** {@inheritDoc CngxTabGroupHost.lastFailedIndex} */\n readonly lastFailedIndex: Signal<number | undefined> = this.lastFailedIndexState.asReadonly();\n /** {@inheritDoc CngxTabGroupHost.originIndexDuringCommit} */\n readonly originIndexDuringCommit: Signal<number | undefined> =\n this.originIndexDuringCommitState.asReadonly();\n\n private readonly tabsState = signal<readonly CngxTabHandle[]>([], {\n equal: tabsEqual,\n });\n readonly tabs: Signal<readonly CngxTabHandle[]> = this.tabsState.asReadonly();\n\n private readonly clampedIndex = computed(() => {\n const count = this.tabs().length;\n if (count === 0) {\n return 0;\n }\n return Math.max(0, Math.min(this.activeIndex(), count - 1));\n });\n\n readonly activeId: Signal<string | null> = computed(\n () => this.tabs()[this.clampedIndex()]?.id ?? null,\n { equal: Object.is },\n );\n\n register(handle: CngxTabHandle): void {\n const current = this.tabsState();\n const idx = current.findIndex((h) => h.id === handle.id);\n if (idx >= 0) {\n const next = current.slice();\n next[idx] = handle;\n this.tabsState.set(next);\n return;\n }\n this.tabsState.set([...current, handle]);\n }\n\n unregister(id: string): void {\n const current = this.tabsState();\n const next = current.filter((h) => h.id !== id);\n if (next.length !== current.length) {\n this.tabsState.set(next);\n }\n }\n\n /** {@inheritDoc CngxTabGroupHost.clearLastFailed} */\n clearLastFailed(): void {\n this.lastFailedIndexState.set(undefined);\n }\n\n select(index: number): void {\n const tabs = this.tabs();\n if (tabs.length === 0) {\n return;\n }\n const target = Math.max(0, Math.min(index, tabs.length - 1));\n if (tabs[target].disabled()) {\n return;\n }\n const previous = this.activeIndex();\n if (target === previous) {\n return;\n }\n\n const action = this.commitAction();\n if (!action) {\n // No-action fast path - `originIndexDuringCommit` stays\n // untouched, so a stale origin can never leak into the\n // live-region announcement.\n this.activeIndex.set(target);\n if (this.lastFailedIndexState() === target) {\n this.lastFailedIndexState.set(undefined);\n }\n return;\n }\n\n // Open the commit window - origin is captured ONLY here so a\n // stale value never lingers into a non-commit navigation.\n this.originIndexDuringCommitState.set(previous);\n const mode = this.commitMode();\n if (mode === 'optimistic') {\n this.activeIndex.set(target);\n }\n this.commitHandler.beginTransition(previous, target, action, (accept) => {\n if (accept) {\n // Window closes on success - origin label no longer needed;\n // clear the rejection flag if the user re-picked the failed\n // target successfully.\n this.originIndexDuringCommitState.set(undefined);\n if (this.lastFailedIndexState() === target) {\n this.lastFailedIndexState.set(undefined);\n }\n if (mode === 'pessimistic') {\n this.activeIndex.set(target);\n }\n } else {\n // Reject - flag the refused target; RETAIN the origin so\n // the organism's `liveAnnouncement` computed can resolve\n // the origin label for the rich rollback phrase. Optimistic\n // rolls back; pessimistic never moved.\n this.lastFailedIndexState.set(target);\n if (mode === 'optimistic') {\n this.activeIndex.set(previous);\n }\n }\n });\n }\n\n selectNext(): void {\n const tabs = this.tabs();\n if (tabs.length === 0) {\n return;\n }\n let next = this.activeIndex() + 1;\n while (next < tabs.length && tabs[next].disabled()) {\n next++;\n }\n if (next < tabs.length) {\n this.select(next);\n return;\n }\n if (this.loop()) {\n let i = 0;\n while (i < tabs.length && tabs[i].disabled()) {\n i++;\n }\n if (i < tabs.length && i !== this.activeIndex()) {\n this.select(i);\n }\n }\n }\n\n selectPrevious(): void {\n const tabs = this.tabs();\n if (tabs.length === 0) {\n return;\n }\n let prev = this.activeIndex() - 1;\n while (prev >= 0 && tabs[prev].disabled()) {\n prev--;\n }\n if (prev >= 0) {\n this.select(prev);\n return;\n }\n if (this.loop()) {\n let i = tabs.length - 1;\n while (i >= 0 && tabs[i].disabled()) {\n i--;\n }\n if (i >= 0 && i !== this.activeIndex()) {\n this.select(i);\n }\n }\n }\n\n selectById(id: string): void {\n const tabs = this.tabs();\n const idx = tabs.findIndex((h) => h.id === id);\n if (idx >= 0) {\n this.select(idx);\n }\n }\n\n requestClose(id: string): void {\n const tabs = this.tabs();\n const index = tabs.findIndex((h) => h.id === id);\n if (index < 0) {\n return;\n }\n const active = this.clampedIndex();\n // Only closing a tab BEFORE the active one needs a pre-emptive\n // index shift: the active tab moves down one slot once the consumer\n // removes the closed tab, so decrement to keep the same tab active.\n // Closing the active tab (or one after it) needs no write -\n // `clampedIndex` re-derives against the shorter array and lands on\n // the next tab (or the new last when the closed tab was last).\n if (index < active) {\n this.activeIndex.set(active - 1);\n }\n this.tabClose.emit({ id, index });\n }\n\n requestAdd(): void {\n this.tabAdd.emit();\n }\n}\n\n/**\n * Structural equality for the tab registry. Compares length and\n * per-entry `id`, `disabled()`, `label()`, `subLabel()`, and\n * `closable()`.\n *\n * `errorAggregator`, `hasError`, and `errorMessage` are left out on\n * purpose. The handle is a stable per-tab reference injected once, and\n * the organism reads `tab.hasError()` / `tab.errorMessage()` reactively\n * off that handle (not off array identity), so the badge + descriptor\n * update on error-state changes without the registry array re-emitting.\n * Comparing them here would push the memoisation burden onto consumers\n * and break the structural-equal contract.\n *\n * Reading the signals here doesn't subscribe - the comparator runs\n * synchronously inside `signal.set()`, outside any tracking context.\n *\n * @internal\n */\nexport function tabsEqual(a: readonly CngxTabHandle[], b: readonly CngxTabHandle[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (\n a[i].id !== b[i].id ||\n a[i].disabled() !== b[i].disabled() ||\n a[i].label() !== b[i].label() ||\n a[i].subLabel() !== b[i].subLabel() ||\n a[i].closable() !== b[i].closable()\n ) {\n return false;\n }\n }\n return true;\n}\n","import { InjectionToken, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from './tab-group-host.token';\n\n/**\n * Read-mostly panel-surface contract for the overflow molecule, skin\n * sub-components, and future panel-level helpers. \\\n * Narrower than {@link CngxTabGroupHost} - register / unregister stay on the brain.\n *\n * The single write path is `selectById`; routing back through the\n * presenter preserves clamping, disabled-skip, and commit-action\n * gating. Template resolvers let skin sub-components project the\n * `*cngxTabLabel` / `*cngxTabContent` slots without depending on the\n * concrete `CngxTabGroup` class.\n *\n * @category common/tabs\n */\nexport interface CngxTabPanelHost {\n readonly tabs: Signal<readonly CngxTabHandle[]>;\n readonly activeId: Signal<string | null>;\n readonly orientation: Signal<'horizontal' | 'vertical'>;\n\n selectById(id: string): void;\n\n /** Resolves a tab id to its `*cngxTabLabel` template (consumer-supplied). */\n labelTemplateFor(id: string): TemplateRef<unknown> | null;\n /** Resolves a tab id to its `*cngxTabContent` template (consumer-supplied). */\n contentTemplateFor(id: string): TemplateRef<unknown> | null;\n}\n\n/**\n * DI token the organism provides via `useExisting`.\\\n * The overflow molecule and consumer-authored skin sub-components inject this\n * instead of the concrete component class.\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-panel-host.token.ts\n * @since 0.1.0\n */\nexport const CNGX_TAB_PANEL_HOST = new InjectionToken<CngxTabPanelHost>('CngxTabPanelHost');\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot directive marking the per-tab panel-body template. \\\n * Discovered by `<cngx-tab-group>` via `contentChild` on each\n * `CngxTab` and projected into the matching `role=\"tabpanel\"`.\n *\n * ```html\n * <div cngxTab [label]=\"'Settings'\">\n * <ng-template cngxTabContent>\n * <p>Settings panel body…</p>\n * </ng-template>\n * </div>\n * ```\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-content.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTab, CngxTabLabel\n */\n@Directive({\n selector: 'ng-template[cngxTabContent]',\n exportAs: 'cngxTabContent',\n standalone: true,\n})\nexport class CngxTabContent {\n readonly templateRef = inject(TemplateRef<unknown>);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot directive marking the per-tab label template. \\\n * Discovered by `<cngx-tab-group>` via `contentChild` on each\n * `CngxTab` and projected into the tab strip.\n *\n * ```html\n * <div cngxTab id=\"settings\">\n * <ng-template cngxTabLabel>Settings</ng-template>\n * ... tab content ...\n * </div>\n * ```\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-label.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTab, CngxTabContent\n */\n@Directive({\n selector: 'ng-template[cngxTabLabel]',\n exportAs: 'cngxTabLabel',\n standalone: true,\n})\nexport class CngxTabLabel {\n readonly templateRef = inject(TemplateRef<unknown>);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot directive marking a tab's secondary label template. \\\n * Discovered by `<cngx-tab-group>` via `contentChild` on each\n * `CngxTab` and rendered as a stacked second line under the primary\n * label. \\\n *\n * Per-tab content, mirroring `CngxTabLabel` - the convenience\n * `[subLabel]` string input on `CngxTab` covers the plain-text case.\n *\n * ```html\n * <div cngxTab id=\"bookmarks\">\n * <ng-template cngxTabLabel>Bookmarks</ng-template>\n * <ng-template cngxTabSubLabel>45 saved</ng-template>\n * <ng-template cngxTabContent>...</ng-template>\n * </div>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-sub-label.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTab, CngxTabLabel, CngxTabContent\n * <example-url>http://localhost:4200/#/ui/tabs/tab-sub-label/label-with-count</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabSubLabel]',\n exportAs: 'cngxTabSubLabel',\n standalone: true,\n})\nexport class CngxTabSubLabel {\n /**\n * The captured `<ng-template>`, projected by `<cngx-tab-group>` as the\n * tab's secondary label line under the primary label.\n */\n readonly templateRef = inject(TemplateRef<unknown>);\n}\n","import {\n computed,\n contentChild,\n DestroyRef,\n Directive,\n inject,\n input,\n type OnInit,\n type Signal,\n} from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { CngxTabContent } from './tab-content.directive';\nimport { CngxTabLabel } from './tab-label.directive';\nimport { CngxTabSubLabel } from './slots/tab-sub-label.directive';\nimport { CNGX_TAB_GROUP_HOST } from './tab-group-host.token';\n\n/**\n * Single-tab atom. \\\n * Registers with the enclosing presenter via\n * {@link CNGX_TAB_GROUP_HOST} on construction; deregisters via\n * {@link DestroyRef} on teardown. \\\n * The presenter holds the atom's\n * input signals by reference, so input changes propagate without\n * re-registration. \\\n * `labelTemplate` / `contentTemplate` are projected\n * by the organism - the atom carries no rendering logic.\n *\n * ```html\n * <div cngxTab [label]=\"'Settings'\">\n * ... content templates here ...\n * </div>\n * ```\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroupPresenter, CngxTabLabel, CngxTabContent, CngxTabErrorBadge\n */\n@Directive({\n selector: '[cngxTab]',\n exportAs: 'cngxTab',\n standalone: true,\n})\nexport class CngxTab implements OnInit {\n readonly id = input<string>(nextUid('cngx-tab-'));\n readonly disabled = input<boolean>(false);\n readonly label = input<string | undefined>(undefined);\n /**\n * Optional secondary text line under the primary label (a count, a\n * status word, a short detail). Convenience for the common text\n * case, parallel to `[label]`; the `*cngxTabSubLabel` slot covers\n * richer content. Folds into the tab's accessible name.\n */\n readonly subLabel = input<string | undefined>(undefined);\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n\n /**\n * Direct error flag for the common \"this tab is invalid\" case - no\n * `errorAggregator` boilerplate required. `true` or a non-empty string\n * drives the error state; a string doubles as the inline message\n * (surfaced via the `*cngxTabErrorBadge` slot context). `false` / `''`\n * clear it. The aggregator stays the rich multi-source forms path; the\n * two channels compose (either errors). Mirrors `CngxStep.error`.\n */\n readonly error = input<string | boolean>(false);\n\n /**\n * Resolved direct-error message: the `[error]` string when non-empty,\n * else `undefined`. Carried onto the registration handle so the error\n * badge slot can render it. `computed` over the input - never written.\n */\n readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n /**\n * Per-tab error fold driving the badge + SR descriptor. `true` when\n * the direct `[error]` flag is set OR the optional aggregator wants to\n * reveal (`shouldShow()` = `hasError` AND scope reveal-state). The\n * aggregator arm reads `shouldShow`, not `hasError`, so deferred-reveal\n * validation stays silent until revealed - the direct flag has no\n * reveal concept (the consumer sets it when it wants it shown). A\n * boolean, not a status enum: tabs carry no success/completed/disabled\n * model (Pillar 3).\n */\n readonly hasError: Signal<boolean> = computed(\n () => {\n const directError = this.error();\n return (\n (directError !== false && directError !== '') ||\n (this.errorAggregator()?.shouldShow?.() ?? false)\n );\n },\n { equal: Object.is },\n );\n\n /**\n * Per-tab close-affordance override. `undefined` (default) inherits\n * the group-level `[closable]` resolution; set `false` to pin this\n * tab open inside a dismissable group, or `true` to make a single tab\n * closable while the group default is off.\n */\n readonly closable = input<boolean | undefined>(undefined);\n\n readonly labelTemplate = contentChild(CngxTabLabel);\n readonly subLabelTemplate = contentChild(CngxTabSubLabel);\n readonly contentTemplate = contentChild(CngxTabContent);\n\n private readonly host = inject(CNGX_TAB_GROUP_HOST, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n\n /** `true` when the presenter's `activeId` equals this tab's id. */\n readonly selected: Signal<boolean> = computed(() => this.host?.activeId() === this.id(), {\n equal: Object.is,\n });\n\n constructor() {\n if (!this.host) {\n throw new Error(\n 'CngxTab: no enclosing CngxTabGroupPresenter found. Wrap the tab inside an element carrying [cngxTabGroup] (or place it inside <cngx-tab-group>).',\n );\n }\n }\n\n ngOnInit(): void {\n // Register in ngOnInit, NOT the constructor: a dynamically-bound\n // `[id]` (or `[label]`) signal input is not applied until the first\n // change detection, so a constructor read would capture the default\n // auto-id. The handle id is the stable key consumers map `(tabClose)`\n // back to their data with, so it must reflect the bound `[id]`.\n const host = this.host!;\n const tabId = this.id();\n host.register({\n id: tabId,\n label: this.label,\n subLabel: this.subLabel,\n disabled: this.disabled,\n errorAggregator: this.errorAggregator,\n hasError: this.hasError,\n errorMessage: this.errorMessage,\n closable: this.closable,\n });\n this.destroyRef.onDestroy(() => host.unregister(tabId));\n }\n}\n","import {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n type OnInit,\n Renderer2,\n type Signal,\n signal,\n} from '@angular/core';\n\nimport { nextUid } from '@cngx/core/utils';\n\nimport type { CngxErrorAggregatorContract } from '@cngx/common/interactive';\n\nimport { CNGX_TAB_GROUP_HOST, type CngxTabHandle } from './tab-group-host.token';\n\n/**\n * Turns a consumer `<a routerLink>` into a registered {@link CngxTabHandle}\n * inside a {@link CngxTabNav}. \\\n * Native parallel of {@link CngxMatTabLink}: in a\n * navigation bar the link IS the tab, so this per-anchor directive is the\n * registration seam - symmetric with how `CngxTab` registers each `[cngxTab]`.\n *\n * Carries no rendering and no click handler. Navigation is the native\n * `routerLink` (middle-click, open-in-new-tab and the hover URL all work),\n * gating is the link's own `CanDeactivate`, and the active marker comes from\n * the route: `[cngxTabsRouteSync]` on the nav reflects `NavigationEnd` onto the\n * presenter's `activeId`, which this link matches against its own `id`. \\\n * There is no `select()` call - invoking it would re-enter the commit path the\n * routed-nav model deliberately keeps dormant.\n *\n * **Error communication is reactive:** `aria-invalid` plus the\n * `--error` skin glyph signal the state, and an injected screen-reader\n * descriptor span (referenced by a permanent `aria-describedby`) carries the\n * direct `[error]` message string so assistive tech reads *why* the link is\n * invalid.\n *\n * ```html\n * <cngx-tab-nav cngxTabsRouteSync>\n * <a cngxTabLink id=\"overview\" routerLink=\"overview\">Overview</a>\n * <a cngxTabLink id=\"profile\" routerLink=\"profile\" [error]=\"profileInvalid\">Profile</a>\n * </cngx-tab-nav>\n * ```\n *\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tab-link.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabNav, CngxTabsRouteSync, CngxTab, CngxMatTabLink\n */\n@Directive({\n selector: '[cngxTabLink]',\n exportAs: 'cngxTabLink',\n standalone: true,\n host: {\n class: 'cngx-tab-nav__link',\n '[attr.aria-current]': \"selected() ? 'page' : null\",\n '[attr.aria-invalid]': \"hasError() ? 'true' : null\",\n '[attr.aria-describedby]': 'descriptorId()',\n '[class.cngx-tab-nav__link--active]': 'selected()',\n '[class.cngx-tab-nav__link--error]': 'hasError()',\n },\n})\nexport class CngxTabLink implements OnInit {\n private readonly host = inject(CNGX_TAB_GROUP_HOST, { optional: true });\n private readonly destroyRef = inject(DestroyRef);\n private readonly renderer = inject(Renderer2);\n private readonly hostEl = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * Handle id. Set it to the link's route segment so the nav's\n * `[cngxTabsRouteSync]` reflects the active route onto this link via the\n * default `(h) => [h.id]` mapping. Defaults to a fresh uid when route-sync\n * is not used.\n */\n readonly id = input<string>(nextUid('cngx-tab-link-'));\n /** Accessible label fed to the nav's live-region announcer. */\n readonly label = input<string | undefined>(undefined);\n /**\n * Direct error flag for the link - `true` or a non-empty string marks it\n * invalid (the string doubles as the message). Mirrors `CngxTab.error`.\n */\n readonly error = input<string | boolean>(false);\n /** Optional rich error aggregator for the link. */\n readonly errorAggregator = input<CngxErrorAggregatorContract | undefined>(undefined);\n\n /**\n * Resolved direct-error message: the `[error]` string when non-empty, else\n * `undefined`. Carried onto the registration handle by reference.\n * `computed` over the input - never written.\n */\n private readonly errorMessage: Signal<string | undefined> = computed(() => {\n const value = this.error();\n return typeof value === 'string' && value !== '' ? value : undefined;\n });\n\n /**\n * Per-link error fold driving `aria-invalid` and the `--error` class.\n * `true` when the direct `[error]` flag is set OR the optional aggregator\n * wants to reveal (`shouldShow()`, so deferred-reveal validation stays\n * silent until revealed). Mirrors `CngxTab.hasError`.\n */\n protected readonly hasError: Signal<boolean> = computed(\n () => {\n const direct = this.error();\n return (\n (direct !== false && direct !== '') || (this.errorAggregator()?.shouldShow?.() ?? false)\n );\n },\n { equal: Object.is },\n );\n\n /** `true` when the presenter's `activeId` equals this link's id. */\n protected readonly selected: Signal<boolean> = computed(\n () => this.host?.activeId() === this.id(),\n { equal: Object.is },\n );\n\n /**\n * Id of the injected SR error-message descriptor. Always referenced by the\n * `aria-describedby` host binding (Pillar 2 - the id is permanent; the\n * span's content and `aria-hidden` toggle, never the id itself).\n */\n protected readonly descriptorId: Signal<string> = computed(() => `${this.id()}-desc`);\n\n /** The injected descriptor `<span>`, created in {@link ngOnInit}. */\n private descriptorEl: HTMLElement | null = null;\n\n constructor() {\n if (!this.host) {\n throw new Error(\n 'CngxTabLink: no enclosing CngxTabGroupPresenter found. Wrap the link inside <cngx-tab-nav> (or an element carrying [cngxTabGroup]).',\n );\n }\n // Mirror the direct-error message into the describedby span. DOM side\n // effect only - no signal writes. Guards until the span exists (created\n // in ngOnInit); errorMessage / descriptorId changes re-run it after.\n effect(() => {\n const el = this.descriptorEl;\n if (el) {\n this.syncDescriptor(el);\n }\n });\n }\n\n ngOnInit(): void {\n // Register in ngOnInit, NOT the constructor: a dynamically-bound `[id]`\n // signal input is not applied until the first change detection, so a\n // constructor read would capture the default auto-id. The handle id is the\n // stable key the nav's route-sync matches the URL segment against.\n const host = this.host!;\n const handle: CngxTabHandle = {\n id: this.id(),\n label: this.label,\n subLabel: signal(undefined),\n disabled: signal(false),\n errorAggregator: this.errorAggregator,\n hasError: this.hasError,\n errorMessage: this.errorMessage,\n closable: signal(undefined),\n };\n host.register(handle);\n\n // Inject the SR error-message descriptor as a SIBLING of the anchor: a\n // child span would fold into the link's accessible name, so it lives\n // beside it and is reached only via the aria-describedby id.\n const descriptor = this.renderer.createElement('span') as HTMLElement;\n this.renderer.addClass(descriptor, 'cngx-sr-only');\n const parent = this.renderer.parentNode(this.hostEl) as HTMLElement | null;\n if (parent) {\n this.renderer.insertBefore(parent, descriptor, this.renderer.nextSibling(this.hostEl));\n }\n this.descriptorEl = descriptor;\n this.syncDescriptor(descriptor);\n\n this.destroyRef.onDestroy(() => {\n host.unregister(handle.id);\n if (parent) {\n this.renderer.removeChild(parent, descriptor);\n }\n });\n }\n\n /**\n * Write the current direct-error message into the descriptor span and\n * toggle its `aria-hidden` so a clear link exposes no description. Keeps\n * the span id in sync with {@link descriptorId} (read here so the effect\n * tracks an id change too).\n */\n private syncDescriptor(el: HTMLElement): void {\n this.renderer.setAttribute(el, 'id', this.descriptorId());\n const message = this.errorMessage() ?? '';\n this.renderer.setProperty(el, 'textContent', message);\n if (message) {\n this.renderer.removeAttribute(el, 'aria-hidden');\n } else {\n this.renderer.setAttribute(el, 'aria-hidden', 'true');\n }\n }\n}\n","/**\n * Single dev-warning both tab sync directives emit when `@angular/router`\n * is not provided. Shared so the message stays identical across\n * {@link CngxTabsFragmentSync} (deep-linking) and {@link CngxTabsRouteSync}\n * (router-outlet); only the `enables` clause differs. The URL readers\n * themselves stay separate - they target different surfaces (fragment /\n * query-param vs route path) and must not converge.\n *\n * @internal\n */\nexport function warnTabsRouterAbsent(directive: string, enables: string): void {\n console.warn(\n `${directive}: no Router available - directive is a no-op. ` +\n `Provide @angular/router via provideRouter(...) to enable ${enables}.`,\n );\n}\n","import {\n afterNextRender,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n untracked,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nimport { warnTabsRouterAbsent } from './router-absent-warning';\nimport { CNGX_TAB_GROUP_HOST } from './tab-group-host.token';\n\n/**\n * URL deep-linking for tab groups. \\\n * Bidirectional sync between `activeId` and a URL fragment or query-param. Opt-in via\n * `[cngxTabsFragmentSync]` on the presenter element.\n *\n * - `mode = 'fragment'` (default) → `#tab=settings`\n * - `mode = 'queryParam'` with `paramName = 'tab'` → `?tab=settings`\n *\n * `Router` is optional - without it the directive logs a dev warning\n * via `afterNextRender` and becomes a no-op. \\\n * Every `router.navigate` and `host.selectById` inside the effects sits in `untracked()`.\n *\n * ```html\n * <!-- Default fragment mode: the active tab reflects to #tab=<id>, and a\n * deep link like /account#tab=settings selects that tab on load. -->\n * <cngx-tab-group cngxTabsFragmentSync>\n * <div cngxTab id=\"overview\" label=\"Overview\"></div>\n * <div cngxTab id=\"settings\" label=\"Settings\"></div>\n * </cngx-tab-group>\n *\n * <!-- Query-param mode with a custom name -> ?section=settings -->\n * <cngx-tab-group cngxTabsFragmentSync mode=\"queryParam\" paramName=\"section\">\n * <!-- ...tabs... -->\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/router-sync.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroupPresenter, CngxTab\n */\n@Directive({\n selector: '[cngxTabsFragmentSync]',\n exportAs: 'cngxTabsFragmentSync',\n standalone: true,\n})\nexport class CngxTabsFragmentSync {\n readonly mode = input<'fragment' | 'queryParam'>('fragment');\n readonly paramName = input<string>('tab');\n\n private readonly host = inject(CNGX_TAB_GROUP_HOST, { host: true });\n private readonly router = inject(Router, { optional: true });\n\n constructor() {\n if (!this.router) {\n afterNextRender(() => warnTabsRouterAbsent('CngxTabsFragmentSync', 'deep-linking'));\n return;\n }\n const router = this.router;\n const destroyRef = inject(DestroyRef);\n\n afterNextRender(() => {\n const initial = this.readUrlValue(router);\n if (initial) {\n untracked(() => this.host.selectById(initial));\n }\n });\n\n effect(() => {\n const id = this.host.activeId();\n if (!id) {\n return;\n }\n untracked(() => {\n const navigation =\n this.mode() === 'fragment'\n ? router.navigate([], {\n fragment: `${this.paramName()}=${id}`,\n queryParamsHandling: 'merge',\n replaceUrl: true,\n })\n : router.navigate([], {\n queryParams: { [this.paramName()]: id },\n queryParamsHandling: 'merge',\n replaceUrl: true,\n });\n // Router rejection (e.g. cancelled navigation) has no recovery path.\n navigation.catch?.(() => undefined);\n });\n });\n\n const navEnd = toSignal(\n router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n takeUntilDestroyed(destroyRef),\n ),\n { initialValue: null },\n );\n effect(() => {\n const e = navEnd();\n if (!e) {\n return;\n }\n untracked(() => {\n const next = this.readUrlValue(router);\n if (next && next !== this.host.activeId()) {\n this.host.selectById(next);\n }\n });\n });\n }\n\n private readUrlValue(router: Router): string | null {\n if (this.mode() === 'fragment') {\n const fragment = router.routerState.snapshot.root.fragment ?? '';\n return this.parseFragment(fragment);\n }\n return router.routerState.snapshot.root.queryParamMap.get(this.paramName()) ?? null;\n }\n\n private parseFragment(fragment: string): string | null {\n const param = this.paramName();\n const segments = fragment.split('&');\n for (const seg of segments) {\n const [key, val] = seg.split('=');\n if (key === param && val) {\n return val;\n }\n }\n return null;\n }\n}\n","import { Observable } from 'rxjs';\nimport { NavigationCancel, NavigationEnd, NavigationError, type Router } from '@angular/router';\nimport { filter, take } from 'rxjs/operators';\n\nimport type { CngxTabsCommitAction } from './presenter.directive';\nimport type { CngxTabHandle } from './tab-group-host.token';\n\n/**\n * Options for {@link createTabRouterCommit}.\n *\n * `tabs` is the presenter's live handle list - the action receives the\n * target *index*, so it needs the registry to resolve the matching\n * {@link CngxTabHandle} before computing its route. `[cngxTabsRouteSync]`\n * passes the host's `tabs` signal straight through.\n *\n * @category common/tabs\n */\nexport interface CngxTabRouterCommitOptions {\n readonly router: Router;\n readonly tabs: () => readonly CngxTabHandle[];\n /**\n * Maps a tab handle to its router command array. Default\n * `(handle) => [handle.id]` - the tab id is the child segment.\n * Override for real route paths (`(h) => ['settings', h.id]`).\n */\n readonly routeFor?: (handle: CngxTabHandle) => unknown[];\n}\n\n/**\n * Default tab-to-route mapping: the tab id is the child segment.\n * Shared so the factory and `[cngxTabsRouteSync]` reference one\n * definition instead of inlining the closure twice.\n *\n * @internal\n */\nexport const cngxDefaultTabRoute = (handle: CngxTabHandle): unknown[] => [handle.id];\n\n/**\n * Builds a {@link CngxTabsCommitAction} that gates a tab switch through\n * `@angular/router`. The action navigates to the target tab's route and\n * resolves on the router's own outcome:\n *\n * - `NavigationEnd` → `true` (commit the switch)\n * - `NavigationCancel` (a `CanDeactivate` guard blocked) → `false`\n * - `NavigationError` (guard/resolver threw) → `false`\n *\n * Routed tabs reuse the presenter's commit lifecycle verbatim - the\n * router navigation is simply the async op. \\\n * In pessimistic mode the active tab follows the *resolved* route, so a cancelled guard keeps\n * the old tab with zero extra gate machinery. The events subscription\n * is opened *before* `navigate(...)` so a synchronously-resolving\n * navigation cannot emit before the action is listening; the commit\n * controller's `cancel()` unsubscribes on supersede.\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/router-commit.ts\n * @since 0.1.0\n */\nexport function createTabRouterCommit(opts: CngxTabRouterCommitOptions): CngxTabsCommitAction {\n const routeFor = opts.routeFor ?? cngxDefaultTabRoute;\n return (_fromIndex, toIndex) =>\n new Observable<boolean>((subscriber) => {\n const target = opts.tabs()[toIndex];\n if (!target) {\n subscriber.next(false);\n subscriber.complete();\n return;\n }\n const sub = opts.router.events\n .pipe(\n filter(\n (e): e is NavigationEnd | NavigationCancel | NavigationError =>\n e instanceof NavigationEnd ||\n e instanceof NavigationCancel ||\n e instanceof NavigationError,\n ),\n take(1),\n )\n .subscribe((event) => {\n subscriber.next(event instanceof NavigationEnd);\n subscriber.complete();\n });\n // A rejected promise surfaces on the events stream as\n // NavigationError, so the subscription above is the single\n // resolution path; swallow the promise rejection to avoid an\n // unhandled-rejection warning.\n opts.router.navigate(routeFor(target)).catch(() => undefined);\n return () => sub.unsubscribe();\n });\n}\n","import {\n afterNextRender,\n computed,\n DestroyRef,\n Directive,\n effect,\n inject,\n input,\n signal,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { NavigationEnd, Router } from '@angular/router';\nimport { filter } from 'rxjs/operators';\n\nimport { CNGX_TABS_COMMIT_ACTION, type CngxTabsCommitActionSource } from './commit-action.token';\nimport { cngxDefaultTabRoute, createTabRouterCommit } from './router-commit';\nimport { warnTabsRouterAbsent } from './router-absent-warning';\nimport { CNGX_TAB_GROUP_HOST, type CngxTabHandle } from './tab-group-host.token';\nimport type { CngxTabsCommitAction } from './presenter.directive';\n\n/**\n * Router-outlet integration for tab groups. \\\n * Opt-in via `[cngxTabsRouteSync]` on the presenter element. Each tab is an\n * Angular child route whose component renders into a `<router-outlet>`;\n * switching tabs navigates, and a `CanDeactivate` guard can gate the\n * leave.\n *\n * Supplies the presenter's commit-action through the\n * {@link CNGX_TABS_COMMIT_ACTION} DI fallback (no consumer\n * `[commitAction]` hand-binding) and pins **pessimistic** mode so the\n * active tab follows the *resolved* route - a guard-cancelled switch\n * keeps the old tab. The routing gate reuses the presenter's commit\n * lifecycle verbatim; the router navigation is the async op.\n *\n * Seeds the active tab from the current URL on mount and reflects\n * external navigations (back/forward, direct URL) into `activeIndex`\n * *without* re-navigating - those writes bypass the commit-action,\n * since the router is already at the resolved route.\n *\n * `Router` is optional - without it the directive logs a single dev\n * warning via `afterNextRender`, exposes a null action, and becomes a\n * no-op. Mirrors {@link CngxTabsFragmentSync}; every `activeIndex`\n * write inside an effect sits in `untracked()`.\n *\n * **The mental model.** It turns the tab group into the router's view\n * switcher: the tabs choose *which child route* renders in the\n * `<router-outlet>`, not which inline template shows. \\\n * Concretely, a Settings page with Profile / Security / Billing tabs then gets, for\n * free: each tab its own URL (`/settings/profile`) so a refresh or a\n * shared link stays on the tab; browser back/forward between tabs;\n * `Billing` lazy-loading its chunk only when first opened; and `Profile`\n * blocking the switch via a `CanDeactivate` guard while its form is\n * dirty - all while keeping the `role=\"tab\"` keyboard and ARIA model.\n *\n * **Use it when** each tab's content is a real Angular route - a lazy\n * chunk, a resolver, or a `CanActivate` / `CanDeactivate` guard -\n * rendered into a `<router-outlet>`, and you want browser back/forward\n * and deep links to move between tabs while the route's own guard gates\n * the switch (e.g. an unsaved-changes prompt on leave). \\\n * If the tabs are purely visual, use a plain `<cngx-tab-group>` with no sync directive;\n * if you only want the active tab reflected in the URL while content\n * stays inline, use {@link CngxTabsFragmentSync}.\n *\n * **What this is not.** \\\n * Not a per-tab `routerLink`: \\\n * the tabs stay `role=\"tab\"` buttons and the directive drives `router.navigate`\n * centrally through the commit lifecycle, so there are no anchors, no\n * `href`, and no native open-in-new-tab / middle-click / copy-link. \\\n * For real link semantics (right-click, ctrl-click) reach for the CNGX\n * `<cngx-tab-nav>` and `<a cngx-tab-link routerLink>` variant\n * instead. \\\n * Not URL deep-linking either - that is {@link CngxTabsFragmentSync} (a `#tab=` fragment or `?tab=`\n * query-param); this directive renders child route *components* into a\n * `<router-outlet>`. \\\n * And not optimistic: the active tab moves only once\n * the route resolves, so a `CanDeactivate` guard can cancel the switch.\n *\n * ```ts\n * // Each tab is a child route; the editor guards its own exit.\n * const ROUTES: Routes = [\n * { path: '', pathMatch: 'full', redirectTo: 'editor' },\n * { path: 'editor', component: EditorPage, canDeactivate: [unsavedChangesGuard] },\n * { path: 'preview', component: PreviewPage },\n * { path: 'settings', component: SettingsPage },\n * ];\n * ```\n *\n * ```html\n * <!-- Tab ids match the child segments (default routeFor = (h) => [h.id]).\n * Switching a tab navigates; the guard gates leaving the editor;\n * back/forward and /account/settings deep links move the active tab. -->\n * <cngx-tab-group cngxTabsRouteSync aria-label=\"Account\">\n * <div cngxTab id=\"editor\" label=\"Editor\"></div>\n * <div cngxTab id=\"preview\" label=\"Preview\"></div>\n * <div cngxTab id=\"settings\" label=\"Settings\"></div>\n * </cngx-tab-group>\n *\n * <!-- The active tab's routed component renders here. -->\n * <router-outlet></router-outlet>\n * ```\n *\n * @category common/tabs\n * @docsKind primary\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/route-sync.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroupPresenter, CngxTabsFragmentSync, createTabRouterCommit, CngxTabNav, CngxTabLink\n */\n@Directive({\n selector: '[cngxTabsRouteSync]',\n exportAs: 'cngxTabsRouteSync',\n standalone: true,\n providers: [{ provide: CNGX_TABS_COMMIT_ACTION, useExisting: CngxTabsRouteSync }],\n})\nexport class CngxTabsRouteSync implements CngxTabsCommitActionSource {\n /**\n * Maps a tab handle to its router command array. Default\n * `(handle) => [handle.id]` - the tab id is the child segment.\n * Override for real route paths.\n */\n readonly routeFor = input<(handle: CngxTabHandle) => unknown[]>(cngxDefaultTabRoute);\n\n private readonly host = inject(CNGX_TAB_GROUP_HOST, { host: true });\n private readonly router = inject(Router, { optional: true });\n\n /**\n * Pessimistic-only - not exposed as an input. The route-sync owns the\n * mode so optimistic (show-then-revert) can never flash the target\n * tab before a `CanDeactivate` guard decides.\n */\n readonly mode: Signal<'optimistic' | 'pessimistic'> = signal('pessimistic');\n\n /**\n * Router commit-action read by the presenter via the DI fallback.\n * `null` when no `Router` is available (graceful no-op). Rebuilt only\n * when `routeFor` changes; the navigation gate itself is the async\n * op inside the action.\n */\n readonly action: Signal<CngxTabsCommitAction | null> = computed(() => {\n const router = this.router;\n if (!router) {\n return null;\n }\n return createTabRouterCommit({\n router,\n tabs: this.host.tabs,\n routeFor: this.routeFor(),\n });\n });\n\n constructor() {\n if (!this.router) {\n afterNextRender(() => warnTabsRouterAbsent('CngxTabsRouteSync', 'routed tabs'));\n return;\n }\n const router = this.router;\n const destroyRef = inject(DestroyRef);\n\n // Seed from the current URL once the registry has populated.\n afterNextRender(() => {\n untracked(() => this.reflectFromUrl(router));\n });\n\n const navEnd = toSignal(\n router.events.pipe(\n filter((e): e is NavigationEnd => e instanceof NavigationEnd),\n takeUntilDestroyed(destroyRef),\n ),\n { initialValue: null },\n );\n effect(() => {\n const e = navEnd();\n if (!e) {\n return;\n }\n untracked(() => this.reflectFromUrl(router));\n });\n }\n\n /**\n * Mirror the URL's active tab onto `activeIndex` without navigating.\n * Writing the index directly (not via `select()`) is the re-entry\n * guard: `select()` would re-run the commit-action and navigate to\n * the route the router is already on, leaving the commit pending\n * forever.\n */\n private reflectFromUrl(router: Router): void {\n const next = this.readActiveId(router);\n if (!next || next === this.host.activeId()) {\n return;\n }\n const index = this.host.tabs().findIndex((t) => t.id === next);\n if (index >= 0) {\n this.host.activeIndex.set(index);\n }\n }\n\n /**\n * Find the tab whose route is the trailing segment(s) of the current\n * URL path. Anchors on position (a suffix match), not a loose\n * \"appears anywhere\" scan - a tab id that happens to equal an\n * unrelated parent segment cannot win. The path is taken before any\n * query/fragment. If two tabs produce the same trailing segment(s)\n * (only possible with a custom `routeFor` that collides), the first\n * registered tab wins - the default id-based mapping never collides.\n */\n private readActiveId(router: Router): string | null {\n const path = router.url.split(/[?#]/)[0];\n const segments = path.split('/').filter(Boolean);\n const routeFor = this.routeFor();\n for (const tab of this.host.tabs()) {\n const route = routeFor(tab).map((command) => String(command));\n if (route.length === 0 || route.length > segments.length) {\n continue;\n }\n const tail = segments.slice(-route.length);\n if (tail.every((segment, i) => segment === route[i])) {\n return tab.id;\n }\n }\n return null;\n }\n}\n","import {\n type EnvironmentProviders,\n inject,\n InjectionToken,\n makeEnvironmentProviders,\n type Provider,\n type TemplateRef,\n} from '@angular/core';\n\nimport type { CngxTabOverflowItemContext } from './overflow/tab-overflow-item.directive';\nimport type { CngxTabOverflowTriggerContext } from './overflow/tab-overflow-trigger.directive';\nimport type { CngxTabBusySpinnerContext } from './slots/tab-busy-spinner.directive';\nimport type { CngxTabCloseIconContext } from './slots/tab-close-icon.directive';\nimport type { CngxTabErrorBadgeContext } from './slots/tab-error-badge.directive';\nimport type { CngxTabIconContext } from './slots/tab-icon.directive';\nimport type { CngxTabRejectionIconContext } from './slots/tab-rejection-icon.directive';\n\n/**\n * Aria-label overrides for the tab-group landmark region. \\\n * Library defaults are English; consumers override via\n * {@link withTabsAriaLabels}.\n *\n * Per-tab nav phrasing (`previousTab`, `nextTab`) lives in\n * {@link CngxTabsI18n}, not here - landmark naming and SR phrasing\n * stay on separate override paths.\n *\n * @category common/tabs\n */\nexport interface CngxTabsAriaLabels {\n /**\n * Accessible name for the tab-group wrapper (`role=\"group\"`), read by\n * AT when focus enters the region. Default `'Tabs'`. Ignored when a\n * per-instance `[aria-label]` / `[aria-labelledby]` is bound (those\n * win).\n */\n readonly tabsRegion?: string;\n}\n\n/**\n * Fallback labels for derived strings (role descriptions, badge SR\n * announcements). Library defaults are English; consumers override\n * per locale.\n *\n * @category common/tabs\n */\nexport interface CngxTabsFallbackLabels {\n /**\n * `aria-roledescription` for the tablist. Default `'tab list'` (the\n * W3C ARIA convention) - kept distinct from the region `aria-label`\n * so AT does not read the same word twice back-to-back.\n */\n readonly tabRoleDescription?: string;\n /**\n * `aria-roledescription` for each tab panel. Default `'tab panel'`.\n */\n readonly tabPanelRoleDescription?: string;\n}\n\n/**\n * App-wide template overrides for `<cngx-tab-group>` and\n * `<cngx-tab-overflow>` skin regions. \\\n * Middle tier of the 3-stage cascade -\n * per-instance directive > this field > built-in markup. \\\n * Apply via the matching `with*Template` builders. Shape mirrors\n * `CngxStepperTemplates` so consumer templates port across\n * families.\n *\n * @category common/tabs\n */\nexport interface CngxTabsTemplates {\n /** Default for the overflow \"More\" button label (`*cngxTabOverflowTrigger`). */\n readonly overflowTrigger?: TemplateRef<CngxTabOverflowTriggerContext>;\n /** Default for each row inside the overflow popover (`*cngxTabOverflowItem`). */\n readonly overflowItem?: TemplateRef<CngxTabOverflowItemContext>;\n /** Default for the per-tab error badge (`*cngxTabErrorBadge`). */\n readonly errorBadge?: TemplateRef<CngxTabErrorBadgeContext>;\n /** Default for the per-tab rejection decoration (`*cngxTabRejectionIcon`). */\n readonly rejectionIcon?: TemplateRef<CngxTabRejectionIconContext>;\n /** Default for the commit-pending busy spinner (`*cngxTabBusySpinner`). */\n readonly busySpinner?: TemplateRef<CngxTabBusySpinnerContext>;\n /** Default for the per-tab icon ahead of the label (`*cngxTabIcon`). */\n readonly icon?: TemplateRef<CngxTabIconContext>;\n /** Default for a tab's close-button glyph (`*cngxTabCloseIcon`). */\n readonly closeIcon?: TemplateRef<CngxTabCloseIconContext>;\n /** Default for the add-tab button glyph (`*cngxTabAddIcon`). */\n readonly addIcon?: TemplateRef<void>;\n}\n\n/**\n * Selectable visual skin for `<cngx-tab-group>`. \\\n * The skin is a pure thematic concern - every value renders the same `tablist` / `tab` /\n * `tabpanel` structure, slots, ARIA, and keyboard behaviour, and only\n * redirects CSS via the `[data-skin]` host attribute. `'line'`\n * (default) is the underline indicator; `'contained'` fuses the active\n * tab with the panel surface; `'segmented'` sits the tabs in a muted\n * track and lifts the active tab onto a raised surface; `'pill'`\n * renders rounded solid fills; `'pill-outline'` renders the same pill\n * geometry with a tinted, outlined active state instead of a solid\n * fill.\n *\n * Sized to the tab use cases - not a 1:1 copy of the stepper's\n * seven skins. The Material twin (`[cngxMatTabs]`) ignores this setting.\n *\n * @category common/tabs\n */\nexport type CngxTabsSkin = 'line' | 'contained' | 'segmented' | 'pill' | 'pill-outline';\n\n/**\n * Icon-layout axis for `<cngx-tab-group>`, orthogonal to both skin and\n * orientation. \\\n * Positions the `*cngxTabIcon` slot relative to the tab\n * label: `'start'` (default) places the icon before the label in a row;\n * `'end'` places it after the label in a row; `'top'` stacks the icon\n * above the label in a column; `'only'` hides the label visually while\n * keeping it in the DOM as the accessible name.\n *\n * Redirected purely via\n * the `[data-icon-layout]` host attribute.\n *\n * @category common/tabs\n */\nexport type CngxTabIconLayout = 'start' | 'end' | 'top' | 'only';\n\n/**\n * Panel render strategy for `<cngx-tab-group>`. \\\n * The panel `<div>` (the `aria-controls` target) always stays in the DOM; only its content is\n * rendered per mode. `'eager'` (default) renders every panel's content\n * up front and toggles visibility via `[hidden]` - today's behaviour,\n * byte-identical. `'lazy'` renders a panel's content the first time it\n * is activated and keeps it (keep-alive). `'lazy-destroy'` renders only\n * the active panel's content and destroys it on leave.\n *\n * @category common/tabs\n */\nexport type CngxTabsPanelMode = 'eager' | 'lazy' | 'lazy-destroy';\n\n/**\n * Horizontal alignment of the tab cluster along the strip, set via the\n * `[tabAlign]` Input and reflected onto `[data-tab-align]`. `'start'`\n * (default), `'center'`, or `'end'`. Horizontal only - ignored under\n * `orientation=\"vertical\"` (tabs fill the column) and when `[fitted]`\n * stretches them to the full width.\n *\n * @category common/tabs\n */\nexport type CngxTabAlign = 'start' | 'center' | 'end';\n\n/**\n * Tab-group config surface. Resolution priority: \\\n * per-instance Input → `provideTabsConfigAt` (viewProviders) → `provideTabsConfig`\n * (root) → library default.\n *\n * @category common/tabs\n */\nexport interface CngxTabsConfig {\n /**\n * App-wide default tablist orientation. Default `'horizontal'`\n * (left-to-right strip with arrow-left/right navigation);\n * `'vertical'` stacks the tabs in a column with arrow-up/down.\n * Per-instance `[orientation]` Input still wins. Override via\n * {@link withTabsDefaultOrientation}.\n */\n readonly defaultOrientation?: 'horizontal' | 'vertical';\n /**\n * App-wide default for whether roving-tabindex navigation wraps from\n * the last tab back to the first (and vice versa). Default `true`.\n * Per-instance `[loop]` Input still wins. Override via\n * {@link withTabsRovingLoop}.\n */\n readonly defaultLoop?: boolean;\n /**\n * App-wide default commit mode for async tab transitions.\n * `'optimistic'` (default) activates the target tab on action\n * dispatch and rolls back on error; `'pessimistic'` keeps the old tab\n * until the action resolves. Per-instance `[commitMode]` Input still\n * wins (and `[cngxTabsRouteSync]` pins pessimistic regardless).\n * Override via {@link withTabsCommitMode}.\n */\n readonly defaultCommitMode?: 'optimistic' | 'pessimistic';\n /**\n * URL surface for {@link CngxTabsFragmentSync} deep-linking:\n * `'fragment'` (default) writes `#tab=<id>`, `'queryParam'` writes\n * `?tab=<id>`. Has no effect unless the directive is applied. Not the\n * router-outlet integration (`[cngxTabsRouteSync]`). Override via\n * {@link withTabsFragmentSync}.\n */\n readonly fragmentSyncMode?: 'fragment' | 'queryParam';\n /**\n * Key name for the fragment / query-param deep-link written by\n * {@link CngxTabsFragmentSync}. Default `'tab'` (e.g. `#tab=settings`).\n * Override via {@link withTabsFragmentSync}.\n */\n readonly fragmentSyncParam?: string;\n /**\n * App-wide default visual skin. \\\n * Default `'line'`. Per-instance\n * `[skin]` Input still wins; the cascade default itself lives in\n * `createTabsHostAttrs`, not here (mirrors the stepper). Override via\n * {@link withTabsSkin}.\n */\n readonly skin?: CngxTabsSkin;\n /**\n * App-wide default icon layout. \\\n * Default `'start'`. Per-instance\n * `[iconLayout]` Input still wins; the cascade default lives in\n * `createTabsHostAttrs`. Override via {@link withTabsIconLayout}.\n */\n readonly iconLayout?: CngxTabIconLayout;\n /**\n * App-wide default panel render strategy. Default `'eager'`.\n * Per-instance `[panelMode]` Input still wins; the cascade default\n * lives in `createTabsHostAttrs`. Override via\n * {@link withTabsPanelMode}.\n */\n readonly panelMode?: CngxTabsPanelMode;\n /**\n * App-wide default for stretching tabs to the full strip width\n * (horizontal only). Default `false`. Per-instance `[fitted]` Input\n * wins; the cascade default lives in `createTabsHostAttrs`. Override\n * via {@link withTabsFitted}.\n */\n readonly fitted?: boolean;\n /**\n * App-wide default tab-cluster alignment (horizontal only). Default\n * `'start'`. Per-instance `[tabAlign]` Input wins; the cascade default\n * lives in `createTabsHostAttrs`. Override via {@link withTabsAlign}.\n */\n readonly tabAlign?: CngxTabAlign;\n /**\n * App-wide default for whether tabs render a close affordance.\n * Default `false`. Per-instance `[closable]` Input wins, and a\n * per-`CngxTab` `[closable]` override wins over both. The cascade\n * default lives in the organism. Override via {@link withTabsClosable}.\n */\n readonly closable?: boolean;\n /**\n * App-wide default for whether the group renders an add-tab button.\n * Default `false`. Per-instance `[addable]` Input wins. Override via\n * {@link withTabsAddable}.\n */\n readonly addable?: boolean;\n readonly ariaLabels?: CngxTabsAriaLabels;\n readonly fallbackLabels?: CngxTabsFallbackLabels;\n /**\n * Quiescence window (ms) for the overflow IO debounce. Burst\n * emissions during strip animations collapse to one write; the\n * More counter re-renders once IO has been quiet this long.\n * Default 100ms. Capped by {@link overflowMaxDeferMs}.\n */\n readonly overflowStabilizeMs?: number;\n /**\n * Hard ceiling (ms) on commit deferral while IO bursts keep\n * arriving - without it, sustained churn (momentum scroll,\n * continuous resize) would clear the stabilize timer forever and\n * the More counter would freeze on a stale value. Default 250ms.\n */\n readonly overflowMaxDeferMs?: number;\n /**\n * App-wide template overrides for `<cngx-tab-overflow>` regions. \\\n * Middle tier of the family-standard 3-stage cascade. See\n * {@link CngxTabsTemplates}.\n */\n readonly templates?: CngxTabsTemplates;\n}\n\nconst TABS_CONFIG_DEFAULTS: Required<\n Omit<\n CngxTabsConfig,\n | 'ariaLabels'\n | 'fallbackLabels'\n | 'templates'\n | 'skin'\n | 'iconLayout'\n | 'panelMode'\n | 'fitted'\n | 'tabAlign'\n | 'closable'\n | 'addable'\n >\n> & {\n ariaLabels: CngxTabsAriaLabels;\n fallbackLabels: CngxTabsFallbackLabels;\n templates: CngxTabsTemplates;\n} = {\n defaultOrientation: 'horizontal',\n defaultLoop: true,\n defaultCommitMode: 'optimistic',\n fragmentSyncMode: 'fragment',\n fragmentSyncParam: 'tab',\n ariaLabels: {\n tabsRegion: 'Tabs',\n },\n fallbackLabels: {\n // W3C ARIA tablist convention - kept distinct from\n // `i18n.tabsLabel` so AT doesn't read the same string twice\n // back-to-back across `aria-roledescription` and `aria-label`.\n tabRoleDescription: 'tab list',\n tabPanelRoleDescription: 'tab panel',\n },\n overflowStabilizeMs: 100,\n overflowMaxDeferMs: 250,\n templates: {},\n};\n\n/**\n * DI token for the resolved tabs config. \\\n * `providedIn: 'root'` with the library defaults; override via {@link provideTabsConfig}\n * (root) or {@link provideTabsConfigAt} (component scope).\n *\n * @category common/tabs\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/tabs-config.ts\n * @since 0.1.0\n */\nexport const CNGX_TABS_CONFIG = new InjectionToken<CngxTabsConfig>('CngxTabsConfig', {\n providedIn: 'root',\n factory: () => TABS_CONFIG_DEFAULTS,\n});\n\n/**\n * Feature signature for `with*` config builders. \\\n * The hidden `_target` discriminator lets {@link provideCngxTabs} dispatch\n * config features to {@link provideTabsConfig} while i18n features\n * route to {@link provideTabsI18n}.\n *\n * @category common/tabs\n */\nexport type CngxTabsConfigFeature = ((config: CngxTabsConfig) => CngxTabsConfig) & {\n readonly _target: 'config';\n};\n\n/**\n * Internal helper that brands a config-mutator function with the\n * `_target` discriminator. \\\n * Every `with*` config feature returns one\n * of these.\n *\n * @internal\n */\nfunction defineTabsConfigFeature(\n fn: (config: CngxTabsConfig) => CngxTabsConfig,\n): CngxTabsConfigFeature {\n return Object.assign(fn, { _target: 'config' as const });\n}\n\n/**\n * Override the default orientation. Per-instance `[orientation]`\n * still wins; this changes the cascade default only.\n *\n * @category common/tabs\n */\nexport function withTabsDefaultOrientation(\n orientation: 'horizontal' | 'vertical',\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n defaultOrientation: orientation,\n }));\n}\n\n/**\n * @deprecated Use {@link withTabsDefaultOrientation}. The unprefixed name\n * collides with the stepper family's identical symbol when both libs\n * are auto-imported. The alias stays for one minor release before\n * removal.\n *\n * @category common/tabs\n */\nexport const withDefaultOrientation = withTabsDefaultOrientation;\n\n/**\n * Override whether roving-tabindex navigation loops from last back to\n * first (and vice versa). Per-instance `[loop]` Input still wins.\n *\n * @category common/tabs\n */\nexport function withTabsRovingLoop(loop: boolean): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, defaultLoop: loop }));\n}\n\n/**\n * Override the default commit mode for async tab transitions.\n * `'optimistic'` activates the tab on action dispatch and rolls back\n * on error; `'pessimistic'` waits for success. Per-instance\n * `[commitMode]` Input still wins.\n *\n * @category common/tabs\n */\nexport function withTabsCommitMode(mode: 'optimistic' | 'pessimistic'): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n defaultCommitMode: mode,\n }));\n}\n\n/**\n * Configure URL fragment / query-param deep-linking for the active tab\n * (the {@link CngxTabsFragmentSync} directive). \\\n * `mode` chooses the URL surface (URL fragment or query parameter); `param` names the key\n * (default `'tab'`).\n *\n * Not to be confused with `[cngxTabsRouteSync]`, the router-outlet\n * integration - this feature configures fragment deep-linking only.\n *\n * @category common/tabs\n */\nexport function withTabsFragmentSync(\n mode: 'fragment' | 'queryParam',\n param = 'tab',\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n fragmentSyncMode: mode,\n fragmentSyncParam: param,\n }));\n}\n\n/**\n * @deprecated Use {@link withTabsFragmentSync}. \"Router sync\" collided\n * with the new `[cngxTabsRouteSync]` router-outlet directive; this\n * feature only ever configured fragment / query-param deep-linking. The\n * alias stays for one minor release before removal.\n *\n * @category common/tabs\n */\nexport const withTabsRouterSync = withTabsFragmentSync;\n\n/**\n * Select the app-wide default visual skin for `<cngx-tab-group>`. \\\n * Default `'line'`. Per-instance `[skin]` Input still wins; this moves\n * the cascade default. Structure, slots, ARIA, and keyboard behaviour\n * are identical across skins - only the `[data-skin]` host attribute\n * changes the CSS layer. The Material twin (`[cngxMatTabs]`) ignores it.\n *\n * @category common/tabs\n */\nexport function withTabsSkin(skin: CngxTabsSkin): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, skin }));\n}\n\n/**\n * Set the app-wide default icon layout for `<cngx-tab-group>`. \\\n * Default`'start'`. Per-instance `[iconLayout]` Input still wins. Orthogonal to\n * skin and orientation - only the `[data-icon-layout]` host attribute\n * changes.\n *\n * @category common/tabs\n */\nexport function withTabsIconLayout(layout: CngxTabIconLayout): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, iconLayout: layout }));\n}\n\n/**\n * Set the app-wide default panel render strategy for `<cngx-tab-group>`. \\\n * Default `'eager'` (every panel's content rendered up front, toggled\n * via `[hidden]`). `'lazy'` keep-alives content after first activation;\n * `'lazy-destroy'` renders only the active panel's content. Per-instance\n * `[panelMode]` Input still wins. The panel `<div>` always stays in the\n * DOM regardless of mode (the `aria-controls` target).\n *\n * @category common/tabs\n */\nexport function withTabsPanelMode(mode: CngxTabsPanelMode): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, panelMode: mode }));\n}\n\n/**\n * Set the app-wide default for stretching tabs to the full strip width\n * (horizontal only). \\\n * Default `false`. Per-instance `[fitted]` Input still\n * wins. No effect under `orientation=\"vertical\"`.\n *\n * @category common/tabs\n */\nexport function withTabsFitted(fitted: boolean): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, fitted }));\n}\n\n/**\n * Set the app-wide default tab-cluster alignment (horizontal only). \\\n * Default `'start'`. Per-instance `[tabAlign]` Input still wins. Ignored\n * under `orientation=\"vertical\"` and when the group is `fitted`.\n *\n * @category common/tabs\n */\nexport function withTabsAlign(align: CngxTabAlign): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, tabAlign: align }));\n}\n\n/**\n * Set the app-wide default for whether tabs render a close affordance. \\\n * Default `false`. Per-instance `[closable]` Input wins; a per-`CngxTab`\n * `[closable]` override wins over both.\n *\n * @category common/tabs\n */\nexport function withTabsClosable(closable: boolean): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, closable }));\n}\n\n/**\n * Set the app-wide default for whether the group renders an add-tab\n * button. \\\n * Default `false`. Per-instance `[addable]` Input wins.\n *\n * @category common/tabs\n */\nexport function withTabsAddable(addable: boolean): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({ ...cfg, addable }));\n}\n\n/**\n * Merge ARIA labels into the cascade. Keys not provided keep their\n * library defaults; per-instance overrides on the tab group still win.\n *\n * @category common/tabs\n */\nexport function withTabsAriaLabels(labels: CngxTabsAriaLabels): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n ariaLabels: { ...cfg.ariaLabels, ...labels },\n }));\n}\n\n/**\n * Merge text fallback labels (overflow trigger, busy / rejection text)\n * into the cascade. Used when a slot directive is not present.\n *\n * @category common/tabs\n */\nexport function withTabsFallbackLabels(labels: CngxTabsFallbackLabels): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n fallbackLabels: { ...cfg.fallbackLabels, ...labels },\n }));\n}\n\n/**\n * Override the IO-debounce window (ms). See\n * {@link CngxTabsConfig.overflowStabilizeMs}.\n *\n * @category common/tabs\n */\nexport function withTabOverflowStabilizeMs(ms: number): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n overflowStabilizeMs: ms,\n }));\n}\n\n/**\n * Override the worst-case staleness ceiling on the visibility-map\n * commit. See {@link CngxTabsConfig.overflowMaxDeferMs}.\n *\n * @category common/tabs\n */\nexport function withTabOverflowMaxDeferMs(ms: number): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n overflowMaxDeferMs: ms,\n }));\n}\n\n/**\n * App-wide override for the More-button label. Middle tier; \\\n * per-instance `*cngxTabOverflowTrigger` still wins.\n *\n * ```ts\n * readonly moreTrigger = viewChild.required<TemplateRef<CngxTabOverflowTriggerContext>>(\n * 'moreTrigger',\n * { read: TemplateRef },\n * );\n *\n * providers: [provideTabsConfig(withTabOverflowTriggerTemplate(this.moreTrigger()))]\n * ```\n *\n * @category common/tabs\n */\nexport function withTabOverflowTriggerTemplate(\n template: TemplateRef<CngxTabOverflowTriggerContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, overflowTrigger: template },\n }));\n}\n\n/**\n * App-wide override for each row inside the overflow popover. \\\n * Middle tier; per-instance `*cngxTabOverflowItem` still wins.\n *\n * @category common/tabs\n */\nexport function withTabOverflowItemTemplate(\n template: TemplateRef<CngxTabOverflowItemContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, overflowItem: template },\n }));\n}\n\n/**\n * App-wide override for the error-badge decoration. Middle tier;\n * per-instance `*cngxTabErrorBadge` still wins. Sibling of the\n * stepper family's `withStepBadgeTemplate`.\n *\n * @category common/tabs\n */\nexport function withTabErrorBadgeTemplate(\n template: TemplateRef<CngxTabErrorBadgeContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, errorBadge: template },\n }));\n}\n\n/**\n * App-wide override for the rejection-icon decoration. Middle\n * tier; \\\n * per-instance `*cngxTabRejectionIcon` still wins. Sibling\n * of {@link withStepRejectionTemplate}.\n *\n * @category common/tabs\n */\nexport function withTabRejectionIconTemplate(\n template: TemplateRef<CngxTabRejectionIconContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, rejectionIcon: template },\n }));\n}\n\n/**\n * App-wide override for the commit-pending busy-spinner overlay.\n * Middle tier; per-instance `*cngxTabBusySpinner` still wins.\n * Sibling of {@link withStepBusySpinnerTemplate}.\n *\n * @category common/tabs\n */\nexport function withTabBusySpinnerTemplate(\n template: TemplateRef<CngxTabBusySpinnerContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, busySpinner: template },\n }));\n}\n\n/**\n * App-wide override for the tab-icon slot. Middle tier of the 3-stage\n * cascade; per-instance `*cngxTabIcon` still wins. Sibling of\n * {@link withStepIndicatorTemplate}.\n *\n * @category common/tabs\n */\nexport function withTabIconTemplate(\n template: TemplateRef<CngxTabIconContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, icon: template },\n }));\n}\n\n/**\n * App-wide override for a tab's close-button glyph. Middle tier;\n * per-instance `*cngxTabCloseIcon` still wins.\n *\n * @category common/tabs\n */\nexport function withTabCloseIconTemplate(\n template: TemplateRef<CngxTabCloseIconContext>,\n): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, closeIcon: template },\n }));\n}\n\n/**\n * App-wide override for the add-tab button glyph. Middle tier;\n * per-instance `*cngxTabAddIcon` still wins.\n *\n * @category common/tabs\n */\nexport function withTabAddIconTemplate(template: TemplateRef<void>): CngxTabsConfigFeature {\n return defineTabsConfigFeature((cfg) => ({\n ...cfg,\n templates: { ...cfg.templates, addIcon: template },\n }));\n}\n\nfunction resolveFeatures(features: readonly CngxTabsConfigFeature[]): CngxTabsConfig {\n return features.reduce<CngxTabsConfig>((cfg, feat) => feat(cfg), TABS_CONFIG_DEFAULTS);\n}\n\n/**\n * Root-level provider. Apply once in `bootstrapApplication` /\n * `appConfig.providers`. Returns {@link EnvironmentProviders} per\n * the canonical cngx config-cascade signature.\n *\n * @category common/tabs\n */\nexport function provideTabsConfig(\n ...features: readonly CngxTabsConfigFeature[]\n): EnvironmentProviders {\n return makeEnvironmentProviders([\n { provide: CNGX_TABS_CONFIG, useValue: resolveFeatures(features) },\n ]);\n}\n\n/**\n * Component-scoped override. Returns `Provider[]` (not\n * {@link EnvironmentProviders}) because `viewProviders` rejects\n * opaque environment providers. Resolution priority: per-instance\n * Input > viewProviders (`At`) > root > default.\n *\n * ```ts\n * @Component({\n * viewProviders: [...provideTabsConfigAt(withTabsDefaultOrientation('vertical'))],\n * })\n * ```\n *\n * @category common/tabs\n */\nexport function provideTabsConfigAt(...features: readonly CngxTabsConfigFeature[]): Provider[] {\n return [{ provide: CNGX_TABS_CONFIG, useValue: resolveFeatures(features) }];\n}\n\n/**\n * Inject the resolved tabs config in an injection context.\n *\n * @category common/tabs\n */\nexport function injectTabsConfig(): CngxTabsConfig {\n return inject(CNGX_TABS_CONFIG);\n}\n","import { computed, type Signal } from '@angular/core';\n\nimport type {\n CngxTabAlign,\n CngxTabIconLayout,\n CngxTabsConfig,\n CngxTabsPanelMode,\n CngxTabsSkin,\n} from './tabs-config';\n\n/**\n * Input bundle for {@link createTabsHostAttrs}: the per-instance inputs\n * (each `Signal<T | undefined>`) and the resolved config (read\n * synchronously at construction). Each cascade collapses through\n * `input ?? config ?? library-default`.\n *\n * @internal\n */\nexport interface CngxTabsHostAttrsInputs {\n readonly skin: Signal<CngxTabsSkin | undefined>;\n readonly iconLayout: Signal<CngxTabIconLayout | undefined>;\n readonly panelMode: Signal<CngxTabsPanelMode | undefined>;\n readonly fitted: Signal<boolean | undefined>;\n readonly tabAlign: Signal<CngxTabAlign | undefined>;\n readonly config: CngxTabsConfig;\n}\n\n/**\n * Host-attribute signals for `<cngx-tab-group>`. Each is read by a\n * `[attr.data-*]` host binding on the organism.\n *\n * @internal\n */\nexport interface CngxTabsHostAttrs {\n readonly resolvedSkin: Signal<CngxTabsSkin>;\n readonly resolvedIconLayout: Signal<CngxTabIconLayout>;\n readonly resolvedPanelMode: Signal<CngxTabsPanelMode>;\n readonly resolvedFitted: Signal<boolean>;\n readonly resolvedTabAlign: Signal<CngxTabAlign>;\n}\n\n/**\n * Helper resolving the host-attribute cascades for\n * `<cngx-tab-group>` (skin / iconLayout). Keeps the organism class\n * under the LOC guard while making the cascade pattern reusable. Sibling\n * shape to `createStepperHostAttrs`; the resolved-type unions differ per\n * family, so the helpers are siblings, not shared code.\n *\n * Each computed honors the cascade:\n * per-instance input wins over root config wins over library default. No\n * manual sync. The library defaults (`'line'` / `'start'`) live here,\n * not in `TABS_CONFIG_DEFAULTS` - mirroring the stepper.\n *\n * @internal\n */\nexport function createTabsHostAttrs(inputs: CngxTabsHostAttrsInputs): CngxTabsHostAttrs {\n return {\n resolvedSkin: computed<CngxTabsSkin>(() => inputs.skin() ?? inputs.config.skin ?? 'line'),\n resolvedIconLayout: computed<CngxTabIconLayout>(\n () => inputs.iconLayout() ?? inputs.config.iconLayout ?? 'start',\n ),\n resolvedPanelMode: computed<CngxTabsPanelMode>(\n () => inputs.panelMode() ?? inputs.config.panelMode ?? 'eager',\n ),\n resolvedFitted: computed<boolean>(() => inputs.fitted() ?? inputs.config.fitted ?? false),\n resolvedTabAlign: computed<CngxTabAlign>(\n () => inputs.tabAlign() ?? inputs.config.tabAlign ?? 'start',\n ),\n };\n}\n","import { inject, InjectionToken, type Provider } from '@angular/core';\n\n/**\n * Tabs i18n surface. Library defaults are English; consumers\n * override via {@link provideTabsI18n}. Sibling to\n * `CNGX_STEPPER_I18N` and `CNGX_CHART_I18N`.\n *\n * @category common/tabs/i18n\n */\nexport interface CngxTabsI18n {\n readonly tabsLabel: string;\n readonly selectedTab: (label: string, position: number, count: number) => string;\n /**\n * Folds a tab's optional secondary label into its accessible name.\n * Receives the primary label and the sub-label detail; the result\n * is passed to {@link selectedTab} as the label part, e.g.\n * `Tab 2 of 5: Bookmarks, 45`. Only invoked when a sub-label is\n * present.\n */\n readonly tabLabelWithDetail: (label: string, detail: string) => string;\n readonly tabHasErrors: (count: number) => string;\n readonly moreTabsLabel: (count: number) => string;\n readonly previousTab: string;\n readonly nextTab: string;\n /**\n * Accessible name for a tab's close button. Receives the tab label\n * (or a generic fallback when unlabeled) and yields the button's\n * `aria-label`, e.g. `Close \"Profile\"`.\n */\n readonly closeTab: (label: string) => string;\n /** Accessible name for the add-tab button. */\n readonly addTab: string;\n /**\n * @deprecated Superseded by {@link commitRolledBackTo}. Retained as\n * the defensive fallback in `liveAnnouncement` when the origin\n * label is unresolvable - fires for unlabeled tabs or programmatic\n * `commitState` writes that bypass `select()`. See\n * `tabs-accepted-debt §4`.\n */\n readonly commitFailedRetry: string;\n readonly commitInFlight: string;\n /**\n * Origin-aware rollback announcement. Receives the safe-harbour\n * tab label and yields the rollback phrase. Read on the\n * `pending → error` transition when both `lastFailedIndex` and\n * `originIndexDuringCommit` are set.\n */\n readonly commitRolledBackTo: (originLabel: string) => string;\n}\n\nconst TABS_I18N_DEFAULTS: CngxTabsI18n = {\n tabsLabel: 'Tabs',\n selectedTab: (label, position, count) => `Tab ${position} of ${count}: ${label}`,\n tabLabelWithDetail: (label, detail) => `${label}, ${detail}`,\n tabHasErrors: (count) => `${count} error${count === 1 ? '' : 's'}`,\n moreTabsLabel: (count) => `${count} more`,\n previousTab: 'Previous tab',\n nextTab: 'Next tab',\n closeTab: (label) => `Close \"${label}\"`,\n addTab: 'Add tab',\n commitFailedRetry: 'Tab change refused — retry?',\n commitInFlight: 'Switching tab…',\n commitRolledBackTo: (originLabel) => `Could not save changes — reverted to \"${originLabel}\".`,\n};\n\n/**\n * DI token for the tabs i18n bundle. `providedIn: 'root'` with\n * English defaults.\n *\n * @category common/tabs/i18n\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/i18n/tabs-i18n.ts\n * @since 0.1.0\n */\nexport const CNGX_TABS_I18N = new InjectionToken<CngxTabsI18n>('CngxTabsI18n', {\n providedIn: 'root',\n factory: () => TABS_I18N_DEFAULTS,\n});\n\n/**\n * Branded feature-fn for {@link provideTabsI18n} and\n * {@link provideCngxTabs}. The hidden `_target` discriminator routes\n * i18n features to `provideTabsI18n` and config features to\n * `provideTabsConfig` from the unified aggregator.\n *\n * @category common/tabs/i18n\n */\nexport type CngxTabsI18nFeature = ((bundle: CngxTabsI18n) => CngxTabsI18n) & {\n readonly _target: 'i18n';\n};\n\n/**\n * Brands an i18n-mutator with the `_target` discriminator.\n *\n * @internal\n */\nfunction defineTabsI18nFeature(fn: (bundle: CngxTabsI18n) => CngxTabsI18n): CngxTabsI18nFeature {\n return Object.assign(fn, { _target: 'i18n' as const });\n}\n\n/**\n * Override i18n labels via a partial bundle - unset keys keep the\n * English default. Same shape as `withTabsAriaLabels` /\n * `withTabsFallbackLabels` so `provideCngxTabs` composes both\n * surfaces uniformly.\n *\n * @category common/tabs/i18n\n */\nexport function withTabsI18nLabels(overrides: Partial<CngxTabsI18n>): CngxTabsI18nFeature {\n return defineTabsI18nFeature((bundle) => ({ ...bundle, ...overrides }));\n}\n\nfunction resolveI18nFeatures(features: readonly CngxTabsI18nFeature[]): CngxTabsI18n {\n return features.reduce<CngxTabsI18n>((bundle, feat) => feat(bundle), TABS_I18N_DEFAULTS);\n}\n\n/**\n * Provider for the tabs i18n bundle. Compose `withTabsI18nLabels(...)`\n * (and future i18n `with*` features); unset keys fall back to the\n * English default.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideTabsI18n(\n * withTabsI18nLabels({ tabsLabel: 'Reiter', previousTab: 'Vorheriger' }),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/tabs/i18n\n */\nexport function provideTabsI18n(...features: readonly CngxTabsI18nFeature[]): Provider {\n return {\n provide: CNGX_TABS_I18N,\n useValue: resolveI18nFeatures(features),\n };\n}\n\n/**\n * Inject the resolved tabs i18n bundle.\n *\n * @category common/tabs/i18n\n */\nexport function injectTabsI18n(): CngxTabsI18n {\n return inject(CNGX_TABS_I18N);\n}\n","import {\n type EnvironmentProviders,\n isDevMode,\n makeEnvironmentProviders,\n type Provider,\n} from '@angular/core';\n\nimport { provideTabsI18n, type CngxTabsI18nFeature } from './i18n/tabs-i18n';\nimport { provideTabsConfig, provideTabsConfigAt, type CngxTabsConfigFeature } from './tabs-config';\n\n/**\n * Union of feature kinds the tabs aggregator accepts. \\\n * Today: config and i18n; future surfaces widen the union and dispatch via the\n * hidden `_target` discriminator.\n *\n * @category common/tabs\n */\nexport type CngxTabsFeature = CngxTabsConfigFeature | CngxTabsI18nFeature;\n\n/** @internal */\ninterface PartitionedFeatures {\n readonly config: CngxTabsConfigFeature[];\n readonly i18n: CngxTabsI18nFeature[];\n}\n\nfunction partitionFeatures(features: readonly CngxTabsFeature[]): PartitionedFeatures {\n const config: CngxTabsConfigFeature[] = [];\n const i18n: CngxTabsI18nFeature[] = [];\n for (const feat of features) {\n if (feat._target === 'i18n') {\n i18n.push(feat);\n continue;\n }\n if (feat._target === 'config') {\n config.push(feat);\n continue;\n }\n // Unbranded feature — runtime escape from the `_target` type.\n // Drop with dev-warn so an i18n-shaped override never lands\n // silently in `CNGX_TABS_CONFIG`.\n if (isDevMode()) {\n console.warn(\n '[provideCngxTabs] Dropped feature without a `_target` ' +\n 'discriminator. Brand config-side mutators with ' +\n '`defineTabsConfigFeature(...)` (or use a `with*` helper) ' +\n 'and i18n-side mutators with `withTabsI18nLabels(...)`.',\n );\n }\n }\n return { config, i18n };\n}\n\n/**\n * Unified aggregator for tabs configuration. \\\n * Routes features by `_target` to {@link provideTabsConfig} and {@link provideTabsI18n}. \\\n * Sibling to\n * - `provideCngxMenu` and\n * - `provideCngxSelect`;\n * apply once in the app providers array. \\\n * Returns {@link EnvironmentProviders}; for\n * - `viewProviders` use {@link provideCngxTabsAt} — opaque\n * - `EnvironmentProviders` cannot live there.\n *\n * ```ts\n * bootstrapApplication(AppComponent, {\n * providers: [\n * provideCngxTabs(\n * withTabsDefaultOrientation('vertical'),\n * withTabsAriaLabels({ tabsRegion: 'Bereiche' }),\n * withTabsI18nLabels({ tabsLabel: 'Bereiche', moreTabsLabel: (n) => `${n} mehr` }),\n * withTabOverflowStabilizeMs(150),\n * ),\n * ],\n * });\n * ```\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/provide-cngx-tabs.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroup, CngxTabsConfig, provideCngxTabsAt\n */\nexport function provideCngxTabs(...features: readonly CngxTabsFeature[]): EnvironmentProviders {\n const { config, i18n } = partitionFeatures(features);\n return makeEnvironmentProviders([\n provideTabsConfig(...config),\n ...(i18n.length > 0 ? [provideTabsI18n(...i18n)] : []),\n ]);\n}\n\n/**\n * Component-scoped twin of {@link provideCngxTabs}. \\\n * Returns `Provider[]` for `viewProviders`/`providers`; same dispatch\n * semantics, different scope.\n *\n * ```ts\n * @Component({\n * viewProviders: [\n * ...provideCngxTabsAt(\n * withTabsDefaultOrientation('vertical'),\n * withTabsI18nLabels({ tabsLabel: 'Bereiche' }),\n * ),\n * ],\n * })\n * ```\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/provide-cngx-tabs.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroup, CngxTabsConfig, provideCngxTabs\n */\nexport function provideCngxTabsAt(...features: readonly CngxTabsFeature[]): Provider[] {\n const { config, i18n } = partitionFeatures(features);\n return [\n ...provideTabsConfigAt(...config),\n ...(i18n.length > 0 ? [provideTabsI18n(...i18n)] : []),\n ];\n}\n","import { InjectionToken } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\nimport type { CngxTabPanelHost } from '../tab-panel-host.token';\n\n/**\n * Resolves the DOM elements `<cngx-tab-overflow>` observes. \\\n * cngx-native keys by `[id=\"${handle.id}-header\"]`; the Material twin keys by\n * positional index into `.mat-mdc-tab` (handle ids never appear on\n * Material's rendered DOM). \\\n *\n * The molecule is variant-agnostic and\n * consumes whichever adapter\n * {@link CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY} provides.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowDomAdapter {\n /**\n * Resolve the IntersectionObserver root - the scroll viewport the\n * molecule observes. \\\n * Returning `null` short-circuits the attach;\n * the molecule's rAF retry loop polls again next frame.\n */\n resolveStripRoot(panelHost: CngxTabPanelHost, host: HTMLElement): HTMLElement | null;\n\n /**\n * Resolve the rendered button for `handle` inside `root`. cngx-native\n * keys by `handle.id`; Material adapters key by `idx`.\n */\n resolveTabButton(handle: CngxTabHandle, root: HTMLElement, idx: number): HTMLElement | null;\n}\n\n/**\n * Factory signature for {@link CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY}.\n *\n * @category common/tabs/overflow\n */\nexport type CngxTabOverflowDomAdapterFactory = () => CngxTabOverflowDomAdapter;\n\n/**\n * Default adapter for the cngx-native `<cngx-tab-group>` strip: \\\n * walks `host.closest('.cngx-tabs__strip-wrapper')` for the IO root,\n * then `[id=\"${handle.id}-header\"]` for each button.\n *\n * @category common/tabs/overflow\n */\nexport function createCngxTabOverflowDefaultDomAdapter(): CngxTabOverflowDomAdapter {\n return {\n resolveStripRoot(_panelHost, host) {\n const wrapper = host.closest<HTMLElement>('.cngx-tabs__strip-wrapper');\n return wrapper?.querySelector<HTMLElement>('.cngx-tabs__strip') ?? null;\n },\n resolveTabButton(handle, root, _idx) {\n return root.querySelector<HTMLElement>(`[id=\"${handle.id}-header\"]`);\n },\n };\n}\n\n/**\n * DI token for the overflow molecule's DOM-resolution strategy. \\\n * Override at directive `providers` or component `viewProviders` to\n * swap in a Material, custom-skin, or test-double adapter without\n * forking the molecule. Defaults to\n * {@link createCngxTabOverflowDefaultDomAdapter}.\n *\n * @category common/tabs/overflow\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/dom-adapter.ts\n * @since 0.1.0\n */\nexport const CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY =\n new InjectionToken<CngxTabOverflowDomAdapterFactory>('CngxTabOverflowDomAdapterFactory', {\n providedIn: 'root',\n factory: () => createCngxTabOverflowDefaultDomAdapter,\n });\n","import { InjectionToken } from '@angular/core';\n\n/**\n * Outcome reported by an `attempt` callback. `true` halts the loop\n * (success); `false` or `null` schedules another tick.\n *\n * @category common/tabs/overflow\n */\nexport type CngxDomAnchorRetryResult = true | false | null;\n\n/**\n * Configuration for {@link createDomAnchorRetry}.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxDomAnchorRetryOptions {\n /**\n * Per-attempt callback. `true` halts; `false`/`null` schedules\n * another attempt.\n */\n readonly attempt: () => CngxDomAnchorRetryResult;\n /**\n * Cap on unsuccessful attempts before {@link onGiveUp} fires.\n * The first synchronous call counts as attempt #1 - `5` permits\n * four scheduled retries after the initial.\n */\n readonly maxAttempts: number;\n /**\n * Schedules the next attempt (rAF / `afterNextRender` /\n * `setTimeout` / `queueMicrotask`). Returns a cancellation\n * closure - return a noop when the scheduler doesn't expose one.\n */\n readonly schedule: (cb: () => void) => () => void;\n /** Fires once after the `maxAttempts`-th unsuccessful attempt. */\n readonly onGiveUp?: () => void;\n}\n\n/**\n * Imperative handle returned by {@link createDomAnchorRetry}.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxDomAnchorRetryHandle {\n /** Begin (or restart) the retry loop. Resets the attempt counter. */\n start(): void;\n /** Stop the retry loop and cancel any pending scheduled attempt. */\n cancel(): void;\n}\n\n/**\n * Bounded retry loop for DOM-anchoring patterns - shared\n * attempt-counter and give-up and cancellation contract. \\\n * Used by\n * `<cngx-tab-overflow>`'s rAF strip-attach loop and `[cngxMatTabs]`'s\n * `afterNextRender` header-anchor loop.\n *\n * Consumer-supplied scheduler\n * lets different timing primitives flow through one counter.\n *\n * ```ts\n * const retry = createDomAnchorRetry({\n * attempt: () => {\n * const root = host.closest('.strip-wrapper');\n * if (!root) return null;\n * observer.observe(root);\n * return true;\n * },\n * maxAttempts: 60,\n * schedule: (cb) => {\n * const h = requestAnimationFrame(cb);\n * return () => cancelAnimationFrame(h);\n * },\n * onGiveUp: () => console.warn('strip wrapper not found'),\n * });\n * afterNextRender(() => retry.start());\n * destroyRef.onDestroy(() => retry.cancel());\n * ```\n *\n * @category common/tabs/overflow\n */\nexport function createDomAnchorRetry(options: CngxDomAnchorRetryOptions): CngxDomAnchorRetryHandle {\n let attempts = 0;\n let cancelLast: (() => void) | null = null;\n let stopped = false;\n const tick = (): void => {\n if (stopped) {\n cancelLast = null;\n return;\n }\n cancelLast = null;\n let result: CngxDomAnchorRetryResult;\n try {\n result = options.attempt();\n } catch {\n // Swallow + terminal stop - covers the test-runner teardown\n // race where a global (e.g. IntersectionObserver) is reset\n // between schedule and fire, before consumer DestroyRef can\n // call cancel().\n // Production callback bugs still surface via\n // their own console.error before they throw here.\n stopped = true;\n return;\n }\n if (result === true) {\n stopped = true;\n return;\n }\n attempts++;\n if (attempts >= options.maxAttempts) {\n stopped = true;\n options.onGiveUp?.();\n return;\n }\n cancelLast = options.schedule(tick);\n };\n return {\n start: () => {\n stopped = false;\n attempts = 0;\n tick();\n },\n cancel: () => {\n stopped = true;\n cancelLast?.();\n cancelLast = null;\n },\n };\n}\n\n/**\n * Factory signature for {@link CNGX_DOM_ANCHOR_RETRY_FACTORY} -\n * matches {@link createDomAnchorRetry} for drop-in overrides.\n *\n * @category common/tabs/overflow\n */\nexport type CngxDomAnchorRetryFactory = (\n options: CngxDomAnchorRetryOptions,\n) => CngxDomAnchorRetryHandle;\n\n/**\n * DI token for the DOM-anchor retry policy. \\\n * Default {@link createDomAnchorRetry}. Two real consumers today -\n * `<cngx-tab-overflow>`'s rAF strip-attach loop and\n * `[cngxMatTabs]`'s `afterNextRender` header-anchor loop. Override\n * via `providers` / `viewProviders` for retry-with-backoff,\n * telemetry on give-up, etc. \\\n * Symmetric to\n * - `CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY`,\n * - `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY`, and\n * - `CNGX_TABS_COMMIT_HANDLER_FACTORY`.\n *\n * @category common/tabs/overflow\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/dom-anchor-retry.ts\n * @since 0.1.0\n */\nexport const CNGX_DOM_ANCHOR_RETRY_FACTORY = new InjectionToken<CngxDomAnchorRetryFactory>(\n 'CngxDomAnchorRetryFactory',\n {\n providedIn: 'root',\n factory: () => createDomAnchorRetry,\n },\n);\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabOverflowTrigger` template. Replaces the\n * default `i18n.moreTabsLabel(count)` text on the More button; the\n * surrounding `<button cngxPopoverTrigger>` shell (`aria-haspopup`,\n * `aria-expanded`, click handler, hidden binding) stays library-owned.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowTriggerContext {\n /** Convenience alias for `count` - usable as `let-count` shorthand. */\n readonly $implicit: number;\n /** Number of hidden tabs currently surfaced through the overflow popover. */\n readonly count: number;\n /** Hidden tabs, in the order they appear in `presenter.tabs()`. */\n readonly hiddenTabs: readonly CngxTabHandle[];\n}\n\n/**\n * Structural slot for the More-button label. 3-stage cascade:\n * per-instance directive >\n * `CNGX_TABS_CONFIG.templates.overflowTrigger` >\n * `i18n.moreTabsLabel(count)`.\n *\n * ```html\n * <cngx-tab-overflow>\n * <ng-template cngxTabOverflowTrigger let-count>\n * <my-icon name=\"dots\" /> +{{ count }}\n * </ng-template>\n * </cngx-tab-overflow>\n * ```\n *\n * @category common/tabs/overflow\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/tab-overflow-trigger.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabOverflowItem, CngxTab\n */\n@Directive({\n selector: 'ng-template[cngxTabOverflowTrigger]',\n exportAs: 'cngxTabOverflowTrigger',\n standalone: true,\n})\nexport class CngxTabOverflowTrigger {\n readonly templateRef = inject<TemplateRef<CngxTabOverflowTriggerContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabOverflowItem` template. Replaces the\n * default `tab.label() ?? tab.id` text inside the More popover; the\n * surrounding `<li role=\"menuitem\">` shell (`aria-disabled`, click\n * handler, `data-tab-id`) stays library-owned.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowItemContext {\n /** Convenience alias for `tab` - usable as `let-tab` shorthand. */\n readonly $implicit: CngxTabHandle;\n /** The hidden tab the row represents. */\n readonly tab: CngxTabHandle;\n /**\n * Commit-aware select. Routes through `panelHost.selectById(tab.id)`\n * and dismisses the popover; no-op when `disabled`.\n */\n readonly pick: () => void;\n /** Mirrors `tab.disabled()` - pre-resolved for consumer convenience. */\n readonly disabled: boolean;\n /** Row index inside `hiddenTabs()`, starting at 0. */\n readonly index: number;\n}\n\n/**\n * Structural slot for the per-row body inside the More popover.\n * 3-stage cascade: per-instance directive >\n * `CNGX_TABS_CONFIG.templates.overflowItem` > built-in label text.\n *\n * ```html\n * <cngx-tab-overflow>\n * <ng-template cngxTabOverflowItem let-tab let-disabled=\"disabled\">\n * <my-icon [name]=\"tab.id\" />\n * <span class=\"row-label\" [class.is-muted]=\"disabled\">\n * {{ tab.label() }}\n * </span>\n * </ng-template>\n * </cngx-tab-overflow>\n * ```\n *\n * @category common/tabs/overflow\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/tab-overflow-item.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabOverflowTrigger, CngxTab\n */\n@Directive({\n selector: 'ng-template[cngxTabOverflowItem]',\n exportAs: 'cngxTabOverflowItem',\n standalone: true,\n})\nexport class CngxTabOverflowItem {\n readonly templateRef = inject<TemplateRef<CngxTabOverflowItemContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabErrorBadge` template. Renders only when\n * the tab's `errorAggregator?.shouldShow()` is `true`; the visibility\n * gate stays library-owned. Sibling shape to `CngxStepBadgeContext`.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabErrorBadgeContext {\n /** The tab handle carrying id / label / disabled / aggregator signals. */\n readonly tab: CngxTabHandle;\n}\n\n/**\n * Structural slot for the error-badge template. 3-stage cascade:\n * per-instance directive >\n * `CNGX_TABS_CONFIG.templates.errorBadge` >\n * `CNGX_TABS_GLYPHS.errorBadge`.\n *\n * ```html\n * <cngx-tab-group>\n * <ng-template cngxTabErrorBadge let-tab=\"tab\">\n * <span class=\"my-badge-pill\">\n * {{ tab.errorAggregator()?.count() }}\n * </span>\n * </ng-template>\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-error-badge.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabRejectionIcon, CngxTabBusySpinner, CngxTab\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-error-badge-via-code-cngxtaberrorbadge-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabErrorBadge]',\n exportAs: 'cngxTabErrorBadge',\n standalone: true,\n})\nexport class CngxTabErrorBadge {\n readonly templateRef = inject<TemplateRef<CngxTabErrorBadgeContext>>(\n TemplateRef,\n );\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Context for the `*cngxTabRejectionIcon` template. Renders only on\n * the tab matching `presenter.lastFailedIndex()`; the visibility\n * gate stays library-owned. `originLabel` is the safe-harbour tab,\n * derived from `presenter.originIndexDuringCommit()` - `undefined`\n * for the synchronous-rejection edge case. Sibling shape to\n * `CngxStepRejectionContext`.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabRejectionIconContext {\n /** Flat-index of the rejected tab (`presenter.lastFailedIndex()`). */\n readonly failedIndex: number;\n /** Resolved label of the safe-harbour tab, when derivable. */\n readonly originLabel: string | undefined;\n}\n\n/**\n * Structural slot for the rejection-decoration template. 3-stage\n * cascade: per-instance directive >\n * `CNGX_TABS_CONFIG.templates.rejectionIcon` >\n * `CNGX_TABS_GLYPHS.rejectionIcon`.\n *\n * ```html\n * <cngx-tab-group>\n * <ng-template\n * cngxTabRejectionIcon\n * let-failedIndex=\"failedIndex\"\n * let-originLabel=\"originLabel\"\n * >\n * <my-icon name=\"rollback\" />\n * @if (originLabel) {\n * <span class=\"cngx-sr-only\">Rolled back to {{ originLabel }}</span>\n * }\n * </ng-template>\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-rejection-icon.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabErrorBadge, CngxTabBusySpinner, CngxTab\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/rejection-decoration-via-code-cngxtabrejectionicon-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabRejectionIcon]',\n exportAs: 'cngxTabRejectionIcon',\n standalone: true,\n})\nexport class CngxTabRejectionIcon {\n readonly templateRef = inject<TemplateRef<CngxTabRejectionIconContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabBusySpinner` template. Renders only on\n * the in-flight commit target (matches `presenter.intendedIndex()`\n * with `commitState.status() === 'pending'`); the visibility gate\n * stays library-owned. `intendedIndex` is exposed so positional\n * variants (progress bars, step counters) read the same source.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabBusySpinnerContext {\n /** The tab handle carrying id / label / disabled / aggregator signals. */\n readonly tab: CngxTabHandle;\n /** The flat-index of the in-flight commit target. */\n readonly intendedIndex: number;\n}\n\n/**\n * Structural slot for the busy-spinner template. 3-stage cascade:\n * per-instance directive >\n * `CNGX_TABS_CONFIG.templates.busySpinner` > built-in pulse span.\n *\n * ```html\n * <cngx-tab-group>\n * <ng-template cngxTabBusySpinner>\n * <my-spinner size=\"sm\" />\n * </ng-template>\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-busy-spinner.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabErrorBadge, CngxTabRejectionIcon, CngxTab\n * <example-url>http://localhost:4200/#/ui/tabs/tab-slot-overrides/custom-busy-spinner-via-code-cngxtabbusyspinner-code</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabBusySpinner]',\n exportAs: 'cngxTabBusySpinner',\n standalone: true,\n})\nexport class CngxTabBusySpinner {\n readonly templateRef = inject<TemplateRef<CngxTabBusySpinnerContext>>(\n TemplateRef,\n );\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabIcon` template. \\\n * Rendered once per tab in the header, ahead of the label. \\\n * Carries the tab handle plus the two\n * per-tab signals a consumer icon usually keys off - whether the tab is\n * the active one and its positional index.\n *\n * Richer than {@link CngxTabErrorBadgeContext} (which only needs `tab`) because an\n * icon commonly swaps glyph on the active tab.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabIconContext {\n /** The tab handle carrying id / label / disabled / aggregator signals. */\n readonly tab: CngxTabHandle;\n /** Whether this tab is the currently active one. */\n readonly active: boolean;\n /** Zero-based position of the tab in the strip. */\n readonly index: number;\n}\n\n/**\n * Structural slot for the tab-icon template. \\\n * One group-level slot with per-tab context (stepper-slot parity), not a per-`CngxTab` input.\\\n * 3-stage cascade: \n * per-instance directive > `CNGX_TABS_CONFIG.templates.icon` > none (no icon rendered).\n *\n * ```html\n * <ng-template cngxTabIcon let-active=\"active\">\n * <cngx-icon [name]=\"active ? 'folder-open' : 'folder'\" />\n * </ng-template>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-icon.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabErrorBadge, CngxTab, CngxTabGroup\n * <example-url>http://localhost:4200/#/ui/tabs/tab-icons/icon-end</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-icons/icon-only</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-icons/icon-start</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-icons/icon-top</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-icons/icon-vertical-sidebar</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabIcon]',\n exportAs: 'cngxTabIcon',\n standalone: true,\n})\nexport class CngxTabIcon {\n readonly templateRef = inject<TemplateRef<CngxTabIconContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Context for the `*cngxTabCloseIcon` template. Rendered inside each\n * closable tab's close button (the button itself owns the\n * `aria-label`); the template paints only the glyph, so it carries the\n * tab handle in case the visual varies per tab.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabCloseIconContext {\n /** The tab handle whose close button this icon paints. */\n readonly tab: CngxTabHandle;\n}\n\n/**\n * Structural slot for a tab's close-button glyph. 3-stage cascade:\n * per-instance directive > `CNGX_TABS_CONFIG.templates.closeIcon` >\n * `CNGX_TABS_GLYPHS.closeIcon`.\n *\n * ```html\n * <cngx-tab-group closable (tabClose)=\"remove($event.id)\">\n * <ng-template cngxTabCloseIcon><cngx-icon name=\"close\" /></ng-template>\n * ...\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-close-icon.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabAddIcon, CngxTabGroup\n * <example-url>http://localhost:4200/#/ui/tabs/tab-dismissable/dismissable-and-addable</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabCloseIcon]',\n exportAs: 'cngxTabCloseIcon',\n standalone: true,\n})\nexport class CngxTabCloseIcon {\n readonly templateRef = inject<TemplateRef<CngxTabCloseIconContext>>(TemplateRef);\n}\n","import { Directive, inject, TemplateRef } from '@angular/core';\n\n/**\n * Structural slot for the add-tab button glyph. 3-stage cascade:\n * per-instance directive > `CNGX_TABS_CONFIG.templates.addIcon` >\n * `CNGX_TABS_GLYPHS.addIcon`. The button owns its `aria-label`; the\n * template paints only the glyph, so its context is `void`.\n *\n * ```html\n * <cngx-tab-group addable (tabAdd)=\"add()\">\n * <ng-template cngxTabAddIcon><cngx-icon name=\"plus\" /></ng-template>\n * ...\n * </cngx-tab-group>\n * ```\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-add-icon.directive.ts\n * @since 0.1.0\n * @relatedTo CngxTabCloseIcon, CngxTabGroup\n * <example-url>http://localhost:4200/#/ui/tabs/tab-dismissable/dismissable-and-addable</example-url>\n * <example-url>http://localhost:4200/#/ui/tabs/tab-group/addable-tabs</example-url>\n */\n@Directive({\n selector: 'ng-template[cngxTabAddIcon]',\n exportAs: 'cngxTabAddIcon',\n standalone: true,\n})\nexport class CngxTabAddIcon {\n readonly templateRef = inject<TemplateRef<void>>(TemplateRef);\n}\n","import { afterNextRender, computed, type Injector, type Signal } from '@angular/core';\n\nimport type { CngxTabsI18n } from '../i18n/tabs-i18n';\nimport type { CngxTabCloseIconContext } from '../slots/tab-close-icon.directive';\nimport type { CngxTabsConfig } from '../tabs-config';\nimport type { CngxTabGroupHost, CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Inputs to {@link createTabDismissals}. \\\n * The organism owns the\n * `[closable]` / `[addable]` inputs and the DOM handle; the factory runs\n * the cascade and the close/add interaction so the organism class stays\n * under the LOC guard. \\\n *\n * Sibling shape to `createTabGroupAnnouncements`.\n *\n * @category common/tabs\n */\nexport interface CngxTabDismissalsOptions {\n readonly host: CngxTabGroupHost;\n readonly config: CngxTabsConfig;\n readonly i18n: CngxTabsI18n;\n readonly closable: Signal<boolean | undefined>;\n readonly addable: Signal<boolean | undefined>;\n readonly hostElement: HTMLElement;\n readonly injector: Injector;\n}\n\n/**\n * Resolved dismissable/addable surface for `<cngx-tab-group>`. \\\n * The organism holds this as one field and the template reads it.\n *\n * @category common/tabs\n */\nexport interface CngxTabDismissals {\n /** Effective group-level close affordance (`input ?? config ?? false`). */\n readonly resolvedClosable: Signal<boolean>;\n /** Effective group-level add affordance (`input ?? config ?? false`). */\n readonly resolvedAddable: Signal<boolean>;\n /** Per-tab closable: per-tab override > group resolution. */\n isTabClosable(tab: CngxTabHandle): boolean;\n /** i18n accessible name for a tab's close button. */\n closeButtonLabel(tab: CngxTabHandle): string;\n /** Stable `*cngxTabCloseIcon` context (`{ tab }`) per tab. */\n closeIconContextFor(tab: CngxTabHandle): CngxTabCloseIconContext;\n /** Close a tab and restore focus to the new active tab / add button. */\n handleClose(tab: CngxTabHandle, event?: Event): void;\n /** Delete on a focused closable tab requests its close (APG). */\n handleTabKeydown(tab: CngxTabHandle, event: KeyboardEvent): void;\n /** Request a new tab via the add button. */\n handleAdd(): void;\n}\n\n/**\n * Helper resolving the dismissable/addable affordances for\n * `<cngx-tab-group>`. \\\n * Keeps the close/add cascade + interaction off the\n * organism class (LOC guard). \\\n * Each cascade is one `computed()`.\n * The actual tab removal is the consumer's -\n * `handleClose` only routes through the presenter's `requestClose`, which\n * moves the active index, and restores focus once the consumer's removal\n * has rendered.\n *\n * ```ts\n * // The organism builds it once from field-init; the template reads it.\n * protected readonly dismiss = createTabDismissals({\n * host: this.host, // CNGX_TAB_GROUP_HOST\n * config: this.config, // injectTabsConfig()\n * i18n: this.i18n, // injectTabsI18n()\n * closable: this.closable, // input<boolean | undefined>('closable')\n * addable: this.addable, // input<boolean | undefined>('addable')\n * hostElement: this.hostElement,\n * injector: this.injector,\n * });\n *\n * // Per-tab close affordance, read from the header template:\n * dismiss.isTabClosable(tab); // per-tab override > group resolution\n * dismiss.closeButtonLabel(tab); // i18n accessible name for the close button\n * dismiss.handleClose(tab, clickEvent); // routes through presenter.requestClose, restores focus\n * dismiss.handleTabKeydown(tab, keyEvent); // Delete on a focused closable tab closes it (APG)\n *\n * // Group-level add affordance:\n * dismiss.resolvedAddable(); // input ?? config ?? false\n * dismiss.handleAdd(); // routes through presenter.requestAdd\n * ```\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/dismissals/tab-dismissals.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroup, CngxTabCloseIcon, CngxTabAddIcon\n */\nexport function createTabDismissals(opts: CngxTabDismissalsOptions): CngxTabDismissals {\n const resolvedClosable = computed<boolean>(\n () => opts.closable() ?? opts.config.closable ?? false,\n );\n const resolvedAddable = computed<boolean>(() => opts.addable() ?? opts.config.addable ?? false);\n\n const closeIconContextCache = new WeakMap<CngxTabHandle, CngxTabCloseIconContext>();\n\n const isTabClosable = (tab: CngxTabHandle): boolean => tab.closable() ?? resolvedClosable();\n\n const handleClose = (tab: CngxTabHandle, event?: Event): void => {\n event?.stopPropagation();\n if (!isTabClosable(tab)) {\n return;\n }\n opts.host.requestClose(tab.id);\n // Restore focus once the consumer's removal has rendered: the new\n // active tab, then the add button, and finally the group element\n // itself (made programmatically focusable) so focus never falls to\n // `<body>` when the strip empties with no add button (APG).\n afterNextRender(\n () => {\n const active = opts.hostElement.querySelector<HTMLElement>(\n '.cngx-tabs__tab[aria-selected=\"true\"]',\n );\n const add = opts.hostElement.querySelector<HTMLElement>('.cngx-tabs__add');\n const target = active ?? add;\n if (target) {\n target.focus();\n return;\n }\n opts.hostElement.tabIndex = -1;\n opts.hostElement.focus();\n },\n { injector: opts.injector },\n );\n };\n\n return {\n resolvedClosable,\n resolvedAddable,\n isTabClosable,\n closeButtonLabel: (tab) => opts.i18n.closeTab(tab.label() ?? ''),\n closeIconContextFor: (tab) => {\n let ctx = closeIconContextCache.get(tab);\n if (!ctx) {\n ctx = { tab };\n closeIconContextCache.set(tab, ctx);\n }\n return ctx;\n },\n handleClose,\n handleTabKeydown: (tab, event) => {\n if (event.key === 'Delete' && isTabClosable(tab)) {\n event.preventDefault();\n handleClose(tab);\n }\n },\n handleAdd: () => opts.host.requestAdd(),\n };\n}\n","import type { CngxTabGroupHost, CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Inputs to {@link createTabKeyboardNav}. The organism owns the DOM\n * handle and the presenter contract; the factory runs the APG tablist\n * keyboard model so the organism class stays under the LOC guard.\n * Sibling shape to `createTabDismissals`.\n *\n * @category common/tabs\n */\nexport interface CngxTabKeyboardNavOptions {\n readonly host: CngxTabGroupHost;\n readonly hostElement: HTMLElement;\n}\n\n/**\n * Resolved keyboard surface for `<cngx-tab-group>`'s tablist. The\n * organism holds this as one field; the template reads `tabTabindex`\n * for the roving stop and routes the tab buttons' `(keydown)` through\n * `handleKeydown`.\n *\n * @category common/tabs\n */\nexport interface CngxTabKeyboardNav {\n /**\n * Roving `tabindex` for a tab button: `0` for the selected tab, `-1`\n * for every other. Derived from `host.activeId()` (Pillar 1: a single\n * source, never a second index to keep in sync) so the active tab is\n * the group's lone tab stop and `Tab` always lands on it.\n */\n tabTabindex(tab: CngxTabHandle): 0 | -1;\n /**\n * APG tablist navigation: arrow keys (axis from orientation), Home,\n * and End move between tabs with disabled-skip + loop, activate the\n * target through `host.select()` (automatic activation), and move DOM\n * focus to it. Returns silently for any other key so the caller can\n * chain further handlers (e.g. Delete-to-close).\n */\n handleKeydown(event: KeyboardEvent): void;\n}\n\n/**\n * Level-2 helper implementing the WAI-ARIA APG tabs keyboard model for\n * `<cngx-tab-group>` with **automatic activation**: an arrow press moves\n * focus AND activates the target tab in one step, so focus and selection\n * never diverge. Keeps the keyboard logic off the organism class (LOC\n * guard) and out of a competing roving-tabindex state machine.\n *\n * Pillar 1 (Ableitung statt Verwaltung): the tab stop is derived from the\n * presenter's `activeId`, not managed as a second index. Pillar 2\n * (Kommunikation): activation routes through `host.select()`, which owns\n * disabled-skip, loop, commit gating, and the live-region announcement -\n * the keyboard layer adds only focus movement (a DOM concern the\n * presenter, living in `@cngx/common`, must not own).\n *\n * Navigation always originates from the active tab: under automatic\n * activation the focused tab is always the active one, so the clamped\n * active index is the correct origin.\n *\n * @category common/tabs\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/keyboard/tab-keyboard-nav.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroupPresenter, CngxTabGroup, createTabGroupAnnouncements\n */\nexport function createTabKeyboardNav(\n opts: CngxTabKeyboardNavOptions,\n): CngxTabKeyboardNav {\n const clampedActive = (): number => {\n const len = opts.host.tabs().length;\n if (len === 0) {\n return 0;\n }\n return Math.max(0, Math.min(opts.host.activeIndex(), len - 1));\n };\n\n // Next enabled index in `direction`, honouring `loop`. Mirrors the\n // presenter's `selectNext`/`selectPrevious` geometry but returns the\n // resolved index so the caller can both activate and focus it.\n const step = (direction: 1 | -1): number | null => {\n const tabs = opts.host.tabs();\n const len = tabs.length;\n if (len === 0) {\n return null;\n }\n const loop = opts.host.loop();\n let idx = clampedActive() + direction;\n for (let i = 0; i < len; i++) {\n if (loop) {\n idx = ((idx % len) + len) % len;\n } else if (idx < 0 || idx >= len) {\n return null;\n }\n if (!tabs[idx].disabled()) {\n return idx;\n }\n idx += direction;\n }\n return null;\n };\n\n // First (direction 1) or last (direction -1) enabled tab, for Home/End.\n const edge = (direction: 1 | -1): number | null => {\n const tabs = opts.host.tabs();\n const len = tabs.length;\n if (direction === 1) {\n for (let i = 0; i < len; i++) {\n if (!tabs[i].disabled()) {\n return i;\n }\n }\n } else {\n for (let i = len - 1; i >= 0; i--) {\n if (!tabs[i].disabled()) {\n return i;\n }\n }\n }\n return null;\n };\n\n // Focus the tab button for the tab at `index`, keyed off the stable\n // tab id (the rendered `data-tab-id`) rather than a positional\n // `.cngx-tabs__tab[index]` lookup - so a skin that reorders or wraps\n // the tab buttons can't misdirect keyboard focus. `[role=\"tab\"]` is\n // the APG contract every skin must honour, so it survives a class\n // rename too. The button already exists regardless of pending CD, so\n // focus is immediate and never waits on the activation's render.\n const focusTabAt = (index: number): void => {\n const id = opts.host.tabs()[index]?.id;\n if (id == null) {\n return;\n }\n const buttons = Array.from(\n opts.hostElement.querySelectorAll<HTMLElement>('[role=\"tab\"]'),\n );\n buttons.find((button) => button.getAttribute('data-tab-id') === id)?.focus();\n };\n\n return {\n tabTabindex: (tab) => (tab.id === opts.host.activeId() ? 0 : -1),\n handleKeydown: (event) => {\n const horizontal = opts.host.orientation() === 'horizontal';\n let target: number | null;\n switch (event.key) {\n case 'ArrowRight':\n target = horizontal ? step(1) : null;\n break;\n case 'ArrowLeft':\n target = horizontal ? step(-1) : null;\n break;\n case 'ArrowDown':\n target = horizontal ? null : step(1);\n break;\n case 'ArrowUp':\n target = horizontal ? null : step(-1);\n break;\n case 'Home':\n target = edge(1);\n break;\n case 'End':\n target = edge(-1);\n break;\n default:\n return;\n }\n if (target === null) {\n return;\n }\n event.preventDefault();\n // Automatic activation: select first (content + aria-selected +\n // announcement follow), then move focus to the same tab button.\n opts.host.select(target);\n focusTabAt(target);\n },\n };\n}\n","import { computed, type Signal, type TemplateRef } from '@angular/core';\n\nimport type { CngxTabsConfig } from '../tabs-config';\nimport type { CngxTabAddIcon } from './tab-add-icon.directive';\nimport type { CngxTabBusySpinner, CngxTabBusySpinnerContext } from './tab-busy-spinner.directive';\nimport type { CngxTabCloseIcon, CngxTabCloseIconContext } from './tab-close-icon.directive';\nimport type { CngxTabErrorBadge, CngxTabErrorBadgeContext } from './tab-error-badge.directive';\nimport type { CngxTabIcon, CngxTabIconContext } from './tab-icon.directive';\nimport type {\n CngxTabRejectionIcon,\n CngxTabRejectionIconContext,\n} from './tab-rejection-icon.directive';\n\n/**\n * Inputs to {@link createTabGroupTemplateBindings}. \\\n * The organism owns the `contentChild()` queries (NG8110 — must run in component\n * injection context) and the resolved {@link CngxTabsConfig}; the\n * factory runs the 3-stage cascade per slot key.\n *\n * Sibling shape to\n * - `createStepperTemplateBindings`.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabGroupTemplateBindingsOptions {\n readonly errorBadgeSlot: Signal<CngxTabErrorBadge | undefined>;\n readonly rejectionIconSlot: Signal<CngxTabRejectionIcon | undefined>;\n readonly busySpinnerSlot: Signal<CngxTabBusySpinner | undefined>;\n readonly iconSlot: Signal<CngxTabIcon | undefined>;\n /** Per-instance `*cngxTabCloseIcon` slot. Optional - close is opt-in. */\n readonly closeIconSlot?: Signal<CngxTabCloseIcon | undefined>;\n /** Per-instance `*cngxTabAddIcon` slot. Optional - add is opt-in. */\n readonly addIconSlot?: Signal<CngxTabAddIcon | undefined>;\n readonly config: CngxTabsConfig;\n}\n\n/**\n * Output of {@link createTabGroupTemplateBindings}. One resolved\n * `Signal<TemplateRef | null>` per slot; `null` means the organism\n * renders its built-in default.\n *\n * @category common/tabs/slots\n */\nexport interface CngxTabGroupTemplateBindings {\n readonly errorBadge: Signal<TemplateRef<CngxTabErrorBadgeContext> | null>;\n readonly rejectionIcon: Signal<TemplateRef<CngxTabRejectionIconContext> | null>;\n readonly busySpinner: Signal<TemplateRef<CngxTabBusySpinnerContext> | null>;\n readonly icon: Signal<TemplateRef<CngxTabIconContext> | null>;\n readonly closeIcon: Signal<TemplateRef<CngxTabCloseIconContext> | null>;\n readonly addIcon: Signal<TemplateRef<void> | null>;\n}\n\n/**\n * Wires the 3-stage template cascade for the `<cngx-tab-group>` skin\n * slots (errorBadge / rejectionIcon / busySpinner / icon / closeIcon /\n * addIcon):\n * per-instance directive >\n * `CNGX_TABS_CONFIG.templates.<key>` >\n * `null`.\n *\n * `null` means the organism renders its built-in default - a default\n * span for the state decorations, the `CNGX_TABS_GLYPHS` glyph for\n * `closeIcon` / `addIcon`, and nothing for `icon`.\n *\n * Pure — no DI, no side effects. Safe in field-init. Sibling to\n * `createStepperTemplateBindings` and `createTabOverflowTemplateBindings`.\n *\n * Single-consumer today: `[cngxMatTabs]` does not consume this —\n * Material owns the rendered tab-button chrome via its own MDC\n * template, leaving no DOM seam. See `tabs-accepted-debt §9`.\n *\n * **UX / a11y**\n * - The cascade is presentation-only; the accessibility contract is\n * invariant under it. Overriding a slot never strips its accessible\n * default (fallthrough to a built-in or the organism default).\n * - The screen-reader channel (descriptor / `aria-busy` / live region)\n * lives on the organism, not the slot template, so swapping a decoration\n * template changes only the visual.\n * - An unbound `icon` slot resolves to nothing, which is correct - the\n * icon is decorative and the label carries the accessible name.\n *\n * @category common/tabs/slots\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/slots/tab-group-template-cascade.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroup, CngxTabErrorBadge, CngxTabBusySpinner, CngxTabRejectionIcon\n */\nexport function createTabGroupTemplateBindings(\n opts: CngxTabGroupTemplateBindingsOptions,\n): CngxTabGroupTemplateBindings {\n return {\n errorBadge: computed<TemplateRef<CngxTabErrorBadgeContext> | null>(\n () => opts.errorBadgeSlot()?.templateRef ?? opts.config.templates?.errorBadge ?? null,\n ),\n rejectionIcon: computed<TemplateRef<CngxTabRejectionIconContext> | null>(\n () => opts.rejectionIconSlot()?.templateRef ?? opts.config.templates?.rejectionIcon ?? null,\n ),\n busySpinner: computed<TemplateRef<CngxTabBusySpinnerContext> | null>(\n () => opts.busySpinnerSlot()?.templateRef ?? opts.config.templates?.busySpinner ?? null,\n ),\n icon: computed<TemplateRef<CngxTabIconContext> | null>(\n () => opts.iconSlot()?.templateRef ?? opts.config.templates?.icon ?? null,\n ),\n closeIcon: computed<TemplateRef<CngxTabCloseIconContext> | null>(\n () => opts.closeIconSlot?.()?.templateRef ?? opts.config.templates?.closeIcon ?? null,\n ),\n addIcon: computed<TemplateRef<void> | null>(\n () => opts.addIconSlot?.()?.templateRef ?? opts.config.templates?.addIcon ?? null,\n ),\n };\n}\n","// Single-consumer factory — staged under family-uniformity\n// (`createTabGroupTemplateBindings` and `CngxMatTabAggregatorContent`).\n// Re-eval on second consumer or sibling debt closure.\nimport { computed, linkedSignal, type Signal } from '@angular/core';\n\nimport type { CngxTabsConfig } from '../tabs-config';\nimport type { CngxTabsI18n } from '../i18n/tabs-i18n';\nimport type { CngxTabGroupHost, CngxTabHandle } from '../tab-group-host.token';\n\n/**\n * Inputs the announcements bundle reads from the host organism.\n * Passing presenter / i18n / config in (instead of re-injecting)\n * keeps the factory pure — one call returns the bundle, no\n * injection context required.\n *\n * @category common/tabs/announcements\n */\nexport interface CngxTabGroupAnnouncementsOptions {\n readonly presenter: CngxTabGroupHost;\n readonly i18n: CngxTabsI18n;\n readonly config: CngxTabsConfig;\n /** Per-instance `aria-label` Input on the organism. */\n readonly ariaLabel: Signal<string | undefined>;\n /** Per-instance `aria-labelledby` Input on the organism. */\n readonly ariaLabelledBy: Signal<string | undefined>;\n}\n\n/**\n * Resolved bundle returned by {@link createTabGroupAnnouncements}.\n * Host bindings and template outlets read these directly. Owns one\n * internal `linkedSignal` slot (prior-active-index tracker driving\n * the success-arm direction prefix); consumers never touch it.\n *\n * @category common/tabs/announcements\n */\nexport interface CngxTabGroupAnnouncements {\n /**\n * Tablist `aria-roledescription`. Cascades through\n * `CngxTabsFallbackLabels.tabRoleDescription` → `'tab list'`.\n * Distinct from `i18n.tabsLabel` (which feeds `aria-label`) so\n * AT does not read the same word twice.\n */\n readonly tabsRoleDescription: Signal<string>;\n\n /**\n * Tab-panel `aria-roledescription`. Cascades through\n * `CngxTabsFallbackLabels.tabPanelRoleDescription` → `'tab panel'`.\n */\n readonly tabPanelRoleDescription: Signal<string>;\n\n /**\n * Wrapper `aria-label`. Resolution: per-instance Input →\n * `ariaLabels.tabsRegion` → `i18n.tabsLabel`. Returns `null` when\n * `aria-labelledby` is bound (mutually exclusive per WAI-ARIA).\n */\n readonly resolvedAriaLabel: Signal<string | null>;\n\n /**\n * Polite live-region content — declarative, never an imperative\n * `announce()`. Empty between transitions so the region stays\n * quiet on no-op ticks.\n *\n * Error arm: `commitRolledBackTo(originLabel)` when origin\n * resolves; otherwise `commitFailedRetry`.\n *\n * Success arm: `${previousTab|nextTab}: selectedTab(...)` when\n * the index moved; bare `selectedTab(...)` when it didn't (initial\n * mount, or commit-success that lands on the same tab).\n */\n readonly liveAnnouncement: Signal<string>;\n\n /**\n * SR descriptor phrase for a tab's `cngx-sr-only` span. Gated on the\n * folded `tab.hasError()` so a direct `[error]` tab announces without\n * an aggregator. Resolution: `aggregator.announcement()` →\n * `tab.errorMessage()` (the direct-channel message) →\n * `i18n.tabHasErrors(errorCount)`. Empty string when the tab has no\n * error. The span itself is always rendered (cngx ARIA-by-value\n * rule); this returns its content.\n */\n statusPhrase(tab: CngxTabHandle): string;\n\n /**\n * Verbose tab-button `aria-label` — `selectedTab(label, position,\n * count)` so AT hears \"Tab 2 of 5: Settings\" instead of inferring\n * position from tablist enumeration. The visual span keeps the\n * bare label.\n */\n tabAriaLabel(tab: CngxTabHandle, position: number): string;\n}\n\n/**\n * Pure factory bundling the `<cngx-tab-group>` AT-announcement +\n * descriptor surfaces. Owns one internal `linkedSignal`\n * (prior-active-index, drives the success-arm direction prefix) —\n * lazy by `linkedSignal` semantics, so the organism reads\n * `liveAnnouncement` once at construction to seed it.\n *\n * **UX / a11y**\n * - The live region is declarative, never imperative: `liveAnnouncement`\n * is a signal the polite region renders, empty between transitions so\n * AT stays silent on no-op ticks.\n * - Direction is spoken on every change: a move carries a previous/next\n * prefix plus the landing tab; a rollback announces the safe-harbour tab\n * or a retry, so the outcome is never silent.\n * - Accessible names carry position (\"Tab 2 of 5: Settings\") so AT does\n * not infer it from tablist enumeration.\n * - Role descriptions stay distinct from the label: the tablist\n * `aria-roledescription` is separate from the region `aria-label`, so AT\n * never reads the same word twice.\n * - `aria-label` and `aria-labelledby` stay mutually exclusive\n * (`resolvedAriaLabel` returns `null` when labelledby is bound).\n * - The per-tab descriptor is ARIA-by-value: the `cngx-sr-only` span is\n * always in the DOM; `statusPhrase` only fills its content, keeping the\n * `aria-describedby` reference stable.\n *\n * @category common/tabs/announcements\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/announcements/tab-group-announcements.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroup, CngxLiveRegion, createTabKeyboardNav\n */\nexport function createTabGroupAnnouncements(\n options: CngxTabGroupAnnouncementsOptions,\n): CngxTabGroupAnnouncements {\n const { presenter, i18n, config, ariaLabel, ariaLabelledBy } = options;\n\n const tabsRoleDescription = computed<string>(\n () => config.fallbackLabels?.tabRoleDescription ?? 'tab list',\n );\n\n const tabPanelRoleDescription = computed<string>(\n () => config.fallbackLabels?.tabPanelRoleDescription ?? 'tab panel',\n );\n\n const resolvedAriaLabel = computed<string | null>(() => {\n if (ariaLabelledBy()) {\n return null;\n }\n return ariaLabel() ?? config.ariaLabels?.tabsRegion ?? i18n.tabsLabel;\n });\n\n // `prev?.source` = source value before the most recent change —\n // prior activeIndex without an `effect`-driven slot (Pillar 1).\n // Coalesce to current on first emission.\n const priorActiveIndex = linkedSignal<number, number>({\n source: () => presenter.activeIndex(),\n computation: (curr, prev) => prev?.source ?? curr,\n equal: Object.is,\n });\n\n const liveAnnouncement = computed<string>(() => {\n const current = presenter.commitTransition.current();\n if (current === 'pending') {\n return i18n.commitInFlight;\n }\n if (current === 'error') {\n // No `previous === 'pending'` guard — sync rejections collapse\n // pending → error in one flush, so the tracker captures\n // `previous = 'idle'` and an unguarded read keeps the\n // announcement reachable for `commitAction = () => false`.\n const failedIdx = presenter.lastFailedIndex();\n const originIdx = presenter.originIndexDuringCommit();\n if (failedIdx !== undefined && originIdx !== undefined) {\n const originLabel = presenter.tabs()[originIdx]?.label();\n if (originLabel) {\n return i18n.commitRolledBackTo(originLabel);\n }\n }\n return i18n.commitFailedRetry;\n }\n if (current === 'success') {\n const tabs = presenter.tabs();\n const idx = presenter.activeIndex();\n const tab = tabs[idx];\n if (!tab) {\n return '';\n }\n const label = tab.label() ?? '';\n const positionPhrase = i18n.selectedTab(label, idx + 1, tabs.length);\n const prevIdx = priorActiveIndex();\n if (idx > prevIdx) {\n return `${i18n.nextTab}: ${positionPhrase}`;\n }\n if (idx < prevIdx) {\n return `${i18n.previousTab}: ${positionPhrase}`;\n }\n return positionPhrase;\n }\n return '';\n });\n\n function statusPhrase(tab: CngxTabHandle): string {\n if (!tab.hasError()) {\n return '';\n }\n const aggregator = tab.errorAggregator();\n const announcement = aggregator?.announcement();\n if (announcement) {\n return announcement;\n }\n const directMessage = tab.errorMessage();\n if (directMessage) {\n return directMessage;\n }\n return i18n.tabHasErrors(aggregator?.errorCount() ?? 1);\n }\n\n function tabAriaLabel(tab: CngxTabHandle, position: number): string {\n const tabs = presenter.tabs();\n const label = tab.label() ?? '';\n const detail = tab.subLabel();\n const labelPart = detail ? i18n.tabLabelWithDetail(label, detail) : label;\n return i18n.selectedTab(labelPart, position, tabs.length);\n }\n\n // Eager seed — `linkedSignal` is lazy and the success arm doesn't\n // touch the tracker at construction (commitTransition is `idle`),\n // so without this read `prev?.source` is undefined on the first\n // nav and the direction prefix is silently lost.\n priorActiveIndex();\n\n return {\n tabsRoleDescription,\n tabPanelRoleDescription,\n resolvedAriaLabel,\n liveAnnouncement,\n statusPhrase,\n tabAriaLabel,\n };\n}\n","/**\n * Default glyph fallbacks for `<cngx-tab-group>` skin slots. Read by\n * the organism when neither a per-instance slot directive nor\n * `CNGX_TABS_CONFIG.templates.<key>` is bound. Sibling to\n * `CNGX_SELECT_GLYPHS` and `CNGX_STEPPER_GLYPHS`. Exported because\n * Sheriff forbids deep-relative imports across library boundaries;\n * `@internal` enforces consumer intent. Consumers customise via slot\n * directives or `withTab*Template` config features.\n *\n * @internal\n * @category common/tabs\n */\nexport const CNGX_TABS_GLYPHS = {\n /** Default visual for `*cngxTabErrorBadge` when no override is bound. */\n errorBadge: '!',\n /** Default visual for `*cngxTabRejectionIcon` when no override is bound. */\n rejectionIcon: '!',\n /** Default visual for a tab's close button when no override is bound. */\n closeIcon: '×',\n /** Default visual for the add-tab button when no override is bound. */\n addIcon: '+',\n} as const;\n","import {\n effect,\n InjectionToken,\n untracked,\n type Signal,\n computed,\n type TemplateRef,\n} from '@angular/core';\n\nimport type { ActiveDescendantItem, CngxActiveDescendant } from '@cngx/common/a11y';\nimport type { CngxPopover } from '@cngx/common/popover';\n\nimport type { CngxTabHandle } from '../tab-group-host.token';\nimport type { CngxTabsConfig } from '../tabs-config';\nimport type {\n CngxTabOverflowItem,\n CngxTabOverflowItemContext,\n} from './tab-overflow-item.directive';\nimport type {\n CngxTabOverflowTrigger,\n CngxTabOverflowTriggerContext,\n} from './tab-overflow-trigger.directive';\n\n/**\n * DOM `id` for a hidden-tab option row in the overflow listbox. \\\n * Stable across CD passes so `aria-activedescendant` resolves to\n * the same `<li>`. `-overflow-option` suffix avoids collision with\n * the strip-button (`-header`) and per-tab descriptor (`-desc`).\n *\n * @category common/tabs/overflow\n */\nexport function tabOverflowOptionId(tab: CngxTabHandle): string {\n return `${tab.id}-overflow-option`;\n}\n\n/**\n * Inputs to {@link createTabOverflowTemplateBindings}. \\\n * The molecule runs the `contentChild()` queries (injection-context-only) and\n * supplies the reactive sources; the factory owns cascade\n * resolution and per-context builders.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowTemplateBindingsOptions {\n /** `contentChild(CngxTabOverflowTrigger)` from the molecule. */\n readonly triggerSlot: Signal<CngxTabOverflowTrigger | undefined>;\n /** `contentChild(CngxTabOverflowItem)` from the molecule. */\n readonly itemSlot: Signal<CngxTabOverflowItem | undefined>;\n /** Resolved {@link CngxTabsConfig} (the middle cascade tier). */\n readonly config: CngxTabsConfig;\n /** Live count of hidden tabs (drives `triggerContext.count`). */\n readonly hiddenCount: Signal<number>;\n /** Live hidden-tab list (drives `triggerContext.hiddenTabs`). */\n readonly hiddenTabs: Signal<readonly CngxTabHandle[]>;\n /** Commit-aware select callback - invoked from `itemContext.pick`. */\n readonly pickTab: (tab: CngxTabHandle) => void;\n}\n\n/**\n * Output of {@link createTabOverflowTemplateBindings}. Carries the two\n * resolved templates plus a stable trigger-context signal and an\n * imperative item-context builder.\n *\n * @category common/tabs/overflow\n */\nexport interface CngxTabOverflowTemplateBindings {\n readonly triggerTemplate: Signal<TemplateRef<CngxTabOverflowTriggerContext> | null>;\n readonly itemTemplate: Signal<TemplateRef<CngxTabOverflowItemContext> | null>;\n readonly triggerContext: Signal<CngxTabOverflowTriggerContext>;\n readonly buildItemContext: (tab: CngxTabHandle, index: number) => CngxTabOverflowItemContext;\n /**\n * `ActiveDescendantItem[]` projection of `hiddenTabs()` for\n * `CngxActiveDescendant.items`. \\\n * Each entry's `id` matches the\n * row's `<li>` (see {@link tabOverflowOptionId}); `value` carries\n * the tab handle so AD's `(activated)` payload casts back without\n * a registry lookup. Structural equal guards against no-op IO\n * cascades. \\\n * Mutable array shape because `CngxActiveDescendant.items` declares the input that way; the\n * array is rebuilt each computed run so callers can't mutate the\n * live source.\n */\n readonly adItems: Signal<ActiveDescendantItem[]>;\n}\n\n/**\n * Structural equal - same `count` + same `hiddenTabs` reference.\n * The upstream `hiddenTabs` signal already uses `tabIdListEqual`,\n * so this guard stops `ngTemplateOutlet` rebinding on shape-stable\n * IO emissions.\n *\n * @internal\n */\nfunction triggerContextEqual(\n a: CngxTabOverflowTriggerContext,\n b: CngxTabOverflowTriggerContext,\n): boolean {\n return a.count === b.count && a.hiddenTabs === b.hiddenTabs;\n}\n\n/**\n * Structural equal - same length + per-index `id` and `disabled`.\n * Without this, every IO emission yields fresh\n * `ActiveDescendantItem[]` references and AD's `resolvedItems`\n * cascade fires for an unchanged visible-tab set.\n *\n * @internal\n */\nfunction adItemsEqual(a: ActiveDescendantItem[], b: ActiveDescendantItem[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i].id !== b[i].id || a[i].disabled !== b[i].disabled) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Wires the 3-stage template cascade for the overflow molecule's\n * two visible regions: \\\n * per-instance directive > `CNGX_TABS_CONFIG.templates.overflow*` > built-in markup\n * (template-outlet returns `null`). \\\n *\n * Pure - no DI, no side effects, no destroy hooks. Safe to call\n * from a component's field-init block. Mirrors the select-family\n * `createTemplateRegistry` pattern.\n *\n * @category common/tabs/overflow\n */\nexport function createTabOverflowTemplateBindings(\n opts: CngxTabOverflowTemplateBindingsOptions,\n): CngxTabOverflowTemplateBindings {\n const triggerTemplate = computed<TemplateRef<CngxTabOverflowTriggerContext> | null>(\n () => opts.triggerSlot()?.templateRef ?? opts.config.templates?.overflowTrigger ?? null,\n );\n const itemTemplate = computed<TemplateRef<CngxTabOverflowItemContext> | null>(\n () => opts.itemSlot()?.templateRef ?? opts.config.templates?.overflowItem ?? null,\n );\n const triggerContext = computed<CngxTabOverflowTriggerContext>(\n () => {\n const count = opts.hiddenCount();\n const hiddenTabs = opts.hiddenTabs();\n return { $implicit: count, count, hiddenTabs };\n },\n { equal: triggerContextEqual },\n );\n // Per-row context cache - stable context and closure-captured `pick`\n // per `tab` so `ngTemplateOutlet` doesn't re-bind the embedded view\n // unless `index` or `disabled` actually changed. WeakMap so\n // detached handles GC. Mirrors `CngxTreeSelectPanel.nodeContext`.\n interface CachedRow {\n readonly context: CngxTabOverflowItemContext;\n readonly disabled: boolean;\n readonly index: number;\n }\n const itemContextCache = new WeakMap<CngxTabHandle, CachedRow>();\n const buildItemContext = (tab: CngxTabHandle, index: number): CngxTabOverflowItemContext => {\n const disabled = tab.disabled();\n const cached = itemContextCache.get(tab);\n if (cached?.disabled === disabled && cached?.index === index) {\n return cached.context;\n }\n const context: CngxTabOverflowItemContext = {\n $implicit: tab,\n tab,\n pick: () => opts.pickTab(tab),\n disabled,\n index,\n };\n itemContextCache.set(tab, { context, disabled, index });\n return context;\n };\n const adItems = computed<ActiveDescendantItem[]>(\n () =>\n opts.hiddenTabs().map((tab) => ({\n id: tabOverflowOptionId(tab),\n value: tab,\n label: tab.label() ?? tab.id,\n disabled: tab.disabled(),\n })),\n { equal: adItemsEqual },\n );\n return {\n triggerTemplate,\n itemTemplate,\n triggerContext,\n buildItemContext,\n adItems,\n };\n}\n\n/**\n * Resets the AD highlight on popover close. \\\n * Keyboard-open paths\n * (ArrowDown / End / typeahead on the closed trigger) set\n * `activeIndex` via AD's own keydown listener before opening -\n * unaffected. Mouse-open leaves `activeIndex === -1` so the popover\n * renders unhighlighted. \\\n * Without this reset, the next open would\n * inherit a stale index from the prior keyboard session.\n *\n * **Must run in injection context.**\n *\n * ### UX / a11y\n * - Closing the popover resets the highlight, so a keyboard session never\n * leaves a stale `aria-activedescendant` for the next open.\n * - Each row has a stable descendant id (`tabOverflowOptionId`), so the SR\n * focus reference never dangles across re-renders.\n * - Highlight is virtual focus, not DOM focus: keyboard nav moves\n * `aria-activedescendant` while real focus stays on the trigger (APG\n * menu-button); the rows are never tab stops.\n *\n * @category common/tabs/overflow\n * @wcag AA\n */\nexport function createOverflowPopoverHighlightSync(\n popover: Signal<CngxPopover>,\n ad: Signal<CngxActiveDescendant>,\n): void {\n effect(() => {\n const visible = popover().isVisible();\n untracked(() => {\n if (!visible) {\n ad().resetHighlight();\n }\n });\n });\n}\n\n/**\n * Factory signature for {@link CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY}.\n *\n * @category common/tabs/overflow\n */\nexport type CngxOverflowPopoverHighlightSyncFactory = (\n popover: Signal<CngxPopover>,\n ad: Signal<CngxActiveDescendant>,\n) => void;\n\n/**\n * DI token for the overflow popover highlight-sync policy. \\\n * Default {@link createOverflowPopoverHighlightSync}. Override via\n * `providers` / `viewProviders` for last-index preservation,\n * telemetry on close, custom highlight rules. \\\n * Symmetric to\n * - `CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY` and\n * - `CNGX_TABS_COMMIT_HANDLER_FACTORY`.\n *\n * @category common/tabs/overflow\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/overflow/overflow-template-cascade.ts\n * @since 0.1.0\n */\nexport const CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY =\n new InjectionToken<CngxOverflowPopoverHighlightSyncFactory>(\n 'CngxOverflowPopoverHighlightSyncFactory',\n {\n providedIn: 'root',\n factory: () => createOverflowPopoverHighlightSync,\n },\n );\n","import {\n effect,\n InjectionToken,\n type Injector,\n runInInjectionContext,\n type Signal,\n untracked,\n} from '@angular/core';\n\n/**\n * Options for {@link createOrganismScrollSync}.\n *\n * @category common/tabs/scroll-sync\n */\nexport interface CngxOrganismScrollSyncOptions {\n /** Reactive source for the active item id; tracked by the effect. */\n readonly activeId: Signal<string | null>;\n /**\n * Host element containing the per-item buttons. Items must carry\n * `id=\"${itemId}-header\"` - the convention used by\n * `<cngx-tab-group>` and `<cngx-stepper>`.\n */\n readonly hostElement: HTMLElement;\n /**\n * Forwarded to `Element.scrollIntoView`. Default: smooth-center\n * along the inline axis. Override for vertical or instant scroll.\n */\n readonly scrollOptions?: ScrollIntoViewOptions;\n /** Injector for installing the effect. */\n readonly injector: Injector;\n}\n\nconst DEFAULT_SCROLL_OPTIONS: ScrollIntoViewOptions = {\n behavior: 'smooth',\n block: 'nearest',\n inline: 'center',\n};\n\n/**\n * Scroll-into-view effect for any strip-based organism (tabs,\n * stepper headers, future scrolling lists). \\\n * Tracks `activeId` and scrolls the matching `[id=\"<itemId>-header\"]` into view.\n *\n * The DOM call sits in `untracked()` (only `activeId` is tracked). \\\n * `scrollIntoView` is missing in jsdom - guarded with optional chain.\n *\n * ### UX / a11y\n * - The active tab is never stranded off-screen: when activation moves to\n * a tab clipped by overflow (keyboard arrow, deep link, programmatic\n * select), its header scrolls into view, so the focused and selected\n * tab is always visible (WCAG 2.4.7 Focus Visible).\n * - Pairs with the overflow surface: picking a hidden tab from the \"More\"\n * popover scrolls it back into the strip, and the overflow recompute\n * then self-trims - keyboard navigation and the overflow list stay in\n * sync.\n * - Motion is overridable for reduced motion: the default is smooth-center\n * along the inline axis; pass `scrollOptions` (e.g. `behavior: 'auto'`)\n * to honour `prefers-reduced-motion` or to scroll vertically.\n *\n * ```ts\n * // Install once from the organism's field-init (needs an injection context).\n * createOrganismScrollSync({\n * activeId: this.presenter.activeId, // Signal<string | null>\n * hostElement: this.hostElement, // holds the [id=\"<tabId>-header\"] buttons\n * injector: this.injector,\n * // scrollOptions omitted -> smooth-center; override for reduced motion:\n * // scrollOptions: { behavior: 'auto' },\n * });\n * ```\n *\n * @category common/tabs/scroll-sync\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/scroll-sync/organism-scroll-sync.ts\n * @since 0.1.0\n * @relatedTo CngxTabGroup, CngxTabOverflow, CNGX_ORGANISM_SCROLL_SYNC_FACTORY\n */\nexport function createOrganismScrollSync(opts: CngxOrganismScrollSyncOptions): void {\n const { activeId, hostElement, scrollOptions, injector } = opts;\n const resolvedOptions = scrollOptions ?? DEFAULT_SCROLL_OPTIONS;\n\n runInInjectionContext(injector, () => {\n effect(() => {\n const id = activeId();\n if (!id) {\n return;\n }\n untracked(() => {\n const button = hostElement.querySelector<HTMLElement>(`[id=\"${id}-header\"]`);\n button?.scrollIntoView?.(resolvedOptions);\n });\n });\n });\n}\n\n/**\n * Factory signature for {@link CNGX_ORGANISM_SCROLL_SYNC_FACTORY}.\n *\n * @category common/tabs/scroll-sync\n */\nexport type CngxOrganismScrollSyncFactory = (opts: CngxOrganismScrollSyncOptions) => void;\n\n/**\n * DI token for the active-item scroll-into-view policy. \\\n * The default, {@link createOrganismScrollSync}, scrolls the active tab's header into\n * view on every `activeId` change. \\\n * Override the whole policy to swap the\n * scroll behaviour, target a different selector, add telemetry, opt out\n * of motion, or disable it entirely.\n *\n * Provided in root with the default factory, so consumers override only\n * when they need to. \\\n *\n * Sibling to\n * - `CNGX_DOM_ANCHOR_RETRY_FACTORY` and\n * - `CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY`.\n *\n * ```ts\n * // Honour prefers-reduced-motion app-wide:\n * providers: [\n * {\n * provide: CNGX_ORGANISM_SCROLL_SYNC_FACTORY,\n * useValue: (opts) =>\n * createOrganismScrollSync({ ...opts, scrollOptions: { behavior: 'auto' } }),\n * },\n * ];\n * // Or disable scroll-into-view entirely: useValue: () => {}\n * ```\n *\n * @category common/tabs/scroll-sync\n * @wcag AA\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/scroll-sync/organism-scroll-sync.ts\n * @since 0.1.0\n * @relatedTo createOrganismScrollSync, CngxOrganismScrollSyncFactory\n */\nexport const CNGX_ORGANISM_SCROLL_SYNC_FACTORY = new InjectionToken<CngxOrganismScrollSyncFactory>(\n 'CngxOrganismScrollSyncFactory',\n {\n providedIn: 'root',\n factory: () => createOrganismScrollSync,\n },\n);\n","import { computed, InjectionToken, type Signal } from '@angular/core';\n\n/**\n * Structural equal for `Map<string, T>` (size + same value reference\n * per key, via `Object.is`).\n *\n * @internal\n */\nfunction directiveMapEqual<T>(a: Map<string, T>, b: Map<string, T>): boolean {\n if (a === b) {\n return true;\n }\n if (a.size !== b.size) {\n return false;\n }\n for (const [id, dir] of a) {\n if (b.get(id) !== dir) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Options for {@link createDirectiveByIdMap}.\n *\n * @category common/tabs/registry\n */\nexport interface CngxDirectiveByIdMapOptions<T extends { id: () => string }> {\n /** Reactive source - typically `contentChildren(...)`. */\n readonly source: Signal<readonly T[]>;\n}\n\n/**\n * Build a `Signal<Map<string, T>>` from a `Signal<readonly T[]>` of\n * directives keyed by `id()`. Structural equal prevents cascade when\n * `contentChildren` re-emits an unchanged child set. Shared by\n * `<cngx-tab-group>`, `<cngx-stepper>`, and `<cngx-mat-stepper>`.\n *\n * @category common/tabs/registry\n */\nexport function createDirectiveByIdMap<T extends { id: () => string }>(\n opts: CngxDirectiveByIdMapOptions<T>,\n): Signal<Map<string, T>> {\n return computed<Map<string, T>>(\n () => {\n const map = new Map<string, T>();\n for (const dir of opts.source()) {\n map.set(dir.id(), dir);\n }\n return map;\n },\n { equal: directiveMapEqual },\n );\n}\n\n/**\n * Factory signature for {@link CNGX_DIRECTIVE_BY_ID_MAP_FACTORY}.\n *\n * @category common/tabs/registry\n */\nexport type CngxDirectiveByIdMapFactory = <T extends { id: () => string }>(\n opts: CngxDirectiveByIdMapOptions<T>,\n) => Signal<Map<string, T>>;\n\n/**\n * DI token for the per-id directive-resolution policy. \\\n * Defaults to {@link createDirectiveByIdMap}. Override for WeakMap resolution,\n * telemetry, or custom equality. \\\n * Sibling to\n * - `CNGX_DOM_ANCHOR_RETRY_FACTORY` and\n * - `CNGX_ORGANISM_SCROLL_SYNC_FACTORY`.\n *\n * @category common/tabs/registry\n * @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/registry/directive-by-id-map.ts\n * @since 0.1.0\n */\nexport const CNGX_DIRECTIVE_BY_ID_MAP_FACTORY = new InjectionToken<CngxDirectiveByIdMapFactory>(\n 'CngxDirectiveByIdMapFactory',\n {\n providedIn: 'root',\n factory: () => createDirectiveByIdMap,\n },\n);\n","/**\n * @module @cngx/common/tabs\n */\nexport {\n CngxTabGroupPresenter,\n type CngxTabsCommitAction,\n} from './presenter.directive';\nexport {\n CNGX_TAB_GROUP_HOST,\n type CngxTabCloseEvent,\n type CngxTabGroupHost,\n type CngxTabHandle,\n} from './tab-group-host.token';\nexport {\n CNGX_TAB_PANEL_HOST,\n type CngxTabPanelHost,\n} from './tab-panel-host.token';\nexport { CngxTab } from './tab.directive';\nexport { CngxTabLink } from './tab-link.directive';\nexport { CngxTabLabel } from './tab-label.directive';\nexport { CngxTabSubLabel } from './slots/tab-sub-label.directive';\nexport { CngxTabContent } from './tab-content.directive';\nexport { CngxTabsFragmentSync } from './router-sync.directive';\nexport { CngxTabsRouteSync } from './route-sync.directive';\nexport {\n createTabRouterCommit,\n type CngxTabRouterCommitOptions,\n} from './router-commit';\nexport {\n CNGX_TABS_COMMIT_ACTION,\n type CngxTabsCommitActionSource,\n} from './commit-action.token';\nexport {\n CNGX_TABS_CONFIG,\n injectTabsConfig,\n provideTabsConfig,\n provideTabsConfigAt,\n withDefaultOrientation,\n withTabBusySpinnerTemplate,\n withTabErrorBadgeTemplate,\n withTabIconTemplate,\n withTabOverflowItemTemplate,\n withTabOverflowMaxDeferMs,\n withTabOverflowStabilizeMs,\n withTabOverflowTriggerTemplate,\n withTabRejectionIconTemplate,\n withTabsAriaLabels,\n withTabsCommitMode,\n withTabsDefaultOrientation,\n withTabAddIconTemplate,\n withTabCloseIconTemplate,\n withTabsAddable,\n withTabsAlign,\n withTabsClosable,\n withTabsFallbackLabels,\n withTabsFitted,\n withTabsIconLayout,\n withTabsPanelMode,\n withTabsFragmentSync,\n withTabsRouterSync,\n withTabsRovingLoop,\n withTabsSkin,\n type CngxTabAlign,\n type CngxTabIconLayout,\n type CngxTabsAriaLabels,\n type CngxTabsConfig,\n type CngxTabsConfigFeature,\n type CngxTabsFallbackLabels,\n type CngxTabsPanelMode,\n type CngxTabsSkin,\n type CngxTabsTemplates,\n} from './tabs-config';\n// This block ships `@internal` factory helpers. They are exported\n// through `public-api.ts` so the sibling `@cngx/ui/tabs` organism can\n// consume them across the secondary-entry boundary (ng-packagr has no\n// cross-entry private surface). `disableInternal: true` hides them from\n// generated docs; the LLM-md export honours the same tag. Precedent:\n// `CNGX_TABS_GLYPHS`, `tabsEqual`.\nexport {\n createTabsHostAttrs,\n type CngxTabsHostAttrs,\n type CngxTabsHostAttrsInputs,\n} from './tabs-host-attrs';\nexport {\n provideCngxTabs,\n provideCngxTabsAt,\n type CngxTabsFeature,\n} from './provide-cngx-tabs';\nexport {\n CNGX_TABS_I18N,\n injectTabsI18n,\n provideTabsI18n,\n withTabsI18nLabels,\n type CngxTabsI18n,\n type CngxTabsI18nFeature,\n} from './i18n/tabs-i18n';\nexport {\n createTabsCommitHandler,\n CNGX_TABS_COMMIT_HANDLER_FACTORY,\n type CngxTabsCommitHandler,\n type CngxTabsCommitHandlerFactory,\n type CngxTabsCommitHandlerOptions,\n} from './commit-handler';\nexport {\n CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY,\n createCngxTabOverflowDefaultDomAdapter,\n type CngxTabOverflowDomAdapter,\n type CngxTabOverflowDomAdapterFactory,\n} from './overflow/dom-adapter';\nexport {\n CNGX_DOM_ANCHOR_RETRY_FACTORY,\n createDomAnchorRetry,\n type CngxDomAnchorRetryFactory,\n type CngxDomAnchorRetryHandle,\n type CngxDomAnchorRetryOptions,\n type CngxDomAnchorRetryResult,\n} from './overflow/dom-anchor-retry';\nexport {\n CngxTabOverflowTrigger,\n type CngxTabOverflowTriggerContext,\n} from './overflow/tab-overflow-trigger.directive';\nexport {\n CngxTabOverflowItem,\n type CngxTabOverflowItemContext,\n} from './overflow/tab-overflow-item.directive';\nexport {\n CngxTabErrorBadge,\n type CngxTabErrorBadgeContext,\n} from './slots/tab-error-badge.directive';\nexport {\n CngxTabRejectionIcon,\n type CngxTabRejectionIconContext,\n} from './slots/tab-rejection-icon.directive';\nexport {\n CngxTabBusySpinner,\n type CngxTabBusySpinnerContext,\n} from './slots/tab-busy-spinner.directive';\nexport {\n CngxTabIcon,\n type CngxTabIconContext,\n} from './slots/tab-icon.directive';\nexport {\n CngxTabCloseIcon,\n type CngxTabCloseIconContext,\n} from './slots/tab-close-icon.directive';\nexport { CngxTabAddIcon } from './slots/tab-add-icon.directive';\nexport {\n createTabDismissals,\n type CngxTabDismissals,\n type CngxTabDismissalsOptions,\n} from './dismissals/tab-dismissals';\nexport {\n createTabKeyboardNav,\n type CngxTabKeyboardNav,\n type CngxTabKeyboardNavOptions,\n} from './keyboard/tab-keyboard-nav';\nexport {\n createTabGroupTemplateBindings,\n type CngxTabGroupTemplateBindings,\n type CngxTabGroupTemplateBindingsOptions,\n} from './slots/tab-group-template-cascade';\nexport {\n createTabGroupAnnouncements,\n type CngxTabGroupAnnouncements,\n type CngxTabGroupAnnouncementsOptions,\n} from './announcements/tab-group-announcements';\nexport { CNGX_TABS_GLYPHS } from './glyphs';\nexport {\n CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY,\n createOverflowPopoverHighlightSync,\n createTabOverflowTemplateBindings,\n tabOverflowOptionId,\n type CngxOverflowPopoverHighlightSyncFactory,\n type CngxTabOverflowTemplateBindings,\n type CngxTabOverflowTemplateBindingsOptions,\n} from './overflow/overflow-template-cascade';\n\nexport {\n CNGX_ORGANISM_SCROLL_SYNC_FACTORY,\n createOrganismScrollSync,\n type CngxOrganismScrollSyncFactory,\n type CngxOrganismScrollSyncOptions,\n} from './scroll-sync/organism-scroll-sync';\nexport {\n CNGX_DIRECTIVE_BY_ID_MAP_FACTORY,\n createDirectiveByIdMap,\n type CngxDirectiveByIdMapFactory,\n type CngxDirectiveByIdMapOptions,\n} from './registry/directive-by-id-map';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAiCA;;;;;;;;;;AAUG;MACU,uBAAuB,GAAG,IAAI,cAAc,CACvD,sBAAsB;;ACAxB;;;;;;AAMG;AACG,SAAU,uBAAuB,CAAC,IAAkC,EAAA;AACxE,IAAA,MAAM,EAAE,UAAU,EAAE,GAAG,IAAI;IAC3B,OAAO;QACL,YAAY,EAAE,UAAU,CAAC,YAAY;AAErC,QAAA,eAAe,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAA;YACnD,UAAU,CAAC,KAAK,CACd,CAAC,QAAQ,KAAK,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,CAAC,EACjE,OAAO,EACP,SAAS,EACT;AACE,gBAAA,SAAS,EAAE,MAAM,SAAS,CAAC,IAAI,CAAC;AAChC,gBAAA,OAAO,EAAE,MAAM,SAAS,CAAC,KAAK,CAAC;AAChC,aAAA,CACF;QACH,CAAC;QAED,MAAM,GAAA;YACJ,UAAU,CAAC,MAAM,EAAE;QACrB,CAAC;KACF;AACH;AAEA,SAAS,aAAa,CACpB,MAA4B,EAC5B,SAAiB,EACjB,OAAe,EACf,QAGC,EAAA;IAED,IAAI,SAAS,GAAG,KAAK;IACrB,IAAI,WAAW,GAAwB,IAAI;AAE3C,IAAA,MAAM,WAAW,GAAG,CAAC,MAAe,KA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