@flyos/design-system 0.0.1-reserved → 1.0.0

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flyos-design-system.mjs","sources":["../../../projects/design-system/src/lib/fly-federation-singleton-guard.ts","../../../projects/design-system/src/lib/models/window.model.ts","../../../projects/design-system/src/lib/models/share-panel.model.ts","../../../projects/design-system/src/lib/models/audience.model.ts","../../../projects/design-system/src/lib/auth/fly-roles.ts","../../../projects/design-system/src/lib/services/auth.service.ts","../../../projects/design-system/src/lib/directives/fly-if-role.directive.ts","../../../projects/design-system/src/lib/auth/fly-role.guard.ts","../../../projects/design-system/src/lib/auth/fly-auth-contract.ts","../../../projects/design-system/src/lib/auth/step-up/step-up.logic.ts","../../../projects/design-system/src/lib/auth/step-up/step-up.service.ts","../../../projects/design-system/src/lib/auth/step-up/step-up.interceptor.ts","../../../projects/design-system/src/lib/auth/standalone/fly-standalone-auth.config.ts","../../../projects/design-system/src/lib/realtime/fly-hub-client.ts","../../../projects/design-system/src/lib/realtime/fly-auth-live-refresh.ts","../../../projects/design-system/src/lib/auth/standalone/fly-standalone-auth.service.ts","../../../projects/design-system/src/lib/auth/standalone/fly-standalone-auth.guard.ts","../../../projects/design-system/src/lib/auth/standalone/fly-standalone-auth.interceptor.ts","../../../projects/design-system/src/lib/i18n/baseline-locales.ts","../../../projects/design-system/src/lib/services/i18n.service.ts","../../../projects/design-system/src/lib/pipes/translate.pipe.ts","../../../projects/design-system/src/lib/auth/standalone/fly-standalone-auth-callback.component.ts","../../../projects/design-system/src/lib/auth/standalone/provide-fly-standalone-auth.ts","../../../projects/design-system/src/lib/services/fly-theme.service.ts","../../../projects/design-system/src/lib/services/window-manager.service.ts","../../../projects/design-system/src/lib/services/fly-remote-router.types.ts","../../../projects/design-system/src/lib/services/fly-remote-router.service.ts","../../../projects/design-system/src/lib/services/request-app-launch.ts","../../../projects/design-system/src/lib/services/connect-remote-launch.ts","../../../projects/design-system/src/lib/services/fly-remote-context.service.ts","../../../projects/design-system/src/lib/services/source-app-resolver.service.ts","../../../projects/design-system/src/lib/services/fly-window-help.service.ts","../../../projects/design-system/src/lib/services/fly-window-title.service.ts","../../../projects/design-system/src/lib/services/fly-csp-nonce.ts","../../../projects/design-system/src/lib/services/fly-remote-styles.ts","../../../projects/design-system/src/lib/components/remote-router-outlet/remote-router-outlet.component.ts","../../../projects/design-system/src/lib/services/auth.service.mock.ts","../../../projects/design-system/src/lib/services/agent-input/agent-lookup-registry.service.ts","../../../projects/design-system/src/lib/components/entity-lookup/entity-lookup.component.ts","../../../projects/design-system/src/lib/components/entity-lookup/entity-lookup.component.html","../../../projects/design-system/src/lib/directives/fly-click-outside.directive.ts","../../../projects/design-system/src/lib/directives/fly-tooltip.directive.ts","../../../projects/design-system/src/lib/components/emoji-picker/emoji-catalog.data.ts","../../../projects/design-system/src/lib/components/emoji-picker/emoji-catalog.ts","../../../projects/design-system/src/lib/components/emoji-picker/emoji-pack.ts","../../../projects/design-system/src/lib/components/animated-emoji/animated-emoji.component.ts","../../../projects/design-system/src/lib/components/emoji-picker/emoji-picker.component.ts","../../../projects/design-system/src/lib/components/emoji-picker/emoji-picker.component.html","../../../projects/design-system/src/lib/components/context-menu/context-menu.component.ts","../../../projects/design-system/src/lib/components/context-menu/context-menu.component.html","../../../projects/design-system/src/lib/components/message-box/message-box.service.ts","../../../projects/design-system/src/lib/components/message-box/message-box.component.ts","../../../projects/design-system/src/lib/components/message-box/message-box.component.html","../../../projects/design-system/src/lib/components/share-panel/share-panel.component.ts","../../../projects/design-system/src/lib/components/share-panel/share-panel.component.html","../../../projects/design-system/src/lib/components/audience-builder/audience-builder.component.ts","../../../projects/design-system/src/lib/components/audience-builder/audience-builder.component.html","../../../projects/design-system/src/lib/components/block-ui/block-ui.component.ts","../../../projects/design-system/src/lib/components/block-ui/block-ui.component.html","../../../projects/design-system/src/lib/components/card-grid/card-grid.component.ts","../../../projects/design-system/src/lib/components/breadcrumb/breadcrumb.component.ts","../../../projects/design-system/src/lib/components/breadcrumb/breadcrumb.component.html","../../../projects/design-system/src/lib/utils/keyboard-nav.ts","../../../projects/design-system/src/lib/components/tree-nav/tree-nav.component.ts","../../../projects/design-system/src/lib/components/tree-nav/tree-nav.component.html","../../../projects/design-system/src/lib/components/skeleton/skeleton.component.ts","../../../projects/design-system/src/lib/components/skeleton/skeleton.component.html","../../../projects/design-system/src/lib/components/drawer/drawer.component.ts","../../../projects/design-system/src/lib/components/drawer/drawer.component.html","../../../projects/design-system/src/lib/components/image-upload/image-upload.component.ts","../../../projects/design-system/src/lib/components/image-upload/image-upload.component.html","../../../projects/design-system/src/lib/components/file-upload/file-upload.component.ts","../../../projects/design-system/src/lib/components/file-upload/file-upload.component.html","../../../projects/design-system/src/lib/components/select/select.component.ts","../../../projects/design-system/src/lib/components/select/select.component.html","../../../projects/design-system/src/lib/components/typeahead/typeahead.component.ts","../../../projects/design-system/src/lib/components/typeahead/typeahead.component.html","../../../projects/design-system/src/lib/components/cron-builder/cron-builder.types.ts","../../../projects/design-system/src/lib/components/cron-builder/cron-builder.utils.ts","../../../projects/design-system/src/lib/components/cron-builder/cron-builder.component.ts","../../../projects/design-system/src/lib/components/cron-builder/cron-builder.component.html","../../../projects/design-system/src/lib/components/gantt/gantt-scale.ts","../../../projects/design-system/src/lib/components/gantt/gantt.component.ts","../../../projects/design-system/src/lib/components/gantt/gantt.component.html","../../../projects/design-system/src/lib/components/gantt/gantt.types.ts","../../../projects/design-system/src/lib/components/dynamic-form/countries.ts","../../../projects/design-system/src/lib/components/dynamic-form/dynamic-form.component.ts","../../../projects/design-system/src/lib/components/dynamic-form/dynamic-form.component.html","../../../projects/design-system/src/lib/components/dynamic-form/survey-form-alias.ts","../../../projects/design-system/src/lib/components/comment-thread/comment-thread.component.ts","../../../projects/design-system/src/lib/components/comment-thread/comment-thread.component.html","../../../projects/design-system/src/lib/components/captcha/sha256.ts","../../../projects/design-system/src/lib/components/captcha/captcha.component.ts","../../../projects/design-system/src/lib/components/captcha/captcha.component.html","../../../projects/design-system/src/lib/services/agent-input/agent-command-registry.service.ts","../../../projects/design-system/src/lib/services/agent-input/agent-drop-registry.service.ts","../../../projects/design-system/src/lib/models/agent-action.model.ts","../../../projects/design-system/src/lib/models/agent-input.model.ts","../../../projects/design-system/src/lib/utils/agent-payload-guards.ts","../../../projects/design-system/src/lib/services/agent-input/agent-action-bus.service.ts","../../../projects/design-system/src/lib/services/agent-input/agent-flight-animator.service.ts","../../../projects/design-system/src/lib/directives/fly-agent-draggable.directive.ts","../../../projects/design-system/src/lib/directives/fly-secure-src.directive.ts","../../../projects/design-system/src/lib/utils/console-security-warning.ts","../../../projects/design-system/src/lib/models/fly-locale-catalog.ts","../../../projects/design-system/src/lib/utils/chunk-load-error.ts","../../../projects/design-system/src/lib/services/chunk-reload-error-handler.ts","../../../projects/design-system/src/lib/components/badges/badge-wall/badge-wall.component.ts","../../../projects/design-system/src/lib/components/badges/achievement-progress/achievement-progress.component.ts","../../../projects/design-system/src/lib/components/badges/points-tier/points-tier.component.ts","../../../projects/design-system/src/lib/components/badges/leaderboard/leaderboard.component.ts","../../../projects/design-system/src/lib/components/moderation-queue/moderation-queue.component.ts","../../../projects/design-system/src/lib/components/moderation-queue/moderation-queue.component.html","../../../projects/design-system/src/lib/components/people-picker/people-picker.component.ts","../../../projects/design-system/src/lib/components/people-picker/people-picker.component.html","../../../projects/design-system/src/lib/overlays/overlay-stack.ts","../../../projects/design-system/src/lib/overlays/focus-restore.ts","../../../projects/design-system/src/lib/utils/debounce.ts","../../../projects/design-system/src/lib/components/search-input/search-input.component.ts","../../../projects/design-system/src/lib/components/search-input/search-input.component.html","../../../projects/design-system/src/lib/utils/file-download.ts","../../../projects/design-system/src/lib/utils/format.ts","../../../projects/design-system/src/lib/pipes/format.pipes.ts","../../../projects/design-system/src/lib/app-surface/components/button/button.component.ts","../../../projects/design-system/src/lib/app-surface/components/chip/chip.component.ts","../../../projects/design-system/src/lib/app-surface/components/state-message/state-message.logic.ts","../../../projects/design-system/src/lib/app-surface/components/state-message/state-message.component.ts","../../../projects/design-system/src/lib/app-surface/components/spinner.component.ts","../../../projects/design-system/src/lib/app-surface/components/action-stack/action-stack.component.ts","../../../projects/design-system/src/lib/app-surface/components/action-stack/action-stack.component.html","../../../projects/design-system/src/lib/app-surface/components/status-badge/status-badge.component.ts","../../../projects/design-system/src/lib/app-surface/components/status-badge/status-badge.component.html","../../../projects/design-system/src/lib/app-surface/components/kpi.component.ts","../../../projects/design-system/src/lib/app-surface/components/meta-list/meta-list.component.ts","../../../projects/design-system/src/lib/app-surface/components/meta-list/meta-list.component.html","../../../projects/design-system/src/lib/app-surface/listing/pagination/pagination.logic.ts","../../../projects/design-system/src/lib/app-surface/listing/pagination/pagination.component.ts","../../../projects/design-system/src/lib/app-surface/listing/card/card.component.ts","../../../projects/design-system/src/lib/app-surface/listing/card-slots.ts","../../../projects/design-system/src/lib/app-surface/listing/filter-panel/filter-panel.component.ts","../../../projects/design-system/src/lib/app-surface/listing/filter-panel/filter-panel.component.html","../../../projects/design-system/src/lib/app-surface/listing/cell.directive.ts","../../../projects/design-system/src/lib/app-surface/listing/data-table/data-table.logic.ts","../../../projects/design-system/src/lib/app-surface/listing/data-table/data-table.component.ts","../../../projects/design-system/src/lib/app-surface/listing/data-table/data-table.component.html","../../../projects/design-system/src/lib/app-surface/listing/filter-group.ts","../../../projects/design-system/src/lib/app-surface/listing/progress/progress.component.ts","../../../projects/design-system/src/lib/app-surface/listing/sparkline.logic.ts","../../../projects/design-system/src/lib/app-surface/listing/sparkline.component.ts","../../../projects/design-system/src/lib/app-surface/layout/page-header/page-header.component.ts","../../../projects/design-system/src/lib/app-surface/layout/page-header/page-header.component.html","../../../projects/design-system/src/lib/app-surface/layout/section-header/section-header.component.ts","../../../projects/design-system/src/lib/app-surface/layout/app-topbar/app-topbar.logic.ts","../../../projects/design-system/src/lib/app-surface/layout/app-topbar/app-topbar.component.ts","../../../projects/design-system/src/lib/app-surface/layout/app-topbar/app-topbar.component.html","../../../projects/design-system/src/lib/app-surface/forms/segmented/segmented.logic.ts","../../../projects/design-system/src/lib/app-surface/layout/tabs/tabs.logic.ts","../../../projects/design-system/src/lib/app-surface/layout/tabs/tabs.component.ts","../../../projects/design-system/src/lib/app-surface/layout/collapsible/collapsible.component.ts","../../../projects/design-system/src/lib/app-surface/forms/control.directive.ts","../../../projects/design-system/src/lib/app-surface/forms/form-field/form-field.component.ts","../../../projects/design-system/src/lib/app-surface/forms/checkbox/checkbox.component.ts","../../../projects/design-system/src/lib/app-surface/forms/segmented/segmented.component.ts","../../../projects/design-system/src/lib/app-surface/forms/toggle/toggle.component.ts","../../../projects/design-system/src/lib/app-surface/forms/slider/slider.logic.ts","../../../projects/design-system/src/lib/app-surface/forms/slider/slider.component.ts","../../../projects/design-system/src/lib/app-surface/forms/tags-input/tags-input.logic.ts","../../../projects/design-system/src/lib/app-surface/forms/tags-input/tags-input.component.ts","../../../projects/design-system/src/lib/app-surface/forms/form-layout.component.ts","../../../projects/design-system/src/lib/app-surface/forms/form-footer/form-footer.component.ts","../../../projects/design-system/src/lib/app-surface/forms/form-banner/form-banner.component.ts","../../../projects/design-system/src/lib/app-surface/forms/bilingual-field/bilingual-field.component.ts","../../../projects/design-system/src/lib/app-surface/forms/bilingual-field/bilingual-field.component.html","../../../projects/design-system/src/lib/app-surface/overlays/modal/modal.component.ts","../../../projects/design-system/src/lib/app-surface/overlays/confirm-dialog/confirm-dialog.logic.ts","../../../projects/design-system/src/lib/app-surface/overlays/confirm-dialog/confirm-dialog.component.ts","../../../projects/design-system/src/lib/app-surface/overlays/confirm-dialog/confirm-dialog.component.html","../../../projects/design-system/src/lib/app-surface/overlays/action-menu/action-menu.logic.ts","../../../projects/design-system/src/lib/app-surface/overlays/action-menu/action-menu.component.ts","../../../projects/design-system/src/lib/app-surface/overlays/toast.service.ts","../../../projects/design-system/src/lib/app-surface/overlays/toast-host/toast-host.component.ts","../../../projects/design-system/src/lib/app-surface/index.ts","../../../projects/design-system/src/public-api.ts","../../../projects/design-system/src/flyos-design-system.ts"],"sourcesContent":["/**\r\n * Federation singleton self-check (side-effecting module).\r\n *\r\n * Invariant: the design-system MUST resolve to ONE shared instance per browser\r\n * window. The FlyOS shell shares it from workspace SOURCE (federation.config.js\r\n * `sharedMappings` + `features.mappingVersion`, advertising the real version),\r\n * and every federated remote (Circles, …) binds to that single instance as a\r\n * `singleton`. If a remote instead bundles its OWN copy — `requiredVersion`\r\n * unsatisfied, `strictVersion: true`, or the host advertising an empty version\r\n * because `mappingVersion` is off — the platform silently forks. Separate\r\n * `providedIn: 'root'` singletons then mean:\r\n * - cross-app deep links break: `FlyRemoteRouter` writes the canonical\r\n * `?app=&route=` URL on the remote's own instance, so a reload never reaches\r\n * the shell's launch pipeline (see skills/cross-app-deep-linking.md);\r\n * - the `/lookup` + slash-command registries diverge, so entities registered\r\n * in the remote never reach the shell's agent input.\r\n *\r\n * Both bugs are invisible until a user trips over them. This check makes the\r\n * fork LOUD at load time: each DS module evaluation appends its compiled-in\r\n * version to a `globalThis` registry, and a second entry in the same window is\r\n * the fork signal. The healthy case (one shared instance) stays silent.\r\n *\r\n * Why a plain `globalThis` key and not DI: a forked DS means a *separate* module\r\n * graph, so any DI token / module-scoped variable is exactly what's duplicated.\r\n * Only a JS global is shared across module instances in one window — the same\r\n * reason `__FLYOS_SHELL__` and the pending-launches registry use globals.\r\n *\r\n * See skills/business-app-angular-remote.md § \"Design-system singleton across\r\n * the federation boundary\".\r\n */\r\n\r\n// Keep in sync with projects/design-system/package.json \"version\". Used only for\r\n// the diagnostic message — the duplicate-instance detection is version-agnostic.\r\nexport const FLY_DS_VERSION = '1.0.0';\r\n\r\nexport const FLY_DS_REGISTRY_KEY = '__FLY_DS_INSTANCES__';\r\n\r\nexport interface FlyDsInstanceRegistry {\r\n versions: string[];\r\n}\r\n\r\n/**\r\n * Records this design-system instance on the shared `scope` and returns the\r\n * running count of instances seen in this window. Emits a single loud\r\n * `console.error` the moment the count exceeds 1 (the fork signal). Pure aside\r\n * from the registry mutation + console — callable with a fake scope in tests.\r\n */\r\nexport function registerDesignSystemInstance(\r\n scope: Record<string, FlyDsInstanceRegistry | undefined>,\r\n version: string,\r\n): number {\r\n const registry: FlyDsInstanceRegistry = (scope[FLY_DS_REGISTRY_KEY] ??= { versions: [] });\r\n registry.versions.push(version);\r\n if (registry.versions.length > 1) {\r\n console.error(\r\n `[flyos-design-system] Federation singleton FORKED: ${registry.versions.length} ` +\r\n `design-system instances loaded in one window (versions: ${registry.versions.join(', ')}). ` +\r\n `A federated remote is using its own bundled copy instead of the shell's shared ` +\r\n `singleton — cross-app deep links and /lookup registration WILL break. Fix: align the ` +\r\n `remote's federation \\`requiredVersion\\` with the host's advertised version and keep ` +\r\n `\\`features.mappingVersion: true\\` in the shell's federation.config.js.`,\r\n );\r\n }\r\n return registry.versions.length;\r\n}\r\n\r\n// Run once when this module is evaluated — except under the Vitest runner, which\r\n// re-evaluates module graphs per test file against a shared Node global and would\r\n// otherwise accumulate phantom \"instances\". The fork this detects only occurs in a\r\n// real federated browser runtime, where each bundle evaluates the module exactly once.\r\n// Reach `process.env.VITEST` via globalThis rather than the bare `process`\r\n// identifier — the latter needs @types/node, which the production library build\r\n// (tsconfig.lib.prod.json) deliberately doesn't include, and would fail TS2591.\r\nconst underTest = !!(\r\n globalThis as { process?: { env?: Record<string, string | undefined> } }\r\n).process?.env?.['VITEST'];\r\nif (!underTest) {\r\n registerDesignSystemInstance(\r\n globalThis as unknown as Record<string, FlyDsInstanceRegistry | undefined>,\r\n FLY_DS_VERSION,\r\n );\r\n}\r\n","import { InjectionToken, Signal, Type, WritableSignal } from '@angular/core';\r\n\r\nexport type WindowState = 'normal' | 'minimized' | 'maximized';\r\n\r\nexport interface ChildWindowData {\r\n childComponent: Type<unknown>;\r\n [key: string]: unknown;\r\n}\r\n\r\nexport interface WindowInstance {\r\n id: string;\r\n appId: string;\r\n title: string;\r\n icon: string;\r\n iconBg: string;\r\n state: WindowState;\r\n position: { x: number; y: number };\r\n size: { width: number; height: number };\r\n zIndex: number;\r\n isFocused: boolean;\r\n isClosing?: boolean;\r\n isMinimizing?: boolean;\r\n isRestoring?: boolean;\r\n isMaximizing?: boolean;\r\n isUnmaximizing?: boolean;\r\n parentWindowId?: string;\r\n childData?: ChildWindowData;\r\n /** Populated when remote `loadComponent()` fails (e.g. federation). */\r\n remoteLoadError?: string;\r\n /** When true, the shell draws a block overlay over `.window-content` (see `FlyBlockUiComponent`). */\r\n contentUiBlocked?: boolean;\r\n /** i18n key for block overlay label; shell defaults to `common.loading` when unset. */\r\n contentUiBlockMessageKey?: string;\r\n}\r\n\r\nexport const WINDOW_DATA = new InjectionToken<WindowInstance>('WINDOW_DATA');\r\n\r\n/**\r\n * Payload delivered to a window when it is launched (or re-launched) via a deep link.\r\n * Both fields are nullable: a normal dock click yields `route: null`, `params: null`.\r\n * `version` starts at 1 for the first launch and increments on every subsequent\r\n * re-launch of the same window so listeners can dedupe on `version` changes.\r\n */\r\nexport interface LaunchContext {\r\n readonly route: string | null;\r\n readonly params: Readonly<Record<string, unknown>> | null;\r\n readonly version: number;\r\n}\r\n\r\n/**\r\n * Per-window injection token carrying the active `LaunchContext` as a signal.\r\n *\r\n * **Shell-internal.** The shell uses this to track per-window deep-link state across\r\n * dock launches. **Federated remotes must not consume it** — Native Federation can\r\n * split the `InjectionToken` instance across the host and remote bundles, in which\r\n * case `inject(LAUNCH_CONTEXT)` in the remote returns `null` regardless of host\r\n * provisioning. Remotes subscribe to deep links via the federation-safe surfaces\r\n * instead: `FLYOS_LAUNCH_EVENT` (window CustomEvent) plus the\r\n * `__FLYOS_PENDING_LAUNCHES__` registry on `globalThis`. See\r\n * <c>skills/cross-app-deep-linking.md</c>.\r\n */\r\nexport const LAUNCH_CONTEXT = new InjectionToken<Signal<LaunchContext | null>>('LAUNCH_CONTEXT');\r\n\r\n/**\r\n * Detail payload of the <c>flyos:launch</c> window CustomEvent. The shell\r\n * dispatches one event per launch; remotes use this contract to navigate to the\r\n * requested route. Mirrored to <see cref=\"FlyosPendingLaunchesGlobalKey\"/> so a\r\n * remote that mounts AFTER the dispatch can still drain the most recent launch.\r\n */\r\nexport interface FlyLaunchEventDetail {\r\n /** The id used to look up the app in the shell registry (post-canonicalization). */\r\n readonly appId: string;\r\n /** The launch payload — same shape the shell stores on the per-window signal. */\r\n readonly ctx: LaunchContext;\r\n}\r\n\r\n/**\r\n * Name of the window CustomEvent the shell dispatches per launch.\r\n *\r\n * Listeners run on `window` and receive a <c>CustomEvent&lt;FlyLaunchEventDetail&gt;</c>.\r\n * Always filter by `detail.appId` — every remote sees every launch.\r\n */\r\nexport const FLYOS_LAUNCH_EVENT = 'flyos:launch';\r\n\r\n/**\r\n * `globalThis` key for the pending-launches registry. Map<appId, LaunchContext>.\r\n *\r\n * The shell writes the latest launch for each app and the corresponding remote\r\n * **drains** the entry on first mount (i.e. reads then deletes). This covers the\r\n * first-launch race where the event fires before the remote's listener attaches.\r\n * Subsequent re-launches into the already-mounted remote arrive via the event.\r\n */\r\nexport const FlyosPendingLaunchesGlobalKey = '__FLYOS_PENDING_LAUNCHES__' as const;\r\n\r\n/** Type of the `globalThis[FlyosPendingLaunchesGlobalKey]` registry. */\r\nexport type FlyosPendingLaunches = Record<string, LaunchContext>;\r\n\r\n/**\r\n * Detail payload of the <c>flyos:launch-request</c> window CustomEvent — a\r\n * federated remote ASKING the shell to open (or focus) a DIFFERENT app.\r\n *\r\n * This is the outbound counterpart to {@link FLYOS_LAUNCH_EVENT}. The two must not\r\n * be confused: {@link FLYOS_LAUNCH_EVENT} is the shell DELIVERING a launch that has\r\n * already happened (the window is open; remotes react by navigating), whereas this\r\n * event is a REQUEST travelling the other way — nothing is open yet. A remote that\r\n * dispatched {@link FLYOS_LAUNCH_EVENT} directly would tell every remote a launch\r\n * occurred while no window was ever opened.\r\n *\r\n * Only the shell may act on this: it owns the app registry and the window manager,\r\n * neither of which is reachable from a federated remote. See\r\n * `skills/cross-app-deep-linking.md` § \"Initiator side (federated remote)\".\r\n */\r\nexport interface FlyLaunchRequestDetail {\r\n /** Shell-registry app id of the app to open, e.g. `'chats'`. */\r\n readonly appId: string;\r\n /** Route to deep-link into within the target app, or null for its landing route. */\r\n readonly route: string | null;\r\n /** Optional structured params handed to the target app's launch context. */\r\n readonly params: Readonly<Record<string, unknown>> | null;\r\n}\r\n\r\n/** Name of the window CustomEvent a remote dispatches to ask the shell to open another app. */\r\nexport const FLYOS_LAUNCH_REQUEST_EVENT = 'flyos:launch-request';\r\n\r\n/**\r\n * `globalThis` flag set by the shell when it is listening for\r\n * {@link FLYOS_LAUNCH_REQUEST_EVENT}. Mirrors the\r\n * {@link FlyosShellOwnsHistoryGlobalKey} capability-flag idiom: absent ⇒ no shell\r\n * (standalone remote, or an older shell that predates this contract), so\r\n * `requestAppLaunch` reports failure instead of dispatching into the void and\r\n * letting the caller believe a window opened.\r\n */\r\nexport const FlyosShellHandlesLaunchRequestsGlobalKey =\r\n '__FLYOS_SHELL_HANDLES_LAUNCH_REQUESTS__' as const;\r\n\r\n/**\r\n * Detail payload of the <c>flyos:remote-route</c> window CustomEvent — the\r\n * INVERSE of {@link FLYOS_LAUNCH_EVENT}. A federated remote dispatches this\r\n * whenever its OWN logical route changes (user navigation inside the remote), so\r\n * the shell — the single owner of the browser address bar and history — can\r\n * mirror the route to `…/desktop?app=&route=` and push one history entry.\r\n *\r\n * Emitted by `FlyRemoteRouter` ONLY when {@link FlyosShellOwnsHistoryGlobalKey}\r\n * is set (a new shell is present and listening). Older shells receive no event\r\n * and the remote keeps writing its own `pushState` — so this is backward\r\n * compatible.\r\n */\r\nexport interface FlyRemoteRouteEventDetail {\r\n /** The shell-registry app id (from `WINDOW_DATA`). */\r\n readonly appId: string;\r\n /** The window instance id, or null when `WINDOW_DATA` is split across bundles. */\r\n readonly windowId: string | null;\r\n /** The remote's new logical URL, e.g. `/signals/abc`. */\r\n readonly url: string;\r\n}\r\n\r\n/** Name of the window CustomEvent a remote dispatches when its route changes. */\r\nexport const FLYOS_REMOTE_ROUTE_EVENT = 'flyos:remote-route';\r\n\r\n/**\r\n * `globalThis` flag set by the shell when it owns the address bar + history for\r\n * ALL windows (os-core AND remotes) via `ShellHistoryService`. When set, a\r\n * remote's `FlyRemoteRouter` defers history to the shell (dispatching\r\n * {@link FLYOS_REMOTE_ROUTE_EVENT} instead of calling `history.pushState`) and\r\n * stops handling its own `popstate` (the shell replays routes via\r\n * {@link FLYOS_LAUNCH_EVENT}). Absent ⇒ legacy self-managed behaviour.\r\n */\r\nexport const FlyosShellOwnsHistoryGlobalKey = '__FLYOS_SHELL_OWNS_HISTORY__' as const;\r\n\r\n/**\r\n * Hint published by an app to drive the window-titlebar help-button deeplink.\r\n *\r\n * The shell renders the help button automatically on every non-chromeless\r\n * window, defaulting the deeplink to `params.appId = win.appId`. An app\r\n * customises that deeplink by injecting <see cref=\"WINDOW_HELP_HINT\"/> and\r\n * setting the writable signal — typically once on construct + again as the\r\n * active route/page changes.\r\n *\r\n * - `appId` overrides `win.appId` (rare; reserved for embedded sub-apps\r\n * whose help lives under a different seed-pack id).\r\n * - `topic` seeds the help-center search query when the deeplink fires.\r\n * Free-form short phrase (e.g. \"calculated measures\", \"share dialog\").\r\n * Updated dynamically as the user navigates within the app.\r\n */\r\nexport interface WindowHelpHint {\r\n /** Override for the help-center `appId` chip pre-selection. Optional. */\r\n readonly appId?: string;\r\n /** Free-form search-query seed for the help-center landing. */\r\n readonly topic?: string | null;\r\n}\r\n\r\n/**\r\n * Per-window injection token carrying the active <see cref=\"WindowHelpHint\"/>\r\n * as a writable signal. The shell creates one writable signal per window\r\n * (alongside <see cref=\"LAUNCH_CONTEXT\"/>); apps inject it and `.set(...)` to\r\n * publish or update their hint. Setting `null` clears the hint — the chrome\r\n * falls back to the implicit `win.appId` deeplink.\r\n *\r\n * **Federation note:** same caveat as <see cref=\"LAUNCH_CONTEXT\"/> — Native\r\n * Federation can split the InjectionToken across host/remote bundles, so\r\n * federated remotes cannot rely on DI to publish hints. Use\r\n * <see cref=\"FLY_WINDOW_HELP_HINT_EVENT\"/> instead.\r\n */\r\nexport const WINDOW_HELP_HINT = new InjectionToken<WritableSignal<WindowHelpHint | null>>(\r\n 'WINDOW_HELP_HINT',\r\n);\r\n\r\n/**\r\n * Federation-safe window CustomEvent name for publishing a help hint from a\r\n * federated remote that cannot see <see cref=\"WINDOW_HELP_HINT\"/> via DI.\r\n *\r\n * Detail: <see cref=\"FlyWindowHelpHintEventDetail\"/>. The shell listens at\r\n * `window` scope and mirrors the payload into the matching per-window signal\r\n * (keyed by `windowId` from <see cref=\"WINDOW_DATA\"/>). Pairs with the\r\n * <see cref=\"FLYOS_LAUNCH_EVENT\"/> pattern.\r\n */\r\nexport const FLY_WINDOW_HELP_HINT_EVENT = 'flyos:window-help-hint';\r\n\r\n/**\r\n * Detail payload of the <see cref=\"FLY_WINDOW_HELP_HINT_EVENT\"/> CustomEvent.\r\n * Federated remotes dispatch one event per hint change; the shell filters\r\n * by `windowId` (each window owns its own hint).\r\n */\r\nexport interface FlyWindowHelpHintEventDetail {\r\n /** Window id; remotes obtain via WINDOW_DATA at mount. */\r\n readonly windowId: string;\r\n /** Pass `null` to clear; the chrome reverts to win.appId. */\r\n readonly hint: WindowHelpHint | null;\r\n}\r\n\r\n/**\r\n * Federation-safe window CustomEvent name for publishing the **browser-tab\r\n * title** (`document.title`) for a window from any app — in-shell OS-Core app or\r\n * federated remote.\r\n *\r\n * The shell (`DocumentTitleService`) is the SINGLE writer of `document.title`:\r\n * it reflects the focused window's title (baseline = the app name) and lets an\r\n * app override it per page via this event. A federated remote's Angular `Title`\r\n * service writes to a DOM adapter that is NOT the host's real `document`, so a\r\n * remote CANNOT set the tab directly — only the host can. This event is how a\r\n * remote hands its title to the host. Detail:\r\n * <see cref=\"FlyWindowPageTitleEventDetail\"/>. Pairs with\r\n * <see cref=\"FLY_WINDOW_HELP_HINT_EVENT\"/>.\r\n *\r\n * Prefer the <see cref=\"FlyWindowTitleService\"/> publisher over hand-dispatching.\r\n */\r\nexport const FLY_WINDOW_PAGE_TITLE_EVENT = 'flyos:window-page-title';\r\n\r\n/**\r\n * Detail payload of the <see cref=\"FLY_WINDOW_PAGE_TITLE_EVENT\"/> CustomEvent.\r\n *\r\n * At least one of `windowId` / `appId` must be present — the shell keys the\r\n * override by `windowId` when known (precise, multi-window-safe) and falls back\r\n * to `appId`. In this shell an app is single-instance (opening a second time\r\n * focuses the existing window), so `appId` alone is sufficient in practice.\r\n */\r\nexport interface FlyWindowPageTitleEventDetail {\r\n /** Window id; remotes obtain via WINDOW_DATA at mount. Preferred key. */\r\n readonly windowId?: string;\r\n /** App id fallback key when the window id isn't threaded through. */\r\n readonly appId?: string;\r\n /**\r\n * Desired document title, verbatim (e.g. `Clusters — Circles`), or\r\n * `null`/empty to clear the override and fall back to the app-name baseline.\r\n */\r\n readonly title: string | null;\r\n}\r\n","/**\r\n * Generic share / ACL panel models — hosts map domain DTOs to these shapes.\r\n *\r\n * v2.0.0: introduces the {@link SharePrincipal} discriminated union to replace the v1\r\n * \"set-which-is-set\" discriminator on {@link SharePermissionEntry} (`grantedToUserId` /\r\n * `grantedToOuId` / `grantedToAppId`). The new shape compiles invalid combinations away\r\n * (a permission row carries exactly one principal, never overlapping ids) and reserves\r\n * a `role` kind for the planned apps-chart role-as-principal flow.\r\n */\r\n\r\n/**\r\n * Discriminated principal that owns a share permission row. Hosts translate domain DTO\r\n * fields into one of these variants.\r\n *\r\n * The `role` variant is reserved for a follow-up enabling the Apps-chart role-as-principal\r\n * flow end-to-end (frontend looks up the role-OU UUID; backend's PermissionResolver must\r\n * enumerate the user's full OU set including computed-from-role memberships). Until that\r\n * runtime work lands, hosts SHOULD NOT emit `role` principals.\r\n */\r\nexport type SharePrincipal =\r\n | UserPrincipal\r\n | RolePrincipal\r\n | OuPrincipal\r\n | AppEveryonePrincipal;\r\n\r\nexport interface UserPrincipal {\r\n kind: 'user';\r\n /** Tenant-scoped user id. */\r\n userId: string;\r\n /** Display name resolved by the host (e.g. \"Jane Doe\"). Falls back to a Guid prefix. */\r\n displayName?: string;\r\n /** Optional email — surfaced as a secondary line on the row when set. */\r\n email?: string;\r\n}\r\n\r\nexport interface RolePrincipal {\r\n kind: 'role';\r\n /** Owning app id (e.g. `circles`). Roles are unique within an app, not globally. */\r\n appId: string;\r\n /** Stable role key within that app (e.g. `ffo`, `viewer`). */\r\n roleKey: string;\r\n displayName?: string;\r\n}\r\n\r\nexport interface OuPrincipal {\r\n kind: 'ou';\r\n ouId: string;\r\n /** Chart context for stable display labels. Null = the Default Company chart. */\r\n chartId?: string | null;\r\n displayName?: string;\r\n}\r\n\r\nexport interface AppEveryonePrincipal {\r\n kind: 'app-everyone';\r\n /** App id whose user population this grant targets. `*` = every tenant user. */\r\n appId: string;\r\n displayName?: string;\r\n}\r\n\r\n/** Principal-kind discriminator strings — re-exported for hosts that build menus dynamically. */\r\nexport type SharePrincipalKind = SharePrincipal['kind'];\r\n\r\n/**\r\n * One row of the share-panel permissions list. v2.0 carries a {@link SharePrincipal}\r\n * discriminated union instead of the v1 `grantedToUserId` / `grantedToOuId` / `grantedToAppId`\r\n * fields. See the file header for migration notes.\r\n */\r\nexport interface SharePermissionEntry {\r\n id: string;\r\n principal: SharePrincipal;\r\n level: string;\r\n isInherited?: boolean;\r\n /**\r\n * When true, this row is a deny grant — visually distinct, revokes access for the\r\n * principal regardless of any matching allow grant. Backed by the ACL semantic in\r\n * Files Manager (`FilePermission.IsDeny`) and Notes (`NoteShareLevel.Deny`).\r\n * Hosts that do not support deny grants may omit this field entirely.\r\n */\r\n isDeny?: boolean;\r\n}\r\n\r\nexport interface ShareUserResult {\r\n id: string;\r\n firstName: string;\r\n lastName: string;\r\n email: string;\r\n}\r\n\r\nexport interface ShareOuNode {\r\n id: string;\r\n displayName: string;\r\n /** 0 = root. When set, share panel indents rows for hierarchy. */\r\n depth?: number;\r\n}\r\n\r\n/** Option for OU tree source: `id` null = default/official org chart. */\r\nexport interface ShareOrgChartOption {\r\n id: string | null;\r\n name: string;\r\n /**\r\n * Stable system-chart key used by hosts that want to pre-select a specific platform-managed\r\n * chart (e.g. `'apps'`, `'default-company'`). Custom charts have no system key. Wired through\r\n * `defaultChartSystemKey` on share-panel / audience-builder so the host doesn't need to know\r\n * the tenant-specific Guid up front.\r\n */\r\n systemKey?: string | null;\r\n}\r\n\r\n/**\r\n * Stable identifiers for platform-managed system charts. Hosts that don't recognise the\r\n * value just fall through to the default selection — these constants are advisory.\r\n */\r\nexport const SHARE_ORG_CHART_SYSTEM_KEY_DEFAULT = 'default-company';\r\nexport const SHARE_ORG_CHART_SYSTEM_KEY_APPS = 'apps';\r\n\r\nexport interface SharePanelLevelOption {\r\n value: string;\r\n labelKey: string;\r\n}\r\n","/**\r\n * Canonical {@link AudienceFilter} TypeScript model — wire-compatible byte-for-byte with the\r\n * C# `Fly.Sdk.Core.Audience.AudienceFilter` polymorphic record. The discriminator field is\r\n * `kind` and matches the values declared in `AudienceTerm.cs`'s `[JsonDerivedType]` attributes:\r\n * `users`, `roles`, `ou`, `app-everyone`, `chart`, `preset`.\r\n *\r\n * Resolution semantics (server-side, see `AudienceFilter.cs`):\r\n * 1. Each include term is expanded to a user-id set; sets are unioned.\r\n * 2. Each exclude term is expanded; the union of excludes is subtracted.\r\n * 3. Inactive users are filtered when {@link AudienceOptions.excludeInactiveUsers} is true.\r\n *\r\n * **Empty `includes` resolves to the empty set — never \"everyone\".** To target every user in a\r\n * tenant, emit an explicit {@link AppEveryoneTerm} or {@link ChartTerm}; this matches the\r\n * defensive backend default and prevents a UI bug from broadcasting tenant-wide.\r\n */\r\nexport interface AudienceFilter {\r\n /** At least one term required server-side; an empty array resolves to zero recipients. */\r\n includes: AudienceTerm[];\r\n /** Optional. Subtracted from the include union. */\r\n excludes?: AudienceTerm[];\r\n /** Optional resolver options. Server applies defaults when omitted. */\r\n options?: AudienceOptions;\r\n}\r\n\r\n/** Tagged union of the six supported audience term kinds. */\r\nexport type AudienceTerm =\r\n | UsersTerm\r\n | RolesTerm\r\n | OuTerm\r\n | AppEveryoneTerm\r\n | ChartTerm\r\n | PresetTerm;\r\n\r\nexport type AudienceTermKind = AudienceTerm['kind'];\r\n\r\n/** Discriminator string values — re-exported so hosts can build kind menus dynamically. */\r\nexport const AUDIENCE_TERM_KINDS = [\r\n 'users',\r\n 'roles',\r\n 'ou',\r\n 'app-everyone',\r\n 'chart',\r\n 'preset',\r\n] as const satisfies readonly AudienceTermKind[];\r\n\r\n/**\r\n * Runtime values for {@link AudiencePresetKind}. Hosts iterate this when surfacing a\r\n * preset picker; the type union mirrors this list 1:1.\r\n */\r\nexport const AUDIENCE_PRESETS = [\r\n 'self',\r\n 'ou-managers',\r\n 'direct-reports',\r\n] as const satisfies readonly AudiencePresetKind[];\r\n\r\n/** Explicit user ids. Capped server-side at {@link AUDIENCE_LIMITS.maxUserIdsPerTerm}. */\r\nexport interface UsersTerm {\r\n kind: 'users';\r\n /** Tenant-scoped user ids. */\r\n userIds: string[];\r\n}\r\n\r\n/**\r\n * Users holding any of the named roles in a single owning app. Roles are matched by\r\n * `(appId, key)` and filtered to active rows by the manifest spec — deprecated roles never\r\n * expand into the audience. RoleKeys are unique within an app, not globally.\r\n */\r\nexport interface RolesTerm {\r\n kind: 'roles';\r\n /** The role's owning app id (e.g. `circles`). */\r\n appId: string;\r\n /** Role keys within that app (e.g. `[\"ffo\", \"ops\"]`). */\r\n roleKeys: string[];\r\n}\r\n\r\n/**\r\n * Members of one or more OUs. `chartId` null = the Default Company chart; non-null targets\r\n * an alternative chart (including the Apps Chart). When `includeDescendants` is true, members\r\n * of all descendant OUs are included (resolved server-side via a recursive CTE).\r\n *\r\n * `includeDescendants` is required (not optional) so the wire round-trip is unambiguous: a\r\n * stored term that was previously emitted with `false` deserialises identically to one emitted\r\n * fresh, and the backend never has to choose between \"missing\" and \"explicit false\". Builders\r\n * MUST emit a definite boolean.\r\n */\r\nexport interface OuTerm {\r\n kind: 'ou';\r\n ouIds: string[];\r\n /**\r\n * Chart context for descendant traversal; null = default tree by parent id. Use `null`\r\n * (never `undefined`) to keep wire shape symmetric with C# `Guid?` deserialization.\r\n */\r\n chartId: string | null;\r\n includeDescendants: boolean;\r\n}\r\n\r\n/**\r\n * \"All users of this app in this tenant\" — semantically the Apps Chart app-root OU. Resolved\r\n * from `UserRole` rows joined to active roles owned by the app, never from a materialized\r\n * member list. `appId === '*'` means every tenant user.\r\n */\r\nexport interface AppEveryoneTerm {\r\n kind: 'app-everyone';\r\n appId: string;\r\n}\r\n\r\n/**\r\n * \"Every user placed somewhere in this chart\". For the Default Company chart this is every\r\n * user with at least one OU membership.\r\n */\r\nexport interface ChartTerm {\r\n kind: 'chart';\r\n chartId: string;\r\n}\r\n\r\n/**\r\n * Named platform preset evaluated against an anchor user. Anchor is typically the request\r\n * initiator (`Self`) or a referenced user (e.g. delegate's manager).\r\n */\r\nexport interface PresetTerm {\r\n kind: 'preset';\r\n preset: AudiencePresetKind;\r\n anchorUserId: string;\r\n}\r\n\r\n/**\r\n * Supported audience presets. Kept intentionally small — wire matches C# `JsonStringEnumMemberName`.\r\n */\r\nexport type AudiencePresetKind = 'self' | 'ou-managers' | 'direct-reports';\r\n\r\nexport interface AudienceOptions {\r\n /** When true (default), users with `IsActive=false` are filtered out. */\r\n excludeInactiveUsers?: boolean;\r\n /** Caller-supplied ceiling. Server clamps to {@link AUDIENCE_LIMITS.maxResolvedUsers}. */\r\n hardCap?: number;\r\n}\r\n\r\n/**\r\n * Hard caps mirrored from `AudienceLimits.cs`. Hosts use these for client-side validation\r\n * before submit — backend re-validates regardless. Keep these in sync with the C# constants.\r\n */\r\nexport const AUDIENCE_LIMITS = {\r\n maxTermsPerFilter: 64,\r\n maxUserIdsPerTerm: 500,\r\n maxRoleKeysPerTerm: 64,\r\n maxOuIdsPerTerm: 32,\r\n maxResolvedUsers: 10_000,\r\n} as const;\r\n","/**\r\n * Canonical platform role taxonomy + pure role-matching helpers for FlyOS\r\n * Business Apps.\r\n *\r\n * Defined ONCE here so no app hand-rolls the admin role set. Before this, every\r\n * gate copy-pasted `roles.some(r => ['tenant_admin','tenant_owner','sysadmin'].includes(r))`\r\n * inline, so each app's notion of \"admin\" drifted independently and a taxonomy\r\n * change meant editing N call sites. Consume the centralized gate via\r\n * `AuthService.isAdmin` / `AuthService.hasAnyRole()`, the `*flyIfRole` /\r\n * `*flyIfAdmin` structural directives, or the `flyRoleGuard` / `flyAdminGuard`\r\n * route guards.\r\n *\r\n * These are UX affordances only — the backend (Cerbos) remains the real\r\n * enforcer. Client gating just hides controls a user can't action.\r\n */\r\n\r\n/**\r\n * Platform-operations roles that unlock tenant-admin surfaces across every app\r\n * (Foresight Line, Vocabulary admin, autopilot controls, …). Keep in sync with\r\n * the backend role seed; the server-side Cerbos policy is the source of truth.\r\n */\r\nexport const FLY_ADMIN_ROLES: readonly string[] = Object.freeze([\r\n 'tenant_admin',\r\n 'tenant_owner',\r\n 'sysadmin',\r\n]);\r\n\r\n/** Normalize a directive/guard input (`'role'`, `['a','b']`, `null`) to a `string[]`. */\r\nexport function normalizeRoles(\r\n input: string | readonly string[] | null | undefined,\r\n): readonly string[] {\r\n if (input == null) return [];\r\n return typeof input === 'string' ? [input] : input;\r\n}\r\n\r\n/**\r\n * True if the user holds at least one of the `required` roles.\r\n *\r\n * Fails closed: an empty/absent `userRoles` OR an empty `required` set returns\r\n * `false`, so a misconfigured `*flyIfRole` (no roles supplied) hides content\r\n * rather than leaking it.\r\n */\r\nexport function hasAnyRoleIn(\r\n userRoles: readonly string[] | null | undefined,\r\n required: readonly string[],\r\n): boolean {\r\n if (!userRoles?.length || !required.length) return false;\r\n return required.some((r) => userRoles.includes(r));\r\n}\r\n","import { Injectable, computed, signal } from '@angular/core';\r\nimport { User } from '../models/user.model';\r\nimport { FLY_ADMIN_ROLES, hasAnyRoleIn } from '../auth/fly-roles';\r\n\r\ninterface AuthSession {\r\n user: User;\r\n accessToken: string;\r\n expiresAt: number;\r\n}\r\n\r\n/**\r\n * Shared AuthService for the whole FlyOS federation — the **single source of\r\n * truth for identity**.\r\n *\r\n * Read vs write — the contract that keeps role-gating working everywhere:\r\n *\r\n * - **UI components only READ.** Inject this service and read `currentUser` /\r\n * `roles` / `isAuthenticated`, or gate via `isAdmin` / `hasAnyRole()` / the\r\n * `*flyIfRole` / `*flyIfAdmin` directives / the `flyRoleGuard` route guards.\r\n * Never call `setSession()` from a component.\r\n *\r\n * - **Exactly one HOST writes.** Whoever owns the login flow populates this\r\n * store and is the ONLY writer:\r\n * · embedded (Module-Federation remote): the **shell** owns it for every\r\n * mounted remote — the shell and the remote share this singleton via the\r\n * `@flyos/design-system` shared mapping, so the shell's\r\n * populated instance IS the object the remote reads;\r\n * · standalone: the app's own PKCE/mock auth service writes it.\r\n * Host auth services delegate their `currentUser`/`accessToken` reads back to\r\n * this store rather than keeping a private session copy, so the two can never\r\n * drift (the dual-store drift was the root cause of the \"admin nav hidden for\r\n * an admin\" bug class). See `skills/business-app-angular-remote.md`.\r\n *\r\n * When running standalone without any host wiring, `initFromToken()` hydrates\r\n * the user from a JWT in localStorage.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class AuthService {\r\n private _session = signal<AuthSession | null>(null);\r\n\r\n readonly currentUser = computed(() => this._session()?.user ?? null);\r\n readonly accessToken = computed(() => this._session()?.accessToken ?? null);\r\n /** Epoch-ms expiry of the current session (0 when unauthenticated). Host auth\r\n * services read this to schedule silent refresh without a private copy. */\r\n readonly expiresAt = computed(() => this._session()?.expiresAt ?? 0);\r\n readonly isAuthenticated = computed(() => {\r\n const s = this._session();\r\n return s !== null && s.expiresAt > Date.now();\r\n });\r\n\r\n /** The current user's roles (empty when unauthenticated). */\r\n readonly roles = computed<readonly string[]>(() => this._session()?.user?.roles ?? []);\r\n\r\n /**\r\n * Canonical platform-admin gate — true when the user holds any of\r\n * {@link FLY_ADMIN_ROLES} (tenant_admin / tenant_owner / sysadmin). UX only;\r\n * the backend Cerbos policy is the real enforcer. Reactive: recomputes when\r\n * the session hydrates (e.g. after a standalone reload's silent refresh).\r\n */\r\n readonly isAdmin = computed<boolean>(() => hasAnyRoleIn(this.roles(), FLY_ADMIN_ROLES));\r\n\r\n /**\r\n * True if the current user holds at least one of `required`. Reactive when\r\n * read inside a template/`computed`/`effect` (it reads the session signal).\r\n * Fails closed on an empty `required` set. Prefer this + the `*flyIfRole`\r\n * directive over hand-rolling `roles().some(...)` at each call site.\r\n */\r\n hasAnyRole(required: readonly string[]): boolean {\r\n return hasAnyRoleIn(this._session()?.user?.roles, required);\r\n }\r\n\r\n /**\r\n * No-op when running as a Module Federation remote — the shell has already\r\n * initialised the session before the remote bootstraps. Business Apps call\r\n * this in their APP_INITIALIZER so the same code works in both standalone\r\n * and embedded modes without branching.\r\n */\r\n async init(): Promise<void> {\r\n // Intentional no-op — see class doc above. Explicit `return` keeps this\r\n // a real statement (not just a comment) so it isn't flagged as an empty\r\n // function while resolving the same `Promise<void>` an empty body would.\r\n return;\r\n }\r\n\r\n /**\r\n * Called by the shell after a successful login or silent refresh.\r\n * Business Apps should not call this directly.\r\n */\r\n setSession(user: User, accessToken: string, expiresAt: number): void {\r\n this._session.set({ user, accessToken, expiresAt });\r\n }\r\n\r\n /** Clears the in-memory session (called by the shell on logout). */\r\n clearSession(): void {\r\n this._session.set(null);\r\n }\r\n\r\n /**\r\n * Patch profile fields on the live session that change without a token refresh\r\n * (e.g. preferred locale after `PATCH /users/me/preferred-locale`). No-op when\r\n * unauthenticated. Lets host auth services keep this store as the single\r\n * identity copy instead of mutating a private session and re-mirroring.\r\n */\r\n patchProfile(patch: Partial<User>): void {\r\n const s = this._session();\r\n if (!s) return;\r\n this._session.set({ ...s, user: { ...s.user, ...patch } });\r\n }\r\n\r\n /**\r\n * Standalone mode: parse a JWT from localStorage and hydrate the user.\r\n * Pass the storage key your app uses (e.g. `'my_app_token'`); apps typically\r\n * call this in an `APP_INITIALIZER`. The key is required — the design system\r\n * has no default token store, and the historical `'circles_token'` default\r\n * was app-specific coupling (removed in the external-app decoupling; needs a\r\n * DS version bump at the next scheduled publish).\r\n */\r\n initFromToken(storageKey: string): void {\r\n const token = localStorage.getItem(storageKey);\r\n if (!token) return;\r\n try {\r\n const base64 = token.split('.')[1].replace(/-/g, '+').replace(/_/g, '/');\r\n const payload = JSON.parse(decodeURIComponent(\r\n atob(base64).split('').map(c => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)).join('')\r\n )) as Record<string, unknown>;\r\n\r\n const rawRole = payload['role'];\r\n const roles = Array.isArray(rawRole) ? rawRole as string[] : rawRole ? [rawRole as string] : [];\r\n const rawApps = payload['apps'];\r\n const apps = Array.isArray(rawApps) ? rawApps as string[] : rawApps ? [rawApps as string] : [];\r\n const name = (payload['name'] as string) ?? '';\r\n const nameParts = name.split(' ');\r\n\r\n const user: User = {\r\n id: (payload['sub'] as string) ?? '',\r\n tenantId: (payload['tenant_id'] as string) ?? (payload['tid'] as string) ?? null,\r\n email: (payload['email'] as string) ?? '',\r\n fullName: name,\r\n firstName: nameParts[0] ?? '',\r\n lastName: nameParts.slice(1).join(' '),\r\n preferredLocale: (payload['locale'] as string) ?? 'en',\r\n roles,\r\n apps,\r\n ou: payload['ou'] as string | undefined,\r\n };\r\n\r\n const expiresAt = ((payload['exp'] as number) ?? 0) * 1000;\r\n this.setSession(user, token, expiresAt);\r\n } catch {\r\n // Invalid token — stay unauthenticated\r\n }\r\n }\r\n}\r\n","import {\r\n Directive,\r\n Input,\r\n TemplateRef,\r\n ViewContainerRef,\r\n effect,\r\n inject,\r\n signal,\r\n} from '@angular/core';\r\nimport { AuthService } from '../services/auth.service';\r\nimport { normalizeRoles } from '../auth/fly-roles';\r\n\r\n/**\r\n * Structural directive that renders its content only while the current user\r\n * holds at least one of the supplied roles. Reactive by construction — the\r\n * effect re-evaluates whenever the shared session hydrates, so it can NEVER\r\n * capture a stale \"forbidden\" verdict at construction the way a one-shot\r\n * `computed` snapshot does. UX only; Cerbos remains the real enforcer.\r\n *\r\n * @example\r\n * ```html\r\n * <a *flyIfRole=\"['tenant_admin', 'tenant_owner']\" routerLink=\"/settings\">Settings</a>\r\n * <button *flyIfRole=\"'sysadmin'\">Platform tools</button>\r\n * ```\r\n */\r\n@Directive({ selector: '[flyIfRole]', standalone: true })\r\nexport class FlyIfRoleDirective {\r\n private readonly auth = inject(AuthService);\r\n private readonly tpl = inject(TemplateRef<unknown>);\r\n private readonly vcr = inject(ViewContainerRef);\r\n private readonly required = signal<readonly string[]>([]);\r\n private rendered = false;\r\n\r\n /** Accepts a single role string or an array; empty/absent ⇒ never renders. */\r\n @Input()\r\n set flyIfRole(roles: string | readonly string[] | null | undefined) {\r\n this.required.set(normalizeRoles(roles));\r\n }\r\n\r\n constructor() {\r\n effect(() => {\r\n this.toggle(this.auth.hasAnyRole(this.required()));\r\n });\r\n }\r\n\r\n private toggle(show: boolean): void {\r\n if (show && !this.rendered) {\r\n this.vcr.createEmbeddedView(this.tpl);\r\n this.rendered = true;\r\n } else if (!show && this.rendered) {\r\n this.vcr.clear();\r\n this.rendered = false;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Convenience sibling of {@link FlyIfRoleDirective} for the most common gate —\r\n * renders content only for platform-admin roles (the canonical\r\n * `FLY_ADMIN_ROLES`). Equivalent to `*flyIfRole` bound to that set, but with no\r\n * role list to import or mistype.\r\n *\r\n * @example\r\n * ```html\r\n * <section *flyIfAdmin>Tenant-admin controls…</section>\r\n * ```\r\n */\r\n@Directive({ selector: '[flyIfAdmin]', standalone: true })\r\nexport class FlyIfAdminDirective {\r\n private readonly auth = inject(AuthService);\r\n private readonly tpl = inject(TemplateRef<unknown>);\r\n private readonly vcr = inject(ViewContainerRef);\r\n private rendered = false;\r\n\r\n constructor() {\r\n effect(() => {\r\n this.toggle(this.auth.isAdmin());\r\n });\r\n }\r\n\r\n private toggle(show: boolean): void {\r\n if (show && !this.rendered) {\r\n this.vcr.createEmbeddedView(this.tpl);\r\n this.rendered = true;\r\n } else if (!show && this.rendered) {\r\n this.vcr.clear();\r\n this.rendered = false;\r\n }\r\n }\r\n}\r\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn } from '@angular/router';\r\nimport { AuthService } from '../services/auth.service';\r\n\r\n/**\r\n * Route guard factory that admits the route only when the current user holds at\r\n * least one of `required`. UX gate only — the backend (Cerbos) is the real\r\n * enforcer, so a route slipping through here still fails server-side.\r\n *\r\n * Timing: relies on the host having populated the shared AuthService store\r\n * before routing. Both the shell and standalone Business Apps `await\r\n * auth.init()` in an `APP_INITIALIZER`, so the session is hydrated before the\r\n * first route activates. If a future host activates routes before auth settles,\r\n * prefer redirecting to a \"loading\"/login route over returning `false` here.\r\n *\r\n * @example\r\n * ```ts\r\n * { path: 'settings', canActivate: [flyRoleGuard(['tenant_admin'])], component: SettingsComponent }\r\n * ```\r\n */\r\nexport function flyRoleGuard(required: readonly string[]): CanActivateFn {\r\n return () => inject(AuthService).hasAnyRole(required);\r\n}\r\n\r\n/**\r\n * Convenience guard for the canonical platform-admin gate (tenant_admin /\r\n * tenant_owner / sysadmin). Equivalent to `flyRoleGuard(FLY_ADMIN_ROLES)`.\r\n *\r\n * @example\r\n * ```ts\r\n * { path: 'admin', canActivate: [flyAdminGuard], component: AdminComponent }\r\n * ```\r\n */\r\nexport const flyAdminGuard: CanActivateFn = () => inject(AuthService).isAdmin();\r\n","import { User } from '../models/user.model';\r\n\r\n/**\r\n * The minimal read surface every FlyOS auth store exposes. Both the real\r\n * `AuthService` and `MockAuthService` satisfy it, as do host (shell / Business\r\n * App) auth services once they delegate identity to the shared store.\r\n */\r\nexport interface FlyAuthStoreReadable {\r\n currentUser(): User | null;\r\n isAuthenticated(): boolean;\r\n}\r\n\r\n/**\r\n * Pure invariant of the populate contract: \"after a host writes a session, the\r\n * shared store exposes an authenticated identity.\" Host regression specs assert\r\n * this against the REAL shared `AuthService` after their `setSession` /\r\n * `handleCallback` / `silentRefresh` path runs — it would have failed the moment\r\n * a host stopped mirroring its session into the store (the silent failure mode\r\n * behind the \"admin nav hidden for an admin\" bug class).\r\n */\r\nexport function isFlyAuthStorePopulated(store: FlyAuthStoreReadable): boolean {\r\n return store.currentUser() != null && store.isAuthenticated();\r\n}\r\n\r\n/** Inputs for {@link warnIfEmbeddedSessionMissing}. */\r\nexport interface EmbeddedSessionProbe {\r\n /** True when the app is mounted inside the desktop shell (a federation remote). */\r\n embedded: boolean;\r\n /** Current value of the shared store's `isAuthenticated()`. */\r\n authenticated: boolean;\r\n /** App id for the diagnostic message (e.g. `'circles'`). */\r\n appId?: string;\r\n}\r\n\r\n/**\r\n * Dev/diagnostic guard that converts the silent failure into a loud one: a\r\n * remote mounted **embedded** but the shared store has no session means the\r\n * HOST shell failed to populate identity, so every role-gated surface stays\r\n * hidden even for an admin — with no error to point at. Call this once after\r\n * the remote's init settles (it has the `isEmbedded` signal already).\r\n *\r\n * Returns whether the warning fired (so callers can assert in tests). Pure\r\n * aside from the single `console.warn`.\r\n */\r\nexport function warnIfEmbeddedSessionMissing(probe: EmbeddedSessionProbe): boolean {\r\n const missing = probe.embedded && !probe.authenticated;\r\n if (missing) {\r\n console.warn(\r\n `[flyos-design-system] ${probe.appId ?? 'remote'} mounted embedded but the shared ` +\r\n `AuthService store has no session — the host shell did not populate identity, so ` +\r\n `role-gated UI (admin nav, gated screens) will stay hidden even for an admin. The ` +\r\n `shell's AuthService must write its session into the design-system store on login + ` +\r\n `silent refresh. See skills/business-app-angular-remote.md.`,\r\n );\r\n }\r\n return missing;\r\n}\r\n","/**\r\n * Pure helpers for the step-up (MFA re-auth) flow — kept framework-free so they can be unit-tested\r\n * without Angular's TestBed. A backend gate (e.g. `[RequireStepUp]`) answers a stale/absent step-up\r\n * with `401` carrying the platform error envelope `{ error: { code: 'step_up_required',\r\n * validationErrors: { maxAgeSeconds: ['300'] } } }`. These helpers parse that shape and carry the\r\n * post-reauth return path. Ported from GRC (`FANR EOI-11698 §2.6.6`) as a generic platform surface.\r\n */\r\n\r\n/** Machine-readable code the backend returns on a not-satisfied step-up (mirrors `RequireStepUpAttribute.RequiredCode`). */\r\nexport const STEP_UP_CODE = 'step_up_required';\r\n\r\n/**\r\n * sessionStorage key holding the route to return to after a step-up re-auth round-trip.\r\n *\r\n * Collision risk: this key is process-wide on `sessionStorage`, which is scoped per browser tab/origin\r\n * — not per app. If two co-hosted apps on the same origin (e.g. two federated remotes sharing the shell's\r\n * origin) both trigger a step-up round-trip in the same tab, the second write clobbers the first return\r\n * path. Acceptable today because the desktop shell owns re-authentication for federated remotes (see\r\n * `StepUpService.reauthenticate`) and only standalone apps reach this branch; revisit if that changes.\r\n */\r\nexport const STEP_UP_RETURN_KEY = 'fly.stepup.returnTo';\r\n\r\n/**\r\n * Builds the `sessionStorage` key holding the post-step-up return path, **scoped by app id** to close\r\n * the collision documented on {@link STEP_UP_RETURN_KEY}: two co-hosted standalone apps sharing one\r\n * browser origin would otherwise clobber each other's return path on the process-wide key. Pass an\r\n * `appId` (the standalone-auth vertical does — see {@link provideFlyStandaloneAuth}) to get\r\n * `fly.stepup.{appId}.returnTo`; omit it to fall back to the un-scoped {@link STEP_UP_RETURN_KEY}\r\n * (the value `StepUpService.reauthenticate` writes when no standalone config is present).\r\n */\r\nexport function stepUpReturnKey(appId?: string): string {\r\n return appId ? `fly.stepup.${appId}.returnTo` : STEP_UP_RETURN_KEY;\r\n}\r\n\r\n/** A parsed step-up challenge: the freshness window (seconds) the caller must satisfy by re-authenticating. */\r\nexport interface StepUpChallenge {\r\n readonly maxAgeSeconds: number;\r\n}\r\n\r\n/**\r\n * Detects a step-up challenge in an HTTP error. Returns the parsed challenge, or `null` when the error\r\n * is anything else (so callers rethrow untouched). Defensive against partial/absent envelopes: a `401`\r\n * whose body isn't a recognizable step-up payload yields `null`, and a missing/garbled `maxAgeSeconds`\r\n * defaults to 0 (the prompt copy doesn't depend on the exact number).\r\n */\r\nexport function parseStepUpChallenge(err: unknown): StepUpChallenge | null {\r\n const e = err as { status?: number; error?: { error?: { code?: string; validationErrors?: Record<string, string[] | undefined> | null } } };\r\n if (!e || e.status !== 401) return null;\r\n\r\n const apiError = e.error?.error;\r\n if (!apiError || apiError.code !== STEP_UP_CODE) return null;\r\n\r\n const raw = apiError.validationErrors?.['maxAgeSeconds']?.[0];\r\n const parsed = raw != null ? Number.parseInt(raw, 10) : NaN;\r\n return { maxAgeSeconds: Number.isFinite(parsed) && parsed > 0 ? parsed : 0 };\r\n}\r\n","import { Injectable, InjectionToken, computed, inject, signal } from '@angular/core';\r\nimport { WINDOW_DATA } from '../../models/window.model';\r\nimport { STEP_UP_RETURN_KEY, type StepUpChallenge } from './step-up.logic';\r\n\r\n/** Options the re-auth handler receives — mirrors the PKCE `authorize` params that force a fresh login. */\r\nexport interface StepUpReauthRequest {\r\n readonly prompt: 'login';\r\n readonly maxAge?: number;\r\n}\r\n\r\n/**\r\n * App-supplied hook that performs the actual re-authentication redirect. The design system owns no\r\n * login flow (its own {@link AuthService} is a pure identity *store*, not a PKCE client — see that\r\n * file's \"exactly one HOST writes\" contract) — each standalone app provides this token, typically\r\n * delegating straight to its own `AuthService.startLogin({ prompt, maxAge })`. Federated remotes never\r\n * need this: the shell owns re-authentication there (see {@link StepUpService.reauthenticate}).\r\n *\r\n * Recipe for a consuming app:\r\n * ```ts\r\n * { provide: STEP_UP_REAUTH_HANDLER, useFactory: () => {\r\n * const auth = inject(AuthService); // the app's own PKCE AuthService, not the DS store\r\n * return (req: StepUpReauthRequest) => auth.startLogin(req);\r\n * } }\r\n * ```\r\n */\r\nexport type StepUpReauthHandler = (request: StepUpReauthRequest) => void | Promise<void>;\r\n\r\nexport const STEP_UP_REAUTH_HANDLER = new InjectionToken<StepUpReauthHandler>('STEP_UP_REAUTH_HANDLER');\r\n\r\n/**\r\n * Owns the client side of the step-up (MFA re-auth) flow. Ported from GRC (`FANR EOI-11698 §2.6.6`)\r\n * as a generic platform surface.\r\n *\r\n * When a crown-jewel call is rejected with `401 step_up_required`, {@link stepUpInterceptor} calls\r\n * {@link StepUpService.challenge} to raise a prompt (a signal a consumer-owned prompt component renders\r\n * — the design system does not ship one; see the `step-up` recipe in `skills/`). The user chooses to\r\n * re-authenticate — {@link StepUpService.reauthenticate} stashes the current route and invokes the\r\n * app-supplied {@link STEP_UP_REAUTH_HANDLER}, which redirects through PKCE with `prompt=login` so the\r\n * fresh token carries a new `auth_time` that clears the backend gate.\r\n *\r\n * The prompt is **user-driven**, never an automatic redirect: an in-flight action (a form the user was\r\n * filling) shouldn't be blown away by a silent full-page navigation the moment a background call trips\r\n * the gate.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class StepUpService {\r\n /**\r\n * Federated detection: in the desktop shell, `WINDOW_DATA` is populated and the **shell owns auth** —\r\n * an app-local PKCE redirect would be wrong there. Standalone dev/prod → `null`. When federated re-auth\r\n * is needed, it requires a shell-provided reauth hook (a platform follow-up, tracked outside this port).\r\n */\r\n private readonly windowData = inject(WINDOW_DATA, { optional: true });\r\n\r\n /** App-supplied login-redirect hook; absent when the consumer hasn't wired one (standalone only). */\r\n private readonly reauthHandler = inject(STEP_UP_REAUTH_HANDLER, { optional: true });\r\n\r\n private readonly _challenge = signal<StepUpChallenge | null>(null);\r\n\r\n /** The active step-up challenge (drives the prompt), or `null` when none is pending. */\r\n readonly challenge$ = this._challenge.asReadonly();\r\n\r\n /** `true` while a step-up prompt should be shown. */\r\n readonly isPrompting = computed(() => this._challenge() !== null);\r\n\r\n /** Raises the step-up prompt for the given challenge (idempotent — a second 401 doesn't stack prompts). */\r\n challenge(challenge: StepUpChallenge): void {\r\n this._challenge.set(challenge);\r\n }\r\n\r\n /** Dismisses the prompt without re-authenticating (the user cancels; the gated action stays blocked). */\r\n dismiss(): void {\r\n this._challenge.set(null);\r\n }\r\n\r\n /**\r\n * Re-authenticates to satisfy the step-up. Stashes the current route so the consumer can return here\r\n * after the STS round-trip, then invokes the app-supplied {@link STEP_UP_REAUTH_HANDLER} with\r\n * `prompt=login`. In federated mode, or when no handler is provided, this is a no-op with a warning\r\n * (see the field docs above).\r\n */\r\n reauthenticate(): void {\r\n const challenge = this._challenge();\r\n this._challenge.set(null);\r\n if (challenge === null) return;\r\n\r\n if (this.windowData) {\r\n console.warn('[fly] step-up re-auth requested while federated — the shell owns re-authentication.');\r\n return;\r\n }\r\n\r\n if (!this.reauthHandler) {\r\n console.warn('[fly] step-up re-auth requested but no STEP_UP_REAUTH_HANDLER is provided — see the step-up recipe.');\r\n return;\r\n }\r\n\r\n try {\r\n sessionStorage.setItem(STEP_UP_RETURN_KEY, window.location.pathname + window.location.search);\r\n } catch { /* sessionStorage unavailable — fall back to landing on '/' after login */ }\r\n\r\n void this.reauthHandler({ prompt: 'login', maxAge: challenge.maxAgeSeconds || undefined });\r\n }\r\n}\r\n","import { HttpRequest, HttpHandlerFn, HttpErrorResponse } from '@angular/common/http';\r\nimport { inject } from '@angular/core';\r\nimport { catchError, throwError } from 'rxjs';\r\nimport { StepUpService } from './step-up.service';\r\nimport { parseStepUpChallenge } from './step-up.logic';\r\n\r\n/**\r\n * Detects the backend's `401 step_up_required` (a crown-jewel action that needs a fresh MFA re-auth)\r\n * and raises the step-up prompt via {@link StepUpService}. The error is **rethrown unchanged** so the\r\n * calling component's own handling still runs (stops its spinner, etc.) — this interceptor only adds\r\n * the global re-auth prompt; it never swallows the response.\r\n *\r\n * Ordering: register this AFTER any auth interceptor that redirects only when there is *no* session. A\r\n * `step_up_required` 401 arrives while the session is valid, so an auth interceptor passes it through\r\n * and this interceptor gets to inspect the envelope.\r\n */\r\nexport function stepUpInterceptor(req: HttpRequest<unknown>, next: HttpHandlerFn) {\r\n const stepUp = inject(StepUpService);\r\n\r\n return next(req).pipe(\r\n catchError((error: HttpErrorResponse) => {\r\n const challenge = parseStepUpChallenge(error);\r\n if (challenge) stepUp.challenge(challenge);\r\n return throwError(() => error);\r\n })\r\n );\r\n}\r\n","import { InjectionToken } from '@angular/core';\r\n\r\n/**\r\n * Configuration for {@link provideFlyStandaloneAuth}. Everything an app must supply to wire the\r\n * shared PKCE / BFF standalone-auth vertical; the identity-provider details (authority URL,\r\n * client id, scope) come from the app's own `GET /api/{appId}/auth/config` BFF endpoint at runtime,\r\n * NOT from here.\r\n */\r\nexport interface FlyStandaloneAuthConfig {\r\n /**\r\n * The app id — the single identity string that is also the OAuth `client_id`, `serviceId`, and\r\n * federation `name`. It drives every app-owned surface this vertical touches:\r\n * - the BFF endpoint prefix `/api/{appId}/auth/{config,store-refresh,refresh,clear-refresh}`,\r\n * - the per-app `sessionStorage` PKCE keys (`{appId}_pkce_verifier` / `{appId}_pkce_state`),\r\n * - the appId-scoped step-up return key (see {@link stepUpReturnKey}).\r\n */\r\n readonly appId: string;\r\n\r\n /**\r\n * Optional OAuth scope override. When set, it is used verbatim for the authorize + token requests\r\n * instead of the `scope` returned by the BFF `/config` endpoint. Leave unset (the default) to let\r\n * the backend own the scope — the proven app behaviour. Provide it only to pin a scope the BFF\r\n * does not (yet) return.\r\n */\r\n readonly scope?: string;\r\n}\r\n\r\n/**\r\n * DI token carrying the {@link FlyStandaloneAuthConfig}. Provided by {@link provideFlyStandaloneAuth};\r\n * consumed by {@link FlyStandaloneAuthService}, {@link flyStandaloneAuthInterceptor}, the step-up\r\n * re-auth handler, and {@link FlyStandaloneAuthCallbackComponent}.\r\n */\r\nexport const FLY_STANDALONE_AUTH_CONFIG = new InjectionToken<FlyStandaloneAuthConfig>(\r\n 'FLY_STANDALONE_AUTH_CONFIG',\r\n);\r\n","import { Injectable, inject, signal } from '@angular/core';\r\nimport { Subject, type Observable } from 'rxjs';\r\nimport {\r\n HubConnection, HubConnectionBuilder, HubConnectionState, HttpTransportType, LogLevel,\r\n} from '@microsoft/signalr';\r\nimport { AuthService } from '../services/auth.service';\r\n\r\n/** Payload of the platform `AuthRefresh` push — the reason is advisory (logging only). */\r\nexport interface FlyAuthRefreshPayload {\r\n reason?: string;\r\n}\r\n\r\n/**\r\n * A shared, lazy client for the platform realtime hub at `/hubs/fly` (served by the Controller). It\r\n * lets ANY FlyOS app — the desktop shell or a standalone External App — subscribe to per-user platform\r\n * pushes without re-implementing the SignalR wiring. Currently surfaces the `AuthRefresh` signal (used by\r\n * {@link FlyAuthLiveRefresh} to re-mint a token when the user's roles/OU/app-access/license change).\r\n *\r\n * <p>Connects WebSockets-only with `skipNegotiation` (same rationale as the shell: behind a multi-replica\r\n * gateway the negotiate→connect hops can land on different replicas and 404; the Redis backplane delivers\r\n * across replicas). The bearer rides as `?access_token=` via the {@link AuthService} token. Idempotent\r\n * `connect()`; safe to call once auth is established.</p>\r\n *\r\n * <p>Requires `@microsoft/signalr` (declared a peer dependency of the design system).</p>\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyHubClient {\r\n private readonly auth = inject(AuthService);\r\n private connection: HubConnection | null = null;\r\n\r\n readonly connected = signal(false);\r\n\r\n private readonly _authRefresh$ = new Subject<FlyAuthRefreshPayload>();\r\n /** Emits when the server signals this user's authorization shape changed. */\r\n readonly authRefresh$: Observable<FlyAuthRefreshPayload> = this._authRefresh$.asObservable();\r\n\r\n /** Open the hub connection (idempotent). No-op without an access token. */\r\n connect(): void {\r\n if (this.connection !== null) return;\r\n const token = this.auth.accessToken();\r\n if (!token) return;\r\n\r\n this.connection = new HubConnectionBuilder()\r\n .withUrl('/hubs/fly', {\r\n accessTokenFactory: () => this.auth.accessToken() ?? '',\r\n skipNegotiation: true,\r\n transport: HttpTransportType.WebSockets,\r\n })\r\n .withAutomaticReconnect([0, 2000, 5000, 10000, 30000])\r\n .configureLogging(LogLevel.Warning)\r\n .build();\r\n\r\n this.connection.on('AuthRefresh', (payload: FlyAuthRefreshPayload | undefined) =>\r\n this._authRefresh$.next(payload ?? {}));\r\n\r\n this.connection.onreconnected(() => this.connected.set(true));\r\n this.connection.onreconnecting(() => this.connected.set(false));\r\n this.connection.onclose(() => { this.connected.set(false); this.connection = null; });\r\n\r\n this.connection.start()\r\n .then(() => this.connected.set(true))\r\n .catch(() => this.connected.set(false));\r\n }\r\n\r\n async disconnect(): Promise<void> {\r\n if (this.connection) {\r\n const c = this.connection;\r\n this.connection = null;\r\n this.connected.set(false);\r\n try { await c.stop(); } catch { /* already closed */ }\r\n }\r\n }\r\n\r\n get isConnected(): boolean {\r\n return this.connection?.state === HubConnectionState.Connected;\r\n }\r\n}\r\n","import { Injectable, inject } from '@angular/core';\r\nimport { Subscription, type Observable } from 'rxjs';\r\nimport { FlyHubClient } from './fly-hub-client';\r\n\r\n/** Options for {@link FlyAuthLiveRefresh.attach}. */\r\nexport interface FlyLiveRefreshOptions {\r\n /** Re-mint the session token (the host's silent-refresh). Must be idempotent & single-flight. */\r\n refresh: () => Promise<void> | void;\r\n /**\r\n * Source of the platform `AuthRefresh` signal (option ①). Omit to have the coordinator open its own\r\n * {@link FlyHubClient} connection to `/hubs/fly` — the right choice for a standalone External App with\r\n * no hub of its own. Pass the host's existing stream (e.g. the shell's RealTimeService) to reuse one\r\n * connection instead of opening a second.\r\n */\r\n signal$?: Observable<unknown>;\r\n /** Minimum ms between focus-triggered refreshes (option ②). Default 30s. */\r\n minIntervalMs?: number;\r\n}\r\n\r\n/**\r\n * The shared, app-agnostic coordinator that keeps a FlyOS session's token fresh so role / OU /\r\n * app-access / license changes reflect WITHOUT a re-login — usable identically by the desktop shell and\r\n * every standalone External App, instead of each re-implementing the triggers.\r\n *\r\n * <p>Two triggers, one shared `refresh` callback (the host owns the actual BFF refresh):</p>\r\n * <ul>\r\n * <li><b>① Push</b> — subscribes the platform `AuthRefresh` signal (from {@link signal$} or an internal\r\n * {@link FlyHubClient}) and refreshes on each.</li>\r\n * <li><b>② Focus</b> — refreshes when the tab returns to the foreground (throttled), catching changes\r\n * made while the user was away.</li>\r\n * </ul>\r\n *\r\n * <p>Idempotent: repeated {@link attach} calls are ignored (first wins). Call {@link detach} to tear down\r\n * (rarely needed — an app-lifetime singleton).</p>\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyAuthLiveRefresh {\r\n private readonly hub = inject(FlyHubClient);\r\n\r\n private attached = false;\r\n private lastRefreshAt = 0;\r\n private minIntervalMs = 30_000;\r\n private sub: Subscription | null = null;\r\n private focusHandler: (() => void) | null = null;\r\n private visibilityHandler: (() => void) | null = null;\r\n private doRefresh: (() => Promise<void> | void) | null = null;\r\n\r\n /** Wire both triggers to the host's `refresh` callback. Safe to call once at auth bootstrap. */\r\n attach(opts: FlyLiveRefreshOptions): void {\r\n if (this.attached || typeof window === 'undefined') return;\r\n this.attached = true;\r\n this.minIntervalMs = opts.minIntervalMs ?? 30_000;\r\n this.doRefresh = opts.refresh;\r\n\r\n // ① Push — reuse the host's signal source, or open our own hub connection.\r\n const source = opts.signal$ ?? (this.hub.connect(), this.hub.authRefresh$);\r\n this.sub = source.subscribe(() => this.runRefresh(/* throttle */ false));\r\n\r\n // ② Focus / visibility (throttled).\r\n this.focusHandler = () => this.runRefresh(true);\r\n this.visibilityHandler = () => { if (document.visibilityState === 'visible') this.runRefresh(true); };\r\n window.addEventListener('focus', this.focusHandler);\r\n document.addEventListener('visibilitychange', this.visibilityHandler);\r\n }\r\n\r\n detach(): void {\r\n if (this.focusHandler) window.removeEventListener('focus', this.focusHandler);\r\n if (this.visibilityHandler) document.removeEventListener('visibilitychange', this.visibilityHandler);\r\n this.sub?.unsubscribe();\r\n this.focusHandler = this.visibilityHandler = null;\r\n this.sub = null;\r\n this.attached = false;\r\n }\r\n\r\n /** Let the host mark a refresh it performed itself, so a paired focus/push doesn't double-fire. */\r\n notifyRefreshed(): void {\r\n this.lastRefreshAt = Date.now();\r\n }\r\n\r\n private runRefresh(throttled: boolean): void {\r\n if (!this.doRefresh) return;\r\n if (throttled && Date.now() - this.lastRefreshAt < this.minIntervalMs) return;\r\n // Stamp eagerly so a paired visibilitychange+focus (or a burst of pushes) collapses to one.\r\n this.lastRefreshAt = Date.now();\r\n void Promise.resolve(this.doRefresh()).catch(() => { /* transient; scheduled refresh remains */ });\r\n }\r\n}\r\n","import { Injectable, inject, signal } from '@angular/core';\r\nimport { HttpClient, HttpErrorResponse, HttpHeaders, HttpParams } from '@angular/common/http';\r\nimport { Observable, firstValueFrom, from } from 'rxjs';\r\nimport { switchMap } from 'rxjs/operators';\r\nimport { AuthService } from '../../services/auth.service';\r\nimport { User } from '../../models/user.model';\r\nimport { WINDOW_DATA } from '../../models/window.model';\r\nimport { FlyAuthLiveRefresh } from '../../realtime/fly-auth-live-refresh';\r\nimport { FLY_STANDALONE_AUTH_CONFIG } from './fly-standalone-auth.config';\r\n\r\n/** BFF `GET /api/{appId}/auth/config` response — the identity-provider coordinates for the PKCE flow. */\r\ninterface AuthConfig {\r\n authorityUrl: string;\r\n clientId: string;\r\n scope: string;\r\n}\r\n\r\n/** STS `POST /connect/token` (authorization_code grant) response. */\r\ninterface TokenResponse {\r\n access_token: string;\r\n refresh_token?: string;\r\n expires_in: number;\r\n token_type: string;\r\n}\r\n\r\n/** BFF `POST /api/{appId}/auth/refresh` response (silent refresh via the HttpOnly cookie). */\r\ninterface SilentRefreshResponse {\r\n access_token: string;\r\n expires_in: number;\r\n token_type: string;\r\n}\r\n\r\nfunction parseJwt(token: string): Record<string, unknown> | null {\r\n try {\r\n const parts = token.split('.');\r\n if (parts.length !== 3) return null;\r\n const base64 = parts[1].replace(/-/g, '+').replace(/_/g, '/');\r\n const json = decodeURIComponent(\r\n atob(base64)\r\n .split('')\r\n .map((c) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2))\r\n .join(''),\r\n );\r\n return JSON.parse(json) as Record<string, unknown>;\r\n } catch {\r\n return null;\r\n }\r\n}\r\n\r\nfunction claimsToUser(claims: Record<string, unknown>): User {\r\n const rawRole = claims['role'];\r\n const roles = Array.isArray(rawRole) ? (rawRole as string[]) : rawRole ? [rawRole as string] : [];\r\n const rawApps = claims['apps'];\r\n const apps = Array.isArray(rawApps) ? (rawApps as string[]) : rawApps ? [rawApps as string] : [];\r\n const name = (claims['name'] as string) ?? '';\r\n const parts = name.split(' ');\r\n\r\n return {\r\n id: (claims['sub'] as string) ?? '',\r\n tenantId: (claims['tenant_id'] as string) ?? null,\r\n email: (claims['email'] as string) ?? '',\r\n firstName: parts[0] ?? '',\r\n lastName: parts.slice(1).join(' '),\r\n fullName: name,\r\n preferredLocale: (claims['locale'] as string) ?? 'en',\r\n roles,\r\n apps,\r\n ou: claims['ou'] as string | undefined,\r\n createdAt: new Date(((claims['iat'] as number) ?? 0) * 1000),\r\n };\r\n}\r\n\r\n/**\r\n * The shared **standalone** PKCE / BFF auth vertical for FlyOS External Apps — one canonical port of\r\n * the auth.service.ts that Circles, GRC, and the external-app template each shipped verbatim.\r\n *\r\n * Identity ownership: the design-system {@link AuthService} is the shared-singleton identity store\r\n * that every gate / user component reads (`currentUser()`, `isAuthenticated()`, `isAdmin`). This\r\n * service owns the actual login + silent refresh, so it is the sole WRITER of that store in\r\n * standalone mode — and it DELEGATES its own `currentUser`/`accessToken`/`isAuthenticated` reads\r\n * back to it rather than keeping a private session copy, so the two can never drift (the dual-store\r\n * drift was the root cause of the \"admin nav hidden for an admin\" bug class).\r\n *\r\n * Embedded (federated) mode: when the app is mounted inside the desktop shell, `WINDOW_DATA` is\r\n * populated and the **shell** owns login + the store. This service's {@link init} is then a no-op —\r\n * consumers read the shell-populated singleton. Standalone builds never see `WINDOW_DATA`.\r\n *\r\n * Wire it with {@link provideFlyStandaloneAuth}; it is not meant to be provided by hand.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyStandaloneAuthService {\r\n private readonly http = inject(HttpClient);\r\n\r\n /** The shared identity store — this service's single source of truth (never a private copy). */\r\n private readonly dsAuth = inject(AuthService);\r\n\r\n private readonly config = inject(FLY_STANDALONE_AUTH_CONFIG);\r\n\r\n /** Live token-refresh coordinator (①push + ②focus) — keeps roles/OU/license fresh without re-login. */\r\n private readonly liveRefresh = inject(FlyAuthLiveRefresh);\r\n\r\n /**\r\n * Federated detection: in the desktop shell `WINDOW_DATA` is populated and the shell owns auth, so\r\n * {@link init} short-circuits. Standalone dev/prod → `null`.\r\n */\r\n private readonly windowData = inject(WINDOW_DATA, { optional: true });\r\n\r\n private readonly _initializing = signal(false);\r\n private refreshTimer: ReturnType<typeof setTimeout> | null = null;\r\n private configPromise: Promise<AuthConfig> | null = null;\r\n\r\n /**\r\n * Single-flight guard for {@link silentRefresh}. The refresh cookie is single-use and rotated\r\n * server-side on every call, so two overlapping refreshes (the initializer + the scheduled timer,\r\n * a re-init, or two fast navigations) would race: the first rotates the token, the second presents\r\n * the now-invalid old token and gets a 401. Collapsing concurrent callers onto one promise means\r\n * only ONE token is ever presented per refresh.\r\n */\r\n private refreshInFlight: Promise<void> | null = null;\r\n\r\n /**\r\n * Re-entrancy guard for {@link startLogin}. Concurrent triggers (N parallel API calls all 401-ing\r\n * at once, an interceptor + a route guard racing) would each regenerate the PKCE verifier/state\r\n * pair and overwrite the sessionStorage copy — the verifier presented at the callback then no\r\n * longer matches the challenge baked into the authorize redirect, and the code exchange fails.\r\n * First caller wins and navigates; later calls no-op. Reset only on failure — on success the\r\n * full-page redirect destroys this JS context anyway.\r\n */\r\n private loginInFlight = false;\r\n\r\n private get appId(): string {\r\n return this.config.appId;\r\n }\r\n\r\n private get bffBase(): string {\r\n return `/api/${this.appId}/auth`;\r\n }\r\n\r\n private get verifierKey(): string {\r\n return `${this.appId}_pkce_verifier`;\r\n }\r\n\r\n private get stateKey(): string {\r\n return `${this.appId}_pkce_state`;\r\n }\r\n\r\n // Identity is delegated to the shared design-system store (the single source of truth) — no private\r\n // session copy lives here, so the two can never drift.\r\n readonly isAuthenticated = this.dsAuth.isAuthenticated;\r\n readonly currentUser = this.dsAuth.currentUser;\r\n readonly accessToken = this.dsAuth.accessToken;\r\n readonly initializing = this._initializing.asReadonly();\r\n\r\n // ── Init ──────────────────────────────────────────────────────────────────\r\n\r\n /**\r\n * Standalone bootstrap: hydrate the session from the refresh cookie before the app renders. A\r\n * **no-op when embedded** in the shell (`WINDOW_DATA` present) — the shell owns identity there.\r\n * Also skipped on the OIDC callback route, where a code exchange is already in progress.\r\n */\r\n async init(): Promise<void> {\r\n if (this.windowData) return; // embedded in the shell — the shell populates the store.\r\n\r\n if (window.location.pathname.startsWith('/auth/callback')) return;\r\n\r\n // Live refresh: re-mint the token on a platform AuthRefresh push (its own /hubs/fly connection) or\r\n // on tab focus, so role/OU/app-access/license changes reflect without a re-login. Standalone only —\r\n // when embedded, the shell owns this (init already returned above).\r\n this.liveRefresh.attach({ refresh: () => this.silentRefresh() });\r\n\r\n this._initializing.set(true);\r\n try {\r\n if (this.dsAuth.isAuthenticated()) {\r\n this.scheduleRefresh(this.dsAuth.expiresAt());\r\n return;\r\n }\r\n await this.silentRefresh();\r\n } finally {\r\n this._initializing.set(false);\r\n }\r\n }\r\n\r\n // ── PKCE login ────────────────────────────────────────────────────────────\r\n\r\n /**\r\n * Kicks off the PKCE authorize redirect.\r\n *\r\n * @param opts.prompt When `'login'`, asks the STS to force a **fresh** interactive login (used by\r\n * the step-up flow so the issued token carries a new `auth_time`). The STS must honour\r\n * `prompt=login`/`max_age` for this to re-challenge.\r\n * @param opts.maxAge Max acceptable age (seconds) of the existing authentication before the STS\r\n * should re-challenge (sent as the OIDC `max_age` param).\r\n */\r\n async startLogin(opts?: { prompt?: 'login'; maxAge?: number }): Promise<void> {\r\n if (this.loginInFlight) return;\r\n this.loginInFlight = true;\r\n try {\r\n const config = await this.loadConfig();\r\n\r\n const verifier = this.generateCodeVerifier();\r\n const challenge = await this.generateCodeChallenge(verifier);\r\n const state = this.generateState();\r\n\r\n sessionStorage.setItem(this.verifierKey, verifier);\r\n sessionStorage.setItem(this.stateKey, state);\r\n\r\n let params = new HttpParams()\r\n .set('client_id', config.clientId)\r\n .set('redirect_uri', `${window.location.origin}/auth/callback`)\r\n .set('response_type', 'code')\r\n .set('scope', this.config.scope ?? config.scope)\r\n .set('code_challenge_method', 'S256')\r\n .set('code_challenge', challenge)\r\n .set('state', state);\r\n\r\n // Step-up: force a fresh authentication so the new token's `auth_time` clears the gate.\r\n if (opts?.prompt) params = params.set('prompt', opts.prompt);\r\n if (opts?.maxAge != null) params = params.set('max_age', String(opts.maxAge));\r\n\r\n window.location.href = `${config.authorityUrl}/connect/authorize?${params.toString()}`;\r\n } catch (err) {\r\n this.loginInFlight = false;\r\n throw err;\r\n }\r\n }\r\n\r\n // ── Callback ──────────────────────────────────────────────────────────────\r\n\r\n handleCallback(code: string, state?: string): Observable<User> {\r\n // Strict state check: when a login round-trip stored a state, the callback MUST echo it exactly.\r\n // Merely-if-present comparison would let an attacker-crafted callback simply OMIT `state` to skip\r\n // the CSRF check.\r\n const storedState = sessionStorage.getItem(this.stateKey);\r\n if (storedState && state !== storedState) {\r\n throw new Error('State mismatch — possible CSRF attack');\r\n }\r\n\r\n const verifier = sessionStorage.getItem(this.verifierKey) ?? '';\r\n sessionStorage.removeItem(this.verifierKey);\r\n sessionStorage.removeItem(this.stateKey);\r\n\r\n const headers = new HttpHeaders({ 'Content-Type': 'application/x-www-form-urlencoded' });\r\n\r\n return from(this.loadConfig()).pipe(\r\n switchMap((config) => {\r\n const body = new HttpParams()\r\n .set('grant_type', 'authorization_code')\r\n .set('code', code)\r\n .set('client_id', config.clientId)\r\n .set('redirect_uri', `${window.location.origin}/auth/callback`)\r\n .set('code_verifier', verifier);\r\n return this.http.post<TokenResponse>(`${config.authorityUrl}/connect/token`, body.toString(), { headers });\r\n }),\r\n switchMap((response) => {\r\n const claims = parseJwt(response.access_token);\r\n if (!claims) throw new Error('Invalid token response');\r\n const user = claimsToUser(claims);\r\n const expiresAt = Date.now() + response.expires_in * 1000;\r\n this.setSession(response.access_token, expiresAt, user);\r\n\r\n // Persist the refresh token in the HttpOnly cookie BEFORE resolving, so any silent refresh\r\n // triggered by a fast post-login navigation finds the cookie instead of getting a\r\n // `no_refresh_cookie` 401 that would clear the freshly-set session.\r\n if (!response.refresh_token) return from(Promise.resolve(user));\r\n return from(\r\n firstValueFrom(this.http.post(`${this.bffBase}/store-refresh`, { refreshToken: response.refresh_token }))\r\n .catch((e) => {\r\n console.warn('Failed to store refresh cookie', e);\r\n })\r\n .then(() => user),\r\n );\r\n }),\r\n );\r\n }\r\n\r\n // ── Logout ────────────────────────────────────────────────────────────────\r\n\r\n logout(): void {\r\n this.clearSession();\r\n this.http.post(`${this.bffBase}/clear-refresh`, {}).subscribe({\r\n complete: () => this.redirectToStsLogout(),\r\n error: () => this.redirectToStsLogout(),\r\n });\r\n }\r\n\r\n // ── Internal ──────────────────────────────────────────────────────────────\r\n\r\n private async redirectToStsLogout(): Promise<void> {\r\n const config = await this.loadConfig().catch(() => null);\r\n if (!config) {\r\n window.location.href = '/';\r\n return;\r\n }\r\n const postLogout = encodeURIComponent(window.location.origin);\r\n window.location.href =\r\n `${config.authorityUrl}/account/logout?postLogoutRedirectUri=${postLogout}` +\r\n `&client_id=${encodeURIComponent(config.clientId)}`;\r\n }\r\n\r\n private loadConfig(): Promise<AuthConfig> {\r\n if (!this.configPromise) {\r\n this.configPromise = firstValueFrom(this.http.get<AuthConfig>(`${this.bffBase}/config`)).catch((err) => {\r\n this.configPromise = null;\r\n throw err;\r\n });\r\n }\r\n return this.configPromise;\r\n }\r\n\r\n setSession(accessToken: string, expiresAt: number, user: User): void {\r\n // The shared DS store is the single identity source of truth — write here and read back via the\r\n // delegating computeds above. Every consumer that injects the DS AuthService reacts to the same\r\n // object.\r\n this.dsAuth.setSession(user, accessToken, expiresAt);\r\n this.scheduleRefresh(expiresAt);\r\n }\r\n\r\n private scheduleRefresh(expiresAt: number): void {\r\n if (this.refreshTimer) clearTimeout(this.refreshTimer);\r\n const refreshIn = Math.max(0, expiresAt - Date.now() - 60_000);\r\n // Route the timer through the single-flight path so it can never race a manual / init-driven\r\n // refresh and present a rotated-away cookie.\r\n this.refreshTimer = setTimeout(() => {\r\n void this.silentRefresh();\r\n }, refreshIn);\r\n }\r\n\r\n /**\r\n * Single-flight, non-destructive silent refresh.\r\n *\r\n * Concurrency: overlapping callers share one in-flight promise — only one `/refresh` is ever issued\r\n * at a time, so the single-use refresh cookie is never double-spent.\r\n *\r\n * Failure semantics: a *definitive* unauthenticated signal (`no_refresh_cookie` / `refresh_failed`,\r\n * surfaced as 401) clears the session. A *transient* failure (network error, 503 `sts_unavailable`,\r\n * or any non-401) is treated as \"keep whatever we have\" — it must NOT nuke a still-valid in-memory\r\n * session because one refresh blipped.\r\n */\r\n private silentRefresh(): Promise<void> {\r\n if (this.refreshInFlight) return this.refreshInFlight;\r\n this.refreshInFlight = this.doSilentRefresh().finally(() => {\r\n this.refreshInFlight = null;\r\n });\r\n return this.refreshInFlight;\r\n }\r\n\r\n private async doSilentRefresh(): Promise<void> {\r\n try {\r\n const response = await firstValueFrom(this.http.post<SilentRefreshResponse>(`${this.bffBase}/refresh`, {}));\r\n const claims = parseJwt(response.access_token);\r\n if (!claims) {\r\n // A 200 with an unparseable token is a definitive bad response.\r\n this.clearIfNoValidSession(true);\r\n return;\r\n }\r\n const user = claimsToUser(claims);\r\n const expiresAt = Date.now() + response.expires_in * 1000;\r\n this.setSession(response.access_token, expiresAt, user);\r\n } catch (err) {\r\n // 401 = the server gave a definitive \"you are not authenticated\" (no cookie, or the STS\r\n // rejected the refresh token). Anything else (0 network, 503, 5xx) is transient — preserve an\r\n // existing session.\r\n const definitive = err instanceof HttpErrorResponse && err.status === 401;\r\n this.clearIfNoValidSession(definitive);\r\n }\r\n }\r\n\r\n /**\r\n * Clears the session ONLY when it is safe to do so:\r\n * - `definitive` failures (real 401) always clear — the user genuinely has no usable session on\r\n * the server side.\r\n * - transient failures clear only if there is no currently-valid session to protect.\r\n */\r\n private clearIfNoValidSession(definitive: boolean): void {\r\n if (definitive || !this.isAuthenticated()) {\r\n this.clearSession();\r\n }\r\n }\r\n\r\n private clearSession(): void {\r\n this.dsAuth.clearSession();\r\n if (this.refreshTimer) {\r\n clearTimeout(this.refreshTimer);\r\n this.refreshTimer = null;\r\n }\r\n }\r\n\r\n // ── PKCE helpers ──────────────────────────────────────────────────────────\r\n\r\n private generateCodeVerifier(): string {\r\n const arr = new Uint8Array(32);\r\n crypto.getRandomValues(arr);\r\n return btoa(String.fromCharCode(...arr))\r\n .replace(/\\+/g, '-')\r\n .replace(/\\//g, '_')\r\n .replace(/=+$/, '');\r\n }\r\n\r\n private async generateCodeChallenge(verifier: string): Promise<string> {\r\n const data = new TextEncoder().encode(verifier);\r\n const digest = await crypto.subtle.digest('SHA-256', data);\r\n return btoa(String.fromCharCode(...new Uint8Array(digest)))\r\n .replace(/\\+/g, '-')\r\n .replace(/\\//g, '_')\r\n .replace(/=+$/, '');\r\n }\r\n\r\n private generateState(): string {\r\n const arr = new Uint8Array(16);\r\n crypto.getRandomValues(arr);\r\n return Array.from(arr, (b) => b.toString(16).padStart(2, '0')).join('');\r\n }\r\n}\r\n","import { inject } from '@angular/core';\r\nimport { CanActivateFn } from '@angular/router';\r\nimport { FlyStandaloneAuthService } from './fly-standalone-auth.service';\r\n\r\n/**\r\n * Standalone-dev route guard: if there is no authenticated session, start the PKCE login (redirects\r\n * to the STS) and block activation. Not reached in federated mode — the shell mounts the app's root\r\n * component directly rather than routing through the app shell.\r\n */\r\nexport const flyStandaloneAuthGuard: CanActivateFn = () => {\r\n const auth = inject(FlyStandaloneAuthService);\r\n if (auth.isAuthenticated()) return true;\r\n void auth.startLogin();\r\n return false;\r\n};\r\n","import { HttpErrorResponse, HttpHandlerFn, HttpRequest } from '@angular/common/http';\r\nimport { inject } from '@angular/core';\r\nimport { catchError, throwError } from 'rxjs';\r\nimport { FlyStandaloneAuthService } from './fly-standalone-auth.service';\r\nimport { FLY_STANDALONE_AUTH_CONFIG } from './fly-standalone-auth.config';\r\n\r\n/**\r\n * Attaches the current access token to the app's API calls, and — when a call 401s and there is no\r\n * valid session at all — kicks off the PKCE login. A 401 while a session exists is left for the\r\n * component to handle (it means that specific endpoint rejected the token, not that the whole session\r\n * is gone), so an in-memory session is never wiped by a full-page redirect. In federated mode the\r\n * shell populates the shared DS session, so `accessToken()` returns the shell's token here.\r\n *\r\n * The bearer is attached ONLY to **same-origin** requests: a relative URL, or an absolute URL whose\r\n * origin equals `window.location.origin`. An absolute third-party URL never carries the FlyOS access\r\n * token — attaching it would exfiltrate the token to whatever host the app happens to call.\r\n *\r\n * Requests that MUST NOT carry the bearer even same-origin: the STS token endpoint (its own client\r\n * auth) and the pre-auth BFF endpoints under `/api/{appId}/auth/` (they authenticate via the HttpOnly\r\n * cookie). The exclusion runs on the origin-NORMALIZED pathname, so an absolute same-origin URL to\r\n * the BFF is excluded exactly like its relative spelling.\r\n *\r\n * Ordering: register this AFTER any offline/sample-data interceptor and BEFORE `stepUpInterceptor`\r\n * (a `401 step_up_required` arrives while the session is valid, so this interceptor passes it through\r\n * and `stepUpInterceptor` gets to inspect the envelope).\r\n */\r\nexport function flyStandaloneAuthInterceptor(req: HttpRequest<unknown>, next: HttpHandlerFn) {\r\n const auth = inject(FlyStandaloneAuthService);\r\n const appId = inject(FLY_STANDALONE_AUTH_CONFIG).appId;\r\n const authPaths = ['/connect/token', `/api/${appId}/auth/`];\r\n\r\n // Normalize BEFORE any decision: resolving against the app's own origin collapses a relative URL\r\n // and its absolute same-origin spelling onto one shape, and exposes a foreign origin for what it is.\r\n let sameOrigin = false;\r\n let pathname = req.url;\r\n try {\r\n const resolved = new URL(req.url, window.location.origin);\r\n sameOrigin = resolved.origin === window.location.origin;\r\n pathname = resolved.pathname;\r\n } catch {\r\n // Unparseable URL — fail closed: no bearer.\r\n }\r\n const isAuthPath = authPaths.some((p) => pathname.includes(p));\r\n\r\n const token = auth.accessToken();\r\n const request =\r\n token && sameOrigin && !isAuthPath\r\n ? req.clone({ setHeaders: { Authorization: `Bearer ${token}` } })\r\n : req;\r\n\r\n return next(request).pipe(\r\n catchError((error: HttpErrorResponse) => {\r\n if (error.status === 401 && !isAuthPath && !auth.isAuthenticated()) {\r\n void auth.startLogin();\r\n }\r\n return throwError(() => error);\r\n }),\r\n );\r\n}\r\n","/* eslint-disable max-lines -- skills/coding-conventions.md §1 exempt taxonomy: this is a\r\n * zero-logic `Readonly<Record<string, Record<string, string>>>` data literal (copied from the\r\n * already-exempt public/locale/*.json), growing one key-block whenever a DS component adopts\r\n * `| translate`. Also path-exempt from the file-size guard in tools/conventions-guard/config.yaml\r\n * — this keeps the ESLint lane in agreement. */\r\n/**\r\n * Baseline UI strings for design-system components (markdown editor, entity\r\n * lookup, …) in the four platform locales (`en`, `ar`, `fr`, `ur`).\r\n *\r\n * These are registered as the **lowest-priority** layer of {@link I18nService}\r\n * (below the shell layer and any remote bundle), so DS components render real,\r\n * localized labels even in a **standalone** consumer — a Business App running\r\n * outside the desktop shell that never called `setShellTranslations()` — which\r\n * would otherwise see raw keys (`common.label.bold`) as the pipe's fallback.\r\n *\r\n * Precedence: any consumer-supplied key with the same name still wins, so this\r\n * is a safe default that an integrator can override without coordination.\r\n *\r\n * Scope: only the keys the **shippable** DS components reference today\r\n * (`common.*` toolbar/link/emoji-picker labels + `agent.lookup.*` + `select.*` + `typeahead.*` + `cron.*` + `gantt.*` + `form.*` + `captcha.*` + `comment.*` + `canvas_board.*` + `moderation.*` + `people_picker.*` + `pagination.*` + `tree_nav.*`). When a new DS component\r\n * starts using `| translate`, add its keys here so it stays self-sufficient.\r\n * Values are copied verbatim from the shell's `public/locale/*.json` — keep\r\n * them in sync if either side changes.\r\n */\r\nexport const DS_BASELINE_LOCALES: Readonly<Record<string, Readonly<Record<string, string>>>> = {\r\n en: {\r\n 'common.action.cancel': 'Cancel',\r\n 'common.label.apply': 'Apply',\r\n 'common.label.formatting_toolbar': 'Formatting toolbar',\r\n 'common.label.https': 'https://…',\r\n 'common.label.insert_entity_link': 'Insert in-app link',\r\n 'common.label.link': 'Link',\r\n 'common.label.blockquote': 'Quote',\r\n 'common.label.bold': 'Bold',\r\n 'common.label.bullet_list': 'Bulleted list',\r\n 'common.label.code_block': 'Code block',\r\n 'common.label.heading1': 'Heading 1',\r\n 'common.label.heading2': 'Heading 2',\r\n 'common.label.heading3': 'Heading 3',\r\n 'common.label.horizontal_rule': 'Divider',\r\n 'common.label.inline_code': 'Inline code',\r\n 'common.label.italic': 'Italic',\r\n 'common.label.numbered_list': 'Numbered list',\r\n 'common.label.redo': 'Redo',\r\n 'common.label.strikethrough': 'Strikethrough',\r\n 'common.label.task_list': 'Task list',\r\n 'common.label.underline': 'Underline',\r\n 'common.label.undo': 'Undo',\r\n 'common.label.table': 'Table',\r\n 'common.label.insert_table': 'Insert table',\r\n 'common.label.add_row_above': 'Add row above',\r\n 'common.label.add_row_below': 'Add row below',\r\n 'common.label.add_col_before': 'Add column before',\r\n 'common.label.add_col_after': 'Add column after',\r\n 'common.label.delete_row': 'Delete row',\r\n 'common.label.delete_column': 'Delete column',\r\n 'common.label.toggle_header_row': 'Toggle header row',\r\n 'common.label.merge_split_cells': 'Merge / split cells',\r\n 'common.label.align_left': 'Align left',\r\n 'common.label.align_center': 'Align center',\r\n 'common.label.align_right': 'Align right',\r\n 'common.label.delete_table': 'Delete table',\r\n 'common.label.math_inline': 'Inline math',\r\n 'common.label.math_block': 'Block math',\r\n 'common.label.edit_formula': 'Edit formula',\r\n 'common.label.math_preview': 'Formula preview',\r\n 'common.label.insert_symbol': 'Insert symbol',\r\n 'common.label.symbols': 'Symbols',\r\n 'common.label.search_symbols': 'Search symbols',\r\n 'common.label.math_palette': 'Symbols & structures',\r\n 'common.label.category_structures': 'Structures',\r\n 'common.label.category_greek': 'Greek',\r\n 'common.label.category_operators': 'Operators',\r\n 'common.label.category_arrows': 'Arrows',\r\n 'common.label.category_sets': 'Sets & logic',\r\n 'common.label.category_emoji': 'Emoji',\r\n // emoji picker (fly-emoji-picker)\r\n 'common.label.emoji_picker': 'Emoji picker',\r\n 'common.label.search_emoji': 'Search emoji',\r\n 'common.label.emoji_tabs': 'Emoji and stickers',\r\n 'common.label.emoji_tab_emoji': 'Emoji',\r\n 'common.label.emoji_tab_stickers': 'Stickers',\r\n 'common.label.emoji_show_more': 'Even more',\r\n 'common.label.emoji_show_less': 'Show less',\r\n 'common.label.skin_tone': 'Skin tone',\r\n 'common.label.skin_tone_default': 'Default',\r\n 'common.label.skin_tone_light': 'Light',\r\n 'common.label.skin_tone_medium_light': 'Medium light',\r\n 'common.label.skin_tone_medium': 'Medium',\r\n 'common.label.skin_tone_medium_dark': 'Medium dark',\r\n 'common.label.skin_tone_dark': 'Dark',\r\n 'common.label.emoji_category_status': 'Status',\r\n 'common.label.emoji_category_priority': 'Priority',\r\n 'common.label.emoji_category_time': 'Planning & time',\r\n 'common.label.emoji_category_people': 'People & roles',\r\n 'common.label.emoji_category_roles': 'Roles & professions',\r\n 'common.label.emoji_category_timers': 'Timers',\r\n 'common.label.emoji_category_weather': 'Weather & conditions',\r\n 'common.label.emoji_category_reactions': 'Reactions',\r\n 'common.label.emoji_category_communication': 'Communication',\r\n 'common.label.emoji_category_documents': 'Documents & data',\r\n 'common.label.emoji_category_finance': 'Finance',\r\n 'common.label.emoji_category_tech': 'Tech & infrastructure',\r\n 'common.label.emoji_category_process': 'Process & workflow',\r\n 'common.label.emoji_category_logistics': 'Transport & logistics',\r\n 'common.label.emoji_category_places': 'Places & facilities',\r\n 'common.label.emoji_category_symbols': 'Symbols & arrows',\r\n 'common.label.emoji_category_dots': 'Colour coding',\r\n 'agent.lookup.back_aria': 'Back to entity types',\r\n 'agent.lookup.dialog_aria': 'Entity lookup',\r\n 'agent.lookup.no_entities': 'No items available to reference.',\r\n 'agent.lookup.no_results': 'No matches found.',\r\n 'agent.lookup.searching': 'Searching…',\r\n // typeahead (fly-typeahead)\r\n // select (fly-select) — the DS control's own chrome. Consumers may still override any of\r\n // these via the matching input; these are what they fall back to.\r\n 'select.placeholder': 'Select…',\r\n 'select.search_placeholder': 'Search…',\r\n 'select.no_results': 'No results',\r\n 'select.select_all': 'Select all',\r\n 'select.clear_all': 'Clear all',\r\n 'select.clear': 'Clear',\r\n 'select.summary': '{{count}} selected',\r\n\r\n // search input (fly-search-input)\r\n 'search.placeholder': 'Search…',\r\n 'search.clear': 'Clear search',\r\n 'search.open': 'Search',\r\n 'search.filters': \"Filters\",\r\n // skeleton (fly-skeleton)\r\n 'skeleton.loading': 'Loading…',\r\n // typeahead (fly-typeahead)\r\n 'typeahead.loading': 'Loading…',\r\n 'typeahead.no_results': 'No matches found.',\r\n 'typeahead.clear': 'Clear',\r\n 'typeahead.search_label': 'Search',\r\n // cron-builder (fly-cron-builder)\r\n 'cron.frequency_label': 'Frequency',\r\n 'cron.mode.none': 'On demand (no schedule)',\r\n 'cron.mode.minutes': 'Every N minutes',\r\n 'cron.mode.hourly': 'Hourly',\r\n 'cron.mode.daily': 'Daily',\r\n 'cron.mode.weekly': 'Weekly',\r\n 'cron.mode.monthly': 'Monthly',\r\n 'cron.mode.advanced': 'Advanced (cron)',\r\n 'cron.every_label': 'Every',\r\n 'cron.unit_minutes': 'minute(s)',\r\n 'cron.unit_hours': 'hour(s)',\r\n 'cron.at_minute_label': 'at minute',\r\n 'cron.time_label': 'Time',\r\n 'cron.on_days_label': 'On days',\r\n 'cron.day_of_month_label': 'Day of month',\r\n 'cron.weekday_short.0': 'Sun',\r\n 'cron.weekday_short.1': 'Mon',\r\n 'cron.weekday_short.2': 'Tue',\r\n 'cron.weekday_short.3': 'Wed',\r\n 'cron.weekday_short.4': 'Thu',\r\n 'cron.weekday_short.5': 'Fri',\r\n 'cron.weekday_short.6': 'Sat',\r\n 'cron.advanced.second': 'Second',\r\n 'cron.advanced.minute': 'Minute',\r\n 'cron.advanced.hour': 'Hour',\r\n 'cron.advanced.day_of_month': 'Day (month)',\r\n 'cron.advanced.month': 'Month',\r\n 'cron.advanced.day_of_week': 'Day (week)',\r\n 'cron.advanced.hint': 'Cron syntax: * any · , list · - range · / step',\r\n 'cron.summary.none': 'Runs on demand only.',\r\n 'cron.summary.every_minute': 'Every minute.',\r\n 'cron.summary.every_n_minutes': 'Every {{n}} minutes.',\r\n 'cron.summary.hourly_at': 'Every hour at minute {{m}}.',\r\n 'cron.summary.every_n_hours': 'Every {{n}} hours, at minute {{m}}.',\r\n 'cron.summary.daily_at': 'Every day at {{time}}.',\r\n 'cron.summary.weekly_at': 'Every {{days}} at {{time}}.',\r\n 'cron.summary.monthly_at': 'On day {{d}} of every month at {{time}}.',\r\n 'cron.summary.custom': 'Custom schedule.',\r\n 'cron.error.invalid': 'This isn’t a valid cron expression.',\r\n 'cron.error.weekday_required': 'Pick at least one day of the week.',\r\n 'cron.error.required': 'A schedule is required.',\r\n 'cron.list_separator': ', ',\r\n // gantt (fly-gantt)\r\n 'gantt.today': 'Today',\r\n 'gantt.expand': 'Expand group',\r\n 'gantt.collapse': 'Collapse group',\r\n 'gantt.no_data': 'No scheduled items',\r\n 'gantt.overflow': 'Showing {{shown}} of {{total}} rows',\r\n 'gantt.aria.grid': 'Project timeline',\r\n 'gantt.aria.bar': '{{label}}: {{start}} to {{end}}, {{progress}}% complete',\r\n 'gantt.aria.bar_plain': '{{label}}: {{start}} to {{end}}',\r\n 'gantt.aria.group': '{{label}} group: {{start}} to {{end}}',\r\n 'gantt.aria.milestone': '{{label}} milestone on {{date}}',\r\n 'gantt.aria.unscheduled': '{{label}}: unscheduled',\r\n 'gantt.aria.resize_start': 'Resize start date',\r\n 'gantt.aria.resize_end': 'Resize end date',\r\n 'gantt.aria.link_handle': 'Drag to link from {{label}}',\r\n // dynamic-form (fly-dynamic-form / fly-survey-form)\r\n 'form.required_error': 'This field is required.',\r\n 'form.yes': 'Yes',\r\n 'form.no': 'No',\r\n 'form.select_placeholder': 'Select…',\r\n 'form.search_placeholder': 'Search…',\r\n 'form.country_search': 'Search countries…',\r\n 'form.no_results': 'No results',\r\n 'form.declaration_accept': 'I have read and accept the above.',\r\n 'form.submit': 'Submit',\r\n 'form.file_too_large': 'File exceeds the {{mb}} MB limit.',\r\n 'form.too_many_files': 'You can attach at most {{n}} file(s).',\r\n // canvas board (fly-canvas-board)\r\n 'canvas_board.board': 'Canvas board',\r\n 'canvas_board.empty': 'This board has no rows or columns yet.',\r\n 'canvas_board.delete_row': 'Delete row',\r\n 'canvas_board.delete_column': 'Delete column',\r\n 'canvas_board.add_row': 'Add row',\r\n 'canvas_board.add_column': 'Add column',\r\n 'canvas_board.add_row_placeholder': 'New tool name…',\r\n 'canvas_board.add_column_placeholder': 'New perspective name…',\r\n 'canvas_board.cell_edited_by': 'Last edited by {{user}} · {{time}}',\r\n 'canvas_board.cell_edited_at': 'Last edited {{time}}',\r\n // captcha (fly-captcha)\r\n 'captcha.label': 'Human verification',\r\n 'captcha.idle': 'Awaiting verification',\r\n 'captcha.verifying': 'Verifying…',\r\n 'captcha.verified': 'Verified',\r\n 'captcha.expired': 'Verification expired — please retry.',\r\n 'captcha.error': 'Verification failed.',\r\n // standalone auth callback (provideFlyStandaloneAuth)\r\n 'auth.callback.signing_in': 'Signing you in…',\r\n // comment-thread (fly-comment-thread)\r\n 'comment.count': '{{n}} comments',\r\n 'comment.sort_label': 'Sort comments',\r\n 'comment.sort_newest': 'Newest',\r\n 'comment.sort_oldest': 'Oldest',\r\n 'comment.lock': 'Lock thread',\r\n 'comment.unlock': 'Unlock thread',\r\n 'comment.locked_notice': 'This thread is locked — no new comments can be posted.',\r\n 'comment.composer_placeholder': 'Write a comment…',\r\n 'comment.reply_placeholder': 'Write a reply…',\r\n 'comment.post': 'Post',\r\n 'comment.save': 'Save',\r\n 'comment.empty': 'No comments yet.',\r\n 'comment.edited': '(edited)',\r\n 'comment.deleted': 'This comment was deleted.',\r\n 'comment.reply': 'Reply',\r\n 'comment.edit': 'Edit',\r\n 'comment.delete': 'Delete',\r\n 'comment.delete_confirm': 'Delete this comment?',\r\n 'comment.report': 'Report',\r\n 'comment.report_title': 'Report comment',\r\n 'comment.report_reason_label': 'Reason',\r\n 'comment.report_detail_label': 'Additional details (optional)',\r\n 'comment.report_submit': 'Submit report',\r\n 'comment.reason.Spam': 'Spam',\r\n 'comment.reason.Harassment': 'Harassment',\r\n 'comment.reason.OffTopic': 'Off-topic',\r\n 'comment.reason.Misinformation': 'Misinformation',\r\n 'comment.reason.Inappropriate': 'Inappropriate',\r\n 'comment.reason.Other': 'Other',\r\n 'comment.show_replies': 'Show {{n}} replies',\r\n 'comment.hide_replies': 'Hide replies',\r\n 'comment.load_more': 'Load more',\r\n // moderation queue (fly-moderation-queue)\r\n 'moderation.count': '{{n}} reports',\r\n 'moderation.status_label': 'Filter by status',\r\n 'moderation.status_all': 'All',\r\n 'moderation.status.Open': 'Open',\r\n 'moderation.status.UnderReview': 'Under review',\r\n 'moderation.status.ActionTaken': 'Action taken',\r\n 'moderation.status.Dismissed': 'Dismissed',\r\n 'moderation.loading': 'Loading reports…',\r\n 'moderation.empty': 'No reports to review.',\r\n 'moderation.table_caption': 'Comment moderation reports',\r\n 'moderation.col_reason': 'Reason',\r\n 'moderation.col_reporter': 'Reporter',\r\n 'moderation.col_reported': 'Reported',\r\n 'moderation.col_excerpt': 'Comment',\r\n 'moderation.col_subject': 'Subject',\r\n 'moderation.col_status': 'Status',\r\n 'moderation.col_actions': 'Actions',\r\n 'moderation.resolve': 'Resolve',\r\n 'moderation.resolve_title': 'Resolve report',\r\n 'moderation.resolution_label': 'Resolution',\r\n 'moderation.resolution.ActionTaken': 'Action taken',\r\n 'moderation.resolution.Dismissed': 'Dismissed',\r\n 'moderation.resolution_note_label': 'Note (optional)',\r\n 'moderation.delete_comment_label': 'Also delete the reported comment',\r\n 'moderation.resolve_submit': 'Resolve',\r\n 'moderation.lock_thread': 'Lock thread',\r\n // people picker (fly-people-picker)\r\n 'people_picker.search_placeholder': 'Search people…',\r\n 'people_picker.remove': 'Remove {{name}}',\r\n 'people_picker.change': 'Change',\r\n // chat composer (fly-chat-composer)\r\n 'chat_composer.label.message': 'Message',\r\n 'chat_composer.label.mention_suggestions': 'Mention suggestions',\r\n\r\n // app-surface component library (fly-card / -data-table / -pagination /\r\n // -filter-panel / forms / overlays). Absorbed with the kit from Circles.\r\n 'ui.action.addMoreOptions': 'Add more options',\r\n 'ui.action.cancel': 'Cancel',\r\n 'ui.action.clear': 'Clear',\r\n 'ui.action.clearFilters': 'Clear filters',\r\n 'ui.action.close': 'Close',\r\n 'ui.action.confirm': 'Confirm',\r\n 'ui.action.dismiss': 'Dismiss',\r\n 'ui.action.fewerOptions': 'Fewer options',\r\n 'ui.action.retry': 'Retry',\r\n 'ui.action.save': 'Save',\r\n 'ui.action.search': 'Search',\r\n 'ui.card.select': 'Select',\r\n 'ui.confirm.typeToConfirm': 'Type {{text}} to confirm',\r\n 'ui.filters.title': 'Filters',\r\n 'ui.form.autoSaving': 'Auto-saving',\r\n 'ui.nav.breadcrumbs': 'Breadcrumbs',\r\n 'ui.nav.home': 'Home',\r\n 'ui.nav.selectModule': 'Select a module',\r\n 'ui.nav.switchModule': 'Switch module',\r\n 'ui.pagination.first': 'First page',\r\n 'ui.pagination.label': 'Pagination',\r\n 'ui.pagination.last': 'Last page',\r\n 'ui.pagination.next': 'Next',\r\n 'ui.pagination.pageOf': '{{page}} / {{total}}',\r\n 'ui.pagination.previous': 'Previous',\r\n 'ui.search.placeholder': 'Search…',\r\n 'ui.state.empty': 'No results',\r\n 'ui.state.error': 'Something went wrong',\r\n 'ui.state.loading': 'Loading…',\r\n 'ui.table.actions': 'Actions',\r\n 'ui.table.sortAsc': 'Sort ascending',\r\n 'ui.table.sortDesc': 'Sort descending',\r\n 'ui.toast.label': 'Notifications',\r\n\r\n // breadcrumb (fly-breadcrumb)\r\n 'breadcrumb.label': 'Breadcrumb',\r\n // tree nav (fly-tree-nav)\r\n 'tree_nav.nav_label': 'Navigation',\r\n },\r\n ar: {\r\n 'common.action.cancel': 'إلغاء',\r\n 'common.label.apply': 'تطبيق',\r\n 'common.label.formatting_toolbar': 'شريط أدوات التنسيق',\r\n 'common.label.https': 'https://…',\r\n 'common.label.insert_entity_link': 'إدراج رابط داخل التطبيق',\r\n 'common.label.link': 'رابط',\r\n 'common.label.blockquote': 'اقتباس',\r\n 'common.label.bold': 'غامق',\r\n 'common.label.bullet_list': 'قائمة نقطية',\r\n 'common.label.code_block': 'كتلة شيفرة',\r\n 'common.label.heading1': 'عنوان 1',\r\n 'common.label.heading2': 'عنوان 2',\r\n 'common.label.heading3': 'عنوان 3',\r\n 'common.label.horizontal_rule': 'فاصل',\r\n 'common.label.inline_code': 'كود مضمّن',\r\n 'common.label.italic': 'مائل',\r\n 'common.label.numbered_list': 'قائمة مرقَّمة',\r\n 'common.label.redo': 'إعادة',\r\n 'common.label.strikethrough': 'يتوسطه خط',\r\n 'common.label.task_list': 'قائمة مهام',\r\n 'common.label.underline': 'تسطير',\r\n 'common.label.undo': 'تراجع',\r\n 'common.label.table': 'جدول',\r\n 'common.label.insert_table': 'إدراج جدول',\r\n 'common.label.add_row_above': 'إضافة صف للأعلى',\r\n 'common.label.add_row_below': 'إضافة صف للأسفل',\r\n 'common.label.add_col_before': 'إضافة عمود قبل',\r\n 'common.label.add_col_after': 'إضافة عمود بعد',\r\n 'common.label.delete_row': 'حذف الصف',\r\n 'common.label.delete_column': 'حذف العمود',\r\n 'common.label.toggle_header_row': 'تبديل صف الترويسة',\r\n 'common.label.merge_split_cells': 'دمج / تقسيم الخلايا',\r\n 'common.label.align_left': 'محاذاة لليسار',\r\n 'common.label.align_center': 'توسيط',\r\n 'common.label.align_right': 'محاذاة لليمين',\r\n 'common.label.delete_table': 'حذف الجدول',\r\n 'common.label.math_inline': 'معادلة مضمّنة',\r\n 'common.label.math_block': 'معادلة بلوك',\r\n 'common.label.edit_formula': 'تعديل المعادلة',\r\n 'common.label.math_preview': 'معاينة المعادلة',\r\n 'common.label.insert_symbol': 'إدراج رمز',\r\n 'common.label.symbols': 'الرموز',\r\n 'common.label.search_symbols': 'البحث عن رموز',\r\n 'common.label.math_palette': 'الرموز والبنى',\r\n 'common.label.category_structures': 'بُنى',\r\n 'common.label.category_greek': 'يوناني',\r\n 'common.label.category_operators': 'عوامل',\r\n 'common.label.category_arrows': 'أسهم',\r\n 'common.label.category_sets': 'المجموعات والمنطق',\r\n 'common.label.category_emoji': 'رموز تعبيرية',\r\n // emoji picker (fly-emoji-picker)\r\n 'common.label.emoji_picker': 'منتقي الرموز التعبيرية',\r\n 'common.label.search_emoji': 'البحث عن رموز تعبيرية',\r\n 'common.label.emoji_tabs': 'الرموز التعبيرية والملصقات',\r\n 'common.label.emoji_tab_emoji': 'رموز تعبيرية',\r\n 'common.label.emoji_tab_stickers': 'ملصقات',\r\n 'common.label.emoji_show_more': 'المزيد',\r\n 'common.label.emoji_show_less': 'عرض أقل',\r\n 'common.label.skin_tone': 'لون البشرة',\r\n 'common.label.skin_tone_default': 'افتراضي',\r\n 'common.label.skin_tone_light': 'فاتح',\r\n 'common.label.skin_tone_medium_light': 'فاتح متوسط',\r\n 'common.label.skin_tone_medium': 'متوسط',\r\n 'common.label.skin_tone_medium_dark': 'داكن متوسط',\r\n 'common.label.skin_tone_dark': 'داكن',\r\n 'common.label.emoji_category_status': 'الحالة',\r\n 'common.label.emoji_category_priority': 'الأولوية',\r\n 'common.label.emoji_category_time': 'التخطيط والوقت',\r\n 'common.label.emoji_category_people': 'الأشخاص والأدوار',\r\n 'common.label.emoji_category_roles': 'الأدوار والمهن',\r\n 'common.label.emoji_category_timers': 'المؤقتات',\r\n 'common.label.emoji_category_weather': 'الطقس والظروف',\r\n 'common.label.emoji_category_reactions': 'التفاعلات',\r\n 'common.label.emoji_category_communication': 'التواصل',\r\n 'common.label.emoji_category_documents': 'المستندات والبيانات',\r\n 'common.label.emoji_category_finance': 'المالية',\r\n 'common.label.emoji_category_tech': 'التقنية والبنية التحتية',\r\n 'common.label.emoji_category_process': 'العمليات وسير العمل',\r\n 'common.label.emoji_category_logistics': 'النقل والخدمات اللوجستية',\r\n 'common.label.emoji_category_places': 'الأماكن والمرافق',\r\n 'common.label.emoji_category_symbols': 'الرموز والأسهم',\r\n 'common.label.emoji_category_dots': 'الترميز اللوني',\r\n 'agent.lookup.back_aria': 'العودة إلى أنواع العناصر',\r\n 'agent.lookup.dialog_aria': 'البحث عن عنصر',\r\n 'agent.lookup.no_entities': 'لا توجد عناصر متاحة للإشارة إليها.',\r\n 'agent.lookup.no_results': 'لا توجد نتائج مطابقة.',\r\n 'agent.lookup.searching': 'جارٍ البحث…',\r\n // typeahead (fly-typeahead)\r\n // select (fly-select)\r\n 'select.placeholder': 'اختر…',\r\n 'select.search_placeholder': 'بحث…',\r\n 'select.no_results': 'لا توجد نتائج',\r\n 'select.select_all': 'تحديد الكل',\r\n 'select.clear_all': 'مسح الكل',\r\n 'select.clear': 'مسح',\r\n 'select.summary': 'تم تحديد {{count}}',\r\n\r\n // search input (fly-search-input)\r\n 'search.placeholder': 'بحث…',\r\n 'search.clear': 'مسح البحث',\r\n 'search.open': 'بحث',\r\n 'search.filters': \"عوامل التصفية\",\r\n // skeleton (fly-skeleton)\r\n 'skeleton.loading': 'جارٍ التحميل…',\r\n // typeahead (fly-typeahead)\r\n 'typeahead.loading': 'جارٍ التحميل…',\r\n 'typeahead.no_results': 'لا توجد نتائج مطابقة.',\r\n 'typeahead.clear': 'مسح',\r\n 'typeahead.search_label': 'بحث',\r\n // cron-builder (fly-cron-builder)\r\n 'cron.frequency_label': 'التكرار',\r\n 'cron.mode.none': 'عند الطلب (بدون جدولة)',\r\n 'cron.mode.minutes': 'كل عدّة دقائق',\r\n 'cron.mode.hourly': 'كل ساعة',\r\n 'cron.mode.daily': 'يوميًا',\r\n 'cron.mode.weekly': 'أسبوعيًا',\r\n 'cron.mode.monthly': 'شهريًا',\r\n 'cron.mode.advanced': 'متقدم (cron)',\r\n 'cron.every_label': 'كل',\r\n 'cron.unit_minutes': 'دقيقة',\r\n 'cron.unit_hours': 'ساعة',\r\n 'cron.at_minute_label': 'عند الدقيقة',\r\n 'cron.time_label': 'الوقت',\r\n 'cron.on_days_label': 'في أيام',\r\n 'cron.day_of_month_label': 'يوم الشهر',\r\n 'cron.weekday_short.0': 'أحد',\r\n 'cron.weekday_short.1': 'إثنين',\r\n 'cron.weekday_short.2': 'ثلاثاء',\r\n 'cron.weekday_short.3': 'أربعاء',\r\n 'cron.weekday_short.4': 'خميس',\r\n 'cron.weekday_short.5': 'جمعة',\r\n 'cron.weekday_short.6': 'سبت',\r\n 'cron.advanced.second': 'ثانية',\r\n 'cron.advanced.minute': 'دقيقة',\r\n 'cron.advanced.hour': 'ساعة',\r\n 'cron.advanced.day_of_month': 'يوم (الشهر)',\r\n 'cron.advanced.month': 'شهر',\r\n 'cron.advanced.day_of_week': 'يوم (الأسبوع)',\r\n 'cron.advanced.hint': 'صيغة cron: * الكل · , قائمة · - نطاق · / خطوة',\r\n 'cron.summary.none': 'يعمل عند الطلب فقط.',\r\n 'cron.summary.every_minute': 'كل دقيقة.',\r\n 'cron.summary.every_n_minutes': 'كل {{n}} دقائق.',\r\n 'cron.summary.hourly_at': 'كل ساعة عند الدقيقة {{m}}.',\r\n 'cron.summary.every_n_hours': 'كل {{n}} ساعات، عند الدقيقة {{m}}.',\r\n 'cron.summary.daily_at': 'كل يوم في {{time}}.',\r\n 'cron.summary.weekly_at': 'كل {{days}} في {{time}}.',\r\n 'cron.summary.monthly_at': 'في اليوم {{d}} من كل شهر في {{time}}.',\r\n 'cron.summary.custom': 'جدولة مخصصة.',\r\n 'cron.error.invalid': 'تعبير cron غير صالح.',\r\n 'cron.error.weekday_required': 'اختر يومًا واحدًا على الأقل من أيام الأسبوع.',\r\n 'cron.error.required': 'الجدولة مطلوبة.',\r\n 'cron.list_separator': '، ',\r\n // gantt (fly-gantt)\r\n 'gantt.today': 'اليوم',\r\n 'gantt.expand': 'توسيع المجموعة',\r\n 'gantt.collapse': 'طي المجموعة',\r\n 'gantt.no_data': 'لا توجد عناصر مجدولة',\r\n 'gantt.overflow': 'عرض {{shown}} من {{total}} صفوف',\r\n 'gantt.aria.grid': 'الخط الزمني للمشروع',\r\n 'gantt.aria.bar': '{{label}}: من {{start}} إلى {{end}}، اكتمل {{progress}}%',\r\n 'gantt.aria.bar_plain': '{{label}}: من {{start}} إلى {{end}}',\r\n 'gantt.aria.group': 'مجموعة {{label}}: من {{start}} إلى {{end}}',\r\n 'gantt.aria.milestone': 'معلم {{label}} في {{date}}',\r\n 'gantt.aria.unscheduled': '{{label}}: غير مجدول',\r\n 'gantt.aria.resize_start': 'تغيير تاريخ البدء',\r\n 'gantt.aria.resize_end': 'تغيير تاريخ الانتهاء',\r\n 'gantt.aria.link_handle': 'اسحب للربط من {{label}}',\r\n // dynamic-form (fly-dynamic-form / fly-survey-form)\r\n 'form.required_error': 'هذا الحقل مطلوب.',\r\n 'form.yes': 'نعم',\r\n 'form.no': 'لا',\r\n 'form.select_placeholder': 'اختر…',\r\n 'form.search_placeholder': 'بحث…',\r\n 'form.country_search': 'ابحث عن دولة…',\r\n 'form.no_results': 'لا توجد نتائج',\r\n 'form.declaration_accept': 'لقد قرأت ما سبق وأوافق عليه.',\r\n 'form.submit': 'إرسال',\r\n 'form.file_too_large': 'يتجاوز الملف الحد الأقصى {{mb}} ميغابايت.',\r\n 'form.too_many_files': 'يمكنك إرفاق {{n}} ملف كحد أقصى.',\r\n // canvas board (fly-canvas-board)\r\n 'canvas_board.board': 'لوحة الأفكار',\r\n 'canvas_board.empty': 'لا توجد صفوف أو أعمدة في هذه اللوحة بعد.',\r\n 'canvas_board.delete_row': 'حذف الصف',\r\n 'canvas_board.delete_column': 'حذف العمود',\r\n 'canvas_board.add_row': 'إضافة صف',\r\n 'canvas_board.add_column': 'إضافة عمود',\r\n 'canvas_board.add_row_placeholder': 'اسم الأداة الجديدة…',\r\n 'canvas_board.add_column_placeholder': 'اسم المنظور الجديد…',\r\n 'canvas_board.cell_edited_by': 'آخر تعديل بواسطة {{user}} · {{time}}',\r\n 'canvas_board.cell_edited_at': 'آخر تعديل {{time}}',\r\n // captcha (fly-captcha)\r\n 'captcha.label': 'التحقق البشري',\r\n 'captcha.idle': 'في انتظار التحقق',\r\n 'captcha.verifying': 'جارٍ التحقق…',\r\n 'captcha.verified': 'تم التحقق',\r\n 'captcha.expired': 'انتهت صلاحية التحقق — يرجى إعادة المحاولة.',\r\n 'captcha.error': 'فشل التحقق.',\r\n // standalone auth callback (provideFlyStandaloneAuth)\r\n 'auth.callback.signing_in': 'جارٍ تسجيل الدخول…',\r\n // comment-thread (fly-comment-thread)\r\n 'comment.count': '{{n}} تعليقات',\r\n 'comment.sort_label': 'ترتيب التعليقات',\r\n 'comment.sort_newest': 'الأحدث',\r\n 'comment.sort_oldest': 'الأقدم',\r\n 'comment.lock': 'قفل الموضوع',\r\n 'comment.unlock': 'إلغاء قفل الموضوع',\r\n 'comment.locked_notice': 'هذا الموضوع مُقفل — لا يمكن نشر تعليقات جديدة.',\r\n 'comment.composer_placeholder': 'اكتب تعليقًا…',\r\n 'comment.reply_placeholder': 'اكتب ردًا…',\r\n 'comment.post': 'نشر',\r\n 'comment.save': 'حفظ',\r\n 'comment.empty': 'لا توجد تعليقات بعد.',\r\n 'comment.edited': '(تم التعديل)',\r\n 'comment.deleted': 'تم حذف هذا التعليق.',\r\n 'comment.reply': 'رد',\r\n 'comment.edit': 'تعديل',\r\n 'comment.delete': 'حذف',\r\n 'comment.delete_confirm': 'هل تريد حذف هذا التعليق؟',\r\n 'comment.report': 'إبلاغ',\r\n 'comment.report_title': 'الإبلاغ عن تعليق',\r\n 'comment.report_reason_label': 'السبب',\r\n 'comment.report_detail_label': 'تفاصيل إضافية (اختياري)',\r\n 'comment.report_submit': 'إرسال البلاغ',\r\n 'comment.reason.Spam': 'رسائل مزعجة',\r\n 'comment.reason.Harassment': 'مضايقة',\r\n 'comment.reason.OffTopic': 'خارج الموضوع',\r\n 'comment.reason.Misinformation': 'معلومات مضللة',\r\n 'comment.reason.Inappropriate': 'غير لائق',\r\n 'comment.reason.Other': 'أخرى',\r\n 'comment.show_replies': 'عرض {{n}} ردود',\r\n 'comment.hide_replies': 'إخفاء الردود',\r\n 'comment.load_more': 'تحميل المزيد',\r\n // moderation queue (fly-moderation-queue)\r\n 'moderation.count': '{{n}} بلاغات',\r\n 'moderation.status_label': 'تصفية حسب الحالة',\r\n 'moderation.status_all': 'الكل',\r\n 'moderation.status.Open': 'مفتوح',\r\n 'moderation.status.UnderReview': 'قيد المراجعة',\r\n 'moderation.status.ActionTaken': 'تم اتخاذ إجراء',\r\n 'moderation.status.Dismissed': 'مرفوض',\r\n 'moderation.loading': 'جارٍ تحميل البلاغات…',\r\n 'moderation.empty': 'لا توجد بلاغات للمراجعة.',\r\n 'moderation.table_caption': 'بلاغات مراجعة التعليقات',\r\n 'moderation.col_reason': 'السبب',\r\n 'moderation.col_reporter': 'المُبلِّغ',\r\n 'moderation.col_reported': 'تاريخ البلاغ',\r\n 'moderation.col_excerpt': 'التعليق',\r\n 'moderation.col_subject': 'الموضوع',\r\n 'moderation.col_status': 'الحالة',\r\n 'moderation.col_actions': 'الإجراءات',\r\n 'moderation.resolve': 'حل البلاغ',\r\n 'moderation.resolve_title': 'حل البلاغ',\r\n 'moderation.resolution_label': 'القرار',\r\n 'moderation.resolution.ActionTaken': 'تم اتخاذ إجراء',\r\n 'moderation.resolution.Dismissed': 'مرفوض',\r\n 'moderation.resolution_note_label': 'ملاحظة (اختياري)',\r\n 'moderation.delete_comment_label': 'حذف التعليق المُبلَّغ عنه أيضًا',\r\n 'moderation.resolve_submit': 'حل البلاغ',\r\n 'moderation.lock_thread': 'قفل الموضوع',\r\n // people picker (fly-people-picker)\r\n 'people_picker.search_placeholder': 'ابحث عن أشخاص…',\r\n 'people_picker.remove': 'إزالة {{name}}',\r\n 'people_picker.change': 'تغيير',\r\n // chat composer (fly-chat-composer)\r\n 'chat_composer.label.message': 'رسالة',\r\n 'chat_composer.label.mention_suggestions': 'اقتراحات الإشارة',\r\n\r\n // app-surface component library (fly-card / -data-table / -pagination /\r\n // -filter-panel / forms / overlays). Absorbed with the kit from Circles.\r\n 'ui.action.addMoreOptions': 'خيارات إضافية',\r\n 'ui.action.cancel': 'إلغاء',\r\n 'ui.action.clear': 'مسح',\r\n 'ui.action.clearFilters': 'مسح عوامل التصفية',\r\n 'ui.action.close': 'إغلاق',\r\n 'ui.action.confirm': 'تأكيد',\r\n 'ui.action.dismiss': 'تجاهل',\r\n 'ui.action.fewerOptions': 'خيارات أقل',\r\n 'ui.action.retry': 'إعادة المحاولة',\r\n 'ui.action.save': 'حفظ',\r\n 'ui.action.search': 'بحث',\r\n 'ui.card.select': 'تحديد',\r\n 'ui.confirm.typeToConfirm': 'اكتب {{text}} للتأكيد',\r\n 'ui.filters.title': 'عوامل التصفية',\r\n 'ui.form.autoSaving': 'حفظ تلقائي',\r\n 'ui.nav.breadcrumbs': 'مسار التنقل',\r\n 'ui.nav.home': 'الرئيسية',\r\n 'ui.nav.selectModule': 'اختر وحدة',\r\n 'ui.nav.switchModule': 'تبديل الوحدة',\r\n 'ui.pagination.first': 'الصفحة الأولى',\r\n 'ui.pagination.label': 'تقسيم الصفحات',\r\n 'ui.pagination.last': 'الصفحة الأخيرة',\r\n 'ui.pagination.next': 'التالي',\r\n 'ui.pagination.pageOf': '{{page}} / {{total}}',\r\n 'ui.pagination.previous': 'السابق',\r\n 'ui.search.placeholder': 'بحث…',\r\n 'ui.state.empty': 'لا توجد نتائج',\r\n 'ui.state.error': 'حدث خطأ ما',\r\n 'ui.state.loading': 'جارٍ التحميل…',\r\n 'ui.table.actions': 'إجراءات',\r\n 'ui.table.sortAsc': 'ترتيب تصاعدي',\r\n 'ui.table.sortDesc': 'ترتيب تنازلي',\r\n 'ui.toast.label': 'الإشعارات',\r\n\r\n // breadcrumb (fly-breadcrumb)\r\n 'breadcrumb.label': 'مسار التنقل',\r\n // tree nav (fly-tree-nav)\r\n 'tree_nav.nav_label': 'التنقل',\r\n },\r\n fr: {\r\n 'common.action.cancel': 'Annuler',\r\n 'common.label.apply': 'Appliquer',\r\n 'common.label.formatting_toolbar': \"Barre d'outils de mise en forme\",\r\n 'common.label.https': 'https://…',\r\n 'common.label.insert_entity_link': 'Insérer un lien interne',\r\n 'common.label.link': 'Lien',\r\n 'common.label.blockquote': 'Citation',\r\n 'common.label.bold': 'Gras',\r\n 'common.label.bullet_list': 'Liste à puces',\r\n 'common.label.code_block': 'Bloc de code',\r\n 'common.label.heading1': 'Titre 1',\r\n 'common.label.heading2': 'Titre 2',\r\n 'common.label.heading3': 'Titre 3',\r\n 'common.label.horizontal_rule': 'Séparateur',\r\n 'common.label.inline_code': 'Code en ligne',\r\n 'common.label.italic': 'Italique',\r\n 'common.label.numbered_list': 'Liste numérotée',\r\n 'common.label.redo': 'Rétablir',\r\n 'common.label.strikethrough': 'Barré',\r\n 'common.label.task_list': 'Liste de tâches',\r\n 'common.label.underline': 'Souligner',\r\n 'common.label.undo': 'Annuler',\r\n 'common.label.table': 'Tableau',\r\n 'common.label.insert_table': 'Insérer un tableau',\r\n 'common.label.add_row_above': 'Ajouter une ligne au-dessus',\r\n 'common.label.add_row_below': 'Ajouter une ligne en dessous',\r\n 'common.label.add_col_before': 'Ajouter une colonne avant',\r\n 'common.label.add_col_after': 'Ajouter une colonne après',\r\n 'common.label.delete_row': 'Supprimer la ligne',\r\n 'common.label.delete_column': 'Supprimer la colonne',\r\n 'common.label.toggle_header_row': \"Basculer la ligne d'en-tête\",\r\n 'common.label.merge_split_cells': 'Fusionner / scinder les cellules',\r\n 'common.label.align_left': 'Aligner à gauche',\r\n 'common.label.align_center': 'Centrer',\r\n 'common.label.align_right': 'Aligner à droite',\r\n 'common.label.delete_table': 'Supprimer le tableau',\r\n 'common.label.math_inline': 'Formule en ligne',\r\n 'common.label.math_block': 'Formule en bloc',\r\n 'common.label.edit_formula': 'Modifier la formule',\r\n 'common.label.math_preview': 'Aperçu de la formule',\r\n 'common.label.insert_symbol': 'Insérer un symbole',\r\n 'common.label.symbols': 'Symboles',\r\n 'common.label.search_symbols': 'Rechercher des symboles',\r\n 'common.label.math_palette': 'Symboles et structures',\r\n 'common.label.category_structures': 'Structures',\r\n 'common.label.category_greek': 'Grec',\r\n 'common.label.category_operators': 'Opérateurs',\r\n 'common.label.category_arrows': 'Flèches',\r\n 'common.label.category_sets': 'Ensembles et logique',\r\n 'common.label.category_emoji': 'Émojis',\r\n // emoji picker (fly-emoji-picker)\r\n 'common.label.emoji_picker': 'Sélecteur d’émojis',\r\n 'common.label.search_emoji': 'Rechercher des émojis',\r\n 'common.label.emoji_tabs': 'Émojis et autocollants',\r\n 'common.label.emoji_tab_emoji': 'Émojis',\r\n 'common.label.emoji_tab_stickers': 'Autocollants',\r\n 'common.label.emoji_show_more': 'Encore plus',\r\n 'common.label.emoji_show_less': 'Afficher moins',\r\n 'common.label.skin_tone': 'Teinte de peau',\r\n 'common.label.skin_tone_default': 'Par défaut',\r\n 'common.label.skin_tone_light': 'Claire',\r\n 'common.label.skin_tone_medium_light': 'Moyennement claire',\r\n 'common.label.skin_tone_medium': 'Moyenne',\r\n 'common.label.skin_tone_medium_dark': 'Moyennement foncée',\r\n 'common.label.skin_tone_dark': 'Foncée',\r\n 'common.label.emoji_category_status': 'Statut',\r\n 'common.label.emoji_category_priority': 'Priorité',\r\n 'common.label.emoji_category_time': 'Planification et temps',\r\n 'common.label.emoji_category_people': 'Personnes et rôles',\r\n 'common.label.emoji_category_roles': 'Rôles et métiers',\r\n 'common.label.emoji_category_timers': 'Minuteurs',\r\n 'common.label.emoji_category_weather': 'Météo et conditions',\r\n 'common.label.emoji_category_reactions': 'Réactions',\r\n 'common.label.emoji_category_communication': 'Communication',\r\n 'common.label.emoji_category_documents': 'Documents et données',\r\n 'common.label.emoji_category_finance': 'Finance',\r\n 'common.label.emoji_category_tech': 'Technique et infrastructure',\r\n 'common.label.emoji_category_process': 'Processus et flux de travail',\r\n 'common.label.emoji_category_logistics': 'Transport et logistique',\r\n 'common.label.emoji_category_places': 'Lieux et installations',\r\n 'common.label.emoji_category_symbols': 'Symboles et flèches',\r\n 'common.label.emoji_category_dots': 'Codage couleur',\r\n 'agent.lookup.back_aria': \"Retour aux types d'entité\",\r\n 'agent.lookup.dialog_aria': \"Recherche d'entité\",\r\n 'agent.lookup.no_entities': 'Aucun élément disponible à référencer.',\r\n 'agent.lookup.no_results': 'Aucun résultat trouvé.',\r\n 'agent.lookup.searching': 'Recherche en cours…',\r\n // typeahead (fly-typeahead)\r\n // select (fly-select)\r\n 'select.placeholder': 'Sélectionner…',\r\n 'select.search_placeholder': 'Rechercher…',\r\n 'select.no_results': 'Aucun résultat',\r\n 'select.select_all': 'Tout sélectionner',\r\n 'select.clear_all': 'Tout effacer',\r\n 'select.clear': 'Effacer',\r\n 'select.summary': '{{count}} sélectionné(s)',\r\n\r\n // search input (fly-search-input)\r\n 'search.placeholder': 'Rechercher…',\r\n 'search.clear': 'Effacer la recherche',\r\n 'search.open': 'Rechercher',\r\n 'search.filters': \"Filtres\",\r\n // skeleton (fly-skeleton)\r\n 'skeleton.loading': 'Chargement…',\r\n // typeahead (fly-typeahead)\r\n 'typeahead.loading': 'Chargement…',\r\n 'typeahead.no_results': 'Aucun résultat trouvé.',\r\n 'typeahead.clear': 'Effacer',\r\n 'typeahead.search_label': 'Rechercher',\r\n // cron-builder (fly-cron-builder)\r\n 'cron.frequency_label': 'Fréquence',\r\n 'cron.mode.none': 'À la demande (aucune planification)',\r\n 'cron.mode.minutes': 'Toutes les N minutes',\r\n 'cron.mode.hourly': 'Toutes les heures',\r\n 'cron.mode.daily': 'Tous les jours',\r\n 'cron.mode.weekly': 'Toutes les semaines',\r\n 'cron.mode.monthly': 'Tous les mois',\r\n 'cron.mode.advanced': 'Avancé (cron)',\r\n 'cron.every_label': 'Toutes les',\r\n 'cron.unit_minutes': 'minute(s)',\r\n 'cron.unit_hours': 'heure(s)',\r\n 'cron.at_minute_label': 'à la minute',\r\n 'cron.time_label': 'Heure',\r\n 'cron.on_days_label': 'Les jours',\r\n 'cron.day_of_month_label': 'Jour du mois',\r\n 'cron.weekday_short.0': 'dim',\r\n 'cron.weekday_short.1': 'lun',\r\n 'cron.weekday_short.2': 'mar',\r\n 'cron.weekday_short.3': 'mer',\r\n 'cron.weekday_short.4': 'jeu',\r\n 'cron.weekday_short.5': 'ven',\r\n 'cron.weekday_short.6': 'sam',\r\n 'cron.advanced.second': 'Seconde',\r\n 'cron.advanced.minute': 'Minute',\r\n 'cron.advanced.hour': 'Heure',\r\n 'cron.advanced.day_of_month': 'Jour (mois)',\r\n 'cron.advanced.month': 'Mois',\r\n 'cron.advanced.day_of_week': 'Jour (sem.)',\r\n 'cron.advanced.hint': 'Syntaxe cron : * tout · , liste · - plage · / pas',\r\n 'cron.summary.none': 'S’exécute uniquement à la demande.',\r\n 'cron.summary.every_minute': 'Chaque minute.',\r\n 'cron.summary.every_n_minutes': 'Toutes les {{n}} minutes.',\r\n 'cron.summary.hourly_at': 'Chaque heure à la minute {{m}}.',\r\n 'cron.summary.every_n_hours': 'Toutes les {{n}} heures, à la minute {{m}}.',\r\n 'cron.summary.daily_at': 'Tous les jours à {{time}}.',\r\n 'cron.summary.weekly_at': 'Les {{days}} à {{time}}.',\r\n 'cron.summary.monthly_at': 'Le {{d}} de chaque mois à {{time}}.',\r\n 'cron.summary.custom': 'Planification personnalisée.',\r\n 'cron.error.invalid': 'Expression cron non valide.',\r\n 'cron.error.weekday_required': 'Choisissez au moins un jour de la semaine.',\r\n 'cron.error.required': 'Une planification est requise.',\r\n 'cron.list_separator': ', ',\r\n // gantt (fly-gantt)\r\n 'gantt.today': \"Aujourd'hui\",\r\n 'gantt.expand': 'Développer le groupe',\r\n 'gantt.collapse': 'Réduire le groupe',\r\n 'gantt.no_data': 'Aucun élément planifié',\r\n 'gantt.overflow': 'Affichage de {{shown}} sur {{total}} lignes',\r\n 'gantt.aria.grid': 'Chronologie du projet',\r\n 'gantt.aria.bar': '{{label}} : du {{start}} au {{end}}, {{progress}} % terminé',\r\n 'gantt.aria.bar_plain': '{{label}} : du {{start}} au {{end}}',\r\n 'gantt.aria.group': 'Groupe {{label}} : du {{start}} au {{end}}',\r\n 'gantt.aria.milestone': 'Jalon {{label}} le {{date}}',\r\n 'gantt.aria.unscheduled': '{{label}} : non planifié',\r\n 'gantt.aria.resize_start': 'Redimensionner la date de début',\r\n 'gantt.aria.resize_end': 'Redimensionner la date de fin',\r\n 'gantt.aria.link_handle': 'Glisser pour lier depuis {{label}}',\r\n // dynamic-form (fly-dynamic-form / fly-survey-form)\r\n 'form.required_error': 'Ce champ est obligatoire.',\r\n 'form.yes': 'Oui',\r\n 'form.no': 'Non',\r\n 'form.select_placeholder': 'Sélectionner…',\r\n 'form.search_placeholder': 'Rechercher…',\r\n 'form.country_search': 'Rechercher un pays…',\r\n 'form.no_results': 'Aucun résultat',\r\n 'form.declaration_accept': \"J'ai lu et j'accepte ce qui précède.\",\r\n 'form.submit': 'Envoyer',\r\n 'form.file_too_large': 'Le fichier dépasse la limite de {{mb}} Mo.',\r\n 'form.too_many_files': 'Vous pouvez joindre au maximum {{n}} fichier(s).',\r\n // canvas board (fly-canvas-board)\r\n 'canvas_board.board': 'Tableau canevas',\r\n 'canvas_board.empty': \"Ce tableau n'a pas encore de lignes ni de colonnes.\",\r\n 'canvas_board.delete_row': 'Supprimer la ligne',\r\n 'canvas_board.delete_column': 'Supprimer la colonne',\r\n 'canvas_board.add_row': 'Ajouter une ligne',\r\n 'canvas_board.add_column': 'Ajouter une colonne',\r\n 'canvas_board.add_row_placeholder': 'Nom du nouvel outil…',\r\n 'canvas_board.add_column_placeholder': 'Nom de la nouvelle perspective…',\r\n 'canvas_board.cell_edited_by': 'Modifié pour la dernière fois par {{user}} · {{time}}',\r\n 'canvas_board.cell_edited_at': 'Dernière modification {{time}}',\r\n // captcha (fly-captcha)\r\n 'captcha.label': 'Vérification humaine',\r\n 'captcha.idle': 'En attente de vérification',\r\n 'captcha.verifying': 'Vérification…',\r\n 'captcha.verified': 'Vérifié',\r\n 'captcha.expired': 'Vérification expirée — veuillez réessayer.',\r\n 'captcha.error': 'Échec de la vérification.',\r\n // standalone auth callback (provideFlyStandaloneAuth)\r\n 'auth.callback.signing_in': 'Connexion en cours…',\r\n // comment-thread (fly-comment-thread)\r\n 'comment.count': '{{n}} commentaires',\r\n 'comment.sort_label': 'Trier les commentaires',\r\n 'comment.sort_newest': 'Plus récents',\r\n 'comment.sort_oldest': 'Plus anciens',\r\n 'comment.lock': 'Verrouiller le fil',\r\n 'comment.unlock': 'Déverrouiller le fil',\r\n 'comment.locked_notice': 'Ce fil est verrouillé — aucun nouveau commentaire ne peut être publié.',\r\n 'comment.composer_placeholder': 'Écrire un commentaire…',\r\n 'comment.reply_placeholder': 'Écrire une réponse…',\r\n 'comment.post': 'Publier',\r\n 'comment.save': 'Enregistrer',\r\n 'comment.empty': 'Aucun commentaire pour le moment.',\r\n 'comment.edited': '(modifié)',\r\n 'comment.deleted': 'Ce commentaire a été supprimé.',\r\n 'comment.reply': 'Répondre',\r\n 'comment.edit': 'Modifier',\r\n 'comment.delete': 'Supprimer',\r\n 'comment.delete_confirm': 'Supprimer ce commentaire ?',\r\n 'comment.report': 'Signaler',\r\n 'comment.report_title': 'Signaler le commentaire',\r\n 'comment.report_reason_label': 'Motif',\r\n 'comment.report_detail_label': 'Détails supplémentaires (facultatif)',\r\n 'comment.report_submit': 'Envoyer le signalement',\r\n 'comment.reason.Spam': 'Spam',\r\n 'comment.reason.Harassment': 'Harcèlement',\r\n 'comment.reason.OffTopic': 'Hors sujet',\r\n 'comment.reason.Misinformation': 'Désinformation',\r\n 'comment.reason.Inappropriate': 'Inapproprié',\r\n 'comment.reason.Other': 'Autre',\r\n 'comment.show_replies': 'Afficher {{n}} réponses',\r\n 'comment.hide_replies': 'Masquer les réponses',\r\n 'comment.load_more': 'Charger plus',\r\n // moderation queue (fly-moderation-queue)\r\n 'moderation.count': '{{n}} signalements',\r\n 'moderation.status_label': 'Filtrer par statut',\r\n 'moderation.status_all': 'Tous',\r\n 'moderation.status.Open': 'Ouvert',\r\n 'moderation.status.UnderReview': 'En cours d’examen',\r\n 'moderation.status.ActionTaken': 'Action prise',\r\n 'moderation.status.Dismissed': 'Rejeté',\r\n 'moderation.loading': 'Chargement des signalements…',\r\n 'moderation.empty': 'Aucun signalement à examiner.',\r\n 'moderation.table_caption': 'Signalements de modération des commentaires',\r\n 'moderation.col_reason': 'Motif',\r\n 'moderation.col_reporter': 'Signalé par',\r\n 'moderation.col_reported': 'Signalé le',\r\n 'moderation.col_excerpt': 'Commentaire',\r\n 'moderation.col_subject': 'Sujet',\r\n 'moderation.col_status': 'Statut',\r\n 'moderation.col_actions': 'Actions',\r\n 'moderation.resolve': 'Résoudre',\r\n 'moderation.resolve_title': 'Résoudre le signalement',\r\n 'moderation.resolution_label': 'Résolution',\r\n 'moderation.resolution.ActionTaken': 'Action prise',\r\n 'moderation.resolution.Dismissed': 'Rejeté',\r\n 'moderation.resolution_note_label': 'Note (facultatif)',\r\n 'moderation.delete_comment_label': 'Supprimer également le commentaire signalé',\r\n 'moderation.resolve_submit': 'Résoudre',\r\n 'moderation.lock_thread': 'Verrouiller le fil',\r\n // people picker (fly-people-picker)\r\n 'people_picker.search_placeholder': 'Rechercher des personnes…',\r\n 'people_picker.remove': 'Retirer {{name}}',\r\n 'people_picker.change': 'Changer',\r\n // chat composer (fly-chat-composer)\r\n 'chat_composer.label.message': 'Message',\r\n 'chat_composer.label.mention_suggestions': 'Suggestions de mention',\r\n\r\n // app-surface component library (fly-card / -data-table / -pagination /\r\n // -filter-panel / forms / overlays). Absorbed with the kit from Circles.\r\n 'ui.action.addMoreOptions': 'Plus d\\'options',\r\n 'ui.action.cancel': 'Annuler',\r\n 'ui.action.clear': 'Effacer',\r\n 'ui.action.clearFilters': 'Effacer les filtres',\r\n 'ui.action.close': 'Fermer',\r\n 'ui.action.confirm': 'Confirmer',\r\n 'ui.action.dismiss': 'Ignorer',\r\n 'ui.action.fewerOptions': 'Moins d\\'options',\r\n 'ui.action.retry': 'Réessayer',\r\n 'ui.action.save': 'Enregistrer',\r\n 'ui.action.search': 'Rechercher',\r\n 'ui.card.select': 'Sélectionner',\r\n 'ui.confirm.typeToConfirm': 'Saisissez {{text}} pour confirmer',\r\n 'ui.filters.title': 'Filtres',\r\n 'ui.form.autoSaving': 'Enregistrement automatique',\r\n 'ui.nav.breadcrumbs': 'Fil d\\'Ariane',\r\n 'ui.nav.home': 'Accueil',\r\n 'ui.nav.selectModule': 'Choisir un module',\r\n 'ui.nav.switchModule': 'Changer de module',\r\n 'ui.pagination.first': 'Première page',\r\n 'ui.pagination.label': 'Pagination',\r\n 'ui.pagination.last': 'Dernière page',\r\n 'ui.pagination.next': 'Suivant',\r\n 'ui.pagination.pageOf': '{{page}} / {{total}}',\r\n 'ui.pagination.previous': 'Précédent',\r\n 'ui.search.placeholder': 'Rechercher…',\r\n 'ui.state.empty': 'Aucun résultat',\r\n 'ui.state.error': 'Une erreur est survenue',\r\n 'ui.state.loading': 'Chargement…',\r\n 'ui.table.actions': 'Actions',\r\n 'ui.table.sortAsc': 'Tri croissant',\r\n 'ui.table.sortDesc': 'Tri décroissant',\r\n 'ui.toast.label': 'Notifications',\r\n\r\n // breadcrumb (fly-breadcrumb)\r\n 'breadcrumb.label': \"Fil d'Ariane\",\r\n // tree nav (fly-tree-nav)\r\n 'tree_nav.nav_label': 'Navigation',\r\n },\r\n ur: {\r\n 'common.action.cancel': 'منسوخ کریں',\r\n 'common.label.apply': 'لاگو کریں',\r\n 'common.label.formatting_toolbar': 'فارمیٹنگ ٹول بار',\r\n 'common.label.https': 'https://…',\r\n 'common.label.insert_entity_link': 'ان-ایپ لنک داخل کریں',\r\n 'common.label.link': 'لنک',\r\n 'common.label.blockquote': 'اقتباس',\r\n 'common.label.bold': 'موٹا',\r\n 'common.label.bullet_list': 'بلٹ فہرست',\r\n 'common.label.code_block': 'کوڈ بلاک',\r\n 'common.label.heading1': 'سرخی 1',\r\n 'common.label.heading2': 'سرخی 2',\r\n 'common.label.heading3': 'سرخی 3',\r\n 'common.label.horizontal_rule': 'تقسیم لائن',\r\n 'common.label.inline_code': 'ان لائن کوڈ',\r\n 'common.label.italic': 'ترچھا',\r\n 'common.label.numbered_list': 'نمبر والی فہرست',\r\n 'common.label.redo': 'دوبارہ کریں',\r\n 'common.label.strikethrough': 'خط زدہ',\r\n 'common.label.task_list': 'ٹاسک فہرست',\r\n 'common.label.underline': 'خط کشید',\r\n 'common.label.undo': 'واپس کریں',\r\n 'common.label.table': 'ٹیبل',\r\n 'common.label.insert_table': 'ٹیبل داخل کریں',\r\n 'common.label.add_row_above': 'اوپر قطار شامل کریں',\r\n 'common.label.add_row_below': 'نیچے قطار شامل کریں',\r\n 'common.label.add_col_before': 'پہلے کالم شامل کریں',\r\n 'common.label.add_col_after': 'بعد میں کالم شامل کریں',\r\n 'common.label.delete_row': 'قطار حذف کریں',\r\n 'common.label.delete_column': 'کالم حذف کریں',\r\n 'common.label.toggle_header_row': 'ہیڈر قطار ٹوگل کریں',\r\n 'common.label.merge_split_cells': 'خانے ضم / تقسیم کریں',\r\n 'common.label.align_left': 'بائیں ترتیب دیں',\r\n 'common.label.align_center': 'درمیان میں ترتیب دیں',\r\n 'common.label.align_right': 'دائیں ترتیب دیں',\r\n 'common.label.delete_table': 'ٹیبل حذف کریں',\r\n 'common.label.math_inline': 'ان لائن ریاضی',\r\n 'common.label.math_block': 'بلاک ریاضی',\r\n 'common.label.edit_formula': 'فارمولا ترمیم کریں',\r\n 'common.label.math_preview': 'فارمولا پیش نظارہ',\r\n 'common.label.insert_symbol': 'علامت داخل کریں',\r\n 'common.label.symbols': 'علامتیں',\r\n 'common.label.search_symbols': 'علامتیں تلاش کریں',\r\n 'common.label.math_palette': 'علامتیں اور ساخت',\r\n 'common.label.category_structures': 'ساخت',\r\n 'common.label.category_greek': 'یونانی',\r\n 'common.label.category_operators': 'آپریٹرز',\r\n 'common.label.category_arrows': 'تیر',\r\n 'common.label.category_sets': 'سیٹس اور منطق',\r\n 'common.label.category_emoji': 'ایموجی',\r\n // emoji picker (fly-emoji-picker)\r\n 'common.label.emoji_picker': 'ایموجی منتخب کنندہ',\r\n 'common.label.search_emoji': 'ایموجی تلاش کریں',\r\n 'common.label.emoji_tabs': 'ایموجی اور اسٹیکرز',\r\n 'common.label.emoji_tab_emoji': 'ایموجی',\r\n 'common.label.emoji_tab_stickers': 'اسٹیکرز',\r\n 'common.label.emoji_show_more': 'مزید',\r\n 'common.label.emoji_show_less': 'کم دکھائیں',\r\n 'common.label.skin_tone': 'جلد کی رنگت',\r\n 'common.label.skin_tone_default': 'ڈیفالٹ',\r\n 'common.label.skin_tone_light': 'ہلکی',\r\n 'common.label.skin_tone_medium_light': 'درمیانی ہلکی',\r\n 'common.label.skin_tone_medium': 'درمیانی',\r\n 'common.label.skin_tone_medium_dark': 'درمیانی گہری',\r\n 'common.label.skin_tone_dark': 'گہری',\r\n 'common.label.emoji_category_status': 'حیثیت',\r\n 'common.label.emoji_category_priority': 'ترجیح',\r\n 'common.label.emoji_category_time': 'منصوبہ بندی اور وقت',\r\n 'common.label.emoji_category_people': 'لوگ اور کردار',\r\n 'common.label.emoji_category_roles': 'کردار اور پیشے',\r\n 'common.label.emoji_category_timers': 'ٹائمرز',\r\n 'common.label.emoji_category_weather': 'موسم اور حالات',\r\n 'common.label.emoji_category_reactions': 'ردعمل',\r\n 'common.label.emoji_category_communication': 'رابطہ',\r\n 'common.label.emoji_category_documents': 'دستاویزات اور ڈیٹا',\r\n 'common.label.emoji_category_finance': 'مالیات',\r\n 'common.label.emoji_category_tech': 'ٹیکنالوجی اور انفراسٹرکچر',\r\n 'common.label.emoji_category_process': 'عمل اور ورک فلو',\r\n 'common.label.emoji_category_logistics': 'نقل و حمل اور لاجسٹکس',\r\n 'common.label.emoji_category_places': 'مقامات اور سہولیات',\r\n 'common.label.emoji_category_symbols': 'علامتیں اور تیر',\r\n 'common.label.emoji_category_dots': 'رنگین کوڈنگ',\r\n 'agent.lookup.back_aria': 'عناصر کی اقسام پر واپس جائیں',\r\n 'agent.lookup.dialog_aria': 'عنصر کی تلاش',\r\n 'agent.lookup.no_entities': 'حوالہ دینے کے لیے کوئی آئٹم دستیاب نہیں۔',\r\n 'agent.lookup.no_results': 'کوئی مماثل نتیجہ نہیں ملا۔',\r\n 'agent.lookup.searching': 'تلاش جاری ہے…',\r\n // select (fly-select)\r\n 'select.placeholder': 'منتخب کریں…',\r\n 'select.search_placeholder': 'تلاش کریں…',\r\n 'select.no_results': 'کوئی نتیجہ نہیں',\r\n 'select.select_all': 'سب منتخب کریں',\r\n 'select.clear_all': 'سب صاف کریں',\r\n 'select.clear': 'صاف کریں',\r\n 'select.summary': '{{count}} منتخب',\r\n\r\n // search input (fly-search-input)\r\n 'search.placeholder': 'تلاش کریں…',\r\n 'search.clear': 'تلاش صاف کریں',\r\n 'search.open': 'تلاش کریں',\r\n 'search.filters': \"فلٹرز\",\r\n // skeleton (fly-skeleton)\r\n 'skeleton.loading': 'لوڈ ہو رہا ہے…',\r\n // typeahead (fly-typeahead)\r\n 'typeahead.loading': 'لوڈ ہو رہا ہے…',\r\n 'typeahead.no_results': 'کوئی مماثل نتیجہ نہیں ملا۔',\r\n 'typeahead.clear': 'صاف کریں',\r\n 'typeahead.search_label': 'تلاش',\r\n // cron-builder (fly-cron-builder)\r\n 'cron.frequency_label': 'تکرار',\r\n 'cron.mode.none': 'آن ڈیمانڈ (کوئی شیڈول نہیں)',\r\n 'cron.mode.minutes': 'ہر چند منٹ بعد',\r\n 'cron.mode.hourly': 'ہر گھنٹے',\r\n 'cron.mode.daily': 'روزانہ',\r\n 'cron.mode.weekly': 'ہفتہ وار',\r\n 'cron.mode.monthly': 'ماہانہ',\r\n 'cron.mode.advanced': 'ایڈوانسڈ (cron)',\r\n 'cron.every_label': 'ہر',\r\n 'cron.unit_minutes': 'منٹ',\r\n 'cron.unit_hours': 'گھنٹے',\r\n 'cron.at_minute_label': 'منٹ پر',\r\n 'cron.time_label': 'وقت',\r\n 'cron.on_days_label': 'ان دنوں',\r\n 'cron.day_of_month_label': 'مہینے کا دن',\r\n 'cron.weekday_short.0': 'اتوار',\r\n 'cron.weekday_short.1': 'پیر',\r\n 'cron.weekday_short.2': 'منگل',\r\n 'cron.weekday_short.3': 'بدھ',\r\n 'cron.weekday_short.4': 'جمعرات',\r\n 'cron.weekday_short.5': 'جمعہ',\r\n 'cron.weekday_short.6': 'ہفتہ',\r\n 'cron.advanced.second': 'سیکنڈ',\r\n 'cron.advanced.minute': 'منٹ',\r\n 'cron.advanced.hour': 'گھنٹہ',\r\n 'cron.advanced.day_of_month': 'دن (مہینہ)',\r\n 'cron.advanced.month': 'مہینہ',\r\n 'cron.advanced.day_of_week': 'دن (ہفتہ)',\r\n 'cron.advanced.hint': 'cron نحو: * سب · , فہرست · - رینج · / قدم',\r\n 'cron.summary.none': 'صرف آن ڈیمانڈ چلتا ہے۔',\r\n 'cron.summary.every_minute': 'ہر منٹ۔',\r\n 'cron.summary.every_n_minutes': 'ہر {{n}} منٹ بعد۔',\r\n 'cron.summary.hourly_at': 'ہر گھنٹے {{m}} منٹ پر۔',\r\n 'cron.summary.every_n_hours': 'ہر {{n}} گھنٹے، {{m}} منٹ پر۔',\r\n 'cron.summary.daily_at': 'ہر روز {{time}} پر۔',\r\n 'cron.summary.weekly_at': 'ہر {{days}} کو {{time}} پر۔',\r\n 'cron.summary.monthly_at': 'ہر مہینے کی {{d}} تاریخ کو {{time}} پر۔',\r\n 'cron.summary.custom': 'حسب ضرورت شیڈول۔',\r\n 'cron.error.invalid': 'یہ درست cron اظہار نہیں ہے۔',\r\n 'cron.error.weekday_required': 'ہفتے کا کم از کم ایک دن منتخب کریں۔',\r\n 'cron.error.required': 'شیڈول درکار ہے۔',\r\n 'cron.list_separator': '، ',\r\n // gantt (fly-gantt)\r\n 'gantt.today': 'آج',\r\n 'gantt.expand': 'گروپ پھیلائیں',\r\n 'gantt.collapse': 'گروپ سمیٹیں',\r\n 'gantt.no_data': 'کوئی شیڈول شدہ آئٹم نہیں',\r\n 'gantt.overflow': '{{total}} میں سے {{shown}} قطاریں دکھائی جا رہی ہیں',\r\n 'gantt.aria.grid': 'پروجیکٹ ٹائم لائن',\r\n 'gantt.aria.bar': '{{label}}: {{start}} سے {{end}} تک، {{progress}}% مکمل',\r\n 'gantt.aria.bar_plain': '{{label}}: {{start}} سے {{end}} تک',\r\n 'gantt.aria.group': 'گروپ {{label}}: {{start}} سے {{end}} تک',\r\n 'gantt.aria.milestone': '{{date}} کو {{label}} سنگ میل',\r\n 'gantt.aria.unscheduled': '{{label}}: غیر شیڈول شدہ',\r\n 'gantt.aria.resize_start': 'آغاز کی تاریخ تبدیل کریں',\r\n 'gantt.aria.resize_end': 'اختتام کی تاریخ تبدیل کریں',\r\n 'gantt.aria.link_handle': '{{label}} سے لنک کرنے کے لیے گھسیٹیں',\r\n // dynamic-form (fly-dynamic-form / fly-survey-form)\r\n 'form.required_error': 'یہ خانہ لازمی ہے۔',\r\n 'form.yes': 'ہاں',\r\n 'form.no': 'نہیں',\r\n 'form.select_placeholder': 'منتخب کریں…',\r\n 'form.search_placeholder': 'تلاش کریں…',\r\n 'form.country_search': 'ملک تلاش کریں…',\r\n 'form.no_results': 'کوئی نتیجہ نہیں',\r\n 'form.declaration_accept': 'میں نے مندرجہ بالا پڑھ لیا ہے اور اسے قبول کرتا ہوں۔',\r\n 'form.submit': 'جمع کرائیں',\r\n 'form.file_too_large': 'فائل {{mb}} ایم بی کی حد سے تجاوز کر گئی۔',\r\n 'form.too_many_files': 'آپ زیادہ سے زیادہ {{n}} فائلیں منسلک کر سکتے ہیں۔',\r\n // canvas board (fly-canvas-board)\r\n 'canvas_board.board': 'کینوس بورڈ',\r\n 'canvas_board.empty': 'اس بورڈ میں ابھی تک کوئی قطار یا کالم نہیں ہے۔',\r\n 'canvas_board.delete_row': 'قطار حذف کریں',\r\n 'canvas_board.delete_column': 'کالم حذف کریں',\r\n 'canvas_board.add_row': 'قطار شامل کریں',\r\n 'canvas_board.add_column': 'کالم شامل کریں',\r\n 'canvas_board.add_row_placeholder': 'نئے ٹول کا نام…',\r\n 'canvas_board.add_column_placeholder': 'نئے نقطہ نظر کا نام…',\r\n 'canvas_board.cell_edited_by': 'آخری بار {{user}} نے ترمیم کی · {{time}}',\r\n 'canvas_board.cell_edited_at': 'آخری ترمیم {{time}}',\r\n // captcha (fly-captcha)\r\n 'captcha.label': 'انسانی تصدیق',\r\n 'captcha.idle': 'تصدیق کے انتظار میں',\r\n 'captcha.verifying': 'تصدیق ہو رہی ہے…',\r\n 'captcha.verified': 'تصدیق ہو گئی',\r\n 'captcha.expired': 'تصدیق کی میعاد ختم — دوبارہ کوشش کریں۔',\r\n 'captcha.error': 'تصدیق ناکام۔',\r\n // standalone auth callback (provideFlyStandaloneAuth)\r\n 'auth.callback.signing_in': 'سائن ان ہو رہا ہے…',\r\n // comment-thread (fly-comment-thread)\r\n 'comment.count': '{{n}} تبصرے',\r\n 'comment.sort_label': 'تبصرے ترتیب دیں',\r\n 'comment.sort_newest': 'تازہ ترین',\r\n 'comment.sort_oldest': 'پرانے',\r\n 'comment.lock': 'تھریڈ لاک کریں',\r\n 'comment.unlock': 'تھریڈ ان لاک کریں',\r\n 'comment.locked_notice': 'یہ تھریڈ لاک ہے — نئے تبصرے پوسٹ نہیں کیے جا سکتے۔',\r\n 'comment.composer_placeholder': 'ایک تبصرہ لکھیں…',\r\n 'comment.reply_placeholder': 'جواب لکھیں…',\r\n 'comment.post': 'پوسٹ کریں',\r\n 'comment.save': 'محفوظ کریں',\r\n 'comment.empty': 'ابھی تک کوئی تبصرہ نہیں۔',\r\n 'comment.edited': '(ترمیم شدہ)',\r\n 'comment.deleted': 'یہ تبصرہ حذف کر دیا گیا ہے۔',\r\n 'comment.reply': 'جواب دیں',\r\n 'comment.edit': 'ترمیم کریں',\r\n 'comment.delete': 'حذف کریں',\r\n 'comment.delete_confirm': 'کیا یہ تبصرہ حذف کر دیا جائے؟',\r\n 'comment.report': 'رپورٹ کریں',\r\n 'comment.report_title': 'تبصرے کی رپورٹ کریں',\r\n 'comment.report_reason_label': 'وجہ',\r\n 'comment.report_detail_label': 'اضافی تفصیلات (اختیاری)',\r\n 'comment.report_submit': 'رپورٹ جمع کرائیں',\r\n 'comment.reason.Spam': 'سپیم',\r\n 'comment.reason.Harassment': 'ہراسانی',\r\n 'comment.reason.OffTopic': 'موضوع سے ہٹ کر',\r\n 'comment.reason.Misinformation': 'غلط معلومات',\r\n 'comment.reason.Inappropriate': 'نامناسب',\r\n 'comment.reason.Other': 'دیگر',\r\n 'comment.show_replies': '{{n}} جوابات دکھائیں',\r\n 'comment.hide_replies': 'جوابات چھپائیں',\r\n 'comment.load_more': 'مزید لوڈ کریں',\r\n // moderation queue (fly-moderation-queue)\r\n 'moderation.count': '{{n}} رپورٹس',\r\n 'moderation.status_label': 'حالت کے لحاظ سے فلٹر کریں',\r\n 'moderation.status_all': 'تمام',\r\n 'moderation.status.Open': 'کھلا',\r\n 'moderation.status.UnderReview': 'زیرِ جائزہ',\r\n 'moderation.status.ActionTaken': 'کارروائی کی گئی',\r\n 'moderation.status.Dismissed': 'مسترد',\r\n 'moderation.loading': 'رپورٹس لوڈ ہو رہی ہیں…',\r\n 'moderation.empty': 'جائزے کے لیے کوئی رپورٹ نہیں۔',\r\n 'moderation.table_caption': 'تبصرہ ماڈریشن رپورٹس',\r\n 'moderation.col_reason': 'وجہ',\r\n 'moderation.col_reporter': 'رپورٹ کنندہ',\r\n 'moderation.col_reported': 'رپورٹ کی تاریخ',\r\n 'moderation.col_excerpt': 'تبصرہ',\r\n 'moderation.col_subject': 'موضوع',\r\n 'moderation.col_status': 'حالت',\r\n 'moderation.col_actions': 'اقدامات',\r\n 'moderation.resolve': 'حل کریں',\r\n 'moderation.resolve_title': 'رپورٹ حل کریں',\r\n 'moderation.resolution_label': 'فیصلہ',\r\n 'moderation.resolution.ActionTaken': 'کارروائی کی گئی',\r\n 'moderation.resolution.Dismissed': 'مسترد',\r\n 'moderation.resolution_note_label': 'نوٹ (اختیاری)',\r\n 'moderation.delete_comment_label': 'رپورٹ شدہ تبصرہ بھی حذف کریں',\r\n 'moderation.resolve_submit': 'حل کریں',\r\n 'moderation.lock_thread': 'تھریڈ لاک کریں',\r\n // people picker (fly-people-picker)\r\n 'people_picker.search_placeholder': 'لوگ تلاش کریں…',\r\n 'people_picker.remove': '{{name}} کو ہٹائیں',\r\n 'people_picker.change': 'تبدیل کریں',\r\n // chat composer (fly-chat-composer)\r\n 'chat_composer.label.message': 'پیغام',\r\n 'chat_composer.label.mention_suggestions': 'تذکرے کی تجاویز',\r\n\r\n // app-surface component library (fly-card / -data-table / -pagination /\r\n // -filter-panel / forms / overlays). Absorbed with the kit from Circles.\r\n 'ui.action.addMoreOptions': 'مزید اختیارات',\r\n 'ui.action.cancel': 'منسوخ کریں',\r\n 'ui.action.clear': 'صاف کریں',\r\n 'ui.action.clearFilters': 'فلٹرز صاف کریں',\r\n 'ui.action.close': 'بند کریں',\r\n 'ui.action.confirm': 'تصدیق کریں',\r\n 'ui.action.dismiss': 'مسترد کریں',\r\n 'ui.action.fewerOptions': 'کم اختیارات',\r\n 'ui.action.retry': 'دوبارہ کوشش کریں',\r\n 'ui.action.save': 'محفوظ کریں',\r\n 'ui.action.search': 'تلاش کریں',\r\n 'ui.card.select': 'منتخب کریں',\r\n 'ui.confirm.typeToConfirm': 'تصدیق کے لیے {{text}} لکھیں',\r\n 'ui.filters.title': 'فلٹرز',\r\n 'ui.form.autoSaving': 'خودکار محفوظ ہو رہا ہے',\r\n 'ui.nav.breadcrumbs': 'بریڈکرمب',\r\n 'ui.nav.home': 'ہوم',\r\n 'ui.nav.selectModule': 'ماڈیول منتخب کریں',\r\n 'ui.nav.switchModule': 'ماڈیول تبدیل کریں',\r\n 'ui.pagination.first': 'پہلا صفحہ',\r\n 'ui.pagination.label': 'صفحہ بندی',\r\n 'ui.pagination.last': 'آخری صفحہ',\r\n 'ui.pagination.next': 'اگلا',\r\n 'ui.pagination.pageOf': '{{page}} / {{total}}',\r\n 'ui.pagination.previous': 'پچھلا',\r\n 'ui.search.placeholder': 'تلاش کریں…',\r\n 'ui.state.empty': 'کوئی نتیجہ نہیں ملا',\r\n 'ui.state.error': 'کچھ غلط ہو گیا',\r\n 'ui.state.loading': 'لوڈ ہو رہا ہے…',\r\n 'ui.table.actions': 'کارروائیاں',\r\n 'ui.table.sortAsc': 'صعودی ترتیب',\r\n 'ui.table.sortDesc': 'نزولی ترتیب',\r\n 'ui.toast.label': 'اطلاعات',\r\n\r\n // breadcrumb (fly-breadcrumb)\r\n 'breadcrumb.label': 'بریڈکرمب',\r\n // tree nav (fly-tree-nav)\r\n 'tree_nav.nav_label': 'نیویگیشن',\r\n },\r\n};\r\n","import { Injectable, computed, signal, inject, ErrorHandler } from '@angular/core';\r\nimport { DS_BASELINE_LOCALES } from '../i18n/baseline-locales';\r\n\r\n/** Locales that use RTL layout for `dir` and DS `isRtl` / `direction`. */\r\nexport const RTL_LOCALE_SET: ReadonlySet<string> = new Set(['ar', 'ur']);\r\n\r\nexport function isRtlLocale(lang: string): boolean {\r\n return RTL_LOCALE_SET.has(lang);\r\n}\r\n\r\nfunction escapeRegExp(s: string): string {\r\n return s.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\r\n}\r\n\r\n/** Accepts flat or nested JSON objects; nested keys become dot paths. Rejects arrays and non-string leaves. */\r\nfunction normalizeLocaleJson(raw: unknown): Record<string, string> {\r\n if (raw === null || typeof raw !== 'object' || Array.isArray(raw)) {\r\n throw new Error('Locale bundle must be a JSON object');\r\n }\r\n const out: Record<string, string> = {};\r\n const walk = (obj: Record<string, unknown>, prefix: string): void => {\r\n for (const [k, v] of Object.entries(obj)) {\r\n const path = prefix ? `${prefix}.${k}` : k;\r\n if (typeof v === 'string') {\r\n out[path] = v;\r\n } else if (v !== null && typeof v === 'object' && !Array.isArray(v)) {\r\n walk(v as Record<string, unknown>, path);\r\n } else {\r\n throw new Error(`Locale bundle invalid value at \"${path}\" (expected string or nested object)`);\r\n }\r\n }\r\n };\r\n walk(raw as Record<string, unknown>, '');\r\n return out;\r\n}\r\n\r\n/** Options for loading a remote or standalone locale JSON bundle. */\r\nexport interface LoadBundleOptions {\r\n /** Stable id (e.g. app id from manifest); later loads replace this bundle only. */\r\n id: string;\r\n /** Base URL ending with `/`, e.g. `https://app.example.com/locale/` or `/my-remote/locale/` */\r\n baseUrl: string;\r\n lang: string;\r\n /** When aborted, failures are ignored (e.g. superseded language load). */\r\n signal?: AbortSignal;\r\n /**\r\n * When true, fetch/parse failures are not reported via Angular `ErrorHandler`.\r\n * Use for optional remote locale bundles (e.g. federated apps that may be offline).\r\n */\r\n silent?: boolean;\r\n /**\r\n * Cache-bust token appended as `?v=<version>` to the bundle URL. Pass the\r\n * publishing app's build version (e.g. the manifest `localeVersion`, or the\r\n * app's own build SHA when it loads its locales independently) so the static\r\n * host can serve the bundle `immutable` yet a new build always refetches.\r\n * Omit for unversioned URLs (revalidation/ETag handled by the host).\r\n */\r\n version?: string;\r\n}\r\n\r\n/**\r\n * Shared I18nService for the shell and Business Apps.\r\n *\r\n * **Merge order** (later keys win): DS baseline → shell layer → remote bundles\r\n * in registration order.\r\n *\r\n * - Baseline: {@link DS_BASELINE_LOCALES} — built-in strings for DS components\r\n * (markdown editor, entity lookup) so they render localized labels even in a\r\n * standalone consumer that never populated the shell layer. Always overridable.\r\n * - Shell: `setShellTranslations()` after loading `locale/{lang}.json` and API overrides.\r\n * - Remotes: `loadBundle()` per manifest `localeBaseUrl`.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class I18nService {\r\n // NOTE (NG0200 / federation): the ErrorHandler ↔ I18nService cycle is broken on the\r\n // CONSUMER side (the shell's FlyErrorHandler resolves I18nService lazily via Injector),\r\n // NOT here — changing this service's inject() field set is a MAJOR change under the\r\n // ds-compat federation gate (a providedIn:'root' singleton forked for every remote), so\r\n // the eager optional ErrorHandler inject stays. An app whose ErrorHandler eagerly needs\r\n // I18nService must lazily resolve it on its own side.\r\n private readonly errorHandler = inject(ErrorHandler, { optional: true });\r\n\r\n private readonly _shell = signal<Record<string, string>>({});\r\n private readonly _bundles = signal<Record<string, Record<string, string>>>({});\r\n private readonly _bundleOrder = signal<string[]>([]);\r\n private readonly _locale = signal<string>('en');\r\n private readonly _version = signal(0);\r\n\r\n /** Built-in DS strings for the active locale (falls back to `en` for any\r\n * locale we don't ship). Lowest-priority layer — always overridable. */\r\n private readonly _baseline = computed<Record<string, string>>(\r\n () => DS_BASELINE_LOCALES[this._locale()] ?? DS_BASELINE_LOCALES['en'] ?? {},\r\n );\r\n\r\n private readonly _merged = computed(() => {\r\n const shell = this._shell();\r\n const order = this._bundleOrder();\r\n const bundles = this._bundles();\r\n let out: Record<string, string> = { ...this._baseline(), ...shell };\r\n for (const id of order) {\r\n const b = bundles[id];\r\n if (b) out = { ...out, ...b };\r\n }\r\n return out;\r\n });\r\n\r\n readonly locale = this._locale.asReadonly();\r\n readonly version = this._version.asReadonly();\r\n readonly isRtl = computed(() => isRtlLocale(this._locale()));\r\n readonly direction = computed(() => (isRtlLocale(this._locale()) ? 'rtl' : 'ltr'));\r\n\r\n private bump(): void {\r\n this._version.update((v) => v + 1);\r\n }\r\n\r\n /** Replace shell strings (desktop `locale/*.json` + `/api/i18n/desktop-shell/{lang}` merged by the shell). */\r\n setShellTranslations(data: Record<string, string>, lang: string): void {\r\n this._shell.set(data);\r\n this._locale.set(lang);\r\n this.bump();\r\n }\r\n\r\n setLanguage(lang: string): void {\r\n this._locale.set(lang);\r\n this.bump();\r\n }\r\n\r\n /**\r\n * Fetch `{baseUrl}{lang}.json` and store under `id`. New ids are appended to the merge order.\r\n * @returns whether the bundle was loaded successfully.\r\n */\r\n async loadBundle(opts: LoadBundleOptions): Promise<boolean> {\r\n const { id, baseUrl, lang, signal: abortSignal, silent, version } = opts;\r\n try {\r\n const base = baseUrl.endsWith('/') ? baseUrl : `${baseUrl}/`;\r\n // Build the file URL first, then append the cache-bust query so a baseUrl\r\n // is never accidentally treated as containing one (the `?v=` must sit AFTER\r\n // `<lang>.json`, not inside the path).\r\n const url = version\r\n ? `${base}${lang}.json?v=${encodeURIComponent(version)}`\r\n : `${base}${lang}.json`;\r\n const resp = await fetch(url, { signal: abortSignal });\r\n if (!resp.ok) throw new Error(`HTTP ${resp.status}`);\r\n const data = normalizeLocaleJson(await resp.json());\r\n if (abortSignal?.aborted) return false;\r\n this._bundles.update((b) => ({ ...b, [id]: data }));\r\n this._bundleOrder.update((order) => (order.includes(id) ? order : [...order, id]));\r\n this._locale.set(lang);\r\n this.bump();\r\n return true;\r\n } catch (e) {\r\n if (abortSignal?.aborted) return false;\r\n if (!silent) this.errorHandler?.handleError(e);\r\n return false;\r\n }\r\n }\r\n\r\n removeBundle(id: string): void {\r\n this._bundles.update((b) => {\r\n const next = { ...b };\r\n delete next[id];\r\n return next;\r\n });\r\n this._bundleOrder.update((order) => order.filter((x) => x !== id));\r\n this.bump();\r\n }\r\n\r\n clearRemoteBundles(): void {\r\n this._bundles.set({});\r\n this._bundleOrder.set([]);\r\n this.bump();\r\n }\r\n\r\n t(key: string, params?: Record<string, string | number>): string {\r\n const val = this._merged()[key] ?? key;\r\n if (!params) return val;\r\n return Object.entries(params).reduce((result, [k, v]) => {\r\n const safe = escapeRegExp(k);\r\n return result.replace(new RegExp(`{{\\\\s*${safe}\\\\s*}}`, 'g'), String(v));\r\n }, val);\r\n }\r\n}\r\n","import { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { I18nService } from '../services/i18n.service';\r\n\r\n/**\r\n * Translates a key using the shared I18nService.\r\n *\r\n * @example\r\n * {{ 'myApp.section.title' | translate }}\r\n * {{ 'myApp.items_count' | translate:{ n: count() } }}\r\n */\r\n@Pipe({\r\n name: 'translate',\r\n standalone: true,\r\n pure: false,\r\n})\r\nexport class TranslatePipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n\r\n transform(key: string, params?: Record<string, string | number>): string {\r\n // Read version so template CD re-runs when bundles load (merged translations updated).\r\n void this.i18n.version();\r\n return this.i18n.t(key, params);\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component, OnInit, inject } from '@angular/core';\r\nimport { HttpErrorResponse } from '@angular/common/http';\r\nimport { Router } from '@angular/router';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { STEP_UP_RETURN_KEY, stepUpReturnKey } from '../step-up/step-up.logic';\r\nimport { FlyStandaloneAuthService } from './fly-standalone-auth.service';\r\nimport { FLY_STANDALONE_AUTH_CONFIG } from './fly-standalone-auth.config';\r\n\r\n/**\r\n * Handles the OIDC authorization-code callback for the standalone PKCE vertical. The code exchange\r\n * ({@link FlyStandaloneAuthService.handleCallback}) writes the session into the shared `AuthService`\r\n * store — that service is the sole session writer — so this component only triggers the exchange and\r\n * navigates to the post-step-up return path (or `/`).\r\n *\r\n * Wire it at the `/auth/callback` route (matching the `redirect_uri`\r\n * {@link FlyStandaloneAuthService.startLogin} sends). The label is localized via the DS\r\n * {@link TranslatePipe}; the `auth.callback.signing_in` key ships in the DS baseline locales\r\n * (en/ar/fr/ur), so it resolves even in a standalone app that never populated the shell layer.\r\n */\r\n@Component({\r\n selector: 'fly-standalone-auth-callback',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n imports: [TranslatePipe],\r\n template: `\r\n <div\r\n style=\"display:flex;align-items:center;justify-content:center;height:100vh;\r\n font-family:var(--font-sans);color:var(--ink-3);font-size:var(--text-base);\"\r\n >\r\n {{ 'auth.callback.signing_in' | translate }}\r\n </div>\r\n `,\r\n})\r\nexport class FlyStandaloneAuthCallbackComponent implements OnInit {\r\n private readonly pkceAuth = inject(FlyStandaloneAuthService);\r\n private readonly router = inject(Router);\r\n private readonly appId = inject(FLY_STANDALONE_AUTH_CONFIG).appId;\r\n\r\n ngOnInit(): void {\r\n const params = new URLSearchParams(window.location.search);\r\n const code = params.get('code');\r\n const state = params.get('state') ?? undefined;\r\n\r\n if (!code) {\r\n console.error('Auth callback: missing code parameter');\r\n void this.router.navigateByUrl('/');\r\n return;\r\n }\r\n\r\n this.pkceAuth.handleCallback(code, state).subscribe({\r\n next: () => {\r\n // handleCallback already wrote the session into the shared store (single-writer contract) —\r\n // nothing to re-derive here, just leave the callback route.\r\n void this.router.navigateByUrl(this.consumeStepUpReturn());\r\n },\r\n error: (err: HttpErrorResponse) => {\r\n console.error('Auth callback failed', err);\r\n void this.router.navigateByUrl('/');\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Returns (and clears) the route to land on after login. A step-up re-auth stashes the originating\r\n * route so the user returns there and can retry the gated action; otherwise defaults to `/`. Only\r\n * same-origin relative paths are honoured (never an absolute/external URL) to avoid an open\r\n * redirect.\r\n *\r\n * Reads the appId-scoped key the standalone re-auth handler writes, and also clears the un-scoped\r\n * key `StepUpService.reauthenticate` writes, so no stale entry lingers either way.\r\n */\r\n private consumeStepUpReturn(): string {\r\n let target = '/';\r\n try {\r\n const scopedKey = stepUpReturnKey(this.appId);\r\n const stashed = sessionStorage.getItem(scopedKey) ?? sessionStorage.getItem(STEP_UP_RETURN_KEY);\r\n sessionStorage.removeItem(scopedKey);\r\n sessionStorage.removeItem(STEP_UP_RETURN_KEY);\r\n if (stashed && stashed.startsWith('/') && !stashed.startsWith('//')) target = stashed;\r\n } catch {\r\n /* sessionStorage unavailable — fall back to '/' */\r\n }\r\n return target;\r\n }\r\n}\r\n","import { EnvironmentProviders, inject, makeEnvironmentProviders, provideAppInitializer } from '@angular/core';\r\nimport { STEP_UP_REAUTH_HANDLER, type StepUpReauthHandler } from '../step-up/step-up.service';\r\nimport { stepUpReturnKey } from '../step-up/step-up.logic';\r\nimport { FLY_STANDALONE_AUTH_CONFIG, type FlyStandaloneAuthConfig } from './fly-standalone-auth.config';\r\nimport { FlyStandaloneAuthService } from './fly-standalone-auth.service';\r\n\r\n/**\r\n * Wires the shared **standalone** PKCE / BFF auth vertical for a FlyOS External App in one line.\r\n *\r\n * Provides:\r\n * - {@link FLY_STANDALONE_AUTH_CONFIG} — the app id (+ optional scope) that drives the BFF paths,\r\n * PKCE storage keys, and the step-up return key.\r\n * - {@link STEP_UP_REAUTH_HANDLER} — so the DS {@link StepUpService} can drive a re-auth by\r\n * delegating to {@link FlyStandaloneAuthService.startLogin} with `prompt=login`. The handler also\r\n * stashes the current route under the appId-scoped {@link stepUpReturnKey}, which\r\n * {@link FlyStandaloneAuthCallbackComponent} consumes to return the user to where they were.\r\n * - an app initializer that runs {@link FlyStandaloneAuthService.init} before the app renders (a\r\n * no-op when embedded in the shell — `WINDOW_DATA` present).\r\n *\r\n * The consuming app still owns its HTTP client and routes. Compose the interceptors in ORDER —\r\n * `provideHttpClient(withFetch(), withInterceptors([<offline?>, flyStandaloneAuthInterceptor,\r\n * stepUpInterceptor]))` — and wire {@link flyStandaloneAuthGuard} on gated routes plus the\r\n * {@link FlyStandaloneAuthCallbackComponent} at `/auth/callback`. See the auth/standalone README.\r\n *\r\n * @example\r\n * export const appConfig: ApplicationConfig = {\r\n * providers: [\r\n * provideFlyChunkReloadRecovery(),\r\n * provideHttpClient(withFetch(), withInterceptors([flyStandaloneAuthInterceptor, stepUpInterceptor])),\r\n * provideRouter(appRoutes),\r\n * provideFlyStandaloneAuth({ appId: 'sample' }),\r\n * ],\r\n * };\r\n */\r\nexport function provideFlyStandaloneAuth(config: FlyStandaloneAuthConfig): EnvironmentProviders {\r\n return makeEnvironmentProviders([\r\n { provide: FLY_STANDALONE_AUTH_CONFIG, useValue: config },\r\n {\r\n provide: STEP_UP_REAUTH_HANDLER,\r\n useFactory: (): StepUpReauthHandler => {\r\n const auth = inject(FlyStandaloneAuthService);\r\n return (request) => {\r\n // StepUpService already wrote the un-scoped return key; additionally stash it under the\r\n // appId-scoped key so two standalone apps on one origin don't clobber each other. The route\r\n // is unchanged here (startLogin triggers the redirect), so this captures the originating one.\r\n try {\r\n sessionStorage.setItem(stepUpReturnKey(config.appId), window.location.pathname + window.location.search);\r\n } catch {\r\n /* sessionStorage unavailable — fall back to landing on '/' after login */\r\n }\r\n return auth.startLogin(request);\r\n };\r\n },\r\n },\r\n provideAppInitializer(() => inject(FlyStandaloneAuthService).init()),\r\n ]);\r\n}\r\n","import { isPlatformBrowser } from '@angular/common';\r\nimport { Injectable, inject, PLATFORM_ID, signal } from '@angular/core';\r\n\r\n/** Single source of truth for persisted / API theme strings. */\r\nexport const FLY_THEME_MODE_IDS = ['light', 'dark'] as const;\r\n\r\nexport type FlyThemeMode = (typeof FLY_THEME_MODE_IDS)[number];\r\n\r\n/** Factory default: `dark` (opaque dark / `html.dark-theme`); shell i18n `settings.theme.dark`. Keep in sync with `UserSettings` defaults. */\r\nexport const DEFAULT_FLY_THEME_MODE: FlyThemeMode = 'dark';\r\n\r\n/** Coerce unknown values (localStorage, API) to a valid theme mode. */\r\nexport function normalizeFlyTheme(value: unknown): FlyThemeMode {\r\n if (typeof value === 'string' && (FLY_THEME_MODE_IDS as readonly string[]).includes(value)) {\r\n return value as FlyThemeMode;\r\n }\r\n return DEFAULT_FLY_THEME_MODE;\r\n}\r\n\r\n/** The one custom property the whole accent system derives from. */\r\nexport const FLY_ACCENT_PROPERTY = '--accent';\r\n\r\n/**\r\n * Characters a CSS colour can be built from — hex, functional notations, and named colours.\r\n * Anything else (`;`, `{`, `}`, quotes, …) is a token stream, not a colour.\r\n */\r\nconst COLOUR_CHARSET = /^[\\w#().,%/\\s+-]+$/;\r\n\r\n/**\r\n * True when `value` is a colour the cascade will actually accept.\r\n *\r\n * Two layers, deliberately:\r\n *\r\n * 1. **Structural** — a charset check plus an explicit `url(` ban. Cheap, and crucially the ONLY\r\n * check that runs where `CSS.supports` does not exist (SSR, and jsdom — where `CSS` is\r\n * undefined entirely). This is the layer that rejects the shapes that actually matter:\r\n * `url(https://…)`, and anything carrying a `;`/`{}` that could ride along in a slot that is\r\n * not colour-typed.\r\n * 2. **`CSS.supports`** — the browser's own parser, so it cannot drift from what CSS allows. This\r\n * is what rejects merely-wrong values (`1px`, `not-a-colour`) that are structurally harmless.\r\n *\r\n * Layer 1 alone would let `1px` through; layer 2 alone would silently pass EVERYTHING where `CSS`\r\n * is missing, which is the wrong default for a guard. Together they fail closed on the dangerous\r\n * shapes everywhere, and precisely in a browser.\r\n *\r\n * Guards {@link FlyThemeService.applyAccent}; see its docs for why a branding field reaching a\r\n * stylesheet needs this at all. The server validates too (Controller's `IsValidAccentColor`).\r\n */\r\nexport function isAccentColor(value: string): boolean {\r\n if (!COLOUR_CHARSET.test(value)) return false;\r\n if (/url\\s*\\(/i.test(value)) return false;\r\n if (typeof CSS === 'undefined' || typeof CSS.supports !== 'function') return true;\r\n return CSS.supports('color', value);\r\n}\r\n\r\n/**\r\n * Applies `html.light-theme` / `html.dark-theme` for DS SCSS, and the platform accent.\r\n * Shell and standalone Business Apps use the same service (federation singleton when shared).\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyThemeService {\r\n private readonly platformId = inject(PLATFORM_ID);\r\n\r\n readonly theme = signal<FlyThemeMode>(DEFAULT_FLY_THEME_MODE);\r\n\r\n /** Active accent override, or `null` when the theme's built-in accent is in force. */\r\n readonly accent = signal<string | null>(null);\r\n\r\n applyTheme(mode: FlyThemeMode): void {\r\n this.theme.set(mode);\r\n if (!isPlatformBrowser(this.platformId)) {\r\n return;\r\n }\r\n const html = document.documentElement;\r\n html.classList.remove('light-theme', 'dark-theme');\r\n if (mode === 'dark') {\r\n html.classList.add('dark-theme');\r\n } else {\r\n html.classList.add('light-theme');\r\n }\r\n }\r\n\r\n /**\r\n * Re-skins the platform's accent — the tenant / user customization hook.\r\n *\r\n * **One write does it.** `--accent` is the single knob: `--primary-color`, `--accent-soft`,\r\n * `--focus-ring` and the fly-context-menu gradient all `var()`/`color-mix()` off it, so setting\r\n * it here cascades to every accented control in the shell AND in every External App remote\r\n * (custom properties inherit through Angular's emulated encapsulation and across federation —\r\n * they are document-scoped, not bundle-scoped).\r\n *\r\n * Written as an inline style on `<html>`, which outranks the `html.light-theme` /\r\n * `html.dark-theme` rules that carry the default. That is deliberate: the override therefore\r\n * survives {@link applyTheme}, and light/dark keep working under a custom accent.\r\n *\r\n * **Rejects anything that is not a colour.** The value typically arrives from tenant config, i.e.\r\n * from a database — and a CSS custom property accepts almost any token stream, because the\r\n * browser only rejects it at the point of USE. `--accent: url(https://x)` is a perfectly legal\r\n * custom-property value that would be taken literally wherever the accent lands in a slot that\r\n * is not colour-typed. `CSS.supports` is the browser's own parser, so it cannot drift from what\r\n * the cascade will accept. The server validates too (Controller's `IsValidAccentColor`); this is\r\n * the second layer, and it is the one that protects a standalone consumer with a different backend.\r\n *\r\n * @param color any CSS colour (`#0aa`, `oklch(…)`, …), or `null` to restore the theme default.\r\n * @returns `true` when applied (or cleared), `false` when the value was rejected.\r\n *\r\n * @example\r\n * // tenant branding resolved at startup, user preference layered on top\r\n * theme.applyAccent(user.accent ?? tenant.accent ?? null);\r\n */\r\n applyAccent(color: string | null): boolean {\r\n const value = color?.trim() || null;\r\n if (value !== null && !isAccentColor(value)) {\r\n return false; // keep the previous accent rather than poison the cascade\r\n }\r\n this.accent.set(value);\r\n if (!isPlatformBrowser(this.platformId)) {\r\n return true;\r\n }\r\n const html = document.documentElement;\r\n if (value) {\r\n html.style.setProperty(FLY_ACCENT_PROPERTY, value);\r\n } else {\r\n html.style.removeProperty(FLY_ACCENT_PROPERTY);\r\n }\r\n return true;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\n/** Options for opening a child window. */\r\nexport interface OpenWindowOptions {\r\n /** Unique identifier for the window instance. */\r\n windowId: string;\r\n /** Display title shown in the window chrome. */\r\n title: string;\r\n /** Route path or URL to load inside the window. */\r\n route: string;\r\n /** Initial width in pixels. Defaults to 900. */\r\n width?: number;\r\n /** Initial height in pixels. Defaults to 600. */\r\n height?: number;\r\n /** Whether the window can be resized. Defaults to true. */\r\n resizable?: boolean;\r\n /** Whether the window can be maximised. Defaults to true. */\r\n maximizable?: boolean;\r\n /** Arbitrary data passed to the child window via WINDOW_DATA. */\r\n data?: unknown;\r\n}\r\n\r\n/**\r\n * Abstract interface for the WindowManager.\r\n * The FlyOS shell provides the concrete implementation; Business Apps\r\n * inject this token to open, close, and focus windows without depending\r\n * on the shell's internal implementation.\r\n */\r\nexport abstract class WindowManagerService {\r\n abstract openChildWindow(options: OpenWindowOptions): void;\r\n abstract closeWindow(windowId: string): void;\r\n abstract focusWindow(windowId: string): void;\r\n\r\n /**\r\n * Shell: increments per-window depth and shows content block UI.\r\n * Standalone / no host: no-op.\r\n */\r\n beginContentUiBlock(_windowId: string, _messageKey?: string): void {\r\n // Intentional no-op default — see doc above.\r\n return;\r\n }\r\n\r\n /** Shell: decrements depth; clears block when depth reaches 0. Standalone: no-op. */\r\n endContentUiBlock(_windowId: string): void {\r\n // Intentional no-op default — see doc above.\r\n return;\r\n }\r\n}\r\n\r\n/**\r\n * No-op fallback implementation used when running a Business App in\r\n * standalone mode (outside the FlyOS shell). Logs a warning instead of\r\n * throwing so standalone dev/test flows are not broken.\r\n */\r\n@Injectable()\r\nexport class StandaloneWindowManagerService extends WindowManagerService {\r\n openChildWindow(options: OpenWindowOptions): void {\r\n console.warn('[WindowManagerService] openChildWindow called in standalone mode — no shell available.', options);\r\n }\r\n\r\n closeWindow(windowId: string): void {\r\n console.warn('[WindowManagerService] closeWindow called in standalone mode — no shell available.', windowId);\r\n }\r\n\r\n focusWindow(windowId: string): void {\r\n console.warn('[WindowManagerService] focusWindow called in standalone mode — no shell available.', windowId);\r\n }\r\n}\r\n\r\n","import { InjectionToken, Type } from '@angular/core';\r\n\r\n/**\r\n * One row in a remote's route table. Mirrors Angular's `Route` interface but\r\n * pared down to what the FlyOS-embedded router actually supports — synchronous\r\n * component refs only (no `loadChildren`, no resolvers/guards).\r\n *\r\n * Patterns:\r\n * '' — matches an empty URL (\"/\")\r\n * 'signals' — exact static segment\r\n * 'signals/:id' — `:foo` captures any single segment into `params.foo`\r\n * 'signals/:id/edit' — mixed static + capture segments\r\n *\r\n * `data` is an opaque bag the consumer can read from `router.matchedRoute()?.data`.\r\n */\r\nexport interface FlyRemoteRoute {\r\n readonly path: string;\r\n readonly component: Type<unknown>;\r\n readonly data?: Readonly<Record<string, unknown>>;\r\n}\r\n\r\n/**\r\n * Result of matching the current `segments` against a remote's route table.\r\n * `params` contains captured `:foo` segments — empty object for paths with no\r\n * captures.\r\n */\r\nexport interface FlyRemoteMatch {\r\n readonly route: FlyRemoteRoute;\r\n readonly params: Readonly<Record<string, string>>;\r\n}\r\n\r\n/**\r\n * Optional injection token a remote provides at its root to declare which routes\r\n * `<fly-remote-router-outlet>` should resolve. Provided WITHIN the remote (not\r\n * the shell), e.g.:\r\n *\r\n * ```ts\r\n * @Component({\r\n * providers: [\r\n * FlyRemoteRouter,\r\n * { provide: FLY_REMOTE_ROUTES, useValue: CIRCLES_ROUTES },\r\n * ],\r\n * })\r\n * export class CirclesComponent { }\r\n * ```\r\n *\r\n * If no routes are provided, `FlyRemoteRouter.matchedRoute()` is always `null`\r\n * and the outlet renders nothing — useful for remotes that don't need internal\r\n * routing.\r\n */\r\nexport const FLY_REMOTE_ROUTES = new InjectionToken<readonly FlyRemoteRoute[]>(\r\n 'FLY_REMOTE_ROUTES',\r\n);\r\n\r\n/**\r\n * Optional injection token a remote provides at its root to declare the shell\r\n * mount path prefix (e.g. `'/desktop'`). When set, `FlyRemoteRouter.segments()`\r\n * strips this prefix from `window.location.pathname` before matching routes.\r\n *\r\n * **Why this is needed:** In embedded mode the remote is loaded via\r\n * `NgComponentOutlet` inside the shell SPA. The shell's own Angular route may\r\n * leave `window.location.pathname` as `/desktop` (or any shell-level path).\r\n * Without stripping that prefix, `segments()` returns `['desktop']` which\r\n * matches none of the remote's Circles-internal routes (e.g. `''`, `'signals'`,\r\n * `'signals/:id'`), so `<fly-remote-router-outlet>` renders nothing.\r\n *\r\n * **Default behaviour (token absent):** `FlyRemoteRouter` initialises `_url`\r\n * to `'/'` in embedded mode, completely ignoring `window.location.pathname`.\r\n * This is safe because the shell does not push the remote's logical URL into\r\n * browser history — only `navigate()` / `navigateByUrl()` calls do.\r\n *\r\n * **Usage in a remote root component:**\r\n * ```ts\r\n * providers: [\r\n * FlyRemoteRouter,\r\n * { provide: FLY_REMOTE_ROUTES, useValue: MY_ROUTES },\r\n * { provide: FLY_REMOTE_BASE_PATH, useValue: '/desktop' },\r\n * ]\r\n * ```\r\n *\r\n * With `basePath = '/desktop'` and `window.location.pathname = '/desktop'`,\r\n * the stripped URL is `'/'` → `segments() = []` → matches the `''` default\r\n * route. With pathname `'/desktop/signals/abc'`, segments become\r\n * `['signals', 'abc']` → matches `'signals/:id'`.\r\n *\r\n * Available since design-system **2.7.2**.\r\n */\r\nexport const FLY_REMOTE_BASE_PATH = new InjectionToken<string>(\r\n 'FLY_REMOTE_BASE_PATH',\r\n);\r\n\r\n/**\r\n * Match a route's path pattern against URL segments. Returns the captured params\r\n * map on a successful match, or `null` if the pattern can't match. Empty path\r\n * matches only an empty segments array.\r\n *\r\n * Exported for unit testing — most consumers should rely on\r\n * `FlyRemoteRouter.matchedRoute()`.\r\n */\r\nexport function matchFlyRoutePattern(\r\n pattern: string,\r\n segments: readonly string[],\r\n): Record<string, string> | null {\r\n const patternSegments = pattern.split('/').filter(Boolean);\r\n if (patternSegments.length !== segments.length) return null;\r\n\r\n const params: Record<string, string> = {};\r\n for (let i = 0; i < patternSegments.length; i++) {\r\n const p = patternSegments[i];\r\n const s = segments[i];\r\n if (p.startsWith(':')) {\r\n params[p.slice(1)] = decodeURIComponent(s);\r\n } else if (p !== s) {\r\n return null;\r\n }\r\n }\r\n return params;\r\n}\r\n","import { DestroyRef, Injectable, computed, inject, signal } from '@angular/core';\r\nimport {\r\n NavigationEnd,\r\n NavigationExtras,\r\n Router,\r\n} from '@angular/router';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport {\r\n WINDOW_DATA,\r\n FLYOS_REMOTE_ROUTE_EVENT,\r\n FlyosShellOwnsHistoryGlobalKey,\r\n type FlyRemoteRouteEventDetail,\r\n} from '../models/window.model';\r\nimport {\r\n FLY_REMOTE_BASE_PATH,\r\n FLY_REMOTE_ROUTES,\r\n FlyRemoteMatch,\r\n matchFlyRoutePattern,\r\n} from './fly-remote-router.types';\r\n\r\n/**\r\n * FlyOS standard navigation surface for Business / Supporting App remotes.\r\n *\r\n * Problem this solves\r\n * -------------------\r\n * A federated remote ships with its own Angular `Routes` table that works\r\n * perfectly in **standalone** mode (e.g. `http://localhost:7202/signals/:id`).\r\n * Once the same remote is mounted inside the FlyOS desktop shell via\r\n * `*ngComponentOutlet`, `inject(Router)` resolves to the **host shell's**\r\n * Router — which has no knowledge of `/signals/:id`. Calls like\r\n * `router.navigate(['/signals', id])` then silently no-op and the click\r\n * \"does nothing.\"\r\n *\r\n * The fix\r\n * -------\r\n * Inject `FlyRemoteRouter` instead of `Router`. It mirrors `Router.navigate` /\r\n * `Router.navigateByUrl` and:\r\n *\r\n * - **Standalone** (no `WINDOW_DATA`): delegates to the real Angular Router,\r\n * so the URL bar, browser back button, and `RouterLink` continue to work\r\n * exactly as before.\r\n * - **Embedded** (mounted in the shell via `WINDOW_DATA`): writes the target\r\n * URL to an internal signal (`url`, `segments`) and does **not** touch the\r\n * host's Router. The remote's root component watches the signal and renders\r\n * the right view (typically a `@switch` on the first segment, plus an inline\r\n * overlay for detail pages).\r\n *\r\n * Usage in a list page\r\n * --------------------\r\n * ```ts\r\n * private readonly router = inject(FlyRemoteRouter);\r\n *\r\n * openDetail(item: Signal): void {\r\n * this.router.navigate(['/signals', item.id]); // works in both modes\r\n * }\r\n * ```\r\n *\r\n * Usage in the remote's root component (embedded dispatcher)\r\n * ----------------------------------------------------------\r\n * ```ts\r\n * private readonly router = inject(FlyRemoteRouter);\r\n *\r\n * readonly view = computed(() => {\r\n * if (!this.router.isEmbedded) return null; // standalone: <router-outlet> handles it\r\n * const [head, id] = this.router.segments();\r\n * if (head === 'signals' && id) return { kind: 'signal-detail', id };\r\n * if (head === 'signals') return { kind: 'signals-list' };\r\n * return { kind: head ?? 'home' };\r\n * });\r\n * ```\r\n *\r\n * Notes\r\n * -----\r\n * - `WINDOW_DATA` is the canonical \"I am running inside the shell\" marker; the\r\n * shell provides it per window, and it is `null` everywhere else.\r\n * - `Router` is injected as `optional`. A remote that does not register a Router\r\n * (e.g. a tiny chromeless utility app) still gets a working `navigate` that\r\n * updates the `url` signal in embedded mode.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyRemoteRouter {\r\n private readonly windowData = inject(WINDOW_DATA, { optional: true });\r\n private readonly router = inject(Router, { optional: true });\r\n /**\r\n * Optional route table — if the remote provides `FLY_REMOTE_ROUTES`,\r\n * `matchedRoute` / `params` resolve against it. Unset means the consumer is\r\n * driving its own switch/template — `matchedRoute` stays `null`.\r\n */\r\n private readonly routes = inject(FLY_REMOTE_ROUTES, { optional: true }) ?? [];\r\n /**\r\n * Shell mount path prefix to strip from `window.location.pathname` when\r\n * deriving the initial URL in embedded mode. See `FLY_REMOTE_BASE_PATH` docs.\r\n *\r\n * When absent (the common case), the embedded router initialises `_url` to\r\n * `'/'` and ignores `window.location.pathname` entirely — correct because the\r\n * shell SPA never encodes the remote's logical route into the browser URL.\r\n */\r\n private readonly basePath = inject(FLY_REMOTE_BASE_PATH, { optional: true }) ?? null;\r\n\r\n /**\r\n * True when this remote is rendered inside the FlyOS desktop shell.\r\n *\r\n * Detection order:\r\n * 1. `WINDOW_DATA` is provided — the canonical signal, works when the\r\n * design-system module is genuinely shared via Native Federation's\r\n * `sharedMappings` and the InjectionToken identity matches.\r\n * 2. `globalThis.__FLYOS_SHELL__ === true` — set by the shell's `main.ts`\r\n * before `initFederation`. A plain JS global is shared across all\r\n * module instances in the same browser context, so this works even\r\n * when the InjectionToken splits between host and remote bundles\r\n * (a known Native Federation edge case).\r\n */\r\n readonly isEmbedded: boolean =\r\n this.windowData != null\r\n || (typeof globalThis !== 'undefined'\r\n && (globalThis as { __FLYOS_SHELL__?: boolean }).__FLYOS_SHELL__ === true);\r\n\r\n /**\r\n * True when a new shell owns the browser address bar + history for every\r\n * window (it set {@link FlyosShellOwnsHistoryGlobalKey}). In that mode this\r\n * router defers history to the shell: it dispatches {@link FLYOS_REMOTE_ROUTE_EVENT}\r\n * instead of `pushState`, and does not handle its own `popstate` (the shell\r\n * replays routes via `FLYOS_LAUNCH_EVENT`). Absent ⇒ legacy self-managed mode.\r\n */\r\n private get shellOwnsHistory(): boolean {\r\n return (\r\n typeof globalThis !== 'undefined' &&\r\n (globalThis as { [FlyosShellOwnsHistoryGlobalKey]?: boolean })[FlyosShellOwnsHistoryGlobalKey] === true\r\n );\r\n }\r\n\r\n private readonly _url = signal<string>('/');\r\n\r\n /**\r\n * Current logical URL of the remote — `/signals/abc` etc.\r\n *\r\n * Standalone: mirrors `Router.url` and is updated on every `NavigationEnd`.\r\n * Embedded: updated by `navigate` / `navigateByUrl` only.\r\n */\r\n readonly url = this._url.asReadonly();\r\n\r\n /**\r\n * `url` parsed into path segments, e.g. `'/signals/abc'` → `['signals', 'abc']`.\r\n * Query string and hash are stripped. Empty segments removed.\r\n */\r\n readonly segments = computed<readonly string[]>(() => {\r\n const u = this._url();\r\n return u.split('?')[0].split('#')[0].split('/').filter(Boolean);\r\n });\r\n\r\n /**\r\n * First route from `FLY_REMOTE_ROUTES` whose pattern matches `segments()`,\r\n * paired with its captured params. `null` when no routes are registered or\r\n * none matches. Used by `<fly-remote-router-outlet>` to pick what to render.\r\n *\r\n * Match order: routes are tried in declaration order. Put more specific\r\n * patterns (e.g. `'signals/:id'`) before catch-alls.\r\n */\r\n readonly matchedRoute = computed<FlyRemoteMatch | null>(() => {\r\n const segs = this.segments();\r\n for (const route of this.routes) {\r\n const params = matchFlyRoutePattern(route.path, segs);\r\n if (params != null) return { route, params };\r\n }\r\n return null;\r\n });\r\n\r\n /**\r\n * Captured route params from the active route, e.g. `{ id: 'abc' }` for a\r\n * `'signals/:id'` match on `/signals/abc`. Empty object if no route matched\r\n * or the matched route has no captures.\r\n *\r\n * Components can read this directly:\r\n * ```ts\r\n * private readonly flyRouter = inject(FlyRemoteRouter);\r\n * readonly signalId = computed(() => this.flyRouter.params()['id'] ?? '');\r\n * ```\r\n */\r\n readonly params = computed<Readonly<Record<string, string>>>(() =>\r\n this.matchedRoute()?.params ?? {},\r\n );\r\n\r\n private readonly destroyRef = inject(DestroyRef);\r\n\r\n constructor() {\r\n if (!this.isEmbedded && this.router) {\r\n // Standalone: seed from Angular Router and track NavigationEnd events so\r\n // browser back/forward (which the host Router handles) keep segments() current.\r\n this._url.set(this.router.url);\r\n this.router.events\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe(event => {\r\n if (event instanceof NavigationEnd) {\r\n this._url.set(event.urlAfterRedirects);\r\n }\r\n });\r\n } else if (this.isEmbedded) {\r\n // Embedded: the shell SPA keeps its own route in window.location.pathname\r\n // (e.g. '/desktop') which is meaningless for the remote's route table.\r\n // Default: initialise to '/' so the remote's empty-path default route\r\n // matches on first render. When FLY_REMOTE_BASE_PATH is provided, strip\r\n // it from pathname first — useful if the shell does push a remote-aware\r\n // URL (e.g. '/desktop/signals/abc' with basePath '/desktop').\r\n if (typeof window !== 'undefined') {\r\n const rawPath = window.location.pathname || '/';\r\n const initialUrl = this._resolveEmbeddedInitialUrl(rawPath);\r\n this._url.set(initialUrl);\r\n\r\n // When the shell owns history it replays our route on Back/Forward via\r\n // FLYOS_LAUNCH_EVENT (the remote root re-applies it), so we must NOT also\r\n // handle popstate — the shell's entries carry no `flyRemoteUrl` and we'd\r\n // clobber `_url` with the shell path. Only self-manage under a legacy shell.\r\n if (!this.shellOwnsHistory) {\r\n // Listen for browser back/forward so segments() stays in sync with\r\n // history entries pushed by navigate() / navigateByUrl().\r\n const onPopState = (event: PopStateEvent): void => {\r\n const state = event.state as { flyRemoteUrl?: string } | null;\r\n // Prefer the URL we stashed in the history state; fall back to pathname.\r\n const url = state?.flyRemoteUrl ?? window.location.pathname ?? '/';\r\n this._url.set(url.startsWith('/') ? url : '/' + url);\r\n };\r\n\r\n window.addEventListener('popstate', onPopState);\r\n\r\n // Defensive cleanup — the service is providedIn: 'root' so this fires\r\n // only when the whole Angular app is destroyed, but it keeps things tidy.\r\n this.destroyRef.onDestroy(() => {\r\n window.removeEventListener('popstate', onPopState);\r\n });\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Navigate to a route, identified by an array of commands as you would pass\r\n * to Angular's `Router.navigate`. In embedded mode `extras` is ignored — the\r\n * shell owns history and query-param handling for the window's URL.\r\n */\r\n navigate(commands: readonly unknown[], extras?: NavigationExtras): Promise<boolean> {\r\n if (!this.isEmbedded && this.router) {\r\n // Standalone: Angular Router owns history — pushState semantics are the default.\r\n return this.router.navigate(commands as unknown[], extras);\r\n }\r\n const url = this.buildUrl(commands);\r\n this._pushEmbedded(url);\r\n return Promise.resolve(true);\r\n }\r\n\r\n /**\r\n * Navigate to a route given as a full URL string. Mirrors `Router.navigateByUrl`.\r\n */\r\n navigateByUrl(url: string, extras?: NavigationExtras): Promise<boolean> {\r\n if (!this.isEmbedded && this.router) {\r\n // Standalone: Angular Router owns history — pushState semantics are the default.\r\n return this.router.navigateByUrl(url, extras);\r\n }\r\n this._pushEmbedded(url.startsWith('/') ? url : '/' + url);\r\n return Promise.resolve(true);\r\n }\r\n\r\n /**\r\n * Convenience: pop the last two segments (the typical \"go back from detail\r\n * to list\" gesture). In standalone mode this falls through to `history.back()`\r\n * so the browser's back stack is respected.\r\n */\r\n back(): void {\r\n // Both modes: delegate to the browser's history stack. In embedded mode we\r\n // now push real history entries in navigate() / navigateByUrl(), so\r\n // history.back() triggers popstate and the listener updates segments().\r\n if (typeof history !== 'undefined') {\r\n history.back();\r\n }\r\n }\r\n\r\n /**\r\n * Resolve the logical URL to seed `_url` from on embedded initial load.\r\n *\r\n * - No basePath: always return `'/'`. The shell's SPA path (e.g. `/desktop`)\r\n * is irrelevant to the remote — `navigate()` is the only thing that should\r\n * move the remote's URL.\r\n * - basePath provided: strip it from `rawPath`. If rawPath starts with the\r\n * basePath, the remainder becomes the seed URL (normalised to start with\r\n * `'/'`). If it doesn't match (e.g. shell changed its own route), fall back\r\n * to `'/'` rather than surfacing shell-specific segments to the remote's\r\n * route table.\r\n */\r\n private _resolveEmbeddedInitialUrl(rawPath: string): string {\r\n if (!this.basePath) {\r\n // Default: ignore the shell's pathname, start at remote root.\r\n return '/';\r\n }\r\n const base = this.basePath.endsWith('/') ? this.basePath.slice(0, -1) : this.basePath;\r\n if (rawPath === base || rawPath === base + '/') {\r\n return '/';\r\n }\r\n if (rawPath.startsWith(base + '/')) {\r\n const remainder = rawPath.slice(base.length);\r\n return remainder.startsWith('/') ? remainder : '/' + remainder;\r\n }\r\n // Shell path doesn't begin with our basePath — fall through to root.\r\n return '/';\r\n }\r\n\r\n /**\r\n * In embedded mode: push a real browser history entry (so back/forward work)\r\n * and update the internal signal synchronously.\r\n *\r\n * The browser address bar is written as the shell's **canonical deep-link\r\n * form** — `<shell-path>?app=<appId>&route=<remote-url>` — NOT the bare remote\r\n * URL. This is what makes a hard reload work: on reload the shell's\r\n * `DeepLinkService` captures `?app=&route=` in its APP_INITIALIZER, re-opens\r\n * this app, and replays the route through the pending-launch pipeline\r\n * (`ShellLauncherService.launch` → `FLYOS_LAUNCH_EVENT` / pending registry →\r\n * the remote's root applies `ctx.route`). Writing the bare remote URL (e.g.\r\n * `/trends/abc`) instead would leave a host-unroutable path in the bar — on\r\n * reload the shell router falls through to its `**` wildcard, redirects to\r\n * `/desktop`, and the deep link is silently lost. See\r\n * skills/cross-app-deep-linking.md.\r\n *\r\n * `flyRemoteUrl` is still stashed in the history state so the popstate\r\n * listener restores the exact remote URL for back/forward without re-parsing\r\n * the query string.\r\n */\r\n private _pushEmbedded(url: string): void {\r\n this._url.set(url);\r\n\r\n if (this.shellOwnsHistory && typeof window !== 'undefined') {\r\n // Single-writer mode: hand the route to the shell, which owns the address\r\n // bar + browser history for every window. The shell mirrors it to the\r\n // canonical `…/desktop?app=&route=` form and pushes one history entry.\r\n const appId = this.windowData?.appId;\r\n if (appId) {\r\n const detail: FlyRemoteRouteEventDetail = {\r\n appId,\r\n windowId: this.windowData?.id ?? null,\r\n url,\r\n };\r\n window.dispatchEvent(new CustomEvent<FlyRemoteRouteEventDetail>(FLYOS_REMOTE_ROUTE_EVENT, { detail }));\r\n return;\r\n }\r\n // No appId reachable (WINDOW_DATA split across bundles) — fall through to\r\n // the legacy local history entry so Back/Forward still update segments().\r\n }\r\n\r\n // Legacy / fallback: self-managed history entry (older shell, or no appId).\r\n if (typeof history !== 'undefined') {\r\n history.pushState({ flyRemoteUrl: url }, '', this._buildEmbeddedHistoryUrl(url));\r\n }\r\n }\r\n\r\n /**\r\n * Build the browser-address-bar URL for an embedded navigation: the shell's\r\n * current path plus the canonical `?app=&route=` deep-link query (the same\r\n * contract `DeepLinkService.captureFromCurrentUrl` parses on cold load).\r\n *\r\n * The path is left untouched — only the query string carries the remote's\r\n * logical route — so the shell's own Angular Router (anchored at e.g.\r\n * `/desktop`) is never handed a path it cannot match.\r\n *\r\n * Fallback: when `appId` is unknown (WINDOW_DATA not injected — the Native\r\n * Federation token-split case where only `__FLYOS_SHELL__` proves embedding)\r\n * we cannot build a shareable link, so we return the shell path query-less.\r\n * Back/forward still work via the `flyRemoteUrl` history state; only\r\n * reload-restore is unavailable — no regression over leaving the bar as-is.\r\n */\r\n private _buildEmbeddedHistoryUrl(remoteUrl: string): string {\r\n const shellPath =\r\n (typeof window !== 'undefined' && window.location.pathname) || this.basePath || '/';\r\n const appId = this.windowData?.appId;\r\n if (!appId) return shellPath;\r\n const query = new URLSearchParams({ app: appId, route: remoteUrl });\r\n return `${shellPath}?${query.toString()}`;\r\n }\r\n\r\n private buildUrl(commands: readonly unknown[]): string {\r\n const parts = commands\r\n .map(c => (c == null ? '' : String(c)))\r\n .map(s => s.replace(/^\\/+|\\/+$/g, ''))\r\n .filter(Boolean);\r\n return '/' + parts.join('/');\r\n }\r\n}\r\n","import {\r\n FLYOS_LAUNCH_REQUEST_EVENT,\r\n FlyosShellHandlesLaunchRequestsGlobalKey,\r\n type FlyLaunchRequestDetail,\r\n} from '../models/window.model';\r\n\r\n/** Options for {@link requestAppLaunch}. */\r\nexport interface RequestAppLaunchOptions {\r\n /** Shell-registry app id of the app to open, e.g. `'chats'`. */\r\n readonly appId: string;\r\n /** Route to deep-link into within the target app. Omit for its landing route. */\r\n readonly route?: string | null;\r\n /** Optional structured params handed to the target app's launch context. */\r\n readonly params?: Readonly<Record<string, unknown>> | null;\r\n}\r\n\r\n/**\r\n * Federation-safe cross-app launch INITIATOR for an Angular Native-Federation\r\n * remote — the outbound counterpart of {@link connectRemoteLaunch}.\r\n *\r\n * A federated remote cannot open another app itself: resolving an `appId` needs the\r\n * shell's app registry and opening a window needs its window manager, and neither is\r\n * reachable from a remote bundle (`ShellLauncherService` lives in the shell app and\r\n * is deliberately not exported from this package). This helper is the sanctioned\r\n * request channel — the remote asks, the shell decides and acts.\r\n *\r\n * ```ts\r\n * // Inside a remote, e.g. Thoughts linking a lab to its Chats room:\r\n * if (!requestAppLaunch({ appId: 'chats', route: `/rooms/${roomId}` })) {\r\n * // No shell is listening (standalone mode) — fall back to your own UI.\r\n * }\r\n * ```\r\n *\r\n * ## Why not dispatch `FLYOS_LAUNCH_EVENT` directly\r\n * That event is the shell DELIVERING a launch that already happened — every mounted\r\n * remote treats it as \"a window is open for me, navigate\". A remote firing it would\r\n * announce a launch while no window was ever opened, and would bypass registry\r\n * resolution, licence filtering, focus/restore of an already-open window, and\r\n * outcome reporting. Hence the separate {@link FLYOS_LAUNCH_REQUEST_EVENT} channel.\r\n *\r\n * ## Capability detection (no silent no-op)\r\n * Returns `false` when there is no browser `window`, or when the shell has not set\r\n * {@link FlyosShellHandlesLaunchRequestsGlobalKey} — i.e. the remote is running\r\n * standalone, or inside a shell older than this contract. Callers get a definite\r\n * answer instead of a request dispatched into the void, and can degrade gracefully\r\n * (hide the button, show a copyable link, …). This mirrors the\r\n * `FlyosShellOwnsHistoryGlobalKey` idiom used by `FlyRemoteRouter`, so old shells\r\n * stay backward compatible.\r\n *\r\n * Unlike {@link connectRemoteLaunch} this needs no injection context — it touches\r\n * no DI and attaches no listener, so it is safe to call from an event handler.\r\n *\r\n * @returns `true` if the request was dispatched to a listening shell.\r\n */\r\nexport function requestAppLaunch(opts: RequestAppLaunchOptions): boolean {\r\n if (typeof window === 'undefined') return false;\r\n\r\n const g = globalThis as { [FlyosShellHandlesLaunchRequestsGlobalKey]?: boolean };\r\n if (!g[FlyosShellHandlesLaunchRequestsGlobalKey]) return false;\r\n\r\n const detail: FlyLaunchRequestDetail = {\r\n appId: opts.appId,\r\n route: opts.route ?? null,\r\n params: opts.params ?? null,\r\n };\r\n window.dispatchEvent(new CustomEvent<FlyLaunchRequestDetail>(FLYOS_LAUNCH_REQUEST_EVENT, { detail }));\r\n return true;\r\n}\r\n","import { DestroyRef, inject } from '@angular/core';\r\nimport {\r\n FLYOS_LAUNCH_EVENT,\r\n FlyosPendingLaunchesGlobalKey,\r\n type FlyLaunchEventDetail,\r\n type FlyosPendingLaunches,\r\n type LaunchContext,\r\n} from '../models/window.model';\r\n\r\n/** Options for {@link connectRemoteLaunch}. */\r\nexport interface ConnectRemoteLaunchOptions {\r\n /**\r\n * This remote's shell-registry app id (the value the shell filters launches by,\r\n * post-canonicalization). Every remote sees every launch — this is the filter.\r\n */\r\n readonly appId: string;\r\n /**\r\n * Navigate the remote to an inbound deep-link route. Called only for a non-null\r\n * `route`, version-deduped. The canonical wiring is\r\n * `route => void flyRouter.navigateByUrl(route)`.\r\n */\r\n readonly navigate: (route: string) => void;\r\n /**\r\n * Gate. Pass your `isEmbedded` flag — when `false` the helper is a no-op (a\r\n * standalone remote has no shell dispatcher). Defaults to `true`. The helper is\r\n * still safe to call unconditionally from the constructor (it `inject()`s a\r\n * `DestroyRef` first, then early-returns) so the integrator needs no outer `if`.\r\n */\r\n readonly enabled?: boolean;\r\n}\r\n\r\n/**\r\n * Federation-safe deep-link RECEIVER for an Angular Native-Federation remote — the\r\n * remote-side counterpart of the shell's `connectWindowRoute`. Collapses the\r\n * drain + dedupe + listen + cleanup boilerplate every remote root used to\r\n * hand-roll (see `skills/cross-app-deep-linking.md` § \"Receiver side\") into one\r\n * call, so the correct contract can't be hand-rolled wrong.\r\n *\r\n * **Must be called from an injection context** (component constructor or a field\r\n * initializer) — it `inject()`s `DestroyRef` to auto-remove its window listener.\r\n *\r\n * ```ts\r\n * constructor() {\r\n * connectRemoteLaunch({\r\n * appId: 'circles',\r\n * navigate: route => void this.flyRouter.navigateByUrl(route),\r\n * enabled: this.isEmbedded,\r\n * });\r\n * }\r\n * ```\r\n *\r\n * ## Why DI tokens are NOT used\r\n * Native Federation can split an `InjectionToken` instance across the host and\r\n * remote bundles, so a remote cannot trust `inject(LAUNCH_CONTEXT)`. The shell\r\n * therefore publishes every launch onto two DI-free surfaces, both keyed by\r\n * `appId`: the {@link FLYOS_LAUNCH_EVENT} window `CustomEvent` and the\r\n * `globalThis[FlyosPendingLaunchesGlobalKey]` registry. This helper consumes both.\r\n *\r\n * ## Two inbound paths, one dedupe\r\n * 1. **First-mount drain.** The launch event fires BEFORE this listener attaches\r\n * for the very first launch, so the shell stashes the latest context per\r\n * `appId` on the `globalThis` registry. The helper reads it then **deletes**\r\n * it — never leaving a stale entry behind (a leftover entry would re-apply on\r\n * every re-mount; this is the failure mode `skills/cross-app-deep-linking.md`\r\n * § \"What NOT to do\" warns about).\r\n * 2. **Live event.** Re-launches into an already-mounted remote arrive on\r\n * {@link FLYOS_LAUNCH_EVENT}; the `appId` filter is mandatory.\r\n * Both share one `lastVersion` so the drain and the live event dedupe against each\r\n * other.\r\n *\r\n * ## Reload safety\r\n * `lastVersion` is a per-instance closure that resets to `0` on every remount —\r\n * the latent half of the \"stale deep-link reopen\" bug class. It is safe because\r\n * the shell is the single writer of both surfaces: `DesktopShellComponent.\r\n * reloadWindowContent` always re-publishes the window's CURRENT route (the\r\n * `launch()` call overwrites the registry entry the remount then drains) before\r\n * dropping the injector, so the drained context reflects present state, never the\r\n * already-consumed original. A `null` route is a no-op here (a remote navigates by\r\n * URL — there is nothing to navigate to), which is correct: the stale entry was\r\n * already overwritten, so doing nothing leaves the remount on its default landing\r\n * route rather than reopening a closed detail.\r\n */\r\nexport function connectRemoteLaunch(opts: ConnectRemoteLaunchOptions): void {\r\n const destroyRef = inject(DestroyRef);\r\n const { appId, navigate, enabled = true } = opts;\r\n if (!enabled || typeof window === 'undefined') return;\r\n\r\n let lastVersion = 0;\r\n const apply = (ctx: LaunchContext | null | undefined): void => {\r\n if (!ctx || !ctx.route || ctx.version === lastVersion) return;\r\n lastVersion = ctx.version;\r\n navigate(ctx.route);\r\n };\r\n\r\n // 1. First-mount drain — read then DELETE (no stale entry left behind).\r\n const g = globalThis as { [FlyosPendingLaunchesGlobalKey]?: FlyosPendingLaunches };\r\n const pending = g[FlyosPendingLaunchesGlobalKey]?.[appId];\r\n if (pending) {\r\n apply(pending);\r\n delete g[FlyosPendingLaunchesGlobalKey]![appId];\r\n }\r\n\r\n // 2. Live listener — re-launches into the already-mounted remote.\r\n const onLaunch = (e: Event): void => {\r\n const detail = (e as CustomEvent<FlyLaunchEventDetail>).detail;\r\n if (detail?.appId !== appId || !detail.ctx) return;\r\n apply(detail.ctx);\r\n };\r\n window.addEventListener(FLYOS_LAUNCH_EVENT, onLaunch);\r\n destroyRef.onDestroy(() => window.removeEventListener(FLYOS_LAUNCH_EVENT, onLaunch));\r\n}\r\n","import { Injectable, signal } from '@angular/core';\r\n\r\n/**\r\n * A federated remote's current navigation context, as published to the shell.\r\n *\r\n * `params` are the remote's **resolved route params** (e.g. `{ id: 'abc' }` for a\r\n * `trends/:id` match) — the remote owns its route table, so it resolves these and\r\n * the shell never has to know the remote's route patterns.\r\n */\r\nexport interface FlyRemoteContext {\r\n /** Owning app id — matches the shell's app registry and `AgentCommandScope.appId`. */\r\n readonly appId: string;\r\n /** Logical remote URL, e.g. `/trends/abc`. Query/hash stripped by the publisher. */\r\n readonly url: string;\r\n /** `url` split into path segments, e.g. `['trends', 'abc']`. */\r\n readonly segments: readonly string[];\r\n /** Resolved route params, e.g. `{ id: 'abc' }`. Empty when no param route matched. */\r\n readonly params: Readonly<Record<string, string>>;\r\n}\r\n\r\n/**\r\n * Shared cross-bundle store key + sync event. **Public contract** — a remote that\r\n * cannot consume a DS new enough to back {@link FlyRemoteContextService.publish} on\r\n * `globalThis` itself may write this slot directly (same shape, keyed by appId) and\r\n * dispatch {@link FLY_REMOTE_CONTEXT_EVENT} to notify the shell. Keep these literals\r\n * stable; they are an integration boundary, not an implementation detail.\r\n */\r\nexport const FLY_REMOTE_CONTEXT_STORE_KEY = '__flyRemoteContext__';\r\nexport const FLY_REMOTE_CONTEXT_EVENT = 'fly:remote-context';\r\n\r\ntype Store = Record<string, FlyRemoteContext>;\r\n\r\n/** The single cross-bundle store, lazily created on `globalThis`. */\r\nfunction store(): Store {\r\n const g = globalThis as unknown as Record<string, Store | undefined>;\r\n return (g[FLY_REMOTE_CONTEXT_STORE_KEY] ??= {});\r\n}\r\n\r\n/** Notify every federated copy of the service that the store changed. */\r\nfunction emitSync(): void {\r\n const g = globalThis as { dispatchEvent?: (e: Event) => boolean };\r\n try {\r\n g.dispatchEvent?.(new Event(FLY_REMOTE_CONTEXT_EVENT));\r\n } catch {\r\n /* non-DOM realm (SSR / unit env without Event) — readers fall back to a direct read */\r\n }\r\n}\r\n\r\nfunction toMap(s: Store): ReadonlyMap<string, FlyRemoteContext> {\r\n return new Map(Object.entries(s));\r\n}\r\n\r\n/**\r\n * Remote → shell route/context channel.\r\n *\r\n * Why this exists\r\n * ---------------\r\n * A federated remote (e.g. Circles) renders inside a desktop-shell window and\r\n * keeps its own internal Angular route (`/trends/:id`). The shell cannot see that\r\n * route: the remote provides {@link FlyRemoteRouter} at its **component** injector\r\n * (so it can read per-window `WINDOW_DATA`), which makes the route state invisible\r\n * to the host. Shell-side features that need \"what is the user looking at right\r\n * now\" — most importantly Category-B slash commands whose `contextBindings` include\r\n * a `lookup`/`route` entity id — had no way to resolve the current entity id, and\r\n * degraded to \"ask the user\".\r\n *\r\n * The channel — why `globalThis`, not the DI singleton\r\n * ----------------------------------------------------\r\n * This service is `providedIn: 'root'`, but a root instance is **NOT** reliably\r\n * shared across the federation boundary. The shell builds the design system from\r\n * workspace SOURCE while remotes consume the PUBLISHED npm package; Native\r\n * Federation only collapses those two physical builds into one runtime instance if\r\n * version negotiation succeeds perfectly (matching advertised `mappingVersion`,\r\n * `singleton`, compatible ranges). That negotiation has silently split before —\r\n * giving the shell and a remote *separate* `providedIn:'root'` instances, so a\r\n * value published on one was invisible to the other.\r\n *\r\n * `globalThis` is the one substrate guaranteed shared across every federated bundle\r\n * in the same realm (there are no iframes), so the channel stores its state there\r\n * (see {@link FLY_REMOTE_CONTEXT_STORE_KEY}). {@link context} / {@link param} read\r\n * it directly — split-proof, synchronous, no injector-token gymnastics. A per-\r\n * instance signal mirrors the store for reactive consumers and is re-synced from a\r\n * `globalThis` event whenever any copy of the service (or a remote writing the slot\r\n * directly) mutates it. The same pattern already backs the shell's app-launch\r\n * context bridge, so this is an established boundary, not a new hack.\r\n *\r\n * Contract\r\n * --------\r\n * - Remote: call {@link publish} whenever its embedded route changes, and\r\n * {@link clear} on teardown (window close / component destroy).\r\n * - Shell: call {@link context} (or {@link param}) for an app id to resolve bindings.\r\n *\r\n * Keyed by `appId` (last publisher wins) — a single live window per app is the v1\r\n * assumption; a windowId key is the natural extension if multi-window-per-app\r\n * dispatch is ever needed.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyRemoteContextService {\r\n private readonly _byApp = signal<ReadonlyMap<string, FlyRemoteContext>>(toMap(store()));\r\n\r\n /** All currently-published contexts, keyed by app id. Reactive. */\r\n readonly contexts = this._byApp.asReadonly();\r\n\r\n constructor() {\r\n // Keep this instance's reactive mirror current when ANOTHER federated copy of\r\n // the service — or a remote writing the store slot directly — mutates it.\r\n const g = globalThis as { addEventListener?: (t: string, l: () => void) => void };\r\n g.addEventListener?.(FLY_REMOTE_CONTEXT_EVENT, () => this._byApp.set(toMap(store())));\r\n }\r\n\r\n /** Publish (or replace) the active route context for an app. */\r\n publish(ctx: FlyRemoteContext): void {\r\n store()[ctx.appId] = ctx;\r\n this._byApp.set(toMap(store()));\r\n emitSync();\r\n }\r\n\r\n /** Drop an app's context (remote unmounted / window closed). No-op if absent. */\r\n clear(appId: string): void {\r\n const s = store();\r\n if (!(appId in s)) return;\r\n delete s[appId];\r\n this._byApp.set(toMap(s));\r\n emitSync();\r\n }\r\n\r\n /** Current context for an app, or `null` when nothing is published. */\r\n context(appId: string): FlyRemoteContext | null {\r\n return store()[appId] ?? null;\r\n }\r\n\r\n /**\r\n * Resolve a single route param for an app, e.g. `param('circles', 'id')`.\r\n * Returns `null` when the app has no published context or the param is absent —\r\n * the caller then degrades (the skill asks for the missing id).\r\n */\r\n param(appId: string, path: string): string | null {\r\n const value = store()[appId]?.params[path];\r\n return value != null && value !== '' ? value : null;\r\n }\r\n}\r\n","import { InjectionToken, Injectable, inject } from '@angular/core';\r\n\r\n/**\r\n * Minimal adapter the shell (or any host) provides so design-system services can\r\n * look up apps without depending on `AppRegistryService` directly. Keeps the\r\n * design-system decoupled from shell internals — hosts wire this once at root.\r\n *\r\n * Shell wiring example:\r\n * ```ts\r\n * { provide: APP_LOOKUP, useFactory: () => {\r\n * const r = inject(AppRegistryService);\r\n * return { getById: id => { const a = r.getById(id); return a ? { id: a.id, name: a.name } : undefined; } };\r\n * } }\r\n * ```\r\n */\r\nexport interface AppLookupEntry {\r\n readonly id: string;\r\n readonly name: string;\r\n}\r\n\r\nexport interface AppLookup {\r\n getById(id: string): AppLookupEntry | undefined;\r\n}\r\n\r\nexport const APP_LOOKUP = new InjectionToken<AppLookup>('APP_LOOKUP');\r\n\r\n/**\r\n * Canonicalizes raw source-app identifiers and resolves display names.\r\n *\r\n * Problem this solves\r\n * -------------------\r\n * Backend services emit two different identifiers for the same app:\r\n * - JWT `client_id` (inter-service identity), e.g. `\"circles-service\"`.\r\n * - AppCatalog `id` (frontend identity), e.g. `\"circles\"`.\r\n *\r\n * Task rows, audit entries, notifications, etc. may carry either form depending\r\n * on which service wrote them and when. Every UI surface that renders the\r\n * source app needs the same canonicalization rule — without it, chips display\r\n * `\"circles-service\"` instead of the friendly `\"Circles\"`.\r\n *\r\n * Rule: try the raw id against the registry; if it misses and the id ends in\r\n * `-service`, retry with the suffix stripped. The first hit wins. Returns\r\n * `null` from `resolveId` when nothing matches, so callers can guard CTAs.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class SourceAppResolver {\r\n private readonly lookup = inject(APP_LOOKUP, { optional: true });\r\n\r\n /** Returns the registry-resolvable canonical id, or `null` when neither form is registered. */\r\n resolveId(rawId: string | null | undefined): string | null {\r\n if (!rawId || !this.lookup) return null;\r\n if (this.lookup.getById(rawId)) return rawId;\r\n const canonical = rawId.replace(/-service$/, '');\r\n if (canonical !== rawId && this.lookup.getById(canonical)) return canonical;\r\n return null;\r\n }\r\n\r\n /**\r\n * Display name for the source app. Prefers the registry's localized name when\r\n * the id resolves; falls back to a title-cased canonical id (e.g.\r\n * `\"circles-service\"` → `\"Circles\"`) so chips never expose raw `-service`\r\n * client_ids even for apps not yet in the registry. Empty string for null/undefined.\r\n */\r\n resolveName(rawId: string | null | undefined): string {\r\n if (!rawId) return '';\r\n const id = this.resolveId(rawId);\r\n if (id) return this.lookup!.getById(id)!.name;\r\n const canonical = rawId.replace(/-service$/, '');\r\n return canonical.charAt(0).toUpperCase() + canonical.slice(1);\r\n }\r\n\r\n /** True when an open-in-source CTA is launchable: id resolves *and* there's a route. */\r\n canOpen(rawId: string | null | undefined, route: string | null | undefined): boolean {\r\n return this.resolveId(rawId) !== null && !!route;\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n FLY_WINDOW_HELP_HINT_EVENT,\r\n type FlyWindowHelpHintEventDetail,\r\n type WindowHelpHint,\r\n} from '../models/window.model';\r\n\r\n/**\r\n * Per-window publisher handle returned by {@link FlyWindowHelpService.forWindow}.\r\n * Bound to a single window id; keep the handle and call {@link setHint} as the\r\n * active view changes.\r\n */\r\nexport interface FlyWindowHelpPublisher {\r\n /**\r\n * Set the active hint for this window (or null to clear — the shell then\r\n * reverts to the window's own `appId`). Safe to call repeatedly.\r\n */\r\n setHint(hint: WindowHelpHint | null): void;\r\n}\r\n\r\n/**\r\n * Publishes a {@link WindowHelpHint} for a window so the shell's titlebar Help\r\n * button deeplinks the help-center reader to the article most relevant to where\r\n * the user is. The **publisher twin** of the shell's `WindowHelpHintService`\r\n * (the listener): it exists in the design system so that **any app — in-shell\r\n * OS-Core app or federated remote — publishes hints the same way**, without\r\n * hand-rolling the cross-bundle CustomEvent contract.\r\n *\r\n * **Why a `window` CustomEvent and not the `WINDOW_HELP_HINT` DI token?**\r\n * Native Federation can split an `InjectionToken` instance across host and\r\n * remote bundles, so a remote that injects `WINDOW_HELP_HINT` may receive a\r\n * different token than the one the shell provides. The string-keyed\r\n * {@link FLY_WINDOW_HELP_HINT_EVENT} crosses bundles reliably; the shell mirrors\r\n * it into the matching per-window hint signal.\r\n *\r\n * **Why a per-window handle and not `bindWindow`/`setHint` state?**\r\n * This service is `providedIn: 'root'` and the design system is a shared\r\n * Native-Federation singleton, so a *single* instance is shared across the\r\n * shell and every concurrently-open window (multiple in-shell apps, multiple\r\n * remotes). A handle closes over its window id, so two windows never clobber a\r\n * shared \"current window\" — each handle targets only its own titlebar.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyWindowHelpService {\r\n /**\r\n * Returns a publisher bound to a single window. Call once per window (e.g.\r\n * from the app root with `WINDOW_DATA.id`) and keep the handle. A\r\n * null/undefined id (standalone, no shell) yields a handle whose `setHint`\r\n * is a no-op.\r\n */\r\n forWindow(windowId: string | null | undefined): FlyWindowHelpPublisher {\r\n const id = windowId ?? null;\r\n return {\r\n setHint: (hint: WindowHelpHint | null): void => {\r\n if (typeof window === 'undefined' || !id) return;\r\n const detail: FlyWindowHelpHintEventDetail = { windowId: id, hint };\r\n window.dispatchEvent(\r\n new CustomEvent<FlyWindowHelpHintEventDetail>(FLY_WINDOW_HELP_HINT_EVENT, { detail }),\r\n );\r\n },\r\n };\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\nimport {\r\n FLY_WINDOW_PAGE_TITLE_EVENT,\r\n type FlyWindowPageTitleEventDetail,\r\n} from '../models/window.model';\r\n\r\n/**\r\n * Per-window publisher handle returned by {@link FlyWindowTitleService.forWindow}.\r\n * Bound to a single window; keep the handle and call {@link setTitle} as the\r\n * active view (route/record) changes.\r\n */\r\nexport interface FlyWindowTitlePublisher {\r\n /**\r\n * Set the browser-tab title for this window (or `null`/empty to clear the\r\n * override — the shell then reverts to the window's app-name baseline). Safe\r\n * to call repeatedly.\r\n */\r\n setTitle(title: string | null): void;\r\n}\r\n\r\n/**\r\n * Publishes the browser-tab title (`document.title`) for a window so the shell\r\n * — the SINGLE writer of `document.title` — reflects the active page in the tab.\r\n * The **publisher twin** of the shell's `DocumentTitleService` (the listener):\r\n * it lives in the design system so **any app — in-shell OS-Core app or federated\r\n * remote — sets its tab title the same way**, without hand-rolling the\r\n * cross-bundle CustomEvent contract.\r\n *\r\n * **Why not just Angular's `Title` service?** A federated remote's `Title`\r\n * service writes to a DOM adapter that isn't the host shell's real `document`,\r\n * so a remote can't reliably drive the tab. The string-keyed\r\n * {@link FLY_WINDOW_PAGE_TITLE_EVENT} crosses the host/remote bundle boundary;\r\n * the shell mirrors it into `document.title`. When the app runs **standalone**\r\n * (no shell — no window id), the publisher falls back to setting `document.title`\r\n * directly, so the SAME call works in both modes and the app never branches.\r\n *\r\n * **Why a per-window handle?** This service is `providedIn: 'root'` and the\r\n * design system is a shared Native-Federation singleton, so one instance is\r\n * shared across the shell and every open window. A handle closes over its\r\n * window id (and app id), so concurrent windows never clobber one another.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyWindowTitleService {\r\n /**\r\n * Returns a publisher bound to a single window. Call once (e.g. from the app\r\n * root with `WINDOW_DATA?.id` and the app id) and keep the handle.\r\n *\r\n * - Embedded (a `windowId` and/or `appId` is known): dispatches\r\n * {@link FLY_WINDOW_PAGE_TITLE_EVENT} for the shell to reflect.\r\n * - Standalone (no `windowId`): also sets `document.title` directly so a\r\n * self-hosted remote still updates its own tab.\r\n */\r\n forWindow(\r\n windowId: string | null | undefined,\r\n appId?: string | null,\r\n ): FlyWindowTitlePublisher {\r\n const id = windowId ?? null;\r\n const app = appId ?? null;\r\n return {\r\n setTitle: (title: string | null): void => {\r\n if (typeof window === 'undefined') return;\r\n if (id || app) {\r\n const detail: FlyWindowPageTitleEventDetail = {\r\n ...(id ? { windowId: id } : {}),\r\n ...(app ? { appId: app } : {}),\r\n title,\r\n };\r\n window.dispatchEvent(\r\n new CustomEvent<FlyWindowPageTitleEventDetail>(FLY_WINDOW_PAGE_TITLE_EVENT, { detail }),\r\n );\r\n }\r\n // Standalone (no shell listener): drive our own tab directly.\r\n if (!id && typeof document !== 'undefined' && title?.trim()) {\r\n document.title = title;\r\n }\r\n },\r\n };\r\n }\r\n}\r\n","/**\r\n * The page's CSP nonce, read once at module init from `<meta name=\"csp-nonce\">`.\r\n *\r\n * Every `<style>` / `<link>` this library injects into `document.head` MUST carry it, or a\r\n * strict `style-src 'self' 'nonce-…'` policy blocks the element outright. Two DS surfaces\r\n * inject head-level CSS — the cascade-layer-order block and the per-remote stylesheet loader\r\n * (`fly-remote-styles.ts`) and the body-parented tooltip surface (`fly-tooltip.directive.ts`)\r\n * — so the lookup lives here rather than being duplicated (or, as it was, simply omitted in\r\n * one of them).\r\n *\r\n * Read from a meta tag rather than Angular's `CSP_NONCE` token on purpose: these injections\r\n * happen at MODULE scope, before/outside any Angular injector, and the DS is also consumed by\r\n * non-Angular and bare-standalone hosts. The host is responsible for emitting the tag — the\r\n * FlyOS shell and admin bake `content=\"__CSP_NONCE__\"` and let nginx `sub_filter` stamp the\r\n * per-request value (see src/infrastructure/docker/nginx/nginx.conf.template).\r\n *\r\n * `null` when absent — which is the correct state in dev (`ng serve`, no nginx, no nonced CSP),\r\n * where the unnonced element is allowed anyway. Callers must therefore guard: `if (nonce)`.\r\n */\r\n/**\r\n * The un-substituted placeholder the shell/admin bake into `index.html`. Reaching the browser\r\n * means nginx's `sub_filter` did not run for that response — the usual cause is a pre-compressed\r\n * `.br`/`.gz` sibling being served by `*_static` (which is why the HTML locations set\r\n * `gzip_static off; brotli_static off;`). Treated as ABSENT rather than passed through: a\r\n * placeholder nonce is worse than none, because it silently fails every `style-src 'nonce-…'`\r\n * check with no hint that the deploy, not the code, is at fault.\r\n */\r\nconst NONCE_PLACEHOLDER = '__CSP_NONCE__';\r\n\r\nfunction _readNonce(): string | null {\r\n if (typeof document === 'undefined') return null;\r\n const value = document.querySelector<HTMLMetaElement>('meta[name=\"csp-nonce\"]')?.content ?? null;\r\n if (!value) return null;\r\n if (value === NONCE_PLACEHOLDER) {\r\n console.warn(\r\n '[FlyOS] meta[name=\"csp-nonce\"] still holds the literal __CSP_NONCE__ placeholder — the ' +\r\n 'nginx sub_filter did not run for this response. Injected <style>/<link> elements will be ' +\r\n 'blocked by a nonced style-src. Check gzip_static/brotli_static are off on the HTML location.'\r\n );\r\n return null;\r\n }\r\n return value;\r\n}\r\n\r\nexport const FLY_CSP_NONCE: string | null = _readNonce();\r\n","/**\r\n * fly-remote-styles — Shell-layer CSS loader for Native Federation remotes.\r\n *\r\n * Problem\r\n * -------\r\n * Federated remotes only ship JS chunks via Native Federation — their global\r\n * `styles.css` (or its hashed equivalent) never loads in the shell, so any\r\n * global CSS selector (e.g. `.circles-overlay`) silently breaks in embedded\r\n * mode.\r\n *\r\n * Solution\r\n * --------\r\n * On first mount of each remote, the shell calls `loadRemoteStyles(appId,\r\n * remoteBaseUrl)`. This function:\r\n * 1. Derives the remote's `index.html` URL from `remoteBaseUrl`.\r\n * 2. Fetches it (one network round-trip per remote; browser-cached thereafter).\r\n * 3. Scans the HTML text for the first `<link rel=\"stylesheet\">` — the hashed\r\n * production stylesheet (e.g. `styles-ABC123.css`). This is Strategy (b):\r\n * index.html discovery. A text scan, NOT DOMParser — see `_firstStylesheetHref`.\r\n * 4. Injects the stylesheet into `document.head` using one of two approaches\r\n * (see Injection approach below).\r\n *\r\n * Why strategy (b)?\r\n * -----------------\r\n * (a) Unhashed `styles.css` — requires remote build config changes (out of scope).\r\n * (b) Parse remote `index.html` — one tiny fetch per remote; browser caches it;\r\n * works today without any remote changes.\r\n * (c) `stylesUrl` in manifest/remoteEntry.json — cleanest long-term; requires\r\n * protocol change to every remote's CI pipeline (out of scope for Wave A1).\r\n *\r\n * Injection approach\r\n * ------------------\r\n * Preferred (Firefox 134+, Chrome 99+, Safari 17.2+):\r\n * `<link rel=\"stylesheet\" href=\"…\" crossorigin=\"anonymous\" layer=\"remote\">`\r\n *\r\n * The `layer` attribute on `<link>` is feature-detected once at module init via:\r\n * `'layer' in HTMLLinkElement.prototype`\r\n * If the attribute is supported, the shell injects a non-render-blocking `<link>`\r\n * element. The browser gets proper preload semantics and CORS headers flow through\r\n * the normal stylesheet pipeline.\r\n *\r\n * Fallback (browsers without `link[layer]` support):\r\n * `<style>@import url(\"…\") layer(remote);</style>`\r\n *\r\n * CSS Cascade Level 5: `@import url(\"…\") layer(remote)` is the ONLY valid way to\r\n * place an @import inside a named cascade layer when using the `<style>` approach.\r\n * The block-form `@layer remote { @import url(\"…\"); }` is INVALID CSS — the spec\r\n * forbids `@import` inside any block at-rule. Browsers silently drop such rules.\r\n *\r\n * Both code paths attach `data-fly-app` and `data-fly-href` attributes to the\r\n * injected element so idempotency checks work uniformly.\r\n *\r\n * Layer order declaration\r\n * -----------------------\r\n * A one-time `<style data-fly-layers>` element is prepended to `<head>` at module\r\n * init. It establishes the canonical layer order:\r\n * reset → designsystem → shell → remote → overrides\r\n * This guarantees that even if individual `@layer` blocks are injected in any\r\n * order at runtime, the cascade priority is always deterministic.\r\n *\r\n * CSP nonce propagation\r\n * ---------------------\r\n * If a `<meta name=\"csp-nonce\">` element is present, its content is read once at\r\n * module init and applied to every injected `<style>` or `<link>` element. If no\r\n * nonce meta is present, nothing is set (graceful degradation).\r\n *\r\n * URL validation\r\n * --------------\r\n * Discovered hrefs must be `http://`-, `https://`-, or `//`-prefixed. `javascript:`,\r\n * `data:`, and `blob:` are rejected outright. The href's origin must also match the\r\n * origin of `remoteBaseUrl` (same-origin as the remote), preventing a compromised\r\n * `index.html` from pointing at an attacker domain.\r\n *\r\n * Unload decision\r\n * ---------------\r\n * `unloadRemoteStyles` is exported for symmetry but should NOT be called on\r\n * normal window close. Keeping styles loaded across remounts avoids FOUC\r\n * flicker when the user reopens the same app. The stylesheet is a few KB; the\r\n * memory cost is negligible. Only call `unloadRemoteStyles` if you are certain\r\n * the remote will never be opened again in this session (e.g. licence revoke).\r\n *\r\n * Caveats\r\n * -------\r\n * - CORS: the remote's dev/prod server must serve `index.html` with a permissive\r\n * `Access-Control-Allow-Origin` header (or be same-origin via the YARP gateway).\r\n * The fetch uses `credentials: 'omit'` to avoid credential-carrying preflights.\r\n * - Fetch timeout: the index.html fetch is capped at 5 seconds. On timeout the\r\n * in-flight entry is cleared so a retry is possible on the next call.\r\n * - Race on rapid mount/unmount: if `loadRemoteStyles` is called a second time for\r\n * the same appId while the first fetch is still in-flight, the second call joins\r\n * the same in-flight Promise.\r\n * - Angular hashing: Angular's production build hashes the stylesheet filename.\r\n * The scan picks the first `<link rel=\"stylesheet\">` in document order, which is the\r\n * single global stylesheet Angular emits. If a remote emits multiple stylesheets,\r\n * only the first is loaded — acceptable for Wave A1.\r\n */\r\n\r\nimport { FLY_CSP_NONCE } from './fly-csp-nonce';\r\n\r\n/**\r\n * Feature detection: does the browser support the `layer` attribute on\r\n * `<link>` elements? Probed once at module init.\r\n * Firefox 134+, Chrome 99+, Safari 17.2+ all ship this.\r\n */\r\nconst _linkLayerSupported: boolean =\r\n typeof HTMLLinkElement !== 'undefined' && 'layer' in HTMLLinkElement.prototype;\r\n\r\n/**\r\n * CSP nonce, read once from `<meta name=\"csp-nonce\">` at module init.\r\n * Applied to every injected `<style>` / `<link>` element. Null when absent.\r\n * Shared with the tooltip directive — see `fly-csp-nonce.ts` for why it is a\r\n * meta-tag lookup and not Angular's `CSP_NONCE` token.\r\n */\r\nconst _cspNonce: string | null = FLY_CSP_NONCE;\r\n\r\n/** In-flight fetch promises keyed by appId — prevents duplicate fetches. */\r\nconst _inFlight = new Map<string, Promise<string | null>>();\r\n\r\n// ---------------------------------------------------------------------------\r\n// Layer order — injected immediately at module init (synchronous, runs once).\r\n// ---------------------------------------------------------------------------\r\n(function _ensureLayerOrder(): void {\r\n if (typeof document === 'undefined') return; // SSR guard\r\n if (document.head.querySelector('style[data-fly-layers]')) return;\r\n\r\n const style = document.createElement('style');\r\n style.setAttribute('data-fly-layers', '');\r\n style.textContent = '@layer reset, designsystem, shell, remote, overrides;';\r\n if (_cspNonce) style.nonce = _cspNonce;\r\n // Prepend so this always precedes any other layer-bearing <style> blocks.\r\n document.head.insertBefore(style, document.head.firstChild);\r\n})();\r\n\r\n// ---------------------------------------------------------------------------\r\n// Internal helpers\r\n// ---------------------------------------------------------------------------\r\n\r\n/**\r\n * Extracts the `href` of the first `<link rel=\"stylesheet\">` in a raw HTML string.\r\n *\r\n * Deliberately a text scan and NOT `DOMParser.parseFromString(html, 'text/html')`.\r\n * Chrome CSP-checks the inline `<style>` elements of a parsed document against the\r\n * PARSING page's policy — even though that document has no browsing context and nothing\r\n * is ever applied from it. Every remote's `index.html` carries an inline `<style>` bearing\r\n * the REMOTE's per-request nonce, which by construction never matches the shell's, so each\r\n * remote's first mount logged a `style-src-elem` violation attributed to this file. Purely\r\n * console noise (the discovered stylesheet still loaded), but it read as a real CSP failure\r\n * and cost a live debugging session on 2026-07-28. Not parsing untrusted remote HTML into a\r\n * document is the better shape regardless.\r\n *\r\n * Returns the raw attribute value — resolution, scheme rejection, and the same-origin check\r\n * all happen in the caller / `_validateHref`, exactly as before.\r\n */\r\nfunction _firstStylesheetHref(html: string): string {\r\n const REL = /\\brel\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>]+))/i;\r\n const HREF = /\\bhref\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|([^\\s>]+))/i;\r\n const attr = (m: RegExpExecArray | null): string => (m ? (m[1] ?? m[2] ?? m[3] ?? '') : '');\r\n\r\n for (const tag of html.match(/<link\\b[^>]*>/gi) ?? []) {\r\n // `rel` is a space-separated token list; match the token, not the whole value.\r\n if (!attr(REL.exec(tag)).toLowerCase().split(/\\s+/).includes('stylesheet')) continue;\r\n const href = attr(HREF.exec(tag));\r\n if (href) return href;\r\n }\r\n return '';\r\n}\r\n\r\n/**\r\n * Discovers the hashed stylesheet href from the remote's `index.html`.\r\n * Applies a 5-second AbortController timeout. Clears `_inFlight` on abort so\r\n * a retry is possible. Returns `null` on any failure.\r\n */\r\nasync function _discoverStylesheetHref(appId: string, remoteBaseUrl: string): Promise<string | null> {\r\n const indexUrl = remoteBaseUrl.replace(/\\/$/, '') + '/index.html';\r\n const controller = new AbortController();\r\n const timeoutId = setTimeout(() => controller.abort(), 5000);\r\n\r\n try {\r\n const res = await fetch(indexUrl, {\r\n credentials: 'omit',\r\n cache: 'default',\r\n signal: controller.signal,\r\n });\r\n clearTimeout(timeoutId);\r\n\r\n if (!res.ok) return null;\r\n const html = await res.text();\r\n const rawHref = _firstStylesheetHref(html);\r\n if (!rawHref) return null;\r\n\r\n // Early-reject dangerous schemes before any URL resolution.\r\n // Without this guard, `javascript:alert(1)` would be rewritten to\r\n // `remoteBaseUrl/javascript:alert(1)` and silently pass origin validation.\r\n const rawLower = rawHref.toLowerCase();\r\n if (\r\n rawLower.startsWith('javascript:') ||\r\n rawLower.startsWith('data:') ||\r\n rawLower.startsWith('blob:')\r\n ) {\r\n console.warn(`[FlyOS] loadRemoteStyles: rejected unsafe stylesheet href \"${rawHref}\"`);\r\n return null;\r\n }\r\n\r\n // Resolve to absolute URL for origin validation.\r\n let resolvedHref: string;\r\n if (rawHref.startsWith('http://') || rawHref.startsWith('https://') || rawHref.startsWith('//')) {\r\n resolvedHref = rawHref;\r\n } else {\r\n resolvedHref = remoteBaseUrl.replace(/\\/$/, '') + '/' + rawHref.replace(/^\\//, '');\r\n }\r\n\r\n return _validateHref(resolvedHref, remoteBaseUrl);\r\n } catch {\r\n clearTimeout(timeoutId);\r\n // On abort or network error, clear in-flight so a retry is possible.\r\n _inFlight.delete(appId);\r\n return null;\r\n }\r\n}\r\n\r\n/**\r\n * Validates that a discovered href is safe to inject:\r\n * - Must be `http://`, `https://`, or `//`-prefixed (no `javascript:`, `data:`, `blob:`).\r\n * - Must share the same origin as `remoteBaseUrl`.\r\n *\r\n * Returns the href on success; logs a warning and returns `null` on failure.\r\n */\r\nfunction _validateHref(href: string, remoteBaseUrl: string): string | null {\r\n // Block dangerous schemes.\r\n const lower = href.toLowerCase();\r\n if (\r\n lower.startsWith('javascript:') ||\r\n lower.startsWith('data:') ||\r\n lower.startsWith('blob:')\r\n ) {\r\n console.warn(`[FlyOS] loadRemoteStyles: rejected unsafe stylesheet href \"${href}\"`);\r\n return null;\r\n }\r\n\r\n // Must be absolute (http/https/protocol-relative).\r\n if (\r\n !lower.startsWith('http://') &&\r\n !lower.startsWith('https://') &&\r\n !lower.startsWith('//')\r\n ) {\r\n console.warn(`[FlyOS] loadRemoteStyles: rejected non-absolute stylesheet href \"${href}\"`);\r\n return null;\r\n }\r\n\r\n // Origin must match remoteBaseUrl — prevents a compromised index.html from\r\n // redirecting styles at an attacker-controlled domain.\r\n try {\r\n const hrefOrigin = new URL(href.startsWith('//') ? 'https:' + href : href).origin;\r\n const remoteOrigin = new URL(remoteBaseUrl).origin;\r\n if (hrefOrigin !== remoteOrigin) {\r\n console.warn(\r\n `[FlyOS] loadRemoteStyles: rejected cross-origin stylesheet href \"${href}\" ` +\r\n `(expected origin \"${remoteOrigin}\", got \"${hrefOrigin}\")`\r\n );\r\n return null;\r\n }\r\n } catch {\r\n console.warn(`[FlyOS] loadRemoteStyles: could not parse href origin for \"${href}\"`);\r\n return null;\r\n }\r\n\r\n return href;\r\n}\r\n\r\n// ---------------------------------------------------------------------------\r\n// Public API\r\n// ---------------------------------------------------------------------------\r\n\r\n/**\r\n * Injects the remote's stylesheet into `document.head`.\r\n *\r\n * @param appId - Stable identifier for the remote app (matches `DesktopApp.id`).\r\n * @param remoteBaseUrl - Base URL of the remote, e.g. `https://circles.example.com`\r\n * or `http://localhost:7202`. Must NOT include `/remoteEntry.json`.\r\n *\r\n * The call is idempotent:\r\n * - If an element with `data-fly-app=\"appId\"` whose `data-fly-href` matches the\r\n * discovered href already exists → no-op.\r\n * - If the href differs (hot upgrade) → existing element is replaced.\r\n * - If no stylesheet is found in `index.html` → no-op (logged as a warning).\r\n *\r\n * Injection shape (preferred — `link[layer]` supported):\r\n * <link rel=\"stylesheet\" data-fly-app=\"<appId>\" data-fly-href=\"<href>\"\r\n * href=\"<href>\" crossorigin=\"anonymous\" layer=\"remote\">\r\n *\r\n * Injection shape (fallback — `link[layer]` unsupported):\r\n * <style data-fly-app=\"<appId>\" data-fly-href=\"<href>\">\r\n * @import url(\"<href>\") layer(remote);\r\n * </style>\r\n *\r\n * The `data-fly-href` attribute stores the discovered href separately from the\r\n * element content so idempotency checks can compare the URL without parsing CSS.\r\n */\r\nexport async function loadRemoteStyles(appId: string, remoteBaseUrl: string): Promise<void> {\r\n if (typeof document === 'undefined') return; // SSR guard\r\n\r\n // Resolve relative remoteBaseUrl (e.g. '/circles-dev') against the current\r\n // page origin so all downstream URL operations (fetch, origin check) receive\r\n // an absolute URL. Absolute inputs are returned unchanged by new URL().\r\n const absoluteBase = new URL(remoteBaseUrl, location.href).href.replace(/\\/$/, '');\r\n\r\n // Kick off or join an in-flight fetch for this appId.\r\n // Note: _resolvedHref cache is intentionally absent — always re-discover so\r\n // the browser's HTTP cache handles cost (index.html is tiny) and hot-deploys\r\n // are picked up without a page reload.\r\n let fetchPromise = _inFlight.get(appId);\r\n if (!fetchPromise) {\r\n fetchPromise = _discoverStylesheetHref(appId, absoluteBase);\r\n _inFlight.set(appId, fetchPromise);\r\n }\r\n\r\n const href = await fetchPromise;\r\n _inFlight.delete(appId);\r\n\r\n if (!href) {\r\n console.warn(\r\n `[FlyOS] loadRemoteStyles: no stylesheet found in ${absoluteBase}/index.html for appId=\"${appId}\"`\r\n );\r\n return;\r\n }\r\n\r\n // Check both <link> and <style> selectors — handle upgrades from the old fallback path.\r\n const escapedId = CSS.escape(appId);\r\n const existing =\r\n document.head.querySelector<HTMLLinkElement | HTMLStyleElement>(\r\n `link[data-fly-app=\"${escapedId}\"], style[data-fly-app=\"${escapedId}\"]`\r\n );\r\n\r\n if (existing) {\r\n if (existing.getAttribute('data-fly-href') === href) return; // identical — no-op\r\n // Hot upgrade: remove old element (could be <link> or <style>) atomically.\r\n existing.remove();\r\n }\r\n\r\n if (_linkLayerSupported) {\r\n // Preferred path: non-render-blocking <link> with native layer= attribute.\r\n // Firefox 134+, Chrome 99+, Safari 17.2+ all support this.\r\n const link = document.createElement('link');\r\n link.rel = 'stylesheet';\r\n link.setAttribute('data-fly-app', appId);\r\n link.setAttribute('data-fly-href', href);\r\n link.href = href;\r\n link.crossOrigin = 'anonymous';\r\n (link as unknown as Record<string, string>)['layer'] = 'remote';\r\n if (_cspNonce) link.nonce = _cspNonce;\r\n document.head.appendChild(link);\r\n } else {\r\n // Fallback path: <style> with @import layer(remote) for older browsers.\r\n // CSS Cascade Level 5: `@import url(\"…\") layer(remote)` is the only valid\r\n // way to place an @import inside a named cascade layer. Block-form\r\n // `@layer remote { @import … }` is invalid and silently dropped by browsers.\r\n const style = document.createElement('style');\r\n style.setAttribute('data-fly-app', appId);\r\n style.setAttribute('data-fly-href', href);\r\n style.textContent = `@import url(\"${href}\") layer(remote);`;\r\n if (_cspNonce) style.nonce = _cspNonce;\r\n document.head.appendChild(style);\r\n }\r\n}\r\n\r\n/**\r\n * Removes the injected stylesheet element (either `<link>` or `<style>`) for\r\n * `appId` from `document.head` and clears all internal state for this appId.\r\n *\r\n * NOTE: Prefer NOT calling this on normal window close — keeping styles loaded\r\n * prevents FOUC flicker when the user reopens the same app. Call only if you\r\n * are certain the remote will not be reopened in this session.\r\n */\r\nexport function unloadRemoteStyles(appId: string): void {\r\n if (typeof document === 'undefined') return; // SSR guard\r\n const escapedId = CSS.escape(appId);\r\n // Remove <link> element (preferred path) if present.\r\n document.head\r\n .querySelector(`link[data-fly-app=\"${escapedId}\"]`)\r\n ?.remove();\r\n // Remove <style> element (fallback path) if present.\r\n document.head\r\n .querySelector(`style[data-fly-app=\"${escapedId}\"]`)\r\n ?.remove();\r\n // Clear in-flight so a future call can retry.\r\n _inFlight.delete(appId);\r\n}\r\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\r\nimport { NgComponentOutlet } from '@angular/common';\r\nimport { FlyRemoteRouter } from '../../services/fly-remote-router.service';\r\n\r\n/**\r\n * Outlet for FlyOS-embedded routing. Renders the component associated with the\r\n * first matching route in the consumer's `FLY_REMOTE_ROUTES` table, reacting to\r\n * `FlyRemoteRouter.navigate(...)` calls.\r\n *\r\n * Use this **only in embedded mode**. Standalone remotes should keep their\r\n * `<router-outlet>` — `FlyRemoteRouter.navigate` delegates to Angular's Router\r\n * there, and this outlet would just shadow it.\r\n *\r\n * Recommended pattern in a remote's root component:\r\n * ```html\r\n * @if (router.isEmbedded) {\r\n * <fly-remote-router-outlet />\r\n * } @else {\r\n * <router-outlet />\r\n * }\r\n * ```\r\n *\r\n * Why both? Standalone keeps full Angular routing — query params, guards,\r\n * resolvers, lazy loading, RouterLink. Embedded gets a stripped-down\r\n * synchronous outlet that matches against the same route table the remote\r\n * declared via `FLY_REMOTE_ROUTES`. The same `router.navigate(['/foo', id])`\r\n * call works in both modes; only the rendering surface differs.\r\n *\r\n * Limitations vs. `<router-outlet>`:\r\n * - Synchronous components only (no `loadComponent` / `loadChildren`).\r\n * - No guards / resolvers / data resolution.\r\n * - No query-param / hash handling — only path segments.\r\n * - No `RouterLink` directive — use `(click)=\"router.navigate(...)\"`.\r\n *\r\n * Components rendered by this outlet read route params via `FlyRemoteRouter.params`:\r\n * ```ts\r\n * private readonly router = inject(FlyRemoteRouter);\r\n * readonly id = computed(() => this.router.params()['id'] ?? '');\r\n * ```\r\n */\r\n@Component({\r\n selector: 'fly-remote-router-outlet',\r\n standalone: true,\r\n imports: [NgComponentOutlet],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n @if (matched(); as m) {\r\n <ng-container *ngComponentOutlet=\"m.route.component\" />\r\n }\r\n `,\r\n})\r\nexport class FlyRemoteRouterOutletComponent {\r\n private readonly router = inject(FlyRemoteRouter);\r\n\r\n /**\r\n * Read directly from FlyRemoteRouter so the outlet re-renders whenever the\r\n * URL changes (signal-based, OnPush-friendly).\r\n */\r\n readonly matched = this.router.matchedRoute;\r\n}\r\n","import { Injectable, Signal, computed, inject, signal } from '@angular/core';\r\nimport { Router } from '@angular/router';\r\nimport { Observable, of } from 'rxjs';\r\nimport { User } from '../models/user.model';\r\nimport { FLY_ADMIN_ROLES, hasAnyRoleIn } from '../auth/fly-roles';\r\n\r\nexport interface MockAuthConfig {\r\n user: User;\r\n token?: string;\r\n loginRedirect?: string[];\r\n logoutRedirect?: string[];\r\n}\r\n\r\ninterface MockSession {\r\n accessToken: string;\r\n user: User;\r\n expiresAt: number;\r\n}\r\n\r\n/**\r\n * Shared mock AuthService base class for Business App developers.\r\n *\r\n * Extend this class in your app's `auth.service.mock.ts` and override\r\n * `getConfig()` to supply app-specific mock user data and navigation paths.\r\n * The subclass must be decorated with `@Injectable({ providedIn: 'root' })`\r\n * and exported as `AuthService` so Angular's `fileReplacements` swap works.\r\n *\r\n * @example\r\n * ```typescript\r\n * // src/app/core/services/auth.service.mock.ts\r\n * import { Injectable } from '@angular/core';\r\n * import { MockAuthService, type MockAuthConfig } from '@flyos/design-system';\r\n *\r\n * @Injectable({ providedIn: 'root' })\r\n * export class AuthService extends MockAuthService {\r\n * protected override getConfig(): MockAuthConfig {\r\n * return {\r\n * user: { id: 'dev-001', tenantId: 'dev-tenant', email: 'dev@example.com',\r\n * firstName: 'Dev', lastName: 'User', fullName: 'Dev User',\r\n * preferredLocale: 'en', roles: ['admin'], apps: ['my-app'] },\r\n * token: 'my-mock-token',\r\n * loginRedirect: ['/app'],\r\n * };\r\n * }\r\n * }\r\n * ```\r\n */\r\n@Injectable()\r\nexport class MockAuthService {\r\n private readonly router = inject(Router);\r\n\r\n protected readonly _session: ReturnType<typeof signal<MockSession | null>>;\r\n\r\n private readonly _config: MockAuthConfig;\r\n\r\n readonly isAuthenticated: Signal<boolean>;\r\n readonly currentUser: Signal<User | null>;\r\n readonly accessToken: Signal<string | null>;\r\n /** Epoch-ms expiry of the mock session — parity with the real AuthService. */\r\n readonly expiresAt: Signal<number>;\r\n /** Mock user roles — parity with the real AuthService gate surface. */\r\n readonly roles: Signal<readonly string[]>;\r\n /** Canonical platform-admin gate over the mock user's roles — parity so mock\r\n * builds exercise the same `isAdmin` path as production. */\r\n readonly isAdmin: Signal<boolean>;\r\n /** Always false in mock mode — 2FA is handled entirely by the STS. */\r\n readonly hasPendingTwoFactor: Signal<boolean>;\r\n /** Always false in mock mode — auth is pre-populated synchronously. */\r\n readonly initializing: Signal<boolean>;\r\n\r\n /**\r\n * Shell and guards may read this flag; real auth uses `localStorage` `fly_had_session`.\r\n * Default false — override in the app’s `auth.service.mock.ts` if needed.\r\n */\r\n // Must stay an accessor: subclasses override it with `override get`\r\n // (src/app/core/services/auth.service.mock.ts, matching the real AuthService's getter).\r\n // Demoting it to a readonly field makes TS reject every such override\r\n // (\"defined as a property ... but overridden here as an accessor\").\r\n // eslint-disable-next-line @typescript-eslint/class-literal-property-style\r\n get hadPriorSession(): boolean {\r\n return false;\r\n }\r\n\r\n constructor() {\r\n // All signal/computed calls are inside the constructor body so Angular's\r\n // injection context and ngDevMode are fully set up before they execute.\r\n this._config = this.getConfig();\r\n\r\n this._session = signal<MockSession | null>({\r\n accessToken: this._config.token ?? 'mock-token',\r\n user: this._config.user,\r\n expiresAt: Date.now() + 24 * 60 * 60 * 1000,\r\n });\r\n\r\n this.isAuthenticated = computed(() => {\r\n const s = this._session();\r\n return s !== null && s.expiresAt > Date.now();\r\n });\r\n\r\n this.currentUser = computed(() => this._session()?.user ?? null);\r\n this.accessToken = computed(() => this._session()?.accessToken ?? null);\r\n this.expiresAt = computed(() => this._session()?.expiresAt ?? 0);\r\n this.roles = computed(() => this._session()?.user?.roles ?? []);\r\n this.isAdmin = computed(() => hasAnyRoleIn(this.roles(), FLY_ADMIN_ROLES));\r\n this.hasPendingTwoFactor = computed(() => false);\r\n this.initializing = signal(false).asReadonly();\r\n }\r\n\r\n /** Parity with the real AuthService — reactive when read in a template/computed. */\r\n hasAnyRole(required: readonly string[]): boolean {\r\n return hasAnyRoleIn(this._session()?.user?.roles, required);\r\n }\r\n\r\n /** Parity with the real AuthService — patch profile fields on the mock session. */\r\n patchProfile(patch: Partial<User>): void {\r\n const session = this._session();\r\n if (!session?.user) return;\r\n this._session.set({ ...session, user: { ...session.user, ...patch } });\r\n }\r\n\r\n /** Override in subclass to supply app-specific mock data. */\r\n protected getConfig(): MockAuthConfig {\r\n return {\r\n user: {\r\n id: 'mock-user-001',\r\n tenantId: 'mock-tenant-001',\r\n email: 'developer@fly.local',\r\n firstName: 'UI',\r\n lastName: 'Developer',\r\n fullName: 'UI Developer',\r\n preferredLocale: 'en',\r\n roles: ['admin'],\r\n apps: [],\r\n },\r\n };\r\n }\r\n\r\n async init(): Promise<void> {\r\n // Mock mode: already authenticated, nothing to initialize.\r\n }\r\n\r\n startLogin(): void {\r\n this.router.navigate(this._config.loginRedirect ?? ['/']);\r\n }\r\n\r\n handleCallback(_code: string, _state?: string): Observable<User> {\r\n return of(this._config.user);\r\n }\r\n\r\n async forceRefresh(): Promise<void> {\r\n // No-op in mock mode — token never expires.\r\n }\r\n\r\n patchSessionPreferredLocale(locale: string): void {\r\n const session = this._session();\r\n if (!session?.user) return;\r\n this._session.set({ ...session, user: { ...session.user, preferredLocale: locale } });\r\n }\r\n\r\n /** Parameter order matches the real AuthService: (user, accessToken, expiresAt). */\r\n setSession(_user: User, _accessToken: string, _expiresAt: number): void {\r\n // No-op in mock mode — session is hardcoded.\r\n }\r\n\r\n logout(): void {\r\n this._session.set(null);\r\n this.router.navigate(this._config.logoutRedirect ?? ['/']);\r\n }\r\n}\r\n","import { Injectable, Signal, computed, signal } from '@angular/core';\r\nimport type {\r\n LookupHandle,\r\n LookupRegistration,\r\n} from '../../models/agent-input.model';\r\n\r\n/**\r\n * Singleton registry of entity lookups offered by the `/lookup` typeahead.\r\n *\r\n * Mirrors {@link AgentCommandRegistry}'s federation-singleton story\r\n * (`sharedMappings: ['@flyos/design-system']`), id-collision\r\n * \"latest wins\" contract, and disposable-handle ergonomics. OS-core entities\r\n * (note / calendar event / file) register once at shell bootstrap via\r\n * `CORE_APP_LOOKUPS`; federated remotes (Circles: scenario / trend / signal)\r\n * register at remote-component boot and dispose on window close.\r\n *\r\n * **Scope semantics diverge from commands.** Commands HIDE when their `appId`\r\n * isn't in `liveAppIds`. Lookups DO NOT — they're always offered, and\r\n * `{appId}` is just a *priority hint* that bumps that lookup to the top of\r\n * the entity picker when the app is live. See {@link LookupRegistration.scope}\r\n * for the rationale.\r\n *\r\n * Storage is a signal store keyed on {@link LookupRegistration.entity}. Because\r\n * `entity` is the collision key, an app re-registering the same entity replaces\r\n * the prior descriptor; a stale handle's `dispose()` then no-ops.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class AgentLookupRegistry {\r\n private readonly _lookups = signal<readonly LookupRegistration[]>([]);\r\n /** All currently-registered lookups, in insertion order. */\r\n readonly all: Signal<readonly LookupRegistration[]> = this._lookups.asReadonly();\r\n\r\n /**\r\n * All registered lookups, sorted by affinity to `liveAppIds`:\r\n *\r\n * 1. Lookups whose `scope.appId` is in the live app set (in registration\r\n * order within that bucket).\r\n * 2. Then everything else — `'global'` lookups AND scoped lookups whose\r\n * app isn't currently live — in registration order.\r\n *\r\n * Recomputes when either the registry or `liveAppIds` changes. Pass a\r\n * `Signal<ReadonlySet<string>>` from the host's app-registry for reactive\r\n * re-sorting. **Always returns the full registry** — see the type doc on\r\n * {@link LookupRegistration.scope} for why this differs from\r\n * {@link AgentCommandRegistry.visible}.\r\n */\r\n visible(\r\n liveAppIds: ReadonlySet<string> | Signal<ReadonlySet<string>>,\r\n ): Signal<readonly LookupRegistration[]> {\r\n const liveSignal = isSignal<ReadonlySet<string>>(liveAppIds)\r\n ? liveAppIds\r\n : signal(liveAppIds).asReadonly();\r\n return computed(() => {\r\n const live = liveSignal();\r\n const all = this._lookups();\r\n const prioritized: LookupRegistration[] = [];\r\n const rest: LookupRegistration[] = [];\r\n for (const l of all) {\r\n if (l.scope !== 'global' && live.has(l.scope.appId)) {\r\n prioritized.push(l);\r\n } else {\r\n rest.push(l);\r\n }\r\n }\r\n return prioritized.length === 0 ? all : [...prioritized, ...rest];\r\n });\r\n }\r\n\r\n /**\r\n * Register one lookup. Returns a handle whose `dispose()` removes the row by\r\n * `entity`. A later re-registration of the same entity makes the original\r\n * handle's `dispose()` a no-op (the newer registration owns the row).\r\n */\r\n register(lookup: LookupRegistration): LookupHandle {\r\n const generation = ++this._generation;\r\n this._lookups.update((rows) => [\r\n ...rows.filter((r) => r.entity !== lookup.entity),\r\n lookup,\r\n ]);\r\n this._owners.set(lookup.entity, generation);\r\n return {\r\n dispose: () => {\r\n if (this._owners.get(lookup.entity) === generation) {\r\n this._owners.delete(lookup.entity);\r\n this._lookups.update((rows) =>\r\n rows.filter((r) => r.entity !== lookup.entity),\r\n );\r\n }\r\n },\r\n };\r\n }\r\n\r\n /**\r\n * Bulk register. Rolls back on a duplicate entity WITHIN the input batch\r\n * (throws before any row lands). Cross-batch duplicates against existing rows\r\n * follow the standard \"latest wins\" rule and do NOT trigger rollback.\r\n */\r\n registerAll(lookups: readonly LookupRegistration[]): LookupHandle {\r\n const seen = new Set<string>();\r\n for (const l of lookups) {\r\n if (seen.has(l.entity)) {\r\n throw new Error(\r\n `AgentLookupRegistry.registerAll: duplicate entity \"${l.entity}\" in batch`,\r\n );\r\n }\r\n seen.add(l.entity);\r\n }\r\n const handles = lookups.map((l) => this.register(l));\r\n let disposed = false;\r\n return {\r\n dispose: () => {\r\n if (disposed) return;\r\n disposed = true;\r\n for (const h of handles) h.dispose();\r\n },\r\n };\r\n }\r\n\r\n /**\r\n * Resolve a deep-link anchor to a concrete launch target.\r\n *\r\n * `kind` is the dotted `<appId>.<entity>` token the agents backend emits\r\n * inside `flyos:<kind>/<id>` chat-answer anchors — the same entity-kind\r\n * vocabulary as drag-payload kinds and `ref` parts. Returns\r\n * `{ appId, route }` when a registered lookup for that `(appId, entity)`\r\n * pair carries a {@link LookupDescriptor.deepLinkRoute} template; `null`\r\n * otherwise (unknown entity, app mismatch, or no template — e.g. the\r\n * owning app isn't installed) so the caller renders plain text rather than\r\n * a dead link.\r\n *\r\n * `appId` and `entity` are both dot-free by their own grammars, so the\r\n * FIRST dot is the unambiguous split point; a dotless `kind` can't carry an\r\n * app and never resolves. The template's single `{id}` placeholder is\r\n * substituted URL-encoded.\r\n */\r\n resolveDeepLink(\r\n kind: string,\r\n id: string,\r\n ): { readonly appId: string; readonly route: string } | null {\r\n if (!kind) return null;\r\n const dot = kind.indexOf('.');\r\n if (dot <= 0 || dot >= kind.length - 1) return null;\r\n const appId = kind.slice(0, dot);\r\n const entity = kind.slice(dot + 1);\r\n const target = this.resolveDeepLinkForEntity(entity, id);\r\n // App must match the one named in the anchor — a `flyos:` href carries\r\n // the owning app explicitly, so a stale/wrong app prefix must NOT resolve\r\n // even when the bare entity name happens to be registered elsewhere.\r\n return target && target.appId === appId ? target : null;\r\n }\r\n\r\n /**\r\n * Resolve a deep-link target from a bare `(entity, id)` pair — the shape a\r\n * `/lookup` ref carries (it has no `<appId>.<entity>` kind token; the owning\r\n * app is implicit in the registered descriptor). `entity` is the registry's\r\n * unique storage key, so it identifies the descriptor unambiguously without\r\n * an app prefix.\r\n *\r\n * Returns `{ appId, route }` (the descriptor's {@link LookupDescriptor.appId}\r\n * / affinity `scope.appId` as the owner, `{id}` substituted URL-encoded) when\r\n * a matching descriptor carries a {@link LookupDescriptor.deepLinkRoute};\r\n * `null` otherwise (unknown entity, no template, or the owning app has since\r\n * unregistered) so callers render plain text rather than a dead link — the\r\n * same graceful-degrade contract as {@link resolveDeepLink}.\r\n */\r\n resolveDeepLinkForEntity(\r\n entity: string,\r\n id: string,\r\n ): { readonly appId: string; readonly route: string } | null {\r\n if (!entity || !id) return null;\r\n const reg = this._lookups().find((r) => r.entity === entity && r.deepLinkRoute);\r\n const appId = reg ? ownerAppId(reg) : undefined;\r\n if (!reg?.deepLinkRoute || !appId) return null;\r\n return { appId, route: reg.deepLinkRoute.replace('{id}', encodeURIComponent(id)) };\r\n }\r\n\r\n /** Tear down by entity. Idempotent. */\r\n unregister(entity: string): void {\r\n if (this._owners.delete(entity)) {\r\n this._lookups.update((rows) => rows.filter((r) => r.entity !== entity));\r\n }\r\n }\r\n\r\n /** Monotonic counter; identifies which registration call currently owns each entity. */\r\n private _generation = 0;\r\n /** entity → generation. Lets a stale handle's `dispose()` no-op after replacement. */\r\n private readonly _owners = new Map<string, number>();\r\n}\r\n\r\n/** `isSignal` shim — narrows to either `Signal<T>` or a plain value. */\r\nfunction isSignal<T>(v: T | Signal<T>): v is Signal<T> {\r\n return typeof v === 'function';\r\n}\r\n\r\n/**\r\n * The app that owns a registration, for deep-link resolution. Prefers the\r\n * stamped {@link LookupDescriptor.appId} (set by `RemoteManifestService` /\r\n * `CORE_APP_LOOKUPS`), falling back to the affinity `scope.appId` so a raw\r\n * manifest descriptor still resolves even before the host stamps it.\r\n * Returns `undefined` for `'global'`-scoped lookups with no stamped appId.\r\n */\r\nfunction ownerAppId(reg: LookupRegistration): string | undefined {\r\n return reg.appId ?? (typeof reg.scope === 'object' ? reg.scope.appId : undefined);\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n HostListener,\r\n ViewChild,\r\n type OnDestroy,\r\n type OnInit,\r\n afterNextRender,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { HttpClient, HttpParams } from '@angular/common/http';\r\nimport { Subscription } from 'rxjs';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { I18nService } from '../../services/i18n.service';\r\nimport { AgentLookupRegistry } from '../../services/agent-input/agent-lookup-registry.service';\r\nimport { APP_LOOKUP } from '../../services/source-app-resolver.service';\r\nimport type { LookupDescriptor, LookupResult } from '../../models/agent-input.model';\r\nimport { type EntityLinkSelection } from './entity-lookup.types';\r\n\r\n/** Debounce (ms) applied to the typeahead between the user's last keystroke\r\n * and the HTTP search. Long enough that a fast typist fires one request, not\r\n * one per character. */\r\nconst SEARCH_DEBOUNCE_MS = 250;\r\n\r\n/** Hard cap on candidate rows rendered, regardless of how many the endpoint\r\n * returns. The descriptor's `extraParams.pageSize` is the primary bound; this\r\n * is a defensive client-side backstop so a misconfigured endpoint can't paint\r\n * a thousand-row list. */\r\nconst MAX_RESULTS_RENDERED = 25;\r\n\r\n/**\r\n * Shared floating entity typeahead — the `/lookup` picker promoted out of the\r\n * agent composer into the design-system so any app (agent composer, notes,\r\n * task comments, federated remotes) can let a user find an entity and act on\r\n * it. Editor-agnostic: it emits a {@link LookupResult} ({@link pick}) and,\r\n * when the entity resolves to a deep link, an {@link EntityLinkSelection}\r\n * ({@link entityLinkSelected}) — the consumer decides whether to make a ref\r\n * chip, insert a `flyos:` link into an editor, etc.\r\n *\r\n * Two-stage cascade:\r\n * - **Stage 1 — entity**: a filterable autocomplete of the offered entities.\r\n * Skipped when there's one entity or `initialEntity` already names one.\r\n * - **Stage 2 — search**: a debounced typeahead against the chosen entity's\r\n * search endpoint, with a breadcrumb back to stage 1.\r\n *\r\n * The HTTP call goes through the host's `HttpClient` so the gateway routing +\r\n * auth interceptor apply — the same path the MCP `*_list_brief` tools wrap,\r\n * but user-authenticated. The \"exposed by app\" badge resolves names via the\r\n * optional {@link LOOKUP_APP_NAME_RESOLVER} the host provides (the DS has no\r\n * app registry); absent it, the badge falls back to `appBadgeKey`.\r\n */\r\n@Component({\r\n selector: 'fly-entity-lookup',\r\n standalone: true,\r\n imports: [CommonModule, FormsModule, TranslatePipe],\r\n templateUrl: './entity-lookup.component.html',\r\n styleUrls: ['./entity-lookup.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n // `placement` drives a host class so the panel positions per anchor: `up`\r\n // (default) = full-width, opens upward (agent composer); `down` =\r\n // button-anchored dropdown opening down (top toolbar — notes); `above` =\r\n // button-anchored dropdown opening up (bottom composer — task comments).\r\n host: {\r\n '[class.fly-entity-lookup--down]': \"placement() === 'down'\",\r\n '[class.fly-entity-lookup--above]': \"placement() === 'above'\",\r\n },\r\n})\r\nexport class EntityLookupComponent implements OnInit, OnDestroy {\r\n private readonly http = inject(HttpClient);\r\n private readonly i18n = inject(I18nService);\r\n private readonly host = inject(ElementRef<HTMLElement>);\r\n private readonly lookupRegistry = inject(AgentLookupRegistry);\r\n /** Host-provided appId → {id,name} adapter for the \"exposed by app\" badge.\r\n * The DS has no app registry; the shell (and remotes) provide APP_LOOKUP.\r\n * Optional — absent, the badge falls back to a descriptor's appBadgeKey. */\r\n private readonly appLookup = inject(APP_LOOKUP, { optional: true });\r\n\r\n /** Entities the picker may search — already filtered to the live-app scope\r\n * by the caller. Empty renders a \"nothing to look up\" hint. */\r\n readonly descriptors = input.required<readonly LookupDescriptor[]>();\r\n /** Entity pre-selected (e.g. from `/lookup <entity>`). Ignored when it\r\n * doesn't match any descriptor (falls back to the first). */\r\n readonly initialEntity = input<string | undefined>(undefined);\r\n /** Query text pre-seeded (e.g. from `/lookup <entity> <query>`). */\r\n readonly initialQuery = input<string>('');\r\n /** Per-instance listbox id so `aria-controls` / `aria-activedescendant`\r\n * resolve unambiguously when multiple panels mount. */\r\n readonly listboxId = input<string>('fly-entity-lookup-listbox');\r\n /** Open direction. `'up'` (default) suits a bottom-anchored composer (the\r\n * agent input); `'down'` suits a top-anchored toolbar button (notes / task\r\n * comments) — the panel then anchors to the host's positioned parent (the\r\n * button wrapper) and opens below it with a fixed width. */\r\n readonly placement = input<'up' | 'down' | 'above'>('up');\r\n /** Lock the picker to its current entity: the breadcrumb back-to-entity\r\n * affordance is disabled and Backspace-on-empty no longer steps back. Set by\r\n * callers whose context only accepts ONE entity type — e.g. an armed agent\r\n * command bound to `signal` must not let the user switch to another entity.\r\n * The crumb still renders (as a static label of what's being searched). */\r\n readonly lockEntity = input<boolean>(false);\r\n\r\n /** Raw pick — every consumer gets this (agent ref chips, etc.). */\r\n readonly pick = output<LookupResult>();\r\n /** Deep-link selection — emitted ONLY when the picked entity resolves to a\r\n * route via the lookup registry (so the consumer never gets a dead link).\r\n * Editors bind this to insert a `flyos:` anchor. */\r\n readonly entityLinkSelected = output<EntityLinkSelection>();\r\n /** Fired when an `onSelect:'invoke'` descriptor's action POST succeeds (e.g. a\r\n * routine was queued to run). Consumers surface a confirmation; the picker\r\n * also self-dismisses. Never fires for the default `'reference'` lookups. */\r\n readonly invokeSuccess = output<LookupResult>();\r\n readonly dismiss = output<void>();\r\n\r\n /** Which cascade stage is active: pick an entity, then search within it. */\r\n readonly stage = signal<'entity' | 'search'>('entity');\r\n /** entity key of the descriptor currently being searched. */\r\n readonly activeEntity = signal<string | null>(null);\r\n /** In stage 1 this filters the entity list; in stage 2 it's the search text. */\r\n readonly query = signal<string>('');\r\n readonly results = signal<readonly LookupResult[]>([]);\r\n readonly loading = signal<boolean>(false);\r\n /** i18n key for an inline error (network / bad endpoint); null when clear. */\r\n readonly errorKey = signal<string | null>(null);\r\n readonly activeIndex = signal<number>(0);\r\n\r\n /** Query stashed when no entity matched, so it can seed the search field the\r\n * moment the user picks an entity. One-shot. */\r\n private _seedQuery = '';\r\n\r\n /** The descriptor matching {@link activeEntity}, or null. */\r\n readonly activeDescriptor = computed<LookupDescriptor | null>(() => {\r\n const e = this.activeEntity();\r\n if (!e) return null;\r\n return this.descriptors().find((d) => d.entity === e) ?? null;\r\n });\r\n\r\n /** Stage-1 entity options, narrowed by the typed filter. Touches\r\n * `i18n.version()` so a locale switch re-resolves the label match. */\r\n readonly filteredEntities = computed<readonly LookupDescriptor[]>(() => {\r\n this.i18n.version();\r\n const q = this.query().trim().toLowerCase();\r\n const descs = this.descriptors();\r\n if (q.length === 0) return descs;\r\n return descs.filter(\r\n (d) =>\r\n d.entity.toLowerCase().includes(q) ||\r\n this.i18n.t(d.labelKey).toLowerCase().includes(q),\r\n );\r\n });\r\n\r\n /** Size of the list the keyboard currently navigates (entities vs results). */\r\n readonly listSize = computed<number>(() =>\r\n this.stage() === 'entity' ? this.filteredEntities().length : this.results().length,\r\n );\r\n\r\n /** Whether stepping back to the entity picker is allowed: there's a real\r\n * choice of entity AND the picker isn't locked to one entity. */\r\n readonly showBack = computed<boolean>(() => this.descriptors().length > 1 && !this.lockEntity());\r\n\r\n /** Whether the breadcrumb chip renders at all. It shows when back-navigation is\r\n * available OR the picker is locked (then it's a static label of the entity\r\n * being searched, with the back affordance disabled). */\r\n readonly showCrumb = computed<boolean>(\r\n () => this.stage() === 'search' && (this.showBack() || this.lockEntity()),\r\n );\r\n\r\n /** Placeholder reflects the active stage. */\r\n readonly searchPlaceholderKey = computed<string>(() =>\r\n this.stage() === 'entity'\r\n ? 'agent.lookup.entity_placeholder'\r\n : 'agent.lookup.search_placeholder',\r\n );\r\n\r\n private _debounceTimer: ReturnType<typeof setTimeout> | null = null;\r\n private _searchSub: Subscription | null = null;\r\n\r\n @ViewChild('searchRef') private readonly searchEl?: ElementRef<HTMLInputElement>;\r\n\r\n constructor() {\r\n afterNextRender(() => this._focusSearch());\r\n }\r\n\r\n ngOnInit(): void {\r\n const descs = this.descriptors();\r\n const initial = this.initialEntity();\r\n const chosen =\r\n (initial ? descs.find((d) => d.entity === initial) : undefined) ??\r\n (descs.length === 1 ? descs[0] : undefined);\r\n if (chosen) {\r\n this.activeEntity.set(chosen.entity);\r\n this.query.set(this.initialQuery() ?? '');\r\n this.stage.set('search');\r\n this._runSearch();\r\n } else {\r\n this._seedQuery = this.initialQuery() ?? '';\r\n this.activeEntity.set(null);\r\n this.query.set('');\r\n this.stage.set('entity');\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._clearTimer();\r\n this._searchSub?.unsubscribe();\r\n }\r\n\r\n optionId(index: number): string {\r\n return `${this.listboxId()}-opt-${index}`;\r\n }\r\n\r\n readonly activeDescendant = computed<string>(() => {\r\n if (this.listSize() === 0) return '';\r\n return `${this.listboxId()}-opt-${this._clampedIndex()}`;\r\n });\r\n\r\n private _clampedIndex(): number {\r\n const size = this.listSize();\r\n if (size === 0) return 0;\r\n return Math.min(Math.max(0, this.activeIndex()), size - 1);\r\n }\r\n\r\n // ── Input + entity handlers ─────────────────────────────────────────────\r\n\r\n onQueryInput(value: string): void {\r\n this.query.set(value);\r\n this.activeIndex.set(0);\r\n if (this.stage() === 'search') this._scheduleSearch();\r\n }\r\n\r\n onSelectEntity(entity: string): void {\r\n this.activeEntity.set(entity);\r\n this.activeIndex.set(0);\r\n this.stage.set('search');\r\n this.query.set(this._seedQuery);\r\n this._seedQuery = '';\r\n this.errorKey.set(null);\r\n this._runSearch();\r\n this._focusSearch();\r\n }\r\n\r\n goBackToEntity(): void {\r\n if (!this.showBack()) return;\r\n this._clearTimer();\r\n this._searchSub?.unsubscribe();\r\n this.stage.set('entity');\r\n this.activeEntity.set(null);\r\n this.activeIndex.set(0);\r\n this.query.set('');\r\n this.results.set([]);\r\n this.loading.set(false);\r\n this.errorKey.set(null);\r\n this._focusSearch();\r\n }\r\n\r\n onRowClick(row: LookupResult): void {\r\n this._selectRow(row);\r\n }\r\n\r\n onRowHover(index: number): void {\r\n if (index !== this.activeIndex()) this.activeIndex.set(index);\r\n }\r\n\r\n /**\r\n * Single pick exit. Emits the raw {@link pick} for every consumer, AND —\r\n * when the entity resolves to a deep-link route via the registry — an\r\n * {@link entityLinkSelected} carrying the `flyos:` href. Resolution failures\r\n * (unknown entity / app mismatch / owning app not installed / no\r\n * `deepLinkRoute`) simply omit the deep-link event: editor consumers get\r\n * nothing to insert rather than a dead link, while the raw `pick` path\r\n * (agent ref chips) still fires.\r\n */\r\n private _selectRow(row: LookupResult): void {\r\n const desc = this.activeDescriptor();\r\n // Command-style lookup: selecting a row fires a side-effecting action (e.g.\r\n // run a Twin routine on demand) instead of staging a reference. Default\r\n // (undefined) is 'reference' — the long-standing behaviour below, byte for\r\n // byte, so every existing lookup is unaffected.\r\n if (desc?.onSelect === 'invoke' && desc.invoke) {\r\n this._invokeSelection(row, desc.invoke);\r\n return;\r\n }\r\n\r\n this.pick.emit(row);\r\n const target = this.lookupRegistry.resolveDeepLinkForEntity(row.entity, row.id);\r\n if (target) {\r\n this.entityLinkSelected.emit({\r\n label: row.label,\r\n kind: `${target.appId}.${row.entity}`,\r\n id: row.id,\r\n appId: target.appId,\r\n route: target.route,\r\n href: `flyos:${target.appId}.${row.entity}/${row.id}`,\r\n });\r\n }\r\n }\r\n\r\n /**\r\n * Fire an `onSelect:'invoke'` descriptor's action. POSTs (or PUTs) to the\r\n * descriptor's `invoke.endpoint` with `{id}` substituted by the picked row's\r\n * id, then emits {@link invokeSuccess} + dismisses on success, or surfaces an\r\n * inline error on failure. The HTTP call rides the host `HttpClient` so the\r\n * gateway routing + auth interceptor apply (same path as the search call).\r\n */\r\n private _invokeSelection(\r\n row: LookupResult,\r\n invoke: { endpoint: string; method?: 'POST' | 'PUT' },\r\n ): void {\r\n const url = invoke.endpoint.replace('{id}', encodeURIComponent(row.id));\r\n const req =\r\n (invoke.method ?? 'POST') === 'PUT'\r\n ? this.http.put(url, {})\r\n : this.http.post(url, {});\r\n this.loading.set(true);\r\n this.errorKey.set(null);\r\n req.subscribe({\r\n next: () => {\r\n this.loading.set(false);\r\n this.invokeSuccess.emit(row);\r\n this.dismiss.emit();\r\n },\r\n error: () => {\r\n this.loading.set(false);\r\n this.errorKey.set('agent.lookup.invoke_error');\r\n },\r\n });\r\n }\r\n\r\n onKeydown(ev: KeyboardEvent): void {\r\n if (ev.key === 'Escape') {\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n this.dismiss.emit();\r\n return;\r\n }\r\n if (\r\n ev.key === 'Backspace' &&\r\n this.stage() === 'search' &&\r\n this.query().length === 0 &&\r\n this.showBack()\r\n ) {\r\n ev.preventDefault();\r\n this.goBackToEntity();\r\n return;\r\n }\r\n const size = this.listSize();\r\n if (ev.key === 'ArrowDown') {\r\n ev.preventDefault();\r\n if (size === 0) return;\r\n this.activeIndex.set((this._clampedIndex() + 1) % size);\r\n return;\r\n }\r\n if (ev.key === 'ArrowUp') {\r\n ev.preventDefault();\r\n if (size === 0) return;\r\n this.activeIndex.set((this._clampedIndex() - 1 + size) % size);\r\n return;\r\n }\r\n if (ev.key === 'Enter') {\r\n ev.preventDefault();\r\n if (this.stage() === 'entity') {\r\n const desc = this.filteredEntities()[this._clampedIndex()];\r\n if (desc) this.onSelectEntity(desc.entity);\r\n } else {\r\n const row = this.results()[this._clampedIndex()];\r\n if (row) this._selectRow(row);\r\n }\r\n return;\r\n }\r\n }\r\n\r\n @HostListener('document:mousedown', ['$event'])\r\n onDocumentMouseDown(ev: MouseEvent): void {\r\n const target = ev.target as Node | null;\r\n if (!target) return;\r\n if (this.host.nativeElement.contains(target)) return;\r\n this.dismiss.emit();\r\n }\r\n\r\n @HostListener('document:keydown.escape')\r\n onDocumentEscape(): void {\r\n this.dismiss.emit();\r\n }\r\n\r\n // ── Search internals ────────────────────────────────────────────────────\r\n\r\n private _scheduleSearch(): void {\r\n this._clearTimer();\r\n this._debounceTimer = setTimeout(() => this._runSearch(), SEARCH_DEBOUNCE_MS);\r\n }\r\n\r\n private _clearTimer(): void {\r\n if (this._debounceTimer !== null) {\r\n clearTimeout(this._debounceTimer);\r\n this._debounceTimer = null;\r\n }\r\n }\r\n\r\n private _runSearch(): void {\r\n this._clearTimer();\r\n const desc = this.activeDescriptor();\r\n if (!desc) {\r\n this.results.set([]);\r\n return;\r\n }\r\n const endpoint = desc.search.endpoint;\r\n // SSRF / shape guard — relative path only (no scheme/host, no protocol-\r\n // relative `//host`).\r\n if (!endpoint.startsWith('/') || endpoint.startsWith('//')) {\r\n this.errorKey.set('agent.lookup.error');\r\n this.results.set([]);\r\n this.loading.set(false);\r\n return;\r\n }\r\n\r\n this._searchSub?.unsubscribe();\r\n this.loading.set(true);\r\n this.errorKey.set(null);\r\n\r\n let params = new HttpParams().set(desc.search.queryParam, this.query().trim());\r\n for (const [k, v] of Object.entries(desc.search.extraParams ?? {})) {\r\n params = params.set(k, v);\r\n }\r\n\r\n this._searchSub = this.http.get<unknown>(endpoint, { params }).subscribe({\r\n next: (body) => {\r\n this.results.set(this._mapResults(desc, body));\r\n this.loading.set(false);\r\n this.activeIndex.set(0);\r\n },\r\n error: () => {\r\n this.errorKey.set('agent.lookup.error');\r\n this.results.set([]);\r\n this.loading.set(false);\r\n },\r\n });\r\n }\r\n\r\n private _mapResults(desc: LookupDescriptor, body: unknown): readonly LookupResult[] {\r\n const arr = this._extractArray(body, desc.search.resultsPath);\r\n const idField = desc.search.idField ?? 'id';\r\n const dispField = desc.search.displayField;\r\n const secField = desc.search.secondaryField;\r\n const appField = desc.search.appIdField;\r\n const out: LookupResult[] = [];\r\n for (const item of arr) {\r\n if (!item || typeof item !== 'object') continue;\r\n const rec = item as Record<string, unknown>;\r\n const id = rec[idField];\r\n const label = rec[dispField];\r\n if (id == null || label == null) continue;\r\n const rowAppId =\r\n appField != null && rec[appField] != null && rec[appField] !== ''\r\n ? String(rec[appField])\r\n : undefined;\r\n out.push({\r\n entity: desc.entity,\r\n id: String(id),\r\n label: String(label),\r\n secondary:\r\n secField != null && rec[secField] != null\r\n ? String(rec[secField])\r\n : undefined,\r\n appId: rowAppId,\r\n });\r\n if (out.length >= MAX_RESULTS_RENDERED) break;\r\n }\r\n return out;\r\n }\r\n\r\n private _extractArray(body: unknown, path?: string): readonly unknown[] {\r\n if (Array.isArray(body)) return body;\r\n if (!path) return [];\r\n let cur: unknown = body;\r\n for (const seg of path.split('.')) {\r\n if (cur && typeof cur === 'object' && seg in (cur as object)) {\r\n cur = (cur as Record<string, unknown>)[seg];\r\n } else {\r\n return [];\r\n }\r\n }\r\n return Array.isArray(cur) ? cur : [];\r\n }\r\n\r\n private _focusSearch(): void {\r\n queueMicrotask(() => this.searchEl?.nativeElement.focus());\r\n }\r\n\r\n entityLabel(desc: LookupDescriptor): string {\r\n this.i18n.version();\r\n return this.i18n.t(desc.labelKey);\r\n }\r\n\r\n readonly activeEntityLabel = computed<string>(() => {\r\n const desc = this.activeDescriptor();\r\n return desc ? this.entityLabel(desc) : '';\r\n });\r\n\r\n /**\r\n * Display name of the app exposing this descriptor, for the \"exposed by …\"\r\n * badge. Resolution order: host-provided {@link LOOKUP_APP_NAME_RESOLVER}\r\n * (keyed by `descriptor.appId`) → descriptor `appBadgeKey` (literal i18n\r\n * key, for entities not mapped to a single shell app) → '' (no badge).\r\n */\r\n appLabel(desc: LookupDescriptor): string {\r\n this.i18n.version();\r\n if (desc.appId) {\r\n const resolved = this.appLookup?.getById(desc.appId)?.name;\r\n if (resolved) return resolved;\r\n }\r\n if (desc.appBadgeKey) return this.i18n.t(desc.appBadgeKey);\r\n return '';\r\n }\r\n\r\n readonly activeAppLabel = computed<string>(() => {\r\n const desc = this.activeDescriptor();\r\n return desc ? this.appLabel(desc) : '';\r\n });\r\n\r\n /** Per-row source-app label for stage-2 rows. Resolves {@link LookupResult.appId}\r\n * through the host resolver. '' when the row carries no `appId`, the resolver\r\n * is absent / doesn't know it, or it duplicates {@link activeAppLabel}. */\r\n rowAppLabel(row: LookupResult): string {\r\n this.i18n.version();\r\n if (!row.appId) return '';\r\n const resolved = this.appLookup?.getById(row.appId)?.name;\r\n if (!resolved) return '';\r\n if (resolved === this.activeAppLabel()) return '';\r\n return resolved;\r\n }\r\n}\r\n","<div class=\"fly-entity-lookup\" role=\"dialog\" [attr.aria-label]=\"'agent.lookup.dialog_aria' | translate\">\r\n @if (descriptors().length === 0) {\r\n <div class=\"fly-entity-lookup__empty\" role=\"status\">\r\n {{ 'agent.lookup.no_entities' | translate }}\r\n </div>\r\n } @else {\r\n <div class=\"fly-entity-lookup__search\" role=\"combobox\" aria-haspopup=\"listbox\" aria-expanded=\"true\"\r\n [attr.aria-controls]=\"listboxId()\">\r\n @if (showCrumb()) {\r\n <!-- Breadcrumb back to the entity picker (also reachable via Backspace\r\n on an empty query). Shows the chosen entity so the user always\r\n knows what they're searching within. When `lockEntity` is set the\r\n context accepts only this entity, so the button is DISABLED (the\r\n back chevron is dropped) and it reads as a static entity label. -->\r\n <button\r\n type=\"button\"\r\n class=\"fly-entity-lookup__crumb\"\r\n [class.is-locked]=\"lockEntity()\"\r\n [disabled]=\"lockEntity()\"\r\n (click)=\"goBackToEntity()\"\r\n [attr.aria-label]=\"(lockEntity() ? activeEntityLabel() : ('agent.lookup.back_aria' | translate))\">\r\n @if (!lockEntity()) {\r\n <i class=\"pi pi-angle-left fly-entity-lookup__crumb-back\" aria-hidden=\"true\"></i>\r\n }\r\n @if (activeDescriptor()?.icon; as ic) {\r\n <i class=\"pi {{ ic }}\" aria-hidden=\"true\"></i>\r\n }\r\n <span>{{ activeEntityLabel() }}</span>\r\n </button>\r\n } @else {\r\n <i class=\"pi pi-search fly-entity-lookup__search-icon\" aria-hidden=\"true\"></i>\r\n }\r\n <input\r\n #searchRef\r\n type=\"text\"\r\n class=\"fly-entity-lookup__search-input\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onQueryInput($event)\"\r\n (keydown)=\"onKeydown($event)\"\r\n [attr.aria-activedescendant]=\"activeDescendant()\"\r\n [attr.aria-controls]=\"listboxId()\"\r\n [placeholder]=\"searchPlaceholderKey() | translate\" />\r\n </div>\r\n\r\n <div [id]=\"listboxId()\" class=\"fly-entity-lookup__results\" role=\"listbox\"\r\n [attr.aria-label]=\"(stage() === 'entity' ? 'agent.lookup.entities_aria' : 'agent.lookup.results_aria') | translate\">\r\n @if (stage() === 'entity') {\r\n <!-- Stage 1: entity autocomplete. -->\r\n @if (filteredEntities().length === 0) {\r\n <div class=\"fly-entity-lookup__status\" role=\"status\">{{ 'agent.lookup.no_results' | translate }}</div>\r\n } @else {\r\n @for (desc of filteredEntities(); track desc.entity; let i = $index) {\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n class=\"fly-entity-lookup__opt fly-entity-lookup__opt--entity\"\r\n [id]=\"optionId(i)\"\r\n [attr.aria-selected]=\"i === activeIndex()\"\r\n [class.is-active]=\"i === activeIndex()\"\r\n (click)=\"onSelectEntity(desc.entity)\"\r\n (mouseenter)=\"onRowHover(i)\">\r\n <span class=\"fly-entity-lookup__opt-label\">\r\n @if (desc.icon) {\r\n <i class=\"pi {{ desc.icon }}\" aria-hidden=\"true\"></i>\r\n }\r\n {{ entityLabel(desc) }}\r\n </span>\r\n @if (appLabel(desc); as app) {\r\n <span class=\"fly-entity-lookup__opt-app-badge\" [title]=\"app\">{{ app }}</span>\r\n }\r\n <i class=\"pi pi-angle-right fly-entity-lookup__opt-chevron\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n }\r\n } @else {\r\n <!-- Stage 2: result typeahead within the chosen entity. -->\r\n @if (loading()) {\r\n <div class=\"fly-entity-lookup__status\" role=\"status\">{{ 'agent.lookup.searching' | translate }}</div>\r\n } @else if (errorKey(); as err) {\r\n <div class=\"fly-entity-lookup__status fly-entity-lookup__status--error\" role=\"alert\">{{ err | translate }}</div>\r\n } @else if (results().length === 0) {\r\n <div class=\"fly-entity-lookup__status\" role=\"status\">{{ 'agent.lookup.no_results' | translate }}</div>\r\n } @else {\r\n @for (row of results(); track row.id; let i = $index) {\r\n <button\r\n type=\"button\"\r\n role=\"option\"\r\n class=\"fly-entity-lookup__opt\"\r\n [id]=\"optionId(i)\"\r\n [attr.aria-selected]=\"i === activeIndex()\"\r\n [class.is-active]=\"i === activeIndex()\"\r\n (click)=\"onRowClick(row)\"\r\n (mouseenter)=\"onRowHover(i)\">\r\n <span class=\"fly-entity-lookup__opt-label\" [title]=\"row.label\">{{ row.label }}</span>\r\n @if (row.secondary) {\r\n <span class=\"fly-entity-lookup__opt-secondary\">{{ row.secondary }}</span>\r\n }\r\n @if (rowAppLabel(row); as rowApp) {\r\n <!-- Source app of this individual row (e.g. \"Circles\" for a\r\n Help-Center article seeded by Circles). Rendered before the\r\n descriptor tag so the per-row signal sits closer to the\r\n title; suppressed when it would duplicate the descriptor\r\n label. -->\r\n <span class=\"fly-entity-lookup__opt-app-tag fly-entity-lookup__opt-app-tag--source\"\r\n [title]=\"rowApp\">{{ rowApp }}</span>\r\n }\r\n @if (activeAppLabel(); as app) {\r\n <span class=\"fly-entity-lookup__opt-app-tag\" [title]=\"app\">{{ app }}</span>\r\n }\r\n </button>\r\n }\r\n }\r\n }\r\n </div>\r\n }\r\n</div>\r\n","import {\r\n Directive,\r\n ElementRef,\r\n HostListener,\r\n inject,\r\n input,\r\n output,\r\n} from '@angular/core';\r\n\r\n/**\r\n * `flyClickOutside` — dismiss an open dropdown / menu / popover when the user presses\r\n * anywhere else. The canonical primitive for the \"panel won't collapse on click-away\"\r\n * problem.\r\n *\r\n * Put it on the element that wraps BOTH the trigger and the panel, and gate it on the\r\n * panel's open-state signal:\r\n *\r\n * ```html\r\n * <div class=\"my-menu\"\r\n * [flyClickOutsideEnabled]=\"menuOpen()\"\r\n * (flyClickOutside)=\"closeMenu()\">\r\n * <button (click)=\"toggleMenu()\">…</button>\r\n * @if (menuOpen()) { <div class=\"my-menu__panel\">…</div> }\r\n * </div>\r\n * ```\r\n *\r\n * Because the trigger lives *inside* the host, clicking it never self-dismisses (the\r\n * trigger's own toggle owns that); interacting inside the panel is likewise ignored.\r\n * Any press outside the wrapper — another toolbar button, the editor, empty chrome,\r\n * or off-window — emits once.\r\n *\r\n * ## Why a document listener and not a full-area backdrop overlay\r\n * A backdrop can only catch presses on regions painted *below* it, so the trigger and\r\n * panel (which must paint above it to be visible) and any sibling controls at a higher\r\n * stacking level escape it — the open panel then survives clicks on the rest of the\r\n * toolbar. A `position: fixed` backdrop is additionally clamped to a sub-region the\r\n * moment any ancestor establishes a containing block (`transform` / `filter` /\r\n * `backdrop-filter`), which the shell's glass chrome routinely does. Containment-testing\r\n * a document-level listener is immune to z-index, stacking contexts, and containing\r\n * blocks alike.\r\n *\r\n * ## Pairs with the overlay stack\r\n * Click-outside handles *pointer* dismissal; `overlayStack` handles *Escape* dismissal\r\n * for stacked overlays. A fully-behaved overlay wires both, plus `captureFocus` /\r\n * `restoreFocus`. They are deliberately separate primitives so a lightweight dropdown\r\n * can take only the piece it needs.\r\n */\r\n@Directive({\r\n selector: '[flyClickOutside]',\r\n standalone: true,\r\n})\r\nexport class FlyClickOutsideDirective {\r\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n /**\r\n * Gate — the directive only reacts while this is true. Bind it to the panel's\r\n * open-state signal so a closed panel does no work and never self-dismisses.\r\n * Defaults to always-on for an always-mounted consumer.\r\n */\r\n readonly enabled = input(true, { alias: 'flyClickOutsideEnabled' });\r\n\r\n /** Emitted once when a pointer press lands outside the host while enabled. */\r\n readonly flyClickOutside = output<void>();\r\n\r\n // `pointerdown` (not `click`): fires at the very start of the gesture — before focus\r\n // moves and before an inside control's own click handler — so dismissal feels\r\n // immediate and never races a select-then-close. It covers mouse, touch and pen. A\r\n // trigger's `stopPropagation()` on `click` can't suppress it (different event), and\r\n // bubbling always reaches `document`.\r\n @HostListener('document:pointerdown', ['$event'])\r\n protected onDocumentPointerDown(event: Event): void {\r\n if (!this.enabled()) return;\r\n const host = this.host.nativeElement;\r\n // `composedPath()` snapshots the path at dispatch, so containment stays correct\r\n // even if the target detaches mid-handler (a menu item that removes its own row),\r\n // and it pierces shadow roots. Fall back to `contains` for any UA without it.\r\n const path = event.composedPath?.();\r\n const inside =\r\n path && path.length\r\n ? path.includes(host)\r\n : host.contains(event.target as Node | null);\r\n if (!inside) this.flyClickOutside.emit();\r\n }\r\n}\r\n","import {\r\n Directive,\r\n DestroyRef,\r\n ElementRef,\r\n NgZone,\r\n OnDestroy,\r\n effect,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport { FLY_CSP_NONCE } from '../services/fly-csp-nonce';\r\n\r\n/** Side the tooltip surface is requested to sit on. Auto-flips when there's no room. */\r\nexport type FlyTooltipPlacement = 'top' | 'bottom' | 'left' | 'right';\r\n\r\n/** Monotonic id source so each shown tooltip gets a stable, unique `aria-describedby` target. */\r\nlet flyTooltipIdSeq = 0;\r\n\r\n/** Id of the singleton `<style>` node the directive injects into `<head>` on first use. */\r\nconst FLY_TOOLTIP_STYLE_ID = 'fly-tooltip-styles';\r\n\r\n/** Gap (px) between the host edge and the tooltip surface — leaves room for the caret. */\r\nconst GAP = 8;\r\n\r\n/** Viewport inset (px) the surface is clamped within so it never touches the screen edge. */\r\nconst MARGIN = 4;\r\n\r\n/**\r\n * `flyTooltip` — the ONE hover/focus tooltip primitive for FlyOS apps.\r\n *\r\n * Replaces the native browser `[title]` (ugly, un-themable, no keyboard story) and\r\n * every hand-rolled inline `::after` tip. Apply on any element that needs a label:\r\n *\r\n * ```html\r\n * <span class=\"avatar\" [flyTooltip]=\"user.displayName\">{{ initials }}</span>\r\n * <button [flyTooltip]=\"'projects.action.edit' | translate\" flyTooltipPlacement=\"bottom\">…</button>\r\n * ```\r\n *\r\n * ## Why it appends to `document.body` (not an inline `::after`)\r\n * Desktop-shell app windows clip overflow, and avatar rows are `overflow: hidden`\r\n * flex strips. An inline tooltip would be cut off at the row / window boundary. This\r\n * directive creates a `position: fixed` node parented to `<body>`, positioned from the\r\n * host's `getBoundingClientRect()`, so it escapes every overflow-clip and app-window\r\n * bound. It flips placement + clamps to the viewport so it's always fully visible.\r\n *\r\n * ## Behaviour\r\n * - Shows on `mouseenter` AND `focus` (keyboard users), after `flyTooltipDelay` ms.\r\n * - Hides immediately on `mouseleave` / `blur` / `Escape` / scroll / wheel / destroy.\r\n * - Never shows for empty/nullish text or while `flyTooltipDisabled`.\r\n * - Cleans the node up on hide, on host removal, and on directive destroy (no leaks).\r\n *\r\n * ## a11y\r\n * The floating surface is `role=\"tooltip\"` with a generated id; the host gains\r\n * `aria-describedby` pointing at it while shown, and it's removed on hide. The surface\r\n * is `pointer-events: none` so it never eats a click or intercepts the hover.\r\n *\r\n * ## Theming + RTL\r\n * The surface is styled from desktop-shell tokens that carry BOTH light and dark\r\n * values (`--glass-bg-elevated`, `--surface-border`/`--separator`, `--text-color`/\r\n * `--label-primary`), with a self-consistent dark-surface + light-text fallback for\r\n * bare standalone usage where the DS theme layer isn't present. Placement is mirrored\r\n * under `dir=\"rtl\"` (a requested `left` lands on the reading-end side) and text aligns\r\n * to the logical start. Honours `prefers-reduced-motion`.\r\n *\r\n * The tip text is caller-supplied and assumed already-localized — no baseline i18n\r\n * strings are shipped.\r\n */\r\n@Directive({\r\n selector: '[flyTooltip]',\r\n standalone: true,\r\n host: {\r\n '(mouseenter)': 'scheduleShow()',\r\n '(focus)': 'scheduleShow()',\r\n '(mouseleave)': 'hide()',\r\n '(blur)': 'hide()',\r\n },\r\n})\r\nexport class FlyTooltipDirective implements OnDestroy {\r\n /** The tooltip label. Empty / `null` / `undefined` ⇒ no tooltip is shown. */\r\n readonly text = input<string | null | undefined>(undefined, { alias: 'flyTooltip' });\r\n /** Requested side. Auto-flips to the opposite side when there's no room. */\r\n readonly flyTooltipPlacement = input<FlyTooltipPlacement>('top');\r\n /** When `true`, the tooltip never shows (and hides if already visible). */\r\n readonly flyTooltipDisabled = input(false);\r\n /** Debounce (ms) before the tooltip appears on hover/focus. Hiding is immediate. */\r\n readonly flyTooltipDelay = input(300);\r\n\r\n private readonly host = inject(ElementRef<HTMLElement>);\r\n private readonly doc = inject(DOCUMENT);\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly zone = inject(NgZone);\r\n\r\n /** The live tooltip node while shown; `null` when hidden. */\r\n private tip: HTMLElement | null = null;\r\n private showTimer: ReturnType<typeof setTimeout> | null = null;\r\n private rafId: number | null = null;\r\n /** Bound so the exact same reference is added/removed as a listener. */\r\n private readonly onDismiss = (): void => this.hide();\r\n private readonly onKeydown = (ev: KeyboardEvent): void => {\r\n if (ev.key === 'Escape') this.hide();\r\n };\r\n\r\n constructor() {\r\n // Reactively hide a live tooltip if it's disabled or its text is cleared, and keep\r\n // the surface text/position in sync when the label changes while shown.\r\n effect(() => {\r\n const text = this.normalizedText();\r\n const disabled = this.flyTooltipDisabled();\r\n if (!this.tip) return;\r\n if (disabled || !text) {\r\n this.hide();\r\n return;\r\n }\r\n this.tip.textContent = text;\r\n this.position();\r\n });\r\n this.destroyRef.onDestroy(() => this.hide());\r\n }\r\n\r\n ngOnDestroy(): void {\r\n // Belt-and-braces alongside DestroyRef (a plain `new` in a test won't run the effect).\r\n this.hide();\r\n }\r\n\r\n /** Trimmed text, or `''` when there's nothing meaningful to show. */\r\n private normalizedText(): string {\r\n return (this.text() ?? '').trim();\r\n }\r\n\r\n scheduleShow(): void {\r\n if (this.flyTooltipDisabled() || !this.normalizedText()) return;\r\n this.clearTimer();\r\n // Outside the Angular zone: the hover delay would otherwise schedule a change\r\n // detection pass for every tooltip the pointer merely crosses on its way\r\n // somewhere else. Dense toolbars and widget grids put dozens of these in a row\r\n // (the shell's weather widget alone has 30), so in-zone timers turn a mouse\r\n // sweep into a burst of full CD cycles. The show/hide path only touches DOM\r\n // nodes the directive owns directly, so it needs no CD to take effect.\r\n this.zone.runOutsideAngular(() => {\r\n this.showTimer = setTimeout(\r\n () => this.show(),\r\n Math.max(0, this.flyTooltipDelay()),\r\n );\r\n });\r\n }\r\n\r\n private show(): void {\r\n this.clearTimer();\r\n if (this.tip) return;\r\n const text = this.normalizedText();\r\n if (this.flyTooltipDisabled() || !text) return;\r\n\r\n this.ensureStyles();\r\n\r\n const tip = this.doc.createElement('div');\r\n tip.className = 'fly-tooltip';\r\n tip.textContent = text;\r\n tip.id = `fly-tooltip-${++flyTooltipIdSeq}`;\r\n tip.setAttribute('role', 'tooltip');\r\n this.doc.body.appendChild(tip);\r\n this.tip = tip;\r\n\r\n // Describe the host for screen readers while the tip is live.\r\n this.host.nativeElement.setAttribute('aria-describedby', tip.id);\r\n\r\n // Dismiss on any scroll/resize/wheel — a fixed node would otherwise drift away\r\n // from its host. `scroll` uses capture so it catches scrolling inner containers,\r\n // which don't bubble scroll events.\r\n const win = this.doc.defaultView;\r\n win?.addEventListener('scroll', this.onDismiss, true);\r\n win?.addEventListener('wheel', this.onDismiss, { passive: true });\r\n win?.addEventListener('resize', this.onDismiss);\r\n this.doc.addEventListener('keydown', this.onKeydown, true);\r\n\r\n // Position after a frame so `getBoundingClientRect()` reflects the laid-out surface,\r\n // then flip on to trigger the fade/scale-in transition.\r\n // Outside the zone for the same reason as the show timer — the measure pass\r\n // mutates only our own node.\r\n this.zone.runOutsideAngular(() => {\r\n this.rafId = (win?.requestAnimationFrame ??\r\n ((cb: FrameRequestCallback) => setTimeout(() => cb(0), 0) as unknown as number))(\r\n () => {\r\n this.rafId = null;\r\n if (!this.tip) return;\r\n this.position();\r\n this.tip.classList.add('fly-tooltip--visible');\r\n },\r\n );\r\n });\r\n }\r\n\r\n hide(): void {\r\n this.clearTimer();\r\n if (this.rafId !== null) {\r\n this.doc.defaultView?.cancelAnimationFrame?.(this.rafId);\r\n this.rafId = null;\r\n }\r\n const win = this.doc.defaultView;\r\n win?.removeEventListener('scroll', this.onDismiss, true);\r\n win?.removeEventListener('wheel', this.onDismiss);\r\n win?.removeEventListener('resize', this.onDismiss);\r\n this.doc.removeEventListener('keydown', this.onKeydown, true);\r\n\r\n this.host.nativeElement.removeAttribute('aria-describedby');\r\n if (this.tip) {\r\n this.tip.remove();\r\n this.tip = null;\r\n }\r\n }\r\n\r\n private clearTimer(): void {\r\n if (this.showTimer !== null) {\r\n clearTimeout(this.showTimer);\r\n this.showTimer = null;\r\n }\r\n }\r\n\r\n /** Resolve the effective placement — RTL mirrors a requested left/right. */\r\n private effectivePlacement(): FlyTooltipPlacement {\r\n const p = this.flyTooltipPlacement();\r\n if (p !== 'left' && p !== 'right') return p;\r\n const dir = this.doc.defaultView?.getComputedStyle(this.host.nativeElement).direction;\r\n if (dir !== 'rtl') return p;\r\n return p === 'left' ? 'right' : 'left';\r\n }\r\n\r\n private static opposite(p: FlyTooltipPlacement): FlyTooltipPlacement {\r\n switch (p) {\r\n case 'top':\r\n return 'bottom';\r\n case 'bottom':\r\n return 'top';\r\n case 'left':\r\n return 'right';\r\n default:\r\n return 'left';\r\n }\r\n }\r\n\r\n private fits(\r\n p: FlyTooltipPlacement,\r\n host: DOMRect,\r\n tip: DOMRect,\r\n vw: number,\r\n vh: number,\r\n ): boolean {\r\n switch (p) {\r\n case 'top':\r\n return host.top - tip.height - GAP >= 0;\r\n case 'bottom':\r\n return host.bottom + tip.height + GAP <= vh;\r\n case 'left':\r\n return host.left - tip.width - GAP >= 0;\r\n default:\r\n return host.right + tip.width + GAP <= vw;\r\n }\r\n }\r\n\r\n private coordsFor(\r\n p: FlyTooltipPlacement,\r\n host: DOMRect,\r\n tip: DOMRect,\r\n ): { top: number; left: number } {\r\n switch (p) {\r\n case 'bottom':\r\n return { top: host.bottom + GAP, left: host.left + (host.width - tip.width) / 2 };\r\n case 'left':\r\n return { top: host.top + (host.height - tip.height) / 2, left: host.left - tip.width - GAP };\r\n case 'right':\r\n return { top: host.top + (host.height - tip.height) / 2, left: host.right + GAP };\r\n default: // top\r\n return { top: host.top - tip.height - GAP, left: host.left + (host.width - tip.width) / 2 };\r\n }\r\n }\r\n\r\n private position(): void {\r\n const tip = this.tip;\r\n const win = this.doc.defaultView;\r\n if (!tip || !win) return;\r\n\r\n const host = this.host.nativeElement.getBoundingClientRect();\r\n const tr = tip.getBoundingClientRect();\r\n const vw = win.innerWidth;\r\n const vh = win.innerHeight;\r\n\r\n // Prefer the (RTL-adjusted) requested side; flip to the opposite only if it doesn't\r\n // fit AND the opposite does — otherwise keep the request and let the clamp handle it.\r\n let placement = this.effectivePlacement();\r\n if (!this.fits(placement, host, tr, vw, vh) && this.fits(FlyTooltipDirective.opposite(placement), host, tr, vw, vh)) {\r\n placement = FlyTooltipDirective.opposite(placement);\r\n }\r\n\r\n let { top, left } = this.coordsFor(placement, host, tr);\r\n left = Math.min(Math.max(left, MARGIN), Math.max(MARGIN, vw - tr.width - MARGIN));\r\n top = Math.min(Math.max(top, MARGIN), Math.max(MARGIN, vh - tr.height - MARGIN));\r\n\r\n tip.setAttribute('data-pos', placement);\r\n tip.style.top = `${Math.round(top)}px`;\r\n tip.style.left = `${Math.round(left)}px`;\r\n }\r\n\r\n /**\r\n * Inject the singleton stylesheet once. The surface is parented to `<body>` (outside\r\n * any component's view encapsulation), so its CSS can't ride along with the DS bundle's\r\n * scoped styles — a head-level stylesheet is the self-contained way to ship it to every\r\n * consumer (shell, admin, External Apps, bare standalone). Rules are UNLAYERED so they\r\n * win over the shell's `@layer shell` chrome without a specificity war.\r\n */\r\n private ensureStyles(): void {\r\n if (this.doc.getElementById(FLY_TOOLTIP_STYLE_ID)) return;\r\n const style = this.doc.createElement('style');\r\n style.id = FLY_TOOLTIP_STYLE_ID;\r\n style.textContent = FLY_TOOLTIP_CSS;\r\n // Without the nonce a strict `style-src 'self' 'nonce-…'` blocks this element and the\r\n // tooltip renders as unstyled body-parented text. Same guard the remote-stylesheet\r\n // loader uses; null in dev, where an unnonced <style> is allowed anyway.\r\n if (FLY_CSP_NONCE) style.nonce = FLY_CSP_NONCE;\r\n this.doc.head.appendChild(style);\r\n }\r\n}\r\n\r\n/**\r\n * Surface polish for the body-parented tooltip. Tokens carry both light + dark values;\r\n * the fallbacks are a self-consistent dark surface + light text (a classic tooltip look)\r\n * for standalone use where the DS theme layer isn't loaded.\r\n */\r\nconst FLY_TOOLTIP_CSS = `\r\n.fly-tooltip {\r\n position: fixed;\r\n z-index: 99000;\r\n top: 0;\r\n left: 0;\r\n pointer-events: none;\r\n max-width: 280px;\r\n padding: 6px 10px;\r\n background: var(--glass-bg-elevated);\r\n -webkit-backdrop-filter: blur(14px) saturate(140%);\r\n backdrop-filter: blur(14px) saturate(140%);\r\n border: 1px solid var(--surface-border);\r\n border-radius: 8px;\r\n box-shadow: 0 6px 22px -6px rgb(0 0 0 / 45%), 0 2px 6px -2px rgb(0 0 0 / 35%);\r\n color: var(--glass-ink-elevated);\r\n font-size: 12.5px;\r\n font-weight: 500;\r\n line-height: 1.45;\r\n text-align: start;\r\n white-space: pre-line;\r\n word-wrap: break-word;\r\n opacity: 0;\r\n transform: scale(0.94) translateY(2px);\r\n transform-origin: center bottom;\r\n transition: opacity .14s cubic-bezier(.22,1,.36,1), transform .14s cubic-bezier(.22,1,.36,1);\r\n}\r\n.fly-tooltip::after {\r\n content: '';\r\n position: absolute;\r\n width: 8px;\r\n height: 8px;\r\n background: var(--glass-bg-elevated);\r\n border: 1px solid var(--surface-border);\r\n transform: rotate(45deg);\r\n}\r\n.fly-tooltip[data-pos='top']::after,\r\n.fly-tooltip:not([data-pos])::after { bottom: -5px; left: 50%; margin-left: -4px; border-top: 0; border-left: 0; }\r\n.fly-tooltip[data-pos='bottom']::after { top: -5px; left: 50%; margin-left: -4px; border-bottom: 0; border-right: 0; }\r\n.fly-tooltip[data-pos='left']::after { inset-inline-end: -5px; top: 50%; margin-top: -4px; border-bottom: 0; border-left: 0; }\r\n.fly-tooltip[data-pos='right']::after { inset-inline-start: -5px; top: 50%; margin-top: -4px; border-top: 0; border-right: 0; }\r\n.fly-tooltip[data-pos='bottom'] { transform-origin: center top; }\r\n.fly-tooltip[data-pos='left'] { transform-origin: right center; }\r\n.fly-tooltip[data-pos='right'] { transform-origin: left center; }\r\n.fly-tooltip--visible { opacity: 1; transform: none; }\r\n@media (prefers-reduced-motion: reduce) {\r\n .fly-tooltip { transition: none; transform: none; }\r\n}\r\n`;\r\n","/**\r\n * The curated emoji data behind `emoji-catalog.ts` — see that file's header for the id contract,\r\n * the grouping rule, and the read path. Nothing here is behaviour; it is the allowlist itself.\r\n *\r\n * ## Animation coverage and category boundaries (plan §3/§4)\r\n * The picker animates a category only when **every** entry in it has an animated asset (the\r\n * no-mixed-category rule). Upstream (Microsoft Fluent animated) covers faces, people, weather and\r\n * vehicles well, and covers office pictographs — documents, finance, symbols, dots — barely at all.\r\n * Membership below is therefore arranged so that the groups which CAN be uniformly animated\r\n * (`reactions`, `people`, `roles`, `timers`, `weather`) are exactly the groups that also stand up as\r\n * coherent functional groups. Where uniformity would have required an incoherent group\r\n * (`status`, `priority`, `logistics`, `places`, `symbols`), the grouping rule wins and the category\r\n * simply renders static. Coverage is a rendering property; it never justifies a category a reader\r\n * cannot predict.\r\n */\r\n\r\nimport type { FlyEmojiCategory } from './emoji-catalog.types';\r\n\r\n/**\r\n * Categories in display order. Ids inherited from the mind-maps marker palette keep their original\r\n * id AND their original English label, so a promoted host renders identical tooltips.\r\n */\r\nexport const FLY_EMOJI_CATEGORIES: readonly FlyEmojiCategory[] = [\r\n {\r\n id: 'reactions',\r\n labelKey: 'common.label.emoji_category_reactions',\r\n label: 'Reactions',\r\n entries: [\r\n { id: 'face-grin', emoji: '😀', label: 'Grinning', keywords: 'happy big smile cheerful' },\r\n {\r\n id: 'face-rofl',\r\n emoji: '🤣',\r\n label: 'Rolling laughing',\r\n keywords: 'lol hilarious funny rofl lmao',\r\n },\r\n { id: 'face-joy', emoji: '😂', label: 'Crying laughing', keywords: 'lol hilarious funny tears' },\r\n { id: 'face-blush', emoji: '😊', label: 'Blushing', keywords: 'shy pleased warm smile' },\r\n { id: 'face-sweat-smile', emoji: '😅', label: 'Nervous laugh', keywords: 'phew relief close' },\r\n { id: 'face-love', emoji: '😍', label: 'Heart eyes', keywords: 'love adore crush' },\r\n { id: 'face-hearts', emoji: '🥰', label: 'Adoring', keywords: 'love affection warm' },\r\n { id: 'face-kiss', emoji: '😘', label: 'Kiss', keywords: 'love affection blow kiss' },\r\n { id: 'face-wink', emoji: '😉', label: 'Wink', keywords: 'flirt joke playful' },\r\n { id: 'face-tongue', emoji: '😛', label: 'Tongue out', keywords: 'joke silly playful' },\r\n { id: 'face-upside-down', emoji: '🙃', label: 'Playful', keywords: 'irony silly whatever' },\r\n { id: 'face-cool', emoji: '😎', label: 'Cool', keywords: 'sunglasses confident chill' },\r\n { id: 'face-star-struck', emoji: '🤩', label: 'Amazed', keywords: 'wow impressed brilliant' },\r\n { id: 'face-hug', emoji: '🤗', label: 'Hug', keywords: 'warm embrace supportive' },\r\n { id: 'face-party', emoji: '🥳', label: 'Celebrating', keywords: 'party birthday confetti' },\r\n { id: 'face-relieved', emoji: '😌', label: 'Relieved', keywords: 'calm content settled' },\r\n { id: 'face-shush', emoji: '🤫', label: 'Shush', keywords: 'quiet secret confidential' },\r\n { id: 'face-eyeroll', emoji: '🙄', label: 'Eye roll', keywords: 'annoyed sarcastic done' },\r\n { id: 'face-grimace', emoji: '😬', label: 'Awkward', keywords: 'yikes tense uncomfortable' },\r\n { id: 'face-mind-blown', emoji: '🤯', label: 'Mind blown', keywords: 'shocked wow overwhelmed' },\r\n { id: 'face-pleading', emoji: '🥺', label: 'Pleading', keywords: 'please puppy eyes beg' },\r\n { id: 'face-shock', emoji: '😱', label: 'Shocked', keywords: 'scared surprised scream' },\r\n { id: 'face-cry', emoji: '😢', label: 'Crying', keywords: 'sad tears upset' },\r\n { id: 'face-angry', emoji: '😡', label: 'Angry', keywords: 'mad furious frustrated' },\r\n { id: 'face-sleep', emoji: '😴', label: 'Sleepy', keywords: 'tired bored zzz' },\r\n { id: 'heart', emoji: '❤️', label: 'Heart', keywords: 'love favourite like' },\r\n { id: 'heart-blue', emoji: '💙', label: 'Blue heart', keywords: 'like support colour' },\r\n { id: 'heart-green', emoji: '💚', label: 'Green heart', keywords: 'like support colour' },\r\n { id: 'heart-orange', emoji: '🧡', label: 'Orange heart', keywords: 'like support colour' },\r\n { id: 'heart-purple', emoji: '💜', label: 'Purple heart', keywords: 'like support colour' },\r\n { id: 'raised', emoji: '🙌', label: 'Raised hands', keywords: 'celebrate praise yay' },\r\n { id: 'pray', emoji: '🙏', label: 'Pray', keywords: 'thanks please hope' },\r\n { id: 'muscle', emoji: '💪', label: 'Strong', keywords: 'flex effort power' },\r\n { id: 'wave', emoji: '👋', label: 'Wave', keywords: 'hello hi bye greeting' },\r\n { id: 'tada', emoji: '🎉', label: 'Celebration', keywords: 'party congrats confetti' },\r\n ],\r\n },\r\n {\r\n id: 'people',\r\n labelKey: 'common.label.emoji_category_people',\r\n label: 'People & roles',\r\n entries: [\r\n { id: 'person', emoji: '🧑', label: 'Person', keywords: 'individual someone', tonable: true },\r\n { id: 'assignee', emoji: '👤', label: 'Assignee', keywords: 'owner responsible user' },\r\n { id: 'team', emoji: '👥', label: 'Team', keywords: 'group people squad' },\r\n { id: 'hug-people', emoji: '🫂', label: 'Support', keywords: 'together help solidarity' },\r\n {\r\n id: 'thumbs-up',\r\n emoji: '👍',\r\n label: 'Thumbs up',\r\n keywords: 'approve agree yes ok',\r\n tonable: true,\r\n },\r\n {\r\n id: 'thumbs-down',\r\n emoji: '👎',\r\n label: 'Thumbs down',\r\n keywords: 'reject disagree no',\r\n tonable: true,\r\n },\r\n { id: 'ok-hand', emoji: '👌', label: 'OK', keywords: 'fine agreed accept', tonable: true },\r\n { id: 'victory', emoji: '✌️', label: 'Victory', keywords: 'peace win two', tonable: true },\r\n {\r\n id: 'point-right',\r\n emoji: '👉',\r\n label: 'Point',\r\n keywords: 'refer see attention',\r\n tonable: true,\r\n },\r\n {\r\n id: 'point-up',\r\n emoji: '☝️',\r\n label: 'Point up',\r\n keywords: 'above note attention first',\r\n tonable: true,\r\n },\r\n {\r\n id: 'raise-hand',\r\n emoji: '🙋',\r\n label: 'Volunteer',\r\n keywords: 'raise hand ask available',\r\n tonable: true,\r\n },\r\n { id: 'shrug', emoji: '🤷', label: 'Shrug', keywords: 'unknown unsure no idea', tonable: true },\r\n {\r\n id: 'writing',\r\n emoji: '✍️',\r\n label: 'Writing',\r\n keywords: 'author draft sign',\r\n tonable: true,\r\n },\r\n {\r\n id: 'clap',\r\n emoji: '👏',\r\n label: 'Clap',\r\n keywords: 'recognition praise kudos',\r\n tonable: true,\r\n },\r\n {\r\n id: 'heart-hands',\r\n emoji: '🫶',\r\n label: 'Appreciation',\r\n keywords: 'thanks grateful love',\r\n tonable: true,\r\n },\r\n { id: 'handshake', emoji: '🤝', label: 'Agreement', keywords: 'deal partner accord' },\r\n { id: 'smile', emoji: '🙂', label: 'Happy', keywords: 'good positive satisfied' },\r\n { id: 'neutral', emoji: '😐', label: 'Neutral', keywords: 'mixed unsure ok' },\r\n { id: 'sad', emoji: '🙁', label: 'Unhappy', keywords: 'bad negative dissatisfied' },\r\n { id: 'face-think', emoji: '🤔', label: 'Thinking', keywords: 'consider question review' },\r\n ],\r\n },\r\n {\r\n // Who a work item belongs to, by profession. Split out of `people` (which is about a person or\r\n // their gesture, not their job) — the two answer different questions on a board.\r\n id: 'roles',\r\n labelKey: 'common.label.emoji_category_roles',\r\n label: 'Roles & professions',\r\n entries: [\r\n { id: 'role-manager', emoji: '🧑‍💼', label: 'Manager', keywords: 'business owner lead', tonable: true },\r\n {\r\n id: 'role-technician',\r\n emoji: '🧑‍🔧',\r\n label: 'Technician',\r\n keywords: 'mechanic maintenance service',\r\n tonable: true,\r\n },\r\n {\r\n id: 'role-operator',\r\n emoji: '🧑‍🏭',\r\n label: 'Operator',\r\n keywords: 'factory production plant',\r\n tonable: true,\r\n },\r\n {\r\n id: 'role-field',\r\n emoji: '👷',\r\n label: 'Field worker',\r\n keywords: 'construction site crew',\r\n tonable: true,\r\n },\r\n {\r\n id: 'role-health',\r\n emoji: '🧑‍⚕️',\r\n label: 'Health worker',\r\n keywords: 'medical nurse doctor',\r\n tonable: true,\r\n },\r\n { id: 'role-legal', emoji: '🧑‍⚖️', label: 'Legal', keywords: 'judge counsel compliance', tonable: true },\r\n {\r\n id: 'role-scientist',\r\n emoji: '🧑‍🔬',\r\n label: 'Scientist',\r\n keywords: 'research lab analysis',\r\n tonable: true,\r\n },\r\n {\r\n id: 'role-teacher',\r\n emoji: '🧑‍🏫',\r\n label: 'Trainer',\r\n keywords: 'teacher instructor coach',\r\n tonable: true,\r\n },\r\n {\r\n id: 'role-student',\r\n emoji: '🧑‍🎓',\r\n label: 'Student',\r\n keywords: 'trainee learner graduate',\r\n tonable: true,\r\n },\r\n {\r\n id: 'role-inspector',\r\n emoji: '🕵️',\r\n label: 'Inspector',\r\n keywords: 'audit investigate review',\r\n tonable: true,\r\n },\r\n { id: 'role-pilot', emoji: '🧑‍✈️', label: 'Pilot', keywords: 'aviation crew flight', tonable: true },\r\n { id: 'role-farmer', emoji: '🧑‍🌾', label: 'Farmer', keywords: 'agriculture field grower', tonable: true },\r\n ],\r\n },\r\n {\r\n id: 'status',\r\n labelKey: 'common.label.emoji_category_status',\r\n label: 'Status',\r\n entries: [\r\n { id: 'check', emoji: '✅', label: 'Done', keywords: 'complete finished ok' },\r\n { id: 'check-mark', emoji: '✔️', label: 'Check', keywords: 'tick verified' },\r\n { id: 'cross', emoji: '❌', label: 'No', keywords: 'fail rejected wrong' },\r\n { id: 'no-entry', emoji: '⛔', label: 'Blocked', keywords: 'stop blocker impediment' },\r\n { id: 'hourglass', emoji: '⏳', label: 'In progress', keywords: 'wip running pending' },\r\n { id: 'pause', emoji: '⏸️', label: 'Paused', keywords: 'hold suspended' },\r\n { id: 'play', emoji: '▶️', label: 'Started', keywords: 'begin resume go' },\r\n { id: 'stop-square', emoji: '⏹️', label: 'Stopped', keywords: 'halted cancelled' },\r\n { id: 'snow', emoji: '❄️', label: 'Frozen', keywords: 'freeze on-hold icebox' },\r\n { id: 'flag-red', emoji: '🚩', label: 'Red flag', keywords: 'raise attention concern' },\r\n { id: 'warning', emoji: '⚠️', label: 'Warning', keywords: 'caution risk' },\r\n { id: 'exclaim', emoji: '❗', label: 'Important', keywords: 'attention urgent' },\r\n { id: 'question', emoji: '❓', label: 'Question', keywords: 'unclear ask query' },\r\n { id: 'star', emoji: '⭐', label: 'Star', keywords: 'favourite highlight' },\r\n { id: 'lock', emoji: '🔒', label: 'Locked', keywords: 'closed frozen restricted' },\r\n { id: 'unlock', emoji: '🔓', label: 'Unlocked', keywords: 'open editable' },\r\n { id: 'checkered', emoji: '🏁', label: 'Finish', keywords: 'done goal end' },\r\n { id: 'check-box', emoji: '☑️', label: 'Checked', keywords: 'ticked selected' },\r\n ],\r\n },\r\n {\r\n id: 'priority',\r\n labelKey: 'common.label.emoji_category_priority',\r\n label: 'Priority',\r\n entries: [\r\n { id: 'priority-1', emoji: '1️⃣', label: 'Priority 1', keywords: 'one first p1' },\r\n { id: 'priority-2', emoji: '2️⃣', label: 'Priority 2', keywords: 'two second p2' },\r\n { id: 'priority-3', emoji: '3️⃣', label: 'Priority 3', keywords: 'three third p3' },\r\n { id: 'priority-4', emoji: '4️⃣', label: 'Priority 4', keywords: 'four fourth p4' },\r\n { id: 'priority-5', emoji: '5️⃣', label: 'Priority 5', keywords: 'five fifth p5' },\r\n { id: 'priority-6', emoji: '6️⃣', label: 'Priority 6', keywords: 'six sixth p6' },\r\n { id: 'siren', emoji: '🚨', label: 'Critical', keywords: 'severity sev1 emergency alarm' },\r\n { id: 'fire', emoji: '🔥', label: 'Hot', keywords: 'urgent burning escalate' },\r\n { id: 'bolt', emoji: '⚡', label: 'Energy', keywords: 'fast urgent power quick' },\r\n { id: 'up-small', emoji: '🔼', label: 'Increase', keywords: 'raise escalate higher' },\r\n { id: 'down-small', emoji: '🔽', label: 'Decrease', keywords: 'lower deprioritise' },\r\n { id: 'hundred', emoji: '💯', label: '100', keywords: 'top full score complete' },\r\n ],\r\n },\r\n {\r\n // Measuring elapsed or remaining time. Split from `time` (which schedules a WHEN) because the\r\n // two are asked in different moments: \"how long did this take\" vs \"what date is this due\".\r\n id: 'timers',\r\n labelKey: 'common.label.emoji_category_timers',\r\n label: 'Timers',\r\n entries: [\r\n { id: 'clock', emoji: '⏰', label: 'Clock', keywords: 'alarm deadline due' },\r\n { id: 'stopwatch', emoji: '⏱️', label: 'Stopwatch', keywords: 'elapsed duration measure' },\r\n { id: 'timer', emoji: '⏲️', label: 'Timer', keywords: 'countdown timebox' },\r\n { id: 'watch', emoji: '⌚', label: 'Watch', keywords: 'time clock' },\r\n { id: 'hourglass-done', emoji: '⌛', label: 'Time up', keywords: 'expired overdue elapsed' },\r\n ],\r\n },\r\n {\r\n id: 'time',\r\n labelKey: 'common.label.emoji_category_time',\r\n label: 'Planning & time',\r\n entries: [\r\n { id: 'calendar', emoji: '📅', label: 'Date', keywords: 'day schedule when' },\r\n { id: 'spiral-cal', emoji: '🗓️', label: 'Calendar', keywords: 'planner schedule month' },\r\n { id: 'soon', emoji: '🔜', label: 'Upcoming', keywords: 'next soon planned' },\r\n ],\r\n },\r\n {\r\n id: 'communication',\r\n labelKey: 'common.label.emoji_category_communication',\r\n label: 'Communication',\r\n entries: [\r\n { id: 'quote', emoji: '💬', label: 'Comment', keywords: 'discuss chat feedback note' },\r\n { id: 'email', emoji: '📧', label: 'Email', keywords: 'mail message send' },\r\n { id: 'phone', emoji: '📞', label: 'Call', keywords: 'phone ring contact' },\r\n { id: 'megaphone', emoji: '📣', label: 'Announcement', keywords: 'broadcast notify shout' },\r\n { id: 'bell', emoji: '🔔', label: 'Reminder', keywords: 'notify alert ping' },\r\n { id: 'inbox', emoji: '📥', label: 'Inbox', keywords: 'received incoming' },\r\n { id: 'outbox', emoji: '📤', label: 'Sent', keywords: 'outgoing dispatched' },\r\n // 'Watching', not 'Watch': ⌚ already owns that label, and a label is both the tooltip and the\r\n // primary search term — two cells answering to the same name is ambiguous in either role.\r\n { id: 'eye', emoji: '👁️', label: 'Watching', keywords: 'observe review monitor watch' },\r\n ],\r\n },\r\n {\r\n id: 'documents',\r\n labelKey: 'common.label.emoji_category_documents',\r\n label: 'Documents & data',\r\n entries: [\r\n { id: 'doc-page', emoji: '📄', label: 'Document', keywords: 'file page paper' },\r\n { id: 'memo', emoji: '📝', label: 'Note', keywords: 'write memo draft' },\r\n { id: 'clipboard', emoji: '📋', label: 'Checklist', keywords: 'list tasks agenda' },\r\n { id: 'folder', emoji: '📁', label: 'Folder', keywords: 'directory group' },\r\n { id: 'clip', emoji: '📎', label: 'Attachment', keywords: 'attach file paperclip' },\r\n { id: 'link', emoji: '🔗', label: 'Link', keywords: 'url reference connect' },\r\n { id: 'bookmark', emoji: '🔖', label: 'Bookmark', keywords: 'save mark reference' },\r\n { id: 'chart-bar', emoji: '📊', label: 'Chart', keywords: 'data report metrics' },\r\n { id: 'chart-up', emoji: '📈', label: 'Growth', keywords: 'increase trend up' },\r\n { id: 'chart-down', emoji: '📉', label: 'Decline', keywords: 'decrease trend down' },\r\n { id: 'card-index', emoji: '🗂️', label: 'Index', keywords: 'categorise dividers' },\r\n { id: 'archive', emoji: '🗃️', label: 'Archive', keywords: 'store old records' },\r\n { id: 'books', emoji: '📚', label: 'Reference', keywords: 'library docs knowledge' },\r\n { id: 'magnifier', emoji: '🔍', label: 'Search', keywords: 'find review inspect' },\r\n { id: 'wastebasket', emoji: '🗑️', label: 'Discard', keywords: 'delete remove trash' },\r\n ],\r\n },\r\n {\r\n id: 'finance',\r\n labelKey: 'common.label.emoji_category_finance',\r\n label: 'Finance',\r\n entries: [\r\n { id: 'money', emoji: '💰', label: 'Budget', keywords: 'cost funds cash' },\r\n { id: 'banknote', emoji: '💵', label: 'Cash', keywords: 'money payment note' },\r\n { id: 'credit-card', emoji: '💳', label: 'Payment', keywords: 'card pay billing' },\r\n { id: 'receipt', emoji: '🧾', label: 'Invoice', keywords: 'bill receipt charge' },\r\n { id: 'bank', emoji: '🏦', label: 'Bank', keywords: 'account finance institution' },\r\n { id: 'abacus', emoji: '🧮', label: 'Calculation', keywords: 'compute maths estimate' },\r\n { id: 'trophy', emoji: '🏆', label: 'Trophy', keywords: 'win award achievement' },\r\n { id: 'medal', emoji: '🥇', label: 'Medal', keywords: 'first best rank' },\r\n ],\r\n },\r\n {\r\n id: 'tech',\r\n labelKey: 'common.label.emoji_category_tech',\r\n label: 'Tech & infrastructure',\r\n entries: [\r\n { id: 'gear', emoji: '⚙️', label: 'Settings', keywords: 'config options cog' },\r\n { id: 'tools', emoji: '🛠️', label: 'Tools', keywords: 'build maintain fix' },\r\n { id: 'wrench', emoji: '🔧', label: 'Fix', keywords: 'repair maintenance patch' },\r\n { id: 'bug', emoji: '🐛', label: 'Bug', keywords: 'defect issue error' },\r\n // Marks engineering ownership of a work item — the same question the rest of this category\r\n // answers (\"which technical thing is this about\"), which is why it sits here and not in\r\n // `roles`: `roles` is uniformly animated and 🧑‍💻 has no animated asset upstream.\r\n {\r\n id: 'role-dev',\r\n emoji: '🧑‍💻',\r\n label: 'Developer',\r\n keywords: 'engineer coder tech role',\r\n tonable: true,\r\n },\r\n { id: 'laptop', emoji: '💻', label: 'Computer', keywords: 'device desktop machine' },\r\n { id: 'mobile', emoji: '📱', label: 'Mobile', keywords: 'phone device app' },\r\n { id: 'database', emoji: '🗄️', label: 'Database', keywords: 'store data records' },\r\n { id: 'floppy', emoji: '💾', label: 'Save', keywords: 'store persist disk' },\r\n { id: 'cloud', emoji: '☁️', label: 'Cloud', keywords: 'hosting saas remote' },\r\n { id: 'globe', emoji: '🌐', label: 'Network', keywords: 'web internet online' },\r\n { id: 'plug', emoji: '🔌', label: 'Integration', keywords: 'connect api plugin' },\r\n { id: 'battery', emoji: '🔋', label: 'Capacity', keywords: 'power charge energy' },\r\n { id: 'shield', emoji: '🛡️', label: 'Security', keywords: 'protect defend safe' },\r\n { id: 'key', emoji: '🔑', label: 'Key', keywords: 'access secret credential' },\r\n { id: 'printer', emoji: '🖨️', label: 'Print', keywords: 'output paper' },\r\n ],\r\n },\r\n {\r\n id: 'process',\r\n labelKey: 'common.label.emoji_category_process',\r\n label: 'Process & workflow',\r\n entries: [\r\n { id: 'briefcase', emoji: '💼', label: 'Work', keywords: 'business case job task' },\r\n { id: 'idea', emoji: '💡', label: 'Idea', keywords: 'insight proposal suggestion' },\r\n { id: 'target', emoji: '🎯', label: 'Target', keywords: 'goal objective aim' },\r\n { id: 'rocket', emoji: '🚀', label: 'Launch', keywords: 'ship release go-live' },\r\n { id: 'refresh', emoji: '🔄', label: 'Refresh', keywords: 'cycle sync iterate loop' },\r\n { id: 'repeat-one', emoji: '🔂', label: 'Repeat', keywords: 'again rerun retry' },\r\n { id: 'shuffle', emoji: '🔀', label: 'Branch', keywords: 'split fork alternative' },\r\n { id: 'back', emoji: '↩️', label: 'Back', keywords: 'return undo revert' },\r\n { id: 'recycle', emoji: '♻️', label: 'Rework', keywords: 'reuse redo recycle' },\r\n { id: 'construction', emoji: '🚧', label: 'Work in progress', keywords: 'wip building' },\r\n { id: 'traffic-light', emoji: '🚦', label: 'Gate', keywords: 'approval checkpoint signal' },\r\n { id: 'scales', emoji: '⚖️', label: 'Decision', keywords: 'balance trade-off compare' },\r\n { id: 'puzzle', emoji: '🧩', label: 'Piece', keywords: 'component part dependency' },\r\n { id: 'test-tube', emoji: '🧪', label: 'Experiment', keywords: 'test trial pilot' },\r\n { id: 'microscope', emoji: '🔬', label: 'Analysis', keywords: 'research investigate study' },\r\n ],\r\n },\r\n {\r\n id: 'logistics',\r\n labelKey: 'common.label.emoji_category_logistics',\r\n label: 'Transport & logistics',\r\n entries: [\r\n { id: 'package', emoji: '📦', label: 'Package', keywords: 'parcel delivery box' },\r\n { id: 'truck', emoji: '🚚', label: 'Delivery', keywords: 'ship transport freight' },\r\n { id: 'ship', emoji: '🚢', label: 'Shipping', keywords: 'sea freight cargo' },\r\n { id: 'plane', emoji: '✈️', label: 'Travel', keywords: 'flight air trip' },\r\n { id: 'train', emoji: '🚆', label: 'Train', keywords: 'rail transport commute' },\r\n { id: 'car', emoji: '🚗', label: 'Car', keywords: 'drive vehicle road' },\r\n { id: 'fuel', emoji: '⛽', label: 'Fuel', keywords: 'energy refuel supply' },\r\n { id: 'cart', emoji: '🛒', label: 'Order', keywords: 'purchase basket procurement' },\r\n ],\r\n },\r\n {\r\n id: 'places',\r\n labelKey: 'common.label.emoji_category_places',\r\n label: 'Places & facilities',\r\n entries: [\r\n { id: 'location', emoji: '📍', label: 'Location', keywords: 'place where pin' },\r\n { id: 'map', emoji: '🗺️', label: 'Map', keywords: 'area region plan' },\r\n { id: 'compass', emoji: '🧭', label: 'Direction', keywords: 'navigate orient bearing' },\r\n { id: 'office', emoji: '🏢', label: 'Office', keywords: 'building workplace hq' },\r\n { id: 'factory', emoji: '🏭', label: 'Factory', keywords: 'plant production industrial' },\r\n { id: 'site', emoji: '🏗️', label: 'Site', keywords: 'construction build project' },\r\n { id: 'house', emoji: '🏠', label: 'Home', keywords: 'remote house base' },\r\n { id: 'school', emoji: '🏫', label: 'Training', keywords: 'school learning course' },\r\n { id: 'hospital', emoji: '🏥', label: 'Clinic', keywords: 'health medical hospital' },\r\n { id: 'store', emoji: '🏬', label: 'Store', keywords: 'retail branch outlet' },\r\n ],\r\n },\r\n {\r\n // Conditions a field/site work item is blocked or qualified by — weather is an operational fact\r\n // on construction, logistics and utilities boards, not decoration. `sun`, `drop` and `rainbow`\r\n // are ids the mind-maps palette already persisted; they are surfaced again here, unchanged.\r\n id: 'weather',\r\n labelKey: 'common.label.emoji_category_weather',\r\n label: 'Weather & conditions',\r\n entries: [\r\n { id: 'sun', emoji: '☀️', label: 'Sunny', keywords: 'clear fair weather' },\r\n { id: 'weather-partly', emoji: '⛅', label: 'Partly cloudy', keywords: 'cloud mixed weather' },\r\n { id: 'weather-rain', emoji: '🌧️', label: 'Rain', keywords: 'wet shower weather' },\r\n { id: 'weather-storm', emoji: '⛈️', label: 'Storm', keywords: 'thunder lightning severe' },\r\n { id: 'weather-snow', emoji: '🌨️', label: 'Snowfall', keywords: 'snow winter cold' },\r\n { id: 'weather-fog', emoji: '🌫️', label: 'Fog', keywords: 'mist visibility haze' },\r\n { id: 'weather-wind', emoji: '🌬️', label: 'Wind', keywords: 'gust breeze gale' },\r\n { id: 'weather-tornado', emoji: '🌪️', label: 'Severe weather', keywords: 'tornado storm hazard' },\r\n { id: 'drop', emoji: '💧', label: 'Water', keywords: 'liquid drop moisture' },\r\n { id: 'rainbow', emoji: '🌈', label: 'Rainbow', keywords: 'clear after colour' },\r\n ],\r\n },\r\n {\r\n id: 'symbols',\r\n labelKey: 'common.label.emoji_category_symbols',\r\n label: 'Symbols & arrows',\r\n entries: [\r\n { id: 'info', emoji: 'ℹ️', label: 'Info', keywords: 'information note detail' },\r\n { id: 'pin', emoji: '📌', label: 'Pin', keywords: 'stick important fix' },\r\n { id: 'sparkles', emoji: '✨', label: 'Sparkles', keywords: 'new shiny polish' },\r\n { id: 'star2', emoji: '🌟', label: 'Glowing', keywords: 'standout special highlight' },\r\n { id: 'seedling', emoji: '🌱', label: 'New', keywords: 'grow start fresh' },\r\n { id: 'plus', emoji: '➕', label: 'Add', keywords: 'plus more create' },\r\n { id: 'minus', emoji: '➖', label: 'Remove', keywords: 'minus less subtract' },\r\n { id: 'arrow-up', emoji: '⬆️', label: 'Up', keywords: 'north above increase' },\r\n { id: 'arrow-down', emoji: '⬇️', label: 'Down', keywords: 'south below decrease' },\r\n { id: 'arrow-left', emoji: '⬅️', label: 'Left', keywords: 'west previous back' },\r\n { id: 'arrow-right', emoji: '➡️', label: 'Right', keywords: 'east next forward' },\r\n { id: 'arrow-ne', emoji: '↗️', label: 'Rising', keywords: 'up-right improve trend' },\r\n { id: 'arrow-se', emoji: '↘️', label: 'Falling', keywords: 'down-right worsen trend' },\r\n ],\r\n },\r\n {\r\n id: 'dots',\r\n labelKey: 'common.label.emoji_category_dots',\r\n label: 'Colour coding',\r\n entries: [\r\n { id: 'dot-red', emoji: '🔴', label: 'Red', keywords: 'stop rag critical' },\r\n { id: 'dot-orange', emoji: '🟠', label: 'Orange', keywords: 'caution rag' },\r\n { id: 'dot-yellow', emoji: '🟡', label: 'Yellow', keywords: 'amber caution rag' },\r\n { id: 'dot-green', emoji: '🟢', label: 'Green', keywords: 'go healthy rag' },\r\n { id: 'dot-blue', emoji: '🔵', label: 'Blue', keywords: 'info rag' },\r\n { id: 'dot-purple', emoji: '🟣', label: 'Purple', keywords: 'category rag' },\r\n { id: 'dot-black', emoji: '⚫', label: 'Black', keywords: 'closed rag' },\r\n { id: 'dot-white', emoji: '⚪', label: 'White', keywords: 'empty none rag' },\r\n ],\r\n },\r\n];\r\n\r\n/**\r\n * Ids persisted by earlier catalogue revisions that the curated categories no longer surface.\r\n *\r\n * These exist for **resolution only**: an artifact saved when the palette carried them must keep\r\n * rendering exactly what its author saw. They are not offered for new selections, and this is not a\r\n * filter applied to the catalogue — the catalogue above is the allowlist, and this is the read-side\r\n * compatibility tail behind it. Never delete an entry from this map.\r\n */\r\nexport const LEGACY_COMPAT_EMOJI: Readonly<Record<string, string>> = {\r\n heart: '❤️',\r\n 'face-grin': '😀',\r\n 'face-joy': '😂',\r\n 'face-cool': '😎',\r\n 'face-love': '😍',\r\n 'face-cry': '😢',\r\n 'face-angry': '😡',\r\n 'face-sleep': '😴',\r\n 'face-party': '🥳',\r\n raised: '🙌',\r\n pray: '🙏',\r\n muscle: '💪',\r\n wave: '👋',\r\n rainbow: '🌈',\r\n clover: '🍀',\r\n blossom: '🌸',\r\n drop: '💧',\r\n leaf: '🌿',\r\n sun: '☀️',\r\n moon: '🌙',\r\n};\r\n","/**\r\n * Shared emoji / marker catalogue backing the {@link FlyEmojiPickerComponent}.\r\n *\r\n * ## What this is\r\n * A hand-picked **allowlist of work-functional emoji for professional tooling** — mind maps,\r\n * project boards, documents, tickets. It is NOT a mirror of Unicode: the catalogue is defined by\r\n * what it contains, and everything in it should read as something a reasonable person would use to\r\n * annotate a work artifact.\r\n *\r\n * This file is the **import surface and the behaviour**; the data itself lives in\r\n * `emoji-catalog.data.ts` and the shapes in `emoji-catalog.types.ts` (split for file size only —\r\n * everything is re-exported here, so no consumer import changes).\r\n *\r\n * ## Grouping rule\r\n * Categories group by **function, not depiction** — a reader should be able to guess an entry's\r\n * category from what it *does* (\"blocked\" → status; \"invoice\" → finance), not from the picture.\r\n * Keep it that way when adding entries. The animation coverage rule (a category animates only if\r\n * every entry in it has an asset) is arranged *around* this rule, never against it — see the header\r\n * of `emoji-catalog.data.ts`.\r\n *\r\n * ## The id contract (READ BEFORE EDITING)\r\n * Hosts persist the **id**, never the emoji — mind-map nodes carry marker ids inside live Yjs\r\n * documents and inside immutable version snapshots. {@link flyEmojiFor} resolves id → emoji at\r\n * render time. Therefore:\r\n *\r\n * - **Ids are a frozen contract.** Adding ids is free. Renaming or dropping an id silently blanks\r\n * that marker on every already-saved artifact — a data-loss bug, not a cosmetic one. Moving an\r\n * id between categories is free; the id, not its category, is what was persisted.\r\n * - An id resolves through {@link FLY_EMOJI_BY_ID}, which unions the categories with\r\n * {@link LEGACY_COMPAT_EMOJI} (ids persisted by earlier catalogue revisions that the curated\r\n * categories no longer surface). Resolution is a superset of what the picker offers, on purpose:\r\n * old data keeps rendering without forcing old choices back into the picker.\r\n * - `emoji-catalog.spec.ts` pins every legacy id → emoji pair as a fixture AND pins the full id\r\n * census of the previous revision, so an edit here that drifts the contract fails the build\r\n * rather than the customer's map.\r\n *\r\n * ## Skin tones\r\n * Only the neutral human/role entries that genuinely accept a Fitzpatrick modifier carry\r\n * `tonable: true`. The tone is applied at **render** time by {@link flyEmojiFor}; the id stays\r\n * tone-free so switching tone can never orphan a stored id. Hosts persist the tone separately (a\r\n * single user-level preference), never baked into the marker id.\r\n */\r\n\r\nimport { FLY_EMOJI_CATEGORIES, LEGACY_COMPAT_EMOJI } from './emoji-catalog.data';\r\nimport type { FlyEmojiCategory, FlySkinTone } from './emoji-catalog.types';\r\n\r\nexport { FLY_EMOJI_CATEGORIES, LEGACY_COMPAT_EMOJI };\r\nexport type { FlyEmojiCategory, FlyEmojiEntry, FlySkinTone } from './emoji-catalog.types';\r\n\r\n/** Tone options in display order — drives the picker's tone selector. */\r\nexport const FLY_SKIN_TONES: readonly FlySkinTone[] = [\r\n 'default',\r\n 'light',\r\n 'medium-light',\r\n 'medium',\r\n 'medium-dark',\r\n 'dark',\r\n];\r\n\r\n/** Fitzpatrick modifier codepoints (U+1F3FB..U+1F3FF). `default` carries no modifier. */\r\nconst TONE_MODIFIER: Readonly<Record<FlySkinTone, string>> = {\r\n default: '',\r\n light: '\\u{1F3FB}',\r\n 'medium-light': '\\u{1F3FC}',\r\n medium: '\\u{1F3FD}',\r\n 'medium-dark': '\\u{1F3FE}',\r\n dark: '\\u{1F3FF}',\r\n};\r\n\r\n/** i18n key for a tone's label in the tone selector. */\r\nexport const flySkinToneLabelKey = (tone: FlySkinTone): string =>\r\n `common.label.skin_tone_${tone.replace(/-/g, '_')}`;\r\n\r\n/** Category ids the picker shows when a host passes no `categories` — the whole catalogue, in order. */\r\nexport const FLY_EMOJI_DEFAULT_CATEGORIES: readonly string[] = FLY_EMOJI_CATEGORIES.map((c) => c.id);\r\n\r\n/** How many entries a category shows before the \"even more\" affordance, unless a host overrides it. */\r\nexport const FLY_EMOJI_PREVIEW_COUNT = 24;\r\n\r\n/** Category lookup by id — `undefined` for an unknown id, so a host's typo degrades to \"skipped\". */\r\nexport const FLY_EMOJI_CATEGORY_BY_ID: ReadonlyMap<string, FlyEmojiCategory> = new Map(\r\n FLY_EMOJI_CATEGORIES.map((c) => [c.id, c]),\r\n);\r\n\r\n/**\r\n * Union id → base-emoji lookup: every catalogue entry plus the {@link LEGACY_COMPAT_EMOJI} tail.\r\n * Built once at module load. The curated catalogue wins on a duplicate id.\r\n */\r\nexport const FLY_EMOJI_BY_ID: ReadonlyMap<string, string> = new Map([\r\n ...Object.entries(LEGACY_COMPAT_EMOJI),\r\n ...FLY_EMOJI_CATEGORIES.flatMap((c) => c.entries.map((e) => [e.id, e.emoji] as const)),\r\n]);\r\n\r\n/** Ids whose base emoji accepts a skin-tone modifier. */\r\nconst TONABLE_IDS: ReadonlySet<string> = new Set(\r\n FLY_EMOJI_CATEGORIES.flatMap((c) => c.entries.filter((e) => e.tonable).map((e) => e.id)),\r\n);\r\n\r\n/** Whether {@link flyEmojiFor} will honour a tone for this id. */\r\nexport const flyEmojiIsTonable = (id: string): boolean => TONABLE_IDS.has(id);\r\n\r\n/** The Fitzpatrick modifiers, as a set — used to strip a pre-existing tone before applying a new one. */\r\nconst TONE_MODIFIER_SET: ReadonlySet<string> = new Set(\r\n Object.values(TONE_MODIFIER).filter((m) => m !== ''),\r\n);\r\n\r\n/** VARIATION SELECTOR-16 — an explicit emoji-presentation hint that a tone modifier makes redundant. */\r\nconst VS16 = '️';\r\n\r\n/**\r\n * Apply a Fitzpatrick modifier to a base emoji.\r\n *\r\n * The modifier attaches to the **first** codepoint, so ZWJ sequences tone correctly\r\n * (`🧑‍💻` + medium → `🧑🏽‍💻`, not `🧑‍💻🏽`). Any existing modifier is replaced, and VS16 is dropped\r\n * because the modifier already forces emoji presentation (`✍️` + medium → `✍🏽`).\r\n *\r\n * Returns the input unchanged for `default` / an unknown tone — never throws.\r\n */\r\nexport function applySkinTone(emoji: string, tone: FlySkinTone): string {\r\n const modifier = TONE_MODIFIER[tone];\r\n if (!modifier) return emoji;\r\n const codepoints = [...emoji];\r\n const [base, ...rest] = codepoints;\r\n if (!base) return emoji;\r\n const tail = rest.filter((cp) => !TONE_MODIFIER_SET.has(cp) && cp !== VS16);\r\n return base + modifier + tail.join('');\r\n}\r\n\r\n/**\r\n * Resolve a persisted id to the emoji to render — THE read path for every host.\r\n *\r\n * `tone` is applied only to ids flagged `tonable`, so passing a tone globally is safe: a non-human\r\n * entry renders unchanged. An unknown id falls back to `•` (matching the mind-maps palette's prior\r\n * behaviour) rather than rendering an empty node.\r\n */\r\nexport function flyEmojiFor(id: string, tone: FlySkinTone = 'default'): string {\r\n const base = FLY_EMOJI_BY_ID.get(id);\r\n if (base === undefined) return '•';\r\n return TONABLE_IDS.has(id) ? applySkinTone(base, tone) : base;\r\n}\r\n","import { InjectionToken, makeEnvironmentProviders, type EnvironmentProviders } from '@angular/core';\r\n\r\n/**\r\n * The animated-emoji pack contract — the DS half of\r\n * `@flyos/design-system-emoji-pack` (`.workflow/plans/emoji-pack-contract.md`).\r\n *\r\n * The assets are an OPTIONAL, separately-installed package that each consumer serves from its\r\n * **own origin**: no cross-origin fetch, no CSP loosening, no availability coupling, and no DS\r\n * bloat for consumers that never turn animation on. All the DS holds is this token.\r\n *\r\n * Nothing here is touched while every surface is `emojiAnimation=\"off\"` — the default — so\r\n * non-adopters and unit tests stay inert.\r\n */\r\n\r\n/** One emoji's assets. Paths are relative to {@link FlyEmojiPack.baseUrl}. */\r\nexport interface FlyEmojiPackEntry {\r\n /** Animated WebP, loop count 1 encoded in the file (D4). */\r\n readonly anim: string;\r\n /** Frame-0 still — identical framing to `anim`, so the swap never jumps (D5). */\r\n readonly still: string;\r\n /** One full play of `anim`, in milliseconds; drives the swap-back timer. */\r\n readonly durationMs: number;\r\n}\r\n\r\nexport interface FlyEmojiPackManifest {\r\n /** Bumped on every asset refresh; appended as the `?v=` cache-buster (filenames aren't hashed). */\r\n readonly version: string;\r\n /** The `emoji-catalog.ts` revision these assets were matched against — skew is warn-and-degrade. */\r\n readonly catalogVersion: string;\r\n /** Keyed on {@link FlyEmojiEntry.id}. An absent id is a coverage gap: static + one warn (D15). */\r\n readonly entries: Readonly<Record<string, FlyEmojiPackEntry>>;\r\n}\r\n\r\nexport interface FlyEmojiPack {\r\n /** Where the consumer serves the pack's `assets/` from, e.g. `/emoji`. No trailing slash needed. */\r\n readonly baseUrl: string;\r\n readonly manifest: FlyEmojiPackManifest;\r\n}\r\n\r\n/**\r\n * Resolved `{ optional: true }` everywhere in the DS. Absent unless the consumer called\r\n * {@link provideFlyEmojiPack} — which is exactly how \"the pack isn't installed\" is detected.\r\n */\r\nexport const FLY_EMOJI_PACK = new InjectionToken<FlyEmojiPack>('FLY_EMOJI_PACK');\r\n\r\n/**\r\n * Register an installed emoji pack.\r\n *\r\n * ```ts\r\n * import { flyEmojiPackManifest } from '@flyos/design-system-emoji-pack';\r\n * providers: [provideFlyEmojiPack('/emoji', flyEmojiPackManifest)]\r\n * ```\r\n */\r\nexport function provideFlyEmojiPack(\r\n baseUrl: string,\r\n manifest: FlyEmojiPackManifest,\r\n): EnvironmentProviders {\r\n return makeEnvironmentProviders([\r\n { provide: FLY_EMOJI_PACK, useValue: { baseUrl, manifest } satisfies FlyEmojiPack },\r\n ]);\r\n}\r\n\r\n/**\r\n * Absolute URL for one of an entry's assets, cache-busted by the manifest version.\r\n *\r\n * The `?v=` is not optional: asset filenames are `<id>.webp` (never content-hashed) and each app\r\n * serves `/emoji/` immutable, so a pack refresh would otherwise be invisible to every warm browser.\r\n */\r\nexport function flyEmojiPackUrl(pack: FlyEmojiPack, path: string): string {\r\n const base = pack.baseUrl.endsWith('/') ? pack.baseUrl.slice(0, -1) : pack.baseUrl;\r\n return `${base}/${path}?v=${encodeURIComponent(pack.manifest.version)}`;\r\n}\r\n\r\n/**\r\n * The error thrown when a surface asks for animation and the pack isn't there — the ONE hard\r\n * failure in this feature (D15). Coverage gaps degrade silently; a developer wiring mistake must not.\r\n */\r\nexport const FLY_EMOJI_PACK_MISSING_MESSAGE =\r\n 'emojiAnimation requires @flyos/design-system-emoji-pack — install it (pinned exactly), ' +\r\n 'add its assets to your build, and call provideFlyEmojiPack(baseUrl, manifest) in your app config. ' +\r\n 'Use emojiAnimation=\"off\" if you do not want animated emoji.';\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n afterNextRender,\r\n computed,\r\n inject,\r\n input,\r\n signal,\r\n} from '@angular/core';\r\nimport { flyEmojiFor } from '../emoji-picker/emoji-catalog';\r\nimport { FLY_EMOJI_PACK, flyEmojiPackUrl } from '../emoji-picker/emoji-pack';\r\n\r\n/** Ids already warned about — one warning per id per page, not one per rendered cell (D15). */\r\nconst WARNED_IDS = new Set<string>();\r\n\r\n/** Slack after `durationMs` before swapping back: covers decode + the last frame's own dwell. */\r\nconst SWAP_BACK_GRACE_MS = 120;\r\n\r\n/**\r\n * `fly-animated-emoji` — one catalogue emoji, animated once on demand.\r\n *\r\n * Idle always paints the **still** (frame 0 of the animated file, so the swap never jumps);\r\n * {@link play} swaps the `src` to the animated file, which plays its single encoded loop, and the\r\n * still comes back after `durationMs` + grace. Used by picker cells, sticker cells and message\r\n * rendering alike, so \"play once\" means the same thing everywhere.\r\n *\r\n * ## Degrades, never breaks\r\n * No pack registered, or an id the pack doesn't cover, ⇒ the native glyph from `flyEmojiFor(id)`,\r\n * plus (for a covered-pack id miss) exactly one `console.warn`. A coverage gap or a\r\n * catalog↔pack version skew must never take a screen down; the hard error for a missing pack is\r\n * raised by the *host* surface that asked for animation, not here.\r\n *\r\n * ## Reduced motion\r\n * `prefers-reduced-motion: reduce` ⇒ the swap NEVER happens — a hard rule, not a preference.\r\n * The still still renders, so nothing disappears.\r\n */\r\n@Component({\r\n selector: 'fly-animated-emoji',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '(pointerenter)': 'onPointerEnter()',\r\n },\r\n template: `\r\n @if (src(); as url) {\r\n <img class=\"fly-animated-emoji__img\" [src]=\"url\" [width]=\"size()\" [height]=\"size()\" alt=\"\" aria-hidden=\"true\" draggable=\"false\" />\r\n } @else {\r\n <span class=\"fly-animated-emoji__glyph\" aria-hidden=\"true\">{{ glyph() }}</span>\r\n }\r\n `,\r\n styles: `\r\n :host {\r\n display: inline-flex;\r\n align-items: center;\r\n justify-content: center;\r\n line-height: 1;\r\n }\r\n .fly-animated-emoji__img {\r\n display: block;\r\n object-fit: contain;\r\n }\r\n .fly-animated-emoji__glyph {\r\n display: block;\r\n font-size: inherit;\r\n }\r\n `,\r\n})\r\nexport class FlyAnimatedEmojiComponent {\r\n private readonly pack = inject(FLY_EMOJI_PACK, { optional: true });\r\n private readonly host = inject(ElementRef<HTMLElement>);\r\n private readonly destroyRef = inject(DestroyRef);\r\n\r\n /** Catalogue entry id — the same frozen id hosts persist. */\r\n readonly id = input.required<string>();\r\n\r\n /** Rendered edge length in px. Picker cells ~20; sticker cells ~64; jumbomoji ~96. */\r\n readonly size = input<number>(20);\r\n\r\n /** Play once, unprompted, the first time this element scrolls into view. */\r\n readonly autoplayOnFirstVisible = input<boolean>(false);\r\n\r\n /**\r\n * Replay on hover/tap. `autoplayOnFirstVisible` only fires ONCE per element (D12: a live\r\n * arrival animates, then rests as a still forever). That leaves a reader looking at history — or\r\n * at a reaction they just added — with motion they can never see again. Opting in here makes the\r\n * emoji replay on every `pointerenter`, the always-available \"show me the animation\" affordance\r\n * every chat app has (and `play()` already no-ops under reduced-motion and while mid-play).\r\n */\r\n readonly playOnHover = input<boolean>(false);\r\n\r\n /** True only while the animated file is the painted `src`. */\r\n private readonly playing = signal(false);\r\n\r\n private timer: ReturnType<typeof setTimeout> | null = null;\r\n private observer: IntersectionObserver | null = null;\r\n private autoplayed = false;\r\n\r\n /** The pack entry for this id, or `null` for \"no pack\" / \"not covered\". Warns once on a miss. */\r\n readonly entry = computed(() => {\r\n const pack = this.pack;\r\n if (!pack) return null;\r\n const hit = pack.manifest.entries[this.id()] ?? null;\r\n if (!hit) this.warnOnce(this.id());\r\n return hit;\r\n });\r\n\r\n /** The image to paint, or `null` when we fall back to the native glyph. */\r\n readonly src = computed<string | null>(() => {\r\n const entry = this.entry();\r\n if (!entry || !this.pack) return null;\r\n return flyEmojiPackUrl(this.pack, this.playing() ? entry.anim : entry.still);\r\n });\r\n\r\n /** Fallback rendering — the plain Unicode glyph, exactly what the picker paints when `off`. */\r\n readonly glyph = computed(() => flyEmojiFor(this.id()));\r\n\r\n constructor() {\r\n afterNextRender(() => this.observeIfAutoplay());\r\n this.destroyRef.onDestroy(() => {\r\n this.clearTimer();\r\n this.observer?.disconnect();\r\n this.observer = null;\r\n });\r\n }\r\n\r\n /**\r\n * Swap in the animated file for one loop. Idempotent while already playing (a re-hover during\r\n * playback does not stack timers); a fresh call after it settles replays.\r\n */\r\n play(): void {\r\n const entry = this.entry();\r\n if (!entry || this.playing() || prefersReducedMotion()) return;\r\n this.playing.set(true);\r\n this.clearTimer();\r\n this.timer = setTimeout(() => {\r\n this.timer = null;\r\n this.playing.set(false);\r\n }, Math.max(0, entry.durationMs) + SWAP_BACK_GRACE_MS);\r\n }\r\n\r\n /** Hover/tap replay — inert unless the host opted in via {@link playOnHover}. */\r\n protected onPointerEnter(): void {\r\n if (this.playOnHover()) this.play();\r\n }\r\n\r\n private observeIfAutoplay(): void {\r\n if (!this.autoplayOnFirstVisible() || prefersReducedMotion()) return;\r\n if (typeof IntersectionObserver === 'undefined') return;\r\n this.observer = new IntersectionObserver((records) => {\r\n if (this.autoplayed || !records.some((r) => r.isIntersecting)) return;\r\n this.autoplayed = true;\r\n this.observer?.disconnect();\r\n this.observer = null;\r\n this.play();\r\n });\r\n this.observer.observe(this.host.nativeElement);\r\n }\r\n\r\n private clearTimer(): void {\r\n if (this.timer !== null) clearTimeout(this.timer);\r\n this.timer = null;\r\n }\r\n\r\n private warnOnce(id: string): void {\r\n if (WARNED_IDS.has(id)) return;\r\n WARNED_IDS.add(id);\r\n console.warn(\r\n `[fly-animated-emoji] emoji \"${id}\" is not covered by the installed emoji pack — ` +\r\n 'rendering the native glyph. Refresh the pack or accept the gap.',\r\n );\r\n }\r\n}\r\n\r\n/** Guarded `matchMedia` — jsdom and SSR both hand us environments without it. */\r\nfunction prefersReducedMotion(): boolean {\r\n if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;\r\n return window.matchMedia('(prefers-reduced-motion: reduce)').matches;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n afterNextRender,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { I18nService } from '../../services/i18n.service';\r\nimport { FlyClickOutsideDirective } from '../../directives/fly-click-outside.directive';\r\nimport { FlyTooltipDirective } from '../../directives/fly-tooltip.directive';\r\nimport { FlyAnimatedEmojiComponent } from '../animated-emoji/animated-emoji.component';\r\nimport { FLY_EMOJI_PACK, FLY_EMOJI_PACK_MISSING_MESSAGE } from './emoji-pack';\r\nimport {\r\n FLY_EMOJI_CATEGORY_BY_ID,\r\n FLY_EMOJI_DEFAULT_CATEGORIES,\r\n FLY_EMOJI_PREVIEW_COUNT,\r\n FLY_SKIN_TONES,\r\n applySkinTone,\r\n flySkinToneLabelKey,\r\n type FlyEmojiCategory,\r\n type FlyEmojiEntry,\r\n type FlySkinTone,\r\n} from './emoji-catalog';\r\n\r\n/** A catalogue entry paired with the glyph to actually paint (tone already applied). */\r\nexport interface FlyEmojiCell {\r\n readonly entry: FlyEmojiEntry;\r\n /** Tone-resolved glyph — what the button renders. */\r\n readonly glyph: string;\r\n readonly selected: boolean;\r\n}\r\n\r\n/** A labelled run of cells — one category's worth, as painted in the single scrolling list. */\r\nexport interface FlyEmojiSection {\r\n readonly id: string;\r\n /** i18n key for the separator heading. */\r\n readonly labelKey: string;\r\n /** English fallback, so a bare standalone consumer still reads sensibly. */\r\n readonly label: string;\r\n readonly cells: FlyEmojiCell[];\r\n /**\r\n * Whether this run paints animated cells. All-or-nothing per category (see\r\n * {@link FlyEmojiPickerComponent.sections}) — a half-animated grid reads as broken art, not as\r\n * a coverage report.\r\n */\r\n readonly animated: boolean;\r\n}\r\n\r\n/** Which tab the `'stickers'` mode is showing. `'emoji'` is the grid you get in every other mode. */\r\nexport type FlyEmojiPickerTab = 'emoji' | 'stickers';\r\n\r\n/**\r\n * Rendering density. See {@link FlyEmojiPickerComponent.size} — `'large'` is the historical\r\n * (and default) rendering, so adopting the input changes nothing until a host asks for less.\r\n */\r\nexport type FlyEmojiPickerSize = 'small' | 'medium' | 'large';\r\n\r\n/** Hover-to-play settle time. Long enough that dragging the pointer across a row plays nothing. */\r\nconst HOVER_PLAY_DEBOUNCE_MS = 120;\r\n\r\n/**\r\n * `fly-emoji-picker` — the ONE emoji / marker picker for FlyOS apps.\r\n *\r\n * A filterable, section-labelled grid over the curated work-emoji catalogue\r\n * (see {@link ./emoji-catalog}). Presentational + reactive by design: it renders\r\n * whatever `selectedIds` says and emits intent — **the host owns persistence**, so\r\n * the highlight reflects a concurrent peer's write (e.g. a Yjs update) exactly like\r\n * a local click.\r\n *\r\n * ```html\r\n * <fly-emoji-picker\r\n * [selectedIds]=\"node().markers\"\r\n * [categories]=\"['status', 'priority', 'people']\"\r\n * defaultCategory=\"status\"\r\n * [skinTones]=\"true\"\r\n * [skinTone]=\"userTone()\"\r\n * (toggled)=\"toggleMarker($event)\"\r\n * (skinToneChange)=\"saveTone($event)\" />\r\n * ```\r\n *\r\n * ## Ids, not emoji\r\n * Every output carries a catalogue **id**. Hosts persist the id and render it back through\r\n * `flyEmojiFor(id, tone)` — never store the glyph, and never store a toned glyph.\r\n *\r\n * ## Skin tones\r\n * The tone is a **view** concern: it never enters an emitted id, so a host that persists\r\n * `skinToneChange` as a single user preference can change tone freely without orphaning stored\r\n * markers. Only entries flagged `tonable` respond to it.\r\n *\r\n * Self-sufficient on i18n via the DS baseline locales, so it renders real labels even in a\r\n * standalone remote that never called `setShellTranslations()`.\r\n */\r\n@Component({\r\n selector: 'fly-emoji-picker',\r\n standalone: true,\r\n imports: [TranslatePipe, FlyClickOutsideDirective, FlyTooltipDirective, FlyAnimatedEmojiComponent],\r\n templateUrl: './emoji-picker.component.html',\r\n styleUrls: ['./emoji-picker.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n // Density is a host CLASS, not a template conditional: every size-dependent number is a CSS\r\n // custom property declared once per class (see the `.scss`), so the template stays identical\r\n // at every size and a consumer can still override a single property if it needs to.\r\n '[class.fly-emoji-picker--small]': \"size() === 'small'\",\r\n '[class.fly-emoji-picker--medium]': \"size() === 'medium'\",\r\n '[class.fly-emoji-picker--large]': \"size() === 'large'\",\r\n },\r\n})\r\nexport class FlyEmojiPickerComponent {\r\n private readonly i18n = inject(I18nService);\r\n private readonly pack = inject(FLY_EMOJI_PACK, { optional: true });\r\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n /** The search box, when the emoji panel is the one on screen (absent on the stickers tab). */\r\n private readonly searchRef = viewChild<ElementRef<HTMLInputElement>>('searchRef');\r\n\r\n /**\r\n * Rendering density.\r\n *\r\n * `'large'` (the default) is today's picker to the pixel — the `--fly-emoji-*` custom properties\r\n * are seeded on `:host` with exactly the values that used to be hardcoded, so an existing host\r\n * that never sets this input renders byte-for-byte as before.\r\n *\r\n * - `'medium'` — a moderately tighter grid for a panel that has to share its frame.\r\n * - `'small'` — the compact inline reaction strip (a Teams-style hover row): smaller cells, a\r\n * slimmer search affordance, and **no category headings**. That last one is deliberate: at\r\n * this density a sticky uppercase group label costs a whole emoji row's worth of height for\r\n * information a one-glance reaction strip does not need. Search and scrolling still work at\r\n * every size — the strip stays a real picker, just a quiet one.\r\n */\r\n readonly size = input<FlyEmojiPickerSize>('large');\r\n\r\n /** `multi` toggles ids in/out; `single` replaces the selection with the tapped id. */\r\n readonly selectionMode = input<'single' | 'multi'>('multi');\r\n\r\n /** The currently-applied ids — drives the active highlight. The host owns the write. */\r\n readonly selectedIds = input<readonly string[]>([]);\r\n\r\n /** Category ids to show, in order. `null` ⇒ the full default catalogue. Unknown ids are skipped. */\r\n readonly categories = input<readonly string[] | null>(null);\r\n\r\n /** Category to show FIRST. `null` (or an id that isn't shown) ⇒ catalogue order. */\r\n readonly defaultCategory = input<string | null>(null);\r\n\r\n /** Show the Fitzpatrick tone selector (only entries flagged `tonable` respond to it). */\r\n readonly skinTones = input<boolean>(false);\r\n\r\n /** Host-persisted tone. The picker's own selector overrides it for the session. */\r\n readonly skinTone = input<FlySkinTone>('default');\r\n\r\n /** Show the \"even more\" affordance that reveals a category beyond {@link previewCount}. */\r\n readonly showMore = input<boolean>(true);\r\n\r\n /** Entries shown per category before \"even more\". Ignored while filtering. */\r\n readonly previewCount = input<number>(FLY_EMOJI_PREVIEW_COUNT);\r\n\r\n /**\r\n * Animated-emoji behaviour. `'off'` (the default) is today's picker **byte-for-byte** — it never\r\n * touches the pack token, so non-adopters and their unit tests are unaffected.\r\n *\r\n * - `'replace'` — covered cells render as animated emoji, still while idle, playing once on hover.\r\n * - `'stickers'` — the emoji grid stays exactly as `'off'`, and a second tab offers the covered\r\n * set as large sticker cells emitting {@link stickerPicked}.\r\n *\r\n * Anything other than `'off'` REQUIRES `@flyos/design-system-emoji-pack` +\r\n * `provideFlyEmojiPack()`; without it the picker throws on first render, on purpose.\r\n */\r\n readonly emojiAnimation = input<'off' | 'replace' | 'stickers'>('off');\r\n\r\n /** A sticker cell was tapped — carries the catalogue id, exactly like {@link toggled}. */\r\n readonly stickerPicked = output<string>();\r\n\r\n /** An emoji was tapped — carries its catalogue id (never the glyph, never a tone). */\r\n readonly toggled = output<string>();\r\n\r\n /** The selection the tap implies: toggled in `multi`, replaced in `single`. Host may ignore it. */\r\n readonly selectionChange = output<readonly string[]>();\r\n\r\n /** The user picked a tone — persist it as a user-level preference, not per marker. */\r\n readonly skinToneChange = output<FlySkinTone>();\r\n\r\n /**\r\n * Whether a pointer press outside the picker emits {@link dismissed}. On by default: a picker is\r\n * a transient surface, and a host that renders it unconditionally simply never binds the output.\r\n */\r\n readonly dismissOnOutsidePress = input<boolean>(true);\r\n\r\n /**\r\n * A press landed outside the picker — the host should close whatever is showing it.\r\n *\r\n * The picker does NOT close itself, because it has no open state to close: hosts mount it behind\r\n * their own `@if`. This is the same host-owns-the-write contract as {@link toggled}.\r\n *\r\n * **Host wiring matters here.** `flyClickOutside` is designed to sit on a wrapper containing BOTH\r\n * the trigger and the panel, and the picker can only be the panel — it does not contain the\r\n * button that opened it. So a host that binds this must put the picker and its trigger inside one\r\n * wrapper (and let the wrapper own dismissal), or ignore a dismissal whose press landed on its\r\n * own trigger. Otherwise the trigger's press dismisses the picker while the trigger's click\r\n * re-opens it, and the picker appears not to close at all.\r\n *\r\n * The opening gesture itself is safe without any of that: the directive's document listener does\r\n * not exist until the picker is created, which is *after* the trigger's `pointerdown`, so the\r\n * press that opens the picker can never be the press that dismisses it.\r\n */\r\n readonly dismissed = output<void>();\r\n\r\n constructor() {\r\n // Focus the search box once, on the render that first paints it. A picker exists to be typed\r\n // into: the catalogue is hundreds of glyphs deep, so landing anywhere else costs a Tab before\r\n // the affordance that actually finds anything.\r\n //\r\n // `afterNextRender` (not `setTimeout`, not `requestAnimationFrame`) is the hook: it runs after\r\n // the DOM is written and only in a browser, so it never fires during SSR/unit prerender — and\r\n // unlike rAF it is not starved when the picker opens in a background tab, where rAF simply\r\n // never fires and the box would silently stay unfocused until the tab is revisited.\r\n afterNextRender(() => this.focusSearch());\r\n }\r\n\r\n /**\r\n * Focus + select the search box, if it is genuinely on screen.\r\n *\r\n * The visibility test is the important half. The picker may be MOUNTED but hidden — inside a\r\n * collapsed panel, a `display: none` tab, an off-screen drawer that pre-renders its body — and\r\n * stealing focus into an invisible input strands the caret nowhere a user can see it, which is\r\n * both a WCAG 2.4.7 problem and a keyboard trap. `checkVisibility()` is the one API that answers\r\n * the whole question (`display: none` anywhere up the chain, `visibility`, `content-visibility`)\r\n * instead of the `offsetParent`/client-rect proxies that each miss a case; where a UA (or jsdom)\r\n * lacks it we settle for \"is it in the document at all\", which is the safe direction — a wrongly\r\n * SKIPPED focus is a minor annoyance, a wrongly STOLEN one is a trap.\r\n *\r\n * The gesture that opened the picker is deliberately irrelevant: keyboard- and mouse-opened\r\n * pickers both want the search box, because that is where typing should land either way.\r\n * `preventScroll` keeps focusing from yanking a surrounding scroller — no layout jank on open.\r\n */\r\n private focusSearch(): void {\r\n const el = this.searchRef()?.nativeElement;\r\n if (!el || !el.isConnected) return;\r\n if (typeof el.checkVisibility === 'function' && !el.checkVisibility()) return;\r\n el.focus({ preventScroll: true });\r\n // Select any pre-existing text so typing REPLACES a stale query rather than appending to it.\r\n el.select();\r\n }\r\n\r\n /** Free-text filter, applied across every visible category. */\r\n readonly query = signal('');\r\n\r\n /** Whether the list is expanded past {@link previewCount}. Reset when a query clears it. */\r\n private readonly expanded = signal(false);\r\n\r\n /** Session tone override; `null` ⇒ defer to the `skinTone` input. */\r\n private readonly toneOverride = signal<FlySkinTone | null>(null);\r\n\r\n /** Whether the skin-tone dropdown panel is open. The trigger itself always shows the\r\n * {@link effectiveTone}'s swatch, so a picker doesn't need six always-visible buttons to make\r\n * the choice reachable — it needs one, plus a menu for the other five. */\r\n readonly toneMenuOpen = signal(false);\r\n\r\n readonly tones = FLY_SKIN_TONES;\r\n readonly toneLabelKey = flySkinToneLabelKey;\r\n\r\n /** The categories actually rendered, resolved from ids and de-duped. */\r\n readonly visibleCategories = computed<readonly FlyEmojiCategory[]>(() => {\r\n const ids = this.categories() ?? FLY_EMOJI_DEFAULT_CATEGORIES;\r\n const seen = new Set<string>();\r\n const out: FlyEmojiCategory[] = [];\r\n for (const id of ids) {\r\n if (seen.has(id)) continue;\r\n seen.add(id);\r\n const cat = FLY_EMOJI_CATEGORY_BY_ID.get(id);\r\n if (cat) out.push(cat);\r\n }\r\n return out;\r\n });\r\n\r\n /**\r\n * The categories in paint order. `defaultCategory` is hoisted to the FRONT rather than \"selected\":\r\n * with one scrolling list there is no tab to select, so \"the category you land on\" means the one you\r\n * see first. Computed — not seeded in the constructor — because a signal `input()` isn't bound yet\r\n * at construction, so `defaultCategory()` there would read its default.\r\n */\r\n readonly orderedCategories = computed<readonly FlyEmojiCategory[]>(() => {\r\n const cats = this.visibleCategories();\r\n const first = this.defaultCategory();\r\n if (!first) return cats;\r\n const hit = cats.find((c) => c.id === first);\r\n return hit ? [hit, ...cats.filter((c) => c !== hit)] : cats;\r\n });\r\n\r\n /** The tone in force: the user's session pick, else the host's persisted preference. */\r\n readonly effectiveTone = computed<FlySkinTone>(() => this.toneOverride() ?? this.skinTone());\r\n\r\n /** Which tab `'stickers'` mode shows. Emoji is first and default — stickers are the extra. */\r\n readonly activeTab = signal<FlyEmojiPickerTab>('emoji');\r\n\r\n /** Whether the tab bar is on offer at all. */\r\n readonly showTabs = computed<boolean>(() => this.emojiAnimation() === 'stickers');\r\n\r\n /**\r\n * The pack, resolved for a mode that needs it — and the ONE hard failure in this feature.\r\n *\r\n * A missing pack with animation requested is a developer wiring mistake, and a silent static\r\n * fallback would hide it until someone noticed the picker \"just doesn't animate in prod\". Per-id\r\n * coverage gaps are the opposite case and degrade quietly (D15).\r\n */\r\n private readonly requiredPack = computed(() => {\r\n if (this.emojiAnimation() === 'off') return null;\r\n if (!this.pack) throw new Error(FLY_EMOJI_PACK_MISSING_MESSAGE);\r\n return this.pack;\r\n });\r\n\r\n /**\r\n * Whether animation is live right now.\r\n *\r\n * Suspended wholesale while a non-default skin tone is selected (D16): the animated artwork is\r\n * default-tone only (D8), so animating it next to toned static glyphs would re-mix every category\r\n * the moment a tone is picked. Tone wins; animation waits.\r\n */\r\n readonly animationActive = computed<boolean>(\r\n () => !!this.requiredPack() && this.effectiveTone() === 'default',\r\n );\r\n\r\n /** Ids the installed pack actually covers. Empty (and untouched) while `'off'`. */\r\n private readonly coveredIds = computed<ReadonlySet<string>>(() => {\r\n const pack = this.requiredPack();\r\n return pack ? new Set(Object.keys(pack.manifest.entries)) : new Set<string>();\r\n });\r\n\r\n /**\r\n * Categories rendered animated — those the pack covers **entirely**.\r\n *\r\n * Uniform-category rule: one uncovered entry makes the whole category static. Mixed Fluent\r\n * artwork and native glyphs side by side in a labelled run reads as a rendering bug, so the\r\n * category is the unit. Search results deliberately span categories and therefore CAN mix —\r\n * accepted, since a filtered list is not a labelled run of peers.\r\n */\r\n private readonly animatedCategoryIds = computed<ReadonlySet<string>>(() => {\r\n if (!this.animationActive() || this.emojiAnimation() !== 'replace') return new Set<string>();\r\n const covered = this.coveredIds();\r\n const out = new Set<string>();\r\n for (const cat of this.visibleCategories()) {\r\n if (cat.entries.length > 0 && cat.entries.every((e) => covered.has(e.id))) out.add(cat.id);\r\n }\r\n return out;\r\n });\r\n\r\n /** The covered entries, in catalogue order — the Stickers tab's content. */\r\n readonly stickers = computed<readonly FlyEmojiEntry[]>(() => {\r\n if (!this.animationActive() || this.emojiAnimation() !== 'stickers') return [];\r\n const covered = this.coveredIds();\r\n const seen = new Set<string>();\r\n const out: FlyEmojiEntry[] = [];\r\n for (const cat of this.orderedCategories()) {\r\n for (const entry of cat.entries) {\r\n if (seen.has(entry.id) || !covered.has(entry.id)) continue;\r\n seen.add(entry.id);\r\n out.push(entry);\r\n }\r\n }\r\n return out;\r\n });\r\n\r\n private matches(e: FlyEmojiEntry, q: string): boolean {\r\n return (\r\n e.label.toLowerCase().includes(q) ||\r\n e.id.includes(q) ||\r\n (e.keywords?.includes(q) ?? false) ||\r\n e.emoji === q\r\n );\r\n }\r\n\r\n /**\r\n * Every visible entry in paint order, tagged with the category it came from. De-duped by id, so an\r\n * entry reachable from two categories can't paint twice. A query filters here and therefore spans\r\n * EVERY visible category — scoping a search to one group means you must already know where a glyph\r\n * lives before you can look it up, which is what the search box exists to spare you.\r\n */\r\n private readonly matchingEntries = computed<readonly { entry: FlyEmojiEntry; cat: FlyEmojiCategory }[]>(() => {\r\n const q = this.query().trim().toLowerCase();\r\n const seen = new Set<string>();\r\n const out: { entry: FlyEmojiEntry; cat: FlyEmojiCategory }[] = [];\r\n for (const cat of this.orderedCategories()) {\r\n for (const entry of cat.entries) {\r\n if (seen.has(entry.id)) continue;\r\n if (q && !this.matches(entry, q)) continue;\r\n seen.add(entry.id);\r\n out.push({ entry, cat });\r\n }\r\n }\r\n return out;\r\n });\r\n\r\n /** True when the catalogue holds more than the preview cap. Stays true while expanded — the toggle\r\n * then reads \"Show less\". */\r\n readonly hasMore = computed<boolean>(() => {\r\n if (!this.showMore() || this.isFiltering()) return false;\r\n return this.matchingEntries().length > Math.max(0, this.previewCount());\r\n });\r\n\r\n readonly isExpanded = computed<boolean>(() => this.expanded());\r\n\r\n /**\r\n * The sections to paint: one per category that still has entries, each with a heading.\r\n *\r\n * ONE scrolling list with separator labels, not tabs. Tabs wrap to three rows in anything as narrow\r\n * as a sidebar drawer, cost a click to reach any group, and hide the catalogue's shape; a labelled\r\n * run of sections shows it at a glance and scrolls.\r\n *\r\n * The preview cap counts across the FLAT order (not per category), so \"show more\" means one thing;\r\n * a filter always ignores it, because hiding a search hit behind a Show-more reads as a bug.\r\n */\r\n readonly sections = computed<readonly FlyEmojiSection[]>(() => {\r\n const flat = this.matchingEntries();\r\n const capped =\r\n this.showMore() && !this.expanded() && !this.isFiltering()\r\n ? flat.slice(0, Math.max(0, this.previewCount()))\r\n : flat;\r\n const tone = this.effectiveTone();\r\n const selected = new Set(this.selectedIds());\r\n const animatedCats = this.animatedCategoryIds();\r\n const out: FlyEmojiSection[] = [];\r\n for (const { entry, cat } of capped) {\r\n const cell: FlyEmojiCell = {\r\n entry,\r\n glyph: entry.tonable ? applySkinTone(entry.emoji, tone) : entry.emoji,\r\n selected: selected.has(entry.id),\r\n };\r\n const last = out[out.length - 1];\r\n if (last && last.id === cat.id) last.cells.push(cell);\r\n else\r\n out.push({\r\n id: cat.id,\r\n labelKey: cat.labelKey,\r\n label: cat.label,\r\n cells: [cell],\r\n animated: animatedCats.has(cat.id),\r\n });\r\n }\r\n return out;\r\n });\r\n\r\n /** Flat view of what's painted — the tap path and specs address cells, not sections. */\r\n readonly cells = computed<readonly FlyEmojiCell[]>(() => this.sections().flatMap((s) => s.cells));\r\n\r\n /** The tone strip only earns its space when something on offer can actually use it. */\r\n readonly showToneStrip = computed<boolean>(\r\n () => this.skinTones() && this.visibleCategories().some((c) => c.entries.some((e) => e.tonable)),\r\n );\r\n\r\n /** A tone swatch's preview glyph — a neutral hand, toned. */\r\n toneSwatch(tone: FlySkinTone): string {\r\n return applySkinTone('👋', tone);\r\n }\r\n\r\n /** Touches `i18n.version()` so section headings re-resolve on a locale switch. */\r\n sectionLabel(section: { labelKey: string; label: string }): string {\r\n this.i18n.version();\r\n const translated = this.i18n.t(section.labelKey);\r\n return translated === section.labelKey ? section.label : translated;\r\n }\r\n\r\n isSelected(id: string): boolean {\r\n return this.selectedIds().includes(id);\r\n }\r\n\r\n private isFiltering(): boolean {\r\n return this.query().trim().length > 0;\r\n }\r\n\r\n onQueryInput(value: string): void {\r\n this.query.set(value);\r\n }\r\n\r\n toggleExpanded(): void {\r\n this.expanded.update((v) => !v);\r\n }\r\n\r\n selectTone(tone: FlySkinTone): void {\r\n if (tone === this.effectiveTone()) return;\r\n this.toneOverride.set(tone);\r\n this.skinToneChange.emit(tone);\r\n }\r\n\r\n /** Menu-option click: picks the tone AND closes the dropdown (a plain {@link selectTone} call\r\n * leaves the menu open — fine for the spec/host callers that just want the tone applied). */\r\n onToneOptionClick(tone: FlySkinTone): void {\r\n this.selectTone(tone);\r\n this.toneMenuOpen.set(false);\r\n }\r\n\r\n /** Hover-play settle timer — one at a time, so sweeping the pointer across a row plays nothing. */\r\n private hoverTimer: ReturnType<typeof setTimeout> | null = null;\r\n\r\n /** Debounced hover trigger. Re-hovering after playback settles replays, by design. */\r\n onCellHover(target: { play: () => void }): void {\r\n this.cancelHover();\r\n this.hoverTimer = setTimeout(() => {\r\n this.hoverTimer = null;\r\n target.play();\r\n }, HOVER_PLAY_DEBOUNCE_MS);\r\n }\r\n\r\n /** Pointer left before the debounce elapsed — the intent to play never formed. */\r\n cancelHover(): void {\r\n if (this.hoverTimer !== null) clearTimeout(this.hoverTimer);\r\n this.hoverTimer = null;\r\n }\r\n\r\n selectTab(tab: FlyEmojiPickerTab): void {\r\n this.activeTab.set(tab);\r\n }\r\n\r\n /**\r\n * Roving-tabindex arrow navigation across the two tabs. Home/End included because a two-tab bar\r\n * today is a three-tab bar tomorrow, and the keyboard contract shouldn't change when it is.\r\n */\r\n onTabKeydown(event: KeyboardEvent): void {\r\n const tabs: readonly FlyEmojiPickerTab[] = ['emoji', 'stickers'];\r\n const current = tabs.indexOf(this.activeTab());\r\n const pressed = event.currentTarget as HTMLElement | null;\r\n const bar = pressed?.closest<HTMLElement>('[role=\"tablist\"]') ?? null;\r\n // Arrow keys are SPATIAL: under `dir=\"rtl\"` the visually-next tab is the logically-previous one.\r\n const forward = bar && isRtl(bar) ? -1 : 1;\r\n const step = (delta: number): number => (current + delta + tabs.length) % tabs.length;\r\n const next = ((): number | null => {\r\n switch (event.key) {\r\n case 'ArrowDown':\r\n return step(1);\r\n case 'ArrowUp':\r\n return step(-1);\r\n case 'ArrowRight':\r\n return step(forward);\r\n case 'ArrowLeft':\r\n return step(-forward);\r\n case 'Home':\r\n return 0;\r\n case 'End':\r\n return tabs.length - 1;\r\n default:\r\n return null;\r\n }\r\n })();\r\n if (next === null) return;\r\n event.preventDefault();\r\n this.selectTab(tabs[next]);\r\n bar?.querySelectorAll<HTMLElement>('[role=\"tab\"]')[next]?.focus();\r\n }\r\n\r\n /** A sticker cell was tapped. Stickers are a send affordance, not a selection — no toggle state. */\r\n pickSticker(entry: FlyEmojiEntry): void {\r\n this.stickerPicked.emit(entry.id);\r\n }\r\n\r\n /** Emit the tap. `multi` toggles the id in/out; `single` replaces the selection outright. */\r\n pick(entry: FlyEmojiEntry): void {\r\n const current = this.selectedIds();\r\n const next =\r\n this.selectionMode() === 'single'\r\n ? [entry.id]\r\n : current.includes(entry.id)\r\n ? current.filter((id) => id !== entry.id)\r\n : [...current, entry.id];\r\n this.toggled.emit(entry.id);\r\n this.selectionChange.emit(next);\r\n }\r\n}\r\n\r\n/** Direction is inherited, so ask the rendered element rather than guessing from a locale. */\r\nfunction isRtl(el: HTMLElement): boolean {\r\n if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') return false;\r\n return window.getComputedStyle(el).direction === 'rtl';\r\n}\r\n","<div\r\n class=\"fly-emoji-picker\"\r\n [flyClickOutsideEnabled]=\"dismissOnOutsidePress()\"\r\n (flyClickOutside)=\"dismissed.emit()\"\r\n [attr.aria-label]=\"'common.label.emoji_picker' | translate\">\r\n <!-- Stickers mode only: the emoji grid is unchanged, stickers are an ADDITIONAL surface. -->\r\n @if (showTabs()) {\r\n <div\r\n class=\"fly-emoji-picker__tabs\"\r\n role=\"tablist\"\r\n [attr.aria-label]=\"'common.label.emoji_tabs' | translate\">\r\n <button\r\n type=\"button\"\r\n class=\"fly-emoji-picker__tab\"\r\n role=\"tab\"\r\n id=\"fly-emoji-tab-emoji\"\r\n aria-controls=\"fly-emoji-panel-emoji\"\r\n [class.is-active]=\"activeTab() === 'emoji'\"\r\n [attr.aria-selected]=\"activeTab() === 'emoji'\"\r\n [attr.tabindex]=\"activeTab() === 'emoji' ? 0 : -1\"\r\n (keydown)=\"onTabKeydown($event)\"\r\n (click)=\"selectTab('emoji')\">\r\n {{ 'common.label.emoji_tab_emoji' | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"fly-emoji-picker__tab\"\r\n role=\"tab\"\r\n id=\"fly-emoji-tab-stickers\"\r\n aria-controls=\"fly-emoji-panel-stickers\"\r\n [class.is-active]=\"activeTab() === 'stickers'\"\r\n [attr.aria-selected]=\"activeTab() === 'stickers'\"\r\n [attr.tabindex]=\"activeTab() === 'stickers' ? 0 : -1\"\r\n (keydown)=\"onTabKeydown($event)\"\r\n (click)=\"selectTab('stickers')\">\r\n {{ 'common.label.emoji_tab_stickers' | translate }}\r\n </button>\r\n </div>\r\n }\r\n\r\n @if (showTabs() && activeTab() === 'stickers') {\r\n <div\r\n class=\"fly-emoji-picker__stickers\"\r\n id=\"fly-emoji-panel-stickers\"\r\n role=\"tabpanel\"\r\n aria-labelledby=\"fly-emoji-tab-stickers\">\r\n @for (entry of stickers(); track entry.id) {\r\n <button\r\n type=\"button\"\r\n class=\"fly-emoji-picker__sticker\"\r\n [flyTooltip]=\"entry.label\"\r\n [attr.aria-label]=\"entry.label\"\r\n (pointerenter)=\"onCellHover(sticker)\"\r\n (pointerleave)=\"cancelHover()\"\r\n (click)=\"pickSticker(entry)\">\r\n <fly-animated-emoji #sticker [id]=\"entry.id\" [size]=\"64\" />\r\n </button>\r\n } @empty {\r\n <p class=\"fly-emoji-picker__empty\">{{ 'agent.lookup.no_results' | translate }}</p>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!showTabs() || activeTab() === 'emoji') {\r\n <!-- Search + tone sit together as one chrome bar: the tone swatches are hands, and on their own row\r\n above the grid they read as pickable content rather than a setting. -->\r\n <div class=\"fly-emoji-picker__bar\">\r\n <input\r\n class=\"fly-emoji-picker__search\"\r\n type=\"text\"\r\n #searchRef\r\n [value]=\"query()\"\r\n (input)=\"onQueryInput(searchRef.value)\"\r\n [placeholder]=\"'common.label.search_emoji' | translate\"\r\n [attr.aria-label]=\"'common.label.search_emoji' | translate\"\r\n spellcheck=\"false\"\r\n autocomplete=\"off\" />\r\n\r\n @if (showToneStrip()) {\r\n <!-- Escape-to-close listener only — every actual control inside (trigger + options) is its\r\n own focusable button, so this wrapper itself doesn't need to be. -->\r\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\r\n <div\r\n class=\"fly-emoji-picker__tones\"\r\n [flyClickOutsideEnabled]=\"toneMenuOpen()\"\r\n (flyClickOutside)=\"toneMenuOpen.set(false)\"\r\n (keydown.escape)=\"toneMenuOpen.set(false)\">\r\n <button\r\n type=\"button\"\r\n class=\"fly-emoji-picker__tone-trigger\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-expanded]=\"toneMenuOpen()\"\r\n [attr.aria-label]=\"'common.label.skin_tone' | translate\"\r\n [flyTooltip]=\"toneLabelKey(effectiveTone()) | translate\"\r\n (click)=\"toneMenuOpen.set(!toneMenuOpen())\">\r\n <span class=\"fly-emoji-picker__tone-glyph\">{{ toneSwatch(effectiveTone()) }}</span>\r\n <i class=\"pi pi-chevron-down fly-emoji-picker__tone-caret\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n @if (toneMenuOpen()) {\r\n <div\r\n class=\"fly-emoji-picker__tone-menu\"\r\n role=\"listbox\"\r\n [attr.aria-label]=\"'common.label.skin_tone' | translate\">\r\n @for (tone of tones; track tone) {\r\n <button\r\n type=\"button\"\r\n class=\"fly-emoji-picker__tone-option\"\r\n role=\"option\"\r\n [class.is-active]=\"effectiveTone() === tone\"\r\n [attr.aria-selected]=\"effectiveTone() === tone\"\r\n [flyTooltip]=\"toneLabelKey(tone) | translate\"\r\n (click)=\"onToneOptionClick(tone)\">\r\n {{ toneSwatch(tone) }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- ONE scrolling list; each category is a separator label over its own grid. Tabs wrapped to three\r\n rows in a sidebar drawer and cost a click to reach any group. -->\r\n <div\r\n class=\"fly-emoji-picker__list\"\r\n role=\"listbox\"\r\n [attr.id]=\"showTabs() ? 'fly-emoji-panel-emoji' : null\"\r\n [attr.aria-labelledby]=\"showTabs() ? 'fly-emoji-tab-emoji' : null\"\r\n [attr.aria-multiselectable]=\"selectionMode() === 'multi'\">\r\n @for (section of sections(); track section.id) {\r\n <div class=\"fly-emoji-picker__section\" role=\"group\" [attr.aria-label]=\"sectionLabel(section)\">\r\n <h4 class=\"fly-emoji-picker__heading\">{{ sectionLabel(section) }}</h4>\r\n <div class=\"fly-emoji-picker__grid\">\r\n @for (cell of section.cells; track cell.entry.id) {\r\n <button\r\n type=\"button\"\r\n class=\"fly-emoji-picker__cell\"\r\n role=\"option\"\r\n [class.is-active]=\"cell.selected\"\r\n [attr.aria-selected]=\"cell.selected\"\r\n [flyTooltip]=\"cell.entry.label\"\r\n [attr.aria-label]=\"cell.entry.label\"\r\n (click)=\"pick(cell.entry)\">\r\n @if (section.animated) {\r\n <!-- Hover lives on the animated element, not the button: a template reference\r\n declared inside a control-flow block isn't visible to the block's parent. -->\r\n <fly-animated-emoji\r\n #anim\r\n class=\"fly-emoji-picker__glyph\"\r\n [id]=\"cell.entry.id\"\r\n [size]=\"20\"\r\n (pointerenter)=\"onCellHover(anim)\"\r\n (pointerleave)=\"cancelHover()\" />\r\n } @else {\r\n <span class=\"fly-emoji-picker__glyph\">{{ cell.glyph }}</span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n </div>\r\n } @empty {\r\n <p class=\"fly-emoji-picker__empty\">{{ 'agent.lookup.no_results' | translate }}</p>\r\n }\r\n\r\n <!-- Lives INSIDE the scroller, as the last row, rather than pinned below it — a static\r\n footer row permanently ate into the vertical space actual emoji rows could use;\r\n scrolled into view instead, it only costs space once you reach the end. -->\r\n @if (hasMore()) {\r\n <button type=\"button\" class=\"fly-emoji-picker__more\" (click)=\"toggleExpanded()\">\r\n {{ (isExpanded() ? 'common.label.emoji_show_less' : 'common.label.emoji_show_more') | translate }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n</div>\r\n","import {\r\n Component, input, output, HostListener, ViewChild, ElementRef,\r\n computed, signal, AfterViewInit, OnDestroy, ChangeDetectionStrategy, inject, DOCUMENT,\r\n} from '@angular/core';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\n\r\nexport interface ContextMenuItem {\r\n id: string;\r\n label: string;\r\n icon: string;\r\n}\r\n\r\nexport interface ContextMenuSection {\r\n label?: string;\r\n items: ContextMenuItem[];\r\n}\r\n\r\n/**\r\n * Which logical edge of the anchor the menu lines up with (see {@link ContextMenuComponent.align}).\r\n * Logical, not physical — `end` is the right edge in LTR and the left edge in RTL.\r\n */\r\nexport type ContextMenuAlign = 'start' | 'end';\r\n\r\n/** Gap between the anchor and the menu, and the minimum breathing room at a boundary edge. */\r\nconst MENU_GAP = 4;\r\nconst EDGE_MARGIN = 8;\r\n\r\n/**\r\n * Stamped on the `[anchor]` for as long as its menu is open, so the trigger can read as pressed\r\n * instead of sitting idle while its own menu floats above the page. Styled once, globally, by\r\n * `scss/_menu-anchor.scss` — a consumer overrides it by styling the same attribute.\r\n */\r\nconst ANCHOR_OPEN_ATTR = 'data-fly-menu-open';\r\n\r\n/**\r\n * Nearest ancestor that BOTH clips its overflow and is wide enough to hold `minWidth`.\r\n *\r\n * \"Nearest clipping ancestor\" alone is wrong in two directions. Walk to the OUTERMOST one and you\r\n * reach the desktop root (full-viewport, `overflow: hidden`) — i.e. the viewport again, which is\r\n * exactly the bound that fails to contain a menu inside a shell window. Take the innermost and a\r\n * narrow chip/toolbar box can be slimmer than the menu itself, clamping it into a sliver. So: the\r\n * first box going up that clips AND could actually contain the menu. For a table row's ellipsis\r\n * that lands on the scrolling table (or the app window), never on the desktop.\r\n */\r\nfunction containingBox(anchor: HTMLElement, minWidth: number): DOMRect | null {\r\n for (let el = anchor.parentElement; el && el !== el.ownerDocument.body; el = el.parentElement) {\r\n const { overflow, overflowX } = getComputedStyle(el);\r\n const clips = overflow !== 'visible' || overflowX !== 'visible';\r\n if (!clips) continue;\r\n const rect = el.getBoundingClientRect();\r\n if (rect.width >= minWidth + EDGE_MARGIN * 2) return rect;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * A floating, anchor-relative context menu (right-click / kebab-button style). Positions itself\r\n * against the containing clipping ancestor rather than the viewport, flips to stay on-screen, and\r\n * marks its `[anchor]` with `data-fly-menu-open` while open so the trigger can render as pressed.\r\n * Sections group items with an optional label; each item carries an id, label, and icon.\r\n */\r\n@Component({\r\n selector: 'fly-context-menu',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n templateUrl: './context-menu.component.html',\r\n styleUrl: './context-menu.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class ContextMenuComponent implements AfterViewInit, OnDestroy {\r\n @ViewChild('contextMenu') private menuEl?: ElementRef<HTMLElement>;\r\n\r\n private readonly doc = inject(DOCUMENT);\r\n private readonly hostEl = inject(ElementRef<HTMLElement>);\r\n\r\n /**\r\n * Pointer position for a true right-click context menu (`event.clientX/clientY`).\r\n * Ignored when {@link anchor} is set. Optional so anchored callers need not pass dummy numbers.\r\n */\r\n x = input<number>(0);\r\n y = input<number>(0);\r\n /**\r\n * The trigger element for a DROPDOWN-style menu (a row's ⋯ button, a card's ⋯ button, …).\r\n * Prefer this over `[x]`/`[y]`: the menu then derives its own position from the anchor's rect,\r\n * measures its OWN width (no caller-side magic number), resolves {@link align} against the\r\n * anchor's `direction` (so RTL mirrors for free), and — crucially — clamps to the anchor's\r\n * containing box rather than the viewport.\r\n *\r\n * That last part is the bug this exists to kill: `[x]`/`[y]` clamp to the VIEWPORT, which inside\r\n * a shell window is no bound at all — a menu opened from a right-hand ⋯ button sat happily\r\n * outside the window's right edge because it was still nowhere near the viewport's. Callers kept\r\n * rediscovering this and patching it locally (a hardcoded menu width here, a hardcoded panel\r\n * selector there). Pass the anchor and the DS handles it.\r\n */\r\n anchor = input<HTMLElement | null>(null);\r\n /**\r\n * Which logical edge of the {@link anchor} the menu lines up with. `start` (default) matches the\r\n * anchor's leading edge; `end` matches its trailing edge, so a right-hand ⋯ button opens INWARD.\r\n * The menu flips to the opposite edge on its own if the requested one would overflow, so this is\r\n * a preference, not a guarantee. No effect without an anchor.\r\n */\r\n align = input<ContextMenuAlign>('start');\r\n sections = input.required<ContextMenuSection[]>();\r\n /**\r\n * Optional containing rect (viewport coords, e.g. from\r\n * `el.getBoundingClientRect()`) to keep the menu inside — for menus opened\r\n * within an embedded panel that shouldn't spill past its edges. When null\r\n * (default) the menu clamps to the viewport, as before. The viewport is\r\n * always respected as the outer bound even when a boundary is given.\r\n */\r\n boundary = input<DOMRect | null>(null);\r\n action = output<string>();\r\n closed = output<void>();\r\n\r\n private menuWidth = signal(0);\r\n private menuHeight = signal(0);\r\n\r\n /** Anchor geometry, sampled once the menu has been measured (see `ngAfterViewInit`). */\r\n private anchorRect = signal<DOMRect | null>(null);\r\n /** Containing box derived from the anchor; only used when no explicit `boundary` is given. */\r\n private derivedBoundary = signal<DOMRect | null>(null);\r\n private anchorRtl = signal(false);\r\n\r\n private previouslyFocused: Element | null = null;\r\n private prevAriaExpanded: string | null = null;\r\n private prevAriaHasPopup: string | null = null;\r\n\r\n // Resolved position: keep the menu inside its target box.\r\n // menuWidth/Height start at 0 so the first render places the menu at (x,y)\r\n // with no clamping; ngAfterViewInit measures the real size and updates the\r\n // signals, which re-evaluates this computed and repositions correctly.\r\n //\r\n // Target box precedence: explicit `boundary` > the box derived from `anchor` > the viewport.\r\n // Pointer menus (no anchor, no boundary) keep the original viewport-only behaviour.\r\n clampedPos = computed(() => {\r\n const vw = this.doc.defaultView?.innerWidth ?? 0;\r\n const vh = this.doc.defaultView?.innerHeight ?? 0;\r\n const w = this.menuWidth();\r\n const h = this.menuHeight();\r\n const b = this.boundary() ?? this.derivedBoundary();\r\n const a = this.anchorRect();\r\n\r\n if (!b && !a) {\r\n // Unchanged viewport behavior for pointer callers that pass no anchor/boundary.\r\n return {\r\n left: w > 0 ? Math.min(this.x(), vw - w - 8) : this.x(),\r\n top: h > 0 ? Math.min(this.y(), vh - h - 8) : this.y(),\r\n };\r\n }\r\n\r\n // Bounds of the target box, intersected with the viewport (never place off-screen even if a\r\n // caller hands us a boundary that is partly scrolled out).\r\n const loX = Math.max(0, b?.left ?? 0) + EDGE_MARGIN;\r\n const hiX = Math.min(vw, b?.right ?? vw) - EDGE_MARGIN;\r\n const loY = Math.max(0, b?.top ?? 0) + EDGE_MARGIN;\r\n const hiY = Math.min(vh, b?.bottom ?? vh) - EDGE_MARGIN;\r\n\r\n /** Prefer `first`; flip to `second` if it doesn't fit; clamp if neither does. */\r\n const place = (first: number, second: number, size: number, lo: number, hi: number): number => {\r\n if (size <= 0) return first; // pre-measure pass: place as-is, fix on next tick\r\n const fits = (p: number) => p >= lo && p + size <= hi;\r\n if (fits(first)) return first;\r\n if (fits(second)) return second;\r\n return hi - size < lo ? lo : Math.min(Math.max(first, lo), hi - size);\r\n };\r\n\r\n if (!a) {\r\n // Bounded pointer menu: clamp BOTH edges so a near-edge anchor flips inward.\r\n return {\r\n left: place(this.x(), this.x(), w, loX, hiX),\r\n top: place(this.y(), this.y(), h, loY, hiY),\r\n };\r\n }\r\n\r\n // Anchored: resolve the logical `align` to a physical edge, then flip on overflow.\r\n // `start` is the anchor's LEFT edge in LTR and its RIGHT edge in RTL.\r\n const alignToLeftEdge = this.anchorRtl() ? this.align() === 'end' : this.align() === 'start';\r\n const atLeft = a.left; // menu's left edge meets the anchor's left edge\r\n const atRight = a.right - w; // menu's right edge meets the anchor's right edge\r\n const below = a.bottom + MENU_GAP;\r\n const above = a.top - h - MENU_GAP;\r\n\r\n return {\r\n left: place(alignToLeftEdge ? atLeft : atRight, alignToLeftEdge ? atRight : atLeft, w, loX, hiX),\r\n top: place(below, above, h, loY, hiY),\r\n };\r\n });\r\n\r\n ngAfterViewInit(): void {\r\n // Portal: move host to <body> so position:fixed resolves against the true\r\n // viewport, not against any transformed/backdrop-filtered ancestor window.\r\n this.doc.body.appendChild(this.hostEl.nativeElement);\r\n\r\n // Measure after portal move so offsetWidth/Height are accurate.\r\n const el = this.menuEl?.nativeElement;\r\n if (el) {\r\n this.menuWidth.set(el.offsetWidth);\r\n this.menuHeight.set(el.offsetHeight);\r\n }\r\n\r\n // Sample the anchor AFTER measuring: `containingBox` needs the menu's real width to skip\r\n // ancestors too narrow to hold it. The anchor is untouched by the portal move above (only the\r\n // menu host relocates), so its rect and ancestor chain are still valid here.\r\n const anchor = this.anchor();\r\n if (anchor) {\r\n this.anchorRect.set(anchor.getBoundingClientRect());\r\n this.anchorRtl.set(getComputedStyle(anchor).direction === 'rtl');\r\n this.derivedBoundary.set(containingBox(anchor, this.menuWidth()));\r\n this.markAnchorOpen(anchor);\r\n }\r\n\r\n this.previouslyFocused = document.activeElement;\r\n this.focusItem(0);\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.clearAnchorOpen();\r\n const el = this.hostEl.nativeElement;\r\n if (el.parentNode === this.doc.body) {\r\n this.doc.body.removeChild(el);\r\n }\r\n }\r\n\r\n /**\r\n * Marks the trigger as open: a styling hook plus the ARIA the pairing actually needs. A button\r\n * that summons a menu should say so — the anchor is the consumer's element, so nothing else sets\r\n * `aria-expanded` on it, and without this the trigger looked (and read) idle while its own menu\r\n * was up. Done here rather than by each caller binding its own `[class.active]`, which is how the\r\n * indicator ended up missing everywhere.\r\n */\r\n private markAnchorOpen(anchor: HTMLElement): void {\r\n // Remember what was there so a consumer that manages its own ARIA gets it back on close.\r\n this.prevAriaExpanded = anchor.getAttribute('aria-expanded');\r\n this.prevAriaHasPopup = anchor.getAttribute('aria-haspopup');\r\n anchor.setAttribute(ANCHOR_OPEN_ATTR, '');\r\n anchor.setAttribute('aria-expanded', 'true');\r\n anchor.setAttribute('aria-haspopup', 'menu');\r\n }\r\n\r\n private clearAnchorOpen(): void {\r\n const anchor = this.anchor();\r\n if (!anchor) return;\r\n anchor.removeAttribute(ANCHOR_OPEN_ATTR);\r\n this.restoreAttr(anchor, 'aria-expanded', this.prevAriaExpanded);\r\n this.restoreAttr(anchor, 'aria-haspopup', this.prevAriaHasPopup);\r\n }\r\n\r\n private restoreAttr(el: HTMLElement, name: string, prev: string | null): void {\r\n if (prev === null) el.removeAttribute(name);\r\n else el.setAttribute(name, prev);\r\n }\r\n\r\n onAction(id: string): void {\r\n this.action.emit(id);\r\n this.close();\r\n }\r\n\r\n @HostListener('document:mousedown', ['$event'])\r\n onClickOutside(event: MouseEvent): void {\r\n if (!this.menuEl?.nativeElement.contains(event.target as Node)) {\r\n this.close();\r\n }\r\n }\r\n\r\n @HostListener('document:keydown.escape')\r\n onEscape(): void {\r\n this.close();\r\n }\r\n\r\n @HostListener('document:contextmenu', ['$event'])\r\n onContextMenu(event: MouseEvent): void {\r\n if (!this.menuEl?.nativeElement.contains(event.target as Node)) {\r\n this.close();\r\n }\r\n }\r\n\r\n @HostListener('keydown', ['$event'])\r\n onKeydown(event: KeyboardEvent): void {\r\n const items = this.getMenuItems();\r\n if (!items.length) return;\r\n const focused = document.activeElement as HTMLElement;\r\n const idx = items.indexOf(focused);\r\n\r\n if (event.key === 'ArrowDown') {\r\n event.preventDefault();\r\n this.focusItem(idx < items.length - 1 ? idx + 1 : 0);\r\n } else if (event.key === 'ArrowUp') {\r\n event.preventDefault();\r\n this.focusItem(idx > 0 ? idx - 1 : items.length - 1);\r\n } else if (event.key === 'Home') {\r\n event.preventDefault();\r\n this.focusItem(0);\r\n } else if (event.key === 'End') {\r\n event.preventDefault();\r\n this.focusItem(items.length - 1);\r\n }\r\n }\r\n\r\n private close(): void {\r\n this.restoreFocus();\r\n this.closed.emit();\r\n }\r\n\r\n private getMenuItems(): HTMLElement[] {\r\n return Array.from(\r\n this.menuEl?.nativeElement.querySelectorAll<HTMLElement>('[role=\"menuitem\"]') ?? [],\r\n );\r\n }\r\n\r\n private focusItem(index: number): void {\r\n const items = this.getMenuItems();\r\n items[index]?.focus();\r\n }\r\n\r\n private restoreFocus(): void {\r\n if (this.previouslyFocused instanceof HTMLElement) {\r\n this.previouslyFocused.focus();\r\n }\r\n this.previouslyFocused = null;\r\n }\r\n}\r\n","<div\r\n #contextMenu\r\n class=\"context-menu\"\r\n [style.left.px]=\"clampedPos().left\"\r\n [style.top.px]=\"clampedPos().top\"\r\n role=\"menu\"\r\n [attr.aria-label]=\"'shell.context_menu' | translate\">\r\n\r\n @for (section of sections(); track $index) {\r\n @if ($index > 0) {\r\n <div class=\"menu-divider\"></div>\r\n }\r\n @if (section.label) {\r\n <div class=\"menu-section-label\">{{ section.label }}</div>\r\n }\r\n @for (item of section.items; track item.id) {\r\n <button\r\n type=\"button\"\r\n class=\"vos-btn sm rect menu-item\"\r\n role=\"menuitem\"\r\n (click)=\"onAction(item.id)\">\r\n <i [class]=\"'pi ' + item.icon\" aria-hidden=\"true\"></i>\r\n <span>{{ item.label }}</span>\r\n </button>\r\n }\r\n }\r\n</div>\r\n","import { Injectable, inject, signal } from '@angular/core';\r\nimport { I18nService } from '../../services/i18n.service';\r\n\r\nexport enum MessageBoxButtons {\r\n OK,\r\n OKCancel,\r\n YesNo,\r\n YesNoCancel,\r\n RetryCancel,\r\n AbortRetryIgnore,\r\n /**\r\n * Three-choice attach-decision set (Cancel / Use once / Keep & index —\r\n * desktop-app's agent-input keep-vs-once modal). Reuses `DialogResult.Yes`\r\n * for \"keep\" and `DialogResult.No` for \"use once\" rather than adding new\r\n * `DialogResult` members — the caller narrows on the two it cares about.\r\n * Labels are dialog-specific i18n keys (`agent.attach.keep` /\r\n * `agent.attach.use_once`), following the same per-case pattern as\r\n * `RetryCancel` / `AbortRetryIgnore` below.\r\n */\r\n KeepUseOnceCancel,\r\n}\r\n\r\nexport enum MessageBoxIcon {\r\n None,\r\n Information,\r\n Warning,\r\n Error,\r\n Question,\r\n}\r\n\r\nexport enum DialogResult {\r\n None,\r\n OK,\r\n Cancel,\r\n Yes,\r\n No,\r\n Retry,\r\n Abort,\r\n Ignore,\r\n}\r\n\r\nexport interface MessageBoxOptions {\r\n title: string;\r\n message: string;\r\n buttons?: MessageBoxButtons;\r\n icon?: MessageBoxIcon;\r\n}\r\n\r\n/**\r\n * Configuration for the \"Don't ask again\" checkbox rendered by\r\n * `showAcknowledged()`. The field is intentionally NOT part of the base\r\n * `MessageBoxOptions` so the type system enforces the rule\r\n * \"checkbox ⇒ caller MUST use `showAcknowledged()`\": the classic `show()`\r\n * entry point cannot accept this shape, eliminating the silent-discard\r\n * dark-pattern path where the user's choice was thrown away.\r\n */\r\nexport interface MessageBoxDontAskAgainConfig {\r\n /** i18n key for the checkbox label, e.g. 'agent.command.builtin.clear.dont_ask_again'. */\r\n labelKey: string;\r\n /** Initial checked state. Default false. */\r\n defaultChecked?: boolean;\r\n}\r\n\r\n/**\r\n * Options narrowed to those carrying a `dontAskAgain` config — the only shape\r\n * accepted by `showAcknowledged()`.\r\n */\r\nexport interface MessageBoxOptionsWithAcknowledgement extends MessageBoxOptions {\r\n dontAskAgain: MessageBoxDontAskAgainConfig;\r\n}\r\n\r\nexport interface MessageBoxButton {\r\n label: string;\r\n result: DialogResult;\r\n variant?: 'primary' | 'danger' | 'default';\r\n}\r\n\r\n/** Shape returned by `showAcknowledged()` — pairs the dialog result with the checkbox state. */\r\nexport interface DialogResultWithAcknowledgement {\r\n readonly result: DialogResult;\r\n readonly dontAskAgain: boolean;\r\n}\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class MessageBoxService {\r\n private readonly i18n = inject(I18nService);\r\n\r\n readonly visible = signal(false);\r\n readonly title = signal('');\r\n readonly message = signal('');\r\n readonly icon = signal<MessageBoxIcon>(MessageBoxIcon.None);\r\n readonly buttons = signal<MessageBoxButton[]>([]);\r\n /**\r\n * Active \"Don't ask again\" config — populated only by `showAcknowledged()`.\r\n * `show()` callers cannot reach this signal because the type system rejects\r\n * `dontAskAgain` on the base `MessageBoxOptions`.\r\n */\r\n readonly dontAskAgain = signal<MessageBoxDontAskAgainConfig | undefined>(undefined);\r\n\r\n /**\r\n * Component-side checkbox state. The component (`MessageBoxComponent`) wires\r\n * its own signal to this one; the service explicitly re-seeds it on every\r\n * `_open()` so reusing a constant `options` literal across two opens does\r\n * NOT leak the previous user's checkbox state through signal `===` dedupe.\r\n * Exposed for the component to read/write; not for general callers.\r\n */\r\n readonly dontAskAgainChecked = signal(false);\r\n\r\n private resolver: ((value: DialogResultWithAcknowledgement) => void) | null = null;\r\n\r\n show(options: MessageBoxOptions): Promise<DialogResult> {\r\n return this._open(options).then((r) => r.result);\r\n }\r\n\r\n /**\r\n * Opens a message box with a \"Don't ask again\" checkbox and resolves to both\r\n * the dialog result and the checkbox state. Throws when `options.dontAskAgain`\r\n * is missing — the checkbox config is mandatory for this entry point. The\r\n * compile-time signature already guarantees presence; the runtime check is\r\n * defense-in-depth for callers that bypass the type system via `as never`.\r\n */\r\n showAcknowledged(\r\n options: MessageBoxOptionsWithAcknowledgement,\r\n ): Promise<DialogResultWithAcknowledgement> {\r\n if (!options.dontAskAgain) {\r\n throw new Error(\r\n 'MessageBoxService.showAcknowledged() requires options.dontAskAgain — use show() for plain dialogs.',\r\n );\r\n }\r\n return this._open(options);\r\n }\r\n\r\n resolve(result: DialogResult, dontAskAgain = false): void {\r\n this.visible.set(false);\r\n if (this.resolver) {\r\n this.resolver({ result, dontAskAgain });\r\n this.resolver = null;\r\n }\r\n }\r\n\r\n private _open(\r\n options: MessageBoxOptions | MessageBoxOptionsWithAcknowledgement,\r\n ): Promise<DialogResultWithAcknowledgement> {\r\n // Dismiss any pending dialog so its Promise resolves rather than leaking.\r\n if (this.resolver) {\r\n this.resolver({ result: DialogResult.None, dontAskAgain: false });\r\n this.resolver = null;\r\n }\r\n\r\n const daa =\r\n 'dontAskAgain' in options ? options.dontAskAgain : undefined;\r\n\r\n this.title.set(options.title);\r\n this.message.set(options.message);\r\n this.icon.set(options.icon ?? MessageBoxIcon.None);\r\n this.buttons.set(this.resolveButtons(options.buttons ?? MessageBoxButtons.OK));\r\n this.dontAskAgain.set(daa);\r\n // Explicit re-seed: signal `set` dedupes by `===`, so an `effect()` on\r\n // `dontAskAgain` would not re-fire when a caller passes the SAME options\r\n // literal twice. Set the checkbox state directly each open.\r\n this.dontAskAgainChecked.set(daa?.defaultChecked ?? false);\r\n this.visible.set(true);\r\n\r\n return new Promise<DialogResultWithAcknowledgement>((resolve) => {\r\n this.resolver = resolve;\r\n });\r\n }\r\n\r\n private resolveButtons(buttons: MessageBoxButtons): MessageBoxButton[] {\r\n const t = (key: string) => this.i18n.t(key);\r\n switch (buttons) {\r\n case MessageBoxButtons.OK:\r\n return [{ label: t('common.ok'), result: DialogResult.OK, variant: 'primary' }];\r\n\r\n case MessageBoxButtons.OKCancel:\r\n return [\r\n { label: t('common.action.cancel'), result: DialogResult.Cancel, variant: 'default' },\r\n { label: t('common.ok'), result: DialogResult.OK, variant: 'primary' },\r\n ];\r\n\r\n case MessageBoxButtons.YesNo:\r\n return [\r\n { label: t('common.no'), result: DialogResult.No, variant: 'default' },\r\n { label: t('common.yes'), result: DialogResult.Yes, variant: 'primary' },\r\n ];\r\n\r\n case MessageBoxButtons.YesNoCancel:\r\n return [\r\n { label: t('common.action.cancel'), result: DialogResult.Cancel, variant: 'default' },\r\n { label: t('common.no'), result: DialogResult.No, variant: 'default' },\r\n { label: t('common.yes'), result: DialogResult.Yes, variant: 'primary' },\r\n ];\r\n\r\n case MessageBoxButtons.RetryCancel:\r\n return [\r\n { label: t('common.action.cancel'), result: DialogResult.Cancel, variant: 'default' },\r\n { label: t('common.retry'), result: DialogResult.Retry, variant: 'primary' },\r\n ];\r\n\r\n case MessageBoxButtons.AbortRetryIgnore:\r\n return [\r\n { label: t('common.abort'), result: DialogResult.Abort, variant: 'danger' },\r\n { label: t('common.retry'), result: DialogResult.Retry, variant: 'default' },\r\n { label: t('common.ignore'), result: DialogResult.Ignore, variant: 'default' },\r\n ];\r\n\r\n case MessageBoxButtons.KeepUseOnceCancel:\r\n // `common.action.cancel` (NOT `common.cancel`, which no consumer app\r\n // defines) is the canonical Cancel string used throughout the shell —\r\n // see the other cases' `t('common.cancel')` calls, which resolve to\r\n // the literal key when no host app happens to define it.\r\n return [\r\n { label: t('common.action.cancel'), result: DialogResult.Cancel, variant: 'default' },\r\n { label: t('agent.attach.use_once'), result: DialogResult.No, variant: 'default' },\r\n { label: t('agent.attach.keep'), result: DialogResult.Yes, variant: 'primary' },\r\n ];\r\n }\r\n }\r\n}\r\n","import {\r\n Component, inject, ChangeDetectionStrategy,\r\n HostListener, ElementRef, AfterViewInit, computed, input,\r\n} from '@angular/core';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { MessageBoxService, MessageBoxIcon, DialogResult } from './message-box.service';\r\n\r\n/**\r\n * Host component for the app-wide alert/confirm dialog surface. It renders whatever the\r\n * current `MessageBoxService` request describes (icon, message, button set) and resolves that\r\n * request with the user's choice — the design-system replacement for native `alert()`/`confirm()`\r\n * dialogs, which the platform disallows (see `feedback_no_native_browser_dialogs`).\r\n */\r\n@Component({\r\n selector: 'fly-message-box',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n templateUrl: './message-box.component.html',\r\n styleUrl: './message-box.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class MessageBoxComponent implements AfterViewInit {\r\n private readonly injectedService = inject(MessageBoxService);\r\n private elRef = inject(ElementRef);\r\n\r\n /**\r\n * Optional service override. When bound, the component renders THIS instance's\r\n * state instead of the root singleton — the mechanism that lets each desktop\r\n * window host its own window-scoped dialog (see the shell's per-window\r\n * `getInjector`). Unbound (the shell-global host) → the injected root singleton.\r\n */\r\n readonly service = input<MessageBoxService | null>(null);\r\n\r\n /** The active service: the bound override when present, else the root singleton. */\r\n get activeService(): MessageBoxService {\r\n return this.service() ?? this.injectedService;\r\n }\r\n\r\n readonly MessageBoxIcon = MessageBoxIcon;\r\n readonly DialogResult = DialogResult;\r\n\r\n /** Mirror of the service's `dontAskAgain` config so the template can read it directly. */\r\n readonly dontAskAgainConfig = computed(() => this.activeService.dontAskAgain());\r\n /**\r\n * User-driven checkbox state, owned by the (possibly overridden) service and\r\n * re-seeded on every `_open()` so reusing a constant options literal cannot\r\n * leak prior state. A getter so it tracks the resolved `service`.\r\n */\r\n get dontAskAgainChecked() {\r\n return this.activeService.dontAskAgainChecked;\r\n }\r\n /**\r\n * Concatenated id list for the dialog's `aria-describedby`. Always includes\r\n * the message; appends the checkbox label id when the checkbox is rendered\r\n * so screen readers announce the checkbox as part of the description.\r\n */\r\n readonly ariaDescribedBy = computed(() =>\r\n this.dontAskAgainConfig() ? 'mb-message mb-dont-ask' : 'mb-message',\r\n );\r\n\r\n private previouslyFocused: Element | null = null;\r\n\r\n ngAfterViewInit(): void {\r\n // Store focus origin so we can restore it on close\r\n this.previouslyFocused = document.activeElement;\r\n this.focusPrimaryButton();\r\n }\r\n\r\n @HostListener('document:keydown.escape')\r\n onEscape(): void {\r\n if (this.activeService.visible()) {\r\n this.activeService.resolve(DialogResult.Cancel, this.dontAskAgainChecked());\r\n this.restoreFocus();\r\n }\r\n }\r\n\r\n onBackdropClick(): void {\r\n this.activeService.resolve(DialogResult.Cancel, this.dontAskAgainChecked());\r\n this.restoreFocus();\r\n }\r\n\r\n /** Space would otherwise scroll the page while the scrim (role=\"button\") is focused. */\r\n onBackdropSpace(event: Event): void {\r\n event.preventDefault();\r\n this.onBackdropClick();\r\n }\r\n\r\n onButtonClick(result: DialogResult): void {\r\n this.activeService.resolve(result, this.dontAskAgainChecked());\r\n this.restoreFocus();\r\n }\r\n\r\n onDontAskAgainToggle(ev: Event): void {\r\n const target = ev.target as HTMLInputElement | null;\r\n this.dontAskAgainChecked.set(!!target?.checked);\r\n }\r\n\r\n iconClass(): string {\r\n switch (this.activeService.icon()) {\r\n case MessageBoxIcon.Information: return 'pi pi-info-circle';\r\n case MessageBoxIcon.Warning: return 'pi pi-exclamation-triangle';\r\n case MessageBoxIcon.Error: return 'pi pi-times-circle';\r\n case MessageBoxIcon.Question: return 'pi pi-question-circle';\r\n default: return '';\r\n }\r\n }\r\n\r\n private focusPrimaryButton(): void {\r\n // Focus the primary (last) button, which is the default action\r\n const buttons = this.elRef.nativeElement.querySelectorAll('.mb-btn') as NodeListOf<HTMLButtonElement>;\r\n const last = buttons[buttons.length - 1];\r\n last?.focus();\r\n }\r\n\r\n private restoreFocus(): void {\r\n if (this.previouslyFocused instanceof HTMLElement) {\r\n this.previouslyFocused.focus();\r\n }\r\n this.previouslyFocused = null;\r\n }\r\n}\r\n","@if (activeService.visible()) {\r\n <div class=\"mb-backdrop\">\r\n <div\r\n class=\"mb-scrim\"\r\n role=\"button\"\r\n tabindex=\"0\"\r\n [attr.aria-label]=\"'common.action.cancel' | translate\"\r\n (click)=\"onBackdropClick()\"\r\n (keydown.enter)=\"onBackdropClick()\"\r\n (keydown.space)=\"onBackdropSpace($event)\"></div>\r\n <div\r\n class=\"mb-dialog\"\r\n [class.mb-info]=\"activeService.icon() === MessageBoxIcon.Information\"\r\n [class.mb-warning]=\"activeService.icon() === MessageBoxIcon.Warning\"\r\n [class.mb-danger]=\"activeService.icon() === MessageBoxIcon.Error\"\r\n [class.mb-question]=\"activeService.icon() === MessageBoxIcon.Question\"\r\n role=\"alertdialog\"\r\n aria-modal=\"true\"\r\n aria-labelledby=\"mb-title\"\r\n [attr.aria-describedby]=\"ariaDescribedBy()\">\r\n\r\n @if (iconClass()) {\r\n <div class=\"mb-icon-wrap\">\r\n <i [class]=\"iconClass() + ' mb-icon'\" aria-hidden=\"true\"></i>\r\n </div>\r\n }\r\n\r\n <div class=\"mb-title\" id=\"mb-title\">{{ activeService.title() }}</div>\r\n <div class=\"mb-message\" id=\"mb-message\">{{ activeService.message() }}</div>\r\n\r\n @if (dontAskAgainConfig(); as daa) {\r\n <label class=\"mb-dont-ask-again\">\r\n <input\r\n type=\"checkbox\"\r\n [checked]=\"dontAskAgainChecked()\"\r\n (change)=\"onDontAskAgainToggle($event)\" />\r\n <span id=\"mb-dont-ask\">{{ daa.labelKey | translate }}</span>\r\n </label>\r\n }\r\n\r\n <div class=\"mb-actions\">\r\n @for (btn of activeService.buttons(); track btn.result) {\r\n <button\r\n type=\"button\"\r\n class=\"vos-btn sm mb-btn\"\r\n [class.mb-btn--primary]=\"btn.variant === 'primary'\"\r\n [class.mb-btn--danger]=\"btn.variant === 'danger'\"\r\n (click)=\"onButtonClick(btn.result)\">\r\n {{ btn.label }}\r\n </button>\r\n }\r\n </div>\r\n\r\n </div>\r\n </div>\r\n}\r\n","import {\r\n Component,\r\n Input,\r\n Output,\r\n EventEmitter,\r\n signal,\r\n inject,\r\n OnInit,\r\n DestroyRef,\r\n ChangeDetectionStrategy,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { Observable, ReplaySubject } from 'rxjs';\r\nimport { switchMap } from 'rxjs/operators';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { I18nService } from '../../services/i18n.service';\r\nimport type {\r\n ShareOrgChartOption,\r\n ShareOuNode,\r\n SharePanelLevelOption,\r\n SharePermissionEntry,\r\n SharePrincipal,\r\n ShareUserResult,\r\n} from '../../models/share-panel.model';\r\n\r\n/** Default permission levels (file-style ACL). Hosts can override via `permissionLevels`. */\r\nexport const SHARE_PANEL_DEFAULT_FILE_LEVELS: SharePanelLevelOption[] = [\r\n { value: 'View', labelKey: 'files.share.level_view' },\r\n { value: 'Download', labelKey: 'files.share.level_download' },\r\n { value: 'Edit', labelKey: 'files.share.level_edit' },\r\n { value: 'FullControl', labelKey: 'files.share.level_full' },\r\n];\r\n\r\n/**\r\n * Generic sharing/permissions panel for file-style resources: searches users and org-chart\r\n * nodes/levels to add as principals, lets a host configure the permission levels offered\r\n * (defaults to {@link SHARE_PANEL_DEFAULT_FILE_LEVELS}), and emits the resulting\r\n * add/update/remove of `SharePermissionEntry` grants for the host to persist.\r\n */\r\n@Component({\r\n selector: 'fly-share-panel',\r\n standalone: true,\r\n imports: [CommonModule, FormsModule, TranslatePipe],\r\n templateUrl: './share-panel.component.html',\r\n styleUrl: './share-panel.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class SharePanelComponent implements OnInit {\r\n /** Resource title shown in the header */\r\n @Input() targetName = '';\r\n\r\n /** i18n key for panel title */\r\n @Input() titleKey = 'files.share.title';\r\n\r\n /** Load current shares / permissions (host resolves display names when possible). */\r\n @Input({ required: true }) loadPermissions!: () => Observable<SharePermissionEntry[]>;\r\n\r\n @Input({ required: true }) searchUsers!: (query: string) => Observable<ShareUserResult[]>;\r\n\r\n /**\r\n * Load OU hierarchy for sharing. `chartId` is null for the default/official tree;\r\n * non-null for an alternative chart.\r\n */\r\n @Input({ required: true })\r\n loadOuTree!: (chartId: string | null) => Observable<ShareOuNode[]>;\r\n\r\n /** Chart selector options; first entry should be the default chart (`id: null`). */\r\n @Input({ required: true }) loadChartOptions!: () => Observable<ShareOrgChartOption[]>;\r\n\r\n /**\r\n * Initial chart selection. Resolution order:\r\n * <list type=\"number\">\r\n * <item>{@link defaultChartId} when explicitly provided (string or null).</item>\r\n * <item>First option matching {@link defaultChartSystemKey} (e.g. <c>'apps'</c>).</item>\r\n * <item>Host order — <c>options[0]?.id ?? null</c>.</item>\r\n * </list>\r\n */\r\n @Input() defaultChartSystemKey?: string | null;\r\n\r\n /** Hard-coded chart id to pre-select. Takes priority over {@link defaultChartSystemKey}. */\r\n @Input() defaultChartId?: string | null;\r\n\r\n /**\r\n * Labels from the default (official) OU tree for stable display names on OU grants\r\n * when the picker shows an alternative chart.\r\n */\r\n @Input({ required: true }) loadOuLabelMap!: () => Observable<Record<string, string>>;\r\n\r\n @Input({ required: true })\r\n grantToUser!: (userId: string, level: string, applyToChildren: boolean, isDeny: boolean) => Observable<void>;\r\n\r\n @Input({ required: true })\r\n grantToOu!: (ouId: string, level: string, applyToChildren: boolean, isDeny: boolean) => Observable<void>;\r\n\r\n @Input({ required: true }) updatePermission!: (id: string, level: string) => Observable<void>;\r\n\r\n @Input({ required: true }) revokePermission!: (id: string) => Observable<void>;\r\n\r\n /** When true, show “apply to children” (e.g. folders). */\r\n @Input() showApplyToChildren = false;\r\n\r\n /**\r\n * When true, surfaces an \"Add as deny\" toggle in the add-permission row and renders\r\n * existing deny grants with red styling. Hosts whose backend does not support deny\r\n * grants (legacy callers) leave this false and the panel hides all deny affordances.\r\n */\r\n @Input() supportsDeny = false;\r\n\r\n /** Override level dropdown options (e.g. notes: View / Edit only). */\r\n @Input() permissionLevels?: SharePanelLevelOption[];\r\n\r\n /** i18n key for wildcard app grant label */\r\n @Input() everyoneLabelKey = 'files.share.everyone';\r\n\r\n /**\r\n * Optional apps-chart role-OU index for the tenant. When supplied, the panel:\r\n * <list type=\"bullet\">\r\n * <item>Renders existing OU grants whose ouId matches a row as <c>RolePrincipal</c>\r\n * chips (\"FFO in Circles\") instead of opaque OU labels.</item>\r\n * <item>Surfaces an \"Add role\" picker that translates the picked role to its\r\n * role-OU UUID and dispatches via {@link grantToOu}. Backend stores it as a\r\n * plain OU grant; <see cref=\"PermissionResolver\"/> resolves at access time via\r\n * the user's effective OU set.</item>\r\n * </list>\r\n * Hosts that don't have access to the apps-chart (or don't want the role flow) omit\r\n * this input — OU grants then render as generic OU principals.\r\n */\r\n @Input() loadRoleOus?: () => Observable<RoleOuLookupRow[]>;\r\n\r\n @Output() closed = new EventEmitter<void>();\r\n\r\n /**\r\n * @deprecated Use `(closed)`. Kept as an alias so the rename is not a\r\n * federation-breaking change.\r\n *\r\n * This output was renamed `close` -> `closed` in 4389a96c9 to clear\r\n * `@angular-eslint/no-output-native`. On an ordinary component that is a\r\n * tidy-up; on THIS one it removes a binding from the design-system's public\r\n * surface, and the design-system is a Native Federation SINGLETON — every\r\n * remote still on the old contract binds `(close)` against the one shared\r\n * copy. ds-compat caught it as `output-removed` with no major bump (build\r\n * 11204), which is exactly its job.\r\n *\r\n * Publishing 4.0.0 for a rename would fork the singleton for every remote,\r\n * and regenerating the baseline would launder the break, so neither is right.\r\n * Both outputs fire together via {@link emitClosed}; drop `close` at the next\r\n * genuine major.\r\n */\r\n // eslint-disable-next-line @angular-eslint/no-output-native\r\n @Output() close = new EventEmitter<void>();\r\n\r\n /**\r\n * Single emit path for both the canonical and the deprecated output, so the\r\n * two can never drift apart. Every close site calls this, never `.emit()`.\r\n */\r\n emitClosed(): void {\r\n this.closed.emit();\r\n this.close.emit();\r\n }\r\n\r\n /** Space would otherwise scroll the page while the backdrop (role=\"button\") is focused. */\r\n onOverlayBackdropSpace(event: Event): void {\r\n event.preventDefault();\r\n this.emitClosed();\r\n }\r\n\r\n private destroyRef = inject(DestroyRef);\r\n private i18n = inject(I18nService);\r\n\r\n permissions = signal<SharePermissionEntry[]>([]);\r\n loading = signal(true);\r\n searchQuery = '';\r\n newLevel = '';\r\n applyToChildren = false;\r\n\r\n /** Apps-chart role-OU index, populated lazily when {@link loadRoleOus} is provided. */\r\n roleOus = signal<RoleOuLookupRow[]>([]);\r\n /** Map<ouId, role row> — derived from roleOus for O(1) lookup during rendering. */\r\n private readonly roleOusByOuId = signal<Record<string, RoleOuLookupRow>>({});\r\n\r\n /** Two-way bound to the role picker's filter input. */\r\n roleSearchQuery = '';\r\n /** True while the role picker section is expanded. */\r\n showRolePicker = signal(false);\r\n /**\r\n * Two-way bound to the \"Add as deny\" toggle. When true, the next user/OU pick is\r\n * persisted as a deny grant. Reset to false after each successful grant so the next\r\n * pick defaults back to allow.\r\n */\r\n addAsDeny = false;\r\n searchResults = signal<ShareUserResult[]>([]);\r\n ouTree = signal<ShareOuNode[]>([]);\r\n showOuPicker = signal(false);\r\n chartOptions = signal<ShareOrgChartOption[]>([]);\r\n selectedOrgChartId = signal<string | null>(null);\r\n /** Default-tree id → display name for permission rows (OU grants). */\r\n private readonly ouLabelById = signal<Record<string, string>>({});\r\n\r\n private searchTimeout: ReturnType<typeof setTimeout> | null = null;\r\n /** Emits after chart options load; further emissions on user chart changes (no initial null). */\r\n private readonly selectedChartId$ = new ReplaySubject<string | null>(1);\r\n\r\n ngOnInit(): void {\r\n const levels = this.levelOptions;\r\n this.newLevel = levels[0]?.value ?? 'View';\r\n this.refreshPermissions();\r\n\r\n // Load the role-OU lookup table once. Failures degrade gracefully — OU grants then\r\n // render as generic OU principals (the v1 behaviour) instead of Role chips.\r\n this.loadRoleOus?.()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (rows) => {\r\n this.roleOus.set(rows);\r\n const byId: Record<string, RoleOuLookupRow> = {};\r\n for (const r of rows) byId[r.ouId] = r;\r\n this.roleOusByOuId.set(byId);\r\n },\r\n error: () => {\r\n this.roleOus.set([]);\r\n this.roleOusByOuId.set({});\r\n },\r\n });\r\n\r\n this.loadOuLabelMap()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (m) => this.ouLabelById.set(m),\r\n error: () => this.ouLabelById.set({}),\r\n });\r\n\r\n this.selectedChartId$\r\n .pipe(\r\n switchMap((id) => this.loadOuTree(id)),\r\n takeUntilDestroyed(this.destroyRef),\r\n )\r\n .subscribe({\r\n next: (tree) => this.ouTree.set(tree),\r\n error: () => this.ouTree.set([]),\r\n });\r\n\r\n this.loadChartOptions()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (opts) => {\r\n this.chartOptions.set(opts);\r\n const initial = this.resolveInitialChartId(opts);\r\n this.selectedOrgChartId.set(initial);\r\n this.selectedChartId$.next(initial);\r\n },\r\n error: () => {\r\n this.chartOptions.set([]);\r\n this.selectedOrgChartId.set(null);\r\n this.selectedChartId$.next(null);\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Picks the chart id to seed the OU picker with. Honours explicit\r\n * {@link defaultChartId} first (null is a valid id), then {@link defaultChartSystemKey},\r\n * then falls back to host order.\r\n */\r\n private resolveInitialChartId(opts: ShareOrgChartOption[]): string | null {\r\n if (this.defaultChartId !== undefined) {\r\n const exists = opts.some((o) => o.id === this.defaultChartId);\r\n return exists ? (this.defaultChartId as string | null) : (opts[0]?.id ?? null);\r\n }\r\n const key = this.defaultChartSystemKey;\r\n if (key) {\r\n const match = opts.find((o) => o.systemKey === key);\r\n if (match) return match.id;\r\n }\r\n return opts[0]?.id ?? null;\r\n }\r\n\r\n onOrgChartSelectChange(chartId: string | null): void {\r\n this.selectedOrgChartId.set(chartId);\r\n this.selectedChartId$.next(chartId);\r\n }\r\n\r\n get levelOptions(): SharePanelLevelOption[] {\r\n const p = this.permissionLevels;\r\n return p && p.length > 0 ? p : SHARE_PANEL_DEFAULT_FILE_LEVELS;\r\n }\r\n\r\n refreshPermissions(): void {\r\n this.loading.set(true);\r\n this.loadPermissions()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (perms) => {\r\n this.permissions.set(perms);\r\n this.loading.set(false);\r\n },\r\n error: () => {\r\n this.permissions.set([]);\r\n this.loading.set(false);\r\n },\r\n });\r\n }\r\n\r\n onSearchInput(): void {\r\n if (this.searchTimeout) clearTimeout(this.searchTimeout);\r\n const query = this.searchQuery.trim();\r\n if (query.length < 2) {\r\n this.searchResults.set([]);\r\n return;\r\n }\r\n\r\n this.searchTimeout = setTimeout(() => {\r\n this.searchUsers(query)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (items) => this.searchResults.set(items),\r\n error: () => this.searchResults.set([]),\r\n });\r\n }, 300);\r\n }\r\n\r\n onGrantToUser(user: ShareUserResult): void {\r\n this.searchResults.set([]);\r\n this.searchQuery = '';\r\n const isDeny = this.supportsDeny && this.addAsDeny;\r\n this.grantToUser(user.id, this.newLevel, this.applyToChildren, isDeny)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: () => {\r\n // Reset deny toggle after each successful grant so allow is the default for the\r\n // next pick. Preserves the level dropdown which is genuinely sticky.\r\n this.addAsDeny = false;\r\n this.refreshPermissions();\r\n },\r\n });\r\n }\r\n\r\n onGrantToOu(ou: ShareOuNode): void {\r\n const isDeny = this.supportsDeny && this.addAsDeny;\r\n this.grantToOu(ou.id, this.newLevel, this.applyToChildren, isDeny)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: () => {\r\n this.addAsDeny = false;\r\n this.refreshPermissions();\r\n },\r\n });\r\n }\r\n\r\n /**\r\n * Add a role grant. Resolves to the role-OU UUID and dispatches via {@link grantToOu}\r\n * so the backend stores it as a plain OU grant; PermissionResolver matches it at access\r\n * time via the user's effective OU set (apps-chart computed-from-role membership).\r\n */\r\n onGrantToRole(role: RoleOuLookupRow): void {\r\n const isDeny = this.supportsDeny && this.addAsDeny;\r\n this.grantToOu(role.ouId, this.newLevel, this.applyToChildren, isDeny)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: () => {\r\n this.addAsDeny = false;\r\n this.roleSearchQuery = '';\r\n this.refreshPermissions();\r\n },\r\n });\r\n }\r\n\r\n /** Filtered role list — empty query returns all roles, otherwise case-insensitive substring match. */\r\n filteredRoles(): RoleOuLookupRow[] {\r\n const q = this.roleSearchQuery.trim().toLowerCase();\r\n const all = this.roleOus();\r\n if (!q) return all;\r\n return all.filter(\r\n (r) =>\r\n r.displayName.toLowerCase().includes(q)\r\n || r.roleKey.toLowerCase().includes(q)\r\n || r.appId.toLowerCase().includes(q),\r\n );\r\n }\r\n\r\n onUpdateLevel(perm: SharePermissionEntry, level: string): void {\r\n this.updatePermission(perm.id, level)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({ next: () => this.refreshPermissions() });\r\n }\r\n\r\n onRevokePermission(perm: SharePermissionEntry): void {\r\n this.revokePermission(perm.id)\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({ next: () => this.refreshPermissions() });\r\n }\r\n\r\n getPermIcon(perm: SharePermissionEntry): string {\r\n // Deny rows take a distinct icon regardless of principal kind so the operator can\r\n // scan a long permission list and immediately spot revocations.\r\n if (perm.isDeny) return 'pi pi-ban';\r\n // Reverse-translate: an OuPrincipal whose ouId matches a known role-OU should render\r\n // as a role chip, even though the host stored it as an OU grant.\r\n if (perm.principal.kind === 'ou' && this.roleOusByOuId()[perm.principal.ouId]) {\r\n return 'pi pi-id-card';\r\n }\r\n return SharePanelComponent.principalIcon(perm.principal);\r\n }\r\n\r\n /** Maps a principal kind to its display icon. Static so hosts can reuse for menus. */\r\n static principalIcon(principal: SharePrincipal): string {\r\n switch (principal.kind) {\r\n case 'user': return 'pi pi-user';\r\n case 'role': return 'pi pi-id-card';\r\n case 'ou': return 'pi pi-sitemap';\r\n case 'app-everyone': return 'pi pi-globe';\r\n }\r\n }\r\n\r\n /** Logical start padding for OU hierarchy (roots align with section padding). */\r\n ouIndentStartPx(ou: ShareOuNode): number {\r\n const d = ou.depth ?? 0;\r\n return 12 + d * 18;\r\n }\r\n\r\n getPermLabel(perm: SharePermissionEntry): string {\r\n const p = perm.principal;\r\n if (p.displayName?.trim()) return p.displayName.trim();\r\n switch (p.kind) {\r\n case 'user':\r\n return `${p.userId.substring(0, 8)}…`;\r\n case 'role':\r\n // Hosts SHOULD pre-resolve role display names — this branch is the\r\n // worst-case fallback for an unresolved key.\r\n return `${p.appId}:${p.roleKey}`;\r\n case 'ou': {\r\n // Reverse-translate: if this OU id matches a known apps-chart role-OU, render\r\n // as the semantic role label instead of the opaque OU name.\r\n const role = this.roleOusByOuId()[p.ouId];\r\n if (role) return role.displayName;\r\n\r\n const fromDefault = this.ouLabelById()[p.ouId];\r\n if (fromDefault) return fromDefault;\r\n const ou = this.ouTree().find((o) => o.id === p.ouId);\r\n if (ou) return ou.displayName;\r\n return `${p.ouId.substring(0, 8)}…`;\r\n }\r\n case 'app-everyone':\r\n return p.appId === '*' ? this.i18n.t(this.everyoneLabelKey) : p.appId;\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * One row in the role-OU lookup table the share panel uses to render OU grants as Role\r\n * chips and to drive the \"Add role\" picker. Hosts source this from\r\n * <c>OrgStructureApiService.listRoleOus()</c> in the desktop shell.\r\n */\r\nexport interface RoleOuLookupRow {\r\n /** Apps-chart role-OU UUID — what backend stores in `grantedToOuId` / `sharedWithOuId`. */\r\n ouId: string;\r\n appId: string;\r\n roleKey: string;\r\n /** Display name resolved by the host (e.g. \"FFO\" or \"Future Foresight Officer\"). */\r\n displayName: string;\r\n}\r\n","<div class=\"fac-overlay\">\r\n <div class=\"fac-overlay-backdrop\" role=\"button\" tabindex=\"0\"\r\n [attr.aria-label]=\"'files.share.close' | translate\"\r\n (click)=\"emitClosed()\"\r\n (keydown.enter)=\"emitClosed()\"\r\n (keydown.space)=\"onOverlayBackdropSpace($event)\"></div>\r\n <div class=\"fac-panel\">\r\n <div class=\"fac-header\">\r\n <h3>{{ titleKey | translate }}</h3>\r\n <span class=\"fac-target-name\">{{ targetName }}</span>\r\n <button\r\n type=\"button\"\r\n class=\"fac-close\"\r\n (click)=\"emitClosed()\"\r\n [attr.aria-label]=\"'files.share.close' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n\r\n <div class=\"fac-add-section\">\r\n <div class=\"fac-search-row\">\r\n <input\r\n type=\"text\"\r\n class=\"fac-input\"\r\n [(ngModel)]=\"searchQuery\"\r\n (input)=\"onSearchInput()\"\r\n [placeholder]=\"'files.share.search_placeholder' | translate\"\r\n [attr.aria-label]=\"'files.share.search_users' | translate\"\r\n />\r\n <select class=\"fac-select\" [(ngModel)]=\"newLevel\">\r\n @for (opt of levelOptions; track opt.value) {\r\n <option [value]=\"opt.value\">{{ opt.labelKey | translate }}</option>\r\n }\r\n </select>\r\n </div>\r\n\r\n @if (searchResults().length > 0) {\r\n <div class=\"fac-search-results\">\r\n @for (result of searchResults(); track result.id) {\r\n <button type=\"button\" class=\"fac-search-item\" (click)=\"onGrantToUser(result)\">\r\n <i class=\"pi pi-user\" aria-hidden=\"true\"></i>\r\n <span>{{ result.firstName }} {{ result.lastName }}</span>\r\n <span class=\"fac-email\">{{ result.email }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if (chartOptions().length > 0) {\r\n <div class=\"fac-chart-row\">\r\n <label for=\"fac-org-chart-select\" class=\"fac-section-label\">{{\r\n 'files.share.org_chart' | translate\r\n }}</label>\r\n <select\r\n id=\"fac-org-chart-select\"\r\n class=\"fac-select\"\r\n [ngModel]=\"selectedOrgChartId()\"\r\n (ngModelChange)=\"onOrgChartSelectChange($event)\">\r\n @for (opt of chartOptions(); track $index) {\r\n <option [ngValue]=\"opt.id\">{{ opt.name }}</option>\r\n }\r\n </select>\r\n </div>\r\n }\r\n\r\n @if (showOuPicker()) {\r\n <div class=\"fac-ou-section\">\r\n <div class=\"fac-section-label\">{{ 'files.share.share_with_ou' | translate }}</div>\r\n @for (ou of ouTree(); track ou.id) {\r\n <button\r\n type=\"button\"\r\n class=\"fac-ou-item\"\r\n [style.padding-inline-start.px]=\"ouIndentStartPx(ou)\"\r\n (click)=\"onGrantToOu(ou)\"\r\n [attr.aria-label]=\"('files.share.share_with_ou_named' | translate) + ' ' + ou.displayName\"\r\n >\r\n <i class=\"pi pi-sitemap\" aria-hidden=\"true\"></i>\r\n <span dir=\"auto\">{{ ou.displayName }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if (loadRoleOus && roleOus().length > 0) {\r\n <div class=\"fac-role-section\">\r\n <div class=\"fac-section-label\">{{ 'files.share.share_with_role' | translate }}</div>\r\n <input\r\n type=\"text\"\r\n class=\"fac-input\"\r\n [(ngModel)]=\"roleSearchQuery\"\r\n [placeholder]=\"'files.share.role_search_placeholder' | translate\"\r\n [attr.aria-label]=\"'files.share.search_roles' | translate\"\r\n [hidden]=\"!showRolePicker()\" />\r\n @if (showRolePicker()) {\r\n <div class=\"fac-role-list\">\r\n @for (role of filteredRoles(); track role.ouId) {\r\n <button\r\n type=\"button\"\r\n class=\"fac-role-item\"\r\n (click)=\"onGrantToRole(role)\"\r\n [attr.aria-label]=\"('files.share.share_with_role_named' | translate) + ' ' + role.displayName\">\r\n <i class=\"pi pi-id-card\" aria-hidden=\"true\"></i>\r\n <span dir=\"auto\">{{ role.displayName }}</span>\r\n <span class=\"fac-role-app\">{{ role.appId }}</span>\r\n </button>\r\n }\r\n @if (filteredRoles().length === 0) {\r\n <div class=\"fac-empty\">{{ 'files.share.no_roles_match' | translate }}</div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n }\r\n\r\n <div class=\"fac-toggle-row\">\r\n <button type=\"button\" class=\"fac-link\" (click)=\"showOuPicker.set(!showOuPicker())\">\r\n {{ showOuPicker() ? ('files.share.hide_ous' | translate) : ('files.share.show_ous' | translate) }}\r\n </button>\r\n @if (loadRoleOus && roleOus().length > 0) {\r\n <button type=\"button\" class=\"fac-link\" (click)=\"showRolePicker.set(!showRolePicker())\">\r\n {{ showRolePicker() ? ('files.share.hide_roles' | translate) : ('files.share.show_roles' | translate) }}\r\n </button>\r\n }\r\n @if (showApplyToChildren) {\r\n <label class=\"fac-checkbox-label\">\r\n <input type=\"checkbox\" [(ngModel)]=\"applyToChildren\" />\r\n {{ 'files.share.apply_children' | translate }}\r\n </label>\r\n }\r\n @if (supportsDeny) {\r\n <label class=\"fac-checkbox-label fac-deny-toggle\"\r\n [title]=\"'files.share.deny_help' | translate\">\r\n <input type=\"checkbox\" [(ngModel)]=\"addAsDeny\" />\r\n <i class=\"pi pi-ban\" aria-hidden=\"true\"></i>\r\n {{ 'files.share.add_as_deny' | translate }}\r\n </label>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"fac-perms-section\">\r\n <div class=\"fac-section-label\">{{ 'files.share.current_permissions' | translate }}</div>\r\n @if (loading()) {\r\n <div class=\"fac-loading\"><i class=\"pi pi-spin pi-spinner\" aria-hidden=\"true\"></i></div>\r\n } @else if (permissions().length === 0) {\r\n <div class=\"fac-empty\">{{ 'files.share.no_permissions' | translate }}</div>\r\n } @else {\r\n @for (perm of permissions(); track perm.id) {\r\n <div class=\"fac-perm-row\" [class.fac-perm-row-deny]=\"perm.isDeny\">\r\n <div class=\"fac-perm-info\">\r\n <i [class]=\"getPermIcon(perm)\" aria-hidden=\"true\"></i>\r\n <span class=\"fac-perm-name\" dir=\"auto\">{{ getPermLabel(perm) }}</span>\r\n @if (perm.isDeny) {\r\n <span class=\"fac-badge deny\">{{ 'files.share.denied' | translate }}</span>\r\n }\r\n @if (perm.isInherited) {\r\n <span class=\"fac-badge inherited\">{{ 'files.share.inherited' | translate }}</span>\r\n }\r\n </div>\r\n <div class=\"fac-perm-actions\">\r\n @if (!perm.isDeny) {\r\n <select\r\n class=\"fac-select sm\"\r\n [ngModel]=\"perm.level\"\r\n (ngModelChange)=\"onUpdateLevel(perm, $event)\"\r\n [disabled]=\"perm.isInherited === true\"\r\n >\r\n @for (opt of levelOptions; track opt.value) {\r\n <option [value]=\"opt.value\">{{ opt.labelKey | translate }}</option>\r\n }\r\n </select>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"fac-icon-btn danger\"\r\n (click)=\"onRevokePermission(perm)\"\r\n [disabled]=\"perm.isInherited === true\"\r\n [title]=\"'files.share.revoke' | translate\"\r\n >\r\n <i class=\"pi pi-trash\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n</div>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n DestroyRef,\r\n EventEmitter,\r\n forwardRef,\r\n inject,\r\n Input,\r\n OnChanges,\r\n OnDestroy,\r\n OnInit,\r\n Output,\r\n signal,\r\n SimpleChanges,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport {\r\n ControlValueAccessor,\r\n FormsModule,\r\n NG_VALIDATORS,\r\n NG_VALUE_ACCESSOR,\r\n Validator,\r\n AbstractControl,\r\n ValidationErrors,\r\n} from '@angular/forms';\r\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\r\nimport { Observable, ReplaySubject, Subject } from 'rxjs';\r\nimport { debounceTime, distinctUntilChanged, filter, switchMap } from 'rxjs/operators';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { I18nService } from '../../services/i18n.service';\r\nimport {\r\n AppEveryoneTerm,\r\n AudienceFilter,\r\n AudienceTerm,\r\n AudienceTermKind,\r\n AUDIENCE_LIMITS,\r\n AUDIENCE_PRESETS,\r\n AudiencePresetKind,\r\n ChartTerm,\r\n OuTerm,\r\n PresetTerm,\r\n RolesTerm,\r\n UsersTerm,\r\n} from '../../models/audience.model';\r\nimport type {\r\n ShareOrgChartOption,\r\n ShareOuNode,\r\n ShareUserResult,\r\n} from '../../models/share-panel.model';\r\nimport type { RoleOuLookupRow } from '../share-panel/share-panel.component';\r\n\r\n/** Bucket the picker is currently editing. Exported so hosts can drive `editTarget` if needed. */\r\nexport type AudienceEditTarget = 'includes' | 'excludes';\r\n\r\n/**\r\n * Strongly-typed context for the term-card `<ng-template>`. Without an explicit interface\r\n * the template's `let-term` falls back to `any`, defeating the discriminated-union narrowing\r\n * inside `@switch (term.kind)`. The `track` expression on the parent `@for` reads\r\n * `target` and `index` through this same context shape.\r\n */\r\ninterface TermCardContext {\r\n $implicit: AudienceTerm;\r\n target: AudienceEditTarget;\r\n index: number;\r\n}\r\n\r\n/**\r\n * Generic builder for {@link AudienceFilter}. Accepts an initial value, emits both the\r\n * full filter and a validity flag on every change. Reuses the same callback shapes as\r\n * {@link SharePanelComponent} so a host already wiring the share panel can drop this in\r\n * with no extra plumbing.\r\n *\r\n * Compaction policy: when the operator picks the same kind multiple times, the component\r\n * merges into a single term where it's safe to do so:\r\n * <list type=\"bullet\">\r\n * <item><b>users</b>: dedupes user ids into one {@link UsersTerm}.</item>\r\n * <item><b>roles</b>: per `appId`, dedupes role keys into one {@link RolesTerm}.</item>\r\n * <item><b>ou</b>: per `(chartId, includeDescendants)`, dedupes OU ids into one {@link OuTerm}.</item>\r\n * <item><b>app-everyone / chart / preset</b>: idempotent per kind+key.</item>\r\n * </list>\r\n * This keeps the term count well below {@link AUDIENCE_LIMITS.maxTermsPerFilter} for typical\r\n * use, and matches how the backend resolver would have unioned them anyway.\r\n */\r\n@Component({\r\n selector: 'fly-audience-builder',\r\n standalone: true,\r\n imports: [CommonModule, FormsModule, TranslatePipe],\r\n templateUrl: './audience-builder.component.html',\r\n styleUrl: './audience-builder.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n useExisting: forwardRef(() => AudienceBuilderComponent),\r\n multi: true,\r\n },\r\n {\r\n provide: NG_VALIDATORS,\r\n useExisting: forwardRef(() => AudienceBuilderComponent),\r\n multi: true,\r\n },\r\n ],\r\n})\r\nexport class AudienceBuilderComponent\r\n implements OnInit, OnChanges, OnDestroy, ControlValueAccessor, Validator {\r\n /** Initial audience filter. Two-way: changes emit via {@link audienceChange}. */\r\n @Input() value: AudienceFilter | null | undefined = { includes: [] };\r\n\r\n /** Hide the Excludes section entirely (e.g. for simple \"send to\" pickers). */\r\n @Input() showExcludes = true;\r\n\r\n /**\r\n * Which term kinds are selectable. Defaults to all six. Hosts that don't have a\r\n * concept of `chart` or `preset` should narrow this down to keep the UI focused.\r\n */\r\n @Input() supportedKinds: readonly AudienceTermKind[] = [\r\n 'users',\r\n 'roles',\r\n 'ou',\r\n 'app-everyone',\r\n 'chart',\r\n 'preset',\r\n ];\r\n\r\n /**\r\n * Anchor user id used when adding a `preset` term. Typically `auth.currentUser().id`.\r\n * If null and the operator picks a preset, the term is rejected with an inline error.\r\n */\r\n @Input() selfUserId: string | null = null;\r\n\r\n /** App ids the host wants to expose as `app-everyone` options. */\r\n @Input() appEveryoneOptions: { appId: string; displayName: string }[] = [];\r\n\r\n // ── Picker callbacks (same shapes as SharePanelComponent) ────────────────────\r\n\r\n @Input({ required: true }) searchUsers!: (query: string) => Observable<ShareUserResult[]>;\r\n\r\n @Input({ required: true })\r\n loadOuTree!: (chartId: string | null) => Observable<ShareOuNode[]>;\r\n\r\n @Input({ required: true }) loadChartOptions!: () => Observable<ShareOrgChartOption[]>;\r\n\r\n /**\r\n * Initial chart selection for the OU picker. Resolution order:\r\n * <list type=\"number\">\r\n * <item>If <see cref=\"defaultChartId\"/> is explicitly provided (string or null), use it.</item>\r\n * <item>Else if <see cref=\"defaultChartSystemKey\"/> is set, pick the first option whose\r\n * <c>systemKey</c> matches (e.g. <c>'apps'</c> → the platform Apps chart).</item>\r\n * <item>Else fall back to <c>options[0]?.id ?? null</c> (host-defined default order).</item>\r\n * </list>\r\n * Hosts that already know the tenant-scoped chart Guid use {@link defaultChartId};\r\n * hosts that only know the semantic kind (typically <c>'apps'</c>) use\r\n * {@link defaultChartSystemKey}.\r\n */\r\n @Input() defaultChartSystemKey?: string | null;\r\n\r\n /**\r\n * Hard-coded chart id to pre-select. Takes priority over {@link defaultChartSystemKey}.\r\n * Use <c>null</c> to force the default/official chart (id null) even when other charts\r\n * are listed first.\r\n */\r\n @Input() defaultChartId?: string | null;\r\n\r\n /**\r\n * Optional apps-chart role-OU index. When supplied, the picker exposes a \"Roles\" tab\r\n * surfacing role chips; without it, that tab is hidden even if `'roles'` is in\r\n * {@link supportedKinds}.\r\n */\r\n @Input() loadRoleOus?: () => Observable<RoleOuLookupRow[]>;\r\n\r\n // ── Outputs ──────────────────────────────────────────────────────────────────\r\n\r\n /** Fires on every successful add/remove with the current filter. */\r\n @Output() audienceChange = new EventEmitter<AudienceFilter>();\r\n\r\n /**\r\n * True when {@link AudienceFilter.includes} is non-empty and the term count is within\r\n * {@link AUDIENCE_LIMITS.maxTermsPerFilter}. Hosts should disable submit when false.\r\n */\r\n @Output() validityChange = new EventEmitter<boolean>();\r\n\r\n // ── Internal state (signals; computed where derived) ─────────────────────────\r\n\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly i18n = inject(I18nService);\r\n\r\n readonly includes = signal<AudienceTerm[]>([]);\r\n readonly excludes = signal<AudienceTerm[]>([]);\r\n\r\n readonly editTarget = signal<AudienceEditTarget>('includes');\r\n readonly pickerOpen = signal(false);\r\n readonly activeKind = signal<AudienceTermKind>('users');\r\n\r\n // User picker — signal-backed so OnPush + computed re-evaluates correctly. Keystrokes go\r\n // through a debounced Subject + switchMap so a slow \"fo\" result can never overwrite a\r\n // fresh \"foobar\" result (the previous setTimeout-based path had this race).\r\n readonly userSearchQuery = signal('');\r\n readonly userSearchResults = signal<ShareUserResult[]>([]);\r\n private readonly userSearch$ = new Subject<string>();\r\n\r\n // Role picker.\r\n readonly roleOus = signal<RoleOuLookupRow[]>([]);\r\n readonly roleSearchQuery = signal('');\r\n /**\r\n * Filtered role list as a `computed` so the template doesn't re-call a method on every\r\n * change-detection cycle.\r\n */\r\n readonly filteredRoles = computed<RoleOuLookupRow[]>(() => {\r\n const q = this.roleSearchQuery().trim().toLowerCase();\r\n const all = this.roleOus();\r\n if (!q) return all;\r\n return all.filter(\r\n (r) =>\r\n r.displayName.toLowerCase().includes(q)\r\n || r.roleKey.toLowerCase().includes(q)\r\n || r.appId.toLowerCase().includes(q),\r\n );\r\n });\r\n\r\n // OU picker.\r\n readonly ouTree = signal<ShareOuNode[]>([]);\r\n readonly chartOptions = signal<ShareOrgChartOption[]>([]);\r\n readonly selectedChartId = signal<string | null>(null);\r\n readonly ouIncludeDescendants = signal(false);\r\n /**\r\n * Chart-term picker entries — filters out the null-id default chart since `ChartTerm`\r\n * requires a real Guid. Avoids the UX trap where clicking \"Default Company\" surfaces\r\n * an inline error.\r\n */\r\n readonly chartTermOptions = computed<ShareOrgChartOption[]>(() =>\r\n this.chartOptions().filter((c) => c.id !== null),\r\n );\r\n private readonly selectedChartId$ = new ReplaySubject<string | null>(1);\r\n\r\n // Preset options exposed from the model so the template stays in sync with new presets.\r\n readonly presetOptions = AUDIENCE_PRESETS;\r\n\r\n // Validation surface (inline errors).\r\n readonly errorKey = signal<string | null>(null);\r\n\r\n /** True when the host disabled this control (template-driven `[disabled]` or reactive). */\r\n readonly disabled = signal(false);\r\n\r\n // ── ControlValueAccessor + Validator wiring ──────────────────────────────────\r\n // These let hosts bind the component via `formControl` / `formControlName` /\r\n // `[(ngModel)]` instead of plumbing `[value]` + `(audienceChange)` manually. The\r\n // (audienceChange) / (validityChange) outputs still fire — Angular forms infrastructure\r\n // is purely additive and template-driven hosts continue to work unchanged.\r\n private onChange: (value: AudienceFilter) => void = () => undefined;\r\n private onTouched: () => void = () => undefined;\r\n private onValidatorChange: () => void = () => undefined;\r\n\r\n // ── Lifecycle ────────────────────────────────────────────────────────────────\r\n\r\n ngOnInit(): void {\r\n // applyValue() seeds includes/excludes — defer the initial emit so we don't trigger\r\n // ExpressionChangedAfterItHasBeenChecked when a parent template binding observes\r\n // (audienceChange) / (validityChange) in the same change-detection cycle.\r\n this.applyValue(this.value, /* emitImmediate */ false);\r\n queueMicrotask(() => this.emitState());\r\n\r\n if (this.loadRoleOus) {\r\n this.loadRoleOus()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (rows) => this.roleOus.set(rows),\r\n error: () => this.roleOus.set([]),\r\n });\r\n }\r\n\r\n this.selectedChartId$\r\n .pipe(\r\n switchMap((id) => this.loadOuTree(id)),\r\n takeUntilDestroyed(this.destroyRef),\r\n )\r\n .subscribe({\r\n next: (tree) => this.ouTree.set(tree),\r\n error: () => this.ouTree.set([]),\r\n });\r\n\r\n // Debounced user search: 300ms idle → switchMap cancels any in-flight request when a\r\n // newer query arrives, killing the \"stale result overwrites fresh result\" race the old\r\n // setTimeout path had. `filter(q.length >= 2)` preserves the same UX gate.\r\n this.userSearch$\r\n .pipe(\r\n debounceTime(300),\r\n distinctUntilChanged(),\r\n filter((q) => q.length >= 2),\r\n switchMap((q) => this.searchUsers(q)),\r\n takeUntilDestroyed(this.destroyRef),\r\n )\r\n .subscribe({\r\n next: (items) => this.userSearchResults.set(items),\r\n error: () => this.userSearchResults.set([]),\r\n });\r\n\r\n this.loadChartOptions()\r\n .pipe(takeUntilDestroyed(this.destroyRef))\r\n .subscribe({\r\n next: (opts) => {\r\n this.chartOptions.set(opts);\r\n const initial = this.resolveInitialChartId(opts);\r\n this.selectedChartId.set(initial);\r\n this.selectedChartId$.next(initial);\r\n },\r\n error: () => {\r\n this.chartOptions.set([]);\r\n this.selectedChartId.set(null);\r\n this.selectedChartId$.next(null);\r\n },\r\n });\r\n\r\n if (this.supportedKinds.length > 0 && !this.supportedKinds.includes(this.activeKind())) {\r\n this.activeKind.set(this.supportedKinds[0]);\r\n }\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n // Re-hydrate when the host swaps the filter wholesale (e.g. editing a different rule).\r\n // First-mount initialisation is handled by ngOnInit so we skip the initial assignment\r\n // here. Picker UI state is also reset so a stale search query / open picker from the\r\n // previous draft doesn't bleed into the new one.\r\n //\r\n // We do NOT emit (audienceChange) / onChange — the host already KNOWS the value it\r\n // pushed. Echoing back via the change callback can create a feedback loop with two-way\r\n // bindings and reactive forms. Validity, however, may genuinely change with the new\r\n // value — emit that signal explicitly via the form-validator hook + (validityChange).\r\n if (changes['value'] && !changes['value'].firstChange) {\r\n this.applyValue(this.value, /* emitImmediate */ false);\r\n this.closePicker();\r\n this.errorKey.set(null);\r\n this.emitValidityOnly();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.userSearch$.complete();\r\n }\r\n\r\n /**\r\n * Replaces the in-component state from an external value. Null-safe — if the host\r\n * passes <c>null</c> or <c>undefined</c> (e.g. while a parent signal is loading),\r\n * we treat it as an empty filter rather than crashing.\r\n */\r\n private applyValue(v: AudienceFilter | null | undefined, emitImmediate: boolean): void {\r\n this.includes.set([...(v?.includes ?? [])]);\r\n this.excludes.set([...(v?.excludes ?? [])]);\r\n if (emitImmediate) this.emitState();\r\n }\r\n\r\n // ── Picker open/close + tabs ─────────────────────────────────────────────────\r\n\r\n openPicker(target: AudienceEditTarget): void {\r\n if (this.disabled()) return;\r\n this.editTarget.set(target);\r\n this.pickerOpen.set(true);\r\n this.errorKey.set(null);\r\n }\r\n\r\n closePicker(): void {\r\n this.pickerOpen.set(false);\r\n this.userSearchQuery.set('');\r\n this.userSearchResults.set([]);\r\n this.roleSearchQuery.set('');\r\n }\r\n\r\n selectKind(kind: AudienceTermKind): void {\r\n this.activeKind.set(kind);\r\n this.errorKey.set(null);\r\n }\r\n\r\n // ── User picker ──────────────────────────────────────────────────────────────\r\n\r\n onUserSearchInput(): void {\r\n const q = this.userSearchQuery().trim();\r\n if (q.length < 2) {\r\n this.userSearchResults.set([]);\r\n // Push the short query into the stream so distinctUntilChanged resets when the user\r\n // shortens and re-lengthens the query (otherwise \"foo\" → \"f\" → \"foo\" is a no-op).\r\n this.userSearch$.next(q);\r\n return;\r\n }\r\n this.userSearch$.next(q);\r\n }\r\n\r\n pickUser(user: ShareUserResult): void {\r\n this.addToActiveBucket((existing) => this.upsertUsersTerm(existing, user.id));\r\n this.userSearchQuery.set('');\r\n this.userSearchResults.set([]);\r\n }\r\n\r\n // ── Role picker ──────────────────────────────────────────────────────────────\r\n\r\n pickRole(role: RoleOuLookupRow): void {\r\n this.addToActiveBucket((existing) => this.upsertRolesTerm(existing, role.appId, role.roleKey));\r\n this.roleSearchQuery.set('');\r\n }\r\n\r\n // ── OU picker ────────────────────────────────────────────────────────────────\r\n\r\n onChartChange(chartId: string | null): void {\r\n this.selectedChartId.set(chartId);\r\n this.selectedChartId$.next(chartId);\r\n }\r\n\r\n pickOu(ou: ShareOuNode): void {\r\n const chartId = this.selectedChartId();\r\n const includeDescendants = this.ouIncludeDescendants();\r\n this.addToActiveBucket((existing) =>\r\n this.upsertOuTerm(existing, ou.id, chartId, includeDescendants),\r\n );\r\n }\r\n\r\n ouIndentStartPx(ou: ShareOuNode): number {\r\n const d = ou.depth ?? 0;\r\n return 12 + d * 18;\r\n }\r\n\r\n /**\r\n * Picks the chart id to seed the OU picker with. Honours explicit {@link defaultChartId}\r\n * first (even when null, since null is a valid id meaning \"default chart\"), then\r\n * {@link defaultChartSystemKey}, then falls back to host order. Lookup uses\r\n * <see cref=\"hasOwnProperty\"/> on the input keys to distinguish \"host did not set this\r\n * input\" from \"host set it to null\" — Angular reflects an unset input as <c>undefined</c>.\r\n */\r\n private resolveInitialChartId(opts: ShareOrgChartOption[]): string | null {\r\n if (this.defaultChartId !== undefined) {\r\n const exists = opts.some((o) => o.id === this.defaultChartId);\r\n return exists ? (this.defaultChartId as string | null) : (opts[0]?.id ?? null);\r\n }\r\n const key = this.defaultChartSystemKey;\r\n if (key) {\r\n const match = opts.find((o) => o.systemKey === key);\r\n if (match) return match.id;\r\n }\r\n return opts[0]?.id ?? null;\r\n }\r\n\r\n // ── App-everyone picker ──────────────────────────────────────────────────────\r\n\r\n pickAppEveryone(appId: string): void {\r\n this.addToActiveBucket((existing) => this.upsertAppEveryoneTerm(existing, appId));\r\n }\r\n\r\n // ── Chart picker ─────────────────────────────────────────────────────────────\r\n\r\n pickChart(chartId: string | null): void {\r\n if (!chartId) {\r\n this.errorKey.set('audience.error.chart_id_required');\r\n return;\r\n }\r\n this.addToActiveBucket((existing) => this.upsertChartTerm(existing, chartId));\r\n }\r\n\r\n // ── Preset picker ────────────────────────────────────────────────────────────\r\n\r\n pickPreset(preset: AudiencePresetKind): void {\r\n if (!this.selfUserId) {\r\n this.errorKey.set('audience.error.self_user_required');\r\n return;\r\n }\r\n const anchor = this.selfUserId;\r\n this.addToActiveBucket((existing) => this.upsertPresetTerm(existing, preset, anchor));\r\n }\r\n\r\n // ── Term removal ─────────────────────────────────────────────────────────────\r\n\r\n removeTerm(target: AudienceEditTarget, index: number): void {\r\n if (this.disabled()) return;\r\n const list = target === 'includes' ? this.includes() : this.excludes();\r\n const next = list.filter((_, i) => i !== index);\r\n if (target === 'includes') this.includes.set(next);\r\n else this.excludes.set(next);\r\n this.emitState();\r\n }\r\n\r\n removeUserId(target: AudienceEditTarget, termIndex: number, userId: string): void {\r\n this.editTermAt(target, termIndex, (term) => {\r\n if (term.kind !== 'users') return term;\r\n const next = term.userIds.filter((id) => id !== userId);\r\n return next.length === 0 ? null : { ...term, userIds: next };\r\n });\r\n }\r\n\r\n removeRoleKey(target: AudienceEditTarget, termIndex: number, roleKey: string): void {\r\n this.editTermAt(target, termIndex, (term) => {\r\n if (term.kind !== 'roles') return term;\r\n const next = term.roleKeys.filter((k) => k !== roleKey);\r\n return next.length === 0 ? null : { ...term, roleKeys: next };\r\n });\r\n }\r\n\r\n removeOuId(target: AudienceEditTarget, termIndex: number, ouId: string): void {\r\n this.editTermAt(target, termIndex, (term) => {\r\n if (term.kind !== 'ou') return term;\r\n const next = term.ouIds.filter((id) => id !== ouId);\r\n return next.length === 0 ? null : { ...term, ouIds: next };\r\n });\r\n }\r\n\r\n // ── Public read API ──────────────────────────────────────────────────────────\r\n\r\n /** Returns the current filter snapshot — useful for hosts that want to peek without subscribing. */\r\n snapshot(): AudienceFilter {\r\n return this.buildFilter();\r\n }\r\n\r\n // ── ControlValueAccessor implementation ──────────────────────────────────────\r\n\r\n /**\r\n * Called by the forms infrastructure to push a new value into the control. Mirrors the\r\n * `[value]` setter path — re-uses `applyValue` so template-driven and reactive callers\r\n * converge on the same hydration code.\r\n */\r\n writeValue(value: AudienceFilter | null | undefined): void {\r\n this.applyValue(value, /* emitImmediate */ false);\r\n }\r\n\r\n registerOnChange(fn: (value: AudienceFilter) => void): void {\r\n this.onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this.onTouched = fn;\r\n }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled.set(isDisabled);\r\n if (isDisabled) this.closePicker();\r\n }\r\n\r\n // ── Validator implementation ─────────────────────────────────────────────────\r\n\r\n /**\r\n * Aligns Angular's reactive-forms validity with the component's own `validityChange`\r\n * output. Returns `audienceRequired` when includes is empty (the canonical \"zero\r\n * recipients\" guard) and `audienceTooManyTerms` when over the per-filter cap.\r\n * <br>\r\n * The output-event path (<see cref=\"emitState\"/>) reuses this method so there is ONE\r\n * definition of \"valid\" — the classic \"two almost-identical validators drifted\" bug\r\n * cannot recur here.\r\n */\r\n validate(_: AbstractControl): ValidationErrors | null {\r\n return this.validateFilter(this.buildFilter());\r\n }\r\n\r\n private validateFilter(candidate: AudienceFilter): ValidationErrors | null {\r\n if (candidate.includes.length === 0) return { audienceRequired: true };\r\n const total = candidate.includes.length + (candidate.excludes?.length ?? 0);\r\n if (total > AUDIENCE_LIMITS.maxTermsPerFilter) {\r\n return { audienceTooManyTerms: { actual: total, max: AUDIENCE_LIMITS.maxTermsPerFilter } };\r\n }\r\n return null;\r\n }\r\n\r\n registerOnValidatorChange(fn: () => void): void {\r\n this.onValidatorChange = fn;\r\n }\r\n\r\n // ── Term display helpers ─────────────────────────────────────────────────────\r\n\r\n ouLabel(ouId: string): string {\r\n const match = this.ouTree().find((o) => o.id === ouId);\r\n return match?.displayName ?? `${ouId.substring(0, 8)}…`;\r\n }\r\n\r\n roleLabel(appId: string, roleKey: string): string {\r\n const match = this.roleOus().find((r) => r.appId === appId && r.roleKey === roleKey);\r\n return match?.displayName ?? `${appId}:${roleKey}`;\r\n }\r\n\r\n appLabel(appId: string): string {\r\n if (appId === '*') return this.i18n.t('audience.app_everyone_wildcard');\r\n const match = this.appEveryoneOptions.find((a) => a.appId === appId);\r\n return match?.displayName ?? appId;\r\n }\r\n\r\n chartLabel(chartId: string): string {\r\n const match = this.chartOptions().find((c) => c.id === chartId);\r\n return match?.name ?? `${chartId.substring(0, 8)}…`;\r\n }\r\n\r\n /**\r\n * Locale key for a term kind. Replaces hyphens with underscores so the JSON file uses\r\n * one consistent naming convention (`audience.kind_app_everyone`, not the hyphen variant).\r\n */\r\n kindLocaleKey(kind: AudienceTermKind): string {\r\n return `audience.kind_${kind.replace(/-/g, '_')}`;\r\n }\r\n\r\n /** Same convention as {@link kindLocaleKey} but for preset names. */\r\n presetLocaleKey(preset: AudiencePresetKind): string {\r\n return `audience.preset_${preset.replace(/-/g, '_')}`;\r\n }\r\n\r\n /** Picon icon CSS class for a term kind tab — kept here so the template stays declarative. */\r\n kindIconClass(kind: AudienceTermKind): string {\r\n switch (kind) {\r\n case 'users': return 'pi pi-user';\r\n case 'roles': return 'pi pi-id-card';\r\n case 'ou': return 'pi pi-sitemap';\r\n case 'app-everyone': return 'pi pi-globe';\r\n case 'chart': return 'pi pi-share-alt';\r\n case 'preset': return 'pi pi-star';\r\n }\r\n }\r\n\r\n // ── Internal helpers — upsert + state emission ───────────────────────────────\r\n\r\n private addToActiveBucket(upsert: (existing: AudienceTerm[]) => AudienceTerm[]): void {\r\n if (this.disabled()) return;\r\n const target = this.editTarget();\r\n const current = target === 'includes' ? this.includes() : this.excludes();\r\n const next = upsert(current);\r\n if (this.totalTermCount(next, target) > AUDIENCE_LIMITS.maxTermsPerFilter) {\r\n this.errorKey.set('audience.error.too_many_terms');\r\n return;\r\n }\r\n if (target === 'includes') this.includes.set(next);\r\n else this.excludes.set(next);\r\n this.errorKey.set(null);\r\n this.emitState();\r\n }\r\n\r\n private editTermAt(\r\n target: AudienceEditTarget,\r\n index: number,\r\n fn: (term: AudienceTerm) => AudienceTerm | null,\r\n ): void {\r\n if (this.disabled()) return;\r\n const list = target === 'includes' ? this.includes() : this.excludes();\r\n const term = list[index];\r\n if (!term) return;\r\n const replaced = fn(term);\r\n const next = replaced === null\r\n ? list.filter((_, i) => i !== index)\r\n : list.map((t, i) => (i === index ? replaced : t));\r\n if (target === 'includes') this.includes.set(next);\r\n else this.excludes.set(next);\r\n this.emitState();\r\n }\r\n\r\n private totalTermCount(replacement: AudienceTerm[], target: AudienceEditTarget): number {\r\n const inc = target === 'includes' ? replacement : this.includes();\r\n const exc = target === 'excludes' ? replacement : this.excludes();\r\n return inc.length + exc.length;\r\n }\r\n\r\n private upsertUsersTerm(existing: AudienceTerm[], userId: string): AudienceTerm[] {\r\n const idx = existing.findIndex((t) => t.kind === 'users');\r\n if (idx < 0) {\r\n const term: UsersTerm = { kind: 'users', userIds: [userId] };\r\n return [...existing, term];\r\n }\r\n const term = existing[idx] as UsersTerm;\r\n if (term.userIds.includes(userId)) return existing; // idempotent\r\n if (term.userIds.length >= AUDIENCE_LIMITS.maxUserIdsPerTerm) {\r\n this.errorKey.set('audience.error.too_many_users_per_term');\r\n return existing;\r\n }\r\n return existing.map((t, i) =>\r\n i === idx ? { ...term, userIds: [...term.userIds, userId] } : t,\r\n );\r\n }\r\n\r\n private upsertRolesTerm(\r\n existing: AudienceTerm[],\r\n appId: string,\r\n roleKey: string,\r\n ): AudienceTerm[] {\r\n const idx = existing.findIndex((t) => t.kind === 'roles' && t.appId === appId);\r\n if (idx < 0) {\r\n const term: RolesTerm = { kind: 'roles', appId, roleKeys: [roleKey] };\r\n return [...existing, term];\r\n }\r\n const term = existing[idx] as RolesTerm;\r\n if (term.roleKeys.includes(roleKey)) return existing;\r\n if (term.roleKeys.length >= AUDIENCE_LIMITS.maxRoleKeysPerTerm) {\r\n this.errorKey.set('audience.error.too_many_roles_per_term');\r\n return existing;\r\n }\r\n return existing.map((t, i) =>\r\n i === idx ? { ...term, roleKeys: [...term.roleKeys, roleKey] } : t,\r\n );\r\n }\r\n\r\n private upsertOuTerm(\r\n existing: AudienceTerm[],\r\n ouId: string,\r\n chartId: string | null,\r\n includeDescendants: boolean,\r\n ): AudienceTerm[] {\r\n const idx = existing.findIndex(\r\n (t) =>\r\n t.kind === 'ou'\r\n && t.chartId === chartId\r\n && t.includeDescendants === includeDescendants,\r\n );\r\n if (idx < 0) {\r\n const term: OuTerm = {\r\n kind: 'ou',\r\n ouIds: [ouId],\r\n chartId,\r\n includeDescendants,\r\n };\r\n return [...existing, term];\r\n }\r\n const term = existing[idx] as OuTerm;\r\n if (term.ouIds.includes(ouId)) return existing;\r\n if (term.ouIds.length >= AUDIENCE_LIMITS.maxOuIdsPerTerm) {\r\n this.errorKey.set('audience.error.too_many_ous_per_term');\r\n return existing;\r\n }\r\n return existing.map((t, i) =>\r\n i === idx ? { ...term, ouIds: [...term.ouIds, ouId] } : t,\r\n );\r\n }\r\n\r\n private upsertAppEveryoneTerm(existing: AudienceTerm[], appId: string): AudienceTerm[] {\r\n const exists = existing.some((t) => t.kind === 'app-everyone' && t.appId === appId);\r\n if (exists) return existing;\r\n const term: AppEveryoneTerm = { kind: 'app-everyone', appId };\r\n return [...existing, term];\r\n }\r\n\r\n private upsertChartTerm(existing: AudienceTerm[], chartId: string): AudienceTerm[] {\r\n const exists = existing.some((t) => t.kind === 'chart' && t.chartId === chartId);\r\n if (exists) return existing;\r\n const term: ChartTerm = { kind: 'chart', chartId };\r\n return [...existing, term];\r\n }\r\n\r\n private upsertPresetTerm(\r\n existing: AudienceTerm[],\r\n preset: AudiencePresetKind,\r\n anchorUserId: string,\r\n ): AudienceTerm[] {\r\n const exists = existing.some(\r\n (t) => t.kind === 'preset' && t.preset === preset && t.anchorUserId === anchorUserId,\r\n );\r\n if (exists) return existing;\r\n const term: PresetTerm = { kind: 'preset', preset, anchorUserId };\r\n return [...existing, term];\r\n }\r\n\r\n private buildFilter(): AudienceFilter {\r\n const inc = this.includes();\r\n const exc = this.excludes();\r\n return {\r\n includes: inc,\r\n ...(exc.length > 0 ? { excludes: exc } : {}),\r\n ...(this.value?.options ? { options: this.value.options } : {}),\r\n };\r\n }\r\n\r\n private emitState(): void {\r\n const filter = this.buildFilter();\r\n this.audienceChange.emit(filter);\r\n this.validityChange.emit(this.computeValidity(filter));\r\n // Forward to the forms infrastructure so reactive forms see the change.\r\n this.onChange(filter);\r\n this.onTouched();\r\n this.onValidatorChange();\r\n }\r\n\r\n /**\r\n * Emits ONLY the validity signal (component output + forms-validator hook). Used by\r\n * <see cref=\"ngOnChanges\"/> when the host pushes a new value: the host already knows the\r\n * value it sent, so re-firing onChange / audienceChange is redundant and risks feedback\r\n * loops with two-way bindings; but the validity flag may genuinely have flipped and the\r\n * host needs that to enable / disable submit.\r\n */\r\n private emitValidityOnly(): void {\r\n const filter = this.buildFilter();\r\n this.validityChange.emit(this.computeValidity(filter));\r\n this.onValidatorChange();\r\n }\r\n\r\n private computeValidity(candidate: AudienceFilter): boolean {\r\n // Single-source: delegate to validateFilter so the output flag and the form-validator\r\n // result agree by construction.\r\n return this.validateFilter(candidate) === null;\r\n }\r\n}\r\n\r\n/**\r\n * Re-export the typed template context so test code (and very advanced hosts that build\r\n * their own term cards) can refer to it without reaching into the component module.\r\n */\r\nexport type AudienceTermCardContext = TermCardContext;\r\n","<div class=\"fab-root\">\r\n\r\n <!-- Includes section -->\r\n <div class=\"fab-bucket\">\r\n <div class=\"fab-bucket-header\">\r\n <div class=\"fab-section-label\" id=\"fab-includes-label\">{{ 'audience.includes' | translate }}</div>\r\n <button\r\n type=\"button\"\r\n class=\"fab-add-btn\"\r\n (click)=\"openPicker('includes')\"\r\n [attr.aria-expanded]=\"pickerOpen() && editTarget() === 'includes'\"\r\n [attr.aria-controls]=\"pickerOpen() && editTarget() === 'includes' ? 'fab-picker-region' : null\"\r\n >\r\n <i class=\"pi pi-plus\" aria-hidden=\"true\"></i>\r\n {{ 'audience.add_term' | translate }}\r\n </button>\r\n </div>\r\n\r\n @if (includes().length === 0) {\r\n <div class=\"fab-empty\">{{ 'audience.includes_empty' | translate }}</div>\r\n } @else {\r\n <ul class=\"fab-term-list\" aria-labelledby=\"fab-includes-label\">\r\n @for (term of includes(); track term) {\r\n <li class=\"fab-term\">\r\n <ng-container\r\n *ngTemplateOutlet=\"termCard; context: { $implicit: term, target: 'includes', index: $index }\">\r\n </ng-container>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n\r\n <!-- Excludes section -->\r\n @if (showExcludes) {\r\n <div class=\"fab-bucket fab-bucket-exclude\">\r\n <div class=\"fab-bucket-header\">\r\n <div class=\"fab-section-label\" id=\"fab-excludes-label\">{{ 'audience.excludes' | translate }}</div>\r\n <button\r\n type=\"button\"\r\n class=\"fab-add-btn\"\r\n (click)=\"openPicker('excludes')\"\r\n [attr.aria-expanded]=\"pickerOpen() && editTarget() === 'excludes'\"\r\n [attr.aria-controls]=\"pickerOpen() && editTarget() === 'excludes' ? 'fab-picker-region' : null\"\r\n >\r\n <i class=\"pi pi-plus\" aria-hidden=\"true\"></i>\r\n {{ 'audience.add_term' | translate }}\r\n </button>\r\n </div>\r\n\r\n @if (excludes().length === 0) {\r\n <div class=\"fab-empty\">{{ 'audience.excludes_empty' | translate }}</div>\r\n } @else {\r\n <ul class=\"fab-term-list\" aria-labelledby=\"fab-excludes-label\">\r\n @for (term of excludes(); track term) {\r\n <li class=\"fab-term\">\r\n <ng-container\r\n *ngTemplateOutlet=\"termCard; context: { $implicit: term, target: 'excludes', index: $index }\">\r\n </ng-container>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </div>\r\n }\r\n\r\n <!-- Inline picker (shared across includes/excludes; gated by pickerOpen) -->\r\n @if (pickerOpen()) {\r\n <div\r\n id=\"fab-picker-region\"\r\n class=\"fab-picker\"\r\n role=\"region\"\r\n [attr.aria-label]=\"(editTarget() === 'includes'\r\n ? ('audience.adding_to_includes' | translate)\r\n : ('audience.adding_to_excludes' | translate))\"\r\n >\r\n <div class=\"fab-picker-header\">\r\n <span class=\"fab-picker-target\">\r\n {{\r\n editTarget() === 'includes'\r\n ? ('audience.adding_to_includes' | translate)\r\n : ('audience.adding_to_excludes' | translate)\r\n }}\r\n </span>\r\n <button type=\"button\" class=\"fab-close\" (click)=\"closePicker()\" [attr.aria-label]=\"'audience.close' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n\r\n <!-- Kind tabs -->\r\n <div class=\"fab-kind-tabs\" role=\"tablist\">\r\n @for (kind of supportedKinds; track kind) {\r\n <button\r\n type=\"button\"\r\n role=\"tab\"\r\n class=\"fab-kind-tab\"\r\n [id]=\"'fab-tab-' + kind\"\r\n [class.active]=\"activeKind() === kind\"\r\n [attr.aria-selected]=\"activeKind() === kind\"\r\n [attr.aria-controls]=\"'fab-tabpanel-' + kind\"\r\n (click)=\"selectKind(kind)\"\r\n >\r\n <i [class]=\"kindIconClass(kind)\" aria-hidden=\"true\"></i>\r\n <span>{{ kindLocaleKey(kind) | translate }}</span>\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (errorKey()) {\r\n <div class=\"fab-inline-error\" role=\"alert\">\r\n <i class=\"pi pi-exclamation-triangle\" aria-hidden=\"true\"></i>\r\n {{ errorKey()! | translate }}\r\n </div>\r\n }\r\n\r\n <!-- Per-kind picker bodies -->\r\n <div\r\n class=\"fab-picker-body\"\r\n role=\"tabpanel\"\r\n [id]=\"'fab-tabpanel-' + activeKind()\"\r\n [attr.aria-labelledby]=\"'fab-tab-' + activeKind()\"\r\n >\r\n @switch (activeKind()) {\r\n\r\n @case ('users') {\r\n <input\r\n type=\"text\"\r\n class=\"fab-input\"\r\n [ngModel]=\"userSearchQuery()\"\r\n (ngModelChange)=\"userSearchQuery.set($event); onUserSearchInput()\"\r\n [placeholder]=\"'audience.search_users_placeholder' | translate\"\r\n [attr.aria-label]=\"'audience.search_users_placeholder' | translate\"\r\n />\r\n @if (userSearchResults().length > 0) {\r\n <div class=\"fab-result-list\" role=\"list\">\r\n @for (u of userSearchResults(); track u.id) {\r\n <button type=\"button\" role=\"listitem\" class=\"fab-result-item\" (click)=\"pickUser(u)\">\r\n <i class=\"pi pi-user\" aria-hidden=\"true\"></i>\r\n <span>{{ u.firstName }} {{ u.lastName }}</span>\r\n <span class=\"fab-result-secondary\">{{ u.email }}</span>\r\n </button>\r\n }\r\n </div>\r\n } @else if (userSearchQuery().length >= 2) {\r\n <div class=\"fab-empty\">{{ 'audience.no_users_match' | translate }}</div>\r\n }\r\n }\r\n\r\n @case ('roles') {\r\n @if (loadRoleOus && roleOus().length > 0) {\r\n <input\r\n type=\"text\"\r\n class=\"fab-input\"\r\n [ngModel]=\"roleSearchQuery()\"\r\n (ngModelChange)=\"roleSearchQuery.set($event)\"\r\n [placeholder]=\"'audience.search_roles_placeholder' | translate\"\r\n [attr.aria-label]=\"'audience.search_roles_placeholder' | translate\"\r\n />\r\n <div class=\"fab-result-list\" role=\"list\">\r\n @for (role of filteredRoles(); track role.ouId) {\r\n <button type=\"button\" role=\"listitem\" class=\"fab-result-item\" (click)=\"pickRole(role)\">\r\n <i class=\"pi pi-id-card\" aria-hidden=\"true\"></i>\r\n <span>{{ role.displayName }}</span>\r\n <span class=\"fab-result-secondary\">{{ role.appId }}</span>\r\n </button>\r\n }\r\n @if (filteredRoles().length === 0) {\r\n <div class=\"fab-empty\">{{ 'audience.no_roles_match' | translate }}</div>\r\n }\r\n </div>\r\n } @else {\r\n <div class=\"fab-empty\">{{ 'audience.roles_unavailable' | translate }}</div>\r\n }\r\n }\r\n\r\n @case ('ou') {\r\n @if (chartOptions().length > 0) {\r\n <label for=\"fab-chart-select\" class=\"fab-mini-label\">\r\n {{ 'audience.org_chart' | translate }}\r\n </label>\r\n <select\r\n id=\"fab-chart-select\"\r\n class=\"fab-select\"\r\n [ngModel]=\"selectedChartId()\"\r\n (ngModelChange)=\"onChartChange($event)\"\r\n >\r\n @for (opt of chartOptions(); track $index) {\r\n <option [ngValue]=\"opt.id\">{{ opt.name }}</option>\r\n }\r\n </select>\r\n }\r\n <label class=\"fab-checkbox-label\">\r\n <input\r\n type=\"checkbox\"\r\n [ngModel]=\"ouIncludeDescendants()\"\r\n (ngModelChange)=\"ouIncludeDescendants.set($event)\"\r\n />\r\n {{ 'audience.include_descendants' | translate }}\r\n </label>\r\n @if (ouTree().length === 0) {\r\n <div class=\"fab-empty\">{{ 'audience.ou_tree_empty' | translate }}</div>\r\n } @else {\r\n <div class=\"fab-result-list fab-ou-tree\" role=\"list\">\r\n @for (ou of ouTree(); track ou.id) {\r\n <button\r\n type=\"button\"\r\n role=\"listitem\"\r\n class=\"fab-result-item\"\r\n [style.padding-inline-start.px]=\"ouIndentStartPx(ou)\"\r\n (click)=\"pickOu(ou)\"\r\n >\r\n <i class=\"pi pi-sitemap\" aria-hidden=\"true\"></i>\r\n <span>{{ ou.displayName }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @case ('app-everyone') {\r\n @if (appEveryoneOptions.length === 0) {\r\n <div class=\"fab-empty\">{{ 'audience.app_everyone_empty' | translate }}</div>\r\n } @else {\r\n <div class=\"fab-result-list\" role=\"list\">\r\n @for (app of appEveryoneOptions; track app.appId) {\r\n <button type=\"button\" role=\"listitem\" class=\"fab-result-item\" (click)=\"pickAppEveryone(app.appId)\">\r\n <i class=\"pi pi-globe\" aria-hidden=\"true\"></i>\r\n <span>{{ app.displayName }}</span>\r\n <span class=\"fab-result-secondary\">{{ app.appId }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @case ('chart') {\r\n @if (chartTermOptions().length === 0) {\r\n <div class=\"fab-empty\">{{ 'audience.chart_options_empty' | translate }}</div>\r\n } @else {\r\n <div class=\"fab-result-list\" role=\"list\">\r\n @for (opt of chartTermOptions(); track opt.id) {\r\n <button type=\"button\" role=\"listitem\" class=\"fab-result-item\" (click)=\"pickChart(opt.id)\">\r\n <i class=\"pi pi-share-alt\" aria-hidden=\"true\"></i>\r\n <span>{{ opt.name }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @case ('preset') {\r\n <div class=\"fab-result-list\" role=\"list\">\r\n @for (p of presetOptions; track p) {\r\n <button type=\"button\" role=\"listitem\" class=\"fab-result-item\" (click)=\"pickPreset(p)\">\r\n <i class=\"pi pi-star\" aria-hidden=\"true\"></i>\r\n <span>{{ presetLocaleKey(p) | translate }}</span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n }\r\n </div>\r\n </div>\r\n }\r\n\r\n</div>\r\n\r\n<!-- Reusable term card template, parameterised by target bucket + index for removal callbacks -->\r\n<ng-template #termCard let-term let-target=\"target\" let-index=\"index\">\r\n <div class=\"fab-term-card\" [class.fab-term-exclude]=\"target === 'excludes'\">\r\n\r\n @switch (term.kind) {\r\n @case ('users') {\r\n <div class=\"fab-term-head\">\r\n <i class=\"pi pi-user\" aria-hidden=\"true\"></i>\r\n <span class=\"fab-term-title\">\r\n {{ 'audience.term_users' | translate: { count: term.userIds.length } }}\r\n </span>\r\n <button type=\"button\" class=\"fab-icon-btn danger\" (click)=\"removeTerm(target, index)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n <div class=\"fab-term-chips\">\r\n @for (id of term.userIds; track id) {\r\n <span class=\"fab-chip\">\r\n <i class=\"pi pi-user\" aria-hidden=\"true\"></i>\r\n <span>{{ id.substring(0, 8) }}…</span>\r\n <button type=\"button\" class=\"fab-chip-x\" (click)=\"removeUserId(target, index, id)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </span>\r\n }\r\n </div>\r\n }\r\n\r\n @case ('roles') {\r\n <div class=\"fab-term-head\">\r\n <i class=\"pi pi-id-card\" aria-hidden=\"true\"></i>\r\n <span class=\"fab-term-title\">\r\n {{ 'audience.term_roles' | translate: { app: appLabel(term.appId), count: term.roleKeys.length } }}\r\n </span>\r\n <button type=\"button\" class=\"fab-icon-btn danger\" (click)=\"removeTerm(target, index)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n <div class=\"fab-term-chips\">\r\n @for (k of term.roleKeys; track k) {\r\n <span class=\"fab-chip\">\r\n <i class=\"pi pi-id-card\" aria-hidden=\"true\"></i>\r\n <span>{{ roleLabel(term.appId, k) }}</span>\r\n <button type=\"button\" class=\"fab-chip-x\" (click)=\"removeRoleKey(target, index, k)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </span>\r\n }\r\n </div>\r\n }\r\n\r\n @case ('ou') {\r\n <div class=\"fab-term-head\">\r\n <i class=\"pi pi-sitemap\" aria-hidden=\"true\"></i>\r\n <span class=\"fab-term-title\">\r\n {{ 'audience.term_ous' | translate: { count: term.ouIds.length } }}\r\n @if (term.includeDescendants) {\r\n <span class=\"fab-badge\">{{ 'audience.descendants_badge' | translate }}</span>\r\n }\r\n </span>\r\n <button type=\"button\" class=\"fab-icon-btn danger\" (click)=\"removeTerm(target, index)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n <div class=\"fab-term-chips\">\r\n @for (id of term.ouIds; track id) {\r\n <span class=\"fab-chip\">\r\n <i class=\"pi pi-sitemap\" aria-hidden=\"true\"></i>\r\n <span>{{ ouLabel(id) }}</span>\r\n <button type=\"button\" class=\"fab-chip-x\" (click)=\"removeOuId(target, index, id)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </span>\r\n }\r\n </div>\r\n }\r\n\r\n @case ('app-everyone') {\r\n <div class=\"fab-term-head\">\r\n <i class=\"pi pi-globe\" aria-hidden=\"true\"></i>\r\n <span class=\"fab-term-title\">\r\n {{ 'audience.term_app_everyone' | translate: { app: appLabel(term.appId) } }}\r\n </span>\r\n <button type=\"button\" class=\"fab-icon-btn danger\" (click)=\"removeTerm(target, index)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n\r\n @case ('chart') {\r\n <div class=\"fab-term-head\">\r\n <i class=\"pi pi-share-alt\" aria-hidden=\"true\"></i>\r\n <span class=\"fab-term-title\">\r\n {{ 'audience.term_chart' | translate: { chart: chartLabel(term.chartId) } }}\r\n </span>\r\n <button type=\"button\" class=\"fab-icon-btn danger\" (click)=\"removeTerm(target, index)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n\r\n @case ('preset') {\r\n <div class=\"fab-term-head\">\r\n <i class=\"pi pi-star\" aria-hidden=\"true\"></i>\r\n <span class=\"fab-term-title\">\r\n {{ presetLocaleKey(term.preset) | translate }}\r\n </span>\r\n <button type=\"button\" class=\"fab-icon-btn danger\" (click)=\"removeTerm(target, index)\"\r\n [attr.aria-label]=\"'audience.remove_term' | translate\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n </div>\r\n }\r\n }\r\n </div>\r\n</ng-template>\r\n","import { Component, ChangeDetectionStrategy, computed, input } from '@angular/core';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\n\r\n/** Full-bleed loading overlay for window content (shell) or embedded hosts. */\r\n@Component({\r\n selector: 'fly-block-ui',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n templateUrl: './block-ui.component.html',\r\n styleUrl: './block-ui.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n})\r\nexport class FlyBlockUiComponent {\r\n /** When false, the overlay is not rendered (host may use @if instead). */\r\n active = input.required<boolean>();\r\n\r\n /** i18n key for status text; empty uses `common.loading`. */\r\n messageKey = input('');\r\n\r\n readonly resolvedMessageKey = computed(() => {\r\n const k = this.messageKey()?.trim();\r\n return k && k.length > 0 ? k : 'common.loading';\r\n });\r\n}\r\n","@if (active()) {\r\n <div\r\n class=\"fly-block-ui\"\r\n role=\"status\"\r\n aria-live=\"polite\"\r\n aria-busy=\"true\"\r\n [attr.aria-label]=\"resolvedMessageKey() | translate\">\r\n <div class=\"fly-block-ui__card\">\r\n <i class=\"pi pi-spin pi-spinner fly-block-ui__spinner\" aria-hidden=\"true\"></i>\r\n <span class=\"fly-block-ui__text\">{{ resolvedMessageKey() | translate }}</span>\r\n </div>\r\n </div>\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\n\r\n/**\r\n * `<fly-card-grid>` — a responsive grid for {@link FlyCardComponent} (or anything else).\r\n *\r\n * It has no breakpoints. Columns come from `auto-fill` against `minColumnWidth`, so the\r\n * grid reflows against the width it actually has rather than the width of the viewport.\r\n * That matters here more than usual: cards render inside desktop-shell windows the user\r\n * resizes freely, and a viewport-breakpoint grid is wrong the moment a window is not\r\n * full-screen.\r\n *\r\n * The app-surface `fly-card` is a `role=\"listitem\"` whenever it is interactive, which is\r\n * only valid inside a list container — so put `role=\"list\"` on the grid. This component\r\n * does not set it itself: a grid of inert cards is not a list, and a wrong ARIA role is\r\n * worse than none.\r\n *\r\n * ```html\r\n * <fly-card-grid role=\"list\" [minColumnWidth]=\"240\">\r\n * @for (tip of tips(); track tip.id) {\r\n * <fly-card layout=\"column\" (activated)=\"open(tip)\">\r\n * <fly-card-title>{{ tip.title }}</fly-card-title>\r\n * </fly-card>\r\n * }\r\n * </fly-card-grid>\r\n * ```\r\n *\r\n * Grid flow is direction-agnostic, so RTL mirrors automatically with no overrides.\r\n */\r\n@Component({\r\n selector: 'fly-card-grid',\r\n standalone: true,\r\n template: '<ng-content />',\r\n styleUrl: './card-grid.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[style.--fly-card-grid-min]': 'minColumnWidth() + \"px\"',\r\n '[style.--fly-card-grid-gap]': 'gap() + \"px\"',\r\n '[class.fly-card-grid--stretch]': 'stretch()',\r\n },\r\n})\r\nexport class FlyCardGridComponent {\r\n /**\r\n * Narrowest a column may get before the grid drops one. This is the only sizing knob:\r\n * pick the width at which your card's title stops being readable.\r\n */\r\n minColumnWidth = input<number>(220);\r\n\r\n /** Gap between cards, in pixels, applied on both axes. */\r\n gap = input<number>(14);\r\n\r\n /**\r\n * When true, a final short row stretches its cards to fill the width instead of\r\n * leaving a gap. Off by default — a stretched single leftover card looks like a\r\n * different component, which is usually worse than the gap.\r\n */\r\n stretch = input<boolean>(false);\r\n}\r\n","import { ChangeDetectionStrategy, Component, computed, inject, input, output } from '@angular/core';\r\nimport { I18nService } from '../../services/i18n.service';\r\n\r\n/** One crumb in a {@link FlyBreadcrumbComponent}. */\r\nexport interface FlyBreadcrumbItem {\r\n id: string;\r\n label: string;\r\n /** When set, the crumb renders as a real `<a>`. Omit for a `<button>` (e.g. a client-side handler with no addressable URL). */\r\n href?: string;\r\n}\r\n\r\n/** An overflow-collapsed middle crumb — never interactive, never emitted by {@link FlyBreadcrumbComponent.navigate}. */\r\ninterface FlyBreadcrumbOverflowMarker {\r\n kind: 'overflow';\r\n}\r\n\r\ntype FlyBreadcrumbRenderItem =\r\n | { kind: 'item'; item: FlyBreadcrumbItem; isCurrent: boolean }\r\n | FlyBreadcrumbOverflowMarker;\r\n\r\n/**\r\n * `<fly-breadcrumb>` — an ordered trail of ancestor links ending at the current page.\r\n *\r\n * The **last item is always the current page**: it renders as plain text with\r\n * `aria-current=\"page\"`, never as a link or button, even if it carries an `href` —\r\n * a breadcrumb that lets you \"navigate\" to the page you're already on is a common,\r\n * confusing bug this rules out structurally rather than by convention.\r\n *\r\n * Renders a real `<a>` when an item has `href` (so it can be opened in a new tab,\r\n * copied, and is announced as a link), a real `<button>` otherwise. Pick `href` when the\r\n * crumb points at an addressable place, not merely at in-window state.\r\n *\r\n * ```html\r\n * <fly-breadcrumb [items]=\"trail\" (navigate)=\"go($event)\" />\r\n * ```\r\n *\r\n * ## Overflow\r\n * Past {@link maxVisible} items, the middle collapses into one non-interactive \"…\"\r\n * crumb, always keeping the first item (the root) and the last two (parent + current\r\n * page) — the three positions a user actually orients by.\r\n */\r\n@Component({\r\n selector: 'fly-breadcrumb',\r\n standalone: true,\r\n templateUrl: './breadcrumb.component.html',\r\n styleUrl: './breadcrumb.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[attr.dir]': 'i18n.direction()',\r\n },\r\n})\r\nexport class FlyBreadcrumbComponent {\r\n protected readonly i18n = inject(I18nService);\r\n\r\n /** The trail, root first, current page last. */\r\n readonly items = input<readonly FlyBreadcrumbItem[]>([]);\r\n\r\n /** How many items may render before the middle collapses. */\r\n readonly maxVisible = input<number>(4);\r\n\r\n /** Overrides the `<nav>` accessible name. `''` ⇒ the localized `breadcrumb.label` baseline. */\r\n readonly ariaLabel = input<string>('');\r\n\r\n /**\r\n * Whether the final item IS the current page.\r\n *\r\n * `true` (default, unchanged behaviour): the last crumb renders as plain text carrying\r\n * `aria-current=\"page\"` — correct when the trail ends at the page you are on.\r\n *\r\n * `false`: the trail is a pure \"way back\" — it lists only ANCESTORS, because the page's\r\n * own title is already the heading and repeating it as a dead crumb is noise. Every item\r\n * then stays navigable and nothing claims `aria-current`, which is the honest markup:\r\n * `aria-current=\"page\"` on a crumb that is not the current page misinforms a screen reader.\r\n */\r\n readonly hasCurrentPage = input<boolean>(true);\r\n\r\n /** Fires when a non-final crumb is activated. Never fires for the current page or the overflow marker. */\r\n readonly navigate = output<FlyBreadcrumbItem>();\r\n\r\n protected readonly resolvedAriaLabel = computed(\r\n () => this.ariaLabel().trim() || this.i18n.t('breadcrumb.label'),\r\n );\r\n\r\n /**\r\n * The items to render, with the middle collapsed into a single overflow marker when\r\n * {@link items} exceeds {@link maxVisible}. Always keeps the first item and the last\r\n * two.\r\n */\r\n protected readonly renderItems = computed<FlyBreadcrumbRenderItem[]>(() => {\r\n const items = this.items();\r\n const max = this.maxVisible();\r\n const lastIndex = items.length - 1;\r\n // When the trail carries no current page, EVERY crumb stays a link.\r\n const current = this.hasCurrentPage();\r\n\r\n if (items.length <= max || max < 3) {\r\n return items.map((item, i) => ({ kind: 'item' as const, item, isCurrent: current && i === lastIndex }));\r\n }\r\n\r\n const first = items[0];\r\n const lastTwo = items.slice(-2);\r\n return [\r\n { kind: 'item' as const, item: first, isCurrent: false },\r\n { kind: 'overflow' as const },\r\n ...lastTwo.map((item, i) => ({\r\n kind: 'item' as const,\r\n item,\r\n isCurrent: current && i === lastTwo.length - 1,\r\n })),\r\n ];\r\n });\r\n\r\n /** Only wired to non-final crumbs in the template — the current page renders no control at all. */\r\n protected onActivate(item: FlyBreadcrumbItem): void {\r\n this.navigate.emit(item);\r\n }\r\n}\r\n","<!--\r\n The CURRENT-PAGE crumb is ALWAYS plain text with aria-current=\"page\" — never an <a>\r\n or <button>, even when it carries an href. With [hasCurrentPage]=\"false\" the trail\r\n lists ancestors only, so no crumb is the current page and every one stays a link.\r\n The separator is decorative (aria-hidden) and drawn as a CSS mask so it mirrors\r\n under RTL with no directional glyph baked in.\r\n-->\r\n<nav class=\"fly-breadcrumb\" [attr.aria-label]=\"resolvedAriaLabel()\">\r\n <ol class=\"fly-breadcrumb__list\">\r\n @for (entry of renderItems(); track entry.kind === 'item' ? entry.item.id : 'overflow'; let i = $index) {\r\n @if (i > 0) {\r\n <li class=\"fly-breadcrumb__separator\" aria-hidden=\"true\"></li>\r\n }\r\n @if (entry.kind === 'overflow') {\r\n <li class=\"fly-breadcrumb__crumb fly-breadcrumb__crumb--overflow\">…</li>\r\n } @else if (entry.isCurrent) {\r\n <li class=\"fly-breadcrumb__crumb fly-breadcrumb__crumb--current\" aria-current=\"page\">\r\n {{ entry.item.label }}\r\n </li>\r\n } @else {\r\n <li class=\"fly-breadcrumb__crumb\">\r\n @if (entry.item.href) {\r\n <a class=\"fly-breadcrumb__link\" [attr.href]=\"entry.item.href\"\r\n (click)=\"onActivate(entry.item)\">{{ entry.item.label }}</a>\r\n } @else {\r\n <button type=\"button\" class=\"fly-breadcrumb__link fly-breadcrumb__link--button\"\r\n (click)=\"onActivate(entry.item)\">{{ entry.item.label }}</button>\r\n }\r\n </li>\r\n }\r\n }\r\n </ol>\r\n</nav>\r\n","/**\r\n * Headless keyboard-navigation logic — roving focus for menus, radiogroups, and\r\n * tablists.\r\n *\r\n * These are pure functions, not components, on purpose. Every app already has its own\r\n * menu/tabs/segmented markup and styling; what it keeps getting wrong is the *logic* —\r\n * wrap-around, skipping disabled items, Home/End, and RTL mirroring. Shipping the\r\n * decision layer alone lets an app adopt correct behaviour without adopting our DOM,\r\n * which is the difference between a primitive that gets used and one that gets\r\n * reimplemented.\r\n *\r\n * The WAI-ARIA authoring practices these implement:\r\n * - Menu / listbox: vertical arrows move, wrap, and skip disabled; Home/End jump.\r\n * - Radiogroup (segmented): arrows move selection and wrap; horizontal arrows mirror\r\n * under RTL so the visual direction of travel matches the key pressed.\r\n * - Tablist: the selected tab falls back to the first tab when the selection is stale.\r\n */\r\n\r\n/** Minimal shape these helpers need — your own item type structurally satisfies it. */\r\nexport interface FlyNavigableItem {\r\n disabled?: boolean;\r\n}\r\n\r\n/**\r\n * Index of the first enabled item scanning from the given edge (`1` = from the start,\r\n * `-1` = from the end). Returns `-1` when every item is disabled.\r\n */\r\nexport function flyFirstEnabledIndex(\r\n items: readonly FlyNavigableItem[],\r\n direction: 1 | -1 = 1,\r\n): number {\r\n if (direction === -1) {\r\n for (let i = items.length - 1; i >= 0; i--) {\r\n if (!items[i].disabled) return i;\r\n }\r\n return -1;\r\n }\r\n for (let i = 0; i < items.length; i++) {\r\n if (!items[i].disabled) return i;\r\n }\r\n return -1;\r\n}\r\n\r\n/**\r\n * Roving-focus target for a **vertical menu** keydown.\r\n *\r\n * - `ArrowDown` advances, `ArrowUp` goes back — wrapping around the ends and skipping\r\n * disabled items. Vertical menus are not RTL-mirrored: down is down in every script.\r\n * - `Home` / `End` jump to the first / last enabled item.\r\n * - With no current focus (`current < 0`), `ArrowDown` starts at the first enabled item\r\n * and `ArrowUp` at the last.\r\n * - Returns `null` for any other key and when no item is enabled — the caller must not\r\n * `preventDefault()` in that case, or it will swallow type-ahead and tabbing.\r\n */\r\nexport function flyNextEnabledIndex(\r\n items: readonly FlyNavigableItem[],\r\n current: number,\r\n key: string,\r\n): number | null {\r\n if (items.length === 0 || items.every(i => i.disabled)) return null;\r\n if (key === 'Home') return flyFirstEnabledIndex(items, 1);\r\n if (key === 'End') return flyFirstEnabledIndex(items, -1);\r\n if (key !== 'ArrowDown' && key !== 'ArrowUp') return null;\r\n\r\n const step = key === 'ArrowDown' ? 1 : -1;\r\n if (current < 0) return flyFirstEnabledIndex(items, step);\r\n\r\n let i = current;\r\n do {\r\n i = (i + step + items.length) % items.length;\r\n } while (items[i].disabled && i !== current);\r\n return items[i].disabled ? null : i;\r\n}\r\n\r\n/**\r\n * Roving-focus target for a **radiogroup / segmented control** keydown.\r\n *\r\n * - `ArrowRight` / `ArrowDown` advance, `ArrowLeft` / `ArrowUp` go back, wrapping.\r\n * - Horizontal arrows mirror when `rtl` is true, so pressing the key that points at a\r\n * segment always moves to that segment regardless of script direction. Vertical\r\n * arrows never mirror.\r\n * - `Home` / `End` jump to the edges.\r\n * - With no current selection (`current < 0`), navigation starts from index 0.\r\n * - Returns `null` for any other key.\r\n *\r\n * Unlike {@link flyNextEnabledIndex} this does not skip disabled entries — a segmented\r\n * control's segments are a closed set of choices and a disabled one is still part of\r\n * the sequence for orientation. Filter the list before calling if you need skipping.\r\n */\r\nexport function flyNextSegmentIndex(\r\n current: number,\r\n key: string,\r\n length: number,\r\n rtl: boolean,\r\n): number | null {\r\n if (length === 0) return null;\r\n if (key === 'Home') return 0;\r\n if (key === 'End') return length - 1;\r\n\r\n const forward = key === 'ArrowDown' || key === (rtl ? 'ArrowLeft' : 'ArrowRight');\r\n const backward = key === 'ArrowUp' || key === (rtl ? 'ArrowRight' : 'ArrowLeft');\r\n if (!forward && !backward) return null;\r\n\r\n const base = current < 0 ? 0 : current;\r\n return forward ? (base + 1) % length : (base - 1 + length) % length;\r\n}\r\n\r\n/**\r\n * Resolves which tab is active: the selected id when it still exists in the tab set,\r\n * otherwise the first tab (or `null` when there are no tabs).\r\n *\r\n * The fallback is the point — tab sets are frequently rebuilt from data (a permission\r\n * change removes a tab, a filter empties one), and a selection pinned to a vanished id\r\n * renders an empty panel with no visible active tab.\r\n */\r\nexport function flyResolveActiveTab(\r\n ids: readonly string[],\r\n selected: string | undefined | null,\r\n): string | null {\r\n if (ids.length === 0) return null;\r\n if (selected != null && ids.includes(selected)) return selected;\r\n return ids[0];\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n model,\r\n signal,\r\n untracked,\r\n viewChildren,\r\n} from '@angular/core';\r\nimport { I18nService } from '../../services/i18n.service';\r\nimport { flyNextEnabledIndex } from '../../utils/keyboard-nav';\r\nimport type { FlyTreeNavNode } from './tree-nav.types';\r\n\r\n/** Flattened, render-order row — a section header (level 0) or a page (level 0 or 1). */\r\ninterface FlyTreeNavRow {\r\n id: string;\r\n label: string;\r\n badge?: string;\r\n level: 0 | 1;\r\n hasChildren: boolean;\r\n parentId: string | null;\r\n // Every row is navigable — explicit (not just absent) so it satisfies\r\n // `FlyNavigableItem`'s weak-type check for `flyNextEnabledIndex`.\r\n disabled: false;\r\n}\r\n\r\n/**\r\n * `<fly-tree-nav>` — a two-level disclosure navigation list: top-level sections that\r\n * expand to reveal child pages. Built for a document/guide sidebar (the motivating\r\n * consumer is the help-center reader), but generic over any `{ id, label }` tree.\r\n *\r\n * ```html\r\n * <fly-tree-nav [nodes]=\"sections()\" [(selectedId)]=\"activePageId\" />\r\n * ```\r\n *\r\n * `selectedId` is a `model()`; the automatic `selectedIdChange` output fires on every\r\n * click or keyboard activation. The section containing the current `selectedId` is\r\n * always expanded — including when `selectedId` is set programmatically (a deep link\r\n * or a \"next article\" jump), so the active page is never hidden behind a collapsed\r\n * section a moment after landing.\r\n *\r\n * ## Keyboard\r\n * Reuses {@link flyNextEnabledIndex} (the same headless roving-focus helper as every\r\n * other DS menu) over the current **visible** rows — a collapsed section's children\r\n * are not in that list, so ArrowDown/ArrowUp/Home/End can never land focus on a row\r\n * the user cannot see. Left/Right expand/collapse the focused section and mirror\r\n * under RTL: the key that means \"toward this row's children\" swaps, exactly like\r\n * {@link import('../../utils/keyboard-nav').flyNextSegmentIndex}'s horizontal\r\n * mirroring. On a leaf page, \"backward\" collapses and refocuses its parent section.\r\n */\r\n@Component({\r\n selector: 'fly-tree-nav',\r\n standalone: true,\r\n templateUrl: './tree-nav.component.html',\r\n styleUrl: './tree-nav.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[class.fly-tree-nav--rtl]': 'rtl()',\r\n },\r\n})\r\nexport class FlyTreeNavComponent {\r\n private readonly i18n = inject(I18nService);\r\n\r\n /** Two-level node list: top-level sections, each optionally holding child pages. */\r\n readonly nodes = input<FlyTreeNavNode[]>([]);\r\n\r\n /** Selected node id, either level. Two-way bindable; automatic output `selectedIdChange`. */\r\n readonly selectedId = model<string | undefined>(undefined);\r\n\r\n /** Overrides the `<nav>` accessible name. `null` ⇒ the localized \"Navigation\" baseline. */\r\n readonly ariaLabel = input<string | null>(null);\r\n\r\n protected readonly rtl = computed(() => this.i18n.isRtl());\r\n protected readonly resolvedAriaLabel = computed(\r\n () => this.ariaLabel() ?? this.i18n.t('tree_nav.nav_label'),\r\n );\r\n\r\n private readonly expandedIds = signal<ReadonlySet<string>>(new Set());\r\n\r\n private readonly rowEls = viewChildren<ElementRef<HTMLButtonElement>>('navRow');\r\n\r\n protected readonly visibleRows = computed<FlyTreeNavRow[]>(() => {\r\n const expanded = this.expandedIds();\r\n const rows: FlyTreeNavRow[] = [];\r\n for (const node of this.nodes()) {\r\n const hasChildren = !!node.children && node.children.length > 0;\r\n rows.push({\r\n id: node.id,\r\n label: node.label,\r\n badge: node.badge,\r\n level: 0,\r\n hasChildren,\r\n parentId: null,\r\n disabled: false,\r\n });\r\n if (hasChildren && expanded.has(node.id)) {\r\n for (const child of node.children ?? []) {\r\n rows.push({\r\n id: child.id,\r\n label: child.label,\r\n badge: child.badge,\r\n level: 1,\r\n hasChildren: false,\r\n parentId: node.id,\r\n disabled: false,\r\n });\r\n }\r\n }\r\n }\r\n return rows;\r\n });\r\n\r\n private readonly activeRowId = computed(\r\n () => this.selectedId() ?? this.visibleRows()[0]?.id ?? null,\r\n );\r\n\r\n constructor() {\r\n // Auto-expand the section holding the selected node — including on a\r\n // programmatic `[selectedId]` change (deep link, \"next article\" jump) — so the\r\n // active page is never rendered behind a collapsed section. This must fire ONLY\r\n // on a real `selectedId`/`nodes` change, not on every `expandedIds` write: the\r\n // read+write of `expandedIds` below is wrapped in `untracked` so the effect\r\n // doesn't re-subscribe to its own output, which would otherwise re-expand a\r\n // section the instant the user manually collapses it while its page is still\r\n // selected (Left/Right on the child, or the section's own toggle).\r\n effect(() => {\r\n const id = this.selectedId();\r\n const nodes = this.nodes();\r\n untracked(() => {\r\n if (!id) return;\r\n const parent = nodes.find((n) => n.children?.some((c) => c.id === id));\r\n if (parent && !this.expandedIds().has(parent.id)) {\r\n this.expandedIds.update((s) => new Set(s).add(parent.id));\r\n }\r\n });\r\n });\r\n }\r\n\r\n protected isExpanded(id: string): boolean {\r\n return this.expandedIds().has(id);\r\n }\r\n\r\n /** Roving tabindex: exactly one row (the selection, or the first row) is tabbable. */\r\n protected tabIndexFor(id: string): number {\r\n return id === this.activeRowId() ? 0 : -1;\r\n }\r\n\r\n protected toggle(id: string): void {\r\n this.expandedIds.update((s) => {\r\n const next = new Set(s);\r\n if (next.has(id)) next.delete(id);\r\n else next.add(id);\r\n return next;\r\n });\r\n }\r\n\r\n private expand(id: string): void {\r\n if (this.expandedIds().has(id)) return;\r\n this.expandedIds.update((s) => new Set(s).add(id));\r\n }\r\n\r\n private collapse(id: string): void {\r\n if (!this.expandedIds().has(id)) return;\r\n this.expandedIds.update((s) => {\r\n const next = new Set(s);\r\n next.delete(id);\r\n return next;\r\n });\r\n }\r\n\r\n protected select(id: string): void {\r\n this.selectedId.set(id);\r\n }\r\n\r\n protected onKeydown(event: KeyboardEvent, rowId: string): void {\r\n const rows = this.visibleRows();\r\n const idx = rows.findIndex((r) => r.id === rowId);\r\n if (idx < 0) return;\r\n const key = event.key;\r\n\r\n if (key === 'ArrowDown' || key === 'ArrowUp' || key === 'Home' || key === 'End') {\r\n const next = flyNextEnabledIndex(rows, idx, key);\r\n if (next !== null) {\r\n event.preventDefault();\r\n this.focusRow(rows[next].id);\r\n }\r\n return;\r\n }\r\n\r\n const rtl = this.rtl();\r\n const forwardKey = rtl ? 'ArrowLeft' : 'ArrowRight';\r\n const backwardKey = rtl ? 'ArrowRight' : 'ArrowLeft';\r\n const row = rows[idx];\r\n\r\n if (key === forwardKey) {\r\n if (row.hasChildren && !this.isExpanded(row.id)) {\r\n event.preventDefault();\r\n this.expand(row.id);\r\n }\r\n return;\r\n }\r\n\r\n if (key === backwardKey) {\r\n if (row.hasChildren && this.isExpanded(row.id)) {\r\n event.preventDefault();\r\n this.collapse(row.id);\r\n return;\r\n }\r\n if (row.parentId) {\r\n event.preventDefault();\r\n this.collapse(row.parentId);\r\n this.focusRow(row.parentId);\r\n }\r\n }\r\n }\r\n\r\n private focusRow(id: string): void {\r\n const rows = this.visibleRows();\r\n const idx = rows.findIndex((r) => r.id === id);\r\n if (idx < 0) return;\r\n this.rowEls()[idx]?.nativeElement.focus();\r\n }\r\n}\r\n","<nav class=\"fly-tree-nav\" [attr.aria-label]=\"resolvedAriaLabel()\">\r\n <ul class=\"fly-tree-nav__list\">\r\n @for (node of nodes(); track node.id) {\r\n <li class=\"fly-tree-nav__section\">\r\n @if (node.children && node.children.length > 0) {\r\n <button\r\n #navRow\r\n type=\"button\"\r\n class=\"fly-tree-nav__row fly-tree-nav__row--section\"\r\n [attr.aria-expanded]=\"isExpanded(node.id)\"\r\n [attr.aria-controls]=\"'fly-tree-nav-group-' + node.id\"\r\n [attr.tabindex]=\"tabIndexFor(node.id)\"\r\n (click)=\"toggle(node.id)\"\r\n (keydown)=\"onKeydown($event, node.id)\"\r\n >\r\n <i class=\"pi pi-chevron-right fly-tree-nav__chevron\" aria-hidden=\"true\"></i>\r\n <span class=\"fly-tree-nav__label\">{{ node.label }}</span>\r\n @if (node.badge) {\r\n <span class=\"fly-tree-nav__badge\">{{ node.badge }}</span>\r\n }\r\n </button>\r\n } @else {\r\n <button\r\n #navRow\r\n type=\"button\"\r\n class=\"fly-tree-nav__row fly-tree-nav__row--item\"\r\n [class.fly-tree-nav__row--selected]=\"selectedId() === node.id\"\r\n [attr.aria-current]=\"selectedId() === node.id ? 'page' : null\"\r\n [attr.tabindex]=\"tabIndexFor(node.id)\"\r\n (click)=\"select(node.id)\"\r\n (keydown)=\"onKeydown($event, node.id)\"\r\n >\r\n <span class=\"fly-tree-nav__label\">{{ node.label }}</span>\r\n @if (node.badge) {\r\n <span class=\"fly-tree-nav__badge\">{{ node.badge }}</span>\r\n }\r\n </button>\r\n }\r\n\r\n @if (node.children && node.children.length > 0 && isExpanded(node.id)) {\r\n <ul class=\"fly-tree-nav__group\" [id]=\"'fly-tree-nav-group-' + node.id\">\r\n @for (child of node.children; track child.id) {\r\n <li>\r\n <button\r\n #navRow\r\n type=\"button\"\r\n class=\"fly-tree-nav__row fly-tree-nav__row--item fly-tree-nav__row--child\"\r\n [class.fly-tree-nav__row--selected]=\"selectedId() === child.id\"\r\n [attr.aria-current]=\"selectedId() === child.id ? 'page' : null\"\r\n [attr.tabindex]=\"tabIndexFor(child.id)\"\r\n (click)=\"select(child.id)\"\r\n (keydown)=\"onKeydown($event, child.id)\"\r\n >\r\n <span class=\"fly-tree-nav__label\">{{ child.label }}</span>\r\n @if (child.badge) {\r\n <span class=\"fly-tree-nav__badge\">{{ child.badge }}</span>\r\n }\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n }\r\n </li>\r\n }\r\n </ul>\r\n</nav>\r\n","import {\r\n Component,\r\n ChangeDetectionStrategy,\r\n DestroyRef,\r\n ElementRef,\r\n afterNextRender,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n signal,\r\n} from '@angular/core';\r\nimport { I18nService } from '../../services/i18n.service';\r\n\r\n/**\r\n * Base shapes the skeleton can render. Each is a self-contained placeholder\r\n * \"cell\". Multi-column shapes tile into a responsive grid; single-column\r\n * shapes stack vertically (`count` becomes the number of rows).\r\n *\r\n * Multi-column (count = columns):\r\n * - `paragraphs` — a carded stack of text lines (title + body rows). Prose /\r\n * detail block.\r\n * - `boxes` — a rounded media rectangle (thumbnail / chart / image).\r\n * - `circles` — a circular avatar with two lines beside it (people / contacts).\r\n * - `cards` — a media box over a title + body lines (a full content card).\r\n * - `stats` — a KPI tile (small label + big number). Dashboard stat rows.\r\n *\r\n * Single-column (count = rows):\r\n * - `list` — full-width avatar rows (menus, feeds, conversation lists).\r\n * - `table` — rows of column segments (data grids / tables).\r\n * - `lines` — plain text lines with no cell chrome (inline copy).\r\n */\r\nexport type FlySkeletonShape =\r\n | 'paragraphs'\r\n | 'boxes'\r\n | 'circles'\r\n | 'cards'\r\n | 'stats'\r\n | 'list'\r\n | 'table'\r\n | 'lines';\r\n\r\n/**\r\n * Convenience presets combining a {@link FlySkeletonShape} with a count, e.g.\r\n * `paragraphs-3`, `stats-4`, `list-6`. Setting `layout` is equivalent to\r\n * setting `shape` + `count` and keeps call-sites terse for the common cases.\r\n */\r\nexport type FlySkeletonLayout =\r\n | 'paragraphs-2'\r\n | 'paragraphs-3'\r\n | 'paragraphs-4'\r\n | 'boxes-3'\r\n | 'boxes-4'\r\n | 'circles-2'\r\n | 'circles-3'\r\n | 'circles-4'\r\n | 'cards-2'\r\n | 'cards-3'\r\n | 'cards-4'\r\n | 'stats-2'\r\n | 'stats-3'\r\n | 'stats-4'\r\n | 'list-4'\r\n | 'list-6'\r\n | 'table-5'\r\n | 'table-8';\r\n\r\nexport type FlySkeletonAnimation = 'shimmer' | 'pulse' | 'none';\r\n\r\n/**\r\n * `<fly-skeleton>` — a shared, dependency-free, responsive loading placeholder.\r\n *\r\n * Drop it in place of content that is still loading. It fills its host, so any\r\n * Core App can size it by sizing the container — same component works as a\r\n * full-window loader or a small inline card.\r\n *\r\n * Pick a shape + count, or a single `layout` preset:\r\n * ```html\r\n * <fly-skeleton layout=\"paragraphs-3\" />\r\n * <fly-skeleton shape=\"circles\" [count]=\"4\" />\r\n * <fly-skeleton shape=\"cards\" [count]=\"3\" animation=\"pulse\" />\r\n * <fly-skeleton layout=\"stats-4\" [fill]=\"true\" />\r\n * ```\r\n * The cells reflow responsively (they wrap when the host is narrow), honour\r\n * `prefers-reduced-motion`, and theme automatically via DS surface tokens\r\n * (light + dark).\r\n */\r\n@Component({\r\n selector: 'fly-skeleton',\r\n standalone: true,\r\n templateUrl: './skeleton.component.html',\r\n styleUrl: './skeleton.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n // `aria-live` is implicit in role=\"status\"; when `announce` is off the\r\n // skeleton is pure decoration and hides from the accessibility tree.\r\n '[attr.role]': \"announce() ? 'status' : null\",\r\n '[attr.aria-busy]': \"announce() ? 'true' : null\",\r\n '[attr.aria-hidden]': \"announce() ? null : 'true'\",\r\n '[attr.aria-label]': 'resolvedAriaLabel()',\r\n '[class]': 'hostClass()',\r\n '[style.--fly-skeleton-count]': 'resolvedCount()',\r\n },\r\n})\r\nexport class FlySkeletonComponent {\r\n /**\r\n * Preset combining shape + count (e.g. `paragraphs-3`). When set it wins over\r\n * the individual `shape`/`count` inputs. Leave unset to drive them directly.\r\n */\r\n layout = input<FlySkeletonLayout | null>(null);\r\n\r\n /** Placeholder shape. Ignored when `layout` is set. Defaults to `paragraphs`. */\r\n shape = input<FlySkeletonShape>('paragraphs');\r\n\r\n /** Number of cells (columns for grid shapes, rows for stacked shapes). */\r\n count = input<number>(3);\r\n\r\n /** Text lines rendered inside line-bearing shapes (paragraphs/cards/lines). */\r\n lines = input<number>(3);\r\n\r\n /** Loading animation. `none` and reduced-motion render a static placeholder. */\r\n animation = input<FlySkeletonAnimation>('shimmer');\r\n\r\n /**\r\n * When true the loader fills the host's full height by **repeating rows** of\r\n * natural-height cells until the container is covered (not by stretching\r\n * individual cells). Requires a host with a bounded height. When false\r\n * (default) it renders exactly `count` cells and top-aligns them.\r\n *\r\n * Row-filling needs to measure rendered heights, so it is driven by a\r\n * `ResizeObserver`; in non-DOM environments it falls back to `count`.\r\n */\r\n fill = input<boolean>(false);\r\n\r\n /** i18n key for the accessible label; empty uses `skeleton.loading`. */\r\n messageKey = input('');\r\n\r\n /**\r\n * When true (default) the skeleton is a `role=\"status\"` live region and\r\n * announces its label to assistive tech. Set false on all-but-one instance\r\n * when a view shows several skeletons at once, so screen readers hear a\r\n * single \"Loading\" instead of one per placeholder.\r\n */\r\n announce = input<boolean>(true);\r\n\r\n private readonly host = inject(ElementRef<HTMLElement>);\r\n private readonly destroyRef = inject(DestroyRef);\r\n private readonly i18n = inject(I18nService);\r\n\r\n /**\r\n * Localized label for the host `aria-label`. Host bindings cannot use pipes,\r\n * so this mirrors TranslatePipe: reading `version()` makes it re-translate\r\n * when the locale or loaded bundles change.\r\n */\r\n readonly resolvedAriaLabel = computed<string | null>(() => {\r\n if (!this.announce()) return null;\r\n void this.i18n.version();\r\n const k = this.messageKey()?.trim();\r\n return this.i18n.t(k && k.length > 0 ? k : 'skeleton.loading');\r\n });\r\n\r\n /**\r\n * Number of cells needed to tile the host when `fill` is on — `null` means\r\n * \"not filling\", so `cells` falls back to the plain `count`. Measured, so it\r\n * updates on resize.\r\n */\r\n private readonly fillTiles = signal<number | null>(null);\r\n\r\n /** Parsed shape — from `layout` when present, else the `shape` input. */\r\n readonly resolvedShape = computed<FlySkeletonShape>(() => {\r\n const preset = this.layout();\r\n if (preset) return preset.split('-')[0] as FlySkeletonShape;\r\n return this.shape();\r\n });\r\n\r\n /** Parsed count — from `layout` when present, else the `count` input. */\r\n readonly resolvedCount = computed<number>(() => {\r\n const preset = this.layout();\r\n const raw = preset ? Number(preset.split('-')[1]) : this.count();\r\n return Number.isFinite(raw) && raw > 0 ? Math.floor(raw) : 1;\r\n });\r\n\r\n /**\r\n * Repeatable index array driving the @for of cells. When filling, this is the\r\n * measured tile count (columns × rows-that-fit); otherwise the plain count.\r\n */\r\n readonly cells = computed(() => {\r\n const n =\r\n this.fill() && this.fillTiles() !== null\r\n ? this.fillTiles()!\r\n : this.resolvedCount();\r\n return Array.from({ length: n });\r\n });\r\n\r\n constructor() {\r\n afterNextRender(() => {\r\n if (typeof ResizeObserver !== 'undefined') {\r\n const ro = new ResizeObserver(() => this.recomputeFill());\r\n ro.observe(this.host.nativeElement);\r\n this.destroyRef.onDestroy(() => ro.disconnect());\r\n }\r\n this.recomputeFill();\r\n });\r\n\r\n // Re-measure whenever an input that affects cell size/shape/count changes.\r\n effect(() => {\r\n this.fill();\r\n this.resolvedShape();\r\n this.resolvedCount();\r\n this.lines();\r\n // Defer to a microtask so the DOM reflects the new base cells first.\r\n queueMicrotask(() => this.recomputeFill());\r\n });\r\n }\r\n\r\n /**\r\n * Measure the host and a single cell, then set `fillTiles` to columns × the\r\n * number of natural-height rows that fit the available height. Cells keep\r\n * their intrinsic height — extra rows are *added*, never stretched.\r\n */\r\n private recomputeFill(): void {\r\n if (!this.fill()) {\r\n this.fillTiles.set(null);\r\n return;\r\n }\r\n // SSR / non-DOM: no layout to measure — leave the `count` fallback in place.\r\n if (typeof getComputedStyle === 'undefined') return;\r\n const el = this.host.nativeElement as HTMLElement;\r\n const cell = el.querySelector('.fly-skeleton__cell') as HTMLElement | null;\r\n if (!cell) return;\r\n\r\n const cs = getComputedStyle(el);\r\n const cols =\r\n cs.gridTemplateColumns.split(' ').filter((t) => t && t !== 'none')\r\n .length || 1;\r\n const rowGap = parseFloat(cs.rowGap) || 0;\r\n const cellHeight = cell.getBoundingClientRect().height;\r\n const available = el.clientHeight;\r\n if (cellHeight <= 0 || available <= 0) return;\r\n\r\n const rows = Math.max(\r\n 1,\r\n Math.floor((available + rowGap) / (cellHeight + rowGap)),\r\n );\r\n // Hard ceiling: a pathological tiny-cell/huge-host combo must not flood the\r\n // DOM (each cell renders several bone nodes).\r\n this.fillTiles.set(Math.min(cols * rows, FlySkeletonComponent.MAX_TILES));\r\n }\r\n\r\n /** Upper bound on fill-mode cells; far above any realistic viewport need. */\r\n private static readonly MAX_TILES = 120;\r\n\r\n /** Repeatable index array for text lines within a cell. */\r\n readonly lineRows = computed(() =>\r\n Array.from({ length: Math.max(1, Math.floor(this.lines())) }),\r\n );\r\n\r\n readonly hostClass = computed(() => {\r\n const base = `fly-skeleton fly-skeleton--${this.resolvedShape()} fly-skeleton--anim-${this.animation()}`;\r\n return this.fill() ? `${base} fly-skeleton--fill` : base;\r\n });\r\n}\r\n","@for (cell of cells(); track $index) {\r\n <div class=\"fly-skeleton__cell\">\r\n @switch (resolvedShape()) {\r\n @case ('boxes') {\r\n <div class=\"fly-skeleton__box fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n }\r\n @case ('circles') {\r\n <div class=\"fly-skeleton__row\">\r\n <div class=\"fly-skeleton__avatar fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__stack\">\r\n <div class=\"fly-skeleton__line fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__line fly-skeleton__line--short fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n </div>\r\n </div>\r\n }\r\n @case ('list') {\r\n <div class=\"fly-skeleton__row\">\r\n <div class=\"fly-skeleton__avatar fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__stack\">\r\n <div class=\"fly-skeleton__line fly-skeleton__line--title fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__line fly-skeleton__line--short fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n </div>\r\n </div>\r\n }\r\n @case ('cards') {\r\n <div class=\"fly-skeleton__box fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__line fly-skeleton__line--title fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n @for (line of lineRows(); track $index) {\r\n <div\r\n class=\"fly-skeleton__line fly-skeleton__bone\"\r\n [class.fly-skeleton__line--short]=\"$last\"\r\n aria-hidden=\"true\"></div>\r\n }\r\n }\r\n @case ('stats') {\r\n <div class=\"fly-skeleton__line fly-skeleton__line--short fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__number fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__line fly-skeleton__line--short fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n }\r\n @case ('table') {\r\n <div class=\"fly-skeleton__trow\">\r\n <div class=\"fly-skeleton__cellbar fly-skeleton__cellbar--lg fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__cellbar fly-skeleton__cellbar--md fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__cellbar fly-skeleton__cellbar--md fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n <div class=\"fly-skeleton__cellbar fly-skeleton__cellbar--sm fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n </div>\r\n }\r\n @default {\r\n <!-- paragraphs + lines -->\r\n <div class=\"fly-skeleton__line fly-skeleton__line--title fly-skeleton__bone\" aria-hidden=\"true\"></div>\r\n @for (line of lineRows(); track $index) {\r\n <div\r\n class=\"fly-skeleton__line fly-skeleton__bone\"\r\n [class.fly-skeleton__line--short]=\"$last\"\r\n aria-hidden=\"true\"></div>\r\n }\r\n }\r\n }\r\n </div>\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n HostListener,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { A11yModule } from '@angular/cdk/a11y';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\n\r\n/** Drawer width tier. Maps to a logical inline-size (see SCSS). */\r\nexport type FlyDrawerSize = 'sm' | 'md' | 'lg' | 'xl';\r\n\r\n/** Edge the drawer is pinned to. Logical → RTL flips automatically. */\r\nexport type FlyDrawerSide = 'end' | 'start';\r\n\r\n/** Standard body padding tier. `none` = full-bleed (consumer draws its own). */\r\nexport type FlyDrawerBodyPadding = 'none' | 'sm' | 'md' | 'lg';\r\n\r\n/**\r\n * Where the drawer is anchored.\r\n * - `absolute` (default) — clipped to the nearest positioned ancestor, i.e. the\r\n * app window. Correct inside the desktop shell, where a viewport-level overlay\r\n * would escape the window and break its stacking.\r\n * - `fixed` — pinned to the viewport at full `100dvh`. For full-page standalone\r\n * app layouts where the drawer should span the whole screen rather than one\r\n * pane, and for hosts whose scroll container isn't the drawer's offset parent.\r\n */\r\nexport type FlyDrawerPosition = 'absolute' | 'fixed';\r\n\r\n/**\r\n * `fly-drawer` — the ONE overlay-drawer primitive for FlyOS apps.\r\n *\r\n * Replaces every hand-rolled centered modal / `*-backdrop` + `modal-panel`\r\n * scaffold. A slide-in panel pinned to the window's inline-end edge over a\r\n * scrim, dismissing away — drops onto ANY app layout (sidebar+main, editor,\r\n * list) with no restructuring.\r\n *\r\n * ## Windowed rendering (important)\r\n * Desktop apps are windowed, so the drawer renders **in-place** — the scrim is\r\n * `position: absolute; inset: 0` and overlays the nearest positioned ancestor,\r\n * NOT a body/CDK portal (a body-level overlay would escape the app window and\r\n * break the shell's window stacking). **The consuming app's root container must\r\n * be `position: relative`** (add it where missing) so the scrim is clipped to\r\n * the window.\r\n *\r\n * ## Controlled\r\n * `open` is a controlled input — bind it to a signal and flip it in the\r\n * `(closed)` / `(openChange)` handlers. The drawer never closes itself; it only\r\n * requests closure (scrim / Escape / ✕) by emitting.\r\n *\r\n * ## Owns (so apps stop reimplementing it)\r\n * slide in/out (honours `prefers-reduced-motion`), focus trap + focus restore,\r\n * Escape + scrim dismiss (both gated), scroll-lock of the host content, ARIA\r\n * (`role=dialog` + `aria-modal` + labelledby/label), logical CSS (RTL-safe),\r\n * dark theme.\r\n *\r\n * ## Slots\r\n * - `[flyDrawerHeader]` — optional custom header (else `heading` + close ✕).\r\n * - default — body (scrolls).\r\n * - `[flyDrawerFooter]` — optional sticky footer (action bar).\r\n */\r\n@Component({\r\n selector: 'fly-drawer',\r\n standalone: true,\r\n imports: [CommonModule, A11yModule, TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '[class.fly-drawer--fixed]': \"position() === 'fixed'\" },\r\n templateUrl: './drawer.component.html',\r\n styleUrl: './drawer.component.scss',\r\n})\r\nexport class FlyDrawerComponent {\r\n private host = inject(ElementRef<HTMLElement>);\r\n private destroyRef = inject(DestroyRef);\r\n\r\n /** Drives mount + slide. Controlled by the parent. */\r\n readonly open = input(false);\r\n /** Width tier → inline-size (sm 360 / md 480 / lg 640 / xl min(960px, 94%)). */\r\n readonly size = input<FlyDrawerSize>('md');\r\n /** Convenience title shown in the default header (ignored if `[flyDrawerHeader]` is projected). Treated as an i18n key. */\r\n readonly heading = input<string | null>(null);\r\n /** Edge to pin to. `end` (default) slides from inline-end; RTL flips it. */\r\n readonly side = input<FlyDrawerSide>('end');\r\n /** Close when the scrim is clicked. */\r\n readonly dismissOnScrim = input(true);\r\n /** Close on Escape. */\r\n readonly dismissOnEscape = input(true);\r\n /** Accessible label when no `heading` / projected header title is available. Treated as an i18n key. */\r\n readonly ariaLabel = input<string | null>(null);\r\n /** Hide the built-in close ✕ in the default header (e.g. a mandatory step). */\r\n readonly hideCloseButton = input(false);\r\n /** Standard body padding tier. Default `md`; use `none` when the projected\r\n * body draws its own full-bleed layout / self-pads. */\r\n readonly bodyPadding = input<FlyDrawerBodyPadding>('md');\r\n /** Viewport-pinned (`fixed`) vs app-window-clipped (`absolute`, default). */\r\n readonly position = input<FlyDrawerPosition>('absolute');\r\n /**\r\n * Explicit panel width — ANY CSS length expression (e.g. `min(640px, 100vw)`),\r\n * overriding the `size` tier when set. Use `size` unless the layout genuinely\r\n * needs a width the four tiers don't express.\r\n */\r\n readonly width = input<string | null>(null);\r\n\r\n /** Emitted when the user requests dismissal (scrim / Escape / ✕). */\r\n readonly closed = output<void>();\r\n /** Two-way friendly: emits `false` on a dismissal request. */\r\n readonly openChange = output<boolean>();\r\n\r\n /** Whether the panel is mounted (true while open AND during the slide-out). */\r\n readonly rendered = signal(false);\r\n /** True only while the slide-out animation is playing (drives the exit keyframe). */\r\n readonly leaving = signal(false);\r\n\r\n readonly headingId = 'fly-drawer-heading';\r\n readonly labelledBy = computed(() => (this.heading() ? this.headingId : null));\r\n\r\n /** Size/side classes as an ngClass map (kept off the `[class]` string binding,\r\n * which can race the leaving toggle and stutter the animation). */\r\n readonly panelClass = computed(() => ({\r\n ['fly-drawer__panel--' + this.size()]: true,\r\n ['fly-drawer__panel--side-' + this.side()]: true,\r\n }));\r\n\r\n /** Name of the exit keyframe — used to ignore bubbled child animationend events. */\r\n private static readonly EXIT_ANIM = 'fly-drawer-out';\r\n\r\n /** Element focused before the drawer opened, restored on close. */\r\n private previouslyFocused: HTMLElement | null = null;\r\n /** Parent element whose overflow we lock while open. */\r\n private scrollLockTarget: HTMLElement | null = null;\r\n private prevOverflow = '';\r\n\r\n constructor() {\r\n effect(() => {\r\n if (this.open()) this.onOpen();\r\n else this.onClose();\r\n });\r\n this.destroyRef.onDestroy(() => this.releaseScrollLock());\r\n }\r\n\r\n private onOpen(): void {\r\n if (this.rendered() && !this.leaving()) return;\r\n this.previouslyFocused =\r\n document.activeElement instanceof HTMLElement ? document.activeElement : null;\r\n this.lockScroll();\r\n // Mount the panel — the enter keyframe plays automatically on insertion, so\r\n // there's no rAF/forced-reflow dance to mis-time (the old source of the\r\n // open glitch). A re-open mid-close just clears `leaving`.\r\n this.leaving.set(false);\r\n this.rendered.set(true);\r\n // Focus the first field AFTER paint and WITHOUT scrolling — focusing an\r\n // off-screen, sliding-in panel otherwise yanks the app root's scroll\r\n // position and stutters the animation.\r\n requestAnimationFrame(() => this.focusFirstField());\r\n }\r\n\r\n private onClose(): void {\r\n if (!this.rendered() || this.leaving()) return;\r\n this.leaving.set(true);\r\n this.releaseScrollLock();\r\n this.restoreFocus();\r\n // Unmount on the exit animation's end; fallback timer covers reduced-motion\r\n // (no animation → no event) so the pointer-grabbing scrim can't linger.\r\n setTimeout(() => this.unmount(), 360);\r\n }\r\n\r\n /** Unmount once the slide-out keyframe finishes (filtered to our exit anim). */\r\n onPanelAnimationEnd(animationName: string): void {\r\n if (animationName === FlyDrawerComponent.EXIT_ANIM) this.unmount();\r\n }\r\n\r\n private unmount(): void {\r\n if (this.open()) return; // re-opened during the slide-out — keep it mounted\r\n this.rendered.set(false);\r\n this.leaving.set(false);\r\n }\r\n\r\n /** Focus the first form control in the body (or the panel) without scrolling. */\r\n private focusFirstField(): void {\r\n const root = this.host.nativeElement as HTMLElement;\r\n const panel = root.querySelector('.fly-drawer__panel') as HTMLElement | null;\r\n if (!panel) return;\r\n const selector =\r\n '[autofocus],input:not([type=hidden]),select,textarea,button,[tabindex]:not([tabindex=\"-1\"]),a[href]';\r\n const body = panel.querySelector('.fly-drawer__body');\r\n const target =\r\n (body?.querySelector(selector) as HTMLElement | null) ??\r\n (panel.querySelector(selector) as HTMLElement | null) ??\r\n panel;\r\n target.focus({ preventScroll: true });\r\n }\r\n\r\n @HostListener('document:keydown.escape')\r\n onEscape(): void {\r\n if (this.open() && this.dismissOnEscape()) this.requestClose();\r\n }\r\n\r\n onScrimClick(): void {\r\n if (this.dismissOnScrim()) this.requestClose();\r\n }\r\n\r\n requestClose(): void {\r\n this.openChange.emit(false);\r\n this.closed.emit();\r\n }\r\n\r\n private lockScroll(): void {\r\n // Lock the nearest positioned ancestor (the app window root) — the same box\r\n // the absolutely-positioned scrim clips to — not the immediate DOM parent\r\n // (which may be a `display:contents` dialog wrapper).\r\n const target =\r\n (this.host.nativeElement.offsetParent as HTMLElement | null) ??\r\n this.host.nativeElement.parentElement;\r\n if (!target) return;\r\n this.scrollLockTarget = target;\r\n this.prevOverflow = target.style.overflow;\r\n target.style.overflow = 'hidden';\r\n }\r\n\r\n private releaseScrollLock(): void {\r\n if (!this.scrollLockTarget) return;\r\n this.scrollLockTarget.style.overflow = this.prevOverflow;\r\n this.scrollLockTarget = null;\r\n this.prevOverflow = '';\r\n }\r\n\r\n private restoreFocus(): void {\r\n const el = this.previouslyFocused;\r\n this.previouslyFocused = null;\r\n if (el && document.contains(el)) {\r\n // Defer so focus lands after the panel is removed from the a11y tree.\r\n requestAnimationFrame(() => el.focus());\r\n }\r\n }\r\n}\r\n","<!--\r\n Windowed overlay drawer. Renders only while mounted (open or sliding out).\r\n Scrim + panel are absolutely positioned within the nearest positioned\r\n ancestor (the consuming app root must be position:relative).\r\n-->\r\n@if (rendered()) {\r\n <div\r\n class=\"fly-drawer__scrim\"\r\n [class.fly-drawer__scrim--leaving]=\"leaving()\"\r\n (click)=\"onScrimClick()\"\r\n aria-hidden=\"true\"\r\n ></div>\r\n\r\n <div\r\n class=\"fly-drawer__panel\"\r\n [ngClass]=\"panelClass()\"\r\n [class.fly-drawer__panel--leaving]=\"leaving()\"\r\n [style.--fly-drawer-width]=\"width()\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.aria-labelledby]=\"labelledBy()\"\r\n [attr.aria-label]=\"!labelledBy() && ariaLabel() ? (ariaLabel()! | translate) : null\"\r\n cdkTrapFocus\r\n (animationend)=\"onPanelAnimationEnd($event.animationName)\"\r\n >\r\n <!-- Header: custom slot, else heading + close ✕. -->\r\n <ng-content select=\"[flyDrawerHeader]\">\r\n @if (heading()) {\r\n <header class=\"fly-drawer__header\">\r\n <h2 class=\"fly-drawer__title\" [id]=\"headingId\">{{ heading()! | translate }}</h2>\r\n @if (!hideCloseButton()) {\r\n <button\r\n type=\"button\"\r\n class=\"fly-drawer__close\"\r\n (click)=\"requestClose()\"\r\n [attr.aria-label]=\"'common.action.close' | translate\"\r\n >\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n </header>\r\n }\r\n </ng-content>\r\n\r\n <div class=\"fly-drawer__body\" [ngClass]=\"'fly-drawer__body--pad-' + bodyPadding()\">\r\n <ng-content></ng-content>\r\n </div>\r\n\r\n <ng-content select=\"[flyDrawerFooter]\"></ng-content>\r\n </div>\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n Injector,\r\n ViewEncapsulation,\r\n afterNextRender,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport type { FlyFileInfo } from '../../models/file.model';\r\n// Type-only: the value is pulled in on demand via a dynamic import in\r\n// `initCropper`, so cropperjs never lands in the design-system's eager bundle.\r\n// A `import Cropper from 'cropperjs'` here would defeat that — the DS ships as a\r\n// single FESM, so anything statically imported is paid for by every consumer,\r\n// including the many that never open an image cropper.\r\nimport type Cropper from 'cropperjs';\r\n\r\n/**\r\n * Image upload component with built-in cropperjs cropping modal.\r\n *\r\n * Usage:\r\n * ```html\r\n * <fly-image-upload\r\n * [aspectRatio]=\"16/9\"\r\n * [currentImageId]=\"trend.coverImageId\"\r\n * sourceApp=\"circles\"\r\n * sourceEntityType=\"trend\"\r\n * (uploaded)=\"onImageUploaded($event)\"\r\n * (removed)=\"onImageRemoved()\"\r\n * />\r\n * ```\r\n */\r\n@Component({\r\n selector: 'fly-image-upload',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n encapsulation: ViewEncapsulation.None,\r\n templateUrl: './image-upload.component.html',\r\n styleUrls: ['./image-upload.component.scss'],\r\n})\r\nexport class FlyImageUploadComponent {\r\n private http = inject(HttpClient);\r\n private injector = inject(Injector);\r\n\r\n // ── Inputs ──\r\n aspectRatio = input(16 / 9);\r\n maxSizeBytes = input(5 * 1024 * 1024);\r\n currentImageId = input<string | null>(null);\r\n sourceApp = input('unknown');\r\n sourceEntityType = input<string | null>(null);\r\n sourceEntityId = input<string | null>(null);\r\n\r\n // ── Outputs ──\r\n uploaded = output<FlyFileInfo>();\r\n removed = output<void>();\r\n\r\n // ── State ──\r\n uploading = signal(false);\r\n error = signal<string | null>(null);\r\n showCropper = signal(false);\r\n rawImageUrl = signal<string>('');\r\n localBlob = signal<string | null>(null);\r\n\r\n fileInput = viewChild<ElementRef<HTMLInputElement>>('fileInput');\r\n cropImage = viewChild<ElementRef<HTMLImageElement>>('cropImage');\r\n\r\n private cropper: Cropper | null = null;\r\n private selectedFile: File | null = null;\r\n\r\n /**\r\n * Bumped by every `destroyCropper()`. `initCropper` captures it across its\r\n * `await import(...)` and bails if it changed — otherwise closing the modal\r\n * while the chunk is still in flight would attach a Cropper to a detached\r\n * element that nothing would ever destroy.\r\n */\r\n private cropperGeneration = 0;\r\n\r\n /** Resolved preview URL — uses blob for local uploads, fetches authenticated for existing images */\r\n previewUrl = signal<string | null>(null);\r\n\r\n constructor() {\r\n // React to currentImageId changes — fetch authenticated blob\r\n effect((onCleanup) => {\r\n const local = this.localBlob();\r\n if (local) { this.previewUrl.set(local); return; }\r\n\r\n const id = this.currentImageId();\r\n if (!id) { this.previewUrl.set(null); return; }\r\n\r\n const sub = this.http.get(`/api/files/${id}/download`, { responseType: 'blob' }).subscribe({\r\n next: (blob) => this.previewUrl.set(URL.createObjectURL(blob)),\r\n error: () => this.previewUrl.set(null),\r\n });\r\n onCleanup(() => sub.unsubscribe());\r\n });\r\n }\r\n\r\n sizeHint = computed(() => {\r\n const mb = this.maxSizeBytes() / (1024 * 1024);\r\n return `Max ${mb}MB`;\r\n });\r\n\r\n triggerFileInput(): void {\r\n this.fileInput()?.nativeElement.click();\r\n }\r\n\r\n onDragOver(e: DragEvent): void {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n }\r\n\r\n onDrop(e: DragEvent): void {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n const file = e.dataTransfer?.files?.[0];\r\n if (file) this.processFile(file);\r\n }\r\n\r\n onFileSelected(e: Event): void {\r\n const input = e.target as HTMLInputElement;\r\n const file = input.files?.[0];\r\n if (file) this.processFile(file);\r\n input.value = '';\r\n }\r\n\r\n removeImage(): void {\r\n this.localBlob.set(null);\r\n this.previewUrl.set(null);\r\n this.error.set(null);\r\n this.removed.emit();\r\n }\r\n\r\n cancelCrop(): void {\r\n this.showCropper.set(false);\r\n this.destroyCropper();\r\n if (this.rawImageUrl()) URL.revokeObjectURL(this.rawImageUrl());\r\n this.rawImageUrl.set('');\r\n }\r\n\r\n /** Space would otherwise scroll the page while the backdrop (role=\"button\") is focused. */\r\n onCropBackdropSpace(event: Event): void {\r\n event.preventDefault();\r\n this.cancelCrop();\r\n }\r\n\r\n applyCrop(): void {\r\n if (!this.cropper) return;\r\n const canvas = this.cropper.getCroppedCanvas({ maxWidth: 1920, maxHeight: 1080 });\r\n this.showCropper.set(false);\r\n this.destroyCropper();\r\n if (this.rawImageUrl()) URL.revokeObjectURL(this.rawImageUrl());\r\n this.rawImageUrl.set('');\r\n\r\n canvas.toBlob((blob) => {\r\n if (!blob) return;\r\n const fileName = this.selectedFile?.name ?? 'cropped-image.jpg';\r\n const file = new File([blob], fileName, { type: blob.type || 'image/jpeg' });\r\n this.uploadFile(file);\r\n }, 'image/jpeg', 0.9);\r\n }\r\n\r\n private processFile(file: File): void {\r\n this.error.set(null);\r\n\r\n if (!file.type.startsWith('image/')) {\r\n this.error.set('Only image files are allowed');\r\n return;\r\n }\r\n if (file.size > this.maxSizeBytes()) {\r\n const mb = this.maxSizeBytes() / (1024 * 1024);\r\n this.error.set(`File exceeds ${mb}MB limit`);\r\n return;\r\n }\r\n\r\n this.selectedFile = file;\r\n const url = URL.createObjectURL(file);\r\n this.rawImageUrl.set(url);\r\n this.showCropper.set(true);\r\n\r\n // Init cropperjs after the @if (showCropper()) block has rendered and\r\n // the #cropImage signal viewQuery is populated. setTimeout(0) used to\r\n // race here under Native Federation when fewer host CD passes happen\r\n // before the macrotask fires (cropImage() returned undefined and\r\n // initCropper bailed). afterNextRender is deterministic.\r\n afterNextRender(() => void this.initCropper(), { injector: this.injector });\r\n }\r\n\r\n private async initCropper(): Promise<void> {\r\n this.destroyCropper();\r\n const generation = this.cropperGeneration;\r\n const imgEl = this.cropImage()?.nativeElement;\r\n if (!imgEl) return;\r\n\r\n const { default: CropperCtor } = await import('cropperjs');\r\n\r\n // The modal may have been dismissed (or re-opened) while the chunk loaded.\r\n if (generation !== this.cropperGeneration || !this.showCropper()) return;\r\n\r\n this.cropper = new CropperCtor(imgEl, {\r\n aspectRatio: this.aspectRatio(),\r\n viewMode: 1,\r\n autoCropArea: 0.9,\r\n responsive: true,\r\n background: false,\r\n });\r\n }\r\n\r\n private destroyCropper(): void {\r\n this.cropperGeneration++;\r\n this.cropper?.destroy();\r\n this.cropper = null;\r\n }\r\n\r\n private uploadFile(file: File): void {\r\n this.uploading.set(true);\r\n this.error.set(null);\r\n\r\n const formData = new FormData();\r\n formData.append('file', file, file.name);\r\n formData.append('sourceApp', this.sourceApp());\r\n if (this.sourceEntityType()) formData.append('sourceEntityType', this.sourceEntityType()!);\r\n if (this.sourceEntityId()) formData.append('sourceEntityId', this.sourceEntityId()!);\r\n\r\n this.http.post<{ data: FlyFileInfo } | FlyFileInfo>('/api/files/upload', formData).subscribe({\r\n next: (res) => {\r\n this.uploading.set(false);\r\n const info = 'data' in res ? res.data : res;\r\n this.localBlob.set(URL.createObjectURL(file));\r\n this.uploaded.emit(info);\r\n },\r\n error: (err) => {\r\n this.uploading.set(false);\r\n this.error.set(err?.error?.message ?? 'Upload failed');\r\n },\r\n });\r\n }\r\n}\r\n","<div class=\"fly-image-upload\">\n @if (previewUrl()) {\n <div class=\"fly-image-upload__preview\">\n <img [src]=\"previewUrl()\" alt=\"\" class=\"fly-image-upload__img\" />\n <div class=\"fly-image-upload__overlay\">\n <button type=\"button\" class=\"fly-image-upload__action-btn\" (click)=\"triggerFileInput()\" [title]=\"'files.imageUpload.change' | translate\">\n <span class=\"pi pi-pencil\" aria-hidden=\"true\"></span>\n </button>\n <button type=\"button\" class=\"fly-image-upload__action-btn fly-image-upload__action-btn--danger\" (click)=\"removeImage()\" [title]=\"'files.imageUpload.remove' | translate\">\n <span class=\"pi pi-trash\" aria-hidden=\"true\"></span>\n </button>\n </div>\n </div>\n } @else {\n <button type=\"button\" class=\"fly-image-upload__dropzone\" (click)=\"triggerFileInput()\" (dragover)=\"onDragOver($event)\" (drop)=\"onDrop($event)\">\n @if (uploading()) {\n <span class=\"pi pi-spin pi-spinner fly-image-upload__icon\" aria-hidden=\"true\"></span>\n <span class=\"fly-image-upload__label\">{{ 'files.imageUpload.uploading' | translate }}</span>\n } @else {\n <span class=\"pi pi-image fly-image-upload__icon\" aria-hidden=\"true\"></span>\n <span class=\"fly-image-upload__label\">{{ 'files.imageUpload.placeholder' | translate }}</span>\n <span class=\"fly-image-upload__hint\">{{ sizeHint() }}</span>\n }\n </button>\n }\n\n @if (error()) {\n <div class=\"fly-image-upload__error\">{{ error() }}</div>\n }\n\n <input #fileInput type=\"file\" accept=\"image/*\" class=\"fly-image-upload__hidden\" (change)=\"onFileSelected($event)\" />\n\n @if (showCropper()) {\n <div class=\"fly-image-upload__crop-overlay\">\n <div class=\"fly-image-upload__crop-backdrop\" role=\"button\" tabindex=\"0\"\n [attr.aria-label]=\"'common.action.cancel' | translate\"\n (click)=\"cancelCrop()\"\n (keydown.enter)=\"cancelCrop()\"\n (keydown.space)=\"onCropBackdropSpace($event)\"></div>\n <div class=\"fly-image-upload__crop-modal\">\n <div class=\"fly-image-upload__crop-header\">\n <h3>{{ 'files.imageUpload.crop' | translate }}</h3>\n </div>\n <div class=\"fly-image-upload__crop-body\">\n <img #cropImage [src]=\"rawImageUrl()\" alt=\"\" />\n </div>\n <div class=\"fly-image-upload__crop-footer\">\n <button type=\"button\" class=\"vos-btn sm platter\" (click)=\"cancelCrop()\">{{ 'common.action.cancel' | translate }}</button>\n <button type=\"button\" class=\"vos-btn sm primary\" (click)=\"applyCrop()\">{{ 'files.imageUpload.apply' | translate }}</button>\n </div>\n </div>\n </div>\n }\n</div>\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { HttpClient, HttpEventType } from '@angular/common/http';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport type { FlyFileInfo } from '../../models/file.model';\r\n\r\ninterface UploadSlot {\r\n file: File;\r\n progress: number; // 0–100\r\n status: 'uploading' | 'done' | 'error';\r\n info?: FlyFileInfo;\r\n error?: string;\r\n}\r\n\r\nconst FILE_ICONS: Record<string, string> = {\r\n 'application/pdf': 'pi-file-pdf',\r\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'pi-file-word',\r\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'pi-file-excel',\r\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'pi-file',\r\n 'image/': 'pi-image',\r\n 'video/': 'pi-video',\r\n 'audio/': 'pi-volume-up',\r\n};\r\n\r\nfunction iconForType(contentType: string): string {\r\n for (const [prefix, icon] of Object.entries(FILE_ICONS)) {\r\n if (contentType.startsWith(prefix)) return icon;\r\n }\r\n return 'pi-file';\r\n}\r\n\r\nfunction formatSize(bytes: number): string {\r\n if (bytes < 1024) return `${bytes} B`;\r\n if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\r\n return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\r\n}\r\n\r\n/**\r\n * Multi-file upload with drag-drop, progress, and validation.\r\n *\r\n * Usage:\r\n * ```html\r\n * <fly-file-upload\r\n * [maxFiles]=\"5\"\r\n * [maxFileSizeBytes]=\"5242880\"\r\n * accept=\".pdf,.docx,.xlsx\"\r\n * [(files)]=\"trend.attachments\"\r\n * sourceApp=\"circles\"\r\n * sourceEntityType=\"trend\"\r\n * (filesChanged)=\"onAttachmentsChanged($event)\"\r\n * />\r\n * ```\r\n */\r\n@Component({\r\n selector: 'fly-file-upload',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './file-upload.component.html',\r\n styleUrls: ['./file-upload.component.scss'],\r\n})\r\nexport class FlyFileUploadComponent {\r\n private http = inject(HttpClient);\r\n\r\n // ── Inputs ──\r\n maxFiles = input(5);\r\n maxFileSizeBytes = input(5 * 1024 * 1024);\r\n accept = input('');\r\n sourceApp = input('unknown');\r\n sourceEntityType = input<string | null>(null);\r\n sourceEntityId = input<string | null>(null);\r\n\r\n /** Optional: provide file IDs to auto-fetch metadata for pre-existing files (edit mode). */\r\n existingFileIds = input<string[] | null>(null);\r\n\r\n /** Two-way model for completed file metadata. */\r\n files = model<FlyFileInfo[]>([]);\r\n\r\n // ── Outputs ──\r\n filesChanged = output<FlyFileInfo[]>();\r\n\r\n // ── State ──\r\n error = signal<string | null>(null);\r\n dragging = signal(false);\r\n slots = signal<UploadSlot[]>([]);\r\n\r\n /** Pre-existing files loaded from the entity (before any new uploads this session). */\r\n existingFiles = signal<FlyFileInfo[]>([]);\r\n\r\n fileInput = viewChild<ElementRef<HTMLInputElement>>('fileInput');\r\n\r\n constructor() {\r\n // Auto-fetch metadata for existing file IDs (edit mode)\r\n effect((onCleanup) => {\r\n const ids = this.existingFileIds();\r\n if (!ids?.length) return;\r\n\r\n const subs = ids.map(id =>\r\n this.http.get<{ data: FlyFileInfo } | FlyFileInfo>(`/api/files/${id}`).subscribe({\r\n next: (res) => {\r\n const info = 'data' in res ? res.data : res;\r\n if (info?.id) {\r\n this.existingFiles.update(list =>\r\n list.some(f => f.id === info.id) ? list : [...list, info]\r\n );\r\n this.files.update(list =>\r\n list.some(f => f.id === info.id) ? list : [...list, info]\r\n );\r\n }\r\n },\r\n })\r\n );\r\n onCleanup(() => subs.forEach(s => s.unsubscribe()));\r\n });\r\n }\r\n\r\n allSlots = computed(() => this.slots());\r\n\r\n canAddMore = computed(() => {\r\n const current = this.files().length + this.slots().filter(s => s.status === 'uploading').length;\r\n return current < this.maxFiles();\r\n });\r\n\r\n limitHint = computed(() => {\r\n const mb = this.maxFileSizeBytes() / (1024 * 1024);\r\n return `Max ${this.maxFiles()} files, ${mb}MB each`;\r\n });\r\n\r\n triggerFileInput(): void {\r\n this.fileInput()?.nativeElement.click();\r\n }\r\n\r\n onDragOver(e: DragEvent): void {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n this.dragging.set(true);\r\n }\r\n\r\n onDragLeave(e: DragEvent): void {\r\n e.preventDefault();\r\n this.dragging.set(false);\r\n }\r\n\r\n onDrop(e: DragEvent): void {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n this.dragging.set(false);\r\n const fileList = e.dataTransfer?.files;\r\n if (fileList) this.processFiles(Array.from(fileList));\r\n }\r\n\r\n onFilesSelected(e: Event): void {\r\n const input = e.target as HTMLInputElement;\r\n if (input.files) this.processFiles(Array.from(input.files));\r\n input.value = '';\r\n }\r\n\r\n removeSlot(slot: UploadSlot): void {\r\n this.slots.update(s => s.filter(x => x !== slot));\r\n if (slot.info) {\r\n this.files.update(f => f.filter(x => x.id !== slot.info!.id));\r\n this.filesChanged.emit(this.files());\r\n }\r\n }\r\n\r\n removeExisting(f: FlyFileInfo): void {\r\n this.existingFiles.update(list => list.filter(x => x.id !== f.id));\r\n this.files.update(list => list.filter(x => x.id !== f.id));\r\n this.filesChanged.emit(this.files());\r\n }\r\n\r\n iconFor(slot: UploadSlot): string { return iconForType(slot.file.type); }\r\n iconForInfo(f: FlyFileInfo): string { return iconForType(f.contentType); }\r\n formatFileSize(bytes: number): string { return formatSize(bytes); }\r\n\r\n private processFiles(newFiles: File[]): void {\r\n this.error.set(null);\r\n const currentCount = this.files().length + this.slots().filter(s => s.status === 'uploading').length;\r\n const remaining = this.maxFiles() - currentCount;\r\n\r\n if (remaining <= 0) {\r\n this.error.set(`Maximum ${this.maxFiles()} files allowed`);\r\n return;\r\n }\r\n\r\n const toUpload = newFiles.slice(0, remaining);\r\n if (newFiles.length > remaining) {\r\n this.error.set(`Only ${remaining} more file(s) can be added`);\r\n }\r\n\r\n for (const file of toUpload) {\r\n if (file.size > this.maxFileSizeBytes()) {\r\n const mb = this.maxFileSizeBytes() / (1024 * 1024);\r\n this.error.set(`\"${file.name}\" exceeds ${mb}MB limit`);\r\n continue;\r\n }\r\n this.uploadFile(file);\r\n }\r\n }\r\n\r\n private uploadFile(file: File): void {\r\n const slot: UploadSlot = { file, progress: 0, status: 'uploading' };\r\n this.slots.update(s => [...s, slot]);\r\n\r\n const formData = new FormData();\r\n formData.append('file', file, file.name);\r\n formData.append('sourceApp', this.sourceApp());\r\n if (this.sourceEntityType()) formData.append('sourceEntityType', this.sourceEntityType()!);\r\n if (this.sourceEntityId()) formData.append('sourceEntityId', this.sourceEntityId()!);\r\n\r\n this.http.post<{ data: FlyFileInfo }>('/api/files/upload', formData, {\r\n reportProgress: true,\r\n observe: 'events',\r\n }).subscribe({\r\n next: (event) => {\r\n if (event.type === HttpEventType.UploadProgress && event.total) {\r\n slot.progress = Math.round((event.loaded / event.total) * 100);\r\n this.slots.update(s => [...s]); // trigger signal change\r\n } else if (event.type === HttpEventType.Response) {\r\n const body = event.body as { data: FlyFileInfo } | FlyFileInfo | null;\r\n const info = (body && 'data' in body ? body.data : body) as FlyFileInfo;\r\n slot.status = 'done';\r\n slot.progress = 100;\r\n slot.info = info;\r\n this.slots.update(s => [...s]);\r\n this.files.update(f => [...f, info]);\r\n this.filesChanged.emit(this.files());\r\n }\r\n },\r\n error: (err) => {\r\n slot.status = 'error';\r\n slot.error = err?.error?.message ?? 'Upload failed';\r\n this.slots.update(s => [...s]);\r\n },\r\n });\r\n }\r\n}\r\n","<div class=\"fly-file-upload\">\n @if (canAddMore()) {\n <button type=\"button\" class=\"fly-file-upload__dropzone\"\n [class.fly-file-upload__dropzone--drag]=\"dragging()\"\n (click)=\"triggerFileInput()\"\n (dragover)=\"onDragOver($event)\"\n (dragleave)=\"onDragLeave($event)\"\n (drop)=\"onDrop($event)\">\n <span class=\"pi pi-cloud-upload fly-file-upload__icon\" aria-hidden=\"true\"></span>\n <span class=\"fly-file-upload__label\">{{ 'files.fileUpload.dropOrClick' | translate }}</span>\n <span class=\"fly-file-upload__hint\">{{ limitHint() }}</span>\n </button>\n }\n\n @if (error()) {\n <div class=\"fly-file-upload__error\">{{ error() }}</div>\n }\n\n @if (allSlots().length) {\n <ul class=\"fly-file-upload__list\">\n @for (slot of allSlots(); track slot.file.name + slot.file.size) {\n <li class=\"fly-file-upload__item\">\n <span class=\"pi {{ iconFor(slot) }} fly-file-upload__file-icon\" aria-hidden=\"true\"></span>\n <div class=\"fly-file-upload__file-info\">\n <span class=\"fly-file-upload__file-name\">{{ slot.file.name }}</span>\n <span class=\"fly-file-upload__file-size\">{{ formatFileSize(slot.file.size) }}</span>\n </div>\n @if (slot.status === 'uploading') {\n <div class=\"fly-file-upload__progress-track\">\n <div class=\"fly-file-upload__progress-fill\" [style.width.%]=\"slot.progress\"></div>\n </div>\n }\n @if (slot.status === 'error') {\n <span class=\"fly-file-upload__file-error\" [title]=\"slot.error ?? ''\">\n <span class=\"pi pi-exclamation-triangle\" aria-hidden=\"true\"></span>\n </span>\n }\n @if (slot.status === 'done') {\n <span class=\"pi pi-check-circle fly-file-upload__file-ok\" aria-hidden=\"true\"></span>\n }\n <button type=\"button\" class=\"fly-file-upload__remove-btn\" (click)=\"removeSlot(slot)\" [title]=\"'common.remove' | translate\">\n <span class=\"pi pi-times\" aria-hidden=\"true\"></span>\n </button>\n </li>\n }\n </ul>\n }\n\n @if (existingFiles().length && !allSlots().length) {\n <ul class=\"fly-file-upload__list\">\n @for (f of existingFiles(); track f.id) {\n <li class=\"fly-file-upload__item\">\n <span class=\"pi {{ iconForInfo(f) }} fly-file-upload__file-icon\" aria-hidden=\"true\"></span>\n <div class=\"fly-file-upload__file-info\">\n <span class=\"fly-file-upload__file-name\">{{ f.fileName }}</span>\n <span class=\"fly-file-upload__file-size\">{{ formatFileSize(f.sizeBytes) }}</span>\n </div>\n <span class=\"pi pi-check-circle fly-file-upload__file-ok\" aria-hidden=\"true\"></span>\n <button type=\"button\" class=\"fly-file-upload__remove-btn\" (click)=\"removeExisting(f)\" [title]=\"'common.remove' | translate\">\n <span class=\"pi pi-times\" aria-hidden=\"true\"></span>\n </button>\n </li>\n }\n </ul>\n }\n\n <input #fileInput type=\"file\" [accept]=\"accept()\" multiple class=\"fly-file-upload__hidden\" (change)=\"onFilesSelected($event)\" />\n</div>\n","import {\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n HostListener,\n ViewChild,\n computed,\n forwardRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { I18nService } from '../../services/i18n.service';\nimport { FlySelectOption, FlySelectValue } from './select.types';\n\n/** Process-wide counter so every instance owns unique element ids (`aria-controls`,\n * `aria-activedescendant`, option ids) even when many selects mount at once. */\nlet _flySelectUid = 0;\n\n/** A group heading plus the (filtered) options under it. `key === null` = the ungrouped bucket. */\ninterface FlySelectRenderGroup {\n key: string | null;\n options: FlySelectOption[];\n}\n\n/**\n * **`fly-select`** — the design-system searchable select / combobox.\n *\n * A single reusable control covering the \"regular features\" of a rich select: single **and**\n * multiple selection, client-side type-to-filter search, select-all / clear-all (multiple),\n * clearable value, grouped options (`optgroup`-style headings), full keyboard a11y (↑/↓/Home/End,\n * Enter/Space, Esc, type-ahead via the search box), click-outside dismissal, ARIA listbox semantics,\n * and RTL via logical CSS. Implements {@link ControlValueAccessor} so it drops into `[(ngModel)]`\n * and reactive forms.\n *\n * **i18n:** options carry already-translated labels — the DS never owns a consumer's locale keys.\n * The control's own chrome (placeholder, search placeholder, \"Select all\", …) is **self-sufficient**:\n * each input defaults to the `select.*` key in `DS_BASELINE_LOCALES` (en/ar/fr/ur), and passing the\n * input still wins. It used to default to a hardcoded English literal that every consumer had to\n * remember to override — none did, so a searchable select read \"Search…\" under ar/fr/ur.\n * Styling uses DS theme tokens (`--surface-card`,\n * `--surface-border`, `--text-color`, `--primary-color`, …) with light-neutral fallbacks so it stays\n * readable in consumers that haven't mapped the tokens.\n *\n * Pattern mirrors {@link EntityLookupComponent}: an absolutely-positioned panel (no CDK Overlay),\n * signal-driven `activeIndex` keyboard nav, and a `document:mousedown` click-outside guard.\n */\n@Component({\n selector: 'fly-select',\n standalone: true,\n imports: [CommonModule],\n templateUrl: './select.component.html',\n styleUrls: ['./select.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FlySelectComponent), multi: true },\n ],\n host: {\n class: 'fly-select',\n '[class.fly-select--open]': 'isOpen()',\n '[class.fly-select--disabled]': 'effectiveDisabled()',\n },\n})\nexport class FlySelectComponent implements ControlValueAccessor {\n private readonly host = inject(ElementRef<HTMLElement>);\n private readonly _i18n = inject(I18nService);\n\n // ── Inputs ─────────────────────────────────────────────────────────────────\n /** Selectable options. Options sharing a `group` render under one heading, in first-seen order. */\n readonly options = input<readonly FlySelectOption[]>([]);\n /** Multiple-selection mode (checkbox-style, value is `string[]`). Default single (`string | null`). */\n readonly multiple = input(false);\n /** Show the in-panel search box (client-side label filter). */\n readonly searchable = input(true);\n /** Show the trigger clear (✕) affordance when there is a selection. */\n readonly clearable = input(true);\n /** Show the select-all / clear-all toggle (multiple mode only). */\n readonly showSelectAll = input(true);\n /** Disable the whole control (also driven by reactive-forms `setDisabledState`). */\n readonly disabled = input(false);\n\n // The control's own chrome. Each defaults to `null` = \"use the localized `select.*` baseline\"\n // (see `_text` below) rather than to a hardcoded English literal, which every consumer then had\n // to remember to override — and none did, so searchable selects showed English \"Search…\" under\n // ar/fr/ur. Passing any of these still wins, so consumer overrides are unaffected.\n /** Trigger text when nothing is selected. Omit for the localized default. */\n readonly placeholder = input<string | null>(null);\n /** Placeholder for the in-panel search box. Omit for the localized default. */\n readonly searchPlaceholder = input<string | null>(null);\n /** Shown when the search filter matches nothing. Omit for the localized default. */\n readonly noResultsLabel = input<string | null>(null);\n /** Label for the select-all action (when not all visible are selected). */\n readonly selectAllLabel = input<string | null>(null);\n /** Label for the clear-all action (when all visible are selected). */\n readonly deselectAllLabel = input<string | null>(null);\n /** Accessible label for the trigger clear (✕) button. */\n readonly clearLabel = input<string | null>(null);\n /** Formats the multi-select trigger summary when more than one is selected. Omit for the\n * localized default (the `select.summary` key's `{{count}}` placeholder). */\n readonly summaryFormatter = input<((count: number) => string) | null>(null);\n /** Optional accessible name for the trigger (else the consumer's `<label for>` should reference it). */\n readonly ariaLabel = input<string>('');\n\n // ── Outputs ────────────────────────────────────────────────────────────────\n /** Emits the normalized value on every selection change (mirrors the form-control value). */\n readonly selectionChange = output<FlySelectValue>();\n /** Emits when the panel opens (`true`) / closes (`false`). */\n readonly openedChange = output<boolean>();\n\n // ── Identity + state ─────────────────────────────────────────────────────────\n private readonly _uid = ++_flySelectUid;\n readonly listboxId = `fly-select-${this._uid}-listbox`;\n readonly triggerId = `fly-select-${this._uid}-trigger`;\n\n readonly isOpen = signal(false);\n readonly searchTerm = signal('');\n readonly activeIndex = signal(0);\n /** Selected values; single mode holds 0–1 entries. Order = selection order. */\n private readonly _selected = signal<string[]>([]);\n /** Disabled requested via reactive forms, OR-ed with the `disabled` input. */\n private readonly _cvaDisabled = signal(false);\n private _touched = false;\n\n @ViewChild('searchRef') private readonly searchEl?: ElementRef<HTMLInputElement>;\n @ViewChild('triggerRef') private readonly triggerEl?: ElementRef<HTMLButtonElement>;\n\n private _onChange: (v: FlySelectValue) => void = () => undefined;\n private _onTouched: () => void = () => undefined;\n\n // ── Derived view state ───────────────────────────────────────────────────────\n readonly effectiveDisabled = computed(() => this.disabled() || this._cvaDisabled());\n\n // ── Resolved chrome text ─────────────────────────────────────────────────────\n // Consumer value if supplied, else the localized `select.*` baseline. `I18nService.t` reads the\n // merged-bundle signal, so these re-resolve on a locale switch. The template binds these, never\n // the raw inputs.\n readonly placeholderText = computed(() => this.placeholder() ?? this._i18n.t('select.placeholder'));\n readonly searchPlaceholderText = computed(\n () => this.searchPlaceholder() ?? this._i18n.t('select.search_placeholder'),\n );\n readonly noResultsText = computed(() => this.noResultsLabel() ?? this._i18n.t('select.no_results'));\n readonly selectAllText = computed(() => this.selectAllLabel() ?? this._i18n.t('select.select_all'));\n readonly deselectAllText = computed(() => this.deselectAllLabel() ?? this._i18n.t('select.clear_all'));\n readonly clearText = computed(() => this.clearLabel() ?? this._i18n.t('select.clear'));\n\n private readonly _selectedSet = computed(() => new Set(this._selected()));\n\n /** Options after the client-side search filter (disabled options stay visible but inert). */\n readonly filteredOptions = computed<readonly FlySelectOption[]>(() => {\n const q = this.searchTerm().trim().toLowerCase();\n const opts = this.options();\n if (!q) return opts;\n return opts.filter((o) => o.label.toLowerCase().includes(q));\n });\n\n /** Filtered options grouped under their headings, preserving first-seen group order. */\n readonly renderGroups = computed<FlySelectRenderGroup[]>(() => {\n const groups: FlySelectRenderGroup[] = [];\n const byKey = new Map<string | null, FlySelectRenderGroup>();\n for (const opt of this.filteredOptions()) {\n const key = opt.group ?? null;\n let g = byKey.get(key);\n if (!g) {\n g = { key, options: [] };\n byKey.set(key, g);\n groups.push(g);\n }\n g.options.push(opt);\n }\n return groups;\n });\n\n /** Flat list of keyboard-navigable (enabled, filtered) options — the index space for `activeIndex`. */\n readonly navigableOptions = computed<readonly FlySelectOption[]>(() =>\n this.filteredOptions().filter((o) => !o.disabled),\n );\n\n /** value → its index within {@link navigableOptions}, for option ids + active-descendant. */\n private readonly _navIndexByValue = computed(() => {\n const map = new Map<string, number>();\n this.navigableOptions().forEach((o, i) => map.set(o.value, i));\n return map;\n });\n\n readonly hasSelection = computed(() => this._selected().length > 0);\n\n /** Trigger display text: placeholder when empty, the label when one, else the multi summary. */\n readonly triggerLabel = computed<string>(() => {\n const sel = this._selected();\n if (sel.length === 0) return this.placeholderText();\n if (sel.length === 1) return this._labelFor(sel[0]);\n const format = this.summaryFormatter();\n return format\n ? format(sel.length)\n : this._i18n.t('select.summary', { count: sel.length });\n });\n\n /** True when every navigable option is selected (drives the select-all toggle state/label). */\n readonly allVisibleSelected = computed<boolean>(() => {\n const nav = this.navigableOptions();\n if (nav.length === 0) return false;\n const set = this._selectedSet();\n return nav.every((o) => set.has(o.value));\n });\n\n readonly activeDescendant = computed<string>(() => {\n const nav = this.navigableOptions();\n if (nav.length === 0) return '';\n return this.optionId(this._clampedIndex());\n });\n\n /** The clamped active navigable index, exposed for the template's active-row highlight. */\n readonly activeNavIndex = computed<number>(() => this._clampedIndex());\n\n // ── Helpers ──────────────────────────────────────────────────────────────────\n optionId(navIndex: number): string {\n return `${this.listboxId}-opt-${navIndex}`;\n }\n\n /** Navigable index of an option (for its element id + active state); -1 when disabled/absent. */\n navIndexOf(value: string): number {\n return this._navIndexByValue().get(value) ?? -1;\n }\n\n isSelected(value: string): boolean {\n return this._selectedSet().has(value);\n }\n\n private _labelFor(value: string): string {\n return this.options().find((o) => o.value === value)?.label ?? value;\n }\n\n private _clampedIndex(): number {\n const size = this.navigableOptions().length;\n if (size === 0) return 0;\n return Math.min(Math.max(0, this.activeIndex()), size - 1);\n }\n\n // ── Open / close ─────────────────────────────────────────────────────────────\n toggleOpen(): void {\n if (this.isOpen()) {\n this.close();\n } else {\n this.open();\n }\n }\n\n open(): void {\n if (this.effectiveDisabled() || this.isOpen()) return;\n this.searchTerm.set('');\n // Start the active row on the first selected (else the first option).\n const firstSel = this._selected()[0];\n this.activeIndex.set(firstSel != null ? Math.max(0, this.navIndexOf(firstSel)) : 0);\n this.isOpen.set(true);\n this.openedChange.emit(true);\n queueMicrotask(() => {\n if (this.searchable()) {\n this.searchEl?.nativeElement.focus();\n } else {\n const listbox = (this.host.nativeElement as HTMLElement).querySelector(\n '.fly-select__listbox',\n ) as HTMLElement | null;\n listbox?.focus();\n }\n });\n }\n\n close(refocusTrigger = false): void {\n if (!this.isOpen()) return;\n this.isOpen.set(false);\n this._markTouched();\n this.openedChange.emit(false);\n if (refocusTrigger) queueMicrotask(() => this.triggerEl?.nativeElement.focus());\n }\n\n // ── Keyboard ─────────────────────────────────────────────────────────────────\n onTriggerKeydown(ev: KeyboardEvent): void {\n if (this.effectiveDisabled()) return;\n if (ev.key === 'ArrowDown' || ev.key === 'ArrowUp' || ev.key === 'Enter' || ev.key === ' ') {\n ev.preventDefault();\n this.open();\n }\n }\n\n onPanelKeydown(ev: KeyboardEvent): void {\n const size = this.navigableOptions().length;\n switch (ev.key) {\n case 'Escape':\n ev.preventDefault();\n ev.stopPropagation();\n this.close(true);\n return;\n case 'Tab':\n // Let focus leave naturally, but collapse the panel.\n this.close();\n return;\n case 'ArrowDown':\n ev.preventDefault();\n if (size > 0) this.activeIndex.set((this._clampedIndex() + 1) % size);\n return;\n case 'ArrowUp':\n ev.preventDefault();\n if (size > 0) this.activeIndex.set((this._clampedIndex() - 1 + size) % size);\n return;\n case 'Home':\n ev.preventDefault();\n if (size > 0) this.activeIndex.set(0);\n return;\n case 'End':\n ev.preventDefault();\n if (size > 0) this.activeIndex.set(size - 1);\n return;\n case 'Enter':\n ev.preventDefault();\n this._selectActive();\n return;\n default:\n // Space toggles only when focus is NOT in the search box (where it types a space).\n if (ev.key === ' ' && !this.searchable()) {\n ev.preventDefault();\n this._selectActive();\n }\n return;\n }\n }\n\n private _selectActive(): void {\n const opt = this.navigableOptions()[this._clampedIndex()];\n if (opt) this.toggleValue(opt.value);\n }\n\n // ── Selection ────────────────────────────────────────────────────────────────\n onOptionClick(opt: FlySelectOption): void {\n if (opt.disabled) return;\n this.toggleValue(opt.value);\n }\n\n onOptionHover(navIndex: number): void {\n if (navIndex >= 0 && navIndex !== this.activeIndex()) this.activeIndex.set(navIndex);\n }\n\n toggleValue(value: string): void {\n if (this.multiple()) {\n const next = this._selected().includes(value)\n ? this._selected().filter((v) => v !== value)\n : [...this._selected(), value];\n this._selected.set(next);\n this._emit();\n // Stay open for multi-pick.\n } else {\n this._selected.set([value]);\n this._emit();\n this.close(true);\n }\n }\n\n /** Multiple mode: select every navigable option, or clear them all if already all-selected. */\n toggleSelectAll(): void {\n if (!this.multiple()) return;\n if (this.allVisibleSelected()) {\n const visible = new Set(this.navigableOptions().map((o) => o.value));\n this._selected.set(this._selected().filter((v) => !visible.has(v)));\n } else {\n const merged = new Set(this._selected());\n for (const o of this.navigableOptions()) merged.add(o.value);\n this._selected.set([...merged]);\n }\n this._emit();\n }\n\n /** Clear the whole selection from the trigger ✕. Stops propagation so it never opens the panel. */\n clear(ev?: Event): void {\n ev?.stopPropagation();\n if (!this.hasSelection()) return;\n this._selected.set([]);\n this._emit();\n }\n\n onSearchInput(value: string): void {\n this.searchTerm.set(value);\n this.activeIndex.set(0);\n }\n\n @HostListener('document:mousedown', ['$event'])\n onDocumentMouseDown(ev: MouseEvent): void {\n if (!this.isOpen()) return;\n const target = ev.target as Node | null;\n if (target && this.host.nativeElement.contains(target)) return;\n this.close();\n }\n\n // ── Value plumbing ───────────────────────────────────────────────────────────\n private _normalizedValue(): FlySelectValue {\n if (this.multiple()) return [...this._selected()];\n return this._selected()[0] ?? null;\n }\n\n private _emit(): void {\n const v = this._normalizedValue();\n this._onChange(v);\n this.selectionChange.emit(v);\n }\n\n private _markTouched(): void {\n if (this._touched) return;\n this._touched = true;\n this._onTouched();\n }\n\n // ── ControlValueAccessor ─────────────────────────────────────────────────────\n writeValue(value: FlySelectValue): void {\n if (value == null) {\n this._selected.set([]);\n } else if (Array.isArray(value)) {\n this._selected.set([...value]);\n } else {\n this._selected.set([value]);\n }\n }\n\n registerOnChange(fn: (v: FlySelectValue) => void): void {\n this._onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this._onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this._cvaDisabled.set(isDisabled);\n if (isDisabled) this.close();\n }\n}\n","<!-- ── Trigger ─────────────────────────────────────────────────────────────── -->\r\n<button\r\n #triggerRef\r\n type=\"button\"\r\n [id]=\"triggerId\"\r\n class=\"fly-select__trigger\"\r\n role=\"combobox\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-expanded]=\"isOpen()\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n [class.fly-select__trigger--placeholder]=\"!hasSelection()\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (click)=\"toggleOpen()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n>\r\n <span class=\"fly-select__trigger-label\">{{ triggerLabel() }}</span>\r\n\r\n @if (clearable() && hasSelection() && !effectiveDisabled()) {\r\n <span\r\n class=\"fly-select__clear\"\r\n role=\"button\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"clearText()\"\r\n [title]=\"clearText()\"\r\n (click)=\"clear($event)\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n >✕</span>\r\n }\r\n\r\n <span class=\"fly-select__chevron\" aria-hidden=\"true\">▾</span>\r\n</button>\r\n\r\n<!-- ── Panel ───────────────────────────────────────────────────────────────── -->\r\n@if (isOpen()) {\r\n <div class=\"fly-select__panel\" tabindex=\"-1\" (keydown)=\"onPanelKeydown($event)\">\r\n @if (searchable()) {\r\n <div class=\"fly-select__search\">\r\n <input\r\n #searchRef\r\n type=\"text\"\r\n class=\"fly-select__search-input\"\r\n role=\"combobox\"\r\n aria-autocomplete=\"list\"\r\n [attr.aria-expanded]=\"true\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-activedescendant]=\"activeDescendant() || null\"\r\n [attr.aria-label]=\"searchPlaceholderText()\"\r\n [placeholder]=\"searchPlaceholderText()\"\r\n [value]=\"searchTerm()\"\r\n (input)=\"onSearchInput($any($event.target).value)\"\r\n />\r\n </div>\r\n }\r\n\r\n @if (multiple() && showSelectAll() && navigableOptions().length > 0) {\r\n <button\r\n type=\"button\"\r\n class=\"fly-select__select-all\"\r\n (click)=\"toggleSelectAll()\"\r\n >\r\n {{ allVisibleSelected() ? deselectAllText() : selectAllText() }}\r\n </button>\r\n }\r\n\r\n <div\r\n class=\"fly-select__listbox\"\r\n role=\"listbox\"\r\n [id]=\"listboxId\"\r\n [attr.tabindex]=\"searchable() ? null : 0\"\r\n [attr.aria-multiselectable]=\"multiple() ? true : null\"\r\n [attr.aria-activedescendant]=\"activeDescendant() || null\"\r\n [attr.aria-label]=\"ariaLabel() || null\"\r\n >\r\n @for (group of renderGroups(); track group.key) {\r\n @if (group.key !== null) {\r\n <div class=\"fly-select__group-label\" role=\"presentation\">{{ group.key }}</div>\r\n }\r\n @for (opt of group.options; track opt.value) {\r\n <div\r\n class=\"fly-select__option\"\r\n role=\"option\"\r\n tabindex=\"-1\"\r\n [id]=\"opt.disabled ? null : optionId(navIndexOf(opt.value))\"\r\n [attr.aria-selected]=\"isSelected(opt.value)\"\r\n [attr.aria-disabled]=\"opt.disabled ? true : null\"\r\n [class.fly-select__option--selected]=\"isSelected(opt.value)\"\r\n [class.fly-select__option--active]=\"!opt.disabled && navIndexOf(opt.value) === activeNavIndex()\"\r\n [class.fly-select__option--disabled]=\"opt.disabled\"\r\n (click)=\"onOptionClick(opt)\"\r\n (keydown.enter)=\"onOptionClick(opt)\"\r\n (mouseenter)=\"onOptionHover(navIndexOf(opt.value))\"\r\n >\r\n @if (multiple()) {\r\n <span class=\"fly-select__checkbox\" aria-hidden=\"true\">\r\n @if (isSelected(opt.value)) { <span class=\"fly-select__checkbox-tick\">✓</span> }\r\n </span>\r\n } @else {\r\n <span class=\"fly-select__check\" aria-hidden=\"true\">\r\n @if (isSelected(opt.value)) { ✓ }\r\n </span>\r\n }\r\n <span class=\"fly-select__option-label\">{{ opt.label }}</span>\r\n </div>\r\n }\r\n }\r\n\r\n @if (filteredOptions().length === 0) {\r\n <div class=\"fly-select__empty\" role=\"presentation\">{{ noResultsText() }}</div>\r\n }\r\n </div>\r\n </div>\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n HostListener,\r\n type OnDestroy,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { type Observable, type Subscription } from 'rxjs';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { type FlyTypeaheadOption } from './typeahead.types';\r\n\r\n/** Process-wide counter so every instance owns unique element ids\r\n * (`aria-controls`, `aria-activedescendant`, option ids) even when many\r\n * typeaheads mount at once. */\r\nlet _flyTypeaheadUid = 0;\r\n\r\n/**\r\n * **`fly-typeahead`** — the design-system generic async, server-backed\r\n * typeahead.\r\n *\r\n * A reusable `{ value, label }` string autocomplete that owns ALL the fiddly\r\n * behaviour — debounce, open/close, loading + empty states, keyboard nav, ARIA\r\n * combobox/listbox semantics, click-outside dismissal, clear affordance, and\r\n * RTL via logical CSS — so a consumer only supplies one async {@link searchFn}.\r\n *\r\n * Distinct from {@link FlySelectComponent} (which filters a FIXED client-side\r\n * option list) and {@link EntityLookupComponent} (coupled to the agent lookup\r\n * registry / deep links): this one is an OPEN, server-queried free-text field.\r\n *\r\n * Pattern mirrors the shipping DS pickers: an absolutely-positioned panel (no\r\n * CDK Overlay), signal-driven `activeIndex` keyboard nav, a `document:mousedown`\r\n * click-outside guard, and `mousedown`-to-select so a pick lands before the\r\n * input's blur. Built-in strings resolve through the DS {@link I18nService}\r\n * baseline (`typeahead.*`) so the control stays localized even in a standalone\r\n * consumer.\r\n *\r\n * @example\r\n * ```html\r\n * <fly-typeahead\r\n * [searchFn]=\"tagSearch\"\r\n * [placeholder]=\"'projects.list.filter_tag' | translate\"\r\n * (selected)=\"applyTag($event)\"\r\n * (cleared)=\"clearTag()\" />\r\n * ```\r\n */\r\n@Component({\r\n selector: 'fly-typeahead',\r\n standalone: true,\r\n imports: [CommonModule, FormsModule, TranslatePipe],\r\n templateUrl: './typeahead.component.html',\r\n styleUrls: ['./typeahead.component.scss'],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'fly-typeahead',\r\n '[class.fly-typeahead--open]': 'open()',\r\n },\r\n})\r\nexport class FlyTypeaheadComponent implements OnDestroy {\r\n private readonly host = inject(ElementRef<HTMLElement>);\r\n\r\n // ── Inputs ─────────────────────────────────────────────────────────────────\r\n /** The ONLY behaviour a consumer must supply: an async search returning the\r\n * candidate `{ value, label }` rows for a query (empty query = \"top N\"). The\r\n * call rides the consumer's own service (gateway routing + auth interceptor\r\n * apply); the component owns debounce, open/close, loading, and keyboard. */\r\n readonly searchFn = input.required<(query: string) => Observable<readonly FlyTypeaheadOption[]>>();\r\n /** Debounce (ms) between the last keystroke and the {@link searchFn} call. */\r\n readonly debounceMs = input(250);\r\n /** Placeholder for the input when empty. */\r\n readonly placeholder = input('');\r\n /** Accessible name for the combobox input. Falls back to {@link placeholder},\r\n * then a localized generic \"Search\" — the input always has an a11y name even\r\n * when the consumer supplies neither. */\r\n readonly ariaLabel = input('');\r\n /** Two-way committed value. Setting it externally seeds the input text; the\r\n * component writes it on select / clear (emitting `valueChange`). */\r\n readonly value = model('');\r\n /** Allow committing raw typed text (Enter with no highlighted row commits the\r\n * trimmed query). Off = only a listed option can be chosen. */\r\n readonly allowFreeText = input(true);\r\n /** Run an empty-query search on focus to surface the \"top N\" options. */\r\n readonly openOnFocus = input(true);\r\n\r\n // ── Outputs ────────────────────────────────────────────────────────────────\r\n /** The chosen value (a picked option's `value`, or committed free text). */\r\n readonly selected = output<string>();\r\n /** The clear (✕) affordance was used — the value was reset to empty. */\r\n readonly cleared = output<void>();\r\n\r\n // ── Identity + state ─────────────────────────────────────────────────────────\r\n private readonly _uid = ++_flyTypeaheadUid;\r\n /** The value this component committed itself, and the label it displayed for it — so the\r\n * seeding effect can tell a self-commit from an external assignment (see {@link _commit}). */\r\n private _committedValue = '';\r\n private _committedLabel = '';\r\n readonly listboxId = `fly-typeahead-${this._uid}-listbox`;\r\n\r\n /** The text currently in the input box (distinct from the committed value). */\r\n readonly query = signal('');\r\n readonly open = signal(false);\r\n readonly options = signal<readonly FlyTypeaheadOption[]>([]);\r\n readonly loading = signal(false);\r\n readonly activeIndex = signal(0);\r\n\r\n constructor() {\r\n // Seed the visible text from an external value assignment (and keep the two\r\n // in sync when the component commits its own value — idempotent then). The\r\n // effect reads `value` and writes the DISTINCT `query` signal, so there is no\r\n // read-then-write loop. It fires only on a value change, never during typing\r\n // (typing touches `query`, not `value`), so it can't clobber in-progress\r\n // input.\r\n effect(() => {\r\n const v = this.value();\r\n // A self-commit already put the option's LABEL in the box — don't overwrite it with the\r\n // raw value (which for id-valued consumers is a Guid). External assignments still seed.\r\n const text = v && v === this._committedValue ? this._committedLabel : v;\r\n // Untracked write to a different signal — safe, no self-retrigger.\r\n this.query.set(text);\r\n });\r\n }\r\n\r\n private _timer: ReturnType<typeof setTimeout> | null = null;\r\n private _searchSub: Subscription | null = null;\r\n\r\n ngOnDestroy(): void {\r\n this._clearTimer();\r\n this._searchSub?.unsubscribe();\r\n }\r\n\r\n optionId(index: number): string {\r\n return `${this.listboxId}-opt-${index}`;\r\n }\r\n\r\n /** The active option's element id for `aria-activedescendant`; '' when none. */\r\n readonly activeDescendant = computed<string>(() => {\r\n if (this.options().length === 0) return '';\r\n return this.optionId(this._clampedIndex());\r\n });\r\n\r\n private _clampedIndex(): number {\r\n const size = this.options().length;\r\n if (size === 0) return 0;\r\n return Math.min(Math.max(0, this.activeIndex()), size - 1);\r\n }\r\n\r\n // ── Input + focus handlers ──────────────────────────────────────────────────\r\n onInput(v: string): void {\r\n this.query.set(v);\r\n this.activeIndex.set(0);\r\n this.open.set(true);\r\n this._scheduleSearch(v.trim());\r\n }\r\n\r\n onFocus(): void {\r\n if (!this.openOnFocus()) return;\r\n this.open.set(true);\r\n // Surface the \"top N\" once; don't re-hit the server on every refocus.\r\n if (this.options().length === 0 && !this.loading()) {\r\n this._runSearch(this.query().trim());\r\n }\r\n }\r\n\r\n onKeydown(ev: KeyboardEvent): void {\r\n const opts = this.options();\r\n if (ev.key === 'Escape') {\r\n this.open.set(false);\r\n return;\r\n }\r\n if (ev.key === 'ArrowDown') {\r\n ev.preventDefault();\r\n this.open.set(true);\r\n if (opts.length) this.activeIndex.set((this._clampedIndex() + 1) % opts.length);\r\n return;\r\n }\r\n if (ev.key === 'ArrowUp') {\r\n ev.preventDefault();\r\n if (opts.length) this.activeIndex.set((this._clampedIndex() - 1 + opts.length) % opts.length);\r\n return;\r\n }\r\n if (ev.key === 'Enter') {\r\n ev.preventDefault();\r\n const o = opts[this._clampedIndex()];\r\n if (o) this._commit(o.value, o.label);\r\n else if (this.allowFreeText() && this.query().trim()) this._commit(this.query().trim());\r\n }\r\n }\r\n\r\n // ── Selection ────────────────────────────────────────────────────────────────\r\n /** Pointer select. `mousedown` (not `click`) so the pick lands before the\r\n * input's blur; `preventDefault` keeps focus/selection stable. */\r\n onOptionMousedown(ev: MouseEvent, opt: FlyTypeaheadOption): void {\r\n ev.preventDefault();\r\n this._commit(opt.value, opt.label);\r\n }\r\n\r\n onOptionHover(index: number): void {\r\n if (index !== this.activeIndex()) this.activeIndex.set(index);\r\n }\r\n\r\n clear(): void {\r\n this._clearTimer();\r\n this._searchSub?.unsubscribe();\r\n this._committedValue = '';\r\n this._committedLabel = '';\r\n this.value.set('');\r\n this.query.set('');\r\n this.options.set([]);\r\n this.activeIndex.set(0);\r\n this.open.set(false);\r\n this.cleared.emit();\r\n }\r\n\r\n /** Commits `v`. When the value came from a listed option, the input shows that option's\r\n * LABEL — an id-valued typeahead (`value` = a Guid) must never leave a raw id sitting in a\r\n * user-facing box. `value` still carries the id; only the visible text differs. */\r\n private _commit(v: string, label?: string): void {\r\n this._committedValue = v;\r\n this._committedLabel = label ?? v;\r\n this.value.set(v);\r\n this.query.set(this._committedLabel);\r\n this.open.set(false);\r\n this.selected.emit(v);\r\n }\r\n\r\n // ── Click-outside ───────────────────────────────────────────────────────────\r\n @HostListener('document:mousedown', ['$event'])\r\n onDocumentMouseDown(ev: MouseEvent): void {\r\n if (!this.open()) return;\r\n const target = ev.target as Node | null;\r\n if (target && this.host.nativeElement.contains(target)) return;\r\n this.open.set(false);\r\n }\r\n\r\n // ── Search internals ─────────────────────────────────────────────────────────\r\n private _scheduleSearch(q: string): void {\r\n this._clearTimer();\r\n this._timer = setTimeout(() => this._runSearch(q), this.debounceMs());\r\n }\r\n\r\n private _clearTimer(): void {\r\n if (this._timer !== null) {\r\n clearTimeout(this._timer);\r\n this._timer = null;\r\n }\r\n }\r\n\r\n private _runSearch(q: string): void {\r\n this._clearTimer();\r\n this._searchSub?.unsubscribe();\r\n this.loading.set(true);\r\n this._searchSub = this.searchFn()(q).subscribe({\r\n next: (rows) => {\r\n this.options.set(rows ?? []);\r\n this.loading.set(false);\r\n this.activeIndex.set(0);\r\n },\r\n error: () => {\r\n this.options.set([]);\r\n this.loading.set(false);\r\n },\r\n });\r\n }\r\n}\r\n","<div class=\"fly-typeahead__control\">\r\n <i class=\"pi pi-search fly-typeahead__icon\" aria-hidden=\"true\"></i>\r\n <input\r\n #inputRef\r\n type=\"text\"\r\n class=\"fly-typeahead__input\"\r\n role=\"combobox\"\r\n aria-autocomplete=\"list\"\r\n aria-haspopup=\"listbox\"\r\n [attr.aria-controls]=\"listboxId\"\r\n [attr.aria-expanded]=\"open()\"\r\n [attr.aria-activedescendant]=\"open() ? activeDescendant() || null : null\"\r\n [attr.aria-label]=\"ariaLabel() || placeholder() || ('typeahead.search_label' | translate)\"\r\n [ngModel]=\"query()\"\r\n (ngModelChange)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (keydown)=\"onKeydown($event)\"\r\n [placeholder]=\"placeholder()\" />\r\n @if (query()) {\r\n <button\r\n type=\"button\"\r\n class=\"fly-typeahead__clear\"\r\n (click)=\"clear()\"\r\n [attr.aria-label]=\"'typeahead.clear' | translate\">\r\n ✕\r\n </button>\r\n }\r\n</div>\r\n\r\n@if (open()) {\r\n <ul [id]=\"listboxId\" class=\"fly-typeahead__menu\" role=\"listbox\">\r\n @if (loading()) {\r\n <li class=\"fly-typeahead__status\" role=\"status\">{{ 'typeahead.loading' | translate }}</li>\r\n } @else if (options().length === 0) {\r\n <li class=\"fly-typeahead__status\" role=\"status\">{{ 'typeahead.no_results' | translate }}</li>\r\n } @else {\r\n @for (o of options(); track o.value; let i = $index) {\r\n <li\r\n class=\"fly-typeahead__opt\"\r\n [class.is-active]=\"i === activeIndex()\"\r\n [id]=\"optionId(i)\"\r\n role=\"option\"\r\n [attr.aria-selected]=\"i === activeIndex()\"\r\n [title]=\"o.label\"\r\n (mouseenter)=\"onOptionHover(i)\"\r\n (mousedown)=\"onOptionMousedown($event, o)\">\r\n {{ o.label }}\r\n </li>\r\n }\r\n }\r\n </ul>\r\n}\r\n","/**\r\n * Public types + constants for {@link FlyCronBuilderComponent}.\r\n *\r\n * The builder targets the **Cronos** dialect the FlyOS Tasks service validates with\r\n * (`src/backend/tasks/Controllers/SchedulesController.cs`): a 5-field standard cron\r\n * (`minute hour day-of-month month day-of-week`) and, optionally, a 6-field variant\r\n * with a leading **seconds** field. Day-of-week is `0–6` with `0 = Sunday` (Cronos /\r\n * Unix standard; `7` is also accepted as Sunday on parse).\r\n */\r\n\r\n/**\r\n * The editing surface the builder is currently showing. Each non-`advanced` mode maps\r\n * to exactly one round-trippable cron shape; `advanced` exposes the raw fields.\r\n * - `none` — no schedule (emits `null`); only offered when `allowNone` is set.\r\n * - `minutes` — every N minutes (`* /N * * * *`).\r\n * - `hourly` — every N hours at a given minute (`M * /N * * *`).\r\n * - `daily` — every day at a given time (`M H * * *`).\r\n * - `weekly` — on selected weekdays at a given time (`M H * * 1,3,5`).\r\n * - `monthly` — on a day-of-month at a given time (`M H D * *`).\r\n * - `advanced` — raw per-field cron editor.\r\n */\r\nexport type CronMode =\r\n | 'none'\r\n | 'minutes'\r\n | 'hourly'\r\n | 'daily'\r\n | 'weekly'\r\n | 'monthly'\r\n | 'advanced';\r\n\r\n/** Canonical mode order used for the frequency picker when a host doesn't restrict it. */\r\nexport const CRON_MODES: readonly CronMode[] = [\r\n 'none',\r\n 'minutes',\r\n 'hourly',\r\n 'daily',\r\n 'weekly',\r\n 'monthly',\r\n 'advanced',\r\n] as const;\r\n\r\n/** Weekday numbers as emitted in the day-of-week field (`0 = Sunday … 6 = Saturday`). */\r\nexport const CRON_WEEKDAYS = [0, 1, 2, 3, 4, 5, 6] as const;\r\nexport type CronWeekday = (typeof CRON_WEEKDAYS)[number];\r\n\r\n/**\r\n * The structured snapshot the component holds and the pure helpers operate on. One flat\r\n * shape covers every mode; each mode reads only the members it needs (e.g. `weekly` reads\r\n * `weekdays`, `monthly` reads `dayOfMonth`). `fields` is the raw token list backing\r\n * `advanced` mode (length 5, or 6 when seconds are enabled).\r\n */\r\nexport interface CronParts {\r\n mode: CronMode;\r\n /** Step value for `minutes` / `hourly` (≥ 1). */\r\n everyN: number;\r\n /** Minute-of-hour for `hourly` / `daily` / `weekly` / `monthly` (0–59). */\r\n minute: number;\r\n /** Hour-of-day for `daily` / `weekly` / `monthly` (0–23). */\r\n hour: number;\r\n /** Day-of-month for `monthly` (1–31). */\r\n dayOfMonth: number;\r\n /** Selected weekdays for `weekly` (`0–6`). */\r\n weekdays: number[];\r\n /** Raw cron fields for `advanced` mode (5 tokens, or 6 with seconds). */\r\n fields: string[];\r\n}\r\n\r\n/** A single labelled input in the `advanced` per-field editor. */\r\nexport interface CronAdvancedFieldDef {\r\n /** Index into {@link CronParts.fields}. */\r\n index: number;\r\n /** Baseline-locale key for the field's label (e.g. `cron.advanced.minute`). */\r\n labelKey: string;\r\n /** Min/max for the field's accepted numeric range (used by the client-side validator). */\r\n min: number;\r\n max: number;\r\n}\r\n","/**\r\n * Pure, dependency-free cron helpers for {@link FlyCronBuilderComponent}.\r\n *\r\n * Kept separate from the component so the field-level grammar, the build (model → cron)\r\n * and the parse-back (cron → model) round-trip can be unit-tested in isolation. None of\r\n * these touch Angular, signals, or i18n.\r\n *\r\n * Authority note: the **backend Cronos parser is the source of truth** for what the Tasks\r\n * service accepts. {@link isValidCron} here is a deliberately conservative client-side\r\n * approximation covering the `* , - /` grammar (+ 3-letter month/weekday names and `?`),\r\n * so it can reject obvious typos early; it does not implement Cronos extensions like\r\n * `L`/`W`/`#`. When in doubt it favours steering the user toward the visual modes.\r\n */\r\nimport type { CronMode, CronParts } from './cron-builder.types';\r\n\r\nconst FIVE_FIELDS = 5;\r\nconst SIX_FIELDS = 6;\r\n\r\n/** Clamp `n` into `[min, max]`; non-finite input collapses to `min`. */\r\nexport function clampInt(n: number, min: number, max: number): number {\r\n if (!Number.isFinite(n)) return min;\r\n return Math.min(Math.max(Math.trunc(n), min), max);\r\n}\r\n\r\n/** Zero-pad to two digits (`9 → \"09\"`). */\r\nexport function pad2(n: number): string {\r\n return String(n).padStart(2, '0');\r\n}\r\n\r\nconst MONTH_NAMES = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];\r\nconst DOW_NAMES = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\r\n\r\nfunction splitFields(cron: string): string[] {\r\n return cron.trim().split(/\\s+/);\r\n}\r\n\r\nfunction isStar(f: string): boolean {\r\n return f === '*';\r\n}\r\n\r\n/** `\"* /N\"` → N, else null. */\r\nfunction asStep(f: string): number | null {\r\n const m = /^\\*\\/(\\d+)$/.exec(f);\r\n return m ? Number(m[1]) : null;\r\n}\r\n\r\n/** Plain integer → its value, else null. */\r\nfunction asInt(f: string): number | null {\r\n return /^\\d+$/.test(f) ? Number(f) : null;\r\n}\r\n\r\n/**\r\n * Parse a day-of-week field into a sorted, de-duplicated weekday set (`0–6`, Sunday = 0),\r\n * accepting comma lists and `a-b` ranges of numbers (with `7` normalised to `0`). Returns\r\n * `null` for `*` (every day — *not* a \"weekly\" selection) or anything outside this grammar.\r\n */\r\nexport function parseWeekdays(field: string): number[] | null {\r\n if (isStar(field)) return null;\r\n const out = new Set<number>();\r\n for (const part of field.split(',')) {\r\n const range = /^(\\d+)-(\\d+)$/.exec(part);\r\n if (range) {\r\n const a = Number(range[1]);\r\n const b = Number(range[2]);\r\n if (a > b) return null;\r\n for (let v = a; v <= b; v++) {\r\n const norm = v === 7 ? 0 : v;\r\n if (norm < 0 || norm > 6) return null;\r\n out.add(norm);\r\n }\r\n } else if (/^\\d+$/.test(part)) {\r\n let v = Number(part);\r\n if (v === 7) v = 0;\r\n if (v < 0 || v > 6) return null;\r\n out.add(v);\r\n } else {\r\n return null;\r\n }\r\n }\r\n return [...out].sort((x, y) => x - y);\r\n}\r\n\r\n/** Compact a weekday set to a cron day-of-week token (`[1,2,3,4,5]` → `\"1,2,3,4,5\"`). */\r\nexport function formatWeekdays(weekdays: number[]): string {\r\n return [...new Set(weekdays)].sort((a, b) => a - b).join(',');\r\n}\r\n\r\n/** Sensible default fields (daily 09:00) for the requested field count. */\r\nfunction defaultFields(secondsMode: boolean): string[] {\r\n return secondsMode ? ['0', '0', '9', '*', '*', '*'] : ['0', '9', '*', '*', '*'];\r\n}\r\n\r\n/** A neutral parts object (daily 09:00, Monday) used as a base for parse results. */\r\nfunction baseParts(mode: CronMode, fields: string[]): CronParts {\r\n return {\r\n mode,\r\n everyN: 1,\r\n minute: 0,\r\n hour: 9,\r\n dayOfMonth: 1,\r\n weekdays: [1],\r\n fields,\r\n };\r\n}\r\n\r\n/**\r\n * Build a cron string from a {@link CronParts} snapshot.\r\n *\r\n * Returns `null` when the snapshot cannot produce a valid expression:\r\n * - `none` mode (intentionally — `null` means \"no schedule\"),\r\n * - `weekly` with no weekday selected,\r\n * - `advanced` whose field count doesn't match `secondsMode` or has an empty field.\r\n *\r\n * `advanced` is otherwise emitted verbatim (joined) — per-field *syntax* validity is the\r\n * concern of {@link isValidCron}, not this function, so the user always sees what they typed.\r\n */\r\nexport function buildCron(parts: CronParts, secondsMode: boolean): string | null {\r\n const sec = secondsMode ? '0 ' : '';\r\n switch (parts.mode) {\r\n case 'none':\r\n return null;\r\n\r\n case 'minutes': {\r\n const n = clampInt(parts.everyN, 1, 59);\r\n const minField = n === 1 ? '*' : `*/${n}`;\r\n return `${sec}${minField} * * * *`;\r\n }\r\n\r\n case 'hourly': {\r\n const n = clampInt(parts.everyN, 1, 23);\r\n const hourField = n === 1 ? '*' : `*/${n}`;\r\n const m = clampInt(parts.minute, 0, 59);\r\n return `${sec}${m} ${hourField} * * *`;\r\n }\r\n\r\n case 'daily': {\r\n const m = clampInt(parts.minute, 0, 59);\r\n const h = clampInt(parts.hour, 0, 23);\r\n return `${sec}${m} ${h} * * *`;\r\n }\r\n\r\n case 'weekly': {\r\n if (parts.weekdays.length === 0) return null;\r\n const m = clampInt(parts.minute, 0, 59);\r\n const h = clampInt(parts.hour, 0, 23);\r\n return `${sec}${m} ${h} * * ${formatWeekdays(parts.weekdays)}`;\r\n }\r\n\r\n case 'monthly': {\r\n const m = clampInt(parts.minute, 0, 59);\r\n const h = clampInt(parts.hour, 0, 23);\r\n const d = clampInt(parts.dayOfMonth, 1, 31);\r\n return `${sec}${m} ${h} ${d} * *`;\r\n }\r\n\r\n case 'advanced': {\r\n const want = secondsMode ? SIX_FIELDS : FIVE_FIELDS;\r\n const fields = parts.fields.map((f) => f.trim());\r\n if (fields.length !== want || fields.some((f) => f === '')) return null;\r\n return fields.join(' ');\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * Parse a cron string back into a {@link CronParts} snapshot, recognising the exact shapes\r\n * {@link buildCron} produces (plus common equivalents like `* * * * *` and weekday ranges).\r\n * Anything it doesn't recognise falls back to `advanced` mode with the raw tokens preserved,\r\n * so editing an unfamiliar expression never loses data.\r\n *\r\n * `secondsMode` sets the expected field count for the empty/default case; a string carrying\r\n * its own field count is honoured regardless (a 6-field string parses with a seconds column).\r\n * A non-zero seconds column forces `advanced` (the visual modes only run at second `0`).\r\n */\r\nexport function parseCron(raw: string | null | undefined, secondsMode: boolean): CronParts {\r\n if (!raw || !raw.trim()) {\r\n return baseParts('none', defaultFields(secondsMode));\r\n }\r\n\r\n const tokens = splitFields(raw);\r\n let hasSeconds = false;\r\n let core = tokens;\r\n if (tokens.length === SIX_FIELDS) {\r\n hasSeconds = true;\r\n core = tokens.slice(1);\r\n } else if (tokens.length !== FIVE_FIELDS) {\r\n return baseParts('advanced', tokens);\r\n }\r\n\r\n // Visual modes can only represent \"run at second 0\"; any other seconds column → advanced.\r\n const secOk = !hasSeconds || tokens[0] === '0';\r\n const [minF, hourF, domF, monF, dowF] = core;\r\n\r\n const stepMin = asStep(minF);\r\n const minInt = asInt(minF);\r\n const stepHour = asStep(hourF);\r\n const hourInt = asInt(hourF);\r\n const domInt = asInt(domF);\r\n\r\n const allRestStar = isStar(domF) && isStar(monF) && isStar(dowF);\r\n\r\n // minutes: every-N (or every) minute, everything else wild.\r\n if (secOk && (isStar(minF) || stepMin !== null) && isStar(hourF) && allRestStar) {\r\n const n = isStar(minF) ? 1 : (stepMin as number);\r\n if (n >= 1) return { ...baseParts('minutes', tokens), everyN: n };\r\n }\r\n\r\n // hourly: fixed minute, every-N (or every) hour, rest wild.\r\n if (secOk && minInt !== null && minInt <= 59 && (isStar(hourF) || stepHour !== null) && allRestStar) {\r\n const n = isStar(hourF) ? 1 : (stepHour as number);\r\n if (n >= 1) return { ...baseParts('hourly', tokens), everyN: n, minute: minInt };\r\n }\r\n\r\n const fixedTime = secOk && minInt !== null && minInt <= 59 && hourInt !== null && hourInt <= 23;\r\n\r\n // daily: fixed time, every day.\r\n if (fixedTime && isStar(domF) && isStar(monF) && isStar(dowF)) {\r\n return { ...baseParts('daily', tokens), minute: minInt as number, hour: hourInt as number };\r\n }\r\n\r\n // weekly: fixed time, any month, a concrete weekday set, no day-of-month.\r\n if (fixedTime && isStar(domF) && isStar(monF)) {\r\n const wd = parseWeekdays(dowF);\r\n if (wd && wd.length > 0) {\r\n return {\r\n ...baseParts('weekly', tokens),\r\n minute: minInt as number,\r\n hour: hourInt as number,\r\n weekdays: wd,\r\n };\r\n }\r\n }\r\n\r\n // monthly: fixed time, a concrete day-of-month, any month, every weekday.\r\n if (fixedTime && domInt !== null && domInt >= 1 && domInt <= 31 && isStar(monF) && isStar(dowF)) {\r\n return {\r\n ...baseParts('monthly', tokens),\r\n minute: minInt as number,\r\n hour: hourInt as number,\r\n dayOfMonth: domInt,\r\n };\r\n }\r\n\r\n return baseParts('advanced', tokens);\r\n}\r\n\r\n/**\r\n * Validate one cron field against the `* , - /` grammar within `[min, max]`. Comma-separated\r\n * parts each allow: `*`, `* /n`, a single value, `a-b` range, and a `/n` step on `*` or a\r\n * range. `names` (3-letter month/weekday) and `?` are accepted where applicable.\r\n */\r\nfunction isValidField(\r\n field: string,\r\n min: number,\r\n max: number,\r\n names: string[] | null,\r\n allowQuestion = false,\r\n): boolean {\r\n if (field === '') return false;\r\n if (field === '?' && allowQuestion) return true; // Cronos accepts ? in dom/dow\r\n for (const part of field.split(',')) {\r\n if (!isValidFieldPart(part, min, max, names)) return false;\r\n }\r\n return true;\r\n}\r\n\r\nfunction isValidFieldPart(part: string, min: number, max: number, names: string[] | null): boolean {\r\n if (part === '*') return true;\r\n\r\n // step: \"<base>/<n>\" where base is \"*\", a value, or a range.\r\n const slash = part.indexOf('/');\r\n if (slash >= 0) {\r\n const base = part.slice(0, slash);\r\n const step = part.slice(slash + 1);\r\n if (!/^\\d+$/.test(step) || Number(step) < 1) return false;\r\n return base === '*' || isRangeOrValue(base, min, max, names);\r\n }\r\n return isRangeOrValue(part, min, max, names);\r\n}\r\n\r\nfunction isRangeOrValue(token: string, min: number, max: number, names: string[] | null): boolean {\r\n const dash = token.indexOf('-');\r\n if (dash > 0) {\r\n const a = resolveValue(token.slice(0, dash), min, max, names);\r\n const b = resolveValue(token.slice(dash + 1), min, max, names);\r\n return a !== null && b !== null && a <= b;\r\n }\r\n return resolveValue(token, min, max, names) !== null;\r\n}\r\n\r\nfunction resolveValue(token: string, min: number, max: number, names: string[] | null): number | null {\r\n if (/^\\d+$/.test(token)) {\r\n const v = Number(token);\r\n return v >= min && v <= max ? v : null;\r\n }\r\n if (names) {\r\n const idx = names.indexOf(token.toLowerCase());\r\n if (idx >= 0) return idx;\r\n }\r\n return null;\r\n}\r\n\r\n/** Grammar bounds for one cron column. */\r\ninterface CronFieldSpec {\r\n min: number;\r\n max: number;\r\n names: string[] | null;\r\n allowQuestion: boolean;\r\n}\r\n\r\n/** Per-column specs in field order (seconds prepended when enabled). Single source of truth. */\r\nfunction fieldSpecs(secondsMode: boolean): CronFieldSpec[] {\r\n const core: CronFieldSpec[] = [\r\n { min: 0, max: 59, names: null, allowQuestion: false }, // minute\r\n { min: 0, max: 23, names: null, allowQuestion: false }, // hour\r\n { min: 1, max: 31, names: null, allowQuestion: true }, // day-of-month\r\n { min: 1, max: 12, names: MONTH_NAMES, allowQuestion: false }, // month\r\n { min: 0, max: 7, names: DOW_NAMES, allowQuestion: true }, // day-of-week\r\n ];\r\n return secondsMode\r\n ? [{ min: 0, max: 59, names: null, allowQuestion: false }, ...core] // seconds\r\n : core;\r\n}\r\n\r\n/**\r\n * Conservative client-side validity check for a whole expression (5- or 6-field). See the\r\n * module note: the backend Cronos parser remains authoritative; this catches obvious typos.\r\n */\r\nexport function isValidCron(cron: string | null | undefined, secondsMode: boolean): boolean {\r\n if (!cron || !cron.trim()) return false;\r\n const tokens = splitFields(cron);\r\n const specs = fieldSpecs(secondsMode);\r\n if (tokens.length !== specs.length) return false;\r\n return tokens.every((tok, i) =>\r\n isValidField(tok, specs[i].min, specs[i].max, specs[i].names, specs[i].allowQuestion),\r\n );\r\n}\r\n\r\n/**\r\n * Validity of a single `advanced`-mode field by its column `index` (used to flag an\r\n * individual input as `aria-invalid`). Shares {@link fieldSpecs} with {@link isValidCron}.\r\n */\r\nexport function isValidSingleField(field: string, index: number, secondsMode: boolean): boolean {\r\n const spec = fieldSpecs(secondsMode)[index];\r\n return spec ? isValidField(field, spec.min, spec.max, spec.names, spec.allowQuestion) : false;\r\n}\r\n","import {\r\n AfterViewChecked,\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n OnInit,\r\n computed,\r\n forwardRef,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport {\r\n AbstractControl,\r\n ControlValueAccessor,\r\n NG_VALIDATORS,\r\n NG_VALUE_ACCESSOR,\r\n ValidationErrors,\r\n Validator,\r\n} from '@angular/forms';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { I18nService } from '../../services/i18n.service';\r\nimport {\r\n CRON_MODES,\r\n CronAdvancedFieldDef,\r\n CronMode,\r\n CronParts,\r\n} from './cron-builder.types';\r\nimport {\r\n buildCron,\r\n clampInt,\r\n isValidCron,\r\n isValidSingleField,\r\n pad2,\r\n parseCron,\r\n} from './cron-builder.utils';\r\n\r\n/** Process-wide counter so each instance owns unique element ids (`<label for>` ↔ control). */\r\nlet _flyCronUid = 0;\r\n\r\n/**\r\n * **`fly-cron-builder`** — the design-system visual cron-expression builder.\r\n *\r\n * Lets a user compose a cron schedule from a friendly, mode-based UI (every-N-minutes,\r\n * hourly, daily, weekly, monthly) instead of hand-writing cron, with an `advanced` escape\r\n * hatch exposing the raw fields. The form-control value is the **cron string** itself\r\n * (`string | null`, where `null` = \"no schedule\" / on-demand), so it drops straight into a\r\n * reactive form or `[(ngModel)]` and round-trips an existing expression on `writeValue`.\r\n *\r\n * Dialect: the FlyOS **Cronos** shape (5-field standard; optional 6-field with a leading\r\n * seconds column via `[seconds]=\"true\"`). The backend Cronos parser stays authoritative —\r\n * the inline validity check is a conservative client-side approximation (see\r\n * {@link isValidCron}).\r\n *\r\n * Self-sufficient i18n: every string comes from the `cron.*` keys in\r\n * `DS_BASELINE_LOCALES` (en/ar/fr/ur), overridable by any consumer key of the same name.\r\n * RTL works via logical CSS — no per-side overrides. Styling uses DS theme tokens\r\n * (`--surface-card`, `--surface-border`, `--text-color`, `--primary-color`, …) with\r\n * light-neutral fallbacks, mirroring {@link FlySelectComponent}.\r\n */\r\n@Component({\r\n selector: 'fly-cron-builder',\r\n standalone: true,\r\n imports: [CommonModule, TranslatePipe],\r\n templateUrl: './cron-builder.component.html',\r\n styleUrl: './cron-builder.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [\r\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FlyCronBuilderComponent), multi: true },\r\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => FlyCronBuilderComponent), multi: true },\r\n ],\r\n host: {\r\n class: 'fly-cron-builder',\r\n '[class.fly-cron-builder--disabled]': 'effectiveDisabled()',\r\n },\r\n})\r\nexport class FlyCronBuilderComponent\r\n implements OnInit, AfterViewChecked, ControlValueAccessor, Validator {\r\n private readonly i18n = inject(I18nService);\r\n\r\n // ── Inputs ───────────────────────────────────────────────────────────────────\r\n /** Use the 6-field (with-seconds) dialect. Visual modes still fire at second `0`. */\r\n readonly seconds = input(false);\r\n /** Offer the \"on demand (no schedule)\" mode, whose value is `null`. */\r\n readonly allowNone = input(true);\r\n /** Restrict / reorder the offered frequency modes. `none` is filtered out when `allowNone` is false. */\r\n readonly modes = input<readonly CronMode[]>(CRON_MODES);\r\n /** Disable the whole control (also driven by reactive-forms `setDisabledState`). */\r\n readonly disabled = input(false);\r\n /** First column in the weekday picker (`0 = Sunday` … `6 = Saturday`). Display only — the\r\n * emitted cron is unaffected. Defaults to Sunday. */\r\n readonly firstDayOfWeek = input(0);\r\n\r\n // ── Outputs ──────────────────────────────────────────────────────────────────\r\n /** Emits the cron string (or `null` for the `none` mode) on every change. */\r\n readonly cronChange = output<string | null>();\r\n /** Emits the client-side validity on every change. Hosts may disable submit when false. */\r\n readonly validityChange = output<boolean>();\r\n\r\n // ── Identity ─────────────────────────────────────────────────────────────────\r\n private readonly _uid = ++_flyCronUid;\r\n readonly modeSelectId = `fly-cron-${this._uid}-mode`;\r\n readonly timeInputId = `fly-cron-${this._uid}-time`;\r\n\r\n /** Stable per-field id for the advanced-mode label/input pair (`@for`-repeated). */\r\n fieldInputId(index: number): string {\r\n return `fly-cron-${this._uid}-field-${index}`;\r\n }\r\n\r\n // ── State (signals) ──────────────────────────────────────────────────────────\r\n readonly mode = signal<CronMode>('daily');\r\n readonly everyN = signal(1);\r\n readonly minute = signal(0);\r\n readonly hour = signal(9);\r\n readonly dayOfMonth = signal(1);\r\n readonly weekdays = signal<number[]>([1]);\r\n readonly fields = signal<string[]>(['0', '9', '*', '*', '*']);\r\n\r\n private readonly _cvaDisabled = signal(false);\r\n private _touched = false;\r\n\r\n /** The native frequency `<select>`, synced imperatively (see the constructor). */\r\n private readonly modeSelectRef = viewChild<ElementRef<HTMLSelectElement>>('modeSelect');\r\n\r\n private _onChange: (v: string | null) => void = () => undefined;\r\n private _onTouched: () => void = () => undefined;\r\n private _onValidatorChange: () => void = () => undefined;\r\n\r\n // A native <select> can't be reliably driven by a [value] / [selected] template binding:\r\n // on cold render (e.g. formControlName's writeValue before the first CD) the binding is\r\n // applied before the @for options exist, so the select silently falls back to its first\r\n // option (\"On demand\") even though mode() is correct. We sync imperatively instead:\r\n // • ngAfterViewChecked covers the cold-mount case (element appears only after first render);\r\n // • _syncSelect() from _applyParts covers a post-mount programmatic write (host swaps the\r\n // routine) without depending on a later CD pass firing.\r\n // Setting `.value` programmatically does not emit a `change` event, so there is no loop.\r\n ngAfterViewChecked(): void {\r\n this._syncSelect();\r\n }\r\n\r\n private _syncSelect(): void {\r\n const el = this.modeSelectRef()?.nativeElement;\r\n if (el && el.value !== this.mode()) el.value = this.mode();\r\n }\r\n\r\n // ── Derived view state ─────────────────────────────────────────────────────────\r\n readonly effectiveDisabled = computed(() => this.disabled() || this._cvaDisabled());\r\n\r\n /** Offered modes after applying `allowNone`. Always non-empty (falls back to `daily`). */\r\n readonly availableModes = computed<readonly CronMode[]>(() => {\r\n const base = this.modes().length > 0 ? this.modes() : CRON_MODES;\r\n const filtered = this.allowNone() ? base : base.filter((m) => m !== 'none');\r\n return filtered.length > 0 ? filtered : (['daily'] as const);\r\n });\r\n\r\n /** Weekday display order, rotated to start on {@link firstDayOfWeek}. */\r\n readonly weekdayOrder = computed<number[]>(() => {\r\n const first = clampInt(this.firstDayOfWeek(), 0, 6);\r\n return Array.from({ length: 7 }, (_, i) => (first + i) % 7);\r\n });\r\n\r\n /** `<input type=\"time\">` value (`\"HH:MM\"`) bound by the daily / weekly / monthly editors. */\r\n readonly timeValue = computed(() => `${pad2(this.hour())}:${pad2(this.minute())}`);\r\n\r\n /** Labelled inputs for the `advanced` per-field editor (6 columns when seconds are enabled). */\r\n readonly advancedFieldDefs = computed<CronAdvancedFieldDef[]>(() => {\r\n const core: Omit<CronAdvancedFieldDef, 'index'>[] = [\r\n { labelKey: 'cron.advanced.minute', min: 0, max: 59 },\r\n { labelKey: 'cron.advanced.hour', min: 0, max: 23 },\r\n { labelKey: 'cron.advanced.day_of_month', min: 1, max: 31 },\r\n { labelKey: 'cron.advanced.month', min: 1, max: 12 },\r\n { labelKey: 'cron.advanced.day_of_week', min: 0, max: 7 },\r\n ];\r\n const withSeconds = this.seconds()\r\n ? [{ labelKey: 'cron.advanced.second', min: 0, max: 59 }, ...core]\r\n : core;\r\n return withSeconds.map((f, index) => ({ index, ...f }));\r\n });\r\n\r\n /** The cron string this control would emit for its current state (`null` for `none`). */\r\n readonly expression = computed<string | null>(() => buildCron(this._snapshot(), this.seconds()));\r\n\r\n /** `{ valid, errorKey }` — single source feeding both the template and {@link validate}. */\r\n private readonly _validity = computed<{ valid: boolean; errorKey: string | null }>(() => {\r\n const mode = this.mode();\r\n if (mode === 'none') {\r\n return this.allowNone()\r\n ? { valid: true, errorKey: null }\r\n : { valid: false, errorKey: 'cron.error.required' };\r\n }\r\n if (mode === 'weekly' && this.weekdays().length === 0) {\r\n return { valid: false, errorKey: 'cron.error.weekday_required' };\r\n }\r\n if (mode === 'advanced') {\r\n const expr = this.fields().map((f) => f.trim()).join(' ');\r\n return isValidCron(expr, this.seconds())\r\n ? { valid: true, errorKey: null }\r\n : { valid: false, errorKey: 'cron.error.invalid' };\r\n }\r\n return { valid: true, errorKey: null };\r\n });\r\n\r\n readonly valid = computed(() => this._validity().valid);\r\n readonly errorKey = computed(() => this._validity().errorKey);\r\n\r\n /** Localized human-readable summary of the current schedule (reactive to locale + state). */\r\n readonly summary = computed<string>(() => {\r\n void this.i18n.version(); // re-run when locale bundles change\r\n if (this.mode() === 'advanced') {\r\n const expr = this.fields().map((f) => f.trim()).join(' ');\r\n if (!isValidCron(expr, this.seconds())) return this.i18n.t('cron.error.invalid');\r\n return this._describe(parseCron(expr, this.seconds()));\r\n }\r\n return this._describe(this._snapshot());\r\n });\r\n\r\n // ── Lifecycle ──────────────────────────────────────────────────────────────────\r\n ngOnInit(): void {\r\n // Forms call writeValue() before this; if nothing was written, align the initial mode\r\n // with what's actually on offer. Defer the validity emit so a parent binding observing\r\n // (validityChange) in the same CD cycle doesn't trip ExpressionChanged.\r\n if (!this.availableModes().includes(this.mode())) {\r\n this.mode.set(this.availableModes()[0]);\r\n }\r\n queueMicrotask(() => this.validityChange.emit(this.valid()));\r\n }\r\n\r\n // ── Template helpers ───────────────────────────────────────────────────────────\r\n isWeekday(day: number): boolean {\r\n return this.weekdays().includes(day);\r\n }\r\n\r\n fieldValid(index: number): boolean {\r\n return isValidSingleField(this.fields()[index] ?? '', index, this.seconds());\r\n }\r\n\r\n // ── User actions ───────────────────────────────────────────────────────────────\r\n onModeChange(mode: CronMode): void {\r\n if (this.effectiveDisabled()) return;\r\n // Entering advanced: seed the raw fields from the current structured value so the user\r\n // starts from where they were, not a blank slate. Also guarantees the field count matches\r\n // the seconds mode.\r\n if (mode === 'advanced') {\r\n const expr = buildCron({ ...this._snapshot(), mode: this._lastConcreteMode() }, this.seconds());\r\n const want = this.seconds() ? 6 : 5;\r\n const seed = expr ? expr.split(/\\s+/) : [];\r\n this.fields.set(seed.length === want ? seed : this._defaultFields());\r\n }\r\n this.mode.set(mode);\r\n this._emit();\r\n }\r\n\r\n onEveryN(value: string): void {\r\n const max = this.mode() === 'hourly' ? 23 : 59;\r\n this.everyN.set(clampInt(Number(value), 1, max));\r\n this._emit();\r\n }\r\n\r\n onMinute(value: string): void {\r\n this.minute.set(clampInt(Number(value), 0, 59));\r\n this._emit();\r\n }\r\n\r\n onDayOfMonth(value: string): void {\r\n this.dayOfMonth.set(clampInt(Number(value), 1, 31));\r\n this._emit();\r\n }\r\n\r\n onTime(value: string): void {\r\n const [h, m] = value.split(':');\r\n this.hour.set(clampInt(Number(h), 0, 23));\r\n this.minute.set(clampInt(Number(m), 0, 59));\r\n this._emit();\r\n }\r\n\r\n toggleWeekday(day: number): void {\r\n if (this.effectiveDisabled()) return;\r\n const set = new Set(this.weekdays());\r\n if (set.has(day)) {\r\n set.delete(day);\r\n } else {\r\n set.add(day);\r\n }\r\n this.weekdays.set([...set].sort((a, b) => a - b));\r\n this._emit();\r\n }\r\n\r\n onFieldInput(index: number, value: string): void {\r\n const next = [...this.fields()];\r\n next[index] = value;\r\n this.fields.set(next);\r\n this._emit();\r\n }\r\n\r\n // ── ControlValueAccessor ─────────────────────────────────────────────────────────\r\n writeValue(value: string | null | undefined): void {\r\n const parts = parseCron(value, this.seconds());\r\n // An empty value means \"none\" only when the host allows it; otherwise show a default mode.\r\n if (parts.mode === 'none' && !this.allowNone()) {\r\n this._applyParts(parseCron(this._defaultFields().join(' '), this.seconds()));\r\n return;\r\n }\r\n this._applyParts(parts);\r\n }\r\n\r\n registerOnChange(fn: (v: string | null) => void): void {\r\n this._onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this._onTouched = fn;\r\n }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this._cvaDisabled.set(isDisabled);\r\n }\r\n\r\n // ── Validator ──────────────────────────────────────────────────────────────────\r\n validate(_: AbstractControl): ValidationErrors | null {\r\n const { valid, errorKey } = this._validity();\r\n if (valid) return null;\r\n return errorKey === 'cron.error.required' ? { cronRequired: true } : { cronInvalid: true };\r\n }\r\n\r\n registerOnValidatorChange(fn: () => void): void {\r\n this._onValidatorChange = fn;\r\n }\r\n\r\n // ── Internals ──────────────────────────────────────────────────────────────────\r\n private _snapshot(): CronParts {\r\n return {\r\n mode: this.mode(),\r\n everyN: this.everyN(),\r\n minute: this.minute(),\r\n hour: this.hour(),\r\n dayOfMonth: this.dayOfMonth(),\r\n weekdays: this.weekdays(),\r\n fields: this.fields(),\r\n };\r\n }\r\n\r\n /** When in advanced mode, treat the prior structured shape as `daily` for the re-seed. */\r\n private _lastConcreteMode(): CronMode {\r\n return this.mode() === 'advanced' || this.mode() === 'none' ? 'daily' : this.mode();\r\n }\r\n\r\n private _defaultFields(): string[] {\r\n return this.seconds() ? ['0', '0', '9', '*', '*', '*'] : ['0', '9', '*', '*', '*'];\r\n }\r\n\r\n private _applyParts(p: CronParts): void {\r\n this.mode.set(p.mode);\r\n this.everyN.set(p.everyN);\r\n this.minute.set(p.minute);\r\n this.hour.set(p.hour);\r\n this.dayOfMonth.set(p.dayOfMonth);\r\n this.weekdays.set(p.weekdays);\r\n this.fields.set(p.fields);\r\n // Re-sync the native select for a post-mount programmatic write (no-op before first render,\r\n // where ngAfterViewChecked handles it instead).\r\n this._syncSelect();\r\n }\r\n\r\n private _emit(): void {\r\n this._markTouched();\r\n this._onChange(this.expression());\r\n this.cronChange.emit(this.expression());\r\n this._onValidatorChange();\r\n this.validityChange.emit(this.valid());\r\n }\r\n\r\n private _markTouched(): void {\r\n if (this._touched) return;\r\n this._touched = true;\r\n this._onTouched();\r\n }\r\n\r\n /** Build the localized cadence sentence for a structured snapshot. */\r\n private _describe(p: CronParts): string {\r\n const t = (k: string, params?: Record<string, string | number>): string => this.i18n.t(k, params);\r\n const time = `${pad2(p.hour)}:${pad2(p.minute)}`;\r\n switch (p.mode) {\r\n case 'none':\r\n return t('cron.summary.none');\r\n case 'minutes': {\r\n const n = clampInt(p.everyN, 1, 59);\r\n return n === 1 ? t('cron.summary.every_minute') : t('cron.summary.every_n_minutes', { n });\r\n }\r\n case 'hourly': {\r\n const n = clampInt(p.everyN, 1, 23);\r\n const m = clampInt(p.minute, 0, 59);\r\n return n === 1\r\n ? t('cron.summary.hourly_at', { m })\r\n : t('cron.summary.every_n_hours', { n, m });\r\n }\r\n case 'daily':\r\n return t('cron.summary.daily_at', { time });\r\n case 'weekly': {\r\n if (p.weekdays.length === 0) return t('cron.error.weekday_required');\r\n return t('cron.summary.weekly_at', { days: this._weekdayNames(p.weekdays), time });\r\n }\r\n case 'monthly':\r\n return t('cron.summary.monthly_at', { d: clampInt(p.dayOfMonth, 1, 31), time });\r\n case 'advanced':\r\n return t('cron.summary.custom');\r\n }\r\n }\r\n\r\n private _weekdayNames(weekdays: number[]): string {\r\n const sep = this.i18n.t('cron.list_separator');\r\n return [...weekdays]\r\n .sort((a, b) => a - b)\r\n .map((d) => this.i18n.t(`cron.weekday_short.${d}`))\r\n .join(sep);\r\n }\r\n}\r\n","<!-- ── Frequency selector ──────────────────────────────────────────────────────── -->\r\n<div class=\"fly-cron__row\">\r\n <label class=\"fly-cron__label\" [attr.for]=\"modeSelectId\">{{ 'cron.frequency_label' | translate }}</label>\r\n <!-- Selection is synced imperatively by an effect() (see the component) — a [value] /\r\n [selected] binding is applied before the @for options exist on cold render and falls\r\n back to the first option. The #modeSelect ref is what the effect drives. -->\r\n <select\r\n #modeSelect\r\n class=\"fly-cron__select\"\r\n [id]=\"modeSelectId\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (change)=\"onModeChange($any($event.target).value)\"\r\n >\r\n @for (m of availableModes(); track m) {\r\n <option [value]=\"m\">{{ ('cron.mode.' + m) | translate }}</option>\r\n }\r\n </select>\r\n</div>\r\n\r\n<!-- ── Mode-specific editor ────────────────────────────────────────────────────── -->\r\n@switch (mode()) {\r\n @case ('minutes') {\r\n <div class=\"fly-cron__row\">\r\n <span class=\"fly-cron__label\">{{ 'cron.every_label' | translate }}</span>\r\n <input\r\n class=\"fly-cron__num\"\r\n type=\"number\"\r\n min=\"1\"\r\n max=\"59\"\r\n [value]=\"everyN()\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (input)=\"onEveryN($any($event.target).value)\"\r\n />\r\n <span class=\"fly-cron__suffix\">{{ 'cron.unit_minutes' | translate }}</span>\r\n </div>\r\n }\r\n\r\n @case ('hourly') {\r\n <div class=\"fly-cron__row fly-cron__row--wrap\">\r\n <span class=\"fly-cron__label\">{{ 'cron.every_label' | translate }}</span>\r\n <input\r\n class=\"fly-cron__num\"\r\n type=\"number\"\r\n min=\"1\"\r\n max=\"23\"\r\n [value]=\"everyN()\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (input)=\"onEveryN($any($event.target).value)\"\r\n />\r\n <span class=\"fly-cron__suffix\">{{ 'cron.unit_hours' | translate }}</span>\r\n <span class=\"fly-cron__suffix\">{{ 'cron.at_minute_label' | translate }}</span>\r\n <input\r\n class=\"fly-cron__num\"\r\n type=\"number\"\r\n min=\"0\"\r\n max=\"59\"\r\n [value]=\"minute()\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (input)=\"onMinute($any($event.target).value)\"\r\n />\r\n </div>\r\n }\r\n\r\n @case ('daily') {\r\n <div class=\"fly-cron__row\">\r\n <label class=\"fly-cron__label\" [attr.for]=\"timeInputId\">{{ 'cron.time_label' | translate }}</label>\r\n <input\r\n class=\"fly-cron__time\"\r\n type=\"time\"\r\n [id]=\"timeInputId\"\r\n [value]=\"timeValue()\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (input)=\"onTime($any($event.target).value)\"\r\n />\r\n </div>\r\n }\r\n\r\n @case ('weekly') {\r\n <div class=\"fly-cron__row fly-cron__row--wrap\">\r\n <span class=\"fly-cron__label\">{{ 'cron.on_days_label' | translate }}</span>\r\n <div class=\"fly-cron__weekdays\" role=\"group\" [attr.aria-label]=\"'cron.on_days_label' | translate\">\r\n @for (d of weekdayOrder(); track d) {\r\n <button\r\n type=\"button\"\r\n role=\"checkbox\"\r\n class=\"fly-cron__chip\"\r\n [class.fly-cron__chip--on]=\"isWeekday(d)\"\r\n [attr.aria-checked]=\"isWeekday(d)\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (click)=\"toggleWeekday(d)\"\r\n >{{ ('cron.weekday_short.' + d) | translate }}</button>\r\n }\r\n </div>\r\n </div>\r\n <div class=\"fly-cron__row\">\r\n <label class=\"fly-cron__label\" [attr.for]=\"timeInputId\">{{ 'cron.time_label' | translate }}</label>\r\n <input\r\n class=\"fly-cron__time\"\r\n type=\"time\"\r\n [id]=\"timeInputId\"\r\n [value]=\"timeValue()\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (input)=\"onTime($any($event.target).value)\"\r\n />\r\n </div>\r\n }\r\n\r\n @case ('monthly') {\r\n <div class=\"fly-cron__row fly-cron__row--wrap\">\r\n <span class=\"fly-cron__label\">{{ 'cron.day_of_month_label' | translate }}</span>\r\n <input\r\n class=\"fly-cron__num\"\r\n type=\"number\"\r\n min=\"1\"\r\n max=\"31\"\r\n [value]=\"dayOfMonth()\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (input)=\"onDayOfMonth($any($event.target).value)\"\r\n />\r\n <label class=\"fly-cron__label\" [attr.for]=\"timeInputId\">{{ 'cron.time_label' | translate }}</label>\r\n <input\r\n class=\"fly-cron__time\"\r\n type=\"time\"\r\n [id]=\"timeInputId\"\r\n [value]=\"timeValue()\"\r\n [disabled]=\"effectiveDisabled()\"\r\n (input)=\"onTime($any($event.target).value)\"\r\n />\r\n </div>\r\n }\r\n\r\n @case ('advanced') {\r\n <div class=\"fly-cron__advanced\">\r\n @for (f of advancedFieldDefs(); track f.index) {\r\n <div class=\"fly-cron__field\">\r\n <label class=\"fly-cron__field-label\" [attr.for]=\"fieldInputId(f.index)\">{{ f.labelKey | translate }}</label>\r\n <input\r\n [id]=\"fieldInputId(f.index)\"\r\n class=\"fly-cron__field-input fly-cron__mono\"\r\n type=\"text\"\r\n inputmode=\"text\"\r\n autocomplete=\"off\"\r\n spellcheck=\"false\"\r\n placeholder=\"*\"\r\n [value]=\"fields()[f.index]\"\r\n [disabled]=\"effectiveDisabled()\"\r\n [attr.aria-invalid]=\"!fieldValid(f.index)\"\r\n [attr.aria-label]=\"f.labelKey | translate\"\r\n (input)=\"onFieldInput(f.index, $any($event.target).value)\"\r\n />\r\n </div>\r\n }\r\n </div>\r\n <p class=\"fly-cron__hint\">{{ 'cron.advanced.hint' | translate }}</p>\r\n }\r\n}\r\n\r\n<!-- ── Summary + resulting expression ──────────────────────────────────────────── -->\r\n@if (mode() !== 'none') {\r\n <div class=\"fly-cron__summary\" [class.fly-cron__summary--error]=\"!valid()\" aria-live=\"polite\">\r\n <span class=\"fly-cron__summary-text\">{{ summary() }}</span>\r\n @if (expression(); as expr) {\r\n <code class=\"fly-cron__expr fly-cron__mono\">{{ expr }}</code>\r\n }\r\n </div>\r\n}\r\n\r\n@if (errorKey(); as ek) {\r\n <p class=\"fly-cron__error\" role=\"alert\">{{ ek | translate }}</p>\r\n}\r\n","/**\n * Pure, dependency-free geometry + tree helpers for {@link FlyGanttComponent}.\n *\n * Kept out of the component so the date-scale math (date ⇄ px), the tree flatten/collapse,\n * the group-span aggregation, the dependency-link resolution and the RTL coordinate mapping\n * can all be unit-tested in isolation. Nothing here touches Angular, signals, the DOM, or i18n.\n *\n * **Time model.** Every date is normalised to **UTC midnight** so the horizontal scale is\n * DST- and timezone-agnostic: one calendar day is always exactly one grid unit regardless of\n * the browser's local offset. `YYYY-MM-DD` strings and full ISO timestamps are both accepted\n * on the way in; only `YYYY-MM-DD` is emitted back out.\n *\n * **Coordinate model.** All geometry is computed in a left-to-right \"logical\" space (x grows\n * with time). {@link mapX} / {@link projectBar} mirror that logical x into render space for RTL\n * locales, so the rest of the component never branches on direction.\n */\nimport type { GanttDependency, GanttRow, GanttZoom } from './gantt.types';\n\nexport const MS_PER_DAY = 86_400_000;\n\n/** Pixels allotted to one calendar day at each zoom level. Everything scales off this. */\nexport const ZOOM_PX_PER_DAY: Readonly<Record<GanttZoom, number>> = {\n day: 36,\n week: 16,\n month: 5.2,\n quarter: 2.4,\n};\n\n/** Days of leading/trailing breathing room added to the data extent, per zoom. */\nconst ZOOM_PAD_DAYS: Readonly<Record<GanttZoom, number>> = {\n day: 2,\n week: 7,\n month: 21,\n quarter: 62,\n};\n\n/** Weekend shading + per-day gridlines only make sense at the two finest zooms. */\nexport function zoomShowsWeekends(zoom: GanttZoom): boolean {\n return zoom === 'day' || zoom === 'week';\n}\n\n// ── Date primitives (all UTC) ────────────────────────────────────────────────\n\n/** Parse an ISO date/timestamp to its UTC-midnight `Date`, or `null` when unparseable. */\nexport function parseIsoDate(value: string | null | undefined): Date | null {\n if (!value) return null;\n // Date-only string → treat the calendar date as UTC midnight (no local-tz shift).\n const dateOnly = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(value);\n if (dateOnly) {\n const d = new Date(\n Date.UTC(Number(dateOnly[1]), Number(dateOnly[2]) - 1, Number(dateOnly[3])),\n );\n return Number.isNaN(d.getTime()) ? null : d;\n }\n const parsed = new Date(value);\n if (Number.isNaN(parsed.getTime())) return null;\n return startOfUtcDay(parsed);\n}\n\n/** Format a `Date` as an ISO `YYYY-MM-DD` calendar date (UTC). */\nexport function toIsoDate(date: Date): string {\n return date.toISOString().slice(0, 10);\n}\n\n/** Truncate any `Date` to UTC midnight. */\nexport function startOfUtcDay(date: Date): Date {\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate()));\n}\n\n/** Add (or subtract) whole days in UTC. */\nexport function addDays(date: Date, days: number): Date {\n return new Date(date.getTime() + days * MS_PER_DAY);\n}\n\n/** Signed day distance `to - from` (fractional when either carries a sub-day component). */\nexport function daysBetween(from: Date, to: Date): number {\n return (to.getTime() - from.getTime()) / MS_PER_DAY;\n}\n\n/** UTC-Monday of the week containing `date` (ISO week start). */\nexport function startOfUtcWeek(date: Date): Date {\n const d = startOfUtcDay(date);\n const dow = d.getUTCDay(); // 0=Sun … 6=Sat\n const backToMonday = (dow + 6) % 7;\n return addDays(d, -backToMonday);\n}\n\nexport function startOfUtcMonth(date: Date): Date {\n return new Date(Date.UTC(date.getUTCFullYear(), date.getUTCMonth(), 1));\n}\n\nexport function startOfUtcQuarter(date: Date): Date {\n const q = Math.floor(date.getUTCMonth() / 3) * 3;\n return new Date(Date.UTC(date.getUTCFullYear(), q, 1));\n}\n\n// ── Scale (date ⇄ x) ─────────────────────────────────────────────────────────\n\n/** Logical x (px from the domain start) for a date. */\nexport function dateToX(date: Date, domainStart: Date, pxPerDay: number): number {\n return daysBetween(domainStart, date) * pxPerDay;\n}\n\n/** Inverse of {@link dateToX} — the date at a logical x offset. */\nexport function xToDate(x: number, domainStart: Date, pxPerDay: number): Date {\n return addDays(domainStart, x / pxPerDay);\n}\n\n/** Days represented by a pixel delta at the given zoom (rounded to whole days). */\nexport function pxToDays(px: number, pxPerDay: number): number {\n return Math.round(px / pxPerDay);\n}\n\n// ── Domain ───────────────────────────────────────────────────────────────────\n\nexport interface GanttDomain {\n start: Date;\n end: Date;\n}\n\n/** Snap a date back to the natural period boundary for a zoom (week/month/quarter start). */\nfunction snapDomainStart(date: Date, zoom: GanttZoom): Date {\n switch (zoom) {\n case 'day':\n case 'week':\n return startOfUtcWeek(date);\n case 'month':\n return startOfUtcMonth(date);\n case 'quarter':\n return startOfUtcQuarter(date);\n }\n}\n\n/**\n * Compute the visible time window from the rows' resolved dates plus zoom-scaled padding,\n * snapped to a clean period boundary on the left. Falls back to a window around `today`\n * (or the real today) when nothing is scheduled, so an empty chart still renders a grid.\n */\nexport function computeDomain(\n rows: readonly GanttRow[],\n zoom: GanttZoom,\n today: Date = new Date(),\n): GanttDomain {\n const resolved = resolveRowDates(rows);\n let min: number | null = null;\n let max: number | null = null;\n for (const { start, end } of resolved.values()) {\n if (start) {\n min = min === null ? start.getTime() : Math.min(min, start.getTime());\n max = max === null ? start.getTime() : Math.max(max, start.getTime());\n }\n if (end) {\n min = min === null ? end.getTime() : Math.min(min, end.getTime());\n max = max === null ? end.getTime() : Math.max(max, end.getTime());\n }\n }\n\n const pad = ZOOM_PAD_DAYS[zoom];\n const base = startOfUtcDay(today);\n const lo = min === null ? addDays(base, -7) : new Date(min);\n const hi = max === null ? addDays(base, 21) : new Date(max);\n\n const start = snapDomainStart(addDays(lo, -pad), zoom);\n const end = addDays(hi, pad);\n // Guarantee a non-degenerate window.\n return end.getTime() <= start.getTime() ? { start, end: addDays(start, pad * 2) } : { start, end };\n}\n\n// ── Tree flatten / collapse ──────────────────────────────────────────────────\n\nexport interface GanttFlatRow {\n row: GanttRow;\n /** 0 = root. */\n depth: number;\n hasChildren: boolean;\n collapsed: boolean;\n}\n\n/**\n * The effective parent of a row: its `parentId` unless that is missing, self-referential,\n * points at an absent row, or would close a cycle — in which case the row becomes a root.\n * This is what makes the flatten **cycle-safe**: no input can wedge the DFS.\n */\nfunction effectiveParentId(row: GanttRow, byId: ReadonlyMap<string, GanttRow>): string | null {\n const pid = row.parentId;\n if (!pid || pid === row.id || !byId.has(pid)) return null;\n const seen = new Set<string>([row.id]);\n let cursor: string | null = pid;\n while (cursor) {\n if (seen.has(cursor)) return null; // walking up returned to us → cycle → treat as root\n seen.add(cursor);\n const parent = byId.get(cursor);\n if (!parent) break;\n const next = parent.parentId;\n cursor = next && next !== parent.id && byId.has(next) ? next : null;\n }\n return pid;\n}\n\n/**\n * Flatten the row tree into the visible, ordered display list. Sibling order follows input\n * order; a row in `collapsedIds` still renders but its descendants are omitted. Duplicate ids\n * are dropped after the first (defensive — ids must be unique).\n */\nexport function flattenRows(\n rows: readonly GanttRow[],\n collapsedIds: ReadonlySet<string>,\n): GanttFlatRow[] {\n const byId = new Map<string, GanttRow>();\n for (const r of rows) if (!byId.has(r.id)) byId.set(r.id, r);\n\n const childrenByParent = new Map<string | null, GanttRow[]>();\n for (const r of byId.values()) {\n const pid = effectiveParentId(r, byId);\n const list = childrenByParent.get(pid);\n if (list) list.push(r);\n else childrenByParent.set(pid, [r]);\n }\n\n const out: GanttFlatRow[] = [];\n const visit = (parentId: string | null, depth: number): void => {\n const kids = childrenByParent.get(parentId);\n if (!kids) return;\n for (const row of kids) {\n const hasChildren = (childrenByParent.get(row.id)?.length ?? 0) > 0;\n const collapsed = hasChildren && collapsedIds.has(row.id);\n out.push({ row, depth, hasChildren, collapsed });\n if (hasChildren && !collapsed) visit(row.id, depth + 1);\n }\n };\n visit(null, 0);\n return out;\n}\n\n// ── Resolved dates (group aggregation) ───────────────────────────────────────\n\nexport interface ResolvedDates {\n start: Date | null;\n end: Date | null;\n}\n\n/**\n * Resolve every row's effective `{start, end}`. Leaf rows use their own dates. A group\n * (kind `group`, or any row that has children) with a missing bound inherits the min-start /\n * max-end of its descendants. Milestones collapse to a single instant (start, else end).\n */\nexport function resolveRowDates(rows: readonly GanttRow[]): Map<string, ResolvedDates> {\n const byId = new Map<string, GanttRow>();\n for (const r of rows) if (!byId.has(r.id)) byId.set(r.id, r);\n\n const childrenByParent = new Map<string | null, GanttRow[]>();\n for (const r of byId.values()) {\n const pid = effectiveParentId(r, byId);\n const list = childrenByParent.get(pid);\n if (list) list.push(r);\n else childrenByParent.set(pid, [r]);\n }\n\n const cache = new Map<string, ResolvedDates>();\n const resolving = new Set<string>(); // recursion guard (defence-in-depth vs. cycles)\n\n const own = (r: GanttRow): ResolvedDates => {\n if (r.kind === 'milestone') {\n const at = parseIsoDate(r.start) ?? parseIsoDate(r.end);\n return { start: at, end: at };\n }\n return { start: parseIsoDate(r.start), end: parseIsoDate(r.end) };\n };\n\n const resolve = (r: GanttRow): ResolvedDates => {\n const cached = cache.get(r.id);\n if (cached) return cached;\n if (resolving.has(r.id)) return own(r);\n resolving.add(r.id);\n\n const kids = childrenByParent.get(r.id) ?? [];\n const isGroup = r.kind === 'group' || kids.length > 0;\n const self = own(r);\n let result: ResolvedDates = self;\n\n if (isGroup && (self.start === null || self.end === null)) {\n let min: Date | null = self.start;\n let max: Date | null = self.end;\n for (const kid of kids) {\n const kd = resolve(kid);\n if (kd.start && (!min || kd.start < min)) min = kd.start;\n if (kd.end && (!max || kd.end > max)) max = kd.end;\n // A child bar's start can also extend a group's end when the group had no end.\n if (kd.start && (!max || kd.start > max)) max = kd.start;\n if (kd.end && (!min || kd.end < min)) min = kd.end;\n }\n result = { start: min, end: max };\n }\n\n resolving.delete(r.id);\n cache.set(r.id, result);\n return result;\n };\n\n for (const r of byId.values()) resolve(r);\n return cache;\n}\n\n// ── Dependency links ─────────────────────────────────────────────────────────\n\n/** A dependency whose endpoints both currently resolve to a rendered bar rectangle. */\nexport interface GanttResolvedLink {\n fromId: string;\n toId: string;\n}\n\n/**\n * Keep only the dependencies drawable right now: both endpoints must exist in `renderableIds`\n * (visible rows that have a bar rectangle) and must differ. Everything else — self-edges,\n * edges to a missing row, edges into a collapsed subtree — is silently skipped. This is what\n * makes rendering **cycle-safe**: a cyclic set of edges still just draws each edge once; the\n * component never traverses the graph.\n */\nexport function resolveLinks(\n deps: readonly GanttDependency[],\n renderableIds: ReadonlySet<string>,\n): GanttResolvedLink[] {\n const out: GanttResolvedLink[] = [];\n const seen = new Set<string>();\n for (const d of deps) {\n if (!d || d.fromId === d.toId) continue;\n if (!renderableIds.has(d.fromId) || !renderableIds.has(d.toId)) continue;\n const key = `${d.fromId}\u0000${d.toId}`;\n if (seen.has(key)) continue;\n seen.add(key);\n out.push({ fromId: d.fromId, toId: d.toId });\n }\n return out;\n}\n\n// ── RTL coordinate mapping ───────────────────────────────────────────────────\n\n/** Mirror a logical x into render space. LTR is identity; RTL reflects about the canvas width. */\nexport function mapX(logicalX: number, innerWidth: number, rtl: boolean): number {\n return rtl ? innerWidth - logicalX : logicalX;\n}\n\n/**\n * Project a logical `[xStart, xEnd]` span (xEnd ≥ xStart) into a render-space rect. Under RTL\n * the left edge becomes `innerWidth - xEnd`; the width is unchanged. Returns a min-width of 1px\n * so a zero-duration span is still hit-testable.\n */\nexport function projectBar(\n xStart: number,\n xEnd: number,\n innerWidth: number,\n rtl: boolean,\n): { x: number; width: number } {\n const width = Math.max(1, xEnd - xStart);\n const x = rtl ? innerWidth - xStart - width : xStart;\n return { x, width };\n}\n\n// ── Header ticks + weekend bands ─────────────────────────────────────────────\n\n/** A gridline / header cell: logical `x` of its left edge, its pixel `width`, and label. */\nexport interface GanttTick {\n x: number;\n width: number;\n label: string;\n /** Stable key for `@for` tracking. */\n key: string;\n}\n\nconst MONTH_ABBR = [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec',\n];\n\nfunction tickWidth(from: Date, to: Date, pxPerDay: number): number {\n return daysBetween(from, to) * pxPerDay;\n}\n\n/** Lower (fine) header band: one cell per day/week/month/quarter depending on zoom. */\nexport function lowerTicks(domain: GanttDomain, zoom: GanttZoom, pxPerDay: number): GanttTick[] {\n const ticks: GanttTick[] = [];\n const push = (from: Date, to: Date, label: string): void => {\n ticks.push({\n x: dateToX(from, domain.start, pxPerDay),\n width: tickWidth(from, to, pxPerDay),\n label,\n key: toIsoDate(from),\n });\n };\n\n if (zoom === 'day') {\n for (let d = startOfUtcDay(domain.start); d < domain.end; d = addDays(d, 1)) {\n push(d, addDays(d, 1), String(d.getUTCDate()));\n }\n } else if (zoom === 'week') {\n for (let w = startOfUtcWeek(domain.start); w < domain.end; w = addDays(w, 7)) {\n push(w, addDays(w, 7), `${MONTH_ABBR[w.getUTCMonth()]} ${w.getUTCDate()}`);\n }\n } else if (zoom === 'month') {\n for (let m = startOfUtcMonth(domain.start); m < domain.end; ) {\n const next = new Date(Date.UTC(m.getUTCFullYear(), m.getUTCMonth() + 1, 1));\n push(m, next, MONTH_ABBR[m.getUTCMonth()]);\n m = next;\n }\n } else {\n for (let q = startOfUtcQuarter(domain.start); q < domain.end; ) {\n const next = new Date(Date.UTC(q.getUTCFullYear(), q.getUTCMonth() + 3, 1));\n push(q, next, `Q${Math.floor(q.getUTCMonth() / 3) + 1}`);\n q = next;\n }\n }\n return ticks;\n}\n\n/** Upper (coarse) header band: month for day/week, year for month/quarter. */\nexport function upperTicks(domain: GanttDomain, zoom: GanttZoom, pxPerDay: number): GanttTick[] {\n const ticks: GanttTick[] = [];\n const push = (from: Date, to: Date, label: string, key: string): void => {\n const x = dateToX(from, domain.start, pxPerDay);\n ticks.push({ x, width: tickWidth(from, to, pxPerDay), label, key });\n };\n\n if (zoom === 'day' || zoom === 'week') {\n for (let m = startOfUtcMonth(domain.start); m < domain.end; ) {\n const next = new Date(Date.UTC(m.getUTCFullYear(), m.getUTCMonth() + 1, 1));\n push(m, next, `${MONTH_ABBR[m.getUTCMonth()]} ${m.getUTCFullYear()}`, `u-${toIsoDate(m)}`);\n m = next;\n }\n } else {\n for (let y = new Date(Date.UTC(domain.start.getUTCFullYear(), 0, 1)); y < domain.end; ) {\n const next = new Date(Date.UTC(y.getUTCFullYear() + 1, 0, 1));\n push(y, next, String(y.getUTCFullYear()), `u-${toIsoDate(y)}`);\n y = next;\n }\n }\n return ticks;\n}\n\n/** Weekend (Sat/Sun) shading bands in logical space; empty when the zoom hides weekends. */\nexport function weekendBands(domain: GanttDomain, zoom: GanttZoom, pxPerDay: number): GanttTick[] {\n if (!zoomShowsWeekends(zoom)) return [];\n const bands: GanttTick[] = [];\n for (let d = startOfUtcDay(domain.start); d < domain.end; d = addDays(d, 1)) {\n const dow = d.getUTCDay();\n if (dow === 0 || dow === 6) {\n bands.push({\n x: dateToX(d, domain.start, pxPerDay),\n width: pxPerDay,\n label: '',\n key: `we-${toIsoDate(d)}`,\n });\n }\n }\n return bands;\n}\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n computed,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { I18nService } from '../../services/i18n.service';\r\nimport type {\r\n GanttDependency,\r\n GanttDependencyCreate,\r\n GanttRow,\r\n GanttRowDatesChange,\r\n GanttZoom,\r\n} from './gantt.types';\r\nimport {\r\n ZOOM_PX_PER_DAY,\r\n addDays,\r\n computeDomain,\r\n dateToX,\r\n flattenRows,\r\n lowerTicks,\r\n mapX,\r\n projectBar,\r\n pxToDays,\r\n resolveLinks,\r\n resolveRowDates,\r\n startOfUtcDay,\r\n toIsoDate,\r\n upperTicks,\r\n weekendBands,\r\n type GanttFlatRow,\r\n type GanttTick,\r\n} from './gantt-scale';\r\n\r\n/** Process-wide counter so each instance owns a unique arrowhead `<marker>` id. */\r\nlet _flyGanttUid = 0;\r\n\r\n/** Header band heights (two-tier: coarse period over fine period). */\r\nconst HEADER_UPPER_H = 22;\r\nconst HEADER_LOWER_H = 22;\r\nconst HEADER_H = HEADER_UPPER_H + HEADER_LOWER_H;\r\n/** Vertical padding inside a row band → bar height. */\r\nconst BAR_V_PAD = 6;\r\n/** Edge-handle hit width (px) for resize + the link connector radius. */\r\nconst HANDLE_W = 8;\r\n\r\ntype RowShape = 'bar' | 'milestone' | 'group' | 'empty';\r\n\r\n/** One fully-resolved, render-space row ready for the template. */\r\ninterface GanttRowVm {\r\n flat: GanttFlatRow;\r\n index: number;\r\n y: number;\r\n midY: number;\r\n shape: RowShape;\r\n /** Bar / group-bracket rect (render space). */\r\n x: number;\r\n width: number;\r\n progressWidth: number;\r\n /** Milestone diamond centre (render space). */\r\n pointX: number;\r\n /** Render-space finish + start edges, for dependency-link anchoring. */\r\n startX: number;\r\n endX: number;\r\n color: string | null;\r\n ariaLabel: string;\r\n editable: boolean;\r\n}\r\n\r\ninterface LinkVm {\r\n key: string;\r\n path: string;\r\n}\r\n\r\n/**\r\n * **`fly-gantt`** — the design-system SVG Gantt chart.\r\n *\r\n * A reusable, **data-contract-driven** timeline: feed it {@link GanttRow}[] + optional\r\n * {@link GanttDependency}[] and it renders a two-pane chart — an indented, collapsible label\r\n * tree on the inline-start side and a scrolling time grid (header ticks, weekend shading, a\r\n * today line, task bars with progress fill, milestone diamonds and finish-to-start dependency\r\n * arrows) on the other. Pointer drag moves/resizes bars and draws new dependencies; the\r\n * keyboard moves the selection and nudges dates. **It never persists** — every mutation is an\r\n * output event the consumer acts on.\r\n *\r\n * Rendered on plain inline SVG (no third-party charting lib, no CDN asset). All geometry is\r\n * computed in the pure {@link './gantt-scale'} module and mirrored for RTL via {@link mapX}, so\r\n * the timeline flows right-to-left and arrows mirror under `ar`/`ur` with no per-side CSS.\r\n *\r\n * Self-sufficient i18n: every user-visible string comes from the `gantt.*` keys in\r\n * `DS_BASELINE_LOCALES` (en/ar/fr/ur), overridable by any consumer key of the same name.\r\n * Styling uses DS theme tokens (`--surface-card`, `--surface-border`, `--primary-color`, …)\r\n * with light-neutral fallbacks, mirroring the other DS controls.\r\n *\r\n * **Scale limit:** renders up to `maxRows` (default 500) visible rows; beyond that the list is\r\n * capped and a footer notes the overflow. Heavy windowing/virtualization is intentionally\r\n * deferred — see the component skill.\r\n */\r\n@Component({\r\n selector: 'fly-gantt',\r\n standalone: true,\r\n imports: [CommonModule, TranslatePipe],\r\n templateUrl: './gantt.component.html',\r\n styleUrl: './gantt.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'fly-gantt',\r\n '[class.fly-gantt--rtl]': 'rtl()',\r\n '[class.fly-gantt--readonly]': 'readonly()',\r\n '[attr.dir]': 'i18n.direction()',\r\n },\r\n})\r\nexport class FlyGanttComponent {\r\n readonly i18n = inject(I18nService);\r\n private readonly destroyRef = inject(DestroyRef);\r\n\r\n // ── Inputs ─────────────────────────────────────────────────────────────────\r\n readonly rows = input<readonly GanttRow[]>([]);\r\n readonly dependencies = input<readonly GanttDependency[]>([]);\r\n readonly zoom = input<GanttZoom>('week');\r\n /** Draw the vertical \"today\" marker when today falls inside the domain. */\r\n readonly showToday = input(true);\r\n /** Globally disable drag/resize/link (individual rows can also be `readonly`). */\r\n readonly readonly = input(false);\r\n /** Inline-start label-pane width in px. */\r\n readonly labelWidth = input(240);\r\n /** Row band height in px. */\r\n readonly rowHeight = input(34);\r\n /** Hard cap on rendered rows; beyond it the list is truncated (see class doc). */\r\n readonly maxRows = input(500);\r\n\r\n // ── Outputs ────────────────────────────────────────────────────────────────\r\n /** Fires on a committed bar move / resize with the new ISO `start`/`end`. */\r\n readonly rowDatesChange = output<GanttRowDatesChange>();\r\n /** Fires when the user drags a link from one bar's finish connector onto another bar. */\r\n readonly dependencyCreate = output<GanttDependencyCreate>();\r\n readonly rowClick = output<string>();\r\n readonly rowDblClick = output<string>();\r\n\r\n // ── Identity + geometry constants (template-visible) ─────────────────────────\r\n private readonly _uid = ++_flyGanttUid;\r\n readonly markerId = `fly-gantt-${this._uid}-arrow`;\r\n readonly HEADER_H = HEADER_H;\r\n readonly HEADER_UPPER_H = HEADER_UPPER_H;\r\n readonly HEADER_LOWER_H = HEADER_LOWER_H;\r\n readonly HANDLE_W = HANDLE_W;\r\n\r\n // ── Interaction state ─────────────────────────────────────────────────────────\r\n readonly selectedId = signal<string | null>(null);\r\n private readonly _collapsed = signal<ReadonlySet<string>>(new Set());\r\n /** Live drag preview `{id,start,end}` folded into geometry while a gesture runs. */\r\n private readonly _dragPreview = signal<{ id: string; start: Date; end: Date } | null>(null);\r\n /** Rubber-band link gesture render-space anchor + cursor, and its origin row. */\r\n readonly linkGesture = signal<{ fromId: string; x0: number; y0: number; x1: number; y1: number } | null>(null);\r\n readonly dragTooltip = signal<{ x: number; y: number; text: string } | null>(null);\r\n\r\n private readonly bodyRef = viewChild<ElementRef<SVGSVGElement>>('bodySvg');\r\n\r\n // ── Derived model ──────────────────────────────────────────────────────────────\r\n readonly rtl = computed(() => this.i18n.isRtl());\r\n readonly pxPerDay = computed(() => ZOOM_PX_PER_DAY[this.zoom()]);\r\n readonly domain = computed(() => computeDomain(this.rows(), this.zoom()));\r\n readonly innerWidth = computed(() =>\r\n Math.max(1, dateToX(this.domain().end, this.domain().start, this.pxPerDay())),\r\n );\r\n\r\n /** Full visible list after tree flatten/collapse. */\r\n private readonly _flat = computed<GanttFlatRow[]>(() => flattenRows(this.rows(), this._collapsed()));\r\n /** Capped list actually rendered. */\r\n readonly visibleRows = computed<GanttFlatRow[]>(() => this._flat().slice(0, this.maxRows()));\r\n readonly overflowCount = computed(() => Math.max(0, this._flat().length - this.maxRows()));\r\n readonly bodyHeight = computed(() => Math.max(this.rowHeight(), this.visibleRows().length * this.rowHeight()));\r\n\r\n private readonly _resolvedDates = computed(() => resolveRowDates(this.rows()));\r\n\r\n readonly weekendBands = computed<GanttTick[]>(() =>\r\n this._mapTicks(weekendBands(this.domain(), this.zoom(), this.pxPerDay())),\r\n );\r\n readonly lowerTicks = computed<GanttTick[]>(() =>\r\n this._mapTicks(lowerTicks(this.domain(), this.zoom(), this.pxPerDay())),\r\n );\r\n readonly upperTicks = computed<GanttTick[]>(() =>\r\n this._mapTicks(upperTicks(this.domain(), this.zoom(), this.pxPerDay())),\r\n );\r\n\r\n /** Render-space today x, or `null` when today is outside the domain (or disabled). */\r\n readonly todayX = computed<number | null>(() => {\r\n if (!this.showToday()) return null;\r\n const dom = this.domain();\r\n const today = startOfUtcDay(new Date());\r\n if (today < dom.start || today >= dom.end) return null;\r\n const logical = dateToX(addDays(today, 0.5), dom.start, this.pxPerDay());\r\n return mapX(logical, this.innerWidth(), this.rtl());\r\n });\r\n\r\n readonly rowVms = computed<GanttRowVm[]>(() => {\r\n const dom = this.domain();\r\n const ppd = this.pxPerDay();\r\n const w = this.innerWidth();\r\n const rtl = this.rtl();\r\n const rh = this.rowHeight();\r\n const resolved = this._resolvedDates();\r\n const preview = this._dragPreview();\r\n const globalReadonly = this.readonly();\r\n\r\n return this.visibleRows().map((flat, index) => {\r\n const row = flat.row;\r\n const y = index * rh;\r\n const midY = y + rh / 2;\r\n const isGroup = flat.hasChildren || row.kind === 'group';\r\n const isMilestone = row.kind === 'milestone';\r\n\r\n // Resolve dates, letting an in-flight drag preview win for this row.\r\n let start = resolved.get(row.id)?.start ?? null;\r\n let end = resolved.get(row.id)?.end ?? null;\r\n if (preview && preview.id === row.id) {\r\n start = preview.start;\r\n end = preview.end;\r\n }\r\n\r\n const editable = !globalReadonly && !row.readonly && !isGroup;\r\n const color = row.color ?? null;\r\n\r\n if (isMilestone) {\r\n const at = start ?? end;\r\n const logical = at ? dateToX(at, dom.start, ppd) : 0;\r\n const pointX = mapX(logical, w, rtl);\r\n return {\r\n flat, index, y, midY, shape: at ? 'milestone' : 'empty',\r\n x: pointX, width: 0, progressWidth: 0, pointX,\r\n startX: pointX, endX: pointX, color,\r\n ariaLabel: this._ariaFor(row, start, end, 'milestone'),\r\n editable: editable && !!at,\r\n } satisfies GanttRowVm;\r\n }\r\n\r\n if (!start || !end) {\r\n return {\r\n flat, index, y, midY, shape: 'empty',\r\n x: 0, width: 0, progressWidth: 0, pointX: 0, startX: 0, endX: 0, color,\r\n ariaLabel: this._ariaFor(row, start, end, isGroup ? 'group' : 'bar'),\r\n editable: false,\r\n } satisfies GanttRowVm;\r\n }\r\n\r\n const xs = dateToX(start, dom.start, ppd);\r\n // Bars are inclusive of the end day, so extend one day for a visible width.\r\n const xe = dateToX(addDays(end, 1), dom.start, ppd);\r\n const { x, width } = projectBar(xs, xe, w, rtl);\r\n const progress = Math.max(0, Math.min(100, row.progress ?? 0));\r\n return {\r\n flat, index, y, midY,\r\n shape: isGroup ? 'group' : 'bar',\r\n x, width,\r\n progressWidth: (width * progress) / 100,\r\n pointX: 0,\r\n startX: mapX(xs, w, rtl),\r\n endX: mapX(xe, w, rtl),\r\n color,\r\n ariaLabel: this._ariaFor(row, start, end, isGroup ? 'group' : 'bar'),\r\n editable: isGroup ? false : editable,\r\n } satisfies GanttRowVm;\r\n });\r\n });\r\n\r\n /** Dependency arrows between currently-rendered rows (missing/collapsed endpoints skipped). */\r\n readonly linkVms = computed<LinkVm[]>(() => {\r\n const vmById = new Map<string, GanttRowVm>();\r\n for (const vm of this.rowVms()) if (vm.shape !== 'empty') vmById.set(vm.flat.row.id, vm);\r\n const links = resolveLinks(this.dependencies(), new Set(vmById.keys()));\r\n const rtl = this.rtl();\r\n const out: LinkVm[] = [];\r\n for (const link of links) {\r\n const from = vmById.get(link.fromId);\r\n const to = vmById.get(link.toId);\r\n if (!from || !to) continue;\r\n out.push({ key: `${link.fromId}~${link.toId}`, path: this._elbow(from, to, rtl) });\r\n }\r\n return out;\r\n });\r\n\r\n // ── Template geometry helpers ─────────────────────────────────────────────────\r\n readonly barHeight = computed(() => Math.max(8, this.rowHeight() - 2 * BAR_V_PAD));\r\n barTop(vm: GanttRowVm): number {\r\n return vm.y + BAR_V_PAD;\r\n }\r\n private milestoneR(): number {\r\n return Math.min(9, this.barHeight() / 2);\r\n }\r\n /** Diamond polygon points for a milestone marker. */\r\n diamondPoints(vm: GanttRowVm): string {\r\n const r = this.milestoneR();\r\n const { pointX: cx, midY: cy } = vm;\r\n return `${cx},${cy - r} ${cx + r},${cy} ${cx},${cy + r} ${cx - r},${cy}`;\r\n }\r\n /** Summary-bracket path (thin bar + down-turned end caps) for a group row. */\r\n groupPath(vm: GanttRowVm): string {\r\n const top = this.barTop(vm);\r\n const h = Math.min(6, this.barHeight());\r\n const cap = h + 4;\r\n const x1 = vm.x;\r\n const x2 = vm.x + vm.width;\r\n return (\r\n `M ${x1} ${top} H ${x2} V ${top + h} H ${x1} Z ` +\r\n `M ${x1} ${top} L ${x1} ${top + cap} L ${x1 + 6} ${top + h} Z ` +\r\n `M ${x2} ${top} L ${x2} ${top + cap} L ${x2 - 6} ${top + h} Z`\r\n );\r\n }\r\n /** Inline-start label indent for a tree depth. */\r\n indentFor(depth: number): number {\r\n return 8 + depth * 16;\r\n }\r\n\r\n // ── Group collapse ─────────────────────────────────────────────────────────────\r\n isCollapsed(id: string): boolean {\r\n return this._collapsed().has(id);\r\n }\r\n\r\n toggleCollapse(id: string, ev?: Event): void {\r\n ev?.stopPropagation();\r\n const next = new Set(this._collapsed());\r\n if (next.has(id)) next.delete(id);\r\n else next.add(id);\r\n this._collapsed.set(next);\r\n }\r\n\r\n /**\r\n * Enter/Space on a focused label row selects it (mirrors the pointer click).\r\n * Typed `Event` (not `KeyboardEvent`) because Angular's strict template checker\r\n * types the `(keydown.enter)` pseudo-event `$event` as `Event`; only\r\n * `preventDefault`/`stopPropagation` are used, both of which live on `Event`.\r\n */\r\n onLabelRowKeydown(ev: Event, id: string): void {\r\n ev.preventDefault();\r\n ev.stopPropagation(); // don't also drive the grid-level Enter handler\r\n this.onRowClick(id);\r\n }\r\n\r\n // ── Row activation ─────────────────────────────────────────────────────────────\r\n onRowClick(id: string): void {\r\n this.selectedId.set(id);\r\n this.rowClick.emit(id);\r\n }\r\n\r\n onRowDblClick(id: string): void {\r\n this.rowDblClick.emit(id);\r\n }\r\n\r\n // ── Keyboard ───────────────────────────────────────────────────────────────────\r\n onGridKeydown(ev: KeyboardEvent): void {\r\n const list = this.visibleRows();\r\n if (list.length === 0) return;\r\n // -1 when nothing is selected yet, so the first ArrowDown lands on row 0 (not row 1).\r\n const curIdx = list.findIndex((r) => r.row.id === this.selectedId());\r\n\r\n switch (ev.key) {\r\n case 'ArrowDown': {\r\n ev.preventDefault();\r\n const i = curIdx < 0 ? 0 : Math.min(list.length - 1, curIdx + 1);\r\n this.selectedId.set(list[i].row.id);\r\n return;\r\n }\r\n case 'ArrowUp': {\r\n ev.preventDefault();\r\n const i = curIdx < 0 ? 0 : Math.max(0, curIdx - 1);\r\n this.selectedId.set(list[i].row.id);\r\n return;\r\n }\r\n case '+':\r\n case '=': // unshifted \"+\" key\r\n ev.preventDefault();\r\n this._nudgeSelected(1);\r\n return;\r\n case '-':\r\n case '_':\r\n ev.preventDefault();\r\n this._nudgeSelected(-1);\r\n return;\r\n case 'Enter':\r\n ev.preventDefault();\r\n if (this.selectedId()) this.rowClick.emit(this.selectedId() as string);\r\n return;\r\n default:\r\n return;\r\n }\r\n }\r\n\r\n /** Shift both dates of the selected bar by `deltaDays` and emit (respecting read-only). */\r\n private _nudgeSelected(deltaDays: number): void {\r\n const id = this.selectedId();\r\n if (!id) return;\r\n const vm = this.rowVms().find((v) => v.flat.row.id === id);\r\n if (!vm || !vm.editable) return;\r\n const dates = this._resolvedDates().get(id);\r\n if (!dates?.start || !dates?.end) return;\r\n if (vm.shape === 'milestone') {\r\n const at = addDays(dates.start, deltaDays);\r\n this.rowDatesChange.emit({ id, start: toIsoDate(at), end: toIsoDate(at) });\r\n return;\r\n }\r\n this.rowDatesChange.emit({\r\n id,\r\n start: toIsoDate(addDays(dates.start, deltaDays)),\r\n end: toIsoDate(addDays(dates.end, deltaDays)),\r\n });\r\n }\r\n\r\n // ── Pointer drag: move / resize ──────────────────────────────────────────────────\r\n onBarPointerDown(ev: PointerEvent, vm: GanttRowVm, mode: 'move' | 'resize-start' | 'resize-end'): void {\r\n if (!vm.editable || ev.button !== 0) return;\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n this.selectedId.set(vm.flat.row.id);\r\n const dates = this._resolvedDates().get(vm.flat.row.id);\r\n if (!dates?.start || !dates?.end) return;\r\n\r\n const origStart = dates.start;\r\n const origEnd = dates.end;\r\n const startClientX = ev.clientX;\r\n const dirSign = this.rtl() ? -1 : 1; // dragging forward in time is +x LTR, -x RTL\r\n\r\n const onMove = (e: PointerEvent): void => {\r\n const deltaDays = pxToDays((e.clientX - startClientX) * dirSign, this.pxPerDay());\r\n let ns = origStart;\r\n let ne = origEnd;\r\n if (mode === 'move') {\r\n ns = addDays(origStart, deltaDays);\r\n ne = addDays(origEnd, deltaDays);\r\n } else if (mode === 'resize-start') {\r\n ns = addDays(origStart, deltaDays);\r\n if (ns > ne) ns = ne; // never cross the end\r\n } else {\r\n ne = addDays(origEnd, deltaDays);\r\n if (ne < ns) ne = ns;\r\n }\r\n this._dragPreview.set({ id: vm.flat.row.id, start: ns, end: ne });\r\n this.dragTooltip.set({\r\n x: e.clientX,\r\n y: e.clientY,\r\n text: `${toIsoDate(ns)} → ${toIsoDate(ne)}`,\r\n });\r\n };\r\n\r\n const onUp = (): void => {\r\n document.removeEventListener('pointermove', onMove);\r\n document.removeEventListener('pointerup', onUp);\r\n const preview = this._dragPreview();\r\n this._dragPreview.set(null);\r\n this.dragTooltip.set(null);\r\n if (preview && (toIsoDate(preview.start) !== toIsoDate(origStart) || toIsoDate(preview.end) !== toIsoDate(origEnd))) {\r\n this.rowDatesChange.emit({\r\n id: vm.flat.row.id,\r\n start: toIsoDate(preview.start),\r\n end: toIsoDate(preview.end),\r\n });\r\n }\r\n };\r\n\r\n document.addEventListener('pointermove', onMove);\r\n document.addEventListener('pointerup', onUp);\r\n this.destroyRef.onDestroy(() => {\r\n document.removeEventListener('pointermove', onMove);\r\n document.removeEventListener('pointerup', onUp);\r\n });\r\n }\r\n\r\n // ── Pointer drag: dependency create ──────────────────────────────────────────────\r\n onLinkPointerDown(ev: PointerEvent, vm: GanttRowVm): void {\r\n if (this.readonly() || vm.flat.row.readonly || ev.button !== 0) return;\r\n ev.preventDefault();\r\n ev.stopPropagation();\r\n const local = this._toBodyPoint(ev);\r\n this.linkGesture.set({ fromId: vm.flat.row.id, x0: vm.endX, y0: vm.midY, x1: local.x, y1: local.y });\r\n\r\n const onMove = (e: PointerEvent): void => {\r\n const p = this._toBodyPoint(e);\r\n const g = this.linkGesture();\r\n if (g) this.linkGesture.set({ ...g, x1: p.x, y1: p.y });\r\n };\r\n const onUp = (e: PointerEvent): void => {\r\n document.removeEventListener('pointermove', onMove);\r\n document.removeEventListener('pointerup', onUp);\r\n const g = this.linkGesture();\r\n this.linkGesture.set(null);\r\n if (!g) return;\r\n const targetId = this._rowIdAtPoint(e.clientX, e.clientY);\r\n if (targetId && targetId !== g.fromId) {\r\n this.dependencyCreate.emit({ fromId: g.fromId, toId: targetId });\r\n }\r\n };\r\n document.addEventListener('pointermove', onMove);\r\n document.addEventListener('pointerup', onUp);\r\n this.destroyRef.onDestroy(() => {\r\n document.removeEventListener('pointermove', onMove);\r\n document.removeEventListener('pointerup', onUp);\r\n });\r\n }\r\n\r\n /** Rubber-band path for an in-flight link gesture (render space). */\r\n readonly linkGesturePath = computed<string | null>(() => {\r\n const g = this.linkGesture();\r\n if (!g) return null;\r\n return `M ${g.x0} ${g.y0} L ${g.x1} ${g.y1}`;\r\n });\r\n\r\n // ── Internals ────────────────────────────────────────────────────────────────────\r\n private _mapTicks(ticks: GanttTick[]): GanttTick[] {\r\n const w = this.innerWidth();\r\n const rtl = this.rtl();\r\n if (!rtl) return ticks;\r\n // Reflect each cell: its inline-start edge becomes innerWidth - (x + width).\r\n return ticks.map((t) => ({ ...t, x: w - t.x - t.width }));\r\n }\r\n\r\n /** Elbow path from a predecessor's finish edge to a successor's start edge (render space). */\r\n private _elbow(from: GanttRowVm, to: GanttRowVm, rtl: boolean): string {\r\n const fwd = rtl ? -1 : 1;\r\n const stub = 12 * fwd;\r\n const x1 = from.shape === 'milestone' ? from.pointX : from.endX;\r\n const y1 = from.midY;\r\n const x2 = to.shape === 'milestone' ? to.pointX : to.startX;\r\n const y2 = to.midY;\r\n // finish → stub out → vertical to target row → into the start edge (arrowhead via marker).\r\n return `M ${x1} ${y1} H ${x1 + stub} V ${y2} H ${x2}`;\r\n }\r\n\r\n /** Convert a pointer event to a coordinate inside the body SVG (render space). */\r\n private _toBodyPoint(ev: PointerEvent): { x: number; y: number } {\r\n const svg = this.bodyRef()?.nativeElement;\r\n if (!svg) return { x: 0, y: 0 };\r\n const rect = svg.getBoundingClientRect();\r\n return { x: ev.clientX - rect.left, y: ev.clientY - rect.top };\r\n }\r\n\r\n /** The row id under a viewport point (for link drop-targeting), via the bar's `data-row-id`. */\r\n private _rowIdAtPoint(clientX: number, clientY: number): string | null {\r\n const el = document.elementFromPoint(clientX, clientY) as Element | null;\r\n const holder = el?.closest('[data-row-id]') as HTMLElement | SVGElement | null;\r\n return holder?.getAttribute('data-row-id') ?? null;\r\n }\r\n\r\n private _ariaFor(row: GanttRow, start: Date | null, end: Date | null, shape: RowShape): string {\r\n const t = (k: string, p?: Record<string, string | number>): string => this.i18n.t(k, p);\r\n if (shape === 'milestone') {\r\n const at = start ?? end;\r\n return at\r\n ? t('gantt.aria.milestone', { label: row.label, date: toIsoDate(at) })\r\n : t('gantt.aria.unscheduled', { label: row.label });\r\n }\r\n if (!start || !end) return t('gantt.aria.unscheduled', { label: row.label });\r\n if (shape === 'group') {\r\n return t('gantt.aria.group', { label: row.label, start: toIsoDate(start), end: toIsoDate(end) });\r\n }\r\n const progress = Math.max(0, Math.min(100, row.progress ?? 0));\r\n return row.progress === undefined\r\n ? t('gantt.aria.bar_plain', { label: row.label, start: toIsoDate(start), end: toIsoDate(end) })\r\n : t('gantt.aria.bar', { label: row.label, start: toIsoDate(start), end: toIsoDate(end), progress });\r\n }\r\n}\r\n","<!-- Cross-scrolling canvas: a CSS grid whose header row and label column are sticky, so the\r\n time grid scrolls under a pinned header + label tree. All SVG geometry is pre-mirrored for\r\n RTL in the component (see gantt-scale mapX), so this template never branches on direction. -->\r\n<div\r\n class=\"fly-gantt__scroll\"\r\n role=\"grid\"\r\n tabindex=\"0\"\r\n [attr.aria-label]=\"'gantt.aria.grid' | translate\"\r\n [attr.aria-rowcount]=\"visibleRows().length\"\r\n (keydown)=\"onGridKeydown($event)\"\r\n>\r\n <div\r\n class=\"fly-gantt__canvas\"\r\n [style.grid-template-columns]=\"labelWidth() + 'px ' + innerWidth() + 'px'\"\r\n [style.grid-template-rows]=\"HEADER_H + 'px ' + bodyHeight() + 'px'\"\r\n >\r\n <!-- ── Corner (pinned both axes) ─────────────────────────────────────────── -->\r\n <div class=\"fly-gantt__corner\" [style.height.px]=\"HEADER_H\"></div>\r\n\r\n <!-- ── Time header (pinned top) ──────────────────────────────────────────── -->\r\n <svg\r\n class=\"fly-gantt__time-header\"\r\n [attr.width]=\"innerWidth()\"\r\n [attr.height]=\"HEADER_H\"\r\n [attr.viewBox]=\"'0 0 ' + innerWidth() + ' ' + HEADER_H\"\r\n aria-hidden=\"true\"\r\n >\r\n @for (b of weekendBands(); track b.key) {\r\n <rect class=\"fly-gantt__weekend\" [attr.x]=\"b.x\" [attr.y]=\"HEADER_UPPER_H\" [attr.width]=\"b.width\" [attr.height]=\"HEADER_LOWER_H\" />\r\n }\r\n @for (t of upperTicks(); track t.key) {\r\n <line class=\"fly-gantt__tick-line\" [attr.x1]=\"t.x\" [attr.y1]=\"0\" [attr.x2]=\"t.x\" [attr.y2]=\"HEADER_H\" />\r\n <text class=\"fly-gantt__tick-label fly-gantt__tick-label--upper\" [attr.x]=\"t.x + t.width / 2\" [attr.y]=\"HEADER_UPPER_H / 2 + 4\">{{ t.label }}</text>\r\n }\r\n @for (t of lowerTicks(); track t.key) {\r\n <line class=\"fly-gantt__tick-line\" [attr.x1]=\"t.x\" [attr.y1]=\"HEADER_UPPER_H\" [attr.x2]=\"t.x\" [attr.y2]=\"HEADER_H\" />\r\n <text class=\"fly-gantt__tick-label\" [attr.x]=\"t.x + t.width / 2\" [attr.y]=\"HEADER_UPPER_H + HEADER_LOWER_H / 2 + 4\">{{ t.label }}</text>\r\n }\r\n @if (todayX() !== null) {\r\n <line class=\"fly-gantt__today\" [attr.x1]=\"todayX()\" [attr.y1]=\"HEADER_UPPER_H\" [attr.x2]=\"todayX()\" [attr.y2]=\"HEADER_H\" />\r\n }\r\n </svg>\r\n\r\n <!-- ── Label tree (pinned inline-start) ──────────────────────────────────── -->\r\n <div class=\"fly-gantt__labels\" role=\"rowgroup\">\r\n @for (vm of rowVms(); track vm.flat.row.id) {\r\n <div\r\n class=\"fly-gantt__label-row\"\r\n role=\"row\"\r\n tabindex=\"-1\"\r\n [class.fly-gantt__label-row--selected]=\"selectedId() === vm.flat.row.id\"\r\n [style.height.px]=\"rowHeight()\"\r\n [attr.aria-selected]=\"selectedId() === vm.flat.row.id\"\r\n [attr.aria-label]=\"vm.ariaLabel\"\r\n (click)=\"onRowClick(vm.flat.row.id)\"\r\n (dblclick)=\"onRowDblClick(vm.flat.row.id)\"\r\n (keydown.enter)=\"onLabelRowKeydown($event, vm.flat.row.id)\"\r\n >\r\n <span class=\"fly-gantt__label-inner\" [style.padding-inline-start.px]=\"indentFor(vm.flat.depth)\">\r\n @if (vm.flat.hasChildren) {\r\n <button\r\n type=\"button\"\r\n class=\"fly-gantt__chevron\"\r\n [class.fly-gantt__chevron--collapsed]=\"isCollapsed(vm.flat.row.id)\"\r\n [attr.aria-label]=\"(isCollapsed(vm.flat.row.id) ? 'gantt.expand' : 'gantt.collapse') | translate\"\r\n [attr.aria-expanded]=\"!isCollapsed(vm.flat.row.id)\"\r\n (click)=\"toggleCollapse(vm.flat.row.id, $event)\"\r\n >▸</button>\r\n } @else {\r\n <span class=\"fly-gantt__chevron-spacer\"></span>\r\n }\r\n <span\r\n class=\"fly-gantt__label-text\"\r\n [class.fly-gantt__label-text--group]=\"vm.shape === 'group'\"\r\n [title]=\"vm.flat.row.label\"\r\n >{{ vm.flat.row.label }}</span>\r\n </span>\r\n </div>\r\n }\r\n </div>\r\n\r\n <!-- ── Time grid body ────────────────────────────────────────────────────── -->\r\n <svg\r\n #bodySvg\r\n class=\"fly-gantt__body\"\r\n [attr.width]=\"innerWidth()\"\r\n [attr.height]=\"bodyHeight()\"\r\n [attr.viewBox]=\"'0 0 ' + innerWidth() + ' ' + bodyHeight()\"\r\n >\r\n <defs>\r\n <marker\r\n [attr.id]=\"markerId\"\r\n markerWidth=\"8\"\r\n markerHeight=\"8\"\r\n refX=\"6\"\r\n refY=\"4\"\r\n orient=\"auto\"\r\n markerUnits=\"userSpaceOnUse\"\r\n >\r\n <path class=\"fly-gantt__arrowhead\" d=\"M0,0 L7,4 L0,8 Z\" />\r\n </marker>\r\n </defs>\r\n\r\n <!-- Weekend shading + vertical gridlines (behind everything). -->\r\n @for (b of weekendBands(); track b.key) {\r\n <rect class=\"fly-gantt__weekend\" [attr.x]=\"b.x\" [attr.y]=\"0\" [attr.width]=\"b.width\" [attr.height]=\"bodyHeight()\" />\r\n }\r\n @for (t of lowerTicks(); track t.key) {\r\n <line class=\"fly-gantt__grid-line\" [attr.x1]=\"t.x\" [attr.y1]=\"0\" [attr.x2]=\"t.x\" [attr.y2]=\"bodyHeight()\" />\r\n }\r\n\r\n <!-- Rows: a full-width hit rect (click + link drop target) then the shape. -->\r\n @for (vm of rowVms(); track vm.flat.row.id) {\r\n <g class=\"fly-gantt__row\" [attr.data-row-id]=\"vm.flat.row.id\">\r\n <rect\r\n class=\"fly-gantt__row-hit\"\r\n [class.fly-gantt__row-hit--selected]=\"selectedId() === vm.flat.row.id\"\r\n [attr.x]=\"0\"\r\n [attr.y]=\"vm.y\"\r\n [attr.width]=\"innerWidth()\"\r\n [attr.height]=\"rowHeight()\"\r\n (pointerdown)=\"onRowClick(vm.flat.row.id)\"\r\n (dblclick)=\"onRowDblClick(vm.flat.row.id)\"\r\n />\r\n\r\n @switch (vm.shape) {\r\n @case ('group') {\r\n <path class=\"fly-gantt__group\" [attr.d]=\"groupPath(vm)\" [style.fill]=\"vm.color\" [style.stroke]=\"vm.color\" />\r\n }\r\n @case ('milestone') {\r\n <polygon\r\n class=\"fly-gantt__milestone\"\r\n [class.fly-gantt__milestone--editable]=\"vm.editable\"\r\n [attr.points]=\"diamondPoints(vm)\"\r\n [style.fill]=\"vm.color\"\r\n (pointerdown)=\"onBarPointerDown($event, vm, 'move')\"\r\n />\r\n }\r\n @case ('bar') {\r\n <g class=\"fly-gantt__bar-group\">\r\n <rect\r\n class=\"fly-gantt__bar\"\r\n [class.fly-gantt__bar--editable]=\"vm.editable\"\r\n [attr.x]=\"vm.x\"\r\n [attr.y]=\"barTop(vm)\"\r\n [attr.width]=\"vm.width\"\r\n [attr.height]=\"barHeight()\"\r\n rx=\"4\"\r\n [style.fill]=\"vm.color\"\r\n (pointerdown)=\"onBarPointerDown($event, vm, 'move')\"\r\n />\r\n @if (vm.progressWidth > 0) {\r\n <rect\r\n class=\"fly-gantt__progress\"\r\n [attr.x]=\"vm.x\"\r\n [attr.y]=\"barTop(vm)\"\r\n [attr.width]=\"vm.progressWidth\"\r\n [attr.height]=\"barHeight()\"\r\n rx=\"4\"\r\n />\r\n }\r\n @if (vm.editable) {\r\n <!-- Resize handles at both edges. -->\r\n <rect\r\n class=\"fly-gantt__handle\"\r\n [attr.x]=\"vm.x\"\r\n [attr.y]=\"barTop(vm)\"\r\n [attr.width]=\"HANDLE_W\"\r\n [attr.height]=\"barHeight()\"\r\n [attr.aria-label]=\"'gantt.aria.resize_start' | translate\"\r\n (pointerdown)=\"onBarPointerDown($event, vm, 'resize-start')\"\r\n />\r\n <rect\r\n class=\"fly-gantt__handle\"\r\n [attr.x]=\"vm.x + vm.width - HANDLE_W\"\r\n [attr.y]=\"barTop(vm)\"\r\n [attr.width]=\"HANDLE_W\"\r\n [attr.height]=\"barHeight()\"\r\n [attr.aria-label]=\"'gantt.aria.resize_end' | translate\"\r\n (pointerdown)=\"onBarPointerDown($event, vm, 'resize-end')\"\r\n />\r\n }\r\n @if (!readonly() && !vm.flat.row.readonly) {\r\n <!-- Finish connector: drag to draw a dependency to another row. -->\r\n <circle\r\n class=\"fly-gantt__connector\"\r\n [attr.cx]=\"vm.endX\"\r\n [attr.cy]=\"vm.midY\"\r\n r=\"4\"\r\n [attr.aria-label]=\"'gantt.aria.link_handle' | translate: { label: vm.flat.row.label }\"\r\n (pointerdown)=\"onLinkPointerDown($event, vm)\"\r\n />\r\n }\r\n </g>\r\n }\r\n }\r\n </g>\r\n }\r\n\r\n <!-- Dependency arrows (skipped for missing / collapsed endpoints). -->\r\n @for (link of linkVms(); track link.key) {\r\n <path class=\"fly-gantt__link\" [attr.d]=\"link.path\" [attr.marker-end]=\"'url(#' + markerId + ')'\" />\r\n }\r\n\r\n <!-- In-flight link rubber band. -->\r\n @if (linkGesturePath(); as gp) {\r\n <path class=\"fly-gantt__link fly-gantt__link--ghost\" [attr.d]=\"gp\" [attr.marker-end]=\"'url(#' + markerId + ')'\" />\r\n }\r\n\r\n <!-- Today line (over the bars). -->\r\n @if (todayX() !== null) {\r\n <line class=\"fly-gantt__today\" [attr.x1]=\"todayX()\" [attr.y1]=\"0\" [attr.x2]=\"todayX()\" [attr.y2]=\"bodyHeight()\" />\r\n }\r\n </svg>\r\n </div>\r\n\r\n @if (visibleRows().length === 0) {\r\n <p class=\"fly-gantt__empty\">{{ 'gantt.no_data' | translate }}</p>\r\n }\r\n @if (overflowCount() > 0) {\r\n <p class=\"fly-gantt__overflow\">\r\n {{ 'gantt.overflow' | translate: { shown: maxRows(), total: maxRows() + overflowCount() } }}\r\n </p>\r\n }\r\n</div>\r\n\r\n<!-- Drag candidate tooltip (HTML overlay, follows the cursor). -->\r\n@if (dragTooltip(); as tip) {\r\n <div class=\"fly-gantt__tooltip\" [style.left.px]=\"tip.x\" [style.top.px]=\"tip.y\">{{ tip.text }}</div>\r\n}\r\n","/**\r\n * Public data contract for {@link FlyGanttComponent}.\r\n *\r\n * The types here are deliberately **app-agnostic** — no Projects/Tasks vocabulary leaks in.\r\n * A consumer maps its own domain rows to {@link GanttRow}[] + {@link GanttDependency}[],\r\n * feeds them in, and reacts to the emitted change events by persisting itself. The Gantt\r\n * never calls a backend and never mutates its inputs.\r\n */\r\n\r\n/** Time-grid resolution. Widens the day → quarter as the pixels-per-day shrink. */\r\nexport type GanttZoom = 'day' | 'week' | 'month' | 'quarter';\r\n\r\n/** Immutable list of the supported zoom levels, coarsest-last. */\r\nexport const GANTT_ZOOMS: readonly GanttZoom[] = ['day', 'week', 'month', 'quarter'] as const;\r\n\r\n/**\r\n * How a row renders on the chart.\r\n * - `bar` (default) — a scheduled task bar with an optional progress fill.\r\n * - `milestone` — a zero-duration diamond marker placed at `start` (falls back to `end`).\r\n * - `group` — a summary/parent row rendered as a thin bracket; collapsible. When its own\r\n * `start`/`end` are null the span is derived from its descendants.\r\n */\r\nexport type GanttRowKind = 'group' | 'bar' | 'milestone';\r\n\r\n/** One row of the chart. `id` must be unique within the input set. */\r\nexport interface GanttRow {\r\n id: string;\r\n label: string;\r\n /** ISO date (`YYYY-MM-DD` or a full ISO timestamp). `null` = unscheduled. */\r\n start: string | null;\r\n /** ISO date. `null` = unscheduled (or open-ended). */\r\n end: string | null;\r\n /** Completion percentage `0..100`; drives the bar fill. Ignored for milestones. */\r\n progress?: number;\r\n /** Render shape. Defaults to `bar` (or `group` when the row has children). */\r\n kind?: GanttRowKind;\r\n /** Parent row id for tree nesting. Unknown/self/cyclic parents are treated as roots. */\r\n parentId?: string | null;\r\n /** Optional CSS color (token or literal) for the bar / diamond. */\r\n color?: string;\r\n /** When true this row cannot be dragged/resized/linked even if the chart is editable. */\r\n readonly?: boolean;\r\n}\r\n\r\n/** A finish-to-start (v1) dependency edge from one row to another. */\r\nexport interface GanttDependency {\r\n fromId: string;\r\n toId: string;\r\n /** Only `FS` (finish-to-start) is modelled today; reserved for future SS/FF/SF. */\r\n type?: 'FS';\r\n}\r\n\r\n/** Payload of {@link FlyGanttComponent.rowDatesChange}. Dates are ISO `YYYY-MM-DD`. */\r\nexport interface GanttRowDatesChange {\r\n id: string;\r\n start: string;\r\n end: string;\r\n}\r\n\r\n/** Payload of {@link FlyGanttComponent.dependencyCreate}. */\r\nexport interface GanttDependencyCreate {\r\n fromId: string;\r\n toId: string;\r\n}\r\n","// ── Bundled ISO 3166-1 country list ──────────────────────────────────────────\r\n// Ships with <fly-survey-form> so a `Country` question renders a searchable\r\n// picker with ZERO network fetch and no external dependency. English display\r\n// names; codes are ISO 3166-1 alpha-2. A host that needs localized country names\r\n// can override the labels by supplying its own options — but the default keeps\r\n// the control self-sufficient (RAD: no integrator boilerplate to render a\r\n// country field).\r\n\r\nexport interface FlyCountry {\r\n /** ISO 3166-1 alpha-2 code (uppercase), e.g. `AE`. */\r\n code: string;\r\n /** English display name. */\r\n name: string;\r\n}\r\n\r\n/** Frozen alpha-2 list, alphabetical by English name. */\r\nexport const FLY_COUNTRIES: readonly FlyCountry[] = Object.freeze([\r\n { code: 'AF', name: 'Afghanistan' },\r\n { code: 'AX', name: 'Åland Islands' },\r\n { code: 'AL', name: 'Albania' },\r\n { code: 'DZ', name: 'Algeria' },\r\n { code: 'AS', name: 'American Samoa' },\r\n { code: 'AD', name: 'Andorra' },\r\n { code: 'AO', name: 'Angola' },\r\n { code: 'AI', name: 'Anguilla' },\r\n { code: 'AQ', name: 'Antarctica' },\r\n { code: 'AG', name: 'Antigua and Barbuda' },\r\n { code: 'AR', name: 'Argentina' },\r\n { code: 'AM', name: 'Armenia' },\r\n { code: 'AW', name: 'Aruba' },\r\n { code: 'AU', name: 'Australia' },\r\n { code: 'AT', name: 'Austria' },\r\n { code: 'AZ', name: 'Azerbaijan' },\r\n { code: 'BS', name: 'Bahamas' },\r\n { code: 'BH', name: 'Bahrain' },\r\n { code: 'BD', name: 'Bangladesh' },\r\n { code: 'BB', name: 'Barbados' },\r\n { code: 'BY', name: 'Belarus' },\r\n { code: 'BE', name: 'Belgium' },\r\n { code: 'BZ', name: 'Belize' },\r\n { code: 'BJ', name: 'Benin' },\r\n { code: 'BM', name: 'Bermuda' },\r\n { code: 'BT', name: 'Bhutan' },\r\n { code: 'BO', name: 'Bolivia' },\r\n { code: 'BQ', name: 'Bonaire, Sint Eustatius and Saba' },\r\n { code: 'BA', name: 'Bosnia and Herzegovina' },\r\n { code: 'BW', name: 'Botswana' },\r\n { code: 'BV', name: 'Bouvet Island' },\r\n { code: 'BR', name: 'Brazil' },\r\n { code: 'IO', name: 'British Indian Ocean Territory' },\r\n { code: 'BN', name: 'Brunei Darussalam' },\r\n { code: 'BG', name: 'Bulgaria' },\r\n { code: 'BF', name: 'Burkina Faso' },\r\n { code: 'BI', name: 'Burundi' },\r\n { code: 'CV', name: 'Cabo Verde' },\r\n { code: 'KH', name: 'Cambodia' },\r\n { code: 'CM', name: 'Cameroon' },\r\n { code: 'CA', name: 'Canada' },\r\n { code: 'KY', name: 'Cayman Islands' },\r\n { code: 'CF', name: 'Central African Republic' },\r\n { code: 'TD', name: 'Chad' },\r\n { code: 'CL', name: 'Chile' },\r\n { code: 'CN', name: 'China' },\r\n { code: 'CX', name: 'Christmas Island' },\r\n { code: 'CC', name: 'Cocos (Keeling) Islands' },\r\n { code: 'CO', name: 'Colombia' },\r\n { code: 'KM', name: 'Comoros' },\r\n { code: 'CG', name: 'Congo' },\r\n { code: 'CD', name: 'Congo, Democratic Republic of the' },\r\n { code: 'CK', name: 'Cook Islands' },\r\n { code: 'CR', name: 'Costa Rica' },\r\n { code: 'CI', name: \"Côte d'Ivoire\" },\r\n { code: 'HR', name: 'Croatia' },\r\n { code: 'CU', name: 'Cuba' },\r\n { code: 'CW', name: 'Curaçao' },\r\n { code: 'CY', name: 'Cyprus' },\r\n { code: 'CZ', name: 'Czechia' },\r\n { code: 'DK', name: 'Denmark' },\r\n { code: 'DJ', name: 'Djibouti' },\r\n { code: 'DM', name: 'Dominica' },\r\n { code: 'DO', name: 'Dominican Republic' },\r\n { code: 'EC', name: 'Ecuador' },\r\n { code: 'EG', name: 'Egypt' },\r\n { code: 'SV', name: 'El Salvador' },\r\n { code: 'GQ', name: 'Equatorial Guinea' },\r\n { code: 'ER', name: 'Eritrea' },\r\n { code: 'EE', name: 'Estonia' },\r\n { code: 'SZ', name: 'Eswatini' },\r\n { code: 'ET', name: 'Ethiopia' },\r\n { code: 'FK', name: 'Falkland Islands (Malvinas)' },\r\n { code: 'FO', name: 'Faroe Islands' },\r\n { code: 'FJ', name: 'Fiji' },\r\n { code: 'FI', name: 'Finland' },\r\n { code: 'FR', name: 'France' },\r\n { code: 'GF', name: 'French Guiana' },\r\n { code: 'PF', name: 'French Polynesia' },\r\n { code: 'TF', name: 'French Southern Territories' },\r\n { code: 'GA', name: 'Gabon' },\r\n { code: 'GM', name: 'Gambia' },\r\n { code: 'GE', name: 'Georgia' },\r\n { code: 'DE', name: 'Germany' },\r\n { code: 'GH', name: 'Ghana' },\r\n { code: 'GI', name: 'Gibraltar' },\r\n { code: 'GR', name: 'Greece' },\r\n { code: 'GL', name: 'Greenland' },\r\n { code: 'GD', name: 'Grenada' },\r\n { code: 'GP', name: 'Guadeloupe' },\r\n { code: 'GU', name: 'Guam' },\r\n { code: 'GT', name: 'Guatemala' },\r\n { code: 'GG', name: 'Guernsey' },\r\n { code: 'GN', name: 'Guinea' },\r\n { code: 'GW', name: 'Guinea-Bissau' },\r\n { code: 'GY', name: 'Guyana' },\r\n { code: 'HT', name: 'Haiti' },\r\n { code: 'HM', name: 'Heard Island and McDonald Islands' },\r\n { code: 'VA', name: 'Holy See' },\r\n { code: 'HN', name: 'Honduras' },\r\n { code: 'HK', name: 'Hong Kong' },\r\n { code: 'HU', name: 'Hungary' },\r\n { code: 'IS', name: 'Iceland' },\r\n { code: 'IN', name: 'India' },\r\n { code: 'ID', name: 'Indonesia' },\r\n { code: 'IR', name: 'Iran' },\r\n { code: 'IQ', name: 'Iraq' },\r\n { code: 'IE', name: 'Ireland' },\r\n { code: 'IM', name: 'Isle of Man' },\r\n { code: 'IL', name: 'Israel' },\r\n { code: 'IT', name: 'Italy' },\r\n { code: 'JM', name: 'Jamaica' },\r\n { code: 'JP', name: 'Japan' },\r\n { code: 'JE', name: 'Jersey' },\r\n { code: 'JO', name: 'Jordan' },\r\n { code: 'KZ', name: 'Kazakhstan' },\r\n { code: 'KE', name: 'Kenya' },\r\n { code: 'KI', name: 'Kiribati' },\r\n { code: 'KP', name: \"Korea, Democratic People's Republic of\" },\r\n { code: 'KR', name: 'Korea, Republic of' },\r\n { code: 'KW', name: 'Kuwait' },\r\n { code: 'KG', name: 'Kyrgyzstan' },\r\n { code: 'LA', name: \"Lao People's Democratic Republic\" },\r\n { code: 'LV', name: 'Latvia' },\r\n { code: 'LB', name: 'Lebanon' },\r\n { code: 'LS', name: 'Lesotho' },\r\n { code: 'LR', name: 'Liberia' },\r\n { code: 'LY', name: 'Libya' },\r\n { code: 'LI', name: 'Liechtenstein' },\r\n { code: 'LT', name: 'Lithuania' },\r\n { code: 'LU', name: 'Luxembourg' },\r\n { code: 'MO', name: 'Macao' },\r\n { code: 'MG', name: 'Madagascar' },\r\n { code: 'MW', name: 'Malawi' },\r\n { code: 'MY', name: 'Malaysia' },\r\n { code: 'MV', name: 'Maldives' },\r\n { code: 'ML', name: 'Mali' },\r\n { code: 'MT', name: 'Malta' },\r\n { code: 'MH', name: 'Marshall Islands' },\r\n { code: 'MQ', name: 'Martinique' },\r\n { code: 'MR', name: 'Mauritania' },\r\n { code: 'MU', name: 'Mauritius' },\r\n { code: 'YT', name: 'Mayotte' },\r\n { code: 'MX', name: 'Mexico' },\r\n { code: 'FM', name: 'Micronesia' },\r\n { code: 'MD', name: 'Moldova' },\r\n { code: 'MC', name: 'Monaco' },\r\n { code: 'MN', name: 'Mongolia' },\r\n { code: 'ME', name: 'Montenegro' },\r\n { code: 'MS', name: 'Montserrat' },\r\n { code: 'MA', name: 'Morocco' },\r\n { code: 'MZ', name: 'Mozambique' },\r\n { code: 'MM', name: 'Myanmar' },\r\n { code: 'NA', name: 'Namibia' },\r\n { code: 'NR', name: 'Nauru' },\r\n { code: 'NP', name: 'Nepal' },\r\n { code: 'NL', name: 'Netherlands' },\r\n { code: 'NC', name: 'New Caledonia' },\r\n { code: 'NZ', name: 'New Zealand' },\r\n { code: 'NI', name: 'Nicaragua' },\r\n { code: 'NE', name: 'Niger' },\r\n { code: 'NG', name: 'Nigeria' },\r\n { code: 'NU', name: 'Niue' },\r\n { code: 'NF', name: 'Norfolk Island' },\r\n { code: 'MK', name: 'North Macedonia' },\r\n { code: 'MP', name: 'Northern Mariana Islands' },\r\n { code: 'NO', name: 'Norway' },\r\n { code: 'OM', name: 'Oman' },\r\n { code: 'PK', name: 'Pakistan' },\r\n { code: 'PW', name: 'Palau' },\r\n { code: 'PS', name: 'Palestine, State of' },\r\n { code: 'PA', name: 'Panama' },\r\n { code: 'PG', name: 'Papua New Guinea' },\r\n { code: 'PY', name: 'Paraguay' },\r\n { code: 'PE', name: 'Peru' },\r\n { code: 'PH', name: 'Philippines' },\r\n { code: 'PN', name: 'Pitcairn' },\r\n { code: 'PL', name: 'Poland' },\r\n { code: 'PT', name: 'Portugal' },\r\n { code: 'PR', name: 'Puerto Rico' },\r\n { code: 'QA', name: 'Qatar' },\r\n { code: 'RE', name: 'Réunion' },\r\n { code: 'RO', name: 'Romania' },\r\n { code: 'RU', name: 'Russian Federation' },\r\n { code: 'RW', name: 'Rwanda' },\r\n { code: 'BL', name: 'Saint Barthélemy' },\r\n { code: 'SH', name: 'Saint Helena, Ascension and Tristan da Cunha' },\r\n { code: 'KN', name: 'Saint Kitts and Nevis' },\r\n { code: 'LC', name: 'Saint Lucia' },\r\n { code: 'MF', name: 'Saint Martin (French part)' },\r\n { code: 'PM', name: 'Saint Pierre and Miquelon' },\r\n { code: 'VC', name: 'Saint Vincent and the Grenadines' },\r\n { code: 'WS', name: 'Samoa' },\r\n { code: 'SM', name: 'San Marino' },\r\n { code: 'ST', name: 'Sao Tome and Principe' },\r\n { code: 'SA', name: 'Saudi Arabia' },\r\n { code: 'SN', name: 'Senegal' },\r\n { code: 'RS', name: 'Serbia' },\r\n { code: 'SC', name: 'Seychelles' },\r\n { code: 'SL', name: 'Sierra Leone' },\r\n { code: 'SG', name: 'Singapore' },\r\n { code: 'SX', name: 'Sint Maarten (Dutch part)' },\r\n { code: 'SK', name: 'Slovakia' },\r\n { code: 'SI', name: 'Slovenia' },\r\n { code: 'SB', name: 'Solomon Islands' },\r\n { code: 'SO', name: 'Somalia' },\r\n { code: 'ZA', name: 'South Africa' },\r\n { code: 'GS', name: 'South Georgia and the South Sandwich Islands' },\r\n { code: 'SS', name: 'South Sudan' },\r\n { code: 'ES', name: 'Spain' },\r\n { code: 'LK', name: 'Sri Lanka' },\r\n { code: 'SD', name: 'Sudan' },\r\n { code: 'SR', name: 'Suriname' },\r\n { code: 'SJ', name: 'Svalbard and Jan Mayen' },\r\n { code: 'SE', name: 'Sweden' },\r\n { code: 'CH', name: 'Switzerland' },\r\n { code: 'SY', name: 'Syrian Arab Republic' },\r\n { code: 'TW', name: 'Taiwan' },\r\n { code: 'TJ', name: 'Tajikistan' },\r\n { code: 'TZ', name: 'Tanzania' },\r\n { code: 'TH', name: 'Thailand' },\r\n { code: 'TL', name: 'Timor-Leste' },\r\n { code: 'TG', name: 'Togo' },\r\n { code: 'TK', name: 'Tokelau' },\r\n { code: 'TO', name: 'Tonga' },\r\n { code: 'TT', name: 'Trinidad and Tobago' },\r\n { code: 'TN', name: 'Tunisia' },\r\n { code: 'TR', name: 'Türkiye' },\r\n { code: 'TM', name: 'Turkmenistan' },\r\n { code: 'TC', name: 'Turks and Caicos Islands' },\r\n { code: 'TV', name: 'Tuvalu' },\r\n { code: 'UG', name: 'Uganda' },\r\n { code: 'UA', name: 'Ukraine' },\r\n { code: 'AE', name: 'United Arab Emirates' },\r\n { code: 'GB', name: 'United Kingdom' },\r\n { code: 'US', name: 'United States of America' },\r\n { code: 'UM', name: 'United States Minor Outlying Islands' },\r\n { code: 'UY', name: 'Uruguay' },\r\n { code: 'UZ', name: 'Uzbekistan' },\r\n { code: 'VU', name: 'Vanuatu' },\r\n { code: 'VE', name: 'Venezuela' },\r\n { code: 'VN', name: 'Viet Nam' },\r\n { code: 'VG', name: 'Virgin Islands (British)' },\r\n { code: 'VI', name: 'Virgin Islands (U.S.)' },\r\n { code: 'WF', name: 'Wallis and Futuna' },\r\n { code: 'EH', name: 'Western Sahara' },\r\n { code: 'YE', name: 'Yemen' },\r\n { code: 'ZM', name: 'Zambia' },\r\n { code: 'ZW', name: 'Zimbabwe' },\r\n]);\r\n","import {\n ChangeDetectionStrategy,\n Component,\n OnInit,\n computed,\n effect,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { TranslatePipe } from '../../pipes/translate.pipe';\nimport { I18nService } from '../../services/i18n.service';\nimport { FlySelectComponent } from '../select/select.component';\nimport type { FlySelectOption } from '../select/select.types';\nimport { FLY_COUNTRIES } from './countries';\nimport type {\n FlyFileSelection,\n FlyFormAnswer,\n FlyFormAnswerValue,\n FlyFormDefinition,\n FlyFormOption,\n FlyFormQuestion,\n FlyFormQuestionType,\n FlyFormScoreDisplay,\n} from './dynamic-form.types';\n\n/** A render segment: either an ungrouped field (`group === null`) or a titled `criteriaGroup` section.\n * `index` is the field's running position across the whole form (drives unique element ids). */\ninterface FlyFormFieldGroup {\n group: string | null;\n items: { q: FlyFormQuestion; index: number }[];\n}\n\n/** Process-wide counter so every instance owns unique element ids (`<label for>` ↔ control). */\nlet _flyDynamicFormUid = 0;\n\n/** The choice-style field kinds whose answer is a set of `selectedOptionIds`. */\nconst CHOICE_TYPES: ReadonlySet<FlyFormQuestionType> = new Set([\n 'SingleSelect',\n 'MultipleSelect',\n 'RadioButton',\n 'Country',\n]);\n\n/** The file-style field kinds whose answer is `fileIds`. */\nconst FILE_TYPES: ReadonlySet<FlyFormQuestionType> = new Set(['File', 'MultiFile', 'Image']);\n\n/**\n * **`fly-dynamic-form`** — the design-system data-contract-driven form renderer.\n *\n * Renders a {@link FlyFormDefinition} (14 field types) into an accessible,\n * theme-aware form, owning all the fiddly behaviour a form needs: conditional\n * **branching** (options reveal branch-target fields), per-visible-field\n * **required validation**, a **declaration** acceptance gate, and a **readonly**\n * replay mode. It is a platform surface — zero coupling to any specific app, and\n * (deliberately) no coupling to an upload API: File / Image / MultiFile fields\n * surface the raw selection via {@link fileSelected} and emit `fileIds` empty; the\n * host wires the upload and feeds ids back through the `[answers]` prefill.\n *\n * The historical **`fly-survey-form`** selector is retained on this same component\n * (multi-selector), so every existing `<fly-survey-form>` binding keeps working\n * unchanged. Surveys never sets {@link showScore}, so its behaviour (never rendering\n * `option.score`) is identical. A scorecard host opts into score display with\n * `[showScore]=\"true\"`.\n *\n * i18n is self-sufficient through the `form.*` keys in `DS_BASELINE_LOCALES`\n * (en/ar/fr/ur), overridable by any consumer key of the same name. RTL works via\n * logical CSS. Styling uses DS theme tokens (`--surface-*`, `--label-*`,\n * `--separator`, `--fill-*`, `--accent`, `--system-*`) with light-neutral\n * fallbacks so it stays readable even in a consumer that hasn't mapped them.\n *\n * @example\n * ```html\n * <fly-dynamic-form\n * [definition]=\"def\"\n * [answers]=\"prefill\"\n * [showScore]=\"true\"\n * (answersChange)=\"draft = $event\"\n * (validityChange)=\"valid = $event\"\n * (fileSelected)=\"upload($event)\"\n * (submit)=\"persist($event)\" />\n * ```\n */\n@Component({\n selector: 'fly-dynamic-form, fly-survey-form',\n standalone: true,\n imports: [CommonModule, FormsModule, TranslatePipe, FlySelectComponent],\n templateUrl: './dynamic-form.component.html',\n styleUrl: './dynamic-form.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'fly-dynamic-form fly-survey-form',\n '[class.fly-dynamic-form--readonly]': 'isReadonly()',\n '[class.fly-survey-form--readonly]': 'isReadonly()',\n },\n})\nexport class FlyDynamicFormComponent implements OnInit {\n private readonly _i18n = inject(I18nService);\n\n // ── Inputs ───────────────────────────────────────────────────────────────────\n /** The form to render. */\n readonly definition = input.required<FlyFormDefinition>();\n /** Replay mode — every control is disabled and no validation errors / submit show.\n * Aliased to `[readonly]` (the public binding); the class member avoids shadowing\n * the TypeScript `readonly` keyword. */\n // eslint-disable-next-line @angular-eslint/no-input-rename -- `[readonly]` is the intended public API\n readonly isReadonly = input(false, { alias: 'readonly' });\n /** Hides the submit button while leaving every control interactive — the author's\n * pre-publish PREVIEW, which must let you open dropdowns and try the form out but has\n * nothing to submit to. Distinct from `readonly`, which disables the controls outright\n * (a submission replay). A host that hides submit should not bind `(submit)`. */\n readonly hideSubmit = input(false);\n /** Prefill answers (e.g. a saved draft or a completed response). Answers for\n * currently-hidden branch targets are ignored. */\n readonly answers = input<readonly FlyFormAnswer[]>([]);\n /** Additive, opt-in: render each choice option's `score` (a weighted scorecard).\n * Defaults false so the respondent-facing survey path never leaks the answer key. */\n readonly showScore = input(false);\n /** How an opted-in score is rendered next to an option (`badge` chip or `inline` text). */\n readonly scoreDisplay = input<FlyFormScoreDisplay>('badge');\n\n // ── Outputs ──────────────────────────────────────────────────────────────────\n /** The full visible answer set on every change. */\n readonly answersChange = output<FlyFormAnswer[]>();\n /** Required-field validity on every change (does NOT include the declaration gate). */\n readonly validityChange = output<boolean>();\n /** Fires only when the form is valid AND (if a declaration is set) accepted. */\n // eslint-disable-next-line @angular-eslint/no-output-native -- `(submit)` is the intended public API name\n readonly submit = output<FlyFormAnswer[]>();\n /** Raw file selection for a File / MultiFile / Image field — the host uploads\n * and feeds the resulting ids back via `[answers]`. */\n readonly fileSelected = output<FlyFileSelection>();\n\n // ── Identity ─────────────────────────────────────────────────────────────────\n private readonly _base = `fly-dynamic-form-${++_flyDynamicFormUid}`;\n\n // ── State (signals) ──────────────────────────────────────────────────────────\n /** questionId → answer value. Only ever contains VISIBLE, non-empty answers. */\n private readonly _values = signal<Map<string, FlyFormAnswerValue>>(new Map());\n /** questionId → locally-picked File[] (transient, pre-upload). Never emitted as ids. */\n private readonly _fileSelections = signal<Map<string, File[]>>(new Map());\n private readonly _declarationAccepted = signal(false);\n private readonly _submitAttempted = signal(false);\n /** questionIds the user has interacted with — gates when a required error shows. */\n private readonly _interacted = signal<Set<string>>(new Set());\n /** Per-field local file-validation error message (already localized). */\n private readonly _fileErrors = signal<Map<string, string>>(new Map());\n\n private readonly _countryOptions: readonly FlySelectOption[] = FLY_COUNTRIES.map((c) => ({\n value: c.code,\n label: c.name,\n }));\n\n constructor() {\n // Seed internal state from the `answers` prefill whenever it (or the definition)\n // changes. Reads the inputs (tracked) and writes the DISTINCT `_values` signal —\n // no read-then-write loop — and NEVER emits (only user edits emit), so a parent\n // that binds `[answers]` to the `(answersChange)` output can't loop.\n effect(() => {\n const def = this.definition();\n const prefill = this.answers();\n const map = new Map<string, FlyFormAnswerValue>();\n for (const a of prefill) map.set(a.questionId, { ...a.value });\n // Drop prefill for fields that aren't currently revealed.\n const visible = this._computeVisibleIds(def, map);\n for (const key of [...map.keys()]) {\n if (!visible.has(key)) map.delete(key);\n }\n this._values.set(map);\n });\n }\n\n ngOnInit(): void {\n // Let the parent observe initial validity without tripping ExpressionChanged.\n queueMicrotask(() => this.validityChange.emit(this.isValid()));\n }\n\n // ── Derived view state ─────────────────────────────────────────────────────────\n /** The set of field ids currently shown (base fields + revealed branch targets). */\n readonly visibleQuestionIds = computed<Set<string>>(() =>\n this._computeVisibleIds(this.definition(), this._values()),\n );\n\n /** Definition fields filtered to the visible set, in definition order. */\n readonly visibleQuestions = computed<FlyFormQuestion[]>(() => {\n const ids = this.visibleQuestionIds();\n return this.definition().questions.filter((q) => ids.has(q.id));\n });\n\n /**\n * The visible fields laid out in render order, segmented by `criteriaGroup`: fields that share a\n * (non-empty) group render together inside one titled section (a scorecard's weighted-criteria\n * grouping); a field with no `criteriaGroup` is its own ungrouped segment and renders flat, exactly\n * as before. Each item keeps its running index across the whole form so element ids stay unique.\n */\n readonly groupedQuestions = computed<FlyFormFieldGroup[]>(() => {\n const out: FlyFormFieldGroup[] = [];\n const byKey = new Map<string, FlyFormFieldGroup>();\n this.visibleQuestions().forEach((q, index) => {\n const key = q.criteriaGroup?.trim() ? q.criteriaGroup.trim() : null;\n if (key === null) {\n out.push({ group: null, items: [{ q, index }] });\n return;\n }\n let g = byKey.get(key);\n if (!g) {\n g = { group: key, items: [] };\n byKey.set(key, g);\n out.push(g);\n }\n g.items.push({ q, index });\n });\n return out;\n });\n\n readonly declarationRequired = computed<boolean>(() => !!this.definition().declaration?.trim());\n\n /** Required-field validity (declaration NOT included — see {@link canSubmit}). */\n readonly isValid = computed<boolean>(() => {\n const ids = this.visibleQuestionIds();\n for (const q of this.definition().questions) {\n if (!ids.has(q.id) || !q.required) continue;\n if (!this._isAnswered(q)) return false;\n }\n return true;\n });\n\n /** Whether `(submit)` may fire: valid required set AND declaration accepted (if any). */\n readonly canSubmit = computed<boolean>(\n () => this.isValid() && (!this.declarationRequired() || this._declarationAccepted()),\n );\n\n readonly declarationAccepted = this._declarationAccepted.asReadonly();\n\n // ── Template helpers ───────────────────────────────────────────────────────────\n fieldId(index: number): string {\n return `${this._base}-q${index}`;\n }\n\n descId(index: number): string {\n return `${this._base}-q${index}-desc`;\n }\n\n errId(index: number): string {\n return `${this._base}-q${index}-err`;\n }\n\n describedBy(q: FlyFormQuestion, index: number): string | null {\n const parts: string[] = [];\n if (q.description) parts.push(this.descId(index));\n if (this.showError(q)) parts.push(this.errId(index));\n return parts.length ? parts.join(' ') : null;\n }\n\n isChoice(type: FlyFormQuestionType): boolean {\n return CHOICE_TYPES.has(type);\n }\n\n isFile(type: FlyFormQuestionType): boolean {\n return FILE_TYPES.has(type);\n }\n\n /** Types rendered as a native input group inside `<fieldset><legend>`. */\n isFieldset(type: FlyFormQuestionType): boolean {\n return type === 'RadioButton' || type === 'MultipleSelect';\n }\n\n isCountry(type: FlyFormQuestionType): boolean {\n return type === 'Country';\n }\n\n /**\n * Types rendered with the DS `<fly-select>` (labelled via `ariaLabel`).\n *\n * Every select-like type now qualifies. `hasSearch` used to gate the CONTROL, which left a plain\n * SingleSelect on a native `<select>` — an OS-chrome popup that cannot be themed (it paints its\n * rows with the control's translucent background over a white backing, so the list rendered\n * white-on-white on the dark shell). `hasSearch` now only decides whether the DS panel carries a\n * search box; see {@link selectSearchable}.\n */\n usesDsSelect(q: FlyFormQuestion): boolean {\n return q.type === 'Country' || q.type === 'SingleSelect';\n }\n\n /** Search box: always for Country (the list is ~200 long), else only when the author asked. */\n selectSearchable(q: FlyFormQuestion): boolean {\n return this.isCountry(q.type) || !!q.fieldOptions?.hasSearch;\n }\n\n /**\n * The points to show for a choice option, or null to render nothing. Non-null only when the host\n * opted in via `[showScore]` and the option actually carries a score — this is the sole gate that\n * keeps a respondent-facing survey (which never binds `showScore`) from leaking the answer key.\n */\n optionScore(opt: FlyFormOption): number | null {\n return this.showScore() && opt.score != null ? opt.score : null;\n }\n\n /** Whether a required error should be visible for a field right now. */\n showError(q: FlyFormQuestion): boolean {\n if (this.isReadonly() || !q.required) return false;\n if (!this.visibleQuestionIds().has(q.id)) return false;\n if (this._isAnswered(q)) return false;\n return this._submitAttempted() || this._interacted().has(q.id);\n }\n\n fileError(q: FlyFormQuestion): string | null {\n return this._fileErrors().get(q.id) ?? null;\n }\n\n // — value readers (drive control state) —\n textValue(q: FlyFormQuestion): string {\n return this._values().get(q.id)?.text ?? '';\n }\n\n numberValue(q: FlyFormQuestion): number | null {\n return this._values().get(q.id)?.number ?? null;\n }\n\n dateValue(q: FlyFormQuestion): string {\n return this._values().get(q.id)?.dateValue ?? '';\n }\n\n boolValue(q: FlyFormQuestion): boolean | null {\n const v = this._values().get(q.id)?.boolValue;\n return v ?? null;\n }\n\n singleValue(q: FlyFormQuestion): string | null {\n return this._values().get(q.id)?.selectedOptionIds?.[0] ?? null;\n }\n\n isSelected(q: FlyFormQuestion, optionId: string): boolean {\n return this._values().get(q.id)?.selectedOptionIds?.includes(optionId) ?? false;\n }\n\n countryOptions(q: FlyFormQuestion): readonly FlySelectOption[] {\n // If the author supplied their own country options, honour them; else the bundled ISO list.\n return q.options.length ? q.options.map((o) => ({ value: o.id, label: o.label })) : this._countryOptions;\n }\n\n selectOptions(q: FlyFormQuestion): readonly FlySelectOption[] {\n return q.options.map((o) => ({ value: o.id, label: o.label }));\n }\n\n fileNames(q: FlyFormQuestion): string[] {\n return (this._fileSelections().get(q.id) ?? []).map((f) => f.name);\n }\n\n acceptFor(q: FlyFormQuestion): string {\n if (q.type === 'Image' && !q.fieldOptions?.allowedExtensions?.length) return 'image/*';\n const exts = q.fieldOptions?.allowedExtensions ?? [];\n return exts.map((e) => (e.startsWith('.') ? e : `.${e}`)).join(',');\n }\n\n // ── User actions ───────────────────────────────────────────────────────────────\n onText(q: FlyFormQuestion, value: string): void {\n this._touch(q.id);\n this._mutate(q.id, { text: value });\n }\n\n onNumber(q: FlyFormQuestion, value: string): void {\n this._touch(q.id);\n if (value.trim() === '') {\n this._mutate(q.id, null);\n return;\n }\n const n = Number(value);\n this._mutate(q.id, Number.isFinite(n) ? { number: n } : null);\n }\n\n onDate(q: FlyFormQuestion, value: string): void {\n this._touch(q.id);\n this._mutate(q.id, value ? { dateValue: value } : null);\n }\n\n onBoolean(q: FlyFormQuestion, value: boolean): void {\n if (this.isReadonly()) return;\n this._touch(q.id);\n this._mutate(q.id, { boolValue: value });\n }\n\n onSingleSelect(q: FlyFormQuestion, value: string | readonly string[] | null): void {\n this._touch(q.id);\n const optionId = Array.isArray(value) ? (value[0] ?? null) : (value as string | null);\n this._mutate(q.id, { selectedOptionIds: optionId ? [optionId] : [] });\n }\n\n onRadio(q: FlyFormQuestion, optionId: string): void {\n if (this.isReadonly()) return;\n this._touch(q.id);\n this._mutate(q.id, { selectedOptionIds: [optionId] });\n }\n\n onMultiToggle(q: FlyFormQuestion, optionId: string, checked: boolean): void {\n if (this.isReadonly()) return;\n this._touch(q.id);\n const current = this._values().get(q.id)?.selectedOptionIds ?? [];\n const next = checked ? [...new Set([...current, optionId])] : current.filter((id) => id !== optionId);\n this._mutate(q.id, { selectedOptionIds: next });\n }\n\n onFiles(q: FlyFormQuestion, input: HTMLInputElement): void {\n if (this.isReadonly()) return;\n this._touch(q.id);\n const picked = input.files ? Array.from(input.files) : [];\n input.value = '';\n\n const opts = q.fieldOptions ?? {};\n const maxCount = q.type === 'MultiFile' ? (opts.maxFileCount ?? Number.MAX_SAFE_INTEGER) : 1;\n const capBytes = opts.maxFileSizeMb != null ? opts.maxFileSizeMb * 1024 * 1024 : null;\n\n let error: string | null = null;\n let files = picked;\n\n if (capBytes != null) {\n const tooBig = files.find((f) => f.size > capBytes);\n if (tooBig) {\n error = this._t('form.file_too_large', { mb: opts.maxFileSizeMb as number });\n files = files.filter((f) => f.size <= capBytes);\n }\n }\n if (files.length > maxCount) {\n error = this._t('form.too_many_files', { n: maxCount });\n files = files.slice(0, maxCount);\n }\n\n this._setFileError(q.id, error);\n\n const next = new Map(this._fileSelections());\n if (files.length) next.set(q.id, files);\n else next.delete(q.id);\n this._fileSelections.set(next);\n\n if (files.length) this.fileSelected.emit({ questionId: q.id, files });\n this._emit();\n }\n\n onDeclarationToggle(checked: boolean): void {\n if (this.isReadonly()) return;\n this._declarationAccepted.set(checked);\n }\n\n onSubmit(): void {\n if (this.isReadonly()) return;\n this._submitAttempted.set(true);\n if (!this.canSubmit()) return;\n this.submit.emit(this._collectAnswers());\n }\n\n // ── Internals ──────────────────────────────────────────────────────────────────\n private _touch(questionId: string): void {\n if (this._interacted().has(questionId)) return;\n this._interacted.update((s) => new Set(s).add(questionId));\n }\n\n private _setFileError(questionId: string, message: string | null): void {\n this._fileErrors.update((m) => {\n const next = new Map(m);\n if (message) next.set(questionId, message);\n else next.delete(questionId);\n return next;\n });\n }\n\n private _mutate(questionId: string, value: FlyFormAnswerValue | null): void {\n const map = new Map(this._values());\n if (value == null || this._isEmptyValue(value)) map.delete(questionId);\n else map.set(questionId, value);\n\n // Recompute visibility from the mutated answers, then prune answers + file\n // selections for fields that just became hidden (a deselected branch clears\n // its revealed subtree). Hidden fields never contribute to the trigger\n // evaluation, so a single prune pass is stable.\n const visible = this._computeVisibleIds(this.definition(), map);\n for (const key of [...map.keys()]) {\n if (!visible.has(key)) map.delete(key);\n }\n this._values.set(map);\n\n const files = this._fileSelections();\n if ([...files.keys()].some((k) => !visible.has(k))) {\n const nextFiles = new Map(files);\n for (const key of [...nextFiles.keys()]) {\n if (!visible.has(key)) nextFiles.delete(key);\n }\n this._fileSelections.set(nextFiles);\n }\n\n this._emit();\n }\n\n private _emit(): void {\n this.answersChange.emit(this._collectAnswers());\n this.validityChange.emit(this.isValid());\n }\n\n private _collectAnswers(): FlyFormAnswer[] {\n const values = this._values();\n const fileSel = this._fileSelections();\n const out: FlyFormAnswer[] = [];\n for (const q of this.visibleQuestions()) {\n if (this.isFile(q.type)) {\n const prefillIds = values.get(q.id)?.fileIds ?? [];\n const hasLocal = (fileSel.get(q.id)?.length ?? 0) > 0;\n // Emit an answer once there is a selection; fileIds stays empty for a\n // local-only pick (the host fills it after upload).\n if (prefillIds.length || hasLocal) {\n out.push({ questionId: q.id, value: { fileIds: prefillIds } });\n }\n continue;\n }\n const v = values.get(q.id);\n if (v && !this._isEmptyValue(v)) out.push({ questionId: q.id, value: { ...v } });\n }\n return out;\n }\n\n private _isAnswered(q: FlyFormQuestion): boolean {\n if (this.isFile(q.type)) {\n const prefillIds = this._values().get(q.id)?.fileIds ?? [];\n const local = this._fileSelections().get(q.id)?.length ?? 0;\n return prefillIds.length > 0 || local > 0;\n }\n const v = this._values().get(q.id);\n return !!v && !this._isEmptyValue(v);\n }\n\n private _isEmptyValue(v: FlyFormAnswerValue): boolean {\n return (\n (v.text == null || v.text.trim() === '') &&\n v.number == null &&\n (v.dateValue == null || v.dateValue === '') &&\n v.boolValue == null &&\n !(v.selectedOptionIds && v.selectedOptionIds.length > 0) &&\n !(v.fileIds && v.fileIds.length > 0)\n );\n }\n\n private _selectedIds(q: FlyFormQuestion, value?: FlyFormAnswerValue): string[] {\n if (!this.isChoice(q.type)) return [];\n return value?.selectedOptionIds ?? [];\n }\n\n /**\n * The set of visible field ids for a given answer map. Base (non-branch-target)\n * fields are always visible; a branch target becomes visible when a\n * currently-visible field has a selected option that links to it. Computed to a\n * fixpoint so chained reveals work, and cycle-safe: the visible set only grows and\n * iteration is capped at `questions.length` passes, so an A↔B link cycle terminates.\n *\n * This is the TypeScript twin of the backend Fly.Sdk.Forms `BranchResolver`\n * fixpoint — the two must stay in lockstep so server + client agree on which fields\n * are active.\n */\n private _computeVisibleIds(\n def: FlyFormDefinition,\n values: Map<string, FlyFormAnswerValue>,\n ): Set<string> {\n const visible = new Set<string>();\n const byId = new Map<string, FlyFormQuestion>();\n for (const q of def.questions) {\n byId.set(q.id, q);\n // An author-hidden field (isVisible === false) is never active: it is neither seeded nor\n // (below) revealable as a branch target. Mirrors the backend BranchResolver IsVisible rule.\n if (!q.isBranchTarget && q.isVisible !== false) visible.add(q.id);\n }\n let changed = true;\n let guard = def.questions.length + 1;\n while (changed && guard-- > 0) {\n changed = false;\n for (const q of def.questions) {\n if (!visible.has(q.id)) continue;\n const selected = this._selectedIds(q, values.get(q.id));\n if (!selected.length) continue;\n for (const opt of q.options) {\n if (!selected.includes(opt.id)) continue;\n for (const tgt of opt.linkedQuestionIds ?? []) {\n const tgtQ = byId.get(tgt);\n if (tgtQ && tgtQ.isVisible !== false && !visible.has(tgt)) {\n visible.add(tgt);\n changed = true;\n }\n }\n }\n }\n }\n return visible;\n }\n\n /** Imperative localization for file-validation messages (the pipe covers view strings). */\n private _t(key: string, params?: Record<string, string | number>): string {\n return this._i18n.t(key, params);\n }\n}\n","<div class=\"fly-dynamic-form__body\">\r\n <header class=\"fly-dynamic-form__header\">\r\n <h2 class=\"fly-dynamic-form__title\">{{ definition().title }}</h2>\r\n @if (definition().description) {\r\n <p class=\"fly-dynamic-form__description\">{{ definition().description }}</p>\r\n }\r\n </header>\r\n\r\n <div class=\"fly-dynamic-form__fields\">\r\n @for (grp of groupedQuestions(); track $index) {\r\n @if (grp.group) {\r\n <fieldset class=\"fly-dynamic-form__section\">\r\n <legend class=\"fly-dynamic-form__section-title\">{{ grp.group }}</legend>\r\n @for (item of grp.items; track item.q.id) {\r\n <ng-container *ngTemplateOutlet=\"fieldTpl; context: { q: item.q, i: item.index }\" />\r\n }\r\n </fieldset>\r\n } @else {\r\n @for (item of grp.items; track item.q.id) {\r\n <ng-container *ngTemplateOutlet=\"fieldTpl; context: { q: item.q, i: item.index }\" />\r\n }\r\n }\r\n }\r\n </div>\r\n\r\n <ng-template #fieldTpl let-q=\"q\" let-i=\"i\">\r\n <div class=\"fly-dynamic-form__field\" [class.fly-dynamic-form__field--invalid]=\"showError(q)\">\r\n\r\n <!-- ── Native input group (RadioButton / MultipleSelect) ── -->\r\n @if (isFieldset(q.type)) {\r\n <fieldset\r\n class=\"fly-dynamic-form__group\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\">\r\n <legend class=\"fly-dynamic-form__label\">\r\n {{ q.text }}\r\n @if (q.required) { <span class=\"fly-dynamic-form__req\" aria-hidden=\"true\">*</span> }\r\n </legend>\r\n @if (q.description) {\r\n <p class=\"fly-dynamic-form__desc\" [id]=\"descId(i)\">{{ q.description }}</p>\r\n }\r\n\r\n @switch (q.type) {\r\n @case ('RadioButton') {\r\n <div class=\"fly-dynamic-form__options\">\r\n @for (opt of q.options; track opt.id) {\r\n <label class=\"fly-dynamic-form__option\">\r\n <input\r\n type=\"radio\"\r\n [name]=\"fieldId(i)\"\r\n [value]=\"opt.id\"\r\n [checked]=\"isSelected(q, opt.id)\"\r\n [disabled]=\"isReadonly()\"\r\n (change)=\"onRadio(q, opt.id)\" />\r\n <span class=\"fly-dynamic-form__option-label\">{{ opt.label }}</span>\r\n @if (optionScore(opt) !== null) {\r\n <span class=\"fly-dynamic-form__option-score\" [class.fly-dynamic-form__option-score--inline]=\"scoreDisplay() === 'inline'\">{{ optionScore(opt) }}</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n }\r\n @case ('MultipleSelect') {\r\n <div class=\"fly-dynamic-form__options\">\r\n @for (opt of q.options; track opt.id) {\r\n <label class=\"fly-dynamic-form__option\">\r\n <input\r\n type=\"checkbox\"\r\n [value]=\"opt.id\"\r\n [checked]=\"isSelected(q, opt.id)\"\r\n [disabled]=\"isReadonly()\"\r\n (change)=\"onMultiToggle(q, opt.id, $any($event.target).checked)\" />\r\n <span class=\"fly-dynamic-form__option-label\">{{ opt.label }}</span>\r\n @if (optionScore(opt) !== null) {\r\n <span class=\"fly-dynamic-form__option-score\" [class.fly-dynamic-form__option-score--inline]=\"scoreDisplay() === 'inline'\">{{ optionScore(opt) }}</span>\r\n }\r\n </label>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @if (showError(q)) {\r\n <p class=\"fly-dynamic-form__error\" [id]=\"errId(i)\" role=\"alert\">\r\n {{ 'form.required_error' | translate }}\r\n </p>\r\n }\r\n </fieldset>\r\n }\r\n\r\n <!-- ── Boolean → segmented Yes / No radiogroup (not a toggle) ── -->\r\n @else if (q.type === 'Boolean') {\r\n <span class=\"fly-dynamic-form__label\" [id]=\"fieldId(i) + '-lbl'\">\r\n {{ q.text }}\r\n @if (q.required) { <span class=\"fly-dynamic-form__req\" aria-hidden=\"true\">*</span> }\r\n </span>\r\n @if (q.description) {\r\n <p class=\"fly-dynamic-form__desc\" [id]=\"descId(i)\">{{ q.description }}</p>\r\n }\r\n <div\r\n class=\"fly-dynamic-form__segmented\"\r\n role=\"radiogroup\"\r\n [attr.aria-labelledby]=\"fieldId(i) + '-lbl'\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\">\r\n <button\r\n type=\"button\"\r\n class=\"fly-dynamic-form__seg\"\r\n role=\"radio\"\r\n [class.fly-dynamic-form__seg--on]=\"boolValue(q) === true\"\r\n [attr.aria-checked]=\"boolValue(q) === true\"\r\n [disabled]=\"isReadonly()\"\r\n (click)=\"onBoolean(q, true)\">\r\n {{ 'form.yes' | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"fly-dynamic-form__seg\"\r\n role=\"radio\"\r\n [class.fly-dynamic-form__seg--on]=\"boolValue(q) === false\"\r\n [attr.aria-checked]=\"boolValue(q) === false\"\r\n [disabled]=\"isReadonly()\"\r\n (click)=\"onBoolean(q, false)\">\r\n {{ 'form.no' | translate }}\r\n </button>\r\n </div>\r\n @if (showError(q)) {\r\n <p class=\"fly-dynamic-form__error\" [id]=\"errId(i)\" role=\"alert\">\r\n {{ 'form.required_error' | translate }}\r\n </p>\r\n }\r\n }\r\n\r\n <!-- ── Searchable DS single-select (SingleSelect+hasSearch / Country) ── -->\r\n @else if (usesDsSelect(q)) {\r\n <span class=\"fly-dynamic-form__label\">\r\n {{ q.text }}\r\n @if (q.required) { <span class=\"fly-dynamic-form__req\" aria-hidden=\"true\">*</span> }\r\n </span>\r\n @if (q.description) {\r\n <p class=\"fly-dynamic-form__desc\" [id]=\"descId(i)\">{{ q.description }}</p>\r\n }\r\n <fly-select\r\n [options]=\"isCountry(q.type) ? countryOptions(q) : selectOptions(q)\"\r\n [multiple]=\"false\"\r\n [searchable]=\"selectSearchable(q)\"\r\n [clearable]=\"!q.required\"\r\n [disabled]=\"isReadonly()\"\r\n [ariaLabel]=\"q.text\"\r\n [placeholder]=\"'form.select_placeholder' | translate\"\r\n [searchPlaceholder]=\"(isCountry(q.type) ? 'form.country_search' : 'form.search_placeholder') | translate\"\r\n [noResultsLabel]=\"'form.no_results' | translate\"\r\n [ngModel]=\"singleValue(q)\"\r\n (selectionChange)=\"onSingleSelect(q, $event)\" />\r\n @if (showError(q)) {\r\n <p class=\"fly-dynamic-form__error\" [id]=\"errId(i)\" role=\"alert\">\r\n {{ 'form.required_error' | translate }}\r\n </p>\r\n }\r\n }\r\n\r\n <!-- ── Single labelled native control ── -->\r\n @else {\r\n <label class=\"fly-dynamic-form__label\" [for]=\"fieldId(i)\">\r\n {{ q.text }}\r\n @if (q.required) { <span class=\"fly-dynamic-form__req\" aria-hidden=\"true\">*</span> }\r\n </label>\r\n @if (q.description) {\r\n <p class=\"fly-dynamic-form__desc\" [id]=\"descId(i)\">{{ q.description }}</p>\r\n }\r\n\r\n @switch (q.type) {\r\n @case ('Text') {\r\n <input\r\n class=\"fly-dynamic-form__input\"\r\n type=\"text\"\r\n [id]=\"fieldId(i)\"\r\n [value]=\"textValue(q)\"\r\n [attr.minlength]=\"q.fieldOptions?.minLength ?? null\"\r\n [attr.maxlength]=\"q.fieldOptions?.maxLength ?? null\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (input)=\"onText(q, $any($event.target).value)\" />\r\n }\r\n @case ('MultilineText') {\r\n <textarea\r\n class=\"fly-dynamic-form__input fly-dynamic-form__textarea\"\r\n [id]=\"fieldId(i)\"\r\n [value]=\"textValue(q)\"\r\n [rows]=\"q.fieldOptions?.rows ?? 4\"\r\n [attr.minlength]=\"q.fieldOptions?.minLength ?? null\"\r\n [attr.maxlength]=\"q.fieldOptions?.maxLength ?? null\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (input)=\"onText(q, $any($event.target).value)\"></textarea>\r\n }\r\n @case ('Number') {\r\n <input\r\n class=\"fly-dynamic-form__input\"\r\n type=\"number\"\r\n [id]=\"fieldId(i)\"\r\n [value]=\"numberValue(q)\"\r\n [attr.min]=\"q.fieldOptions?.numericMin ?? null\"\r\n [attr.max]=\"q.fieldOptions?.numericMax ?? null\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (input)=\"onNumber(q, $any($event.target).value)\" />\r\n }\r\n @case ('Email') {\r\n <input\r\n class=\"fly-dynamic-form__input\"\r\n type=\"email\"\r\n [id]=\"fieldId(i)\"\r\n [value]=\"textValue(q)\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (input)=\"onText(q, $any($event.target).value)\" />\r\n }\r\n @case ('Date') {\r\n <input\r\n class=\"fly-dynamic-form__input\"\r\n type=\"date\"\r\n [id]=\"fieldId(i)\"\r\n [value]=\"dateValue(q)\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (input)=\"onDate(q, $any($event.target).value)\" />\r\n }\r\n @case ('DateTime') {\r\n <input\r\n class=\"fly-dynamic-form__input\"\r\n type=\"datetime-local\"\r\n [id]=\"fieldId(i)\"\r\n [value]=\"dateValue(q)\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (input)=\"onDate(q, $any($event.target).value)\" />\r\n }\r\n @case ('File') {\r\n <div class=\"fly-dynamic-form__file\">\r\n <input\r\n #fileRef\r\n type=\"file\"\r\n class=\"fly-dynamic-form__file-input\"\r\n [id]=\"fieldId(i)\"\r\n [accept]=\"acceptFor(q)\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (change)=\"onFiles(q, fileRef)\" />\r\n @if (fileNames(q).length) {\r\n <ul class=\"fly-dynamic-form__file-list\">\r\n @for (name of fileNames(q); track name) { <li>{{ name }}</li> }\r\n </ul>\r\n }\r\n </div>\r\n }\r\n @case ('Image') {\r\n <div class=\"fly-dynamic-form__file\">\r\n <input\r\n #imgRef\r\n type=\"file\"\r\n class=\"fly-dynamic-form__file-input\"\r\n [id]=\"fieldId(i)\"\r\n [accept]=\"acceptFor(q)\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (change)=\"onFiles(q, imgRef)\" />\r\n @if (fileNames(q).length) {\r\n <ul class=\"fly-dynamic-form__file-list\">\r\n @for (name of fileNames(q); track name) { <li>{{ name }}</li> }\r\n </ul>\r\n }\r\n </div>\r\n }\r\n @case ('MultiFile') {\r\n <div class=\"fly-dynamic-form__file\">\r\n <input\r\n #multiRef\r\n type=\"file\"\r\n multiple\r\n class=\"fly-dynamic-form__file-input\"\r\n [id]=\"fieldId(i)\"\r\n [accept]=\"acceptFor(q)\"\r\n [attr.aria-required]=\"q.required || null\"\r\n [attr.aria-invalid]=\"showError(q) || null\"\r\n [attr.aria-describedby]=\"describedBy(q, i)\"\r\n [disabled]=\"isReadonly()\"\r\n (change)=\"onFiles(q, multiRef)\" />\r\n @if (fileNames(q).length) {\r\n <ul class=\"fly-dynamic-form__file-list\">\r\n @for (name of fileNames(q); track name) { <li>{{ name }}</li> }\r\n </ul>\r\n }\r\n </div>\r\n }\r\n }\r\n\r\n @if (showError(q)) {\r\n <p class=\"fly-dynamic-form__error\" [id]=\"errId(i)\" role=\"alert\">\r\n {{ 'form.required_error' | translate }}\r\n </p>\r\n }\r\n @if (fileError(q)) {\r\n <p class=\"fly-dynamic-form__error\" role=\"alert\">{{ fileError(q) }}</p>\r\n }\r\n }\r\n </div>\r\n </ng-template>\r\n\r\n @if (definition().declaration; as decl) {\r\n <div class=\"fly-dynamic-form__declaration\">\r\n <p class=\"fly-dynamic-form__declaration-text\">{{ decl }}</p>\r\n @if (!isReadonly()) {\r\n <label class=\"fly-dynamic-form__option\">\r\n <input\r\n type=\"checkbox\"\r\n [checked]=\"declarationAccepted()\"\r\n (change)=\"onDeclarationToggle($any($event.target).checked)\" />\r\n <span class=\"fly-dynamic-form__option-label\">{{ 'form.declaration_accept' | translate }}</span>\r\n </label>\r\n }\r\n </div>\r\n }\r\n\r\n @if (!isReadonly() && !hideSubmit()) {\r\n <div class=\"fly-dynamic-form__actions\">\r\n <button\r\n type=\"button\"\r\n class=\"fly-dynamic-form__submit\"\r\n [disabled]=\"!canSubmit()\"\r\n (click)=\"onSubmit()\">\r\n {{ 'form.submit' | translate }}\r\n </button>\r\n </div>\r\n }\r\n</div>\r\n","// ── fly-survey-form — backward-compatible re-export ──────────────────────────\r\n// `fly-survey-form` was promoted to the domain-agnostic `fly-dynamic-form`\r\n// (./dynamic-form.component.ts). That component carries BOTH selectors\r\n// (`fly-dynamic-form, fly-survey-form`), so every existing `<fly-survey-form>` binding\r\n// resolves to it unchanged, and it never sets `showScore`, so survey behaviour (no\r\n// option-score leakage) is identical. This alias keeps the historical\r\n// `FlySurveyFormComponent` symbol importable.\r\nexport { FlyDynamicFormComponent as FlySurveyFormComponent } from './dynamic-form.component';\r\n\r\n// ── fly-survey-form — backward-compatible type aliases ───────────────────────\r\n// The survey form contract was generalised into the domain-agnostic\r\n// `fly-dynamic-form` (see ./dynamic-form.types.ts). These aliases keep\r\n// every existing `FlySurveyForm*` import compiling and behaving identically — they\r\n// are the SAME types under the old names. New code should import the `FlyForm*`\r\n// names from the dynamic-form contract directly.\r\n\r\nexport type {\r\n FlyFormQuestionType as FlySurveyQuestionType,\r\n FlyFormOption as FlySurveyFormOption,\r\n FlyFormFieldOptions as FlySurveyFormFieldOptions,\r\n FlyFormQuestion as FlySurveyFormQuestion,\r\n FlyFormDefinition as FlySurveyFormDefinition,\r\n FlyFormAnswerValue as FlySurveyFormAnswerValue,\r\n FlyFormAnswer as FlySurveyFormAnswer,\r\n FlyFileSelection as FlySurveyFileSelection,\r\n} from './dynamic-form.types';\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n signal,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport type {\r\n FlyComment,\r\n FlyCommentPage,\r\n FlyCommentReportReason,\r\n} from './comment-thread.types';\r\n\r\n/** Process-wide counter so every instance owns unique element ids (`<label for>` ↔ control, dialogs). */\r\nlet _flyCommentThreadUid = 0;\r\n\r\n/** The six typed report reasons — mirrors the backend `CommentReportReason` enum, member names frozen. */\r\nconst REPORT_REASONS: readonly FlyCommentReportReason[] = [\r\n 'Spam',\r\n 'Harassment',\r\n 'OffTopic',\r\n 'Misinformation',\r\n 'Inappropriate',\r\n 'Other',\r\n];\r\n\r\n/** Sentinel key for the root-level composer draft in the per-parent draft map (never collides — comment ids are Guids). */\r\nconst ROOT_DRAFT_KEY = '__root__';\r\n\r\n/**\r\n * **`fly-comment-thread`** — the design-system generic threaded-comments renderer.\r\n *\r\n * Renders a {@link FlyCommentPage} (root comments) plus lazily-fetched nested\r\n * reply pages into an accessible, theme-aware thread: reply composer, inline\r\n * edit, soft-delete (tombstone render), typed report-with-reason dialog, and\r\n * moderator affordances (lock/unlock, delete-any). It is a platform surface —\r\n * transport-agnostic like `fly-survey-form` / `fly-dynamic-form`: this component\r\n * never calls an API. It only renders the pages the host hands it via\r\n * `[rootPage]` / `[repliesByParent]` and emits typed requests\r\n * (`loadReplies`/`loadMore`/`submit`/`edit`/`delete`/`report`/`lockToggle`) —\r\n * the host owns HTTP, optimistic-insert reconciliation, and any live-update\r\n * channel (SignalR, polling, …).\r\n *\r\n * Nested replies are fetched **lazily on expand** (`loadReplies`, never an\r\n * eager load-all) — the explicit fix for the legacy unpaged-children scale bug\r\n * — and each level pages independently via `loadMore`.\r\n *\r\n * i18n is self-sufficient through the `comment.*` keys in `DS_BASELINE_LOCALES`\r\n * (en/ar/fr/ur), overridable by any consumer key of the same name. RTL works via\r\n * logical CSS. Styling uses DS theme tokens (`--surface-*`, `--label-*`,\r\n * `--separator`, `--fill-*`, `--accent`, `--system-*`) with light-neutral\r\n * fallbacks so it stays readable even in a consumer that hasn't mapped them.\r\n *\r\n * @example\r\n * ```html\r\n * <fly-comment-thread\r\n * [rootPage]=\"rootPage()\"\r\n * [repliesByParent]=\"repliesByParent()\"\r\n * [currentUserId]=\"me.id\"\r\n * [canModerateThread]=\"canModerate()\"\r\n * [isLocked]=\"thread().isLocked\"\r\n * (loadReplies)=\"onLoadReplies($event)\"\r\n * (loadMore)=\"onLoadMore($event)\"\r\n * (submit)=\"onSubmit($event)\"\r\n * (edit)=\"onEdit($event)\"\r\n * (delete)=\"onDelete($event)\"\r\n * (report)=\"onReport($event)\"\r\n * (lockToggle)=\"onLockToggle($event)\" />\r\n * ```\r\n */\r\n@Component({\r\n selector: 'fly-comment-thread',\r\n standalone: true,\r\n imports: [CommonModule, FormsModule, TranslatePipe],\r\n templateUrl: './comment-thread.component.html',\r\n styleUrl: './comment-thread.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'fly-comment-thread',\r\n '[class.fly-comment-thread--locked]': 'isLocked()',\r\n '[class.fly-comment-thread--readonly]': 'isReadonly()',\r\n },\r\n})\r\nexport class FlyCommentThreadComponent {\r\n // ── Inputs ───────────────────────────────────────────────────────────────────\r\n /** The root-level comment page (accumulated across `loadMore` calls by the host). */\r\n readonly rootPage = input.required<FlyCommentPage>();\r\n /**\r\n * Accumulated reply page per expanded parent (keyed by `parentCommentId`), also\r\n * accumulated across `loadMore` calls by the host. Additive to the frozen\r\n * contract's `rootPage` input — required because a lazily-nested tree has no\r\n * other channel to carry fetched reply data back into the component.\r\n */\r\n readonly repliesByParent = input<Readonly<Record<string, FlyCommentPage>>>({});\r\n /** Current sort order label (host owns re-fetch on {@link sortChange}; purely descriptive here otherwise). */\r\n readonly sort = input<'newest' | 'oldest'>('newest');\r\n /** Locked threads disable the composer (root + reply) entirely, for every user. */\r\n readonly isLocked = input(false);\r\n /** The signed-in user's id — gates the \"report\" affordance (can't report your own comment). */\r\n readonly currentUserId = input<string | null>(null);\r\n /** Replay / read-only mode — hides composer, reply, edit, delete, report, and lock affordances.\r\n * Aliased to `[readonly]` (the public binding); the class member avoids shadowing the\r\n * TypeScript `readonly` keyword. */\r\n // eslint-disable-next-line @angular-eslint/no-input-rename -- `[readonly]` is the intended public API\r\n readonly isReadonly = input(false, { alias: 'readonly' });\r\n /** Thread-scoped moderator permission (lock/unlock). Additive — distinct from the\r\n * per-comment `canModerate` flag, which gates delete-any on that specific comment. */\r\n readonly canModerateThread = input(false);\r\n\r\n // ── Outputs ──────────────────────────────────────────────────────────────────\r\n /** Expand a collapsed reply subtree — always page 1 of that parent. */\r\n readonly loadReplies = output<{ parentCommentId: string; page: number }>();\r\n /** Fetch the next page at a level: root when `parentCommentId` is omitted, else that parent's replies. */\r\n readonly loadMore = output<{ parentCommentId?: string; page: number }>();\r\n /** A new root comment (`parentCommentId` omitted) or reply. */\r\n // eslint-disable-next-line @angular-eslint/no-output-native -- `(submit)` is the intended public API name\r\n readonly submit = output<{ body: string; parentCommentId?: string }>();\r\n /** Author-only body edit of an existing comment. */\r\n readonly edit = output<{ commentId: string; body: string }>();\r\n /** Soft delete (tombstone) — author's own comment, or any comment for a moderator. */\r\n readonly delete = output<{ commentId: string }>();\r\n /** Typed report submission. */\r\n readonly report = output<{ commentId: string; reason: FlyCommentReportReason; detail?: string }>();\r\n /** Moderator lock/unlock of the whole thread. */\r\n readonly lockToggle = output<{ locked: boolean }>();\r\n /** Additive: a sort-order pick from the header control — the host re-fetches page 1 in that order. */\r\n readonly sortChange = output<'newest' | 'oldest'>();\r\n\r\n // ── Identity ─────────────────────────────────────────────────────────────────\r\n private readonly _base = `fly-comment-thread-${++_flyCommentThreadUid}`;\r\n readonly reportReasons: readonly FlyCommentReportReason[] = REPORT_REASONS;\r\n\r\n // ── State (signals) ──────────────────────────────────────────────────────────\r\n /** commentIds whose reply subtree is currently expanded/visible. */\r\n private readonly _expanded = signal<Set<string>>(new Set());\r\n /** Composer draft text, keyed by parentCommentId (root uses {@link ROOT_DRAFT_KEY}). */\r\n private readonly _drafts = signal<Map<string, string>>(new Map());\r\n /** commentIds whose reply composer box is currently open (distinct from `_expanded`, which toggles the read view). */\r\n private readonly _replyBoxOpen = signal<Set<string>>(new Set());\r\n private readonly _editingId = signal<string | null>(null);\r\n private readonly _editDraft = signal('');\r\n private readonly _confirmingDeleteId = signal<string | null>(null);\r\n private readonly _reportingId = signal<string | null>(null);\r\n private readonly _reportReason = signal<FlyCommentReportReason | null>(null);\r\n private readonly _reportDetail = signal('');\r\n\r\n readonly rootDraft = computed(() => this._drafts().get(ROOT_DRAFT_KEY) ?? '');\r\n readonly editingId = this._editingId.asReadonly();\r\n readonly confirmingDeleteId = this._confirmingDeleteId.asReadonly();\r\n readonly reportingId = this._reportingId.asReadonly();\r\n readonly reportReason = this._reportReason.asReadonly();\r\n readonly reportDetail = this._reportDetail.asReadonly();\r\n\r\n // ── Template helpers ───────────────────────────────────────────────────────────\r\n fieldId(suffix: string): string {\r\n return `${this._base}-${suffix}`;\r\n }\r\n\r\n isExpanded(commentId: string): boolean {\r\n return this._expanded().has(commentId);\r\n }\r\n\r\n isReplyBoxOpen(commentId: string): boolean {\r\n return this._replyBoxOpen().has(commentId);\r\n }\r\n\r\n repliesFor(commentId: string): FlyCommentPage | undefined {\r\n return this.repliesByParent()[commentId];\r\n }\r\n\r\n replyDraft(commentId: string): string {\r\n return this._drafts().get(commentId) ?? '';\r\n }\r\n\r\n isOwn(comment: FlyComment): boolean {\r\n const me = this.currentUserId();\r\n return !!me && me === comment.authorUserId;\r\n }\r\n\r\n canReport(comment: FlyComment): boolean {\r\n return !this.isReadonly() && !comment.isDeleted && !this.isOwn(comment) && !!this.currentUserId();\r\n }\r\n\r\n canReply(): boolean {\r\n return !this.isReadonly() && !this.isLocked();\r\n }\r\n\r\n canDeleteComment(comment: FlyComment): boolean {\r\n return !this.isReadonly() && !comment.isDeleted && (comment.canDelete || comment.canModerate);\r\n }\r\n\r\n canEditComment(comment: FlyComment): boolean {\r\n return !this.isReadonly() && !comment.isDeleted && comment.canEdit;\r\n }\r\n\r\n formatDate(iso: string): string {\r\n const d = new Date(iso);\r\n return Number.isNaN(d.getTime()) ? '' : d.toLocaleString();\r\n }\r\n\r\n // ── Root composer ────────────────────────────────────────────────────────────\r\n onRootDraftChange(value: string): void {\r\n this._setDraft(ROOT_DRAFT_KEY, value);\r\n }\r\n\r\n submitRoot(): void {\r\n const body = this.rootDraft().trim();\r\n if (!body || !this.canReply()) return;\r\n this.submit.emit({ body });\r\n this._setDraft(ROOT_DRAFT_KEY, '');\r\n }\r\n\r\n // ── Expand / paging ──────────────────────────────────────────────────────────\r\n toggleReplies(comment: FlyComment): void {\r\n if (this.isExpanded(comment.id)) {\r\n const expanded = new Set(this._expanded());\r\n expanded.delete(comment.id);\r\n this._expanded.set(expanded);\r\n return;\r\n }\r\n this._expand(comment.id);\r\n }\r\n\r\n private _expand(commentId: string): void {\r\n const expanded = new Set(this._expanded());\r\n expanded.add(commentId);\r\n this._expanded.set(expanded);\r\n if (!this.repliesFor(commentId)) {\r\n this.loadReplies.emit({ parentCommentId: commentId, page: 1 });\r\n }\r\n }\r\n\r\n loadMoreRoot(): void {\r\n const next = this.rootPage().page + 1;\r\n this.loadMore.emit({ page: next });\r\n }\r\n\r\n loadMoreReplies(parentId: string): void {\r\n const current = this.repliesFor(parentId);\r\n const next = (current?.page ?? 0) + 1;\r\n this.loadMore.emit({ parentCommentId: parentId, page: next });\r\n }\r\n\r\n // ── Reply composer ───────────────────────────────────────────────────────────\r\n openReplyBox(commentId: string): void {\r\n if (!this.canReply()) return;\r\n const set = new Set(this._replyBoxOpen());\r\n set.add(commentId);\r\n this._replyBoxOpen.set(set);\r\n }\r\n\r\n closeReplyBox(commentId: string): void {\r\n const set = new Set(this._replyBoxOpen());\r\n set.delete(commentId);\r\n this._replyBoxOpen.set(set);\r\n this._setDraft(commentId, '');\r\n }\r\n\r\n onReplyDraftChange(commentId: string, value: string): void {\r\n this._setDraft(commentId, value);\r\n }\r\n\r\n submitReply(commentId: string): void {\r\n const body = this.replyDraft(commentId).trim();\r\n if (!body || !this.canReply()) return;\r\n this.submit.emit({ body, parentCommentId: commentId });\r\n this.closeReplyBox(commentId);\r\n // Ensure the subtree is visible so the (host-reconciled) new reply is seen once it lands.\r\n if (!this.isExpanded(commentId)) this._expand(commentId);\r\n }\r\n\r\n // ── Edit ─────────────────────────────────────────────────────────────────────\r\n startEdit(comment: FlyComment): void {\r\n if (!this.canEditComment(comment)) return;\r\n this._editingId.set(comment.id);\r\n this._editDraft.set(comment.body);\r\n }\r\n\r\n onEditDraftChange(value: string): void {\r\n this._editDraft.set(value);\r\n }\r\n\r\n saveEdit(comment: FlyComment): void {\r\n const body = this._editDraft().trim();\r\n if (!body) return;\r\n if (body !== comment.body) this.edit.emit({ commentId: comment.id, body });\r\n this._editingId.set(null);\r\n }\r\n\r\n cancelEdit(): void {\r\n this._editingId.set(null);\r\n }\r\n\r\n // ── Delete ───────────────────────────────────────────────────────────────────\r\n requestDelete(comment: FlyComment): void {\r\n if (!this.canDeleteComment(comment)) return;\r\n this._confirmingDeleteId.set(comment.id);\r\n }\r\n\r\n confirmDelete(comment: FlyComment): void {\r\n this.delete.emit({ commentId: comment.id });\r\n this._confirmingDeleteId.set(null);\r\n }\r\n\r\n cancelDelete(): void {\r\n this._confirmingDeleteId.set(null);\r\n }\r\n\r\n // ── Report ───────────────────────────────────────────────────────────────────\r\n openReport(comment: FlyComment): void {\r\n if (!this.canReport(comment)) return;\r\n this._reportingId.set(comment.id);\r\n this._reportReason.set(null);\r\n this._reportDetail.set('');\r\n }\r\n\r\n onReportReasonChange(reason: FlyCommentReportReason): void {\r\n this._reportReason.set(reason);\r\n }\r\n\r\n onReportDetailChange(value: string): void {\r\n this._reportDetail.set(value);\r\n }\r\n\r\n submitReport(): void {\r\n const commentId = this._reportingId();\r\n const reason = this._reportReason();\r\n if (!commentId || !reason) return;\r\n const detail = this._reportDetail().trim();\r\n this.report.emit({ commentId, reason, detail: detail || undefined });\r\n this.closeReport();\r\n }\r\n\r\n closeReport(): void {\r\n this._reportingId.set(null);\r\n this._reportReason.set(null);\r\n this._reportDetail.set('');\r\n }\r\n\r\n /** Space would otherwise scroll the page while the backdrop (role=\"button\") is focused. */\r\n onOverlayBackdropSpace(event: Event): void {\r\n event.preventDefault();\r\n this.closeReport();\r\n }\r\n\r\n // ── Moderation ───────────────────────────────────────────────────────────────\r\n toggleLock(): void {\r\n if (!this.canModerateThread()) return;\r\n this.lockToggle.emit({ locked: !this.isLocked() });\r\n }\r\n\r\n // ── Sort ─────────────────────────────────────────────────────────────────────\r\n onSortPick(next: 'newest' | 'oldest'): void {\r\n if (next === this.sort()) return;\r\n this.sortChange.emit(next);\r\n }\r\n\r\n // ── Internals ──────────────────────────────────────────────────────────────────\r\n private _setDraft(key: string, value: string): void {\r\n const map = new Map(this._drafts());\r\n if (value) map.set(key, value);\r\n else map.delete(key);\r\n this._drafts.set(map);\r\n }\r\n}\r\n","<div class=\"fly-comment-thread__body\">\r\n <!-- ── Header: count + sort + lock toggle ── -->\r\n <header class=\"fly-comment-thread__header\">\r\n <span class=\"fly-comment-thread__count\">\r\n {{ 'comment.count' | translate: { n: rootPage().total } }}\r\n </span>\r\n\r\n <div class=\"fly-comment-thread__header-actions\">\r\n <div class=\"fly-comment-thread__sort\" role=\"group\" [attr.aria-label]=\"'comment.sort_label' | translate\">\r\n <button\r\n type=\"button\"\r\n class=\"fly-comment-thread__sort-btn\"\r\n [class.fly-comment-thread__sort-btn--active]=\"sort() === 'newest'\"\r\n (click)=\"onSortPick('newest')\">\r\n {{ 'comment.sort_newest' | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"fly-comment-thread__sort-btn\"\r\n [class.fly-comment-thread__sort-btn--active]=\"sort() === 'oldest'\"\r\n (click)=\"onSortPick('oldest')\">\r\n {{ 'comment.sort_oldest' | translate }}\r\n </button>\r\n </div>\r\n\r\n @if (canModerateThread() && !isReadonly()) {\r\n <button type=\"button\" class=\"fly-comment-thread__lock-btn\" (click)=\"toggleLock()\">\r\n {{ (isLocked() ? 'comment.unlock' : 'comment.lock') | translate }}\r\n </button>\r\n }\r\n </div>\r\n </header>\r\n\r\n @if (isLocked()) {\r\n <p class=\"fly-comment-thread__locked-notice\">{{ 'comment.locked_notice' | translate }}</p>\r\n }\r\n\r\n <!-- ── Root composer ── -->\r\n @if (canReply()) {\r\n <div class=\"fly-comment-thread__composer\">\r\n <textarea\r\n class=\"fly-comment-thread__textarea\"\r\n rows=\"3\"\r\n [id]=\"fieldId('root-composer')\"\r\n [attr.aria-label]=\"'comment.composer_placeholder' | translate\"\r\n [placeholder]=\"'comment.composer_placeholder' | translate\"\r\n [ngModel]=\"rootDraft()\"\r\n (ngModelChange)=\"onRootDraftChange($event)\"></textarea>\r\n <div class=\"fly-comment-thread__composer-actions\">\r\n <button\r\n type=\"button\"\r\n class=\"fly-comment-thread__submit-btn\"\r\n [disabled]=\"!rootDraft().trim()\"\r\n (click)=\"submitRoot()\">\r\n {{ 'comment.post' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n\r\n <!-- ── Root comments ── -->\r\n @if (rootPage().items.length === 0) {\r\n <p class=\"fly-comment-thread__empty\">{{ 'comment.empty' | translate }}</p>\r\n } @else {\r\n <ul class=\"fly-comment-thread__list\" role=\"list\">\r\n @for (c of rootPage().items; track c.id) {\r\n <ng-container [ngTemplateOutlet]=\"commentNode\" [ngTemplateOutletContext]=\"{ $implicit: c }\"></ng-container>\r\n }\r\n </ul>\r\n\r\n @if (rootPage().hasMore) {\r\n <button type=\"button\" class=\"fly-comment-thread__load-more\" (click)=\"loadMoreRoot()\">\r\n {{ 'comment.load_more' | translate }}\r\n </button>\r\n }\r\n }\r\n</div>\r\n\r\n<!-- ── Recursive comment node template ── -->\r\n<ng-template #commentNode let-comment>\r\n <li class=\"fly-comment-thread__item\" [attr.data-depth]=\"comment.depth\">\r\n <div class=\"fly-comment-thread__row\">\r\n <div class=\"fly-comment-thread__avatar\" aria-hidden=\"true\">\r\n @if (comment.authorAvatarUrl) {\r\n <img [src]=\"comment.authorAvatarUrl\" alt=\"\" />\r\n } @else {\r\n <span class=\"fly-comment-thread__avatar-fallback\">{{ (comment.authorDisplayName || comment.authorUserId)[0] }}</span>\r\n }\r\n </div>\r\n\r\n <div class=\"fly-comment-thread__content\">\r\n <div class=\"fly-comment-thread__meta\">\r\n <span class=\"fly-comment-thread__author\">{{ comment.authorDisplayName || comment.authorUserId }}</span>\r\n <span class=\"fly-comment-thread__timestamp\">{{ formatDate(comment.createdAt) }}</span>\r\n @if (comment.isEdited && !comment.isDeleted) {\r\n <span class=\"fly-comment-thread__edited\">{{ 'comment.edited' | translate }}</span>\r\n }\r\n </div>\r\n\r\n @if (comment.isDeleted) {\r\n <p class=\"fly-comment-thread__tombstone\">{{ 'comment.deleted' | translate }}</p>\r\n } @else if (editingId() === comment.id) {\r\n <div class=\"fly-comment-thread__edit-box\">\r\n <textarea\r\n class=\"fly-comment-thread__textarea\"\r\n rows=\"3\"\r\n [ngModel]=\"comment.body\"\r\n (ngModelChange)=\"onEditDraftChange($event)\"></textarea>\r\n <div class=\"fly-comment-thread__composer-actions\">\r\n <button type=\"button\" class=\"fly-comment-thread__cancel-btn\" (click)=\"cancelEdit()\">\r\n {{ 'common.action.cancel' | translate }}\r\n </button>\r\n <button type=\"button\" class=\"fly-comment-thread__submit-btn\" (click)=\"saveEdit(comment)\">\r\n {{ 'comment.save' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n } @else {\r\n <p class=\"fly-comment-thread__text\">{{ comment.body }}</p>\r\n }\r\n\r\n @if (!isReadonly() && !comment.isDeleted && editingId() !== comment.id) {\r\n <div class=\"fly-comment-thread__actions\">\r\n @if (canReply()) {\r\n <button type=\"button\" class=\"fly-comment-thread__action-btn\" (click)=\"openReplyBox(comment.id)\">\r\n {{ 'comment.reply' | translate }}\r\n </button>\r\n }\r\n @if (canEditComment(comment)) {\r\n <button type=\"button\" class=\"fly-comment-thread__action-btn\" (click)=\"startEdit(comment)\">\r\n {{ 'comment.edit' | translate }}\r\n </button>\r\n }\r\n @if (canDeleteComment(comment)) {\r\n <button type=\"button\" class=\"fly-comment-thread__action-btn fly-comment-thread__action-btn--danger\" (click)=\"requestDelete(comment)\">\r\n {{ 'comment.delete' | translate }}\r\n </button>\r\n }\r\n @if (canReport(comment)) {\r\n <button type=\"button\" class=\"fly-comment-thread__action-btn\" (click)=\"openReport(comment)\">\r\n {{ 'comment.report' | translate }}\r\n </button>\r\n }\r\n </div>\r\n }\r\n\r\n @if (confirmingDeleteId() === comment.id) {\r\n <div class=\"fly-comment-thread__confirm\">\r\n <span>{{ 'comment.delete_confirm' | translate }}</span>\r\n <button type=\"button\" class=\"fly-comment-thread__cancel-btn\" (click)=\"cancelDelete()\">\r\n {{ 'common.action.cancel' | translate }}\r\n </button>\r\n <button type=\"button\" class=\"fly-comment-thread__danger-btn\" (click)=\"confirmDelete(comment)\">\r\n {{ 'comment.delete' | translate }}\r\n </button>\r\n </div>\r\n }\r\n\r\n @if (isReplyBoxOpen(comment.id)) {\r\n <div class=\"fly-comment-thread__composer fly-comment-thread__composer--reply\">\r\n <textarea\r\n class=\"fly-comment-thread__textarea\"\r\n rows=\"2\"\r\n [attr.aria-label]=\"'comment.reply_placeholder' | translate\"\r\n [placeholder]=\"'comment.reply_placeholder' | translate\"\r\n [ngModel]=\"replyDraft(comment.id)\"\r\n (ngModelChange)=\"onReplyDraftChange(comment.id, $event)\"></textarea>\r\n <div class=\"fly-comment-thread__composer-actions\">\r\n <button type=\"button\" class=\"fly-comment-thread__cancel-btn\" (click)=\"closeReplyBox(comment.id)\">\r\n {{ 'common.action.cancel' | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"fly-comment-thread__submit-btn\"\r\n [disabled]=\"!replyDraft(comment.id).trim()\"\r\n (click)=\"submitReply(comment.id)\">\r\n {{ 'comment.post' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n }\r\n\r\n @if (comment.replyCount > 0) {\r\n <button type=\"button\" class=\"fly-comment-thread__toggle-replies\" (click)=\"toggleReplies(comment)\">\r\n {{ (isExpanded(comment.id) ? 'comment.hide_replies' : 'comment.show_replies') | translate: { n: comment.replyCount } }}\r\n </button>\r\n }\r\n\r\n @if (isExpanded(comment.id)) {\r\n <ul class=\"fly-comment-thread__list fly-comment-thread__list--nested\" role=\"list\">\r\n @for (child of repliesFor(comment.id)?.items ?? []; track child.id) {\r\n <ng-container [ngTemplateOutlet]=\"commentNode\" [ngTemplateOutletContext]=\"{ $implicit: child }\"></ng-container>\r\n }\r\n </ul>\r\n @if (repliesFor(comment.id)?.hasMore) {\r\n <button type=\"button\" class=\"fly-comment-thread__load-more fly-comment-thread__load-more--nested\" (click)=\"loadMoreReplies(comment.id)\">\r\n {{ 'comment.load_more' | translate }}\r\n </button>\r\n }\r\n }\r\n </div>\r\n </div>\r\n </li>\r\n</ng-template>\r\n\r\n<!-- ── Report dialog ── -->\r\n@if (reportingId()) {\r\n <div class=\"fly-comment-thread__overlay\">\r\n <div class=\"fly-comment-thread__overlay-backdrop\" role=\"button\" tabindex=\"0\"\r\n [attr.aria-label]=\"'common.action.cancel' | translate\"\r\n (click)=\"closeReport()\"\r\n (keydown.enter)=\"closeReport()\"\r\n (keydown.space)=\"onOverlayBackdropSpace($event)\"></div>\r\n <div class=\"fly-comment-thread__dialog\" role=\"dialog\" [attr.aria-label]=\"'comment.report_title' | translate\">\r\n <h3 class=\"fly-comment-thread__dialog-title\">{{ 'comment.report_title' | translate }}</h3>\r\n\r\n <fieldset class=\"fly-comment-thread__reason-group\">\r\n <legend>{{ 'comment.report_reason_label' | translate }}</legend>\r\n @for (reason of reportReasons; track reason) {\r\n <label class=\"fly-comment-thread__reason-option\">\r\n <input\r\n type=\"radio\"\r\n name=\"fly-comment-report-reason\"\r\n [value]=\"reason\"\r\n [checked]=\"reportReason() === reason\"\r\n (change)=\"onReportReasonChange(reason)\" />\r\n <span>{{ 'comment.reason.' + reason | translate }}</span>\r\n </label>\r\n }\r\n </fieldset>\r\n\r\n <textarea\r\n class=\"fly-comment-thread__textarea\"\r\n rows=\"3\"\r\n [attr.aria-label]=\"'comment.report_detail_label' | translate\"\r\n [placeholder]=\"'comment.report_detail_label' | translate\"\r\n [ngModel]=\"reportDetail()\"\r\n (ngModelChange)=\"onReportDetailChange($event)\"></textarea>\r\n\r\n <div class=\"fly-comment-thread__composer-actions\">\r\n <button type=\"button\" class=\"fly-comment-thread__cancel-btn\" (click)=\"closeReport()\">\r\n {{ 'common.action.cancel' | translate }}\r\n </button>\r\n <button type=\"button\" class=\"fly-comment-thread__submit-btn\" [disabled]=\"!reportReason()\" (click)=\"submitReport()\">\r\n {{ 'comment.report_submit' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n","// ── Vendored synchronous SHA-256 (FIPS 180-4) ────────────────────────────────\r\n// Why this exists: `fly-captcha`'s PoW solver must brute-force up to\r\n// `DefaultMaxNumber` (see `Fly.Sdk.Captcha.CaptchaOptions`) SHA-256 hashes in\r\n// the browser. The obvious approach — `await crypto.subtle.digest(...)` per\r\n// candidate — pays real per-call promise/microtask overhead (structured\r\n// scheduling, not raw hashing) that dominates at tens of thousands of calls,\r\n// making even a moderate difficulty take tens of seconds. A synchronous,\r\n// in-process implementation lets the solver hash the entire candidate space in\r\n// a tight loop with zero per-candidate async overhead, then yield to\r\n// `requestAnimationFrame` only between chunks (not between candidates) to stay\r\n// responsive.\r\n//\r\n// This is a small, self-contained, dependency-free implementation — no\r\n// third-party/CDN crypto library (per repo policy: no external CDNs, vendor\r\n// everything). It is deliberately narrow: it only ever hashes short UTF-8\r\n// strings (`salt + number`, at most a few dozen bytes), so the 32-bit message\r\n// length field is never at risk of overflowing.\r\n//\r\n// Contract: `sha256HexSync(s)` MUST produce byte-for-byte the same lowercase\r\n// hex string as `await crypto.subtle.digest('SHA-256', utf8(s))` and as the\r\n// backend's `Convert.ToHexStringLower(SHA256.HashData(utf8(s)))`\r\n// (`Fly.Sdk.Captcha.CaptchaHashing.ComputeChallenge`) — verified by\r\n// `sha256.spec.ts` against the standard NIST test vectors, against\r\n// `crypto.subtle`, and (transitively, via the shared `captcha.component.spec.ts`\r\n// fixtures) against real challenges shaped like the backend issues them.\r\n\r\nconst H_INIT = new Int32Array([\r\n 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,\r\n]);\r\n\r\nconst K = new Int32Array([\r\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,\r\n 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,\r\n 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\r\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,\r\n 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,\r\n 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\r\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,\r\n 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\r\n]);\r\n\r\nfunction rotr(x: number, n: number): number {\r\n return (x >>> n) | (x << (32 - n));\r\n}\r\n\r\n/** Pads `data` to a multiple of 64 bytes per FIPS 180-4 §5.1.1 (single-block-count length field —\r\n * fine for the short strings this module ever hashes). */\r\nfunction pad(data: Uint8Array): Uint8Array {\r\n const bitLenLo = data.length * 8;\r\n const padLen = (56 - ((data.length + 1) % 64) + 64) % 64;\r\n const out = new Uint8Array(data.length + 1 + padLen + 8);\r\n out.set(data, 0);\r\n out[data.length] = 0x80;\r\n const view = new DataView(out.buffer);\r\n view.setUint32(out.length - 4, bitLenLo >>> 0, false);\r\n return out;\r\n}\r\n\r\n// Reused scratch buffers. Safe to share across calls: `sha256()` runs to\r\n// completion synchronously (no `await`/yield inside it), so two invocations\r\n// can never interleave on JS's single thread.\r\nconst W = new Int32Array(64);\r\nconst H = new Int32Array(8);\r\n\r\n/** Synchronous SHA-256 over raw bytes, returning the 32-byte digest. */\r\nexport function sha256(data: Uint8Array): Uint8Array {\r\n const padded = pad(data);\r\n H.set(H_INIT);\r\n\r\n for (let offset = 0; offset < padded.length; offset += 64) {\r\n for (let i = 0; i < 16; i++) {\r\n W[i] =\r\n (padded[offset + i * 4] << 24) |\r\n (padded[offset + i * 4 + 1] << 16) |\r\n (padded[offset + i * 4 + 2] << 8) |\r\n padded[offset + i * 4 + 3];\r\n }\r\n for (let i = 16; i < 64; i++) {\r\n const s0 = rotr(W[i - 15], 7) ^ rotr(W[i - 15], 18) ^ (W[i - 15] >>> 3);\r\n const s1 = rotr(W[i - 2], 17) ^ rotr(W[i - 2], 19) ^ (W[i - 2] >>> 10);\r\n W[i] = (W[i - 16] + s0 + W[i - 7] + s1) | 0;\r\n }\r\n\r\n let a = H[0], b = H[1], c = H[2], d = H[3], e = H[4], f = H[5], g = H[6], hh = H[7];\r\n for (let i = 0; i < 64; i++) {\r\n const s1 = rotr(e, 6) ^ rotr(e, 11) ^ rotr(e, 25);\r\n const ch = (e & f) ^ (~e & g);\r\n const temp1 = (hh + s1 + ch + K[i] + W[i]) | 0;\r\n const s0 = rotr(a, 2) ^ rotr(a, 13) ^ rotr(a, 22);\r\n const maj = (a & b) ^ (a & c) ^ (b & c);\r\n const temp2 = (s0 + maj) | 0;\r\n\r\n hh = g;\r\n g = f;\r\n f = e;\r\n e = (d + temp1) | 0;\r\n d = c;\r\n c = b;\r\n b = a;\r\n a = (temp1 + temp2) | 0;\r\n }\r\n\r\n H[0] = (H[0] + a) | 0;\r\n H[1] = (H[1] + b) | 0;\r\n H[2] = (H[2] + c) | 0;\r\n H[3] = (H[3] + d) | 0;\r\n H[4] = (H[4] + e) | 0;\r\n H[5] = (H[5] + f) | 0;\r\n H[6] = (H[6] + g) | 0;\r\n H[7] = (H[7] + hh) | 0;\r\n }\r\n\r\n const out = new Uint8Array(32);\r\n const view = new DataView(out.buffer);\r\n for (let i = 0; i < 8; i++) view.setUint32(i * 4, H[i] >>> 0, false);\r\n return out;\r\n}\r\n\r\nconst HEX_TABLE = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));\r\n\r\n/**\r\n * Lowercase-hex SHA-256 of the UTF-8 bytes of `input`, computed synchronously —\r\n * the hot-path hash used by the `fly-captcha` solver loop. Byte-for-byte\r\n * identical to `Convert.ToHexStringLower(SHA256.HashData(...))` on the backend\r\n * and to `await crypto.subtle.digest('SHA-256', ...)` in the browser (see\r\n * `sha256.spec.ts`).\r\n */\r\nexport function sha256HexSync(input: string): string {\r\n const digest = sha256(new TextEncoder().encode(input));\r\n let hex = '';\r\n for (const b of digest) hex += HEX_TABLE[b];\r\n return hex;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n type OnDestroy,\r\n effect,\r\n forwardRef,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport type { FlyCaptchaChallenge, FlyCaptchaSolution, FlyCaptchaState } from './captcha.types';\r\nimport { sha256HexSync } from './sha256';\r\n\r\n/** Lowercase-hex SHA-256 of `input` via Web Crypto — matches `Convert.ToHexStringLower(SHA256…)`. */\r\nexport async function flyCaptchaSha256Hex(input: string): Promise<string> {\r\n const bytes = new TextEncoder().encode(input);\r\n const digest = await crypto.subtle.digest('SHA-256', bytes);\r\n const view = new Uint8Array(digest);\r\n let hex = '';\r\n for (const b of view) hex += b.toString(16).padStart(2, '0');\r\n return hex;\r\n}\r\n\r\n/** Standard base64 of the UTF-8 bytes of `s` — matches .NET `Convert.ToBase64String`. */\r\nexport function flyCaptchaBase64Utf8(s: string): string {\r\n const bytes = new TextEncoder().encode(s);\r\n let binary = '';\r\n for (const b of bytes) binary += String.fromCharCode(b);\r\n return btoa(binary);\r\n}\r\n\r\n/**\r\n * Builds the opaque base64 token the backend's `CaptchaSolution.FromToken` expects.\r\n * Exported so a host (or a test) can construct/verify the token shape without the\r\n * component.\r\n */\r\nexport function flyCaptchaBuildToken(solution: FlyCaptchaSolution): string {\r\n return flyCaptchaBase64Utf8(JSON.stringify(solution));\r\n}\r\n\r\n/**\r\n * **`fly-captcha`** — the design-system client for the self-hosted proof-of-work\r\n * captcha (`Fly.Sdk.Captcha`).\r\n *\r\n * Given a {@link FlyCaptchaChallenge}, it brute-forces `n` in `[0, maxNumber)`\r\n * until `sha256HexLower(salt + n) === challenge`, then emits the solution as the\r\n * base64 token the backend decodes ({@link flyCaptchaBuildToken}). The search\r\n * hashes candidates with a vendored **synchronous** SHA-256 ({@link sha256HexSync}\r\n * from `./sha256` — no `crypto.subtle`/promise overhead per candidate, which used\r\n * to dominate solve time), in chunks scheduled on `requestAnimationFrame` so a\r\n * chunk boundary still yields back to the browser between slices. It auto-starts\r\n * whenever the `[challenge]` input changes. Implements\r\n * {@link ControlValueAccessor} so it drops into a reactive form / `[(ngModel)]` —\r\n * the control value IS the token string.\r\n *\r\n * Expiry is the host's concern to refresh: the component checks `expiresAt` up\r\n * front and while solving, emits {@link expired}, and stops. i18n is\r\n * self-sufficient via the `captcha.*` baseline keys; RTL works via logical CSS.\r\n *\r\n * @example\r\n * ```html\r\n * <fly-captcha [challenge]=\"challenge()\" (solved)=\"post($event)\" (expired)=\"refresh()\" />\r\n * ```\r\n */\r\n@Component({\r\n selector: 'fly-captcha',\r\n standalone: true,\r\n imports: [CommonModule, TranslatePipe],\r\n templateUrl: './captcha.component.html',\r\n styleUrl: './captcha.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [\r\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => FlyCaptchaComponent), multi: true },\r\n ],\r\n host: {\r\n class: 'fly-captcha',\r\n '[class.fly-captcha--verified]': \"state() === 'verified'\",\r\n },\r\n})\r\nexport class FlyCaptchaComponent implements ControlValueAccessor, OnDestroy {\r\n // ── Inputs ───────────────────────────────────────────────────────────────────\r\n /** The challenge to solve. Setting (or replacing) it auto-starts a fresh solve. */\r\n readonly challenge = input<FlyCaptchaChallenge | null>(null);\r\n /** Candidates hashed synchronously in one slice before yielding back to the browser\r\n * on the next animation frame. Higher = fewer `requestAnimationFrame` hops (each\r\n * carries ~16ms of frame-boundary overhead), more synchronous work per slice.\r\n * 20,000 keeps a slice's own hashing time well under a long-task budget on modern\r\n * hardware (the vendored sync SHA-256 does several hundred thousand hashes/sec)\r\n * while needing only a handful of hops to clear the library's default difficulty. */\r\n readonly chunkSize = input(20_000);\r\n\r\n // ── Outputs ──────────────────────────────────────────────────────────────────\r\n /** The solution token once solved — the exact string to POST back to the backend. */\r\n readonly solved = output<string>();\r\n /** The challenge expired (up-front or mid-solve). The host should request a new one. */\r\n readonly expired = output<void>();\r\n\r\n // ── State ────────────────────────────────────────────────────────────────────\r\n readonly state = signal<FlyCaptchaState>('idle');\r\n readonly token = signal<string | null>(null);\r\n\r\n /** Monotonic generation — bumped on every restart/destroy so a stale async chunk\r\n * or timer that captured an older generation no-ops instead of racing. */\r\n private _gen = 0;\r\n private _raf: number | null = null;\r\n private _expiryTimer: ReturnType<typeof setTimeout> | null = null;\r\n\r\n private _onChange: (v: string | null) => void = () => {\r\n /* replaced by registerOnChange */\r\n };\r\n private _onTouched: () => void = () => {\r\n /* replaced by registerOnTouched */\r\n };\r\n\r\n constructor() {\r\n // Auto-(re)start whenever the challenge identity changes. Reads `challenge`\r\n // (tracked) and writes the distinct state/token signals — no self-retrigger.\r\n effect(() => {\r\n const ch = this.challenge();\r\n this._restart(ch);\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this._gen++;\r\n this._cancel();\r\n }\r\n\r\n // ── Solve lifecycle ────────────────────────────────────────────────────────────\r\n private _restart(ch: FlyCaptchaChallenge | null): void {\r\n this._cancel();\r\n const gen = ++this._gen;\r\n this.token.set(null);\r\n this._onChange(null);\r\n\r\n if (!ch) {\r\n this.state.set('idle');\r\n return;\r\n }\r\n\r\n const expiryMs = Date.parse(ch.expiresAt);\r\n if (Number.isFinite(expiryMs) && expiryMs <= Date.now()) {\r\n this.state.set('expired');\r\n this.expired.emit();\r\n return;\r\n }\r\n\r\n this.state.set('verifying');\r\n\r\n if (Number.isFinite(expiryMs)) {\r\n this._expiryTimer = setTimeout(\r\n () => {\r\n if (this._gen !== gen || this.state() !== 'verifying') return;\r\n this._cancel();\r\n this.state.set('expired');\r\n this.expired.emit();\r\n },\r\n Math.max(0, expiryMs - Date.now()),\r\n );\r\n }\r\n\r\n this._solveChunk(ch, 0, gen);\r\n }\r\n\r\n /**\r\n * Hashes `[start, end)` synchronously with {@link sha256HexSync} — no per-candidate\r\n * `await`, so there is no promise/microtask overhead between candidates — then\r\n * yields to the next animation frame for the remainder. Bails to `error` state if\r\n * hashing itself throws (defensive; a pure function over a short string should not)\r\n * or if the whole `[0, maxNumber)` space is exhausted with no match, which means the\r\n * challenge is corrupt or was tampered with.\r\n */\r\n private _solveChunk(ch: FlyCaptchaChallenge, start: number, gen: number): void {\r\n if (this._gen !== gen) return;\r\n\r\n const end = Math.min(start + Math.max(1, this.chunkSize()), ch.maxNumber);\r\n try {\r\n for (let n = start; n < end; n++) {\r\n if (sha256HexSync(ch.salt + n) === ch.challenge) {\r\n this._onSolved(ch, n, gen);\r\n return;\r\n }\r\n }\r\n } catch {\r\n this._cancel();\r\n this.state.set('error');\r\n return;\r\n }\r\n\r\n if (end >= ch.maxNumber) {\r\n // Searched the whole space with no match — the challenge is corrupt or tampered.\r\n this._cancel();\r\n this.state.set('error');\r\n return;\r\n }\r\n\r\n this._raf = this._schedule(() => this._solveChunk(ch, end, gen));\r\n }\r\n\r\n private _onSolved(ch: FlyCaptchaChallenge, n: number, gen: number): void {\r\n if (this._gen !== gen) return;\r\n this._cancel();\r\n\r\n const solution: FlyCaptchaSolution = {\r\n algorithm: ch.algorithm,\r\n challenge: ch.challenge,\r\n salt: ch.salt,\r\n number: n,\r\n signature: ch.signature,\r\n maxNumber: ch.maxNumber,\r\n expiresAt: ch.expiresAt,\r\n };\r\n const token = flyCaptchaBuildToken(solution);\r\n\r\n this.token.set(token);\r\n this.state.set('verified');\r\n this._onChange(token);\r\n this._onTouched();\r\n this.solved.emit(token);\r\n }\r\n\r\n private _cancel(): void {\r\n if (this._raf != null) {\r\n this._cancelSchedule(this._raf);\r\n this._raf = null;\r\n }\r\n if (this._expiryTimer != null) {\r\n clearTimeout(this._expiryTimer);\r\n this._expiryTimer = null;\r\n }\r\n }\r\n\r\n private _schedule(fn: () => void): number {\r\n if (typeof requestAnimationFrame === 'function') return requestAnimationFrame(fn);\r\n return setTimeout(fn, 0) as unknown as number;\r\n }\r\n\r\n private _cancelSchedule(id: number): void {\r\n if (typeof cancelAnimationFrame === 'function') cancelAnimationFrame(id);\r\n else clearTimeout(id as unknown as ReturnType<typeof setTimeout>);\r\n }\r\n\r\n // ── ControlValueAccessor ────────────────────────────────────────────────────────\r\n writeValue(value: string | null): void {\r\n // A host restoring a previously-solved token; reflect it as verified.\r\n this.token.set(value ?? null);\r\n if (value) this.state.set('verified');\r\n }\r\n\r\n registerOnChange(fn: (v: string | null) => void): void {\r\n this._onChange = fn;\r\n }\r\n\r\n registerOnTouched(fn: () => void): void {\r\n this._onTouched = fn;\r\n }\r\n}\r\n","<div class=\"fly-captcha__box\" role=\"group\" [attr.aria-label]=\"'captcha.label' | translate\">\r\n <div class=\"fly-captcha__status\" role=\"status\" aria-live=\"polite\">\r\n @switch (state()) {\r\n @case ('verifying') {\r\n <span class=\"fly-captcha__spinner\" aria-hidden=\"true\"></span>\r\n <span class=\"fly-captcha__text\">{{ 'captcha.verifying' | translate }}</span>\r\n }\r\n @case ('verified') {\r\n <span class=\"fly-captcha__check\" aria-hidden=\"true\">✓</span>\r\n <span class=\"fly-captcha__text fly-captcha__text--ok\">{{ 'captcha.verified' | translate }}</span>\r\n }\r\n @case ('expired') {\r\n <span class=\"fly-captcha__icon\" aria-hidden=\"true\">⚠</span>\r\n <span class=\"fly-captcha__text fly-captcha__text--warn\">{{ 'captcha.expired' | translate }}</span>\r\n }\r\n @case ('error') {\r\n <span class=\"fly-captcha__icon\" aria-hidden=\"true\">⚠</span>\r\n <span class=\"fly-captcha__text fly-captcha__text--warn\">{{ 'captcha.error' | translate }}</span>\r\n }\r\n @default {\r\n <span class=\"fly-captcha__text fly-captcha__text--muted\">{{ 'captcha.idle' | translate }}</span>\r\n }\r\n }\r\n </div>\r\n</div>\r\n","import { Injectable, Signal, computed, signal } from '@angular/core';\r\nimport type {\r\n AgentCommandHandle,\r\n AgentCommandRegistration,\r\n} from '../../models/agent-input.model';\r\n\r\n/**\r\n * Singleton registry of slash commands offered by the agent input palette.\r\n *\r\n * Lives in the DS so it crosses the federation boundary as a single instance via\r\n * `sharedMappings: ['@flyos/design-system']`. Federated remotes register\r\n * their commands at boot (and dispose on window close) without forking the shell.\r\n *\r\n * Storage is a signal store. `register` is O(1) for the unique-id case and O(n) when\r\n * replacing an existing id (filter then push). The append-then-replace strategy is\r\n * deliberate: registrations are rare (each one corresponds to a remote's app-init\r\n * effect), and the tradeoff buys us a stable id-collision contract — the *latest*\r\n * registration wins, and the previous handle's `dispose()` becomes a no-op rather\r\n * than removing the new entry.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class AgentCommandRegistry {\r\n private readonly _commands = signal<readonly AgentCommandRegistration[]>([]);\r\n /** All currently-registered commands, in insertion order. */\r\n readonly all: Signal<readonly AgentCommandRegistration[]> = this._commands.asReadonly();\r\n\r\n /**\r\n * Returns a signal of commands whose scope is `'global'` OR whose `scope.appId` is in\r\n * the live app set. The signal recomputes when either the registry or `liveAppIds`\r\n * changes — pass a `Signal<ReadonlySet<string>>` from the host's app-registry service\r\n * for reactive filtering.\r\n */\r\n visible(liveAppIds: ReadonlySet<string> | Signal<ReadonlySet<string>>): Signal<readonly AgentCommandRegistration[]> {\r\n const liveSignal = isSignal<ReadonlySet<string>>(liveAppIds) ? liveAppIds : signal(liveAppIds).asReadonly();\r\n return computed(() => {\r\n const live = liveSignal();\r\n return this._commands().filter((cmd) => {\r\n if (cmd.scope === 'global') return true;\r\n return live.has(cmd.scope.appId);\r\n });\r\n });\r\n }\r\n\r\n /**\r\n * Register a single command. Returns a handle whose `dispose()` removes the row by\r\n * id. If the same id is later re-registered, the original handle's `dispose()`\r\n * becomes a no-op (the newer registration owns the row). Idempotent disposal.\r\n */\r\n register(cmd: AgentCommandRegistration): AgentCommandHandle {\r\n const generation = ++this._generation;\r\n this._commands.update((rows) => [...rows.filter((r) => r.id !== cmd.id), cmd]);\r\n this._owners.set(cmd.id, generation);\r\n return {\r\n dispose: () => {\r\n if (this._owners.get(cmd.id) === generation) {\r\n this._owners.delete(cmd.id);\r\n this._commands.update((rows) => rows.filter((r) => r.id !== cmd.id));\r\n }\r\n },\r\n };\r\n }\r\n\r\n /**\r\n * Bulk register. Rolls back on duplicate id within the input batch (throws before any\r\n * row lands). Cross-batch duplicates against existing rows follow the standard\r\n * \"latest wins\" rule and do NOT trigger rollback.\r\n *\r\n * Returns a handle whose `dispose()` tears down every row registered by this call.\r\n */\r\n registerAll(cmds: readonly AgentCommandRegistration[]): AgentCommandHandle {\r\n const seen = new Set<string>();\r\n for (const c of cmds) {\r\n if (seen.has(c.id)) {\r\n throw new Error(`AgentCommandRegistry.registerAll: duplicate id \"${c.id}\" in batch`);\r\n }\r\n seen.add(c.id);\r\n }\r\n const handles = cmds.map((c) => this.register(c));\r\n let disposed = false;\r\n return {\r\n dispose: () => {\r\n if (disposed) return;\r\n disposed = true;\r\n for (const h of handles) h.dispose();\r\n },\r\n };\r\n }\r\n\r\n /** Tear down by id. Idempotent. */\r\n unregister(id: string): void {\r\n if (this._owners.delete(id)) {\r\n this._commands.update((rows) => rows.filter((r) => r.id !== id));\r\n }\r\n }\r\n\r\n /** Monotonic counter; identifies which registration call currently owns each id. */\r\n private _generation = 0;\r\n /** id → generation. Used so a stale handle's `dispose()` is a no-op after replacement. */\r\n private readonly _owners = new Map<string, number>();\r\n}\r\n\r\n/** `isSignal` shim — narrows to either `Signal<T>` or a plain value. */\r\nfunction isSignal<T>(v: T | Signal<T>): v is Signal<T> {\r\n return typeof v === 'function';\r\n}\r\n","import { Injectable, Signal, Type, signal, type WritableSignal } from '@angular/core';\r\nimport type {\r\n AgentChipHostInputs,\r\n AgentCommandHandle,\r\n AgentDraggableItem,\r\n AgentDropRendererRegistration,\r\n} from '../../models/agent-input.model';\r\n\r\n/**\r\n * Singleton registry of chip-renderer components and keyboard-alternative draggable\r\n * items, keyed by `kind` and `appId`.\r\n *\r\n * Like {@link AgentCommandRegistry}, this lives in the DS so it crosses the federation\r\n * boundary as a single instance. Hosts (the shell `<fly-agent-input>`) lookup\r\n * renderers; remotes register them.\r\n *\r\n * Renderer lookup is `O(n)` over the registered list — the registry is small (one or\r\n * two entries per app) and lookups happen on drop, not per frame.\r\n *\r\n * Draggable storage is per-`appId` writable signal cached in a Map, so each `appId`\r\n * gets a stable {@link Signal} reference across reads (callers can `===`-compare).\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class AgentDropRegistry {\r\n private readonly _renderers = signal<readonly AgentDropRendererRegistration[]>([]);\r\n /** Per-appId writable store for draggables. Read-only mirror returned to callers. */\r\n private readonly _draggablesByApp = new Map<string, WritableSignal<readonly AgentDraggableItem[]>>();\r\n\r\n /**\r\n * Look up the chip-renderer component class for a `kind`. The newest registration for\r\n * a given `kind` wins, regardless of `appId` — we scan the list in reverse so a later\r\n * `register` call shadows an earlier one for the same `kind`.\r\n *\r\n * Returns `null` when no renderer is registered; the host falls back to a generic\r\n * `plainTextFallback` chip.\r\n */\r\n rendererFor(kind: string): Type<AgentChipHostInputs> | null {\r\n const list = this._renderers();\r\n for (let i = list.length - 1; i >= 0; i--) {\r\n if (list[i].kind === kind) return list[i].component as Type<AgentChipHostInputs>;\r\n }\r\n return null;\r\n }\r\n\r\n /**\r\n * Register a renderer for a `(kind, appId)` pair. Re-registering the same pair\r\n * replaces the prior entry; the disposal handle for the prior registration becomes\r\n * a no-op.\r\n *\r\n * Returns a {@link AgentCommandHandle} (re-used to keep the disposable shape uniform\r\n * across registries) whose `dispose()` removes this exact registration.\r\n */\r\n register<T = unknown>(reg: AgentDropRendererRegistration<T>): AgentCommandHandle {\r\n const generation = ++this._generation;\r\n const key = compositeKey(reg.kind, reg.appId);\r\n this._renderers.update((rows) => [\r\n ...rows.filter((r) => compositeKey(r.kind, r.appId) !== key),\r\n reg as AgentDropRendererRegistration,\r\n ]);\r\n this._owners.set(key, generation);\r\n return {\r\n dispose: () => {\r\n if (this._owners.get(key) === generation) {\r\n this._owners.delete(key);\r\n this._renderers.update((rows) => rows.filter((r) => compositeKey(r.kind, r.appId) !== key));\r\n }\r\n },\r\n };\r\n }\r\n\r\n /**\r\n * Apps publish their live \"draggable from focused window\" set so the keyboard\r\n * \"Attach from app…\" menu can offer them. Hosts call this each time the user-visible\r\n * draggable list changes; passing an empty array clears the entry for this `appId`.\r\n */\r\n publishDraggables(appId: string, items: readonly AgentDraggableItem[]): void {\r\n if (items.length === 0) {\r\n const existing = this._draggablesByApp.get(appId);\r\n if (existing) existing.set([]);\r\n return;\r\n }\r\n this.bucketFor(appId).set(items);\r\n }\r\n\r\n /**\r\n * Reactive read of the draggable set published for `appId`. Empty when none. The\r\n * returned signal is stable across calls (cached by `appId`), so consumers can use\r\n * it as a stable input to `computed()`.\r\n */\r\n draggablesFor(appId: string): Signal<readonly AgentDraggableItem[]> {\r\n return this.bucketFor(appId).asReadonly();\r\n }\r\n\r\n /** Lazy-init the per-appId writable bucket. Returns the writable handle for internal use. */\r\n private bucketFor(appId: string): WritableSignal<readonly AgentDraggableItem[]> {\r\n let bucket = this._draggablesByApp.get(appId);\r\n if (!bucket) {\r\n bucket = signal<readonly AgentDraggableItem[]>([]);\r\n this._draggablesByApp.set(appId, bucket);\r\n }\r\n return bucket;\r\n }\r\n\r\n private _generation = 0;\r\n private readonly _owners = new Map<string, number>();\r\n}\r\n\r\nfunction compositeKey(kind: string, appId: string): string {\r\n return `${kind}::${appId}`;\r\n}\r\n","import type { AgentDragPayload } from './agent-input.model';\r\n\r\n/**\r\n * Imperative action published by an app, consumed by the agent panel.\r\n *\r\n * Re-uses {@link AgentDragPayload} as the wire envelope so a dragged item\r\n * and a programmatic \"Explain\" click are byte-for-byte the same shape —\r\n * renderers, validators, and serialisation paths never fork on transport.\r\n *\r\n * Adding a verb is a minor DS bump (consumers ignore unknown verbs in\r\n * their `switch`). Removing one is a major DS bump.\r\n */\r\nexport type AgentActionVerb =\r\n | 'explain' // narrate what the payload shows in plain language\r\n | 'why-empty' // payload is an empty-result envelope; explain the gap\r\n | 'compose-query' // payload is a dataset schema; emit a DatasetQuery JSON\r\n | 'compare' // payload is { a, b }; compare them\r\n | 'summarize'; // payload is multiple envelopes; one-paragraph synthesis\r\n\r\n/**\r\n * Whether the agent panel sends the staged payload immediately or stages\r\n * the chip for the user to edit and send manually.\r\n *\r\n * Phase 1 (DS v2.6.0) supports `'stage'` only. Dispatching with `'auto'`\r\n * throws {@link AgentActionUnsupportedDispatchError} so callers don't\r\n * silently fail. `'auto'` lands once `AgentInputComponent.programmaticSubmit`\r\n * is exposed and reviewed against the input's state machine.\r\n */\r\nexport type AgentActionDispatch = 'auto' | 'stage';\r\n\r\nexport interface AgentAction<T = unknown> {\r\n /** Intent the agent should apply to {@link payload}. */\r\n readonly verb: AgentActionVerb;\r\n /** The wire envelope. Validated against {@link validateAgentPayload}'s\r\n * size caps before the bus fans it out. */\r\n readonly payload: AgentDragPayload<T>;\r\n /** Optional slash command id to bind before send (e.g. `'explain-report'`).\r\n * Phase 1 captures this for telemetry only — actual binding lands when\r\n * the input's programmatic-send API ships. An unknown id is dropped\r\n * silently with a console warning, the chip still arrives. */\r\n readonly autoCommandId?: string;\r\n /** Phase 1 supports `'stage'` only. See {@link AgentActionDispatch}. */\r\n readonly dispatch: AgentActionDispatch;\r\n /** Source DOM rect for the FLIP entry animation. Omit to skip the\r\n * animation (e.g. dispatching from a keyboard shortcut with no anchor). */\r\n readonly originRect?: DOMRect;\r\n /** Optional HTML snippet rendered inside the flight ghost. Callers are\r\n * responsible for escaping untrusted text — the bus does not sanitise.\r\n * Defaults (when omitted) to a strong-wrapped escape of the payload's\r\n * `plainTextFallback` rendered by the panel host. */\r\n readonly originPreviewHtml?: string;\r\n}\r\n\r\n/**\r\n * Thrown synchronously by {@link AgentActionBus.dispatch} when a caller\r\n * supplies a dispatch mode this DS version doesn't implement yet. Catching\r\n * by class name lets a forward-compatible caller fall back to `'stage'`\r\n * without depending on instanceof across federation boundaries.\r\n */\r\nexport class AgentActionUnsupportedDispatchError extends Error {\r\n constructor(public readonly dispatch: AgentActionDispatch) {\r\n super(`AgentActionBus: dispatch=\"${dispatch}\" not supported in this DS version`);\r\n this.name = 'AgentActionUnsupportedDispatchError';\r\n }\r\n}\r\n","import type { Type } from '@angular/core';\r\n\r\n/**\r\n * Agent input contracts.\r\n *\r\n * These types define the wire and DI surface for the new `<fly-agent-input>` orchestrator\r\n * (Phase 2+). Phase 1 ships only the contracts: payload envelope, command/drop registry\r\n * shapes, and chip-host inputs. The concrete components consume them later.\r\n *\r\n * Design rules:\r\n * - All fields are `readonly` — the registries store these in signal stores and we never\r\n * want a host mutating after registration. Hosts construct fresh objects to update.\r\n * - The discriminated kinds (`scope`, `mode`, `kind`) carry the entire variance — no\r\n * boolean flags. New variants extend the union without breaking existing consumers.\r\n * - The `Type<AgentChipHostInputs<T>>` shape is intentional: chip components declare\r\n * `payload`, `mode`, optional `onRemove` as Angular `input()` signals; the registry\r\n * wires them via `NgComponentOutlet` inputs in the consumer. The component reference\r\n * itself never leaks across the federation boundary by value — only by class identity.\r\n */\r\n\r\n/** Frozen MIME used by `flyAgentDraggable` and the drop-zone reader. Never change without a DS major. */\r\nexport const AGENT_DRAG_MIME = 'application/x-fly-agent-payload+json' as const;\r\n\r\n/**\r\n * Frozen payload envelope version.\r\n *\r\n * v1 — minimal drag payload: kind / appId / version / payload / plainTextFallback /\r\n * suggestedCommandIds. Still used by the drag/drop surface.\r\n *\r\n * v2 — bus envelope ({@link AgentMessageEnvelope}). Adds optional `userMessage`,\r\n * `systemContext`, `attachments`, `mcpScope` so a dispatcher can give the agent\r\n * rich context without polluting the user-visible message bubble. v2 is a\r\n * superset of v1 — every v1 payload is a valid v2 payload — so the version\r\n * number ratchets forward without breaking existing callers.\r\n */\r\nexport const AGENT_PAYLOAD_VERSION = 2 as const;\r\n\r\n/**\r\n * Versions accepted by the validator. v1 payloads (the drag/drop surface) remain valid;\r\n * v2 adds the optional bus-envelope fields. Renderers narrow on `version` when they need\r\n * to.\r\n */\r\nexport const SUPPORTED_AGENT_PAYLOAD_VERSIONS: readonly number[] = Object.freeze([1, 2]);\r\n\r\n// ─── Commands ───────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * Where a command surfaces. `'global'` = always offered. `{ appId }` = offered only when\r\n * the host's live `liveAppIds` set (passed to {@link AgentCommandRegistry.visible}) contains\r\n * that id. This lets a remote register its slash command at boot but only have it appear\r\n * in the palette while at least one of the remote's windows is open.\r\n */\r\nexport type AgentCommandScope = 'global' | { readonly appId: string };\r\n\r\n/**\r\n * A slash command offered by the agent input palette. Commands are deliberately shallow\r\n * descriptors — the host (shell) decides what happens on Send. The descriptor's role is\r\n * to make the palette row renderable (icon, label, kbd hint, app badge) and matchable\r\n * (id, aliases, drop-kind suggestions) without coupling DS to any business logic.\r\n */\r\nexport interface AgentCommand {\r\n /** Stable id, kebab-case. Becomes the slash text after `/`, e.g. `/analyze-trend`. */\r\n readonly id: string;\r\n /** i18n key for the visible label, e.g. `agent.command.analyze_trend.label`. */\r\n readonly labelKey: string;\r\n /** i18n key for an optional sublabel / description shown beneath the label. */\r\n readonly descriptionKey?: string;\r\n /** PrimeIcons class, e.g. `pi-chart-line`. */\r\n readonly icon?: string;\r\n /** App badge label key — appears as a small tag, e.g. `agent.command.app_badge.circles`. */\r\n readonly appBadgeKey?: string;\r\n /** Optional kbd hint i18n key. */\r\n readonly kbdHintKey?: string;\r\n /**\r\n * Argument-hint i18n key. When set, the resolved text renders as a gray\r\n * placeholder guiding what to type AFTER the command — both inline in the\r\n * composer (a ghost suffix shown while the command token is in the input and\r\n * no argument has been typed yet) and as a muted suffix on the command's\r\n * palette row. Distinct from {@link descriptionKey} (which says what the\r\n * command DOES): this says what to TYPE NEXT, e.g. `/analyze-trend` →\r\n * \"the trend you want to analyze\". Resolved in the OWNING app's i18n bundle,\r\n * exactly like {@link labelKey}; absent → no hint (behaviour unchanged).\r\n */\r\n readonly hintKey?: string;\r\n /** When the command is keyword-matched against drop payload kinds, list those kinds here. */\r\n readonly suggestForDropKinds?: readonly string[];\r\n /** Extra match terms beyond id + label, used by the fuzzy filter. */\r\n readonly aliases?: readonly string[];\r\n /** When `'send'`, the command is inserted as a bound prefix and executed on Send. */\r\n readonly executeOn: 'send';\r\n /** Optional client-side gate. Return false to hide the command in this scope. */\r\n readonly isVisible?: () => boolean;\r\n /**\r\n * Category B (PR3): when present, selecting this command invokes a\r\n * manifest-declared app skill instead of sending the composed text as a plain\r\n * message. The host dispatches a Twin message carrying\r\n * `system_context.slash_command_key = slashCommand.key` plus resolved context.\r\n * See {@link AgentCommandSlashSpec}.\r\n */\r\n readonly slashCommand?: AgentCommandSlashSpec;\r\n}\r\n\r\n/**\r\n * A context binding that resolves one `system_context` value for a Category B\r\n * command at dispatch. Pure data so it travels app-agnostically in the\r\n * Controller's app federation metadata (no callbacks). Discriminated by `from`:\r\n *\r\n * - `route` — value from the owning app's current route param `path`. The\r\n * shell cannot read a federated remote's internal route, so route\r\n * bindings **degrade** in v1 (the skill asks for the missing id);\r\n * resolved only once a remote→shell route channel exists.\r\n * - `lookup` — the host opens the `/lookup` entity picker for `entity` and\r\n * writes the picked id into `system_context[key]` (picker-during-\r\n * dispatch is a v1 follow-up — degrades to \"ask\" until then).\r\n * - `constant` — a literal value written into `system_context[key]`.\r\n */\r\nexport type AgentCommandContextBinding =\r\n | { readonly key: string; readonly from: 'route'; readonly path: string }\r\n | {\r\n readonly key: string;\r\n readonly from: 'lookup';\r\n readonly entity: string;\r\n readonly exclude?: readonly string[];\r\n readonly promptKey?: string;\r\n }\r\n | { readonly key: string; readonly from: 'constant'; readonly value: string };\r\n\r\n/**\r\n * Category B slash-command dispatch metadata (PR3). Travels app-agnostically in\r\n * the Controller's app federation metadata and is registered by the shell's\r\n * `RemoteManifestService` (the same path that registers `/lookup` descriptors) —\r\n * remotes do NOT self-register. When an {@link AgentCommand} carries this,\r\n * selecting it dispatches a Twin message with `system_context.slash_command_key\r\n * = key`, merged with the resolved `contextBindings`.\r\n */\r\nexport interface AgentCommandSlashSpec {\r\n /** Dispatched as `system_context.slash_command_key`; matches the agents-side\r\n * skill's `slash_command_key` (= its manifest_key). */\r\n readonly key: string;\r\n /** Reserved: a future confirm step before dispatch (manifest `requiresConfirmation`). */\r\n readonly requiresConfirmation?: boolean;\r\n /** Parameter sources resolved into `system_context` at dispatch. */\r\n readonly contextBindings?: readonly AgentCommandContextBinding[];\r\n}\r\n\r\n/** What hosts pass to {@link AgentCommandRegistry.register}. Adds the scope to {@link AgentCommand}. */\r\nexport interface AgentCommandRegistration extends AgentCommand {\r\n readonly scope: AgentCommandScope;\r\n}\r\n\r\n/** Disposable handle returned by {@link AgentCommandRegistry.register}. Idempotent `dispose()`. */\r\nexport interface AgentCommandHandle {\r\n dispose(): void;\r\n}\r\n\r\n// ─── Entity lookups (the `/lookup` typeahead) ─────────────────────────────────\r\n\r\n/**\r\n * How a lookup fetches candidate entities. The picker calls the app's existing\r\n * authenticated REST search endpoint (the same one the agent's MCP `*_list_brief`\r\n * tool wraps) through the shell's HttpClient — gateway routing + auth\r\n * interceptor apply. We deliberately do NOT route typeahead through MCP (agent-\r\n * shaped, agent-auth) or the dataset executor (aggregation-shaped, no fulltext).\r\n *\r\n * Field mapping is declarative because entities differ: Circles trends/signals\r\n * expose `/brief` endpoints returning `{ id, title, status }`, while scenarios\r\n * have no brief variant and return full objects with `titleEn` / `titleAr`. The\r\n * `displayField` / `secondaryField` indirection absorbs that per-entity skew so\r\n * one picker component serves them all.\r\n */\r\nexport interface LookupSearch {\r\n /**\r\n * Relative REST path the picker GETs, e.g. `/api/circles/trends/brief`. Must\r\n * be a relative path (no scheme/host) — the SSRF guard at onboard time (when\r\n * the descriptor is manifest-backed) and the picker both reject absolute URLs.\r\n */\r\n readonly endpoint: string;\r\n /** Query param carrying the typed text, e.g. `search`. */\r\n readonly queryParam: string;\r\n /** Static query params merged into every request, e.g. `{ pageSize: '10' }`. */\r\n readonly extraParams?: Readonly<Record<string, string>>;\r\n /** Response-item field holding the entity id. Default `id`. */\r\n readonly idField?: string;\r\n /** Response-item field holding the display label, e.g. `title` / `titleEn`. */\r\n readonly displayField: string;\r\n /** Optional response-item field for the chip's secondary line (status, category). */\r\n readonly secondaryField?: string;\r\n /**\r\n * Optional response-item field whose value is a *row-level* app id — i.e. the\r\n * app that owns this individual entity, distinct from the descriptor's\r\n * {@link LookupDescriptor.appId} (which only names the app exposing the\r\n * lookup endpoint). Help articles are the motivating case: every article is\r\n * exposed by `help-center`, but each one was seeded by a *source* app's\r\n * manifest (Circles, Trends, …). Surfacing that per-row appId lets the\r\n * picker render a second source-app tag so the user can tell two\r\n * similarly-titled rows from different source apps apart at a glance.\r\n *\r\n * Resolved through {@link LookupResult.appId} and the shell's app registry\r\n * with the same fallback chain used for {@link LookupDescriptor.appId}.\r\n */\r\n readonly appIdField?: string;\r\n /**\r\n * Dotted path to the results array within the response body when it is\r\n * wrapped, e.g. `items` for `{ items: [...], total }`. Omit when the response\r\n * body IS the array.\r\n */\r\n readonly resultsPath?: string;\r\n /**\r\n * Optional single-item resolver: `{id}` → display label, never for typeahead.\r\n * Backs Category-B slash-command auto-pick (`AgentInputComponent`'s\r\n * `_autoPickArmedBindings`): when the user is on an OS-Core entity's detail\r\n * page, the shell already has the id from the URL but — unlike a federated\r\n * remote, which publishes a `title` via `FlyRemoteContext` — has no title for\r\n * it. Without this, auto-pick silently fell back to painting the raw id as\r\n * the chip's label. Omit for entities that never appear as an auto-pick\r\n * target, or whose owning app already publishes a `FlyRemoteContext` title.\r\n */\r\n readonly resolveById?: {\r\n /** Endpoint template; the single `{id}` placeholder is substituted (URL-encoded). */\r\n readonly endpoint: string;\r\n /** Dotted path to the single item in the response body. Default `'data'` (the platform `ApiResponse<T>` envelope). */\r\n readonly path?: string;\r\n };\r\n}\r\n\r\n/**\r\n * A lookupable entity offered by the `/lookup` palette. Registered by the owning\r\n * app (a federation remote self-registers at boot, mirroring {@link AgentCommand})\r\n * or, once manifest-backed, projected from the app's `lookups[]` manifest section.\r\n *\r\n * The descriptor is a shallow, business-logic-free descriptor: it tells the\r\n * picker WHAT to search, WHERE it is offered, and HOW to map the response — the\r\n * picker owns the typeahead UX, the shell owns the HTTP call.\r\n */\r\nexport interface LookupDescriptor {\r\n /**\r\n * Stable entity key, kebab/lower, e.g. `scenario`. Doubles as the `/lookup\r\n * <entity>` sub-token and the group key the picked ref is grouped under when\r\n * serialized for the agent.\r\n */\r\n readonly entity: string;\r\n /** i18n key for the entity's display name in the picker / palette. */\r\n readonly labelKey: string;\r\n /** Optional PrimeIcons class for the picker row + chip. */\r\n readonly icon?: string;\r\n /**\r\n * Stable id of the app that exposes this lookup, e.g. `notes`, `calendar`,\r\n * `circles`. The picker resolves it to the app's display name via the shell's\r\n * app registry and renders an \"exposed by …\" badge so the user can see which\r\n * app owns the entity they're browsing (helps disambiguate when two apps\r\n * register a similar-sounding entity, e.g. both Tasks and Notes one day).\r\n *\r\n * Populated automatically by the shell's registration paths:\r\n * - `CORE_APP_LOOKUPS` stamps it per descriptor at hand-edit time.\r\n * - `RemoteManifestService` stamps it from the manifest entry's `id` so\r\n * federation remotes don't have to repeat the id in every descriptor.\r\n *\r\n * Falls back to {@link appBadgeKey} (a locale-resolved literal) when an\r\n * entity has no first-class home in the shell's app registry — e.g. `user`,\r\n * `app-agent`, `robot`. When neither is set the picker omits the badge.\r\n */\r\n readonly appId?: string;\r\n /**\r\n * Optional i18n key the picker uses for the \"exposed by …\" badge **when\r\n * {@link appId} is absent or unknown to the shell's app registry**. Lets\r\n * entities that don't map to a single app (Users, Robots, App Agents) still\r\n * surface a meaningful badge instead of silently omitting it. The picker\r\n * resolves the key via the shared i18n service so the badge follows the\r\n * user's locale.\r\n */\r\n readonly appBadgeKey?: string;\r\n /**\r\n * Advisory MCP tool-key prefixes the agent should prefer when the user\r\n * references this entity via `/lookup` (e.g. `['dashboard.reports']`). The\r\n * shell folds these into the turn's `mcp_scope` so the Twin self-serves the\r\n * owning app's tools — fetching and analysing the referenced entity itself —\r\n * instead of defaulting to a specialist-Robot consult for \"tell me more\"\r\n * style prompts. Same dot-namespaced prefix vocabulary as\r\n * {@link AgentMcpScope.apis}. Omit for entities with no first-class MCP tool\r\n * family (e.g. `user`, `robot`).\r\n */\r\n readonly mcpApis?: readonly string[];\r\n /**\r\n * Optional in-app deep-link route TEMPLATE for this entity's detail page,\r\n * e.g. `'/signals/{id}'`. When present, the desktop shell turns an agent's\r\n * inline reference to this entity — the `flyos:<appId>.<entity>/<id>`\r\n * anchors the agents backend emits in chat answers — into a launchable\r\n * link: the single `{id}` placeholder is substituted with the referenced\r\n * entity's id (URL-encoded) and the owning {@link appId} is launched on\r\n * that route via the shell launcher.\r\n *\r\n * Omit for entities with no standalone detail page — their references then\r\n * render as plain text (graceful degrade; never a dead link). The owning\r\n * app declares this once in its `lookups[]` manifest entry, so a remote\r\n * becomes agent-deep-linkable without any shell or design-system change.\r\n * Only `{id}` is substituted here — richer parameterisation rides the\r\n * deep-link `params` channel, not this template.\r\n */\r\n readonly deepLinkRoute?: string;\r\n /**\r\n * What happens when a candidate is SELECTED in the picker. Default\r\n * `'reference'` (omitted): the pick stages a `ref` chip + emits the\r\n * `flyos:<appId>.<entity>/<id>` deep link, exactly as every lookup has always\r\n * done. `'invoke'` instead fires {@link invoke} as a side-effecting action\r\n * (e.g. run a Twin routine on demand) and surfaces the outcome — no chip, no\r\n * deep link — letting a lookup double as a command. ENTIRELY OPTIONAL: a\r\n * descriptor that omits this keeps the reference behaviour byte-for-byte.\r\n */\r\n readonly onSelect?: 'reference' | 'invoke';\r\n /**\r\n * Required when {@link onSelect} is `'invoke'`. The endpoint called on\r\n * selection; the single `{id}` placeholder is substituted with the picked\r\n * entity's id (URL-encoded). Method defaults to `POST`.\r\n */\r\n readonly invoke?: {\r\n readonly endpoint: string;\r\n readonly method?: 'POST' | 'PUT';\r\n };\r\n /** How to fetch + map candidates. */\r\n readonly search: LookupSearch;\r\n}\r\n\r\n/** What hosts pass to the lookup registry. Adds the scope to {@link LookupDescriptor}. */\r\nexport interface LookupRegistration extends LookupDescriptor {\r\n /**\r\n * Affinity hint, NOT a visibility gate.\r\n *\r\n * Unlike {@link AgentCommandScope} — where `{appId}` HIDES a command unless the\r\n * app is live — lookup scope is a *priority hint*. Every registered lookup is\r\n * always offered in `/lookup`; when the app named by `{appId}` is in the host's\r\n * live app set, that lookup sorts to the **top** of the entity picker so the\r\n * \"what am I working on right now?\" entities surface first. `'global'` lookups\r\n * have no affinity and sort after app-affinity matches.\r\n *\r\n * Rationale: OS-core entities (note, calendar event, file) are always\r\n * referenceable — there's no \"open the app first\" condition the way there is\r\n * for federated remotes — so a visibility gate would just produce a confusing\r\n * empty state. Affinity-as-sort preserves the \"Circles is open → prefer\r\n * scenarios/trends/signals\" intuition without hiding the rest.\r\n */\r\n readonly scope: AgentCommandScope;\r\n}\r\n\r\n/** One resolved row the picker returns once the user selects a candidate. */\r\nexport interface LookupResult {\r\n /** The entity kind (echoes {@link LookupDescriptor.entity}). */\r\n readonly entity: string;\r\n /** Selected entity id. */\r\n readonly id: string;\r\n /** Selected entity's display label. */\r\n readonly label: string;\r\n /** Optional secondary detail (status / category). */\r\n readonly secondary?: string;\r\n /**\r\n * Row-level source app id (e.g. `circles` for an article seeded by Circles'\r\n * manifest). Populated when the descriptor sets {@link LookupSearch.appIdField}\r\n * and the response item carries a non-empty value. The picker renders it as\r\n * a second app tag alongside the descriptor-level badge so the user can see\r\n * \"this Help-Center article was contributed by Circles\" without opening it.\r\n */\r\n readonly appId?: string;\r\n}\r\n\r\n/** Disposable handle returned by the lookup registry. Idempotent `dispose()`. */\r\nexport interface LookupHandle {\r\n dispose(): void;\r\n}\r\n\r\n// ─── Drag payloads ──────────────────────────────────────────────────────────\r\n\r\n/**\r\n * The wire envelope used by both the drag/drop surface and the imperative\r\n * {@link AgentActionBus}. Renderers narrow on `kind`; mismatches fall back to\r\n * `plainTextFallback`.\r\n *\r\n * The base fields (v1) describe **what** is being handed to the agent panel.\r\n * The v2 fields describe **how the agent should treat it** — `userMessage`\r\n * scopes the user-visible bubble, `systemContext` extends the system prompt,\r\n * `attachments` decorate the message with typed chips, and `mcpScope` hints\r\n * the agent toward a tool family. All v2 fields are optional so existing\r\n * v1 (drag/drop) payloads remain valid envelopes.\r\n *\r\n * Caps (see {@link AgentPayloadLimits}):\r\n * - JSON total 32 KB\r\n * - plainTextFallback 8 KB\r\n * - per-string field 4 KB\r\n * - userMessage 280 chars\r\n * - systemContext 32 entries × 4 KB per value, 8 KB total serialized\r\n * - attachments 4 entries, kind-dependent inner caps\r\n * - mcpScope.apis 5 prefixes × 128 chars\r\n *\r\n * The cap math is split per-section so an oversize attachment fails fast at the\r\n * attachment site instead of the whole envelope; field paths are dotted (see\r\n * {@link AgentPayloadValidationResult}).\r\n */\r\nexport interface AgentDragPayload<T = unknown> {\r\n /** Domain-stable kind, e.g. `circles.trend`. */\r\n readonly kind: string;\r\n /** Originating appId. Must match an entry in the host's app registry. */\r\n readonly appId: string;\r\n /** Frozen format version. Accepted: 1 or {@link AGENT_PAYLOAD_VERSION} (2). */\r\n readonly version: number;\r\n /** Domain object. Renderers narrow on `kind`. */\r\n readonly payload: T;\r\n /** Plain-text fallback written to the dataTransfer alongside the typed MIME. */\r\n readonly plainTextFallback: string;\r\n /** Optional command ids to highlight when this payload is dropped. */\r\n readonly suggestedCommandIds?: readonly string[];\r\n\r\n // ── v2 — bus envelope fields (all optional; ignored by drag/drop) ──────────\r\n\r\n /**\r\n * Short, locale-resolved string the dispatcher wants shown in the user's\r\n * chat bubble. The agent panel uses it as the visible message text; when\r\n * absent, the panel falls back to a generic per-verb default\r\n * (e.g. \"Tell me more about this\"). Cap 280 chars — chip-sized, not essay.\r\n *\r\n * This is the ONLY field that should ever surface to the user verbatim.\r\n * Everything else (systemContext, attachment bodies, mcpScope) is wire-only.\r\n */\r\n readonly userMessage?: string;\r\n\r\n /**\r\n * Flat key→string facts the dispatcher wants injected into the agent's\r\n * system prompt for this turn. Keys are dot-namespaced (e.g.\r\n * `chart.name`, `chart.type`, `chart.dimension`) to keep the model's\r\n * mental schema flat and grep-friendly. Values are strings — booleans,\r\n * numbers, and dates must be pre-serialized at the call site so the\r\n * dispatcher owns the formatting (timezone, locale, number style).\r\n *\r\n * Cap: 32 entries, 4 KB per value, 8 KB total when serialized.\r\n *\r\n * NOT user-visible. The agent panel may transiently embed this as an\r\n * `[Internal context]` block in the wire content while the backend\r\n * learns to consume the dedicated field, but never renders it in the\r\n * user bubble.\r\n */\r\n readonly systemContext?: Readonly<Record<string, string>>;\r\n\r\n /**\r\n * Typed attachments rendered as a chip strip under the user's outgoing\r\n * message bubble. Each entry has a `kind` discriminator and a `label`\r\n * (locale-resolved by the dispatcher). v2 ships `json` + `text`;\r\n * `image` and `file` are reserved — their interfaces are stable so\r\n * future callers don't need a contract bump, but the panel may render\r\n * a generic chip for them until per-kind renderers land.\r\n *\r\n * Cap: 4 entries per envelope. Per-kind body caps:\r\n * - json: 16 KB serialized\r\n * - text: 8 KB UTF-8\r\n * - image / file: dataUrl ≤ 32 KB (small previews; large media stays in\r\n * the files-manager and is referenced by id)\r\n */\r\n readonly attachments?: readonly AgentEnvelopeAttachment[];\r\n\r\n /**\r\n * Advisory MCP scope. The agent service injects these prefixes into the\r\n * system prompt as a tool-selection hint (\"prefer tools matching\r\n * `dashboard.reports.*` for this turn\") — NOT a hard filter. The agent\r\n * remains free to pick any tool; this just biases the first guess so a\r\n * dashboard explain doesn't waste a tool-call probing Notes APIs first.\r\n *\r\n * Cap: 5 prefixes × 128 chars. Prefixes should match gateway-aggregated\r\n * OpenAPI tag/path roots so they line up with the names the MCP server\r\n * exposes — see `src/backend/gateway` Swagger aggregation + the dynamic\r\n * loader in `src/backend/mcp-server`.\r\n */\r\n readonly mcpScope?: AgentMcpScope;\r\n\r\n /**\r\n * Optional deep-link route the originating app can use to re-open the\r\n * source object. When set, payload chips (and any other renderer that\r\n * surfaces the envelope to the user) become clickable — clicking calls\r\n * `ShellLauncherService.launch({ appId, route: deepLinkRoute })` so the\r\n * target app opens / focuses and navigates to the originating object.\r\n *\r\n * Shape constraints (mirror `DeepLinkService.isValidRoute`):\r\n * - starts with `/`\r\n * - ≤ {@link AgentPayloadLimits.maxDeepLinkRouteBytes} bytes (default\r\n * 1024) — matches the route limit on the wider shell deep-link\r\n * contract so this field can be handed straight to the launcher.\r\n * - no `..` segments\r\n * - no `//` runs\r\n * - no scheme-like prefixes (`/javascript:`, `/data:`, `/http:`, `/https:`)\r\n *\r\n * The DS validator enforces only the byte cap — full route syntax\r\n * validation is owned by the shell side (`DeepLinkService`) because the\r\n * DS package is shell-agnostic and shouldn't grow a second copy of the\r\n * URL grammar. Apps building envelopes are expected to stamp routes that\r\n * match their own internal route schema (e.g. dashboard publishes\r\n * `/reports/{id}` and `/custom/{id}`); see `skills/cross-app-deep-linking.md`.\r\n *\r\n * Backwards-compat: absent on v1 payloads and on v2 payloads built\r\n * before this field was added. Persisted JSONB chips without the field\r\n * remain non-clickable; new chips light up automatically.\r\n */\r\n readonly deepLinkRoute?: string;\r\n}\r\n\r\n/**\r\n * Canonical name for the bus-side envelope. v2 callers should reference this\r\n * over {@link AgentDragPayload} for clarity — the underlying shape is\r\n * identical, but the name signals \"this is going to the agent, not to a\r\n * drop zone.\" The alias is intentional: one wire shape, two semantic uses.\r\n */\r\nexport type AgentMessageEnvelope<T = unknown> = AgentDragPayload<T>;\r\n\r\n/**\r\n * Typed attachment discriminator for {@link AgentDragPayload.attachments}.\r\n *\r\n * - `json` — structured data the panel renders as a \"code-ish\" chip the\r\n * user can expand. Used for chart snapshots, query results, etc.\r\n * - `text` — short utterance / excerpt with optional MIME. Used when the\r\n * dispatcher wants the chip to preview a note paragraph, log line,\r\n * code snippet, etc.\r\n * - `image` / `file` — reserved. Stable interface; renderers added per\r\n * downstream caller (the panel may fall back to a generic icon-chip).\r\n *\r\n * Every kind carries `label` — that's what shows on the chip face and what\r\n * a11y trees announce.\r\n */\r\nexport type AgentEnvelopeAttachment =\r\n | {\r\n readonly kind: 'json';\r\n readonly label: string;\r\n readonly json: unknown;\r\n }\r\n | {\r\n readonly kind: 'text';\r\n readonly label: string;\r\n readonly text: string;\r\n readonly mimeType?: string;\r\n }\r\n | {\r\n readonly kind: 'image';\r\n readonly label: string;\r\n /** `data:` URL — small previews only. Large media stays in files-manager. */\r\n readonly dataUrl: string;\r\n readonly mimeType: string;\r\n }\r\n | {\r\n readonly kind: 'file';\r\n readonly label: string;\r\n readonly dataUrl: string;\r\n readonly mimeType: string;\r\n readonly bytes: number;\r\n };\r\n\r\n/** Advisory tool-selection hint for {@link AgentDragPayload.mcpScope}. */\r\nexport interface AgentMcpScope {\r\n /**\r\n * Prefixes of gateway-aggregated OpenAPI tags / path roots — e.g.\r\n * `dashboard.reports`, `notes.documents`. The agent service treats these\r\n * as a soft preference, not a hard filter.\r\n */\r\n readonly apis: readonly string[];\r\n}\r\n\r\n/**\r\n * Where a chip is being rendered. `inline` = inside the input chip tray (removable);\r\n * `message` = embedded in a sent message bubble (not removable).\r\n */\r\nexport type AgentDropChipMode = 'inline' | 'message';\r\n\r\n/**\r\n * Public input shape for chip-renderer components. Components declare matching\r\n * `input()` signals; the registry wires them via `NgComponentOutlet`.\r\n */\r\nexport interface AgentChipHostInputs<T = unknown> {\r\n payload: AgentDragPayload<T>;\r\n mode: AgentDropChipMode;\r\n /** Called when the user clicks the chip's remove control (only in inline mode). */\r\n onRemove?: () => void;\r\n}\r\n\r\n/**\r\n * Keyboard-alternative draggable item. Hosts publish these via\r\n * {@link AgentDropRegistry.publishDraggables} so the \"Attach from app…\" menu can offer\r\n * them when pointer drag isn't available.\r\n */\r\nexport interface AgentDraggableItem<T = unknown> {\r\n /** Stable id within its app. Used as a list key in the kbd menu. */\r\n readonly id: string;\r\n readonly labelKey: string;\r\n readonly icon?: string;\r\n /** Builds the payload the moment the user picks the item. */\r\n build(): AgentDragPayload<T>;\r\n}\r\n\r\n/** Registry input shape for binding a chip-renderer component to a kind+appId pair. */\r\nexport interface AgentDropRendererRegistration<T = unknown> {\r\n readonly kind: string;\r\n readonly appId: string;\r\n readonly component: Type<AgentChipHostInputs<T>>;\r\n}\r\n\r\n// ─── Payload guards ─────────────────────────────────────────────────────────\r\n\r\n/**\r\n * Caps applied by {@link validateAgentPayload} / {@link trimAgentPayload}. The defaults\r\n * trade off \"fits comfortably in a single MQ frame\" against \"covers a richly-populated\r\n * trend or note card\". Hosts may pass a partial override.\r\n */\r\nexport interface AgentPayloadLimits {\r\n /** Cap on the JSON.stringify(envelope) byte length. Default 32 KB. */\r\n readonly maxJsonBytes: number;\r\n /** Cap on the plainTextFallback byte length. Default 8 KB. */\r\n readonly maxPlainTextFallbackBytes: number;\r\n /** Cap on any single string field inside payload (recursive). Default 4 KB. */\r\n readonly maxStringFieldBytes: number;\r\n\r\n // ── v2 — bus envelope caps ────────────────────────────────────────────────\r\n\r\n /** Cap on `userMessage` UTF-8 byte length. Default 280 chars (~1.1 KB). */\r\n readonly maxUserMessageBytes: number;\r\n /** Max entries in `systemContext`. Default 32. */\r\n readonly maxSystemContextEntries: number;\r\n /** Cap on any single systemContext value's UTF-8 byte length. Default 4 KB. */\r\n readonly maxSystemContextValueBytes: number;\r\n /** Cap on the full JSON.stringify(systemContext). Default 8 KB. */\r\n readonly maxSystemContextJsonBytes: number;\r\n /** Max attachments per envelope. Default 4. */\r\n readonly maxAttachments: number;\r\n /** Cap on a `json` attachment's serialized body. Default 16 KB. */\r\n readonly maxAttachmentJsonBytes: number;\r\n /** Cap on a `text` attachment's body bytes. Default 8 KB. */\r\n readonly maxAttachmentTextBytes: number;\r\n /** Cap on an `image` / `file` attachment's dataUrl bytes. Default 32 KB. */\r\n readonly maxAttachmentDataUrlBytes: number;\r\n /** Max prefixes in `mcpScope.apis`. Default 5. */\r\n readonly maxMcpScopeApis: number;\r\n /** Cap on any single mcpScope prefix string. Default 128 chars. */\r\n readonly maxMcpScopeApiBytes: number;\r\n /**\r\n * Cap on `deepLinkRoute` UTF-8 byte length. Default 1024 bytes — matches\r\n * the route limit on `DeepLinkService.isValidRoute` so this field can be\r\n * handed straight to the shell launcher without a second resize.\r\n */\r\n readonly maxDeepLinkRouteBytes: number;\r\n}\r\n\r\nexport const DEFAULT_AGENT_PAYLOAD_LIMITS: AgentPayloadLimits = Object.freeze({\r\n maxJsonBytes: 32 * 1024,\r\n maxPlainTextFallbackBytes: 8 * 1024,\r\n maxStringFieldBytes: 4 * 1024,\r\n maxUserMessageBytes: 280 * 4, // 280 chars × 4 bytes/char worst-case UTF-8\r\n maxSystemContextEntries: 32,\r\n maxSystemContextValueBytes: 4 * 1024,\r\n maxSystemContextJsonBytes: 8 * 1024,\r\n maxAttachments: 4,\r\n maxAttachmentJsonBytes: 16 * 1024,\r\n maxAttachmentTextBytes: 8 * 1024,\r\n maxAttachmentDataUrlBytes: 32 * 1024,\r\n maxMcpScopeApis: 5,\r\n maxMcpScopeApiBytes: 128,\r\n maxDeepLinkRouteBytes: 1024,\r\n});\r\n\r\n/**\r\n * Stable failure reasons emitted by {@link validateAgentPayload}.\r\n * - `invalid_version` — `version` !== {@link AGENT_PAYLOAD_VERSION}.\r\n * - `invalid_kind` — `kind` is empty / not a string.\r\n * - `field_too_large` — a string field inside `payload` exceeds `maxStringFieldBytes`.\r\n * - `fallback_too_large` — `plainTextFallback` exceeds `maxPlainTextFallbackBytes`.\r\n * - `json_too_large` — the full JSON.stringify(envelope) exceeds `maxJsonBytes`.\r\n */\r\nexport type AgentPayloadValidationResult =\r\n | { readonly ok: true }\r\n | {\r\n readonly ok: false;\r\n readonly reason:\r\n | 'json_too_large'\r\n | 'fallback_too_large'\r\n | 'field_too_large'\r\n | 'invalid_version'\r\n | 'invalid_kind'\r\n // v2:\r\n | 'user_message_too_large'\r\n | 'system_context_too_many_entries'\r\n | 'system_context_value_too_large'\r\n | 'system_context_json_too_large'\r\n | 'too_many_attachments'\r\n | 'attachment_invalid_kind'\r\n | 'attachment_json_too_large'\r\n | 'attachment_text_too_large'\r\n | 'attachment_data_url_too_large'\r\n | 'mcp_scope_too_many_apis'\r\n | 'mcp_scope_api_too_large'\r\n | 'deep_link_route_too_large'\r\n | 'deep_link_route_invalid_shape';\r\n /** Dotted property-access path to the offending field, e.g. `payload.title` or `payload.tags[2]`. NOT RFC 6901 JSON Pointer. */\r\n readonly fieldPath?: string;\r\n readonly actualBytes?: number;\r\n readonly limitBytes?: number;\r\n };\r\n","import {\r\n DEFAULT_AGENT_PAYLOAD_LIMITS,\r\n SUPPORTED_AGENT_PAYLOAD_VERSIONS,\r\n type AgentDragPayload,\r\n type AgentEnvelopeAttachment,\r\n type AgentPayloadLimits,\r\n type AgentPayloadValidationResult,\r\n} from '../models/agent-input.model';\r\n\r\n/**\r\n * Pure utility helpers for agent drag payload size guarding.\r\n *\r\n * Used by `flyAgentDraggable` at `dragstart` (Phase 2) and by app pre-flight code that\r\n * wants a clean payload before constructing the directive input. No Angular DI, no\r\n * runtime side effects — safe to import from anywhere.\r\n *\r\n * Performance notes:\r\n * - The `TextEncoder` is lazily allocated and cached. The constructor runs once per\r\n * module instance even under federation (singleton DS).\r\n * - String trimming uses `Intl.Segmenter` when available (all evergreen browsers\r\n * including Safari 14.1+) so we cut on grapheme boundaries — emoji ZWJ sequences,\r\n * combining marks, regional indicator pairs all stay intact. Fallback is\r\n * UTF-16 code-unit slice, which is a graceful degradation: it can split a\r\n * surrogate pair, but the resulting JSON is still syntactically valid and\r\n * downstream renderers handle the replacement char.\r\n */\r\n\r\n/**\r\n * Thrown by {@link trimAgentPayload} when even a fully string-trimmed envelope still\r\n * exceeds `maxJsonBytes` (e.g. an envelope with thousands of nested empty objects /\r\n * array entries / property keys). Subclasses `RangeError` so callers using the standard\r\n * `instanceof RangeError` check still match, while exposing the structured fields\r\n * (`actualBytes`, `limitBytes`, `reason: 'json_too_large'`) needed for telemetry and\r\n * symmetric handling with {@link AgentPayloadValidationResult} failures.\r\n */\r\nexport class AgentPayloadOversizeError extends RangeError {\r\n readonly reason = 'json_too_large' as const;\r\n constructor(\r\n message: string,\r\n readonly actualBytes: number,\r\n readonly limitBytes: number,\r\n ) {\r\n super(message);\r\n this.name = 'AgentPayloadOversizeError';\r\n }\r\n}\r\n\r\n/** Cap on the dotted `fieldPath` string so a 10 MB property-key payload can't lock dev tools when `console.warn`d. */\r\nconst FIELD_PATH_MAX_CHARS = 256;\r\n\r\n/** Append a path segment, capping the result at {@link FIELD_PATH_MAX_CHARS} chars (with `…` marker). */\r\nfunction appendPath(base: string, segment: string): string {\r\n const next = base + segment;\r\n if (next.length <= FIELD_PATH_MAX_CHARS) return next;\r\n return next.slice(0, FIELD_PATH_MAX_CHARS - 1) + '…';\r\n}\r\n\r\nlet _cachedEncoder: TextEncoder | null = null;\r\nfunction getEncoder(): TextEncoder {\r\n return (_cachedEncoder ??= new TextEncoder());\r\n}\r\n\r\n/** UTF-8 byte length of `s`. Cheap; cached encoder. */\r\nexport function utf8ByteLength(s: string): number {\r\n return getEncoder().encode(s).length;\r\n}\r\n\r\n/**\r\n * Trim `input` so the UTF-8 byte length of the result is `<= maxBytes`. When trimming\r\n * occurs, append `ellipsis` (default `…`, U+2026) — its bytes are included in the cap.\r\n *\r\n * Idempotent: `trimAgentString(trimAgentString(s, n), n)` equals `trimAgentString(s, n)`.\r\n *\r\n * Edge cases:\r\n * - `maxBytes` shorter than the ellipsis itself returns an empty string.\r\n * - `Intl.Segmenter` (when present) ensures we never split a grapheme cluster.\r\n * - When the encoded length is already within the cap, returns `input` unchanged.\r\n */\r\nexport function trimAgentString(input: string, maxBytes: number, ellipsis = '…'): string {\r\n if (maxBytes <= 0) return '';\r\n const enc = getEncoder();\r\n const inputLen = enc.encode(input).length;\r\n if (inputLen <= maxBytes) return input;\r\n\r\n const ellipsisLen = enc.encode(ellipsis).length;\r\n if (maxBytes < ellipsisLen) return '';\r\n const budget = maxBytes - ellipsisLen;\r\n\r\n // Segmenter path: walk graphemes, accumulate until next would overflow.\r\n const segmenterCtor =\r\n typeof Intl !== 'undefined' && (Intl as unknown as { Segmenter?: typeof Intl.Segmenter }).Segmenter;\r\n if (segmenterCtor) {\r\n const segmenter = new segmenterCtor(undefined, { granularity: 'grapheme' });\r\n let used = 0;\r\n let acc = '';\r\n for (const seg of segmenter.segment(input)) {\r\n const segLen = enc.encode(seg.segment).length;\r\n if (used + segLen > budget) break;\r\n acc += seg.segment;\r\n used += segLen;\r\n }\r\n return acc + ellipsis;\r\n }\r\n\r\n // Fallback: code-unit slice; verify byte length and shrink until under budget.\r\n let cut = input.length;\r\n while (cut > 0 && enc.encode(input.slice(0, cut)).length > budget) {\r\n cut--;\r\n }\r\n return input.slice(0, cut) + ellipsis;\r\n}\r\n\r\n/**\r\n * Validate an {@link AgentDragPayload} against the supplied limits (or\r\n * {@link DEFAULT_AGENT_PAYLOAD_LIMITS} when omitted). Returns `{ ok: true }` or a\r\n * structured failure with the offending field path and byte counts.\r\n *\r\n * Order of checks (cheap → expensive):\r\n * 1. `version` is in {@link SUPPORTED_AGENT_PAYLOAD_VERSIONS}.\r\n * 2. `kind` is a non-empty string.\r\n * 3. `plainTextFallback` fits its cap.\r\n * 4. Every string in `payload` (recursively) fits the per-field cap.\r\n * 5. v2 sections — `userMessage`, `systemContext`, `attachments`, `mcpScope` —\r\n * each fits their independent caps. Skipped when absent so v1 payloads pass\r\n * unchanged.\r\n * 6. The full `JSON.stringify(envelope)` fits the JSON cap.\r\n *\r\n * The walker stops on the first oversize string field — the intent is to surface\r\n * actionable feedback, not enumerate every offender.\r\n */\r\nexport function validateAgentPayload(\r\n payload: AgentDragPayload<unknown>,\r\n limits?: Partial<AgentPayloadLimits>,\r\n): AgentPayloadValidationResult {\r\n const eff: AgentPayloadLimits = { ...DEFAULT_AGENT_PAYLOAD_LIMITS, ...(limits ?? {}) };\r\n\r\n if (!SUPPORTED_AGENT_PAYLOAD_VERSIONS.includes(payload.version)) {\r\n return { ok: false, reason: 'invalid_version' };\r\n }\r\n if (typeof payload.kind !== 'string' || payload.kind.length === 0) {\r\n return { ok: false, reason: 'invalid_kind' };\r\n }\r\n\r\n const fbBytes = utf8ByteLength(payload.plainTextFallback ?? '');\r\n if (fbBytes > eff.maxPlainTextFallbackBytes) {\r\n return {\r\n ok: false,\r\n reason: 'fallback_too_large',\r\n fieldPath: 'plainTextFallback',\r\n actualBytes: fbBytes,\r\n limitBytes: eff.maxPlainTextFallbackBytes,\r\n };\r\n }\r\n\r\n const fieldFailure = walkStringsForOverage(payload.payload, 'payload', eff.maxStringFieldBytes);\r\n if (fieldFailure) return fieldFailure;\r\n\r\n // v2 — per-section caps. Each helper is a no-op when its section is absent\r\n // so a v1 payload (no userMessage / systemContext / attachments / mcpScope /\r\n // deepLinkRoute) sails through unchanged.\r\n const v2Failure =\r\n checkUserMessage(payload, eff) ??\r\n checkSystemContext(payload, eff) ??\r\n checkAttachments(payload, eff) ??\r\n checkMcpScope(payload, eff) ??\r\n checkDeepLinkRoute(payload, eff);\r\n if (v2Failure) return v2Failure;\r\n\r\n const json = safeStringify(payload);\r\n const jsonBytes = utf8ByteLength(json);\r\n if (jsonBytes > eff.maxJsonBytes) {\r\n return {\r\n ok: false,\r\n reason: 'json_too_large',\r\n actualBytes: jsonBytes,\r\n limitBytes: eff.maxJsonBytes,\r\n };\r\n }\r\n\r\n return { ok: true };\r\n}\r\n\r\n// ─── v2 section validators ──────────────────────────────────────────────────\r\n\r\nfunction checkUserMessage(\r\n payload: AgentDragPayload<unknown>,\r\n eff: AgentPayloadLimits,\r\n): AgentPayloadValidationResult | null {\r\n if (payload.userMessage === undefined) return null;\r\n if (typeof payload.userMessage !== 'string') return null; // structural; ts catches at the call site\r\n const bytes = utf8ByteLength(payload.userMessage);\r\n if (bytes > eff.maxUserMessageBytes) {\r\n return {\r\n ok: false,\r\n reason: 'user_message_too_large',\r\n fieldPath: 'userMessage',\r\n actualBytes: bytes,\r\n limitBytes: eff.maxUserMessageBytes,\r\n };\r\n }\r\n return null;\r\n}\r\n\r\nfunction checkSystemContext(\r\n payload: AgentDragPayload<unknown>,\r\n eff: AgentPayloadLimits,\r\n): AgentPayloadValidationResult | null {\r\n const ctx = payload.systemContext;\r\n if (!ctx) return null;\r\n const keys = Object.keys(ctx);\r\n if (keys.length > eff.maxSystemContextEntries) {\r\n return {\r\n ok: false,\r\n reason: 'system_context_too_many_entries',\r\n fieldPath: 'systemContext',\r\n actualBytes: keys.length,\r\n limitBytes: eff.maxSystemContextEntries,\r\n };\r\n }\r\n for (const k of keys) {\r\n const v = ctx[k];\r\n if (typeof v !== 'string') continue;\r\n const bytes = utf8ByteLength(v);\r\n if (bytes > eff.maxSystemContextValueBytes) {\r\n return {\r\n ok: false,\r\n reason: 'system_context_value_too_large',\r\n fieldPath: `systemContext.${k}`,\r\n actualBytes: bytes,\r\n limitBytes: eff.maxSystemContextValueBytes,\r\n };\r\n }\r\n }\r\n const ctxJsonBytes = utf8ByteLength(safeStringify(ctx));\r\n if (ctxJsonBytes > eff.maxSystemContextJsonBytes) {\r\n return {\r\n ok: false,\r\n reason: 'system_context_json_too_large',\r\n fieldPath: 'systemContext',\r\n actualBytes: ctxJsonBytes,\r\n limitBytes: eff.maxSystemContextJsonBytes,\r\n };\r\n }\r\n return null;\r\n}\r\n\r\nfunction checkAttachments(\r\n payload: AgentDragPayload<unknown>,\r\n eff: AgentPayloadLimits,\r\n): AgentPayloadValidationResult | null {\r\n const atts = payload.attachments;\r\n if (!atts) return null;\r\n if (atts.length > eff.maxAttachments) {\r\n return {\r\n ok: false,\r\n reason: 'too_many_attachments',\r\n fieldPath: 'attachments',\r\n actualBytes: atts.length,\r\n limitBytes: eff.maxAttachments,\r\n };\r\n }\r\n for (let i = 0; i < atts.length; i++) {\r\n const a = atts[i] as AgentEnvelopeAttachment;\r\n const path = `attachments[${i}]`;\r\n switch (a.kind) {\r\n case 'json': {\r\n const bytes = utf8ByteLength(safeStringify(a.json));\r\n if (bytes > eff.maxAttachmentJsonBytes) {\r\n return {\r\n ok: false,\r\n reason: 'attachment_json_too_large',\r\n fieldPath: `${path}.json`,\r\n actualBytes: bytes,\r\n limitBytes: eff.maxAttachmentJsonBytes,\r\n };\r\n }\r\n break;\r\n }\r\n case 'text': {\r\n const bytes = utf8ByteLength(a.text ?? '');\r\n if (bytes > eff.maxAttachmentTextBytes) {\r\n return {\r\n ok: false,\r\n reason: 'attachment_text_too_large',\r\n fieldPath: `${path}.text`,\r\n actualBytes: bytes,\r\n limitBytes: eff.maxAttachmentTextBytes,\r\n };\r\n }\r\n break;\r\n }\r\n case 'image':\r\n case 'file': {\r\n const bytes = utf8ByteLength(a.dataUrl ?? '');\r\n if (bytes > eff.maxAttachmentDataUrlBytes) {\r\n return {\r\n ok: false,\r\n reason: 'attachment_data_url_too_large',\r\n fieldPath: `${path}.dataUrl`,\r\n actualBytes: bytes,\r\n limitBytes: eff.maxAttachmentDataUrlBytes,\r\n };\r\n }\r\n break;\r\n }\r\n default:\r\n return {\r\n ok: false,\r\n reason: 'attachment_invalid_kind',\r\n fieldPath: `${path}.kind`,\r\n };\r\n }\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Validate `deepLinkRoute` — byte cap + minimal shape sanity check.\r\n *\r\n * The DS package is shell-agnostic, so full route grammar validation\r\n * (scheme prefixes, `..` segments, `//` runs) lives in the shell's\r\n * `DeepLinkService.isValidRoute` — the launcher is the authoritative\r\n * gate. Here we just enforce:\r\n * - byte cap so a malicious payload can't bloat the JSON\r\n * - must start with `/` so the value matches the launcher's contract\r\n * and a renderer can safely concatenate / display it.\r\n *\r\n * Anything more would force the DS to grow a second copy of the route\r\n * grammar; the launcher rejects malformed routes at click time so the\r\n * worst-case impact of a bad route landing here is a no-op click.\r\n */\r\nfunction checkDeepLinkRoute(\r\n payload: AgentDragPayload<unknown>,\r\n eff: AgentPayloadLimits,\r\n): AgentPayloadValidationResult | null {\r\n const route = payload.deepLinkRoute;\r\n if (route === undefined) return null;\r\n if (typeof route !== 'string') return null; // structural; ts catches at the call site\r\n if (!route.startsWith('/')) {\r\n return {\r\n ok: false,\r\n reason: 'deep_link_route_invalid_shape',\r\n fieldPath: 'deepLinkRoute',\r\n };\r\n }\r\n const bytes = utf8ByteLength(route);\r\n if (bytes > eff.maxDeepLinkRouteBytes) {\r\n return {\r\n ok: false,\r\n reason: 'deep_link_route_too_large',\r\n fieldPath: 'deepLinkRoute',\r\n actualBytes: bytes,\r\n limitBytes: eff.maxDeepLinkRouteBytes,\r\n };\r\n }\r\n return null;\r\n}\r\n\r\nfunction checkMcpScope(\r\n payload: AgentDragPayload<unknown>,\r\n eff: AgentPayloadLimits,\r\n): AgentPayloadValidationResult | null {\r\n const scope = payload.mcpScope;\r\n if (!scope) return null;\r\n const apis = scope.apis ?? [];\r\n if (apis.length > eff.maxMcpScopeApis) {\r\n return {\r\n ok: false,\r\n reason: 'mcp_scope_too_many_apis',\r\n fieldPath: 'mcpScope.apis',\r\n actualBytes: apis.length,\r\n limitBytes: eff.maxMcpScopeApis,\r\n };\r\n }\r\n for (let i = 0; i < apis.length; i++) {\r\n const bytes = utf8ByteLength(apis[i]);\r\n if (bytes > eff.maxMcpScopeApiBytes) {\r\n return {\r\n ok: false,\r\n reason: 'mcp_scope_api_too_large',\r\n fieldPath: `mcpScope.apis[${i}]`,\r\n actualBytes: bytes,\r\n limitBytes: eff.maxMcpScopeApiBytes,\r\n };\r\n }\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Returns a NEW payload with all string fields trimmed to fit the per-field cap, the\r\n * `plainTextFallback` trimmed to its cap, and the full envelope re-checked against the\r\n * JSON cap. Idempotent — a second call against the trimmed result yields equal output.\r\n *\r\n * Throws {@link AgentPayloadOversizeError} only if even an empty trim couldn't shrink it\r\n * under the cap (e.g. an envelope with 1000+ nested empty objects). The error subclasses\r\n * `RangeError`, so legacy `instanceof RangeError` checks still match. Apps that hit this\r\n * should re-shape `payload` rather than call again.\r\n */\r\nexport function trimAgentPayload<T>(\r\n payload: AgentDragPayload<T>,\r\n limits?: Partial<AgentPayloadLimits>,\r\n): AgentDragPayload<T> {\r\n const eff: AgentPayloadLimits = { ...DEFAULT_AGENT_PAYLOAD_LIMITS, ...(limits ?? {}) };\r\n\r\n const trimmedFallback = trimAgentString(payload.plainTextFallback ?? '', eff.maxPlainTextFallbackBytes);\r\n const trimmedPayload = mapStrings(payload.payload, (s) => trimAgentString(s, eff.maxStringFieldBytes)) as T;\r\n\r\n const next: AgentDragPayload<T> = {\r\n ...payload,\r\n plainTextFallback: trimmedFallback,\r\n payload: trimmedPayload,\r\n };\r\n\r\n const jsonBytes = utf8ByteLength(safeStringify(next));\r\n if (jsonBytes > eff.maxJsonBytes) {\r\n throw new AgentPayloadOversizeError(\r\n `AgentDragPayload exceeds maxJsonBytes (${jsonBytes} > ${eff.maxJsonBytes}) after string trimming. Re-shape the payload.`,\r\n jsonBytes,\r\n eff.maxJsonBytes,\r\n );\r\n }\r\n return next;\r\n}\r\n\r\n// ─── Internal helpers ───────────────────────────────────────────────────────\r\n\r\n/**\r\n * Recursively walks `value`, returning the first string field that exceeds `maxBytes`\r\n * (as a structured failure). Returns `null` when every string fits.\r\n *\r\n * Path uses dotted property-access notation: `payload.body`, `payload.tags[2]`. Cycles\r\n * are detected via a WeakSet so attacker-crafted self-references don't loop forever.\r\n * Path strings are capped at {@link FIELD_PATH_MAX_CHARS} characters via {@link appendPath}\r\n * to prevent a malicious payload with multi-MB property keys from producing a multi-MB\r\n * `fieldPath` that locks up dev tools when logged.\r\n */\r\nfunction walkStringsForOverage(\r\n value: unknown,\r\n path: string,\r\n maxBytes: number,\r\n seen: WeakSet<object> = new WeakSet<object>(),\r\n): AgentPayloadValidationResult | null {\r\n if (typeof value === 'string') {\r\n const bytes = utf8ByteLength(value);\r\n if (bytes > maxBytes) {\r\n return {\r\n ok: false,\r\n reason: 'field_too_large',\r\n fieldPath: path,\r\n actualBytes: bytes,\r\n limitBytes: maxBytes,\r\n };\r\n }\r\n return null;\r\n }\r\n if (value === null || typeof value !== 'object') return null;\r\n if (seen.has(value as object)) return null;\r\n seen.add(value as object);\r\n\r\n if (Array.isArray(value)) {\r\n for (let i = 0; i < value.length; i++) {\r\n const r = walkStringsForOverage(value[i], appendPath(path, `[${i}]`), maxBytes, seen);\r\n if (r) return r;\r\n }\r\n return null;\r\n }\r\n for (const [k, v] of Object.entries(value as Record<string, unknown>)) {\r\n const r = walkStringsForOverage(v, appendPath(path, `.${k}`), maxBytes, seen);\r\n if (r) return r;\r\n }\r\n return null;\r\n}\r\n\r\n/**\r\n * Recursively maps every string leaf via `fn`, preserving object/array structure.\r\n * Cycles are short-circuited to `null` rather than throwing — the caller already\r\n * has a JSON.stringify cap that will catch any pathological input.\r\n */\r\nfunction mapStrings(value: unknown, fn: (s: string) => string, seen: WeakSet<object> = new WeakSet<object>()): unknown {\r\n if (typeof value === 'string') return fn(value);\r\n if (value === null || typeof value !== 'object') return value;\r\n if (seen.has(value as object)) return null;\r\n seen.add(value as object);\r\n\r\n if (Array.isArray(value)) {\r\n return value.map((v) => mapStrings(v, fn, seen));\r\n }\r\n const out: Record<string, unknown> = {};\r\n for (const [k, v] of Object.entries(value as Record<string, unknown>)) {\r\n out[k] = mapStrings(v, fn, seen);\r\n }\r\n return out;\r\n}\r\n\r\n/** `JSON.stringify` with a cycle-safe replacer — defends against attacker-crafted graphs. */\r\nfunction safeStringify(value: unknown): string {\r\n const seen = new WeakSet<object>();\r\n return JSON.stringify(value, (_k, v) => {\r\n if (v !== null && typeof v === 'object') {\r\n if (seen.has(v as object)) return '[Circular]';\r\n seen.add(v as object);\r\n }\r\n return v;\r\n });\r\n}\r\n","import { Injectable, signal } from '@angular/core';\r\nimport { Observable, Subject } from 'rxjs';\r\nimport type { AgentAction } from '../../models/agent-action.model';\r\nimport { AgentActionUnsupportedDispatchError } from '../../models/agent-action.model';\r\nimport { validateAgentPayload } from '../../utils/agent-payload-guards';\r\n\r\n/**\r\n * Imperative sibling to {@link AgentCommandRegistry} / {@link AgentDropRegistry}.\r\n *\r\n * Apps call {@link dispatch} to push a typed {@link AgentAction} onto the bus;\r\n * the agent panel subscribes once at construct and routes by verb. The bus\r\n * itself is a thin pass-through — it does NOT decide UI behaviour. The\r\n * subscriber (agent-panel) owns: showing the panel, staging the chip,\r\n * triggering the flight animation, and binding the command. This keeps the\r\n * DS free of host policy.\r\n *\r\n * Federation-safe: `providedIn: 'root'` + `sharedMappings: ['@flyos/design-system']`\r\n * give every federated remote the same singleton, so a remote's \"Explain\"\r\n * button reaches the host's panel without any cross-bundle wiring.\r\n *\r\n * Validation runs synchronously inside `dispatch` so a caller that sends an\r\n * oversize payload sees the throw at their site, not on the subscriber. The\r\n * subscriber therefore never has to defend against malformed envelopes.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class AgentActionBus {\r\n private readonly _actions$ = new Subject<AgentAction>();\r\n /** Hot stream of actions in dispatch order. Subscribers receive only\r\n * actions dispatched AFTER they subscribe — late subscribers see nothing\r\n * retroactively. Use {@link lastAction} for the latest snapshot. */\r\n readonly actions$: Observable<AgentAction> = this._actions$.asObservable();\r\n\r\n /** Most recent action — for DevTools, smoke tests, and late-subscriber\r\n * catch-up. Null until the first successful dispatch. */\r\n readonly lastAction = signal<AgentAction | null>(null);\r\n\r\n /**\r\n * The action currently being processed by the subscriber, or null when\r\n * none. Set by {@link dispatch} immediately before emitting on\r\n * {@link actions$}; cleared by the subscriber via {@link settle} once\r\n * it finishes its handler (success or fail). Lets the dispatcher render\r\n * a busy state on the originating control — e.g. a card swapping its\r\n * sparkle icon for a spinner while the agent panel mints the optimistic\r\n * thread and starts the request. Identity check (`bus.inFlight() === act`)\r\n * is the panel-side contract; dispatchers usually project to a stable id\r\n * inside the payload (e.g. <c>reportId</c>) to scope busy-state visually.\r\n *\r\n * If multiple dispatches race, the latest wins — the prior in-flight\r\n * action is dropped on the floor here (the panel may still handle it,\r\n * but the dispatcher's busy indicator follows the newer action). Apps\r\n * that need stricter single-flight semantics should guard at the call\r\n * site (the agent-panel's <c>_pendingTempThreadId</c> already does so\r\n * for the explain verb).\r\n */\r\n readonly inFlight = signal<AgentAction | null>(null);\r\n\r\n /**\r\n * Push an action onto the bus.\r\n *\r\n * Throws synchronously when:\r\n * - `dispatch === 'auto'` (not implemented in this DS version) — see\r\n * {@link AgentActionUnsupportedDispatchError}.\r\n * - the payload fails {@link validateAgentPayload} (oversize, invalid\r\n * version, invalid kind). The error message carries the field path\r\n * so the caller can fix the offending field.\r\n *\r\n * Subscribers see the action via {@link actions$} on the next tick of\r\n * the Subject; the {@link lastAction} signal updates synchronously\r\n * before the Subject emits so an effect reading both stays consistent.\r\n */\r\n dispatch<T>(action: AgentAction<T>): void {\r\n if (action.dispatch === 'auto') {\r\n throw new AgentActionUnsupportedDispatchError(action.dispatch);\r\n }\r\n const v = validateAgentPayload(action.payload);\r\n if (!v.ok) {\r\n const where = v.fieldPath ? ` at ${v.fieldPath}` : '';\r\n throw new Error(\r\n `AgentActionBus.dispatch: invalid payload — ${v.reason}${where}`,\r\n );\r\n }\r\n const a = action as AgentAction;\r\n this.lastAction.set(a);\r\n this.inFlight.set(a);\r\n this._actions$.next(a);\r\n }\r\n\r\n /**\r\n * Subscriber contract: call after the handler for {@link inFlight}\r\n * completes (success or fail). Only clears {@link inFlight} if it still\r\n * points at the passed action — a no-op when a later dispatch already\r\n * superseded it. Pass the same action reference the subscriber received\r\n * from {@link actions$}; identity is the gate.\r\n */\r\n settle(action: AgentAction): void {\r\n if (this.inFlight() === action) {\r\n this.inFlight.set(null);\r\n }\r\n }\r\n\r\n /**\r\n * Semantic alias of {@link settle} for explicit user-driven cancellation —\r\n * e.g. a future \"Stop\" button in the agent input tray, or a dispatcher\r\n * teardown that wants to abandon its own in-flight action. Identical\r\n * runtime behaviour (identity check + clear), but the two-method surface\r\n * lets the UI distinguish \"handler finished\" from \"user said no\" in\r\n * telemetry / logs without sniffing a \"reason\" parameter.\r\n *\r\n * Pass the same action reference returned from {@link inFlight} or held\r\n * by the dispatcher; identity is the gate.\r\n */\r\n cancel(action: AgentAction): void {\r\n if (this.inFlight() === action) {\r\n this.inFlight.set(null);\r\n }\r\n }\r\n}\r\n","import { Injectable } from '@angular/core';\r\n\r\n/**\r\n * FLIP-style entry animation for payloads landing in the agent panel.\r\n *\r\n * Pure DOM + Web Animations API — no Chart.js, no Angular animations module,\r\n * no CSS transitions racing layout. Honours `prefers-reduced-motion`: the\r\n * ghost is appended then removed without animating when the user asked for\r\n * less motion (so DOM side-effects stay consistent).\r\n *\r\n * Lifecycle:\r\n * 1. The agent panel calls {@link registerTarget} in `ngAfterViewInit`\r\n * with its header element.\r\n * 2. A source app dispatches an `AgentAction` carrying an `originRect`\r\n * from `getBoundingClientRect()` on the click target.\r\n * 3. The bus subscriber calls {@link flyInto} with that rect.\r\n * 4. The animator creates a fixed-position ghost at the origin, animates\r\n * transform + opacity toward the registered target's rect, then\r\n * removes itself on `onfinish` / `oncancel`.\r\n *\r\n * Uses `getBoundingClientRect()` (physical viewport coords) so the animation\r\n * is RTL-correct without inset-inline math — the rect already encodes the\r\n * physical position regardless of `dir`.\r\n *\r\n * The 900 ms duration and easing curve are deliberately hardcoded — making\r\n * them configurable surfaces an API the host can't usefully tune without\r\n * understanding motion design as a whole.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class AgentFlightAnimator {\r\n /** Hardcoded — see class doc. */\r\n private static readonly DURATION_MS = 900;\r\n private static readonly EASING = 'cubic-bezier(.2,.7,.2,1)';\r\n /** Floor the target/source scale ratio so a tiny target rect doesn't\r\n * collapse the ghost to invisibility before the animation finishes. */\r\n private static readonly MIN_SCALE = 0.05;\r\n\r\n private targetEl: HTMLElement | null = null;\r\n\r\n /** Called by the panel host to publish where flights should land. Pass\r\n * `null` on destroy so a re-mounted panel doesn't leave the animator\r\n * pointing at a detached node. */\r\n registerTarget(el: HTMLElement | null): void {\r\n this.targetEl = el;\r\n }\r\n\r\n /**\r\n * Animate a ghost element from {@link from} to the registered target's\r\n * rect. No-ops when:\r\n * - no target is registered (silent — panel may not be mounted yet)\r\n * - running outside a browser (SSR safety)\r\n * - the user has `prefers-reduced-motion: reduce` set (DOM is still\r\n * touched so callers see consistent side-effects, but no animation\r\n * runs)\r\n *\r\n * The ghost is appended to `document.body` (not the panel) so a parent\r\n * `overflow: hidden` on the panel can't clip the flight path.\r\n */\r\n flyInto(from: DOMRect, opts: { previewHtml?: string } = {}): void {\r\n if (!this.targetEl) return;\r\n if (typeof document === 'undefined') return;\r\n\r\n const reduced =\r\n typeof window !== 'undefined' && typeof window.matchMedia === 'function'\r\n ? window.matchMedia('(prefers-reduced-motion: reduce)').matches\r\n : false;\r\n\r\n const to = this.targetEl.getBoundingClientRect();\r\n const ghost = document.createElement('div');\r\n ghost.className = 'fly-agent-flight-ghost';\r\n // The ghost is purely decorative — it duplicates the source content\r\n // (chart title + snapshot) that the user just clicked and screen-reader\r\n // users have already heard via the sparkle button's aria-label. Re-\r\n // announcing the same content during the flight would be noisy at best\r\n // and confusing at worst. aria-hidden hides the subtree from assistive\r\n // tech while leaving it visible for sighted users.\r\n ghost.setAttribute('aria-hidden', 'true');\r\n // role=\"presentation\" is belt-and-braces — even if a future renderer\r\n // walks the tree looking for semantic landmarks, the ghost has none.\r\n ghost.setAttribute('role', 'presentation');\r\n if (opts.previewHtml) {\r\n // Caller is responsible for safe HTML — the bus subscriber escapes\r\n // plainTextFallback before passing it here.\r\n ghost.innerHTML = opts.previewHtml;\r\n }\r\n Object.assign(ghost.style, {\r\n position: 'fixed',\r\n left: `${from.left}px`,\r\n top: `${from.top}px`,\r\n width: `${from.width}px`,\r\n height: `${from.height}px`,\r\n pointerEvents: 'none',\r\n zIndex: '99999',\r\n transformOrigin: 'top left',\r\n willChange: 'transform, opacity',\r\n } as Partial<CSSStyleDeclaration>);\r\n document.body.appendChild(ghost);\r\n\r\n if (reduced) {\r\n ghost.remove();\r\n return;\r\n }\r\n\r\n const dx = to.left - from.left;\r\n const dy = to.top - from.top;\r\n const sx = Math.max(to.width / from.width, AgentFlightAnimator.MIN_SCALE);\r\n const sy = Math.max(to.height / from.height, AgentFlightAnimator.MIN_SCALE);\r\n\r\n const anim = ghost.animate(\r\n [\r\n { transform: 'translate(0,0) scale(1,1)', opacity: 1 },\r\n { transform: `translate(${dx}px,${dy}px) scale(${sx},${sy})`, opacity: 0.15 },\r\n ],\r\n {\r\n duration: AgentFlightAnimator.DURATION_MS,\r\n easing: AgentFlightAnimator.EASING,\r\n fill: 'forwards',\r\n },\r\n );\r\n const cleanup = (): void => ghost.remove();\r\n anim.onfinish = cleanup;\r\n anim.oncancel = cleanup;\r\n }\r\n}\r\n","import { Directive, HostListener, inject, input } from '@angular/core';\r\nimport { DOCUMENT } from '@angular/common';\r\nimport {\r\n AGENT_DRAG_MIME,\r\n type AgentDragPayload,\r\n} from '../models/agent-input.model';\r\nimport { validateAgentPayload } from '../utils/agent-payload-guards';\r\n\r\n/**\r\n * Strict whitelist for the ghost element id. Letter-led ASCII, allows word/hyphen/colon/dot,\r\n * capped at 128 chars. Anything else is rejected before reaching `getElementById` so a\r\n * future maintainer can't swap to `querySelector` and quietly reintroduce a CSS-injection\r\n * vector. (`getElementById` itself is string-equality-safe; the whitelist is defence-in-depth.)\r\n */\r\nconst GHOST_ID_PATTERN = /^[A-Za-z][\\w\\-:.]{0,127}$/;\r\n\r\n/**\r\n * Single canonical way to declare a drag source for the agent input.\r\n *\r\n * Apply on any element a remote wants to make draggable into the `<fly-agent-input>`:\r\n *\r\n * ```html\r\n * <article [flyAgentDraggable]=\"() => buildPayload(trend)\" flyAgentDraggableGhostId=\"trend-ghost\">…</article>\r\n * ```\r\n *\r\n * On `dragstart` the directive:\r\n * 1. Resolves the payload (calls the builder fn if supplied; otherwise reads the\r\n * static value).\r\n * 2. Validates against {@link DEFAULT_AGENT_PAYLOAD_LIMITS} via\r\n * {@link validateAgentPayload}. On failure it `console.warn`s with the structured\r\n * reason and writes ONLY the `text/plain` fallback — the receiver still sees a\r\n * legible drop, but the typed envelope is skipped so a misconfigured app can't\r\n * corrupt downstream consumers with an oversize payload.\r\n * 3. Writes the typed MIME (`application/x-fly-agent-payload+json`) plus the\r\n * `text/plain` fallback so non-Fly drop targets still get useful text.\r\n * 4. Sets `effectAllowed = 'copy'` (we never *move* domain objects across windows).\r\n * 5. When `flyAgentDraggableGhostId` resolves to an element in the DOM, calls\r\n * `setDragImage` to use that element as the drag preview; otherwise the browser\r\n * default applies.\r\n *\r\n * Notes:\r\n * - Builder form is preferred over static — it captures fresh state at `dragstart`,\r\n * not at directive init. A static `AgentDragPayload` is fine for items whose\r\n * domain object never changes after the row mounts.\r\n * - The directive sets `[attr.draggable]=\"true\"` so callers don't have to.\r\n */\r\n@Directive({\r\n selector: '[flyAgentDraggable]',\r\n standalone: true,\r\n host: {\r\n '[attr.draggable]': '\"true\"',\r\n },\r\n})\r\nexport class FlyAgentDraggableDirective<T = unknown> {\r\n /**\r\n * Either a static payload or a builder evaluated at `dragstart` (preferred — captures\r\n * fresh state). `input.required` so misuse fails at template compile time.\r\n */\r\n readonly flyAgentDraggable = input.required<AgentDragPayload<T> | (() => AgentDragPayload<T>)>();\r\n\r\n /**\r\n * Optional ghost element id (an existing element in the DOM whose snapshot becomes\r\n * the drag image). Falls back to the default browser drag image when absent or the\r\n * element can't be resolved.\r\n *\r\n * Must be a valid HTML id (ASCII, letter-led). `getElementById` is intentional —\r\n * do NOT swap to `querySelector` without re-introducing this whitelist.\r\n */\r\n readonly flyAgentDraggableGhostId = input<string | undefined>(undefined);\r\n\r\n private readonly doc = inject(DOCUMENT);\r\n\r\n @HostListener('dragstart', ['$event'])\r\n onDragStart(ev: DragEvent): void {\r\n const dt = ev.dataTransfer;\r\n if (!dt) return;\r\n\r\n const payload = this.resolvePayload();\r\n const validation = validateAgentPayload(payload);\r\n\r\n if (!validation.ok) {\r\n console.warn('[flyAgentDraggable] payload validation failed; degrading to text/plain', validation);\r\n dt.setData('text/plain', payload.plainTextFallback ?? '');\r\n dt.effectAllowed = 'copy';\r\n return;\r\n }\r\n\r\n dt.setData(AGENT_DRAG_MIME, JSON.stringify(payload));\r\n dt.setData('text/plain', payload.plainTextFallback ?? '');\r\n dt.effectAllowed = 'copy';\r\n\r\n const ghostId = this.flyAgentDraggableGhostId();\r\n if (ghostId) {\r\n if (!GHOST_ID_PATTERN.test(ghostId)) {\r\n // Don't echo the rejected id (caller-controlled, could be huge).\r\n console.warn('[flyAgentDraggable] ignoring ghost id', { reason: 'invalid_ghost_id' });\r\n } else {\r\n const ghost = this.doc.getElementById(ghostId);\r\n if (ghost) {\r\n // Center the drag image; ResizeObserver-aware sizing is left to the host element.\r\n dt.setDragImage(ghost, ghost.clientWidth / 2, ghost.clientHeight / 2);\r\n }\r\n }\r\n }\r\n }\r\n\r\n private resolvePayload(): AgentDragPayload<T> {\r\n const raw = this.flyAgentDraggable();\r\n return typeof raw === 'function' ? (raw as () => AgentDragPayload<T>)() : raw;\r\n }\r\n}\r\n","import {\r\n Directive,\r\n ElementRef,\r\n Renderer2,\r\n OnDestroy,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { HttpClient, HttpErrorResponse } from '@angular/common/http';\r\nimport { retry, throwError, timer } from 'rxjs';\r\n\r\n/** Files-manager answers a fresh (still-scanning) upload with `423 Locked` /\r\n * `SCAN_PENDING` until the background virus scan clears it. */\r\nconst SCAN_PENDING_STATUS = 423;\r\n\r\n/** Matches the retry budget used by the hand-rolled `423` retries in the notes\r\n * and documents markdown editors (`notes-editor.component.ts`,\r\n * `documents-editor.component.ts`) — the scan usually clears within a few\r\n * seconds, so six attempts comfortably covers the common case without\r\n * hammering the endpoint indefinitely on a stuck scan. */\r\nconst SCAN_PENDING_MAX_RETRIES = 6;\r\n\r\n/** Fallback delay when the response carries no (or an unparsable) `Retry-After`\r\n * header — mirrors the flat 2s the editor call sites use today. */\r\nconst SCAN_PENDING_DEFAULT_DELAY_MS = 2000;\r\n\r\n/** States the host can react to via {@link FlySecureSrcDirective.flySecureSrcStateChange}\r\n * or the `data-fly-secure-src-state` attribute mirrored onto the host element. */\r\nexport type FlySecureSrcState = 'idle' | 'loading' | 'ready' | 'error';\r\n\r\n/**\r\n * Resolves a `423 Locked` / `SCAN_PENDING` error's `Retry-After` header to a\r\n * delay in milliseconds. The header is advisory and, per RFC 9110, either a\r\n * number of seconds or an HTTP-date — both are handled. Falls back to\r\n * {@link SCAN_PENDING_DEFAULT_DELAY_MS} when the header is missing or\r\n * unparsable.\r\n */\r\nfunction scanPendingDelayMs(err: HttpErrorResponse): number {\r\n const header = err.headers?.get('Retry-After');\r\n if (!header) return SCAN_PENDING_DEFAULT_DELAY_MS;\r\n\r\n const seconds = Number(header);\r\n if (Number.isFinite(seconds) && seconds >= 0) return seconds * 1000;\r\n\r\n const dateMs = Date.parse(header);\r\n if (!Number.isNaN(dateMs)) {\r\n const diff = dateMs - Date.now();\r\n if (diff > 0) return diff;\r\n }\r\n\r\n return SCAN_PENDING_DEFAULT_DELAY_MS;\r\n}\r\n\r\n/**\r\n * Renders an authenticated image into a host `<img>` element by fetching the\r\n * resource as a blob through Angular's `HttpClient` and binding the resulting\r\n * object URL to the host's `src` attribute.\r\n *\r\n * Why this exists: every Business / Supporting app stores files in the Files\r\n * Manager service, which authenticates with a Bearer JWT. A raw `<img src>`\r\n * request bypasses the Angular HTTP interceptor — the browser issues the GET\r\n * without the Authorization header, so the response is 401 and the image is\r\n * broken. The standard workaround is roughly fifteen lines of `effect` +\r\n * `URL.createObjectURL` + `URL.revokeObjectURL` per call site (see prior\r\n * inline copies in `FlyImageUploadComponent` and the Circles trend-detail\r\n * cover). This directive centralizes that pattern so:\r\n *\r\n * * Memory hygiene is automatic — the previous object URL is revoked\r\n * whenever the input changes and on destroy. Easy to forget inline.\r\n * * Error handling is uniform — a fetch failure clears the host `src`\r\n * so the browser shows its broken-image affordance once, not the prior\r\n * image stuck on screen.\r\n * * A future protocol change (per-request signed URLs, CDN tokens, etc.)\r\n * lands in one place rather than across every app's image bindings.\r\n *\r\n * Usage:\r\n *\r\n * ```html\r\n * <img [flySecureSrc]=\"trend.coverImageId\" alt=\"\" class=\"cover-img\" />\r\n * ```\r\n *\r\n * Pass a full URL when the resource lives somewhere other than the default\r\n * Files Manager download endpoint:\r\n *\r\n * ```html\r\n * <img [flySecureSrc]=\"'/api/avatars/' + user.id\" alt=\"\" />\r\n * ```\r\n *\r\n * A bare file id (no `/` prefix) is resolved against\r\n * `/api/files/{id}/download`, which matches the Files Manager convention\r\n * used everywhere in the platform. Anything that starts with `/` is treated\r\n * as a literal URL and passed through unchanged — apps with bespoke download\r\n * routes (signed Excel exports, attachment thumbnails, …) keep working\r\n * without a wrapper.\r\n *\r\n * ### Scan-pending retry\r\n *\r\n * A freshly-uploaded attachment is still being virus-scanned for the first\r\n * few seconds of its life; the Files Manager download endpoint answers\r\n * `423 Locked` / `SCAN_PENDING` (with an advisory `Retry-After` header) until\r\n * the scan clears. Rather than treating that like a permission error, the\r\n * directive retries the fetch — up to {@link SCAN_PENDING_MAX_RETRIES} times,\r\n * honoring `Retry-After` when present (falling back to a flat 2s) — and swaps\r\n * in the image automatically once the scan reports Clean. This mirrors the\r\n * hand-rolled `retry({ count: 6, delay: … })` policy already used by the\r\n * notes and documents markdown editors for the same `423` state.\r\n *\r\n * A terminal outcome — `403 SCAN_INFECTED`, `422 SCAN_FAILED`, any other\r\n * 4xx/5xx, or the retry budget running out while still `423` — falls back to\r\n * the original behavior: the `src` is cleared and the browser shows its\r\n * broken-image affordance.\r\n *\r\n * The host can observe the in-flight state two ways, both optional — existing\r\n * `[flySecureSrc]` bindings that use neither keep working unchanged:\r\n *\r\n * * The {@link flySecureSrcStateChange} output, for a host that wants to\r\n * drive its own spinner/skeleton markup instead of the bare `<img>`.\r\n * * The `data-fly-secure-src-state` attribute mirrored onto the host\r\n * element (`\"loading\"` while fetching or retrying a `423`, `\"ready\"` once\r\n * the blob is bound, `\"error\"` on a terminal failure, `\"idle\"` when no\r\n * src is bound), for a host that only needs CSS — e.g.\r\n * `img[flySecureSrc][data-fly-secure-src-state=\"loading\"] { opacity: .4 }`.\r\n */\r\n@Directive({\r\n selector: 'img[flySecureSrc]',\r\n standalone: true,\r\n})\r\nexport class FlySecureSrcDirective implements OnDestroy {\r\n /**\r\n * File id or absolute path. Passing `null` / `undefined` / `''` clears the\r\n * `src` attribute and revokes the previous blob. Useful when binding to a\r\n * signal whose value can become empty (e.g. after a file is detached).\r\n */\r\n readonly flySecureSrc = input<string | null | undefined>();\r\n\r\n /**\r\n * Fires whenever the resolution state changes — `'loading'` when the fetch\r\n * starts (including while retrying a `423 SCAN_PENDING`), `'ready'` once\r\n * the blob is bound to `src`, `'error'` on a terminal failure, `'idle'`\r\n * when the input is cleared. Optional: a host that doesn't bind it can\r\n * instead read the mirrored `data-fly-secure-src-state` attribute, or\r\n * ignore state entirely — existing bindings are unaffected either way.\r\n */\r\n readonly flySecureSrcStateChange = output<FlySecureSrcState>();\r\n\r\n private readonly http = inject(HttpClient);\r\n private readonly host = inject(ElementRef<HTMLImageElement>);\r\n private readonly renderer = inject(Renderer2);\r\n\r\n /**\r\n * The object URL currently bound to the host's `src` attribute. Tracked so\r\n * we can revoke it before binding a new one (avoids leaking blob memory\r\n * across rapid input changes — e.g. carousel scrubbing) and on destroy.\r\n */\r\n private currentUrl: string | null = null;\r\n\r\n constructor() {\r\n effect((onCleanup) => {\r\n const raw = this.flySecureSrc();\r\n this.releaseCurrent();\r\n this.renderer.removeAttribute(this.host.nativeElement, 'src');\r\n\r\n if (!raw) {\r\n this.setState('idle');\r\n return;\r\n }\r\n\r\n this.setState('loading');\r\n\r\n const url = raw.startsWith('/') ? raw : `/api/files/${raw}/download`;\r\n const sub = this.http\r\n .get(url, { responseType: 'blob' })\r\n .pipe(\r\n // While the upload is still being virus-scanned, files-manager answers\r\n // 423 SCAN_PENDING with an advisory Retry-After. Retry that state a\r\n // bounded number of times so the image appears automatically once the\r\n // scan clears. Any other error (401/403/404, terminal 403\r\n // SCAN_INFECTED, 422 SCAN_FAILED) re-throws immediately — the `delay`\r\n // notifier erroring stops `retry` right away without waiting.\r\n retry({\r\n count: SCAN_PENDING_MAX_RETRIES,\r\n delay: (err: HttpErrorResponse) =>\r\n err?.status === SCAN_PENDING_STATUS\r\n ? timer(scanPendingDelayMs(err))\r\n : throwError(() => err),\r\n }),\r\n )\r\n .subscribe({\r\n next: (blob) => {\r\n const objectUrl = URL.createObjectURL(blob);\r\n this.currentUrl = objectUrl;\r\n this.renderer.setAttribute(this.host.nativeElement, 'src', objectUrl);\r\n this.setState('ready');\r\n },\r\n // A 401 / 403 / 404 — or a 423 that outlasted the retry budget — means\r\n // the image is unavailable for this user. Don't loop further: clear the\r\n // src and let the host page render its own placeholder. Logging is\r\n // intentionally silent: it's expected on permission boundaries (e.g.\r\n // shared-evidence on a trend you can read but whose file you can't),\r\n // and stack-traces would be noise.\r\n error: () => {\r\n this.releaseCurrent();\r\n this.renderer.removeAttribute(this.host.nativeElement, 'src');\r\n this.setState('error');\r\n },\r\n });\r\n\r\n onCleanup(() => sub.unsubscribe());\r\n });\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.releaseCurrent();\r\n }\r\n\r\n private releaseCurrent(): void {\r\n if (this.currentUrl) {\r\n URL.revokeObjectURL(this.currentUrl);\r\n this.currentUrl = null;\r\n }\r\n }\r\n\r\n /** Mirrors the resolution state onto the host element's `data-fly-secure-src-state`\r\n * attribute (CSS-only consumers) and emits it via {@link flySecureSrcStateChange}\r\n * (consumers that want to drive their own template). */\r\n private setState(state: FlySecureSrcState): void {\r\n this.renderer.setAttribute(this.host.nativeElement, 'data-fly-secure-src-state', state);\r\n this.flySecureSrcStateChange.emit(state);\r\n }\r\n}\r\n","import { isDevMode } from '@angular/core';\r\n\r\n/**\r\n * Self-XSS console warning.\r\n *\r\n * Prints a loud, coloured notice in the browser DevTools console warning users\r\n * not to paste anything they don't understand. This is the standard defence\r\n * against \"self-XSS\" social-engineering attacks, where a victim is tricked into\r\n * pasting an attacker's script into the console, handing over their session.\r\n *\r\n * Shared across every FlyOS shell + remote so the same notice renders for users\r\n * regardless of which app they opened DevTools on.\r\n *\r\n * Pure side-effect, guarded for:\r\n * - non-browser (SSR / test) environments — skips silently;\r\n * - Angular debug/dev mode — the warning targets end users on a production\r\n * build, and would only be noise (or hide real logs) for developers running\r\n * locally, so it is suppressed in dev/debug builds.\r\n *\r\n * Dev-mode detection across the federation boundary: this util ships inside the\r\n * shared `@flyos/design-system` singleton, so its `isDevMode()` call\r\n * resolves to the SHARED `@angular/core` singleton. Native Federation builds\r\n * that shared bundle with `ngDevMode` hard-stamped to `false` even during\r\n * `ng serve` (the serve target doesn't pass `dev:true`), so the bundled\r\n * `isDevMode()` wrongly returns `false` on localhost and the notice would\r\n * print. Federated hosts must therefore pass their own build mode via\r\n * {@link ConsoleSecurityWarningOptions.isDevBuild}; `isDevMode()` is kept only\r\n * as the correct default for standalone (non-federated) callers.\r\n *\r\n * Safe to call multiple times — it only prints once per page.\r\n */\r\nlet printed = false;\r\n\r\nexport interface ConsoleSecurityWarningOptions {\r\n /**\r\n * Whether the *host application* is running a development/debug build.\r\n *\r\n * Pass the value of the host's own build-time `ngDevMode` define (reliable in\r\n * the host's app bundle). Omit only in standalone apps, where the fallback\r\n * `isDevMode()` reads the app's own correctly-defined `ngDevMode`. See the\r\n * federation note above for why the fallback can't be trusted in remotes/shell.\r\n */\r\n isDevBuild?: boolean;\r\n}\r\n\r\nexport function printConsoleSecurityWarning(options?: ConsoleSecurityWarningOptions): void {\r\n if (printed) return;\r\n // No `console` or not a real browser console (jsdom/SSR) — skip silently.\r\n if (typeof window === 'undefined' || typeof console === 'undefined' || !console.warn) return;\r\n // Developers running a dev/debug build don't need the end-user self-XSS notice.\r\n // Prefer the host-supplied flag over `isDevMode()` — see the federation note\r\n // above: the bundled `isDevMode()` reads the shared core singleton, which is\r\n // built in production mode (`ngDevMode=false`) even under `ng serve`.\r\n const isDevBuild = options?.isDevBuild ?? isDevMode();\r\n if (isDevBuild) return;\r\n printed = true;\r\n\r\n const title = 'background:#b00020;color:#fff;font-size:22px;font-weight:bold;padding:6px 12px;border-radius:4px;';\r\n const lead = 'color:#b00020;font-size:15px;font-weight:bold;';\r\n const body = 'color:#1a1a1a;font-size:13px;';\r\n\r\n // Emitted at `warn` level (not `log`) so the notice survives the common\r\n // DevTools \"hide Info/Verbose\" filter — a security warning must not be\r\n // silently filtered out.\r\n console.warn('%c⚠ Stop!', title);\r\n console.warn(\r\n '%cThis is a browser developer feature intended for developers.',\r\n lead,\r\n );\r\n console.warn(\r\n '%cIf someone told you to copy and paste something here to enable a feature ' +\r\n 'or to \"hack\" FlyOS, it is a scam and will give them access to your account.\\n' +\r\n 'Never paste code you do not fully understand — it can steal your session, ' +\r\n 'your data, and act on your behalf.',\r\n body,\r\n );\r\n}\r\n","import type { FlyLocaleEntry } from './fly-locale-catalog.model';\r\n\r\n/**\r\n * Verbatim TypeScript port of the C# `LanguageDTO[] _AllLanguages` array supplied by\r\n * product. **31 entries**, in the canonical order. Three RTL flagged: `he-IL`, `ur-IN`,\r\n * `ar-AE`. Includes `cmn-Hant-TW` for Chinese and `ka-GE` for Georgian.\r\n *\r\n * The order matches the C# source byte-for-byte — do not re-sort. Downstream tests\r\n * (`fly-locale-catalog.spec.ts`) pin the count, the unique-key constraints, and the\r\n * RTL set; if you reorder or add an entry, those tests will guide the fix.\r\n *\r\n * The strings carry Cyrillic, Hebrew, Vietnamese, Thai, Indonesian, Bengali, Devanagari,\r\n * Urdu, Catalan, Polish, Korean, Russian, Japanese, Han, Turkish, Romanian, Norwegian,\r\n * Hungarian, Greek, Finnish, Danish, Dutch, Swedish, Portuguese, Italian, German,\r\n * Spanish, French, English, Arabic, and Georgian. The file is saved as UTF-8 without\r\n * BOM (matches every other locale file in the repo). The `…` (U+2026) ellipsis is\r\n * preserved verbatim.\r\n */\r\nexport const FLY_LOCALE_CATALOG: readonly FlyLocaleEntry[] = Object.freeze([\r\n {\r\n prefix: 'UK',\r\n dialect: 'uk-UA',\r\n englishName: 'Ukrainian',\r\n arabicName: 'الأوكرانية',\r\n nativeName: 'Українська',\r\n detected: 'Виявлена мова',\r\n searching: 'Шукаючи',\r\n elevating: 'Підняття до',\r\n translating: 'Переклад на',\r\n generatingAnswersForYou: 'Створення відповідей для вас...',\r\n learnMore: 'Дізнайтеся більше',\r\n waitingForResponseMsg: 'Будь ласка, наберіться терпіння, ми ще думаємо',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'HE',\r\n dialect: 'he-IL',\r\n englishName: 'Hebrew',\r\n arabicName: 'العبرية',\r\n nativeName: 'עברית',\r\n detected: 'שפה מזוהה',\r\n searching: 'מחפש אחר',\r\n elevating: 'מרומם ל',\r\n translating: 'תרגום ל',\r\n generatingAnswersForYou: 'מייצר עבורך תשובות...',\r\n learnMore: 'למידע נוסף',\r\n waitingForResponseMsg: 'אנא התאזרו בסבלנות, אנחנו עדיין חושבים',\r\n isRtl: true,\r\n },\r\n {\r\n prefix: 'VI',\r\n dialect: 'vi-VN',\r\n englishName: 'Vietnamese',\r\n arabicName: 'الفيتنامية',\r\n nativeName: 'Tiếng Việt',\r\n detected: 'Ngôn ngữ được phát hiện',\r\n searching: 'Tìm kiếm',\r\n elevating: 'Nâng lên',\r\n translating: 'Dịch sang',\r\n generatingAnswersForYou: 'Đang tạo câu trả lời cho bạn...',\r\n learnMore: 'Tìm hiểu thêm',\r\n waitingForResponseMsg: 'Vui lòng kiên nhẫn, chúng tôi vẫn đang suy nghĩ',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'TH',\r\n dialect: 'th-TH',\r\n englishName: 'Thai',\r\n arabicName: 'التايلاندية',\r\n nativeName: 'ไทย',\r\n detected: 'ภาษาที่ตรวจพบ',\r\n searching: 'ค้นหา',\r\n elevating: 'ยกระดับเป็น',\r\n translating: 'การแปล',\r\n generatingAnswersForYou: 'กำลังสร้างคำตอบให้กับคุณ...',\r\n learnMore: 'เรียนรู้เพิ่มเติม',\r\n waitingForResponseMsg: 'โปรดอดใจรอ, พวกเรายังคงกำลังคิดอยู่',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'ID',\r\n dialect: 'id-ID',\r\n englishName: 'Indonesian',\r\n arabicName: 'الإندونيسية',\r\n nativeName: 'Bahasa Indonesia',\r\n detected: 'Bahasa yang terdeteksi',\r\n searching: 'Mencari',\r\n elevating: 'Meninggalkan ke',\r\n translating: 'Menerjemahkan ke',\r\n generatingAnswersForYou: 'Menghasilkan jawaban untuk Anda...',\r\n learnMore: 'Cari tahu lebih lanjut',\r\n waitingForResponseMsg: 'Harap bersabar, kami masih sedang berpikir',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'BN',\r\n dialect: 'bn-BD',\r\n englishName: 'Bengali',\r\n arabicName: 'البنغالية',\r\n nativeName: 'বাংলা',\r\n detected: 'সনাক্ত করা ভাষা',\r\n searching: 'খুঁজছি',\r\n elevating: 'উন্নত',\r\n translating: 'অনুবাদ',\r\n generatingAnswersForYou: 'আপনার জন্য উত্তর তৈরি করা হচ্ছে...',\r\n learnMore: 'আরো জানুন',\r\n waitingForResponseMsg: 'অনুগ্রহ করে ধৈর্য ধরুন, আমরা এখনও চিন্তা করছি',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'HI',\r\n dialect: 'hi-IN',\r\n englishName: 'Hindi',\r\n arabicName: 'الهندية',\r\n nativeName: 'हिन्दी',\r\n detected: 'पता चला भाषा',\r\n searching: 'के लिए खोज रहे हैं',\r\n elevating: 'के लिए ऊंचा',\r\n translating: 'अनुवाद करना',\r\n generatingAnswersForYou: 'आपके लिए उत्तर तैयार किया जा रहा है...',\r\n learnMore: 'और जानें',\r\n waitingForResponseMsg: 'कृपया धैर्य रखें, हम अभी सोच रहे हैं',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'UR',\r\n dialect: 'ur-IN',\r\n englishName: 'Urdu',\r\n arabicName: 'الأردية',\r\n nativeName: 'اردو',\r\n detected: 'پتہ چلا زبان',\r\n searching: 'کے لیے تلاش',\r\n elevating: 'بلند کرنا',\r\n translating: 'ترجمہ کرنا',\r\n generatingAnswersForYou: 'آپ کے لیے جوابات تیار کیے جا رہے ہیں...',\r\n learnMore: 'مزید جانیں',\r\n waitingForResponseMsg: 'براہ کرم صبر کریں، ہم ابھی سوچ رہے ہیں۔',\r\n isRtl: true,\r\n },\r\n {\r\n prefix: 'CA',\r\n dialect: 'ca-ES',\r\n englishName: 'Catalan',\r\n arabicName: 'الكتالانية',\r\n nativeName: 'Català',\r\n detected: 'Idioma detectat',\r\n searching: 'Buscant',\r\n elevating: 'Elevant a',\r\n translating: 'Traduir a',\r\n generatingAnswersForYou: 'Generant respostes per a tu...',\r\n learnMore: 'Aprèn més',\r\n waitingForResponseMsg: 'Si us plau, tingueu paciència, encara estem pensant',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'PL',\r\n dialect: 'pl-PL',\r\n englishName: 'Polish',\r\n arabicName: 'البولندية',\r\n nativeName: 'Polski',\r\n detected: 'Wykryty język',\r\n searching: 'Szukać',\r\n elevating: 'Podniesienie do',\r\n translating: 'Tłumaczenie na',\r\n generatingAnswersForYou: 'Generowanie odpowiedzi dla Ciebie...',\r\n learnMore: 'Dowiedz się więcej',\r\n waitingForResponseMsg: 'Proszę o cierpliwość, nadal myślimy',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'KO',\r\n dialect: 'ko-KR',\r\n englishName: 'Korean',\r\n arabicName: 'الكورية',\r\n nativeName: '한국어',\r\n detected: '탐지 언어',\r\n searching: '검색',\r\n elevating: '상승',\r\n translating: '번역',\r\n generatingAnswersForYou: '답변을 생성하는 중...',\r\n learnMore: '더 알아보기',\r\n waitingForResponseMsg: '잠시만 기다려 주세요, 저희는 아직 생각 중입니다',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'RU',\r\n dialect: 'ru-RU',\r\n englishName: 'Russian',\r\n arabicName: 'الروسية',\r\n nativeName: 'Русский',\r\n detected: 'Обнаруженный язык',\r\n searching: 'В поисках',\r\n elevating: 'Поднимаясь до',\r\n translating: 'Перевод',\r\n generatingAnswersForYou: 'Генерация ответов для вас...',\r\n learnMore: 'Узнать больше',\r\n waitingForResponseMsg: 'Пожалуйста, подождите, мы всё ещё думаем',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'JA',\r\n dialect: 'ja-JP',\r\n englishName: 'Japanese',\r\n arabicName: 'اليابانية',\r\n nativeName: '日本語',\r\n detected: '検出言語',\r\n searching: '探している',\r\n elevating: '昇格',\r\n translating: '翻訳',\r\n generatingAnswersForYou: 'あなたのための答えを生成中...',\r\n learnMore: 'もっと詳しく',\r\n waitingForResponseMsg: '少々お待ちください、ただいま考え中です',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'ZH',\r\n dialect: 'cmn-Hant-TW',\r\n englishName: 'Chinese',\r\n arabicName: 'الصينية',\r\n nativeName: '中文',\r\n detected: '检测语言',\r\n searching: '搜索',\r\n elevating: '提升到',\r\n translating: '翻译成',\r\n generatingAnswersForYou: '为您生成答案...',\r\n learnMore: '了解更多',\r\n waitingForResponseMsg: '请耐心等待,我们还在思考',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'TR',\r\n dialect: 'tr-TR',\r\n englishName: 'Turkish',\r\n arabicName: 'التركية',\r\n nativeName: 'Türkçe',\r\n detected: 'Tespit edilen dil',\r\n searching: 'Arama',\r\n elevating: 'Yükseltme',\r\n translating: 'Çevirme',\r\n generatingAnswersForYou: 'Sizin için yanıtlar üretiliyor...',\r\n learnMore: 'Daha fazla bilgi edin',\r\n waitingForResponseMsg: 'Lütfen sabırlı olun, hâlâ düşünüyoruz',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'RO',\r\n dialect: 'ro-RO',\r\n englishName: 'Romanian',\r\n arabicName: 'الرومانية',\r\n nativeName: 'Română',\r\n detected: 'Limba detectată',\r\n searching: 'Căutare de',\r\n elevating: 'Elevator la',\r\n translating: 'Traducerea în',\r\n generatingAnswersForYou: 'Generarea de răspunsuri pentru tine...',\r\n learnMore: 'Află mai multe',\r\n waitingForResponseMsg: 'Vă rugăm să aveți răbdare, încă ne gândim',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'NO',\r\n dialect: 'nb-NO',\r\n englishName: 'Norwegian',\r\n arabicName: 'النرويجية',\r\n nativeName: 'Norsk',\r\n detected: 'Oppdaget språk',\r\n searching: 'Leter etter',\r\n elevating: 'Løfter til',\r\n translating: 'Oversette til',\r\n generatingAnswersForYou: 'Genererer svar for deg...',\r\n learnMore: 'Lær mer',\r\n waitingForResponseMsg: 'Vennligst vær tålmodig, vi tenker fortsatt',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'HU',\r\n dialect: 'hu-HU',\r\n englishName: 'Hungarian',\r\n arabicName: 'الهنغارية',\r\n nativeName: 'Magyar',\r\n detected: 'Detektált nyelv',\r\n searching: 'Keresés-ra,-re',\r\n elevating: 'Felemelve',\r\n translating: 'Fordítás',\r\n generatingAnswersForYou: 'Válaszok generálása az Ön számára...',\r\n learnMore: 'Tudj meg többet',\r\n waitingForResponseMsg: 'Kérjük, legyen türelemmel, még gondolkodunk',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'EL',\r\n dialect: 'el-GR',\r\n englishName: 'Greek',\r\n arabicName: 'اليونانية',\r\n nativeName: 'Ελληνικά',\r\n detected: 'Εντοπισμένη γλώσσα',\r\n searching: 'Ψάχνοντας για',\r\n elevating: 'Ανυψώ',\r\n translating: 'Μεταφράζοντας σε',\r\n generatingAnswersForYou: 'Δημιουργία απαντήσεων για εσάς...',\r\n learnMore: 'Μάθε περισσότερα',\r\n waitingForResponseMsg: 'Παρακαλώ περιμένετε με υπομονή, σκεφτόμαστε ακόμα',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'FI',\r\n dialect: 'fi-FI',\r\n englishName: 'Finnish',\r\n arabicName: 'الفنلندية',\r\n nativeName: 'Suomi',\r\n detected: 'Havaittu kieli',\r\n searching: 'Etsimässä',\r\n elevating: 'Nousee jhk',\r\n translating: 'Kääntäen',\r\n generatingAnswersForYou: 'Luodaan vastauksia sinulle...',\r\n learnMore: 'Lue lisää',\r\n waitingForResponseMsg: 'Ole hyvä ja ole kärsivällinen, ajattelemme yhä',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'DA',\r\n dialect: 'da-DK',\r\n englishName: 'Danish',\r\n arabicName: 'الدانماركية',\r\n nativeName: 'Dansk',\r\n detected: 'Opdaget sprog',\r\n searching: 'Leder efter',\r\n elevating: 'Hæve til',\r\n translating: 'Oversættelse til',\r\n generatingAnswersForYou: 'Generer svar til dig...',\r\n learnMore: 'Lær mere',\r\n waitingForResponseMsg: 'Vent venligst tålmodigt, vi tænker stadig',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'NL',\r\n dialect: 'nl-NL',\r\n englishName: 'Dutch',\r\n arabicName: 'الهولندية',\r\n nativeName: 'Nederlands',\r\n detected: 'Gedetecteerde taal',\r\n searching: 'Op zoek naar',\r\n elevating: 'Verheffen tot',\r\n translating: 'Vertalen naar',\r\n generatingAnswersForYou: 'Antwoorden voor u genereren...',\r\n learnMore: 'Lees meer',\r\n waitingForResponseMsg: 'Gelieve geduld te hebben, we zijn nog aan het nadenken',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'SV',\r\n dialect: 'sv-SE',\r\n englishName: 'Swedish',\r\n arabicName: 'السويدية',\r\n nativeName: 'Svenska',\r\n detected: 'Upptäckt språk',\r\n searching: 'Söker efter',\r\n elevating: 'Upphöjande till',\r\n translating: 'Översätta till',\r\n generatingAnswersForYou: 'Genererar svar åt dig...',\r\n learnMore: 'Läs mer',\r\n waitingForResponseMsg: 'Vänligen ha tålamod, vi tänker fortfarande',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'PT',\r\n dialect: 'pt-PT',\r\n englishName: 'Portuguese',\r\n arabicName: 'البرتغالية',\r\n nativeName: 'Português',\r\n detected: 'Idioma detectado',\r\n searching: 'Procurando por',\r\n elevating: 'Elevando para',\r\n translating: 'Traduzindo para',\r\n generatingAnswersForYou: 'Gerando respostas para você...',\r\n learnMore: 'Saiba mais',\r\n waitingForResponseMsg: 'Por favor, tenha paciência, ainda estamos a pensar',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'IT',\r\n dialect: 'it-IT',\r\n englishName: 'Italian',\r\n arabicName: 'الإيطالية',\r\n nativeName: 'Italiano',\r\n detected: 'Lingua rilevata',\r\n searching: 'Alla ricerca di',\r\n elevating: 'Elevare a',\r\n translating: 'Tradurre in',\r\n generatingAnswersForYou: 'Generazione di risposte per te...',\r\n learnMore: 'Scopri di più',\r\n waitingForResponseMsg: 'Per favore, abbi pazienza, stiamo ancora pensando',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'DE',\r\n dialect: 'de-DE',\r\n englishName: 'German',\r\n arabicName: 'الألمانية',\r\n nativeName: 'Deutsch',\r\n detected: 'Erkannte Sprache',\r\n searching: 'Auf der Suche nach',\r\n elevating: 'Erhöhung zu',\r\n translating: 'Übersetzung auf',\r\n generatingAnswersForYou: 'Wir generieren Antworten für Sie...',\r\n learnMore: 'Erfahre mehr',\r\n waitingForResponseMsg: 'Bitte haben Sie Geduld, wir denken noch nach',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'ES',\r\n dialect: 'es-AR',\r\n englishName: 'Spanish',\r\n arabicName: 'الأسبانية',\r\n nativeName: 'Español',\r\n detected: 'Idioma detectado',\r\n searching: 'Buscando',\r\n elevating: 'Elevando a',\r\n translating: 'Traduciendo a',\r\n generatingAnswersForYou: 'Generando respuestas para ti...',\r\n learnMore: 'Aprende más',\r\n waitingForResponseMsg: 'Por favor, ten paciencia, todavía estamos pensando',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'FR',\r\n dialect: 'fr-FR',\r\n englishName: 'French',\r\n arabicName: 'الفرنسية',\r\n nativeName: 'Français',\r\n detected: 'Langue détectée',\r\n searching: 'À la recherche de',\r\n elevating: 'Élever à',\r\n translating: 'Traduire par',\r\n generatingAnswersForYou: 'Générer des réponses pour vous...',\r\n learnMore: 'En savoir plus',\r\n waitingForResponseMsg: 'Veuillez patienter, nous réfléchissons encore',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'EN',\r\n dialect: 'en-US',\r\n englishName: 'English',\r\n arabicName: 'الإنجليزية',\r\n nativeName: 'English',\r\n detected: 'Detected language',\r\n searching: 'Searching for',\r\n elevating: 'Elevating to',\r\n translating: 'Translating to',\r\n generatingAnswersForYou: 'Generating answers for you...',\r\n learnMore: 'Learn more',\r\n waitingForResponseMsg: 'Please bear with us, we are still thinking',\r\n isRtl: false,\r\n },\r\n {\r\n prefix: 'AR',\r\n dialect: 'ar-AE',\r\n englishName: 'Arabic',\r\n arabicName: 'العربية',\r\n nativeName: 'العربية',\r\n detected: 'اللغة المكتشفة',\r\n searching: 'البحث عن',\r\n elevating: 'رفع إلى',\r\n translating: 'ترجمة إلى',\r\n generatingAnswersForYou: 'جارٍ إنشاء إجابات لك...',\r\n learnMore: 'تعرف على المزيد',\r\n waitingForResponseMsg: 'نرجو منك التحلّي بالصبر، نحن ما زلنا نفكر',\r\n isRtl: true,\r\n },\r\n {\r\n prefix: 'KA',\r\n dialect: 'ka-GE',\r\n englishName: 'Georgian',\r\n arabicName: 'الجورجية',\r\n nativeName: 'ქართული',\r\n detected: 'გამოვლენილი ენა',\r\n searching: 'ძიება',\r\n elevating: 'ამაღლება',\r\n translating: 'თარგმნა',\r\n generatingAnswersForYou: 'პასუხების გენერირება თქვენთვის...',\r\n learnMore: 'გაიგე მეტი',\r\n waitingForResponseMsg: 'გთხოვთ მოითმინოთ, ჯერ კიდევ ვფიქრობთ',\r\n isRtl: false,\r\n },\r\n]) as readonly FlyLocaleEntry[];\r\n\r\n/**\r\n * Lookup by BCP-47 dialect (e.g. `'ar-AE'`). Case-insensitive per BCP-47 §2.1.1\r\n * (subtags are case-insensitive on the wire) — accepts `'en-US'`, `'en-us'`,\r\n * `'EN-US'`, etc. all as the canonical EN entry. The catalog itself keeps its\r\n * canonical casing for display.\r\n *\r\n * Returns `undefined` when not found; callers decide whether to fall back to `'en-US'`.\r\n */\r\nexport function findLocaleByDialect(dialect: string): FlyLocaleEntry | undefined {\r\n if (typeof dialect !== 'string' || dialect.length === 0) return undefined;\r\n const lower = dialect.toLowerCase();\r\n return FLY_LOCALE_CATALOG.find((e) => e.dialect.toLowerCase() === lower);\r\n}\r\n\r\n/**\r\n * Lookup by short prefix (e.g. `'AR'`). Prefixes are unique in the catalog (asserted by tests).\r\n * Case-insensitive — accepts `'AR'`, `'ar'`, `'Ar'`. Catalog stores prefixes uppercase\r\n * for display.\r\n */\r\nexport function findLocaleByPrefix(prefix: string): FlyLocaleEntry | undefined {\r\n if (typeof prefix !== 'string' || prefix.length === 0) return undefined;\r\n const lower = prefix.toLowerCase();\r\n return FLY_LOCALE_CATALOG.find((e) => e.prefix.toLowerCase() === lower);\r\n}\r\n\r\n/**\r\n * Type-narrowing helper for entries flagged RTL.\r\n *\r\n * Named with the `Entry` suffix to avoid colliding with the existing\r\n * `isRtlLocale(lang: string)` from `i18n.service.ts`, which answers a different\r\n * question (is the *UI* locale code RTL?). Both helpers coexist in `public-api`.\r\n */\r\nexport function isRtlLocaleEntry(\r\n entry: FlyLocaleEntry,\r\n): entry is FlyLocaleEntry & { isRtl: true } {\r\n return entry.isRtl === true;\r\n}\r\n","/**\r\n * Chunk-load failure detection + one-shot self-heal.\r\n *\r\n * The \"chunk 404 after redeploy\" problem hits every separately-served FlyOS\r\n * SPA — the shell, the admin portal, and every External App standalone build.\r\n * A browser still running the PREVIOUS build lazy-loads a content-hashed chunk\r\n * that the new deploy deleted → the dynamic `import()` rejects. The non-cached\r\n * `index.html` fixes the NEXT full load, but cannot rescue an already-open tab.\r\n * Recognising the failure and reloading once does.\r\n *\r\n * This is the canonical implementation. External Apps should NOT copy it — wire\r\n * {@link provideFlyChunkReloadRecovery} into their `ApplicationConfig` providers\r\n * and inherit it.\r\n *\r\n * ## Error shapes recognised\r\n *\r\n * - **webpack**: `ChunkLoadError` / `Loading chunk 42 failed`.\r\n * - **native `import()`** (Angular esbuild, no es-module-shims): `TypeError:\r\n * Failed to fetch dynamically imported module: https://…/chunk-….js`\r\n * (Chromium) or `error loading dynamically imported module`\r\n * (Firefox/WebKit). This is what a plain esbuild SPA produces.\r\n * - **es-module-shims** (Native Federation hosts/remotes): a bare `TypeError:\r\n * <status> <url>` — e.g. `404 https://…/chunk-….js`.\r\n *\r\n * The match is message-substring based and case-insensitive; a bare HTTP status\r\n * only counts when it accompanies a script-module URL, so an unrelated error\r\n * that merely contains a number (or an API 404) never triggers a reload.\r\n */\r\n\r\nconst DYNAMIC_IMPORT_PHRASES: readonly string[] = [\r\n // webpack\r\n 'loading chunk',\r\n 'chunkloaderror',\r\n // native dynamic import\r\n 'failed to fetch dynamically imported module',\r\n 'error loading dynamically imported module',\r\n 'importing a module script failed',\r\n];\r\n\r\n/** True when `err` is a failed lazy/dynamic module (chunk) load. */\r\nexport function isChunkLoadError(err: unknown): boolean {\r\n const msg = extractMessage(err).toLowerCase();\r\n if (!msg) return false;\r\n\r\n if (DYNAMIC_IMPORT_PHRASES.some((p) => msg.includes(p))) return true;\r\n\r\n const looksLikeModuleUrl =\r\n /https?:\\/\\/\\S+\\.m?js\\b/.test(msg) || /\\/chunk-\\S+\\.m?js\\b/.test(msg);\r\n const looksLikeFetchStatus =\r\n /\\b(4\\d\\d|5\\d\\d)\\b/.test(msg) || msg.includes('failed to fetch');\r\n return looksLikeModuleUrl && looksLikeFetchStatus;\r\n}\r\n\r\n/**\r\n * sessionStorage key recording that this tab session's single chunk-error\r\n * reload was already spent. It persists across the reload it triggers (an\r\n * in-memory flag resets on reload and cannot guard a loop).\r\n */\r\nexport const FLY_CHUNK_RELOAD_FLAG = 'fly:chunk-reload-attempted';\r\n\r\n/**\r\n * One-shot self-heal for a stale client after a redeploy. Permits exactly ONE\r\n * reload per tab session, so a reload that keeps failing (a chunk truly missing\r\n * from the current build, or a genuinely-down host) does NOT loop.\r\n *\r\n * @returns `true` when a reload was initiated (the page will navigate away);\r\n * `false` when the session's reload was already spent or sessionStorage is\r\n * unavailable — callers should surface a fallback / stop rather than spin.\r\n */\r\nexport function reloadOnceForChunkError(): boolean {\r\n try {\r\n if (sessionStorage.getItem(FLY_CHUNK_RELOAD_FLAG)) return false;\r\n sessionStorage.setItem(FLY_CHUNK_RELOAD_FLAG, '1');\r\n } catch {\r\n // Private mode / quota / non-browser: cannot record the attempt, so cannot\r\n // prove a reload wouldn't loop. Prefer the fallback over a spin.\r\n return false;\r\n }\r\n window.location.reload();\r\n return true;\r\n}\r\n\r\n/**\r\n * The Native Federation *import-map* failure — distinct from a chunk-404.\r\n *\r\n * NF emits shared singletons as VERSION-hashed bundles (`_angular_core.<hash>.js`,\r\n * `_flyos_design_system.<hash>.js`): the filename stays byte-identical\r\n * across deploys while the internal `@nf-internal/chunk-*` graph it imports changes.\r\n * A browser holding such a bundle from a cache entry that was served `immutable`\r\n * never revalidates it, so after a redeploy it imports a `@nf-internal/chunk-*` the\r\n * new build deleted and dies with **`Unable to resolve specifier\r\n * '@nf-internal/chunk-…'`** — an import-map resolution failure that aborts module\r\n * instantiation *before* any Angular code runs.\r\n *\r\n * {@link reloadOnceForChunkError} cannot fix this: a plain reload re-serves the same\r\n * cached immutable bundle. Only re-fetching the shared bundles with `{cache:'reload'}`\r\n * (see {@link healNativeFederationCacheOnce}) defeats an already-cached immutable\r\n * resource short of a manual clear.\r\n */\r\nexport function isNativeFederationCacheError(err: unknown): boolean {\r\n const msg = extractMessage(err);\r\n if (!msg) return false;\r\n return /Unable to resolve specifier ['\"]?@nf-internal\\/chunk-/i.test(msg);\r\n}\r\n\r\n/**\r\n * sessionStorage key recording that this tab session's single Native-Federation\r\n * cache-heal (revalidation sweep + reload) was already spent — separate from\r\n * {@link FLY_CHUNK_RELOAD_FLAG} so a plain chunk-404 reload and a shared-bundle\r\n * revalidation sweep each get one independent attempt.\r\n */\r\nexport const FLY_NF_CACHE_HEAL_FLAG = 'nf-cache-heal-attempted';\r\n\r\n/**\r\n * One-shot self-heal for the import-map / stale-shared-bundle failure. Re-fetches\r\n * every shared bundle named in the app's own `remoteEntry.json` with\r\n * `{cache:'reload'}` — force-revalidating the HTTP cache so an already-cached\r\n * immutable `_*.js` is replaced by the current build's bytes — then reloads once.\r\n * Guarded by {@link FLY_NF_CACHE_HEAL_FLAG} so a genuinely-broken deploy can't loop.\r\n *\r\n * Sweeps the *current origin's* remoteEntry (resolved against `document.baseURI`),\r\n * which is correct for a standalone External App and for the shell acting as its own\r\n * host. A stale bundle belonging to a nested *remote* is out of scope here — the\r\n * federation version contract guards mount-time skew for that path.\r\n *\r\n * @returns `true` when a reload was initiated; `false` when already spent or\r\n * sessionStorage is unavailable (caller should surface a fallback).\r\n */\r\nexport function healNativeFederationCacheOnce(): boolean {\r\n try {\r\n if (sessionStorage.getItem(FLY_NF_CACHE_HEAL_FLAG)) return false;\r\n sessionStorage.setItem(FLY_NF_CACHE_HEAL_FLAG, '1');\r\n } catch {\r\n return false;\r\n }\r\n const reload = (): void => {\r\n try {\r\n window.location.reload();\r\n } catch {\r\n /* non-browser / navigation already underway */\r\n }\r\n };\r\n const resolve = (rel: string): string => {\r\n try {\r\n return new URL(rel, document.baseURI).href;\r\n } catch {\r\n return rel;\r\n }\r\n };\r\n void fetch(resolve('remoteEntry.json'), { cache: 'reload' })\r\n .then((r) => r.json())\r\n .then((entry: { shared?: { outFileName?: string }[] }) => {\r\n const files = [\r\n ...new Set(\r\n (entry.shared ?? [])\r\n .map((s) => s?.outFileName)\r\n .filter((f): f is string => typeof f === 'string' && f.length > 0),\r\n ),\r\n ];\r\n return Promise.all(files.map((f) => fetch(resolve(f), { cache: 'reload' }).catch(() => undefined)));\r\n })\r\n .then(reload, reload);\r\n return true;\r\n}\r\n\r\nfunction extractMessage(err: unknown): string {\r\n if (err == null) return '';\r\n if (typeof err === 'string') return err;\r\n if (err instanceof Error) {\r\n // Include the cause chain — es-module-shims often nests the real fetch\r\n // failure as `error.cause`.\r\n const cause = (err as { cause?: unknown }).cause;\r\n return cause != null ? `${err.message}\\n${extractMessage(cause)}` : err.message;\r\n }\r\n if (typeof err === 'object' && 'message' in err) {\r\n return String((err as { message: unknown }).message ?? '');\r\n }\r\n return String(err);\r\n}\r\n","import { ErrorHandler, Injectable, type Provider } from '@angular/core';\r\n\r\nimport {\r\n healNativeFederationCacheOnce,\r\n isChunkLoadError,\r\n isNativeFederationCacheError,\r\n reloadOnceForChunkError,\r\n} from '../utils/chunk-load-error';\r\n\r\n/**\r\n * Drop-in `ErrorHandler` that self-heals the \"chunk 404 after redeploy\" failure\r\n * class: a stale client's lazy `import()` for a deleted content-hashed chunk is\r\n * detected and recovered with a single reload (capped at one per tab session so\r\n * it never loops). Every other error falls through to Angular's default\r\n * `ErrorHandler` behaviour (console logging).\r\n *\r\n * Prefer {@link provideFlyChunkReloadRecovery} over registering this directly.\r\n * An app that already ships its own custom `ErrorHandler` should fold the two\r\n * checks (`isChunkLoadError` → `reloadOnceForChunkError`) into that handler\r\n * instead of replacing it.\r\n */\r\n@Injectable()\r\nexport class FlyChunkReloadErrorHandler extends ErrorHandler {\r\n override handleError(error: unknown): void {\r\n // Stale VERSION-hashed shared bundle → cached immutable `_*.js` imports a deleted\r\n // `@nf-internal/chunk-*`. A plain reload can't fix it; revalidate the shared\r\n // bundles first, then reload. Checked before the chunk-404 path.\r\n if (isNativeFederationCacheError(error)) {\r\n console.warn('[Fly] Native Federation stale-cache failure detected, revalidating…');\r\n healNativeFederationCacheOnce();\r\n return;\r\n }\r\n if (isChunkLoadError(error)) {\r\n console.warn('[Fly] Chunk load failure detected, reloading…');\r\n reloadOnceForChunkError();\r\n return;\r\n }\r\n super.handleError(error);\r\n }\r\n}\r\n\r\n/**\r\n * One-line opt-in for the chunk-reload self-heal. Add to an app's\r\n * `ApplicationConfig.providers`:\r\n *\r\n * ```ts\r\n * export const appConfig: ApplicationConfig = {\r\n * providers: [provideFlyChunkReloadRecovery(), ...],\r\n * };\r\n * ```\r\n *\r\n * Replaces the root `ErrorHandler` with {@link FlyChunkReloadErrorHandler}.\r\n */\r\nexport function provideFlyChunkReloadRecovery(): Provider {\r\n return { provide: ErrorHandler, useClass: FlyChunkReloadErrorHandler };\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FlyBadgeTile } from '../badges.types';\n\n/**\n * `fly-badge-wall` — a responsive grid of earned (and optionally locked) badge tiles. Presentational:\n * pass the Badges read-API wall DTOs straight in. Renders a resolved `iconUrl` image or an `iconName`\n * PrimeIcons glyph; a tile with neither shows a neutral placeholder (the API's fallback means this is rare).\n * RTL-safe (logical properties, no left/right). RAD: any app reuses it via the Badges read API.\n */\n@Component({\n selector: 'fly-badge-wall',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (badges().length === 0) {\n <div class=\"fbw-empty\">{{ emptyText() }}</div>\n } @else {\n <div class=\"fbw-grid\" role=\"list\">\n @for (b of badges(); track b.appId + ':' + b.key) {\n <div class=\"fbw-tile\" role=\"listitem\"\n [class.fbw-locked]=\"b.earned === false\"\n [attr.title]=\"b.name + (b.earnedAt ? '' : '')\">\n <div class=\"fbw-icon\" [style.color]=\"b.iconColor || null\">\n @if (b.iconUrl) {\n <img [src]=\"b.iconUrl\" [alt]=\"b.name\" loading=\"lazy\" />\n } @else if (b.iconName) {\n <i class=\"pi {{ b.iconName }}\"></i>\n } @else {\n <i class=\"pi pi-star\"></i>\n }\n </div>\n <div class=\"fbw-name\">{{ b.name }}</div>\n @if (showPoints() && b.requiredPoints > 0) {\n <div class=\"fbw-sub\">{{ b.requiredPoints }} pts</div>\n }\n </div>\n }\n </div>\n }\n `,\n styles: [`\n :host { display: block; }\n .fbw-grid {\n display: grid; gap: 14px;\n grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));\n }\n .fbw-tile {\n display: flex; flex-direction: column; align-items: center; gap: 6px;\n padding: 12px 8px; border-radius: 12px;\n background: var(--surface-card, #1e1e1e);\n border: 1px solid var(--surface-border, #333);\n text-align: center; transition: transform .12s ease, box-shadow .12s ease;\n }\n .fbw-tile:hover { transform: translateY(-2px); box-shadow: 0 6px 18px #0003; }\n .fbw-locked { opacity: .38; filter: grayscale(1); }\n .fbw-icon { width: 56px; height: 56px; display: grid; place-items: center; }\n .fbw-icon img { width: 100%; height: 100%; object-fit: contain; }\n .fbw-icon i { font-size: 40px; }\n .fbw-name { font-size: .82rem; font-weight: 600; color: var(--text-color, #eee); line-height: 1.2; }\n .fbw-sub { font-size: .72rem; color: var(--text-color-secondary, #9aa0a6); }\n .fbw-empty { padding: 28px; text-align: center; color: var(--text-color-secondary, #9aa0a6); font-size: .9rem; }\n `],\n})\nexport class FlyBadgeWallComponent {\n readonly badges = input<FlyBadgeTile[]>([]);\n readonly showPoints = input<boolean>(true);\n readonly emptyText = input<string>('No badges earned yet.');\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FlyAchievementRow } from '../badges.types';\n\n/**\n * `fly-achievement-progress` — a list of achievements, each with an icon, the current tier (if any),\n * and a progress bar toward the next threshold. Presentational; pass the read-API achievement DTOs.\n */\n@Component({\n selector: 'fly-achievement-progress',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (achievements().length === 0) {\n <div class=\"fap-empty\">{{ emptyText() }}</div>\n } @else {\n <ul class=\"fap-list\">\n @for (a of achievements(); track a.appId + ':' + a.key) {\n <li class=\"fap-row\">\n <div class=\"fap-icon\" [style.color]=\"a.iconColor || null\">\n @if (a.iconUrl) { <img [src]=\"a.iconUrl\" [alt]=\"a.name\" loading=\"lazy\" /> }\n @else if (a.iconName) { <i class=\"pi {{ a.iconName }}\"></i> }\n @else { <i class=\"pi pi-bolt\"></i> }\n </div>\n <div class=\"fap-body\">\n <div class=\"fap-head\">\n <span class=\"fap-name\">{{ a.name }}</span>\n @if (a.currentTierKey) { <span class=\"fap-tier\">{{ a.currentTierKey }}</span> }\n </div>\n @if (a.description) { <div class=\"fap-desc\">{{ a.description }}</div> }\n <div class=\"fap-bar\"><div class=\"fap-fill\" [style.inline-size.%]=\"pct(a)\"></div></div>\n <div class=\"fap-count\">{{ a.currentCount }}<span> / {{ a.nextTierRequiredCount ?? a.requiredCount ?? a.currentCount }}</span></div>\n </div>\n </li>\n }\n </ul>\n }\n `,\n styles: [`\n :host { display: block; }\n .fap-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }\n .fap-row { display: flex; gap: 12px; align-items: flex-start;\n padding: 12px; border-radius: 12px;\n background: var(--surface-card, #1e1e1e); border: 1px solid var(--surface-border, #333); }\n .fap-icon { flex: 0 0 auto; inline-size: 40px; block-size: 40px; display: grid; place-items: center; }\n .fap-icon img { inline-size: 100%; block-size: 100%; object-fit: contain; }\n .fap-icon i { font-size: 28px; }\n .fap-body { flex: 1 1 auto; min-inline-size: 0; }\n .fap-head { display: flex; align-items: center; gap: 8px; }\n .fap-name { font-weight: 600; color: var(--text-color, #eee); }\n .fap-tier { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em;\n padding: 1px 8px; border-radius: 999px; color: #fff;\n background: var(--primary-color, #6366f1); }\n .fap-desc { font-size: .78rem; color: var(--text-color-secondary, #9aa0a6); margin: 2px 0 6px; }\n .fap-bar { block-size: 6px; border-radius: 999px; background: var(--surface-border, #333); overflow: hidden; }\n .fap-fill { block-size: 100%; background: var(--primary-color, #6366f1); border-radius: 999px; transition: inline-size .3s ease; }\n .fap-count { font-size: .72rem; color: var(--text-color-secondary, #9aa0a6); margin-top: 4px; }\n .fap-count span { opacity: .7; }\n .fap-empty { padding: 28px; text-align: center; color: var(--text-color-secondary, #9aa0a6); font-size: .9rem; }\n `],\n})\nexport class FlyAchievementProgressComponent {\n readonly achievements = input<FlyAchievementRow[]>([]);\n readonly emptyText = input<string>('No achievements yet.');\n\n pct(a: FlyAchievementRow): number {\n const target = a.nextTierRequiredCount ?? a.requiredCount ?? 0;\n if (!target || target <= 0) return a.earnedAt ? 100 : 0;\n return Math.max(0, Math.min(100, Math.round((a.currentCount / target) * 100)));\n }\n}\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { FlyPointsSummary } from '../badges.types';\n\n/**\n * `fly-points-tier` — a compact \"N points to next badge\" widget: current balance, the current + next\n * badge, and a progress bar between them. Presentational; pass the read-API points DTO.\n */\n@Component({\n selector: 'fly-points-tier',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (points(); as p) {\n <div class=\"fpt-root\">\n <div class=\"fpt-balance\">\n <span class=\"fpt-num\">{{ p.balance }}</span>\n <span class=\"fpt-label\">{{ pointsLabel() }}</span>\n </div>\n <div class=\"fpt-track\">\n <div class=\"fpt-badge\" [class.fpt-dim]=\"!p.currentBadge\">\n @if (p.currentBadge?.iconUrl) { <img [src]=\"p.currentBadge!.iconUrl!\" [alt]=\"p.currentBadge!.name\" /> }\n @else { <i class=\"pi pi-star-fill\"></i> }\n </div>\n <div class=\"fpt-bar\"><div class=\"fpt-fill\" [style.inline-size.%]=\"progress()\"></div></div>\n <div class=\"fpt-badge\" [class.fpt-dim]=\"!p.nextBadge\">\n @if (p.nextBadge?.iconUrl) { <img [src]=\"p.nextBadge!.iconUrl!\" [alt]=\"p.nextBadge!.name\" /> }\n @else { <i class=\"pi pi-flag-fill\"></i> }\n </div>\n </div>\n <div class=\"fpt-caption\">\n @if (p.nextBadge) {\n {{ p.remainingToNext }} {{ pointsLabel() }} → <strong>{{ p.nextBadge.name }}</strong>\n } @else {\n {{ maxedText() }}\n }\n </div>\n </div>\n }\n `,\n styles: [`\n :host { display: block; }\n .fpt-root { padding: 16px; border-radius: 12px;\n background: var(--surface-card, #1e1e1e); border: 1px solid var(--surface-border, #333); }\n .fpt-balance { display: flex; align-items: baseline; gap: 6px; }\n .fpt-num { font-size: 1.8rem; font-weight: 800; color: var(--text-color, #eee); }\n .fpt-label { font-size: .8rem; color: var(--text-color-secondary, #9aa0a6); }\n .fpt-track { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; }\n .fpt-badge { inline-size: 34px; block-size: 34px; display: grid; place-items: center; flex: 0 0 auto; }\n .fpt-badge img { inline-size: 100%; block-size: 100%; object-fit: contain; }\n .fpt-badge i { font-size: 24px; color: var(--primary-color, #6366f1); }\n .fpt-dim { opacity: .35; }\n .fpt-bar { flex: 1 1 auto; block-size: 8px; border-radius: 999px; background: var(--surface-border, #333); overflow: hidden; }\n .fpt-fill { block-size: 100%; background: linear-gradient(90deg, #f59e0b, #6366f1); border-radius: 999px; transition: inline-size .3s ease; }\n .fpt-caption { font-size: .8rem; color: var(--text-color-secondary, #9aa0a6); }\n .fpt-caption strong { color: var(--text-color, #eee); }\n `],\n})\nexport class FlyPointsTierComponent {\n readonly points = input<FlyPointsSummary | null>(null);\n readonly pointsLabel = input<string>('points');\n readonly maxedText = input<string>('Top tier reached 🎉');\n\n readonly progress = computed(() => {\n const p = this.points();\n if (!p || !p.nextBadge) return 100;\n const floor = p.currentBadge?.requiredPoints ?? 0;\n const ceil = p.nextBadge.requiredPoints;\n if (ceil <= floor) return 100;\n return Math.max(0, Math.min(100, Math.round(((p.balance - floor) / (ceil - floor)) * 100)));\n });\n}\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FlyLeaderboardRow } from '../badges.types';\n\n/**\n * `fly-leaderboard` — a ranked table of users by points (with badge counts). Presentational; pass the\n * read-API leaderboard entries. Top three ranks get a medal accent; the current user's row is highlighted.\n */\n@Component({\n selector: 'fly-leaderboard',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (rows().length === 0) {\n <div class=\"flb-empty\">{{ emptyText() }}</div>\n } @else {\n <ol class=\"flb-list\">\n @for (r of rows(); track r.userId) {\n <li class=\"flb-row\" [class.flb-me]=\"r.isCurrentUser\">\n <span class=\"flb-rank\" [attr.data-medal]=\"r.rank <= 3 ? r.rank : null\">{{ r.rank }}</span>\n <span class=\"flb-name\">{{ r.displayName || shortId(r.userId) }}</span>\n <span class=\"flb-badges\" title=\"badges\"><i class=\"pi pi-star-fill\"></i> {{ r.badgeCount }}</span>\n <span class=\"flb-points\">{{ r.points }}<small> {{ pointsLabel() }}</small></span>\n </li>\n }\n </ol>\n }\n `,\n styles: [`\n :host { display: block; }\n .flb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }\n .flb-row { display: grid; grid-template-columns: 40px 1fr auto auto; align-items: center; gap: 12px;\n padding: 10px 12px; border-radius: 10px;\n background: var(--surface-card, #1e1e1e); border: 1px solid var(--surface-border, #333); }\n .flb-me { outline: 2px solid var(--primary-color, #6366f1); }\n .flb-rank { inline-size: 28px; block-size: 28px; display: grid; place-items: center;\n border-radius: 999px; font-weight: 700; font-size: .82rem;\n background: var(--surface-ground, #2a2a2a); color: var(--text-color, #eee); }\n .flb-rank[data-medal=\"1\"] { background: #FCD34D; color: #3a2a00; }\n .flb-rank[data-medal=\"2\"] { background: #D8D8D8; color: #333; }\n .flb-rank[data-medal=\"3\"] { background: #CD7F32; color: #fff; }\n .flb-name { font-weight: 600; color: var(--text-color, #eee); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n .flb-badges { font-size: .8rem; color: var(--text-color-secondary, #9aa0a6); display: inline-flex; align-items: center; gap: 4px; }\n .flb-badges i { color: #f59e0b; font-size: .8rem; }\n .flb-points { font-weight: 700; color: var(--text-color, #eee); }\n .flb-points small { font-weight: 400; color: var(--text-color-secondary, #9aa0a6); }\n .flb-empty { padding: 28px; text-align: center; color: var(--text-color-secondary, #9aa0a6); font-size: .9rem; }\n `],\n})\nexport class FlyLeaderboardComponent {\n readonly rows = input<FlyLeaderboardRow[]>([]);\n readonly pointsLabel = input<string>('pts');\n readonly emptyText = input<string>('No ranked users yet.');\n\n shortId(id: string): string { return id ? id.slice(0, 8) : '—'; }\n}\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n HostListener,\r\n inject,\r\n signal,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport type {\r\n FlyCommentReportStatus,\r\n FlyModerationLoadPageRequest,\r\n FlyModerationLockThreadRequest,\r\n FlyModerationOpenSubjectRequest,\r\n FlyModerationReport,\r\n FlyModerationReportPage,\r\n FlyModerationResolutionStatus,\r\n FlyModerationResolveRequest,\r\n} from './moderation-queue.types';\r\n\r\n/** The four report statuses, in the order the header filter renders them (after the \"All\" pick). */\r\nconst ALL_STATUSES: readonly FlyCommentReportStatus[] = ['Open', 'UnderReview', 'ActionTaken', 'Dismissed'];\r\n\r\n/** Process-wide counter so every instance owns a unique resolution radio-group\r\n * `name` even when several moderation queues mount at once (see `fly-typeahead`'s\r\n * `_flyTypeaheadUid` for the same pattern). */\r\nlet _flyModerationQueueUid = 0;\r\n\r\n/**\r\n * **`fly-moderation-queue`** — the design-system generic comment-report moderation queue.\r\n *\r\n * Renders a {@link FlyModerationReportPage} of the `comments` core app's\r\n * `CommentReportsController` moderation surface: a paged, status-filterable\r\n * report list (reason / reporter / excerpt / subject deep-link / status),\r\n * a resolve dialog (`ActionTaken` / `Dismissed` + optional note + optional\r\n * delete-the-comment), and a per-row thread-lock action. It is a platform\r\n * surface — transport-agnostic like `fly-comment-thread` / `fly-dynamic-form`:\r\n * this component never calls an API. It only renders the page the host hands\r\n * it via `[page]` and emits typed requests (`loadPage`/`resolve`/`lockThread`/\r\n * `openSubject`) — the host owns HTTP and any live-update channel.\r\n *\r\n * The report DTO itself carries only raw ids (`reporterUserId`, `subjectId`,\r\n * …); `FlyModerationReport` additionally accepts OPTIONAL host-resolved\r\n * display fields (`reporterDisplayName`, `commentExcerpt`, `subjectLabel`) —\r\n * same pattern as `FlyComment.authorDisplayName` — so a host that already has\r\n * a user/subject cache can render richer rows for free, and a host that\r\n * doesn't still gets a working (raw-id) queue.\r\n *\r\n * The subject deep-link reuses the `entity-lookup` `flyos:` href convention\r\n * (`flyos:<appId>.<subjectType>/<subjectId>`), computed purely from the row's\r\n * own fields — clicking it emits {@link openSubject} rather than rendering a\r\n * real anchor, since the host (not the DS) owns whether/how the `flyos:`\r\n * protocol is registered and navigable in its shell.\r\n *\r\n * i18n is self-sufficient through the `moderation.*` keys in `DS_BASELINE_LOCALES`\r\n * (en/ar/fr/ur); report-reason labels reuse the existing `comment.reason.*`\r\n * keys rather than duplicating them. RTL works via logical CSS. Styling uses\r\n * DS theme tokens (`--surface-*`, `--label-*`, `--separator`, `--fill-*`,\r\n * `--accent`, `--system-*`) with light-neutral fallbacks.\r\n *\r\n * @example\r\n * ```html\r\n * <fly-moderation-queue\r\n * [page]=\"reportPage()\"\r\n * [loading]=\"loading()\"\r\n * [status]=\"statusFilter()\"\r\n * (loadPage)=\"onLoadPage($event)\"\r\n * (resolve)=\"onResolve($event)\"\r\n * (lockThread)=\"onLockThread($event)\"\r\n * (openSubject)=\"onOpenSubject($event)\" />\r\n * ```\r\n */\r\n@Component({\r\n selector: 'fly-moderation-queue',\r\n standalone: true,\r\n imports: [CommonModule, FormsModule, TranslatePipe],\r\n templateUrl: './moderation-queue.component.html',\r\n styleUrl: './moderation-queue.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { class: 'fly-moderation-queue' },\r\n})\r\nexport class FlyModerationQueueComponent {\r\n private readonly host = inject(ElementRef<HTMLElement>);\r\n\r\n // ── Inputs ───────────────────────────────────────────────────────────────────\r\n /** The current page of reports (host-fetched/accumulated per its own {@link loadPage} handling). */\r\n readonly page = input.required<FlyModerationReportPage>();\r\n /** A fetch is in flight — disables the filter/actions and shows the loading state on an empty page. */\r\n readonly loading = input(false);\r\n /** Non-null renders an inline error state instead of the list (host-supplied, already localized). */\r\n readonly error = input<string | null>(null);\r\n /** The currently applied status filter; `null` = \"All\". Host-controlled, like `[sort]` on `fly-comment-thread`. */\r\n readonly status = input<FlyCommentReportStatus | null>(null);\r\n\r\n // ── Outputs ──────────────────────────────────────────────────────────────────\r\n /** A status-filter pick (page resets to 1) or a `loadMore` (next page at the current filter). */\r\n readonly loadPage = output<FlyModerationLoadPageRequest>();\r\n /** Resolve a report as `ActionTaken` or `Dismissed`, with an optional note and delete-the-comment flag. */\r\n readonly resolve = output<FlyModerationResolveRequest>();\r\n /** Lock the reported comment's thread (moderator action; destructive on the backend). */\r\n readonly lockThread = output<FlyModerationLockThreadRequest>();\r\n /** The subject deep-link was activated — host resolves/navigates. */\r\n readonly openSubject = output<FlyModerationOpenSubjectRequest>();\r\n\r\n readonly statuses = ALL_STATUSES;\r\n\r\n // ── Identity ─────────────────────────────────────────────────────────────────\r\n private readonly _uid = ++_flyModerationQueueUid;\r\n /** Instance-scoped `name` for the resolution radio group — several moderation\r\n * queues mounted at once must not cross-wire each other's radio selection. */\r\n readonly resolutionGroupName = `fly-moderation-resolution-${this._uid}`;\r\n\r\n // ── State (signals) ──────────────────────────────────────────────────────────\r\n /** Snapshot of the report being resolved, captured at {@link openResolve} time —\r\n * NOT re-derived from `[page]`, so a host refreshing the page mid-edit can't\r\n * silently null this out and discard the in-progress note/selection. */\r\n private readonly _resolvingReport = signal<FlyModerationReport | null>(null);\r\n private readonly _resolutionStatus = signal<FlyModerationResolutionStatus | null>(null);\r\n private readonly _resolutionNote = signal('');\r\n private readonly _deleteComment = signal(false);\r\n private readonly _confirmingLockId = signal<string | null>(null);\r\n /** Element focused before the resolve dialog opened, restored when it closes. */\r\n private _resolveOpener: HTMLElement | null = null;\r\n\r\n readonly resolvingReport = this._resolvingReport.asReadonly();\r\n readonly resolutionStatus = this._resolutionStatus.asReadonly();\r\n readonly resolutionNote = this._resolutionNote.asReadonly();\r\n readonly deleteComment = this._deleteComment.asReadonly();\r\n readonly confirmingLockId = this._confirmingLockId.asReadonly();\r\n\r\n // ── Template helpers ───────────────────────────────────────────────────────────\r\n isResolvable(status: FlyCommentReportStatus): boolean {\r\n return status === 'Open' || status === 'UnderReview';\r\n }\r\n\r\n shortId(id: string): string {\r\n return id.slice(0, 8);\r\n }\r\n\r\n subjectHref(r: FlyModerationReport): string {\r\n return `flyos:${r.appId}.${r.subjectType}/${r.subjectId}`;\r\n }\r\n\r\n subjectDisplay(r: FlyModerationReport): string {\r\n return r.subjectLabel || `${r.subjectType} #${this.shortId(r.subjectId)}`;\r\n }\r\n\r\n formatDate(iso: string): string {\r\n const d = new Date(iso);\r\n return Number.isNaN(d.getTime()) ? '' : d.toLocaleString();\r\n }\r\n\r\n // ── Status filter ────────────────────────────────────────────────────────────\r\n onStatusPick(next: FlyCommentReportStatus | null): void {\r\n if (next === this.status()) return;\r\n this.loadPage.emit({ status: next ?? undefined, page: 1 });\r\n }\r\n\r\n loadMore(): void {\r\n const p = this.page();\r\n this.loadPage.emit({ status: this.status() ?? undefined, page: p.page + 1 });\r\n }\r\n\r\n // ── Subject deep-link ────────────────────────────────────────────────────────\r\n onOpenSubject(r: FlyModerationReport): void {\r\n this.openSubject.emit({\r\n appId: r.appId,\r\n subjectType: r.subjectType,\r\n subjectId: r.subjectId,\r\n href: this.subjectHref(r),\r\n });\r\n }\r\n\r\n // ── Resolve dialog ───────────────────────────────────────────────────────────\r\n @HostListener('document:keydown.escape')\r\n onEscape(): void {\r\n if (this.resolvingReport()) this.closeResolve();\r\n }\r\n\r\n openResolve(r: FlyModerationReport): void {\r\n if (!this.isResolvable(r.status)) return;\r\n this._resolveOpener = document.activeElement instanceof HTMLElement ? document.activeElement : null;\r\n this._resolvingReport.set(r);\r\n this._resolutionStatus.set(null);\r\n this._resolutionNote.set('');\r\n this._deleteComment.set(false);\r\n // After paint, so the dialog panel exists in the DOM to receive focus.\r\n requestAnimationFrame(() => this.focusResolveDialog());\r\n }\r\n\r\n closeResolve(): void {\r\n this._resolvingReport.set(null);\r\n this._resolutionStatus.set(null);\r\n this._resolutionNote.set('');\r\n this._deleteComment.set(false);\r\n this.restoreResolveFocus();\r\n }\r\n\r\n /** Space would otherwise scroll the page while the backdrop (role=\"button\") is focused. */\r\n onOverlayBackdropSpace(event: Event): void {\r\n event.preventDefault();\r\n this.closeResolve();\r\n }\r\n\r\n /** Focuses the first resolution radio, or the dialog panel itself as a fallback. */\r\n private focusResolveDialog(): void {\r\n const dialog = this.host.nativeElement.querySelector('.fly-moderation-queue__dialog') as HTMLElement | null;\r\n if (!dialog) return;\r\n const firstRadio = dialog.querySelector<HTMLElement>('input[type=\"radio\"]');\r\n (firstRadio ?? dialog).focus({ preventScroll: true });\r\n }\r\n\r\n private restoreResolveFocus(): void {\r\n const el = this._resolveOpener;\r\n this._resolveOpener = null;\r\n if (el && document.contains(el)) {\r\n // Defer so focus lands after the dialog is removed from the a11y tree.\r\n requestAnimationFrame(() => el.focus());\r\n }\r\n }\r\n\r\n onResolutionStatusChange(status: FlyModerationResolutionStatus): void {\r\n this._resolutionStatus.set(status);\r\n if (status !== 'ActionTaken') this._deleteComment.set(false);\r\n }\r\n\r\n onResolutionNoteChange(value: string): void {\r\n this._resolutionNote.set(value);\r\n }\r\n\r\n onDeleteCommentToggle(ev: Event): void {\r\n this._deleteComment.set((ev.target as HTMLInputElement).checked);\r\n }\r\n\r\n submitResolve(r: FlyModerationReport): void {\r\n const status = this._resolutionStatus();\r\n if (!status) return;\r\n const note = this._resolutionNote().trim();\r\n this.resolve.emit({\r\n reportId: r.id,\r\n status,\r\n resolutionNote: note || undefined,\r\n deleteComment: status === 'ActionTaken' ? this._deleteComment() : undefined,\r\n });\r\n this.closeResolve();\r\n }\r\n\r\n // ── Thread lock ──────────────────────────────────────────────────────────────\r\n requestLock(r: FlyModerationReport): void {\r\n this._confirmingLockId.set(r.id);\r\n // After paint, so the swapped-in Cancel/Lock-thread pair exists to receive\r\n // focus — the trigger button it replaced is gone, so focus would otherwise\r\n // fall back to <body>.\r\n requestAnimationFrame(() => this.focusLockCancelButton());\r\n }\r\n\r\n cancelLock(): void {\r\n this._confirmingLockId.set(null);\r\n }\r\n\r\n confirmLock(r: FlyModerationReport): void {\r\n this.lockThread.emit({\r\n appId: r.appId,\r\n subjectType: r.subjectType,\r\n subjectId: r.subjectId,\r\n });\r\n this._confirmingLockId.set(null);\r\n }\r\n\r\n /** Only one row can be in the lock-confirm state at a time, so a class query is unambiguous. */\r\n private focusLockCancelButton(): void {\r\n const btn = this.host.nativeElement.querySelector(\r\n '.fly-moderation-queue__lock-confirm .fly-moderation-queue__cancel-btn',\r\n ) as HTMLElement | null;\r\n btn?.focus({ preventScroll: true });\r\n }\r\n}\r\n","<div class=\"fly-moderation-queue__body\">\r\n <!-- ── Header: count + status filter ── -->\r\n <header class=\"fly-moderation-queue__header\">\r\n <span class=\"fly-moderation-queue__count\">\r\n {{ 'moderation.count' | translate: { n: page().total } }}\r\n </span>\r\n\r\n <div class=\"fly-moderation-queue__status-filter\" role=\"group\" [attr.aria-label]=\"'moderation.status_label' | translate\">\r\n <button\r\n type=\"button\"\r\n class=\"fly-moderation-queue__status-btn\"\r\n [class.fly-moderation-queue__status-btn--active]=\"status() === null\"\r\n [attr.aria-pressed]=\"status() === null\"\r\n [disabled]=\"loading()\"\r\n (click)=\"onStatusPick(null)\">\r\n {{ 'moderation.status_all' | translate }}\r\n </button>\r\n @for (s of statuses; track s) {\r\n <button\r\n type=\"button\"\r\n class=\"fly-moderation-queue__status-btn\"\r\n [class.fly-moderation-queue__status-btn--active]=\"status() === s\"\r\n [attr.aria-pressed]=\"status() === s\"\r\n [disabled]=\"loading()\"\r\n (click)=\"onStatusPick(s)\">\r\n {{ 'moderation.status.' + s | translate }}\r\n </button>\r\n }\r\n </div>\r\n </header>\r\n\r\n <!-- ── States ── -->\r\n @if (error()) {\r\n <p class=\"fly-moderation-queue__error\" role=\"alert\">{{ error() }}</p>\r\n } @else if (loading() && page().items.length === 0) {\r\n <p class=\"fly-moderation-queue__status-msg\">{{ 'moderation.loading' | translate }}</p>\r\n } @else if (page().items.length === 0) {\r\n <p class=\"fly-moderation-queue__empty\">{{ 'moderation.empty' | translate }}</p>\r\n } @else {\r\n <!-- ── Report table ── -->\r\n <div class=\"fly-moderation-queue__table-wrap\">\r\n <table class=\"fly-moderation-queue__table\">\r\n <caption class=\"fly-moderation-queue__sr-only\">{{ 'moderation.table_caption' | translate }}</caption>\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">{{ 'moderation.col_reason' | translate }}</th>\r\n <th scope=\"col\">{{ 'moderation.col_reporter' | translate }}</th>\r\n <th scope=\"col\">{{ 'moderation.col_reported' | translate }}</th>\r\n <th scope=\"col\">{{ 'moderation.col_excerpt' | translate }}</th>\r\n <th scope=\"col\">{{ 'moderation.col_subject' | translate }}</th>\r\n <th scope=\"col\">{{ 'moderation.col_status' | translate }}</th>\r\n <th scope=\"col\">{{ 'moderation.col_actions' | translate }}</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @for (r of page().items; track r.id) {\r\n <tr>\r\n <td class=\"fly-moderation-queue__reason-cell\">\r\n <span class=\"fly-moderation-queue__reason\">{{ 'comment.reason.' + r.reason | translate }}</span>\r\n @if (r.detail) {\r\n <span class=\"fly-moderation-queue__detail\" [title]=\"r.detail\">{{ r.detail }}</span>\r\n }\r\n </td>\r\n <td>{{ r.reporterDisplayName || r.reporterUserId }}</td>\r\n <td>{{ formatDate(r.createdAt) }}</td>\r\n <td class=\"fly-moderation-queue__excerpt\">{{ r.commentExcerpt || '—' }}</td>\r\n <td>\r\n <button type=\"button\" class=\"fly-moderation-queue__subject-link\" [title]=\"subjectHref(r)\" (click)=\"onOpenSubject(r)\">\r\n {{ subjectDisplay(r) }}\r\n </button>\r\n </td>\r\n <td>\r\n <span class=\"fly-moderation-queue__badge\" [class]=\"'fly-moderation-queue__badge--' + r.status\">\r\n {{ 'moderation.status.' + r.status | translate }}\r\n </span>\r\n @if (r.resolutionNote) {\r\n <div class=\"fly-moderation-queue__resolution-note\">{{ r.resolutionNote }}</div>\r\n }\r\n </td>\r\n <td class=\"fly-moderation-queue__actions\">\r\n @if (isResolvable(r.status)) {\r\n <button type=\"button\" class=\"fly-moderation-queue__action-btn\" [disabled]=\"loading()\" (click)=\"openResolve(r)\">\r\n {{ 'moderation.resolve' | translate }}\r\n </button>\r\n }\r\n @if (confirmingLockId() === r.id) {\r\n <span class=\"fly-moderation-queue__lock-confirm\">\r\n <button type=\"button\" class=\"fly-moderation-queue__cancel-btn\" (click)=\"cancelLock()\">\r\n {{ 'common.action.cancel' | translate }}\r\n </button>\r\n <button type=\"button\" class=\"fly-moderation-queue__danger-btn\" (click)=\"confirmLock(r)\">\r\n {{ 'moderation.lock_thread' | translate }}\r\n </button>\r\n </span>\r\n } @else {\r\n <button type=\"button\" class=\"fly-moderation-queue__action-btn\" [disabled]=\"loading()\" (click)=\"requestLock(r)\">\r\n {{ 'moderation.lock_thread' | translate }}\r\n </button>\r\n }\r\n </td>\r\n </tr>\r\n }\r\n </tbody>\r\n </table>\r\n </div>\r\n\r\n @if (page().hasMore) {\r\n <button type=\"button\" class=\"fly-moderation-queue__load-more\" [disabled]=\"loading()\" (click)=\"loadMore()\">\r\n {{ 'comment.load_more' | translate }}\r\n </button>\r\n }\r\n }\r\n</div>\r\n\r\n<!-- ── Resolve dialog ── -->\r\n@if (resolvingReport(); as r) {\r\n <div class=\"fly-moderation-queue__overlay\">\r\n <div class=\"fly-moderation-queue__overlay-backdrop\" role=\"button\" tabindex=\"0\"\r\n [attr.aria-label]=\"'common.action.cancel' | translate\"\r\n (click)=\"closeResolve()\"\r\n (keydown.enter)=\"closeResolve()\"\r\n (keydown.space)=\"onOverlayBackdropSpace($event)\"></div>\r\n <div\r\n class=\"fly-moderation-queue__dialog\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"'moderation.resolve_title' | translate\">\r\n <h3 class=\"fly-moderation-queue__dialog-title\">{{ 'moderation.resolve_title' | translate }}</h3>\r\n\r\n <fieldset class=\"fly-moderation-queue__resolution-group\">\r\n <legend>{{ 'moderation.resolution_label' | translate }}</legend>\r\n <label class=\"fly-moderation-queue__resolution-option\">\r\n <input\r\n type=\"radio\"\r\n [name]=\"resolutionGroupName\"\r\n [checked]=\"resolutionStatus() === 'ActionTaken'\"\r\n (change)=\"onResolutionStatusChange('ActionTaken')\" />\r\n <span>{{ 'moderation.resolution.ActionTaken' | translate }}</span>\r\n </label>\r\n <label class=\"fly-moderation-queue__resolution-option\">\r\n <input\r\n type=\"radio\"\r\n [name]=\"resolutionGroupName\"\r\n [checked]=\"resolutionStatus() === 'Dismissed'\"\r\n (change)=\"onResolutionStatusChange('Dismissed')\" />\r\n <span>{{ 'moderation.resolution.Dismissed' | translate }}</span>\r\n </label>\r\n </fieldset>\r\n\r\n @if (resolutionStatus() === 'ActionTaken') {\r\n <label class=\"fly-moderation-queue__checkbox-row\">\r\n <input type=\"checkbox\" [checked]=\"deleteComment()\" (change)=\"onDeleteCommentToggle($event)\" />\r\n <span>{{ 'moderation.delete_comment_label' | translate }}</span>\r\n </label>\r\n }\r\n\r\n <textarea\r\n class=\"fly-moderation-queue__textarea\"\r\n rows=\"3\"\r\n [attr.aria-label]=\"'moderation.resolution_note_label' | translate\"\r\n [placeholder]=\"'moderation.resolution_note_label' | translate\"\r\n [ngModel]=\"resolutionNote()\"\r\n (ngModelChange)=\"onResolutionNoteChange($event)\"></textarea>\r\n\r\n <div class=\"fly-moderation-queue__dialog-actions\">\r\n <button type=\"button\" class=\"fly-moderation-queue__cancel-btn\" (click)=\"closeResolve()\">\r\n {{ 'common.action.cancel' | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"fly-moderation-queue__submit-btn\"\r\n [disabled]=\"!resolutionStatus()\"\r\n (click)=\"submitResolve(r)\">\r\n {{ 'moderation.resolve_submit' | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ViewChild,\r\n computed,\r\n effect,\r\n signal,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { type Observable, map } from 'rxjs';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\nimport { FlyTypeaheadComponent } from '../typeahead/typeahead.component';\r\nimport { type FlyTypeaheadOption } from '../typeahead/typeahead.types';\r\nimport { type FlyPeoplePickerMode, type FlyPeoplePickerOption } from './people-picker.types';\r\n\r\n/**\r\n * **`fly-people-picker`** — a thin design-system wrapper over `fly-typeahead`\r\n * pre-canned for the platform Controller's users lookup\r\n * (`GET /api/users/lookup?q=`, `UserLookupDto`).\r\n *\r\n * Transport-agnostic like its sibling `fly-typeahead`: the host supplies the\r\n * search — `[searchFn]` returns {@link FlyPeoplePickerOption} rows (the host\r\n * maps `UserLookupDto` → this shape, riding its own `HttpClient` so gateway\r\n * routing + auth apply). The component owns debounce/keyboard/ARIA (delegated\r\n * to the wrapped `fly-typeahead`), single vs multi selection, chip rendering\r\n * with an avatar-or-initials fallback, and de-duplication against both the\r\n * host-supplied {@link excludeIds} and the picker's own current selection.\r\n *\r\n * Explicitly NOT an org browser (that's a future `contacts`/`org-structure`\r\n * surface) — this is a search-and-pick widget for \"add N people\" flows\r\n * (contributors, panel members, storm/team members, …). It emits only the\r\n * picked ids ({@link selectionChange}); a host that needs to persist/display\r\n * an EXISTING membership list alongside the picker owns that list itself and\r\n * feeds this component `[excludeIds]` so already-added people don't resurface\r\n * in search.\r\n *\r\n * For the other shape — an EDIT surface where the picker itself IS the\r\n * saved-selection editor (load saved people → let the user add/remove →\r\n * save) — feed {@link initialSelection}. It seeds the picker's chips once so\r\n * the saved multi-value selection renders instead of an empty box, without\r\n * the host maintaining a parallel display list. Hosts that only hold ids\r\n * resolve them to `{id, displayName}` first via the platform's bulk resolve\r\n * (`POST /api/users/resolve`) and pass the result here; the resolve may\r\n * complete after construction and the seed tolerates that (see the input's\r\n * own doc). Prefilling never emits {@link selectionChange} — it is not a user\r\n * edit — so a consuming form is not marked dirty by loading its own data.\r\n *\r\n * i18n is self-sufficient through the `people_picker.*` keys in\r\n * `DS_BASELINE_LOCALES` (en/ar/fr/ur) plus the wrapped typeahead's own\r\n * `typeahead.*` keys (loading/no-results). RTL works via logical CSS.\r\n *\r\n * @example\r\n * ```html\r\n * <!-- Add-only flow, membership rendered separately by the host: -->\r\n * <fly-people-picker\r\n * mode=\"multi\"\r\n * [searchFn]=\"usersLookup\"\r\n * [excludeIds]=\"existingContributorIds()\"\r\n * (selectionChange)=\"onContributorsPicked($event)\" />\r\n *\r\n * <!-- Edit flow, the picker is the saved-selection editor: -->\r\n * <fly-people-picker\r\n * mode=\"multi\"\r\n * [searchFn]=\"usersLookup\"\r\n * [initialSelection]=\"savedContributors()\"\r\n * (selectionChange)=\"onContributorsChanged($event)\" />\r\n * ```\r\n */\r\n@Component({\r\n selector: 'fly-people-picker',\r\n standalone: true,\r\n imports: [CommonModule, TranslatePipe, FlyTypeaheadComponent],\r\n templateUrl: './people-picker.component.html',\r\n styleUrl: './people-picker.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { class: 'fly-people-picker' },\r\n})\r\nexport class FlyPeoplePickerComponent {\r\n // ── Inputs ───────────────────────────────────────────────────────────────────\r\n /** The ONLY behaviour a consumer must supply: an async search returning\r\n * candidate people for a query. Typically wraps `GET /api/users/lookup?q=`. */\r\n readonly searchFn = input.required<(query: string) => Observable<readonly FlyPeoplePickerOption[]>>();\r\n /** `'single'` (default) replaces the current pick; `'multi'` accumulates chips.\r\n * Set-once: pick a mode when composing the host template. The component does\r\n * not watch for a runtime `multi` → `single` flip, so an existing multi-pick\r\n * selection (more than one chip) is left as-is rather than truncated. */\r\n readonly mode = input<FlyPeoplePickerMode>('single');\r\n /** Ids to exclude from search results (e.g. people already on the target list) — additive to the picker's own in-progress selection, which is always excluded too. */\r\n readonly excludeIds = input<readonly string[]>([]);\r\n /** Pre-selected people to seed the picker with — for an edit surface whose picker IS the\r\n * saved-selection editor. Rendered as chips exactly like a live pick, so a saved multi-value\r\n * selection is visible (and editable) rather than silently starting empty.\r\n *\r\n * Seeded ONCE, when this input first carries a non-empty value: the id→name resolve that a\r\n * host runs to build these options is typically async and lands after construction, so the seed\r\n * waits for the first non-empty batch rather than the initial `[]`. After that first seed the\r\n * picker owns the selection — later changes to this input are ignored so a re-emitting resolve\r\n * can't clobber the user's in-progress add/remove. Seeding does NOT emit {@link selectionChange}\r\n * (prefill is not a user edit). For a fresh create surface, leave this empty and use `[searchFn]`\r\n * alone. */\r\n readonly initialSelection = input<readonly FlyPeoplePickerOption[]>([]);\r\n /** Placeholder for the search box. Falls back to the localized `people_picker.search_placeholder`. */\r\n readonly placeholder = input('');\r\n\r\n // ── Outputs ──────────────────────────────────────────────────────────────────\r\n /** The current picked set of ids, emitted after every pick/remove. */\r\n readonly selectionChange = output<readonly string[]>();\r\n\r\n @ViewChild(FlyTypeaheadComponent) private readonly typeahead?: FlyTypeaheadComponent;\r\n\r\n // ── State ────────────────────────────────────────────────────────────────────\r\n private readonly _selected = signal<readonly FlyPeoplePickerOption[]>([]);\r\n /** The most recent search result batch, so a typeahead pick (which only carries `value`/`label`) can resolve back to its full option (avatar, email). */\r\n private readonly _lastResults = signal<readonly FlyPeoplePickerOption[]>([]);\r\n /** One-shot latch: flips true after {@link initialSelection} has seeded the chips, so a later\r\n * (re-emitting) resolve never re-seeds over the user's edits. */\r\n private _seeded = false;\r\n\r\n constructor() {\r\n // Seed the saved selection once, on the first non-empty `initialSelection` batch (which a host's\r\n // async id→name resolve typically delivers after construction). Deliberately does not emit —\r\n // prefilling is not a user action, so a consuming form is not marked dirty by loading its data.\r\n effect(() => {\r\n const init = this.initialSelection();\r\n if (this._seeded || init.length === 0) return;\r\n this._seeded = true;\r\n this._selected.set([...init]);\r\n });\r\n }\r\n\r\n readonly selected = this._selected.asReadonly();\r\n readonly isMulti = computed(() => this.mode() === 'multi');\r\n /** Multi mode always shows the search box; single mode hides it once one person is picked (a \"Change\" affordance replaces it). */\r\n readonly showSearch = computed(() => this.isMulti() || this._selected().length === 0);\r\n\r\n /** Adapts {@link searchFn} to `fly-typeahead`'s `{value,label}` contract, filtering out ids already excluded or already picked. */\r\n readonly typeaheadSearchFn = (query: string): Observable<readonly FlyTypeaheadOption[]> =>\r\n this.searchFn()(query).pipe(\r\n map((rows) => {\r\n const taken = new Set([...this.excludeIds(), ...this._selected().map((o) => o.id)]);\r\n const filtered = rows.filter((r) => !taken.has(r.id));\r\n this._lastResults.set(filtered);\r\n return filtered.map((r) => ({ value: r.id, label: r.displayName }));\r\n }),\r\n );\r\n\r\n // ── Selection ────────────────────────────────────────────────────────────────\r\n onPicked(id: string): void {\r\n const option = this._lastResults().find((o) => o.id === id);\r\n this.typeahead?.clear();\r\n if (!option) return;\r\n if (this._selected().some((o) => o.id === id)) return;\r\n\r\n this._selected.set(this.isMulti() ? [...this._selected(), option] : [option]);\r\n this._emit();\r\n }\r\n\r\n remove(id: string): void {\r\n this._selected.set(this._selected().filter((o) => o.id !== id));\r\n this._emit();\r\n }\r\n\r\n /** Single mode only: clears the current pick so the search box reappears. */\r\n change(): void {\r\n this._selected.set([]);\r\n this._emit();\r\n }\r\n\r\n initialsFor(displayName: string): string {\r\n const parts = displayName.trim().split(/\\s+/).filter(Boolean);\r\n if (parts.length === 0) return '';\r\n if (parts.length === 1) return parts[0].slice(0, 2).toUpperCase();\r\n return (parts[0][0] + parts[parts.length - 1][0]).toUpperCase();\r\n }\r\n\r\n private _emit(): void {\r\n this.selectionChange.emit(this._selected().map((o) => o.id));\r\n }\r\n}\r\n","@if (selected().length > 0) {\r\n <ul class=\"fly-people-picker__chips\" role=\"list\">\r\n @for (o of selected(); track o.id) {\r\n <li class=\"fly-people-picker__chip\" role=\"listitem\">\r\n <span class=\"fly-people-picker__chip-avatar\" aria-hidden=\"true\">\r\n @if (o.avatarUrl) {\r\n <img [src]=\"o.avatarUrl\" alt=\"\" />\r\n } @else {\r\n <span class=\"fly-people-picker__chip-initials\">{{ initialsFor(o.displayName) }}</span>\r\n }\r\n </span>\r\n <span class=\"fly-people-picker__chip-name\" [title]=\"o.email || o.displayName\">{{ o.displayName }}</span>\r\n <button\r\n type=\"button\"\r\n class=\"fly-people-picker__chip-remove\"\r\n [attr.aria-label]=\"'people_picker.remove' | translate: { name: o.displayName }\"\r\n (click)=\"remove(o.id)\">\r\n ✕\r\n </button>\r\n </li>\r\n }\r\n </ul>\r\n}\r\n\r\n@if (showSearch()) {\r\n <fly-typeahead\r\n [searchFn]=\"typeaheadSearchFn\"\r\n [placeholder]=\"placeholder() || ('people_picker.search_placeholder' | translate)\"\r\n [allowFreeText]=\"false\"\r\n (selected)=\"onPicked($event)\" />\r\n} @else {\r\n <button type=\"button\" class=\"fly-people-picker__change-btn\" (click)=\"change()\">\r\n {{ 'people_picker.change' | translate }}\r\n </button>\r\n}\r\n","/**\r\n * Document-wide open-overlay stack — Escape arbitration for stacked overlays.\r\n *\r\n * Every layered overlay (drawer, modal, confirm dialog, menu, popover) listens for\r\n * Escape at the document level, so without arbitration one keypress closes the whole\r\n * pile — a confirm dialog opened over a drawer takes the drawer down with it on the\r\n * first Escape. Each overlay pushes a handle when it opens and removes it when it\r\n * closes or is destroyed; its Escape handler acts only while its handle is\r\n * top-of-stack. First Escape then closes the confirm, second the drawer.\r\n *\r\n * The stack is pure (no DOM, no DI) so the ordering rules are unit-testable, and the\r\n * shared {@link overlayStack} singleton spans the whole document — which is the point:\r\n * independently-owned overlays, including ones in different federated remotes, must\r\n * arbitrate globally or they cannot know about each other.\r\n *\r\n * ## Federation\r\n * Native Federation shares this package as a singleton, so every app in the shell\r\n * binds to one stack instance. A remote that forks its own DS copy would get its own\r\n * stack and lose arbitration against shell overlays — that is what the package's\r\n * federation singleton guard exists to catch.\r\n *\r\n * @example\r\n * ```ts\r\n * export class MyDrawer {\r\n * private handle: OverlayHandle | null = null;\r\n *\r\n * open() { this.handle = overlayStack.push(); }\r\n * close() { this.handle = overlayStack.remove(this.handle); }\r\n *\r\n * onEscape() { if (overlayStack.isTop(this.handle)) this.close(); }\r\n * }\r\n * ```\r\n */\r\n\r\n/** Brand — handles are opaque identity tokens minted by {@link OverlayStack.push}. */\r\nexport interface OverlayHandle {\r\n readonly overlay: true;\r\n}\r\n\r\nexport class OverlayStack {\r\n private readonly stack: OverlayHandle[] = [];\r\n\r\n /** Registers an opening overlay; the returned handle identifies it for later calls. */\r\n push(): OverlayHandle {\r\n const handle: OverlayHandle = { overlay: true };\r\n this.stack.push(handle);\r\n return handle;\r\n }\r\n\r\n /**\r\n * Unregisters a closing or destroyed overlay. Tolerates out-of-order removal (an\r\n * inner overlay torn down after its parent), unknown handles, and `null`.\r\n *\r\n * Returns `null` so callers can clear their field in one statement:\r\n * `this.handle = overlayStack.remove(this.handle)`.\r\n */\r\n remove(handle: OverlayHandle | null): null {\r\n if (!handle) return null;\r\n const index = this.stack.indexOf(handle);\r\n if (index !== -1) this.stack.splice(index, 1);\r\n return null;\r\n }\r\n\r\n /** True when this handle is the topmost open overlay — its Escape handler may act. */\r\n isTop(handle: OverlayHandle | null): boolean {\r\n return (\r\n handle !== null &&\r\n this.stack.length > 0 &&\r\n this.stack[this.stack.length - 1] === handle\r\n );\r\n }\r\n\r\n /** Number of currently-open overlays. Useful for scroll-lock refcounting. */\r\n get depth(): number {\r\n return this.stack.length;\r\n }\r\n}\r\n\r\n/**\r\n * The shared, document-wide stack. Import this rather than constructing an\r\n * `OverlayStack` — a private instance cannot arbitrate against anyone else's\r\n * overlays, which defeats the purpose.\r\n */\r\nexport const overlayStack = new OverlayStack();\r\n","/**\r\n * Focus capture/restore for overlays — the other half of a correct dismiss story.\r\n *\r\n * When an overlay opens it moves focus inside itself; when it closes, focus must go\r\n * back to whatever opened it, or the keyboard user is dumped at the top of the\r\n * document and has to re-traverse the page. Every hand-rolled modal/drawer in the\r\n * estate re-implements this with a `restoreFocusTo` field and a `.focus()` call, and\r\n * most of them miss at least one of the edge cases below.\r\n *\r\n * @example\r\n * ```ts\r\n * private restore: FocusRestore | null = null;\r\n *\r\n * open() { this.restore = captureFocus(); }\r\n * close() { this.restore = restoreFocus(this.restore); }\r\n * ```\r\n */\r\n\r\n/** An opaque capture token. Hold it while the overlay is open, pass it back on close. */\r\nexport interface FocusRestore {\r\n readonly element: HTMLElement | null;\r\n}\r\n\r\n/**\r\n * Snapshots the currently-focused element so it can be refocused later.\r\n *\r\n * Returns a token even when nothing is focused (`document.body` is treated as \"no\r\n * meaningful focus\"), so callers never branch — {@link restoreFocus} no-ops on it.\r\n */\r\nexport function captureFocus(doc: Document = document): FocusRestore {\r\n const active = doc.activeElement;\r\n const element =\r\n active instanceof HTMLElement && active !== doc.body ? active : null;\r\n return { element };\r\n}\r\n\r\n/**\r\n * Returns focus to the captured element, if it is still focusable.\r\n *\r\n * Guards the three cases that make naive `restoreFocusTo.focus()` misbehave:\r\n * - the element was removed from the DOM while the overlay was open (a row deleted by\r\n * the very dialog that is closing) — `isConnected` is false, so we skip rather than\r\n * throw focus to `<body>` via a detached node;\r\n * - it became disabled or `inert` while the overlay was open;\r\n * - nothing was focused when the overlay opened.\r\n *\r\n * `preventScroll` keeps the page from jumping when the trigger has scrolled out of\r\n * view behind the overlay — the caller decides whether the trigger should be scrolled\r\n * back into view, which is a product decision, not a focus one.\r\n *\r\n * Returns `null` so callers can clear their field in one statement.\r\n */\r\nexport function restoreFocus(\r\n restore: FocusRestore | null,\r\n options: { preventScroll?: boolean } = {},\r\n): null {\r\n const element = restore?.element;\r\n if (!element || !element.isConnected) return null;\r\n if (element.hasAttribute('disabled') || element.closest('[inert]')) return null;\r\n element.focus({ preventScroll: options.preventScroll ?? true });\r\n return null;\r\n}\r\n","import { DestroyRef, inject } from '@angular/core';\r\n\r\n/**\r\n * Debounce primitives — the shared replacement for the `setTimeout` / `clearTimeout`\r\n * pairs hand-rolled in every list screen and typeahead across the estate.\r\n *\r\n * Two entry points, for the two situations:\r\n * - {@link FlyDebouncer} — an object you hold and call, with `cancel()` and `flush()`.\r\n * Use it in a component that debounces on a field (search boxes, reload-on-filter).\r\n * - {@link flyDebounced} — an injection-context factory that wires `cancel()` to the\r\n * host's `DestroyRef` for you, so a pending call can never fire after teardown.\r\n *\r\n * ## Why not `debounceTime` from RxJS\r\n * Nothing wrong with it when the input is already a stream. But the common case here\r\n * is a signal-based component with an `(input)` handler and no Subject in sight, and\r\n * standing up a `Subject` + `takeUntilDestroyed` + `subscribe` to debounce one field is\r\n * more machinery than the problem deserves. These helpers are the imperative\r\n * equivalent, with the teardown correctness that hand-rolled timers usually miss.\r\n *\r\n * ## The leak these fix\r\n * A bare `setTimeout(() => this.reload(), 150)` with no `clearTimeout` in `ngOnDestroy`\r\n * still fires after the component is gone — reading destroyed signals, calling a\r\n * service on a torn-down injector, or logging a spurious HTTP request. {@link FlyDebouncer}\r\n * makes cancellation available and {@link flyDebounced} makes it automatic.\r\n */\r\n\r\n/** Default settle delay for search-style inputs, in milliseconds. */\r\nexport const FLY_SEARCH_DEBOUNCE_MS = 300;\r\n\r\n/** Default settle delay for re-querying a list after a filter/sort change. */\r\nexport const FLY_RELOAD_DEBOUNCE_MS = 150;\r\n\r\n/**\r\n * A cancellable trailing-edge debouncer.\r\n *\r\n * Calling {@link run} restarts the timer, so only the last call within `delayMs`\r\n * executes. The arguments of that last call are the ones used.\r\n */\r\nexport class FlyDebouncer<TArgs extends readonly unknown[] = []> {\r\n private timer: ReturnType<typeof setTimeout> | null = null;\r\n private pending: TArgs | null = null;\r\n\r\n constructor(\r\n private readonly fn: (...args: TArgs) => void,\r\n private delayMs: number = FLY_SEARCH_DEBOUNCE_MS,\r\n ) {}\r\n\r\n /** True while a call is scheduled but not yet fired. */\r\n get isPending(): boolean {\r\n return this.timer !== null;\r\n }\r\n\r\n /**\r\n * Changes the settle delay. Cancels anything pending, because letting it fire on the\r\n * old timing after the host has asked for new timing is the kind of one-off surprise\r\n * that is very hard to spot in a test.\r\n */\r\n setDelay(delayMs: number): void {\r\n this.cancel();\r\n this.delayMs = delayMs;\r\n }\r\n\r\n /** Schedules `fn`, replacing any call still waiting. */\r\n run(...args: TArgs): void {\r\n this.cancel();\r\n this.pending = args;\r\n this.timer = setTimeout(() => {\r\n this.timer = null;\r\n const argsToUse = this.pending as TArgs;\r\n this.pending = null;\r\n this.fn(...argsToUse);\r\n }, this.delayMs);\r\n }\r\n\r\n /** Drops any scheduled call. Safe to call when nothing is pending. */\r\n cancel(): void {\r\n if (this.timer === null) return;\r\n clearTimeout(this.timer);\r\n this.timer = null;\r\n this.pending = null;\r\n }\r\n\r\n /**\r\n * Runs a scheduled call immediately instead of waiting out the delay. No-op when\r\n * nothing is pending. Use on explicit submit (Enter) so the user isn't made to wait\r\n * for a timer they already resolved by pressing a key.\r\n */\r\n flush(): void {\r\n if (this.timer === null) return;\r\n const argsToUse = this.pending as TArgs;\r\n this.cancel();\r\n this.fn(...argsToUse);\r\n }\r\n}\r\n\r\n/**\r\n * Creates a {@link FlyDebouncer} already bound to the caller's lifecycle — pending\r\n * calls are cancelled on destroy.\r\n *\r\n * Must be called from an injection context (field initializer or constructor).\r\n *\r\n * @example\r\n * ```ts\r\n * private readonly reload = flyDebounced(() => this.load(), FLY_RELOAD_DEBOUNCE_MS);\r\n * onFilterChange() { this.reload.run(); }\r\n * ```\r\n */\r\nexport function flyDebounced<TArgs extends readonly unknown[] = []>(\r\n fn: (...args: TArgs) => void,\r\n delayMs: number = FLY_SEARCH_DEBOUNCE_MS,\r\n): FlyDebouncer<TArgs> {\r\n const debouncer = new FlyDebouncer(fn, delayMs);\r\n inject(DestroyRef).onDestroy(() => debouncer.cancel());\r\n return debouncer;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { I18nService } from '../../services/i18n.service';\r\nimport { FLY_SEARCH_DEBOUNCE_MS, FlyDebouncer } from '../../utils/debounce';\r\n\r\n/**\r\n * What expands a `collapsible` field beyond keyboard focus (which ALWAYS expands\r\n * it — a keyboard user must be able to reach the field):\r\n * - `click` — the collapsed magnifier is a button; a pointer click / Enter / Space\r\n * expands + focuses it. Merely tabbing onto it does NOT expand (the\r\n * tab-stop is the button, not the hidden field) — the user activates it.\r\n * - `focus` — the field itself is the tab-stop, so tabbing onto it expands it\r\n * immediately. Best when the search is the primary control in its row.\r\n * - `hover` — pointer hover expands it (click / focus still do too). Best in dense\r\n * toolbars where a hover reveal is expected.\r\n */\r\nexport type FlySearchExpandTrigger = 'click' | 'focus' | 'hover';\r\n\r\n/** Control height preset. Drives the `--fly-search-size` token (28 / 36 / 44px). */\r\nexport type FlySearchInputSize = 'sm' | 'md' | 'lg';\r\n\r\n/**\r\n * `<fly-search-input>` — the debounced search / filter box.\r\n *\r\n * Replaces the hand-rolled `setTimeout` + `clearTimeout` pair that every list screen\r\n * in the estate grows independently. Beyond the debounce itself, this bakes in the\r\n * three behaviours those copies routinely miss:\r\n *\r\n * 1. **Enter flushes the pending debounce before emitting `submitted`**, so a parent\r\n * that reacts to submit always sees the latest query — never the previous one,\r\n * which is the classic \"first Enter searches the old text\" bug.\r\n * 2. **Teardown cancels the timer**, so a pending search can't fire against a\r\n * destroyed component after the user navigates away mid-typing.\r\n * 3. **Escape clears, but only swallows the key when there is text to clear** — an\r\n * Escape in an empty box still bubbles, so a search input inside a drawer or modal\r\n * doesn't trap the key and break the overlay's own dismiss.\r\n *\r\n * @example\r\n * ```html\r\n * <fly-search-input\r\n * [(value)]=\"query\"\r\n * [ariaLabel]=\"'projects.search.label' | translate\"\r\n * (queryChange)=\"reload($event)\" />\r\n * ```\r\n *\r\n * ## Why no `ControlValueAccessor`\r\n * A form control has one value; this component has two meaningfully different ones —\r\n * what the user has typed (immediate) and what should be searched for (debounced).\r\n * Binding it as a form control forces a silent choice between them, and either choice\r\n * is wrong half the time. The two-way `[(value)]` gives you the live text and\r\n * `(queryChange)` gives you the settled query, explicitly. Reactive-forms hosts wire\r\n * `(queryChange)` to `control.setValue(...)`.\r\n */\r\n@Component({\r\n selector: 'fly-search-input',\r\n standalone: true,\r\n templateUrl: './search-input.component.html',\r\n styleUrl: './search-input.component.scss',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n class: 'fly-search-input-host',\r\n // Collapsible hosts become the anchor frame for the morphing pill (see .scss):\r\n // the pill pins to the host's inline-END so the magnifier stays put while the\r\n // host's flex-grow snap only moves the START edge.\r\n '[class.fly-search-input-host--collapsible]': 'collapsible()',\r\n },\r\n})\r\nexport class FlySearchInputComponent {\r\n private readonly i18n = inject(I18nService);\r\n\r\n /**\r\n * Live input text. Two-way bindable; updates on every keystroke, NOT debounced —\r\n * bind it when you need the raw text (to show a count, or drive a clear button\r\n * elsewhere). React to `(queryChange)` for the settled query.\r\n */\r\n readonly value = model('');\r\n\r\n /** Placeholder. `null` ⇒ the localized `search.placeholder` baseline. */\r\n readonly placeholder = input<string | null>(null);\r\n\r\n /**\r\n * Placeholder as an i18n KEY, translated here. Use instead of `placeholder`\r\n * when the caller holds a key rather than resolved text — the shape every\r\n * other DS component takes (`labelKey`, `titleKey`, `messageKey`, …).\r\n *\r\n * This is not sugar. The kit this component replaced took `placeholderKey`,\r\n * and a plain `placeholderKey=\"x\"` on a component that lacks the input is a\r\n * static ATTRIBUTE, not a binding — Angular accepts it silently and the field\r\n * simply renders with no placeholder. Accepting the key form here is what\r\n * makes that failure impossible rather than invisible.\r\n */\r\n readonly placeholderKey = input<string | null>(null);\r\n\r\n /**\r\n * Accessible name for the input. `null` ⇒ falls back to the resolved placeholder.\r\n * Prefer a descriptive label (\"Search projects by name or owner\") — a placeholder\r\n * repeated as the accessible name tells a screen-reader user nothing about scope.\r\n */\r\n readonly ariaLabel = input<string | null>(null);\r\n\r\n /** Accessible name as an i18n key. See {@link placeholderKey}. */\r\n readonly ariaLabelKey = input<string | null>(null);\r\n\r\n /** Settle delay before `(queryChange)` fires, in milliseconds. */\r\n readonly debounceMs = input(FLY_SEARCH_DEBOUNCE_MS);\r\n\r\n /** Disables the input and hides the clear button. */\r\n readonly disabled = input(false);\r\n\r\n /**\r\n * Collapse mode. When `true` the field renders as a compact circular magnifier\r\n * and grows into a full field when triggered (see {@link expandTrigger}) — the\r\n * space-saving affordance for headers and toolbars. Default `false` = the\r\n * always-open box. Non-breaking: existing consumers are unaffected.\r\n */\r\n readonly collapsible = input(false);\r\n\r\n /** What expands a `collapsible` field (keyboard focus always does). */\r\n readonly expandTrigger = input<FlySearchExpandTrigger>('click');\r\n\r\n /**\r\n * When collapsible, keep the field expanded while it holds a query, so a search\r\n * you've typed doesn't snap shut the instant focus leaves. Default `true`.\r\n */\r\n readonly stayExpandedWithValue = input(true);\r\n\r\n /** Control height preset (28 / 36 / 44px). Default `md`. */\r\n readonly size = input<FlySearchInputSize>('md');\r\n\r\n /**\r\n * Renders a trailing chevron that toggles an ADVANCED FILTER PANEL the host\r\n * anchors beneath the field (the Outlook-style search box). The panel itself\r\n * stays the host's — this only owns the affordance, its `aria-expanded`, and\r\n * keeping the field open while the panel is (see {@link isExpanded}).\r\n *\r\n * Named `showFilterToggle`, not `expandable`, deliberately: \"expand\" already\r\n * means the {@link collapsible} field's own open/close in this component, and\r\n * a second, unrelated meaning of the word on the same API is a trap.\r\n */\r\n readonly showFilterToggle = input(false);\r\n\r\n /** Reflects the host panel's open state — rotates the chevron and sets `aria-expanded`. */\r\n readonly filterPanelOpen = input(false);\r\n\r\n /**\r\n * The settled query — fires `debounceMs` after typing stops, and immediately on\r\n * clear.\r\n *\r\n * Named `queryChange` rather than `search` because `search` is a native DOM event\r\n * name (`<input type=\"search\">` fires one), and an output that shadows a DOM event\r\n * makes `(search)` ambiguous to read.\r\n */\r\n readonly queryChange = output<string>();\r\n\r\n /**\r\n * Alias of `queryChange`, emitted from the same place with the same payload.\r\n *\r\n * Exists for the same reason as {@link placeholderKey}: the kit this component\r\n * replaced emitted `searched`, and `(searched)=\"reload()\"` on a component that\r\n * does not declare it is an unknown-EVENT binding — Angular attaches a DOM\r\n * listener for an event nobody fires and reports nothing. Search silently stops\r\n * working. Accepting the old name keeps that failure impossible.\r\n *\r\n * `queryChange` is the name to use in new code.\r\n */\r\n readonly searched = output<string>();\r\n\r\n /** Fires on Enter, after flushing any pending `queryChange`. */\r\n readonly submitted = output<string>();\r\n\r\n /** Fires when the user clears the box (button or Escape). */\r\n readonly cleared = output<void>();\r\n\r\n /**\r\n * Fires whenever a `collapsible` field expands (`true`) or collapses (`false`).\r\n * Lets a host react to the reveal — e.g. yield sibling space to the growing\r\n * field, or dim a title while the search is open.\r\n */\r\n readonly expandedChange = output<boolean>();\r\n\r\n /**\r\n * The filter chevron was pressed — the host toggles its own panel. Controlled,\r\n * like `open` on the drawer: this component never assumes the panel opened.\r\n */\r\n readonly filterToggled = output<void>();\r\n\r\n private readonly inputEl =\r\n viewChild.required<ElementRef<HTMLInputElement>>('input');\r\n\r\n // Resolution order: explicit text wins, then the i18n key, then the baseline.\r\n // Text-first because a caller passing resolved text is being deliberate.\r\n protected readonly resolvedPlaceholder = computed(() => {\r\n const key = this.placeholderKey();\r\n return this.placeholder() ?? (key ? this.i18n.t(key) : this.i18n.t('search.placeholder'));\r\n });\r\n protected readonly resolvedAriaLabel = computed(() => {\r\n const key = this.ariaLabelKey();\r\n return this.ariaLabel() ?? (key ? this.i18n.t(key) : this.resolvedPlaceholder());\r\n });\r\n protected readonly clearLabel = computed(() => this.i18n.t('search.clear'));\r\n /** Accessible name of the advanced-filter chevron. */\r\n protected readonly filterToggleLabel = computed(() => this.i18n.t('search.filters'));\r\n /** Accessible name of the collapsed magnifier affordance (an action, not the placeholder). */\r\n protected readonly collapsedLabel = computed(() => this.i18n.t('search.open'));\r\n protected readonly hasValue = computed(() => this.value().length > 0);\r\n\r\n // ── Collapse state ──────────────────────────────────────────────────────────\r\n private readonly inputFocused = signal(false);\r\n private readonly hovered = signal(false);\r\n\r\n /**\r\n * Whether a `collapsible` field is currently open. Non-collapsible fields are\r\n * always \"expanded\". Open when: the field has focus, OR (hover trigger) it's\r\n * hovered, OR it holds a query and {@link stayExpandedWithValue} is on.\r\n */\r\n readonly isExpanded = computed(\r\n () =>\r\n !this.collapsible() ||\r\n this.inputFocused() ||\r\n (this.hovered() && this.expandTrigger() === 'hover') ||\r\n (this.stayExpandedWithValue() && this.hasValue()) ||\r\n // An open filter panel pins the field open: otherwise moving the pointer\r\n // from the chevron to the panel collapses the field out from under the\r\n // gesture, taking its own anchor with it.\r\n this.filterPanelOpen(),\r\n );\r\n\r\n /** Collapsed + a pointer trigger ⇒ the whole control is the button that expands it. */\r\n protected readonly showCollapsedButton = computed(\r\n () => this.collapsible() && !this.isExpanded() && this.expandTrigger() !== 'focus',\r\n );\r\n\r\n /**\r\n * Field tab-index. Collapsed with a pointer trigger ⇒ `-1` (the wrapper button is\r\n * the tab-stop, so Tab reaches the affordance once, not a hidden field). Otherwise\r\n * `0`. `focus`-trigger fields stay tabbable so tabbing in opens them.\r\n */\r\n protected readonly fieldTabIndex = computed(() =>\r\n this.collapsible() && !this.isExpanded() && this.expandTrigger() !== 'focus' ? -1 : 0,\r\n );\r\n\r\n private readonly debouncer = new FlyDebouncer<[string]>(\r\n query => this.emitQuery(query),\r\n FLY_SEARCH_DEBOUNCE_MS,\r\n );\r\n\r\n /** Single emit point so `searched` can never drift out of step with `queryChange`. */\r\n private emitQuery(query: string): void {\r\n this.queryChange.emit(query);\r\n this.searched.emit(query);\r\n }\r\n\r\n constructor() {\r\n inject(DestroyRef).onDestroy(() => this.debouncer.cancel());\r\n // Track `debounceMs` so a host that changes it at runtime doesn't leave the\r\n // debouncer closed over the old timing.\r\n effect(() => this.debouncer.setDelay(this.debounceMs()));\r\n // Surface the open/closed transition to the host. `isExpanded` is memoized, so\r\n // this fires once per real change (including the initial value), never per keystroke.\r\n effect(() => this.expandedChange.emit(this.isExpanded()));\r\n }\r\n\r\n protected onFocus(): void {\r\n this.inputFocused.set(true);\r\n }\r\n\r\n protected onBlur(): void {\r\n this.inputFocused.set(false);\r\n }\r\n\r\n protected onHoverEnter(): void {\r\n if (this.expandTrigger() === 'hover') this.hovered.set(true);\r\n }\r\n\r\n protected onHoverLeave(): void {\r\n this.hovered.set(false);\r\n }\r\n\r\n /** Click / Enter / Space on the collapsed magnifier → open + focus the field. */\r\n protected onCollapsedActivate(event: Event): void {\r\n event.preventDefault();\r\n this.inputEl().nativeElement.focus();\r\n }\r\n\r\n protected onInput(event: Event): void {\r\n const query = (event.target as HTMLInputElement).value;\r\n this.value.set(query);\r\n this.debouncer.run(query);\r\n }\r\n\r\n protected onEnter(): void {\r\n // Flush first so `(queryChange)` lands before `(submitted)` — a parent that\r\n // filters on the query and acts on submit must observe them in that order.\r\n this.debouncer.flush();\r\n this.submitted.emit(this.value());\r\n }\r\n\r\n protected onEscape(event: Event): void {\r\n if (this.hasValue()) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n this.clear();\r\n return;\r\n }\r\n // Progressive dismissal for collapsible fields: an empty-but-open field is\r\n // itself a dismissable layer, so Escape closes IT (blur → collapse) instead\r\n // of bubbling to the enclosing overlay. The ladder reads: Esc① clears the\r\n // text, Esc② collapses the field, Esc③ (bubbling from elsewhere) dismisses\r\n // the overlay. Non-collapsible fields keep the bubble-through behaviour.\r\n if (this.collapsible() && this.isExpanded()) {\r\n event.stopPropagation();\r\n event.preventDefault();\r\n this.inputEl().nativeElement.blur();\r\n }\r\n }\r\n\r\n /** Clears the box and emits an immediate (undebounced) empty `queryChange`. */\r\n clear(): void {\r\n this.debouncer.cancel();\r\n this.value.set('');\r\n this.emitQuery('');\r\n this.cleared.emit();\r\n this.inputEl().nativeElement.focus();\r\n }\r\n\r\n /** Moves focus into the input — for hosts wiring a `/` or Ctrl+F shortcut. */\r\n focus(): void {\r\n this.inputEl().nativeElement.focus();\r\n }\r\n}\r\n","<!--\r\n Collapsible mode: the wrapper doubles as the \"open search\" button when collapsed\r\n behind a pointer trigger (role/tabindex/aria-label applied only then). The field\r\n stays mounted throughout (never unmounted) so focus and typed text survive the\r\n collapse animation; it's clipped to width 0 while collapsed. Logical CSS only —\r\n RTL needs no overrides.\r\n-->\r\n<div\r\n class=\"fly-search-input\"\r\n [class.fly-search-input--disabled]=\"disabled()\"\r\n [class.fly-search-input--collapsible]=\"collapsible()\"\r\n [class.fly-search-input--collapsed]=\"collapsible() && !isExpanded()\"\r\n [class.fly-search-input--expanded]=\"collapsible() && isExpanded()\"\r\n [class.fly-search-input--sm]=\"size() === 'sm'\"\r\n [class.fly-search-input--lg]=\"size() === 'lg'\"\r\n [attr.role]=\"showCollapsedButton() ? 'button' : null\"\r\n [attr.tabindex]=\"showCollapsedButton() ? 0 : null\"\r\n [attr.aria-label]=\"showCollapsedButton() ? collapsedLabel() : null\"\r\n [attr.aria-expanded]=\"showCollapsedButton() ? false : null\"\r\n (mouseenter)=\"onHoverEnter()\"\r\n (mouseleave)=\"onHoverLeave()\"\r\n (click)=\"showCollapsedButton() ? onCollapsedActivate($event) : null\"\r\n (keydown.enter)=\"showCollapsedButton() ? onCollapsedActivate($event) : null\"\r\n (keydown.space)=\"showCollapsedButton() ? onCollapsedActivate($event) : null\">\r\n <i class=\"pi pi-search fly-search-input__icon\" aria-hidden=\"true\"></i>\r\n\r\n <input\r\n #input\r\n class=\"fly-search-input__field\"\r\n type=\"search\"\r\n autocomplete=\"off\"\r\n [attr.tabindex]=\"fieldTabIndex()\"\r\n [attr.aria-label]=\"resolvedAriaLabel()\"\r\n [placeholder]=\"resolvedPlaceholder()\"\r\n [value]=\"value()\"\r\n [disabled]=\"disabled()\"\r\n (input)=\"onInput($event)\"\r\n (focus)=\"onFocus()\"\r\n (blur)=\"onBlur()\"\r\n (keydown.enter)=\"onEnter()\"\r\n (keydown.escape)=\"onEscape($event)\" />\r\n\r\n @if (hasValue() && !disabled() && (!collapsible() || isExpanded())) {\r\n <!-- mousedown.preventDefault keeps focus in the input: without it, the\r\n mousedown blurs the field, a collapse (stayExpandedWithValue=false)\r\n removes this button mid-gesture, and the click never lands. -->\r\n <button\r\n class=\"fly-search-input__clear\"\r\n type=\"button\"\r\n [attr.aria-label]=\"clearLabel()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"$event.stopPropagation(); clear()\">\r\n <i class=\"pi pi-times\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n\r\n @if (showFilterToggle() && !disabled()) {\r\n <!-- Advanced-filter affordance. Same mousedown.preventDefault as the clear\r\n button: without it the mousedown blurs the field, which can collapse a\r\n `collapsible` box and unmount this button before the click lands. -->\r\n <button\r\n class=\"fly-search-input__filter\"\r\n type=\"button\"\r\n [class.fly-search-input__filter--open]=\"filterPanelOpen()\"\r\n [attr.aria-expanded]=\"filterPanelOpen()\"\r\n [attr.aria-label]=\"filterToggleLabel()\"\r\n (mousedown)=\"$event.preventDefault()\"\r\n (click)=\"$event.stopPropagation(); filterToggled.emit()\">\r\n <i class=\"pi pi-chevron-down\" aria-hidden=\"true\"></i>\r\n </button>\r\n }\r\n</div>\r\n","/**\r\n * Canonical, cross-browser \"save this Blob to disk with a real filename\" helper,\r\n * plus the `Content-Disposition` filename parsing that always accompanies it.\r\n *\r\n * ## Why this exists (and why the naive inline version is a trap)\r\n * The obvious pattern —\r\n *\r\n * ```ts\r\n * const url = URL.createObjectURL(blob);\r\n * a.href = url; a.download = name; a.click();\r\n * a.remove(); URL.revokeObjectURL(url); // ← synchronous cleanup\r\n * ```\r\n *\r\n * works in Chromium (which reads the blob synchronously during `click()`) but BREAKS\r\n * in WebKit/Safari, which schedules the download on a later task. The synchronous\r\n * `revokeObjectURL` destroys the blob URL before WebKit reads it, so the browser\r\n * abandons the `download` hint and instead *navigates* to the `blob:…/<uuid>` URL — a\r\n * PDF then opens inline in the viewer and \"Save\" yields the URL's GUID with NO\r\n * extension. (Anchor: the strategy PDF-export bug.)\r\n *\r\n * Every hand-rolled copy of this dance in the estate revokes either synchronously or\r\n * on a ~1s timer; both are the same bug, the second merely narrower. Use this.\r\n *\r\n * Fixes baked in:\r\n * - **Deferred cleanup** — revoke the object URL and detach the anchor on a long\r\n * timer, never synchronously, so WebKit has the URL alive when it reads it.\r\n * - **Typed blob fallback** — if the blob carries no MIME type, wrap it with one so\r\n * the extension / inline-render association is never lost.\r\n * - **Real `download` attribute** so the OS save dialog gets the proper name.\r\n * - `rel=\"noopener\"` and an SSR no-op guard.\r\n *\r\n * No Angular dependencies — pure DOM, unit-testable without a TestBed.\r\n */\r\n\r\n/**\r\n * Delay before the object URL is revoked and the anchor detached.\r\n *\r\n * Deliberately far longer than \"download initiation\" needs: the cost of holding a\r\n * blob URL a while longer is trivial, and the cost of revoking too early is a silently\r\n * broken download on Safari. Do not tune this down without reproducing the WebKit\r\n * behaviour described above.\r\n */\r\nconst REVOKE_DELAY_MS = 40_000;\r\n\r\n/**\r\n * Triggers a browser download for a `Blob`.\r\n *\r\n * @param blob The file content.\r\n * @param fileName Name offered to the OS save dialog, extension included.\r\n * @param mimeFallback MIME type applied when `blob.type` is empty.\r\n */\r\nexport function flyDownloadBlob(\r\n blob: Blob,\r\n fileName: string,\r\n mimeFallback = 'application/octet-stream',\r\n): void {\r\n if (typeof document === 'undefined') return; // SSR / non-browser no-op\r\n\r\n // Guarantee a typed blob — an empty type can make the browser drop the extension\r\n // association on the saved file.\r\n const typed = blob.type ? blob : new Blob([blob], { type: mimeFallback });\r\n const url = URL.createObjectURL(typed);\r\n\r\n const anchor = document.createElement('a');\r\n anchor.href = url;\r\n anchor.download = fileName;\r\n anchor.rel = 'noopener';\r\n anchor.style.display = 'none';\r\n document.body.appendChild(anchor);\r\n anchor.click();\r\n\r\n // CRITICAL: do NOT revoke / remove synchronously. See the module doc.\r\n setTimeout(() => {\r\n URL.revokeObjectURL(url);\r\n anchor.remove();\r\n }, REVOKE_DELAY_MS);\r\n}\r\n\r\n/**\r\n * Resolves a downloadable file's name from a `Content-Disposition` response header,\r\n * falling back to `fallback` when the header is absent or carries no filename.\r\n *\r\n * Handles both `filename=\"report.xlsx\"` and the RFC 5987 `filename*=UTF-8''report.xlsx`\r\n * form, and percent-decodes the result so non-ASCII names survive.\r\n *\r\n * @example\r\n * ```ts\r\n * const name = flyExportFileName(res.headers.get('content-disposition'), 'export.csv');\r\n * flyDownloadBlob(res.body!, name);\r\n * ```\r\n */\r\nexport function flyExportFileName(\r\n contentDisposition: string | null | undefined,\r\n fallback: string,\r\n): string {\r\n const match = /filename\\*?=(?:UTF-8'')?\"?([^\";]+)\"?/i.exec(contentDisposition ?? '');\r\n if (!match) return fallback;\r\n try {\r\n return decodeURIComponent(match[1]);\r\n } catch {\r\n // A literal `%` in the filename makes decodeURIComponent throw; the raw match is\r\n // still a better name than the generic fallback.\r\n return match[1];\r\n }\r\n}\r\n","/**\r\n * Locale-aware formatting primitives — numbers, byte sizes, relative time, and dates.\r\n *\r\n * All of these are `Intl`-backed and take an explicit `locale`, which is the whole\r\n * point: the estate is full of hand-rolled formatters that hardcode ASCII digits,\r\n * English unit strings (\"1.4 MB\", \"5m ago\"), or the *browser's* default locale rather\r\n * than the app's selected language. Under `ar` / `ur` those render wrong — and i18n is\r\n * mandatory on this platform, so this is a correctness surface, not a convenience one.\r\n *\r\n * Pure functions here; the `| flyCompact`-style pipes in `format.pipes.ts` wrap them\r\n * and default the locale to the active {@link I18nService} language.\r\n *\r\n * ## The em-dash convention\r\n * Every formatter returns `'—'` (U+2014) for null / undefined / non-finite input rather\r\n * than throwing, `'NaN'`, or an empty string. A visible placeholder keeps table columns\r\n * aligned and makes \"no value\" legible; an empty string reads as a rendering bug.\r\n */\r\n\r\n/** Rendered for null / undefined / non-finite input across every formatter here. */\r\nexport const FLY_EMPTY_VALUE = '—';\r\n\r\n// ─── Numbers ─────────────────────────────────────────────────────────────────\r\n\r\n/** At or above this magnitude, switch from grouped-exact to compact (K/M/B) notation. */\r\nexport const FLY_COMPACT_THRESHOLD = 10_000;\r\n\r\n// Intl formatters are expensive to construct relative to how often these are called in\r\n// a table cell or chart label; cache one per distinct configuration.\r\nconst compactCache = new Map<string, Intl.NumberFormat>();\r\nconst integerCache = new Map<string, Intl.NumberFormat>();\r\nconst decimalCache = new Map<string, Intl.NumberFormat>();\r\n\r\nfunction compactFormatter(locale: string): Intl.NumberFormat {\r\n let f = compactCache.get(locale);\r\n if (!f) {\r\n f = new Intl.NumberFormat(locale, { notation: 'compact', maximumFractionDigits: 1 });\r\n compactCache.set(locale, f);\r\n }\r\n return f;\r\n}\r\n\r\nfunction integerFormatter(locale: string): Intl.NumberFormat {\r\n let f = integerCache.get(locale);\r\n if (!f) {\r\n f = new Intl.NumberFormat(locale, { maximumFractionDigits: 0 });\r\n integerCache.set(locale, f);\r\n }\r\n return f;\r\n}\r\n\r\n/**\r\n * Compact, scannable form — grouped-exact below {@link FLY_COMPACT_THRESHOLD},\r\n * unit-compacted above it.\r\n *\r\n * ```\r\n * 6 042 → \"6,042\" (exact; small buckets read best as real numbers)\r\n * 12 400 → \"12.4K\"\r\n * 1 900 787 → \"1.9M\"\r\n * 2 300 000 000 → \"2.3B\"\r\n * ```\r\n *\r\n * Pair with {@link flyFullNumber} in a tooltip or `aria-label` so the exact figure is\r\n * always one hover away — compaction is a display affordance, not data loss.\r\n */\r\nexport function flyCompactNumber(\r\n value: number | null | undefined,\r\n locale = 'en',\r\n): string {\r\n if (value == null || !Number.isFinite(value)) return FLY_EMPTY_VALUE;\r\n return Math.abs(value) >= FLY_COMPACT_THRESHOLD\r\n ? compactFormatter(locale).format(value)\r\n : integerFormatter(locale).format(value);\r\n}\r\n\r\n/** Exact, fully-grouped integer form for tooltips / a11y (e.g. `\"1,900,787\"`). */\r\nexport function flyFullNumber(\r\n value: number | null | undefined,\r\n locale = 'en',\r\n): string {\r\n if (value == null || !Number.isFinite(value)) return FLY_EMPTY_VALUE;\r\n return integerFormatter(locale).format(value);\r\n}\r\n\r\n/**\r\n * Fractional form for ratios where the decimal *is* the signal (avg depth 1.5,\r\n * sparsity 0.25) — distinct from {@link flyFullNumber}, which floors to integers.\r\n * Trailing zeros drop.\r\n */\r\nexport function flyDecimalNumber(\r\n value: number | null | undefined,\r\n locale = 'en',\r\n maxFractionDigits = 2,\r\n): string {\r\n if (value == null || !Number.isFinite(value)) return FLY_EMPTY_VALUE;\r\n const key = `${locale}|${maxFractionDigits}`;\r\n let f = decimalCache.get(key);\r\n if (!f) {\r\n f = new Intl.NumberFormat(locale, { maximumFractionDigits: maxFractionDigits });\r\n decimalCache.set(key, f);\r\n }\r\n return f.format(value);\r\n}\r\n\r\n/**\r\n * Signed compact delta for \"change since last poll\" chips (`\"+12.4K\"`, `\"−340\"`).\r\n * Returns an empty string for zero / non-finite so a no-change chip renders nothing\r\n * rather than a meaningless \"0\".\r\n *\r\n * Uses U+2212 MINUS SIGN, not a hyphen — it matches the plus glyph's width and weight,\r\n * so a column of deltas stays visually aligned.\r\n */\r\nexport function flySignedCompact(delta: number, locale = 'en'): string {\r\n if (!Number.isFinite(delta) || delta === 0) return '';\r\n const sign = delta > 0 ? '+' : '−';\r\n return sign + flyCompactNumber(Math.abs(delta), locale);\r\n}\r\n\r\n// ─── Byte sizes ──────────────────────────────────────────────────────────────\r\n\r\n/** Binary unit ladder. Byte sizes are conventionally base-1024 in file UIs. */\r\nconst BYTE_UNITS = ['byte', 'kilobyte', 'megabyte', 'gigabyte', 'terabyte'] as const;\r\n\r\nconst byteCache = new Map<string, Intl.NumberFormat>();\r\n\r\n/**\r\n * Human-readable byte size (`\"482 bytes\"`, `\"1.4 MB\"`, `\"2.3 GB\"`), localized.\r\n *\r\n * Base-1024 with a log-derived unit pick, clamped at TB so a bogus huge value degrades\r\n * to a large TB figure instead of overflowing the ladder. Trailing zeros drop\r\n * (`1.0 MB` → `1 MB`).\r\n *\r\n * Localization matters here and is the reason this supersedes the eight hand-rolled\r\n * copies in the estate: those concatenate hardcoded English unit strings, so an Arabic\r\n * user saw Latin \"MB\" beside Arabic-Indic digits. `Intl` unit formatting renders both\r\n * the number and the unit in the active locale (French even gets \"octets\").\r\n *\r\n * Note the deliberate convention mismatch: the maths is base-1024 while the rendered\r\n * symbols are the SI ones (\"kB\", \"MB\"), so 1024 bytes shows as \"1 kB\" rather than the\r\n * pedantically-correct \"1 KiB\". Every mainstream file UI — Windows Explorer, Finder —\r\n * does exactly this, and `Intl` has no binary-prefix units, so matching user\r\n * expectation beats matching the standard here.\r\n */\r\nexport function flyFormatBytes(\r\n bytes: number | null | undefined,\r\n locale = 'en',\r\n): string {\r\n if (bytes == null || !Number.isFinite(bytes)) return FLY_EMPTY_VALUE;\r\n if (bytes <= 0) return formatByteValue(0, 'byte', locale);\r\n\r\n const index = Math.min(\r\n Math.floor(Math.log(bytes) / Math.log(1024)),\r\n BYTE_UNITS.length - 1,\r\n );\r\n const value = bytes / Math.pow(1024, index);\r\n // Bytes are whole things — never render \"482.3 B\".\r\n const rounded = index === 0 ? Math.round(value) : parseFloat(value.toFixed(1));\r\n return formatByteValue(rounded, BYTE_UNITS[index], locale);\r\n}\r\n\r\nfunction formatByteValue(\r\n value: number,\r\n unit: (typeof BYTE_UNITS)[number],\r\n locale: string,\r\n): string {\r\n const key = `${locale}|${unit}`;\r\n let f = byteCache.get(key);\r\n if (!f) {\r\n f = new Intl.NumberFormat(locale, {\r\n style: 'unit',\r\n unit,\r\n // Raw bytes read best spelled out and pluralized (\"482 bytes\", \"1 byte\" —\r\n // and correctly \"482 octets\" in French). The larger units are universally\r\n // recognised as symbols, where the spelled-out form (\"1.4 megabytes\") would\r\n // be noise in a file list.\r\n unitDisplay: unit === 'byte' ? 'long' : 'short',\r\n maximumFractionDigits: 1,\r\n });\r\n byteCache.set(key, f);\r\n }\r\n return f.format(value);\r\n}\r\n\r\n// ─── Relative time ───────────────────────────────────────────────────────────\r\n\r\n/**\r\n * Formats an instant as a localized relative age — `\"2 minutes ago\"` /\r\n * `\"منذ دقيقتين\"` / `\"il y a 2 minutes\"`. Works for future instants too\r\n * (`\"in 3 days\"`), which is what makes it usable for due dates and SLA countdowns.\r\n *\r\n * `now` is injectable so tests can pin the clock instead of sleeping or accepting\r\n * flake around bucket boundaries.\r\n */\r\nexport function flyRelativeTime(\r\n value: string | number | Date | null | undefined,\r\n locale = 'en',\r\n now: Date = new Date(),\r\n): string {\r\n if (value == null || value === '') return FLY_EMPTY_VALUE;\r\n const then = value instanceof Date ? value : new Date(value);\r\n const ms = then.getTime();\r\n if (Number.isNaN(ms)) return FLY_EMPTY_VALUE;\r\n\r\n const diffMs = ms - now.getTime();\r\n const rtf = new Intl.RelativeTimeFormat(locale, { numeric: 'auto' });\r\n const absSec = Math.abs(diffMs) / 1000;\r\n\r\n // `numeric: 'auto'` is what yields \"yesterday\" / \"now\" instead of a stiff\r\n // \"1 day ago\" / \"0 seconds ago\" at the bucket edges.\r\n if (absSec < 60) return rtf.format(Math.round(diffMs / 1000), 'second');\r\n if (absSec < 3600) return rtf.format(Math.round(diffMs / 60_000), 'minute');\r\n if (absSec < 86_400) return rtf.format(Math.round(diffMs / 3_600_000), 'hour');\r\n if (absSec < 2_592_000) return rtf.format(Math.round(diffMs / 86_400_000), 'day');\r\n if (absSec < 31_536_000) return rtf.format(Math.round(diffMs / 2_592_000_000), 'month');\r\n return rtf.format(Math.round(diffMs / 31_536_000_000), 'year');\r\n}\r\n\r\n/**\r\n * Formats a duration in seconds as a localized short unit string — `420` → `\"7 min\"`\r\n * (en) / `\"7 د\"` (ar). Picks seconds / minutes / hours by magnitude.\r\n */\r\nexport function flyDuration(\r\n seconds: number | null | undefined,\r\n locale = 'en',\r\n): string {\r\n if (seconds == null || !Number.isFinite(seconds) || seconds < 0) {\r\n return FLY_EMPTY_VALUE;\r\n }\r\n const fmt = (unit: 'second' | 'minute' | 'hour', v: number): string =>\r\n new Intl.NumberFormat(locale, {\r\n style: 'unit',\r\n unit,\r\n unitDisplay: 'narrow',\r\n maximumFractionDigits: 0,\r\n }).format(v);\r\n\r\n if (seconds < 60) return fmt('second', seconds);\r\n if (seconds < 3600) return fmt('minute', seconds / 60);\r\n return fmt('hour', seconds / 3600);\r\n}\r\n\r\n// ─── Dates ───────────────────────────────────────────────────────────────────\r\n\r\n/**\r\n * Localized calendar date (no time). Pass `options` to override the default\r\n * short-date presentation.\r\n *\r\n * Unlike the bare `toLocaleDateString()` calls it replaces, this takes an explicit\r\n * locale — those used the *browser's* locale and so ignored the app's language setting\r\n * entirely. Invalid input degrades to the em dash rather than `\"Invalid Date\"`.\r\n */\r\nexport function flyFormatDate(\r\n value: string | number | Date | null | undefined,\r\n locale = 'en',\r\n options: Intl.DateTimeFormatOptions = { dateStyle: 'medium' },\r\n): string {\r\n const date = toValidDate(value);\r\n if (!date) return FLY_EMPTY_VALUE;\r\n try {\r\n return new Intl.DateTimeFormat(locale, options).format(date);\r\n } catch {\r\n // A malformed `options` object (or an unsupported locale extension) throws;\r\n // degrade to the ISO date rather than taking the view down.\r\n return date.toISOString().slice(0, 10);\r\n }\r\n}\r\n\r\n/** Localized time of day (no date). */\r\nexport function flyFormatTime(\r\n value: string | number | Date | null | undefined,\r\n locale = 'en',\r\n options: Intl.DateTimeFormatOptions = { timeStyle: 'short' },\r\n): string {\r\n return flyFormatDate(value, locale, options);\r\n}\r\n\r\n/** Localized date + time — the tooltip companion to a relative or short-date cell. */\r\nexport function flyFormatDateTime(\r\n value: string | number | Date | null | undefined,\r\n locale = 'en',\r\n options: Intl.DateTimeFormatOptions = { dateStyle: 'medium', timeStyle: 'short' },\r\n): string {\r\n return flyFormatDate(value, locale, options);\r\n}\r\n\r\n/**\r\n * Calendar date as `yyyy-MM-dd` — the wire/sort form, deliberately NOT localized.\r\n *\r\n * Use for `<input type=\"date\">` values, query params, and sort keys. For anything a\r\n * user reads, use {@link flyFormatDate}.\r\n *\r\n * Derived from the instant's **UTC** date so the value is stable across timezones —\r\n * a local-date derivation shifts the day for users east/west of the source data.\r\n */\r\nexport function flyToDateOnly(\r\n value: string | number | Date | null | undefined,\r\n): string {\r\n const date = toValidDate(value);\r\n return date ? date.toISOString().slice(0, 10) : '';\r\n}\r\n\r\nfunction toValidDate(value: string | number | Date | null | undefined): Date | null {\r\n if (value == null || value === '') return null;\r\n const date = value instanceof Date ? value : new Date(value);\r\n return Number.isNaN(date.getTime()) ? null : date;\r\n}\r\n","import { Pipe, PipeTransform, inject } from '@angular/core';\r\nimport { I18nService } from '../services/i18n.service';\r\nimport {\r\n flyCompactNumber,\r\n flyDecimalNumber,\r\n flyDuration,\r\n flyFormatBytes,\r\n flyFormatDate,\r\n flyFormatDateTime,\r\n flyFormatTime,\r\n flyFullNumber,\r\n flyRelativeTime,\r\n} from '../utils/format';\r\n\r\n/**\r\n * Template wrappers over the `format.ts` primitives. Each defaults its locale to the\r\n * active {@link I18nService} language, so the common case is `{{ value | flyBytes }}`\r\n * with no arguments.\r\n *\r\n * ## Pass the locale explicitly when the language can change at runtime\r\n * These are **pure** pipes — Angular re-evaluates them only when their inputs change.\r\n * `i18n.locale()` read inside `transform` is not an input, so a language toggle will\r\n * not by itself re-render an already-rendered cell. In a view that must react live to\r\n * the language switcher, pass the locale signal as an argument:\r\n *\r\n * ```html\r\n * {{ total | flyCompact: i18n.locale() }}\r\n * ```\r\n *\r\n * Now the locale IS an input and the pipe re-runs on toggle. Omitting it is correct and\r\n * cheaper for views that are rebuilt on language change anyway (most routed screens).\r\n * Making these impure instead would run them on every change-detection pass — the wrong\r\n * trade for values that appear in large tables.\r\n */\r\n\r\n/** `{{ n | flyCompact }}` → `\"1.9M\"` / `\"12.4K\"` / `\"6,042\"`. */\r\n@Pipe({ name: 'flyCompact', standalone: true })\r\nexport class FlyCompactNumberPipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(value: number | null | undefined, locale?: string): string {\r\n return flyCompactNumber(value, locale ?? this.i18n.locale());\r\n }\r\n}\r\n\r\n/** `{{ n | flyFull }}` → exact grouped form (`\"1,900,787\"`) for tooltips / a11y. */\r\n@Pipe({ name: 'flyFull', standalone: true })\r\nexport class FlyFullNumberPipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(value: number | null | undefined, locale?: string): string {\r\n return flyFullNumber(value, locale ?? this.i18n.locale());\r\n }\r\n}\r\n\r\n/** `{{ ratio | flyDecimal }}` / `{{ ratio | flyDecimal: locale : 3 }}`. */\r\n@Pipe({ name: 'flyDecimal', standalone: true })\r\nexport class FlyDecimalNumberPipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(\r\n value: number | null | undefined,\r\n locale?: string,\r\n maxFractionDigits = 2,\r\n ): string {\r\n return flyDecimalNumber(value, locale ?? this.i18n.locale(), maxFractionDigits);\r\n }\r\n}\r\n\r\n/** `{{ file.size | flyBytes }}` → `\"1.4 MB\"`, localized units included. */\r\n@Pipe({ name: 'flyBytes', standalone: true })\r\nexport class FlyBytesPipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(value: number | null | undefined, locale?: string): string {\r\n return flyFormatBytes(value, locale ?? this.i18n.locale());\r\n }\r\n}\r\n\r\n/**\r\n * `{{ row.updatedAt | flyRelativeTime }}` → `\"2 minutes ago\"`.\r\n *\r\n * Renders once per change-detection input change — it does NOT tick on its own. For a\r\n * live-ageing timestamp, drive a signal on an interval in the component and pass it\r\n * through, so the re-render is explicit and you control the cost.\r\n */\r\n@Pipe({ name: 'flyRelativeTime', standalone: true })\r\nexport class FlyRelativeTimePipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(\r\n value: string | number | Date | null | undefined,\r\n locale?: string,\r\n now?: Date,\r\n ): string {\r\n return flyRelativeTime(value, locale ?? this.i18n.locale(), now);\r\n }\r\n}\r\n\r\n/** `{{ seconds | flyDuration }}` → `\"7 min\"`. */\r\n@Pipe({ name: 'flyDuration', standalone: true })\r\nexport class FlyDurationPipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(value: number | null | undefined, locale?: string): string {\r\n return flyDuration(value, locale ?? this.i18n.locale());\r\n }\r\n}\r\n\r\n/** `{{ iso | flyDate }}` → localized medium date; pass `options` to override. */\r\n@Pipe({ name: 'flyDate', standalone: true })\r\nexport class FlyDatePipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(\r\n value: string | number | Date | null | undefined,\r\n locale?: string,\r\n options?: Intl.DateTimeFormatOptions,\r\n ): string {\r\n return flyFormatDate(value, locale ?? this.i18n.locale(), options);\r\n }\r\n}\r\n\r\n/** `{{ iso | flyTime }}` → localized short time of day. */\r\n@Pipe({ name: 'flyTime', standalone: true })\r\nexport class FlyTimePipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(\r\n value: string | number | Date | null | undefined,\r\n locale?: string,\r\n options?: Intl.DateTimeFormatOptions,\r\n ): string {\r\n return flyFormatTime(value, locale ?? this.i18n.locale(), options);\r\n }\r\n}\r\n\r\n/** `{{ iso | flyDateTime }}` → localized date + time. */\r\n@Pipe({ name: 'flyDateTime', standalone: true })\r\nexport class FlyDateTimePipe implements PipeTransform {\r\n private readonly i18n = inject(I18nService);\r\n transform(\r\n value: string | number | Date | null | undefined,\r\n locale?: string,\r\n options?: Intl.DateTimeFormatOptions,\r\n ): string {\r\n return flyFormatDateTime(value, locale ?? this.i18n.locale(), options);\r\n }\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n effect,\r\n inject,\r\n input,\r\n} from '@angular/core';\r\nimport { I18nService } from '../../../services/i18n.service';\r\n\r\nexport type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger' | 'danger-fill';\r\nexport type ButtonSize = 'xs' | 'sm' | 'md';\r\nexport type IconButtonVariant = 'neutral' | 'primary' | 'danger';\r\n\r\n/**\r\n * Text/action button — attribute component so the native element keeps its\r\n * semantics (`<button fly-button …>` / `<a fly-button …>`).\r\n *\r\n * Variants (extracted from the reference toolbar buttons):\r\n * - `primary` solid dark fill — the main affirmative action\r\n * - `secondary` bordered neutral (default)\r\n * - `ghost` borderless neutral\r\n * - `danger` danger-tinted outline\r\n * - `danger-fill` solid danger fill — destructive confirmation\r\n */\r\n@Component({\r\n selector: 'button[fly-button], a[fly-button]',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[attr.data-variant]': 'variant()',\r\n '[attr.data-size]': 'size()',\r\n '[attr.aria-busy]': 'loading() ? \"true\" : null',\r\n '[attr.disabled]': 'loading() ? \"\" : null',\r\n },\r\n template: `\r\n @if (loading()) {\r\n <i class=\"pi pi-spin pi-spinner\" aria-hidden=\"true\"></i>\r\n }\r\n <ng-content />\r\n `,\r\n styleUrl: './button.component.scss',\r\n})\r\nexport class FlyButtonComponent {\r\n readonly variant = input<ButtonVariant>('secondary');\r\n readonly size = input<ButtonSize>('md');\r\n /** Shows an inline spinner, sets `aria-busy` + `disabled`, and blocks pointer and keyboard activation. */\r\n readonly loading = input(false);\r\n}\r\n\r\n/**\r\n * Circular 34px icon-only button (ported from the legacy global\r\n * `.circles-iconbtn` disc — both render identically until the P6 sweep).\r\n *\r\n * `tooltipKey` resolves through {@link I18nService} and wires BOTH\r\n * `data-tooltip` (CSS tooltip) and `aria-label`, re-resolving on locale change.\r\n */\r\n@Component({\r\n selector: 'button[fly-icon-button]',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[attr.data-variant]': 'variant()',\r\n '[class.on]': 'active()',\r\n },\r\n template: '<ng-content />',\r\n styleUrl: './icon-button.component.scss',\r\n})\r\nexport class FlyIconButtonComponent {\r\n private readonly i18n = inject(I18nService);\r\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n readonly variant = input<IconButtonVariant>('neutral');\r\n /** Toggled / active state (the legacy `.on` modifier). */\r\n readonly active = input(false);\r\n /** i18n key applied as both `data-tooltip` and `aria-label`. */\r\n readonly tooltipKey = input<string>();\r\n\r\n constructor() {\r\n // Imperative (not host bindings) so a consumer-provided static aria-label\r\n // survives when no tooltipKey is given.\r\n let written = false;\r\n effect(() => {\r\n const key = this.tooltipKey();\r\n this.i18n.version();\r\n const host = this.el.nativeElement;\r\n if (!key) {\r\n if (written) {\r\n host.removeAttribute('data-tooltip');\r\n host.removeAttribute('aria-label');\r\n written = false;\r\n }\r\n return;\r\n }\r\n const text = this.i18n.t(key);\r\n host.setAttribute('data-tooltip', text);\r\n host.setAttribute('aria-label', text);\r\n written = true;\r\n });\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\n\r\nexport type ChipTone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger';\r\n\r\n/**\r\n * Read-only pill for tags, categories, and inline qualifiers.\r\n * Text/icon arrive via content projection.\r\n */\r\n@Component({\r\n selector: 'fly-chip',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '[attr.data-tone]': 'tone()' },\r\n template: '<ng-content />',\r\n styleUrl: './chip.component.scss',\r\n})\r\nexport class FlyChipComponent {\r\n readonly tone = input<ChipTone>('accent');\r\n}\r\n","export type StateMessageKind = 'empty' | 'loading' | 'error' | 'success' | 'warning';\r\n\r\n/** Default `pi-*` icon classes per state kind. */\r\nexport const STATE_DEFAULT_ICONS: Record<StateMessageKind, string> = {\r\n empty: 'pi-inbox',\r\n loading: 'pi-spin pi-spinner',\r\n error: 'pi-exclamation-triangle',\r\n success: 'pi-check-circle',\r\n warning: 'pi-exclamation-circle',\r\n};\r\n\r\n/**\r\n * Default message keys per kind. `success`/`warning` have no intrinsic chrome\r\n * string — the caller must supply `messageKey` (or project content).\r\n */\r\nexport const STATE_DEFAULT_MESSAGE_KEYS: Partial<Record<StateMessageKind, string>> = {\r\n empty: 'ui.state.empty',\r\n loading: 'ui.state.loading',\r\n error: 'ui.state.error',\r\n};\r\n\r\nexport function resolveStateIcon(kind: StateMessageKind, override?: string): string {\r\n return override ?? STATE_DEFAULT_ICONS[kind];\r\n}\r\n\r\nexport function resolveStateMessageKey(\r\n kind: StateMessageKind,\r\n override?: string,\r\n): string | undefined {\r\n return override ?? STATE_DEFAULT_MESSAGE_KEYS[kind];\r\n}\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport {\r\n StateMessageKind,\r\n resolveStateIcon,\r\n resolveStateMessageKey,\r\n} from './state-message.logic';\r\n\r\n/**\r\n * Empty / loading / error / success / warning page state.\r\n * Source visual: the legacy `.circles-state-message` block (+ `--error`\r\n * modifier). Extra CTAs project into the default slot.\r\n */\r\n@Component({\r\n selector: 'fly-state-message',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[attr.data-kind]': 'kind()',\r\n '[attr.role]': 'kind() === \"error\" ? \"alert\" : null',\r\n '[attr.aria-busy]': 'kind() === \"loading\" ? \"true\" : null',\r\n },\r\n template: `\r\n <span class=\"msg__icon pi {{ icon() }}\" aria-hidden=\"true\"></span>\r\n @if (resolvedMessageKey(); as key) {\r\n <p class=\"msg__text\">{{ key | translate }}</p>\r\n }\r\n @if (kind() === 'error' && showRetry()) {\r\n <button type=\"button\" class=\"msg__retry\" (click)=\"retried.emit()\">\r\n {{ retryLabelKey() | translate }}\r\n </button>\r\n }\r\n <ng-content />\r\n `,\r\n styleUrl: './state-message.component.scss',\r\n})\r\nexport class FlyStateMessageComponent {\r\n readonly kind = input<StateMessageKind>('empty');\r\n /** Falls back per kind to `ui.state.empty` / `ui.state.loading` / `ui.state.error`. */\r\n readonly messageKey = input<string>();\r\n /** `pi-*` class override, e.g. `pi-bolt`. */\r\n readonly iconClass = input<string>();\r\n readonly retryLabelKey = input('ui.action.retry');\r\n /** Renders the retry button (kind=error only). */\r\n readonly showRetry = input(false);\r\n readonly retried = output<void>();\r\n\r\n protected readonly icon = computed(() => resolveStateIcon(this.kind(), this.iconClass()));\r\n protected readonly resolvedMessageKey = computed(() =>\r\n resolveStateMessageKey(this.kind(), this.messageKey()),\r\n );\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\n\r\n/** Inline busy indicator — spinner glyph plus optional label. */\r\n@Component({\r\n selector: 'fly-spinner',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <i class=\"pi pi-spin pi-spinner\" aria-hidden=\"true\"></i>\r\n @if (labelKey(); as key) {\r\n <span>{{ key | translate }}</span>\r\n }\r\n `,\r\n styles: [\r\n `\r\n :host {\r\n display: inline-flex;\r\n align-items: center;\r\n gap: var(--sp-2);\r\n color: var(--ink-3);\r\n font-size: var(--text-base);\r\n }\r\n `,\r\n ],\r\n})\r\nexport class FlySpinnerComponent {\r\n readonly labelKey = input<string>();\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { FlyIconButtonComponent, type IconButtonVariant } from '../button/button.component';\r\n\r\n/**\r\n * A hover/focus-reveal dropdown of icon buttons behind a single trigger.\r\n *\r\n * The component renders its own circular trigger showing a horizontal ellipsis\r\n * (visionOS / SF Symbols use `ellipsis` for a \"More\" control, not a hamburger)\r\n * that morphs into an ✕ while the group is hovered or focused; the projected buttons\r\n * are revealed below, each floating with its own shadow (no container box). Use\r\n * it to collapse a set of related toolbar icon-buttons (e.g. New + Export +\r\n * Import) behind one trigger.\r\n *\r\n * - `triggerVariant` — the trigger's icon-button variant (default `neutral`;\r\n * use `primary` for the accent fill)\r\n * - `triggerTooltipKey` — i18n key for the trigger tooltip / aria-label\r\n * - default slot — the button(s) revealed in the dropdown\r\n *\r\n * Tokens only; RTL-safe. A transparent top padding on the popover bridges the\r\n * gap to the trigger so the hover doesn't flicker.\r\n */\r\n@Component({\r\n selector: 'fly-action-stack',\r\n standalone: true,\r\n imports: [FlyIconButtonComponent],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './action-stack.component.html',\r\n styleUrl: './action-stack.component.scss',\r\n})\r\nexport class FlyActionStackComponent {\r\n /** Trigger icon-button variant (`neutral` default; `primary` for accent fill). */\r\n readonly triggerVariant = input<IconButtonVariant>('neutral');\r\n /** i18n key for the trigger's tooltip / aria-label. */\r\n readonly triggerTooltipKey = input<string>('');\r\n}\r\n"," <div class=\"as\">\r\n <button\r\n type=\"button\"\r\n fly-icon-button\r\n [variant]=\"triggerVariant()\"\r\n [tooltipKey]=\"triggerTooltipKey()\"\r\n [attr.aria-haspopup]=\"true\"\r\n >\r\n <span class=\"as__dots\" aria-hidden=\"true\"><span></span><span></span><span></span></span>\r\n </button>\r\n <div class=\"as__pop\">\r\n <div class=\"as__panel\">\r\n <ng-content />\r\n </div>\r\n </div>\r\n </div>\r\n \r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { NgClass } from '@angular/common';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\n@Component({\r\n selector: 'fly-status-badge',\r\n standalone: true,\r\n imports: [NgClass, TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './status-badge.component.html',\r\n styleUrl: './status-badge.component.scss',\r\n \r\n})\r\nexport class StatusBadgeComponent {\r\n status = input.required<string>();\r\n /** Render as a colour-coded \"status light\" dot with the label on hover/SR\r\n * instead of the full text pill. Compact mode for dense card/table listings. */\r\n dot = input(false);\r\n /** @deprecated Domain is no longer used — all status labels are shared under `common.status.*`. */\r\n domain = input<string>('signals');\r\n\r\n statusClass() { return this.status().toLowerCase(); }\r\n\r\n labelKey() {\r\n return `common.status.${this.status().toLowerCase()}`;\r\n }\r\n}\r\n","@if (dot()) {\r\n <!-- \"Status light\": a colour-coded dot with a soft concentric halo in the\r\n status colour. The label is shown on hover (global [data-tooltip]) and\r\n read by screen readers (aria-label) — compact, glanceable, and modern. -->\r\n <span\r\n class=\"status-dot\"\r\n [ngClass]=\"'status-dot--' + statusClass()\"\r\n [attr.data-tooltip]=\"labelKey() | translate\"\r\n [attr.aria-label]=\"labelKey() | translate\"\r\n role=\"img\"\r\n tabindex=\"0\"\r\n ></span>\r\n} @else {\r\n <span class=\"status-badge\" [ngClass]=\"'status-badge--' + statusClass()\">\r\n {{ labelKey() | translate }}\r\n </span>\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { NgClass } from '@angular/common';\r\n\r\n// Class name and selector kept as `DashboardKpiComponent` / `fly-dashboard-kpi`\r\n// during adoption; renames land with the P6 sweep.\r\n@Component({\r\n selector: 'fly-dashboard-kpi',\r\n standalone: true,\r\n imports: [NgClass],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <div class=\"kpi-card\" [ngClass]=\"'kpi-card--' + color()\">\r\n <div class=\"kpi-card__icon\">\r\n <i class=\"pi {{ icon() }}\"></i>\r\n </div>\r\n <div class=\"kpi-card__body\">\r\n <span class=\"kpi-card__value\">{{ value() }}</span>\r\n <span class=\"kpi-card__label\">{{ label() }}</span>\r\n @if (delta() !== undefined) {\r\n <span class=\"kpi-card__delta\" [ngClass]=\"{ positive: delta()! >= 0, negative: delta()! < 0 }\">\r\n {{ delta()! >= 0 ? '+' : '' }}{{ delta() }}%\r\n </span>\r\n }\r\n </div>\r\n </div>\r\n `,\r\n styles: [`\r\n /* UAE DS 3.0 — aegov-card base; icon 40×40px per DS feature icon size.\r\n Host DS vars win when present; library tokens are the fallbacks. */\r\n .kpi-card {\r\n display: flex; align-items: center; gap: 16px;\r\n background: var(--glass-bg, var(--material-glass, var(--bg-2)));\r\n border: 1px solid var(--surface-border, var(--separator-primary, var(--line)));\r\n border-radius: 12px; padding: 16px 20px;\r\n min-width: 160px;\r\n }\r\n .kpi-card__icon {\r\n width: 40px; height: 40px; border-radius: 10px;\r\n display: flex; align-items: center; justify-content: center;\r\n font-size: 20px;\r\n }\r\n /* UAE DS 3.0 semantic color tokens */\r\n .kpi-card--blue .kpi-card__icon { background: var(--color-techblue-100, var(--st-approved-bg)); color: var(--color-techblue-800, var(--st-approved)); }\r\n .kpi-card--green .kpi-card__icon { background: var(--color-aegreen-100, var(--success-bg)); color: var(--color-aegreen-800, var(--success)); }\r\n .kpi-card--orange .kpi-card__icon { background: var(--color-aegold-100, var(--warning-bg)); color: var(--color-aegold-700, var(--warning)); }\r\n .kpi-card--purple .kpi-card__icon { background: var(--color-techblue-100, var(--st-approved-bg)); color: var(--color-techblue-800, var(--st-approved)); }\r\n .kpi-card__body { display: flex; flex-direction: column; gap: 2px; }\r\n .kpi-card__value { font-size: 24px; font-weight: var(--fw-bold); line-height: 1; color: var(--text-color, var(--label-primary, var(--ink))); }\r\n /* Minimum 14px per UAE DS 3.0 (text-sm) */\r\n .kpi-card__label { font-size: 14px; color: var(--text-color-secondary, var(--label-secondary, var(--ink-3))); }\r\n .kpi-card__delta { font-size: 12px; font-weight: var(--fw-medium); &.positive { color: var(--color-aegreen-700, var(--success)); } &.negative { color: var(--color-aered-600, var(--danger)); } }\r\n `],\r\n})\r\nexport class DashboardKpiComponent {\r\n label = input.required<string>();\r\n value = input.required<string | number>();\r\n icon = input<string>('pi-chart-bar');\r\n color = input<'blue' | 'green' | 'orange' | 'purple'>('blue');\r\n delta = input<number | undefined>(undefined);\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\n/** One label/value row of a {@link FlyMetaListComponent}. */\r\nexport interface FlyMetaItem {\r\n /** i18n key for the uppercase eyebrow label. */\r\n labelKey: string;\r\n /** Already-formatted value text, rendered verbatim. */\r\n value: string;\r\n /** Render the value in the mono/tabular face (ids, dates, scores). */\r\n mono?: boolean;\r\n}\r\n\r\n/**\r\n * Definition list of label/value metadata rows — the generalization of the\r\n * signal-detail sidecard \"metalist\" (`.metalist__row/__k/__v` anatomy:\r\n * uppercase eyebrow label column beside a wrapping value).\r\n *\r\n * Simple rows come from `items`; richer rows (links, chips, user labels)\r\n * project through the default slot as `<div><dt>…</dt><dd>…</dd></div>` and\r\n * pick up the same skin. Pair a projected `dd` (or a span inside it) with the\r\n * global `.mono` utility for the small monospace value treatment.\r\n */\r\n@Component({\r\n selector: 'fly-meta',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './meta-list.component.html',\r\n styleUrl: './meta-list.component.scss',\r\n \r\n})\r\nexport class FlyMetaListComponent {\r\n readonly items = input.required<FlyMetaItem[]>();\r\n}\r\n","<dl>\r\n @for (item of items(); track $index) {\r\n <div>\r\n <dt>{{ item.labelKey | translate }}</dt>\r\n <dd [class.mono]=\"item.mono ?? false\">{{ item.value }}</dd>\r\n </div>\r\n }\r\n <ng-content />\r\n</dl>\r\n","export function canGoPrev(page: number): boolean {\r\n return page > 1;\r\n}\r\n\r\nexport function canGoNext(page: number, totalPages: number): boolean {\r\n return page < totalPages;\r\n}\r\n\r\n/** Clamp a requested page into `[1, max(1, totalPages)]`. */\r\nexport function clampPage(page: number, totalPages: number): number {\r\n return Math.min(Math.max(1, page), Math.max(1, totalPages));\r\n}\r\n","import { ChangeDetectionStrategy, Component, computed, input, output } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { canGoNext, canGoPrev, clampPage } from './pagination.logic';\r\n\r\n/**\r\n * Previous / «page / total» / next pager (markup and styles extracted from the\r\n * reference listing pagination), with optional first/last edge buttons behind\r\n * `showEdges`. Emits the *target* page; the consuming page owns the page state\r\n * and reload.\r\n *\r\n * <fly-pagination [page]=\"page()\" [totalPages]=\"totalPages()\"\r\n * [rangeText]=\"rangeText()\" (pageChange)=\"goToPage($event)\" />\r\n */\r\n@Component({\r\n selector: 'fly-pagination',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <nav class=\"pg\" [attr.aria-label]=\"'ui.pagination.label' | translate\">\r\n @if (rangeText(); as range) {\r\n <span class=\"pg__range\">{{ range }}</span>\r\n }\r\n <div class=\"pg__controls\">\r\n @if (showEdges()) {\r\n <button\r\n type=\"button\"\r\n class=\"pg__btn\"\r\n [disabled]=\"!prevEnabled()\"\r\n (click)=\"goTo(1)\"\r\n [attr.aria-label]=\"'ui.pagination.first' | translate\"\r\n ><span class=\"pg__chev\" aria-hidden=\"true\">«</span></button>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"pg__btn\"\r\n [disabled]=\"!prevEnabled()\"\r\n (click)=\"goTo(page() - 1)\"\r\n [attr.aria-label]=\"'ui.pagination.previous' | translate\"\r\n >{{ 'ui.pagination.previous' | translate }}</button>\r\n <span class=\"pg__current\" aria-live=\"polite\">\r\n {{ 'ui.pagination.pageOf' | translate: { page: page(), total: totalPages() } }}\r\n </span>\r\n <button\r\n type=\"button\"\r\n class=\"pg__btn\"\r\n [disabled]=\"!nextEnabled()\"\r\n (click)=\"goTo(page() + 1)\"\r\n [attr.aria-label]=\"'ui.pagination.next' | translate\"\r\n >{{ 'ui.pagination.next' | translate }}</button>\r\n @if (showEdges()) {\r\n <button\r\n type=\"button\"\r\n class=\"pg__btn\"\r\n [disabled]=\"!nextEnabled()\"\r\n (click)=\"goTo(totalPages())\"\r\n [attr.aria-label]=\"'ui.pagination.last' | translate\"\r\n ><span class=\"pg__chev\" aria-hidden=\"true\">»</span></button>\r\n }\r\n </div>\r\n </nav>\r\n `,\r\n styleUrl: './pagination.component.scss',\r\n})\r\nexport class FlyPaginationComponent {\r\n readonly page = input.required<number>();\r\n readonly totalPages = input.required<number>();\r\n /** Optional caller-computed range line, e.g. \"1–20 of 134\". */\r\n readonly rangeText = input<string>();\r\n /** Renders the «first / last» edge buttons; the reference pager ships prev/current/next only. */\r\n readonly showEdges = input(false);\r\n /** Emits the target page (already clamped to bounds). */\r\n readonly pageChange = output<number>();\r\n\r\n protected readonly prevEnabled = computed(() => canGoPrev(this.page()));\r\n protected readonly nextEnabled = computed(() => canGoNext(this.page(), this.totalPages()));\r\n\r\n protected goTo(target: number): void {\r\n const next = clampPage(target, this.totalPages());\r\n if (next !== this.page()) this.pageChange.emit(next);\r\n }\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n computed,\r\n inject,\r\n input,\r\n model,\r\n output,\r\n} from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\nexport type CardLayout = 'row' | 'column';\r\n\r\n/**\r\n * Listing card shell — one anatomy for the three reference card patterns:\r\n *\r\n * - compact `layout=\"row\"` (signal-card source) — 1-line title,\r\n * trailing status/footer/actions, optional hover-reveal\r\n * selection checkbox\r\n * - detailed `layout=\"column\"` (trend/cluster-card source) — header\r\n * row (status + actions), 2-line title, meta `<dl>`,\r\n * hairline foot bar\r\n * - visual-analytics `layout=\"column\"` + `fly-card-body` carrying a\r\n * `fly-sparkline` / `fly-progress` / metric block\r\n *\r\n * The card is a pure shell: content arrives through the slot elements in\r\n * `card-slots.ts`; business data/handlers stay in the page. A single fixed\r\n * template serves both layouts — CSS grid re-seats the slots per layout, so\r\n * no slot is ever duplicated across conditional `ng-content` targets.\r\n *\r\n * Interaction: when `interactive` (default) the host is a focusable\r\n * `role=\"listitem\"` activating on click/Enter/Space (source a11y contract) —\r\n * collections of interactive cards must sit in a `role=\"list\"` container.\r\n * `fly-card-actions` swallows those events for inline buttons. With\r\n * `selectable`, a hover/focus-revealed checkbox (signal-card anatomy) drives\r\n * the two-way `selected` model without activating the card — row layout only;\r\n * the column anatomy has no check affordance, so `selectable` is ignored\r\n * there.\r\n *\r\n * Hover: the default interactive hover darkens the hairline and keeps the\r\n * resting shadow (cluster/trend source); `lift` opts into the\r\n * translateY/`--shadow-filter` raise for pages that want it.\r\n */\r\n@Component({\r\n selector: 'fly-card',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[attr.data-layout]': 'layout()',\r\n '[attr.role]': 'interactive() ? \"listitem\" : null',\r\n '[attr.tabindex]': 'interactive() && !disabled() ? 0 : null',\r\n '[attr.aria-disabled]': 'disabled() ? \"true\" : null',\r\n '[class.is-selectable]': 'showCheck()',\r\n '[class.is-selected]': 'selected()',\r\n '[class.is-interactive]': 'interactive() && !disabled()',\r\n '[class.is-lift]': 'lift()',\r\n '(click)': 'activate()',\r\n '(keydown.enter)': 'onKey($event)',\r\n '(keydown.space)': 'onKey($event)',\r\n },\r\n template: `\r\n @if (showCheck()) {\r\n <label class=\"card__check\" role=\"presentation\" (click)=\"$event.stopPropagation()\">\r\n <input\r\n type=\"checkbox\"\r\n [checked]=\"selected()\"\r\n [disabled]=\"disabled()\"\r\n (change)=\"selected.set(!selected())\"\r\n [attr.aria-label]=\"selectLabel() || (selectLabelKey() | translate)\"\r\n />\r\n <span class=\"card__check-box\" aria-hidden=\"true\"></span>\r\n </label>\r\n }\r\n <ng-content select=\"fly-card-media\" />\r\n <div class=\"card__main\">\r\n <ng-content select=\"fly-card-title\" />\r\n <ng-content />\r\n <ng-content select=\"fly-card-body\" />\r\n <ng-content select=\"fly-card-meta\" />\r\n </div>\r\n <ng-content select=\"fly-card-status\" />\r\n <ng-content select=\"fly-card-footer\" />\r\n <ng-content select=\"fly-card-actions\" />\r\n `,\r\n styleUrl: './card.component.scss',\r\n})\r\nexport class FlyCardComponent {\r\n readonly layout = input<CardLayout>('column');\r\n /** Renders the hover/focus-revealed selection checkbox — row layout only. */\r\n readonly selectable = input(false);\r\n readonly selected = model(false);\r\n /** Focusable listitem; click/Enter/Space emit `activated`. */\r\n readonly interactive = input(true);\r\n readonly disabled = input(false);\r\n /** Opt-in hover raise: translateY(-2px) + `--shadow-filter`. */\r\n readonly lift = input(false);\r\n /** aria-label key for the selection checkbox (translated by the kit). */\r\n readonly selectLabelKey = input('ui.card.select');\r\n /**\r\n * Already-translated accessible name for the selection checkbox; takes\r\n * precedence over `selectLabelKey`. Use when the label needs row context\r\n * the caller interpolates (e.g. \"Select <title>\").\r\n */\r\n readonly selectLabel = input<string>();\r\n\r\n readonly activated = output<void>();\r\n\r\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n /** Selection is a row-only affordance — the column anatomy has no check. */\r\n protected readonly showCheck = computed(() => this.selectable() && this.layout() === 'row');\r\n\r\n protected activate(): void {\r\n if (this.interactive() && !this.disabled()) this.activated.emit();\r\n }\r\n\r\n /**\r\n * Keyboard activation fires only when the card itself is focused — Enter/\r\n * Space bubbling out of projected controls (selection checkbox, inputs)\r\n * must neither activate the card nor lose their default behavior.\r\n */\r\n protected onKey(event: Event): void {\r\n if (event.target !== this.el.nativeElement) return;\r\n event.preventDefault();\r\n this.activate();\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\r\n\r\n/**\r\n * Content-projection slot elements for {@link FlyCardComponent}. Each is a\r\n * styleless pass-through component — the card stylesheet owns the slot\r\n * typography/layout (via `::ng-deep`, scoped under the card host), so a slot\r\n * stays a single clean DOM element with zero per-slot style payload.\r\n *\r\n * Anatomy mapping (see card.component.ts for the layout grid):\r\n * - `fly-card-status` column: header start cell (badge) · row: trailing cell\r\n * - `fly-card-actions` column: header end cell · row: trailing cell;\r\n * swallows click/Enter/Space so card activation\r\n * does not fire from inline action buttons\r\n * - `fly-card-media` leading media/illustration block\r\n * - `fly-card-title` column: 2-line clamp · row: 1-line ellipsis\r\n * - `fly-card-body` free content (sparkline/progress/metrics);\r\n * column: pushed toward the foot of the main area\r\n * - `fly-card-meta` summary line, chips, or a `<dl>` of label/value\r\n * cells (`<div><dt>…</dt><dd>…</dd></div>`)\r\n * - `fly-card-footer` column: hairline-topped foot bar · row: trailing\r\n * mono cell (the reference date column)\r\n */\r\n@Component({\r\n selector: 'fly-card-media',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '<ng-content />',\r\n})\r\nexport class FlyCardMediaComponent {}\r\n\r\n@Component({\r\n selector: 'fly-card-title',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '<ng-content />',\r\n})\r\nexport class FlyCardTitleComponent {}\r\n\r\n@Component({\r\n selector: 'fly-card-meta',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '<ng-content />',\r\n})\r\nexport class FlyCardMetaComponent {}\r\n\r\n@Component({\r\n selector: 'fly-card-status',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '<ng-content />',\r\n})\r\nexport class FlyCardStatusComponent {}\r\n\r\n@Component({\r\n selector: 'fly-card-body',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '<ng-content />',\r\n})\r\nexport class FlyCardBodyComponent {}\r\n\r\n@Component({\r\n selector: 'fly-card-footer',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '<ng-content />',\r\n})\r\nexport class FlyCardFooterComponent {}\r\n\r\n@Component({\r\n selector: 'fly-card-actions',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '(click)': '$event.stopPropagation()',\r\n '(keydown.enter)': '$event.stopPropagation()',\r\n '(keydown.space)': '$event.stopPropagation()',\r\n },\r\n template: '<ng-content />',\r\n})\r\nexport class FlyCardActionsComponent {}\r\n","import { ChangeDetectionStrategy, Component, input, output, signal } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { FlyButtonComponent } from '../../components/button/button.component';\r\n\r\n/**\r\n * Collapsible advanced-filter panel — structural port of the reference\r\n * `.signals-page-fp` block (head row + optional status section + field area +\r\n * drop-in animation). Purely presentational: the page keeps its filter\r\n * state/`ngModel` logic and projects its own controls.\r\n *\r\n * Slots:\r\n * - `[filter-status]` — optional section between head and fields (status\r\n * pills / toggles row); renders nothing when not provided\r\n * - default — the core field area; project `fly-field`s\r\n * - `[filter-more]` — advanced `fly-field`s revealed by \"Add more options\";\r\n * only rendered/toggled when `hasMore` is true\r\n *\r\n * Layout (`layout`):\r\n * - `'grid'` (default) — the legacy 6 → 4 → 2 column grid (unchanged for\r\n * existing callers)\r\n * - `'rows'` — Outlook-style labeled rows (label column + control), RTL-safe\r\n *\r\n * Apply model:\r\n * - Live pages leave `showSearchButton` false and keep their per-field\r\n * `(change)` handlers.\r\n * - Deferred pages set `showSearchButton` true, drop the per-field handlers,\r\n * and commit staged criteria on `(search)`.\r\n *\r\n * Matching the source, the panel renders nothing while `open` is false.\r\n */\r\n@Component({\r\n selector: 'fly-filter-panel',\r\n standalone: true,\r\n imports: [TranslatePipe, FlyButtonComponent],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '[class.fp--anchored]': 'anchored()' },\r\n templateUrl: './filter-panel.component.html',\r\n styleUrl: './filter-panel.component.scss',\r\n})\r\nexport class FlyFilterPanelComponent {\r\n readonly open = input.required<boolean>();\r\n readonly titleKey = input('ui.filters.title');\r\n /** `'grid'` = legacy column grid; `'rows'` = Outlook-style labeled rows. */\r\n readonly layout = input<'grid' | 'rows'>('grid');\r\n /** Renders the `[filter-more]` slot + the \"Add more options\" toggle. */\r\n readonly hasMore = input(false);\r\n /** Renders a footer with a primary Search button that emits `(search)`. */\r\n readonly showSearchButton = input(false);\r\n /**\r\n * Renders the panel as a dropdown anchored to a positioned ancestor (the\r\n * page wraps the search box + panel in a `position: relative` container),\r\n * instead of a full-width in-flow block. Pairs with `fly-search-input`\r\n * `[expandable]`.\r\n */\r\n readonly anchored = input(false);\r\n\r\n /** Clear-filters pressed — the page resets its own filter state. */\r\n readonly cleared = output<void>();\r\n /** Close (×) pressed — the page flips its open flag. */\r\n readonly closed = output<void>();\r\n /** Search pressed — deferred pages commit staged criteria and query. */\r\n readonly searched = output<void>();\r\n\r\n /** Whether the `[filter-more]` advanced fields are revealed. */\r\n protected readonly showMore = signal(false);\r\n}\r\n"," @if (open()) {\r\n <div class=\"fp\" [attr.data-layout]=\"layout()\">\r\n <div class=\"fp__head\">\r\n <div class=\"fp__title\">{{ titleKey() | translate }}</div>\r\n <div class=\"fp__actions\">\r\n <button type=\"button\" class=\"fp__clear\" (click)=\"cleared.emit()\">\r\n {{ 'ui.action.clearFilters' | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n class=\"fp__close\"\r\n (click)=\"closed.emit()\"\r\n [attr.aria-label]=\"'ui.action.close' | translate\"\r\n >×</button>\r\n </div>\r\n </div>\r\n\r\n <div class=\"fp__body\">\r\n <ng-content select=\"[filter-status]\" />\r\n\r\n <div class=\"fp__grid\">\r\n <ng-content />\r\n </div>\r\n\r\n @if (hasMore()) {\r\n <div class=\"fp__more\" [hidden]=\"!showMore()\">\r\n <div class=\"fp__grid\">\r\n <ng-content select=\"[filter-more]\" />\r\n </div>\r\n </div>\r\n <div class=\"fp__morebar\">\r\n <button\r\n type=\"button\"\r\n class=\"fp__morebtn\"\r\n (click)=\"showMore.set(!showMore())\"\r\n [attr.aria-expanded]=\"showMore()\"\r\n >\r\n <svg class=\"fp__moreico\" viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\r\n <path [attr.d]=\"showMore() ? 'M3.5 8h9' : 'M8 3.5v9M3.5 8h9'\" />\r\n </svg>\r\n {{ (showMore() ? 'ui.action.fewerOptions' : 'ui.action.addMoreOptions') | translate }}\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n\r\n @if (showSearchButton()) {\r\n <div class=\"fp__footer\">\r\n <button type=\"button\" fly-button variant=\"primary\" (click)=\"searched.emit()\">\r\n {{ 'ui.action.search' | translate }}\r\n </button>\r\n </div>\r\n }\r\n </div>\r\n }\r\n \r\n","import { Directive, TemplateRef, inject, input } from '@angular/core';\r\n\r\nexport interface FlyCellContext {\r\n /**\r\n * The row object — `let-row` in the template.\r\n *\r\n * Deliberately `any`, not `unknown`: this is the implicit context of a\r\n * consumer-authored `ng-template`, and every consumer binds row members\r\n * directly (`row.status`, `row.name`). Under `unknown` those bindings fail\r\n * `strictTemplates` in every consuming app, and there is no row type to be\r\n * generic over — the table renders heterogeneous rows keyed only by column id.\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n $implicit: any;\r\n}\r\n\r\n/**\r\n * Per-column cell override for {@link FlyDataTableComponent}. Declared on an\r\n * `ng-template` inside the table, keyed by column id:\r\n *\r\n * <fly-data-table [columns]=\"columns\" [rows]=\"items()\">\r\n * <ng-template flyCell=\"status\" let-row>\r\n * <fly-status-badge [status]=\"row.status\" />\r\n * </ng-template>\r\n * </fly-data-table>\r\n */\r\n@Directive({\r\n selector: 'ng-template[flyCell]',\r\n standalone: true,\r\n})\r\nexport class FlyCellDirective {\r\n /** Column id this template renders. */\r\n readonly flyCell = input.required<string>();\r\n\r\n readonly template = inject(TemplateRef<FlyCellContext>);\r\n\r\n static ngTemplateContextGuard(_dir: FlyCellDirective, ctx: unknown): ctx is FlyCellContext {\r\n return true;\r\n }\r\n}\r\n","import { FlyColumn, FlySort } from './data-table.types';\r\n\r\n/**\r\n * Tri-state sort cycle for a header click: unsorted column → `asc`,\r\n * `asc` → `desc`, `desc` → `null` (sorting cleared).\r\n */\r\nexport function nextSort(current: FlySort | null, columnId: string): FlySort | null {\r\n if (!current || current.id !== columnId) return { id: columnId, dir: 'asc' };\r\n return current.dir === 'asc' ? { id: columnId, dir: 'desc' } : null;\r\n}\r\n\r\n/** `aria-sort` value for a column header under the current sort state. */\r\nexport function ariaSort(\r\n current: FlySort | null,\r\n column: FlyColumn,\r\n): 'ascending' | 'descending' | 'none' | null {\r\n if (!column.sortable) return null;\r\n if (current?.id !== column.id) return 'none';\r\n return current.dir === 'asc' ? 'ascending' : 'descending';\r\n}\r\n\r\n/**\r\n * Resolves a column's raw cell value off a row via the column's dot-path\r\n * `field` (falling back to `id`). Missing segments resolve to `null` rather\r\n * than throwing — the table renders a dash.\r\n */\r\nexport function resolveCellValue(row: unknown, column: FlyColumn): unknown {\r\n const path = column.field ?? column.id;\r\n let value: unknown = row;\r\n for (const segment of path.split('.')) {\r\n if (value === null || value === undefined) return null;\r\n if (typeof value !== 'object') return null;\r\n value = (value as Record<string, unknown>)[segment];\r\n }\r\n return value ?? null;\r\n}\r\n","import { DatePipe, NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n ChangeDetectionStrategy,\r\n Component,\r\n TemplateRef,\r\n computed,\r\n contentChildren,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { FlyCellContext, FlyCellDirective } from '../cell.directive';\r\nimport { ariaSort, nextSort, resolveCellValue } from './data-table.logic';\r\nimport { FlyColumn, FlySort } from './data-table.types';\r\nimport { FlyStateMessageComponent } from '../../components/state-message/state-message.component';\r\nimport { FlySkeletonComponent } from '../../../components/skeleton/skeleton.component';\r\n\r\n/**\r\n * Config-driven data table (visual base: the legacy global\r\n * `.circles-data-table`, tokenized to the library surface — `--bg-2` body,\r\n * `--bg-3` header, `--line`/`--line-3` dividers, `--row-h` rows).\r\n *\r\n * - Default cell rendering by `field` dot-path + `kind`\r\n * (`text`/`date`/`number`/`mono`); per-column override via\r\n * `<ng-template flyCell=\"colId\" let-row>`. `date` renders the stored UTC\r\n * instant's calendar date (`yyyy-MM-dd`, timezone `'UTC'`) — parity with the\r\n * legacy `slice(0,10)`, immune to the viewer's local offset.\r\n * - Header click on `sortable` columns cycles asc → desc → null and emits\r\n * `sortChange`; sorting itself stays in the page (server- or client-side).\r\n * - Rows are focusable and activate on click/Enter (`rowActivated`).\r\n * - `loading` renders shimmer skeleton rows; empty + `emptyKey` renders a\r\n * `fly-state-message` inside the table shell.\r\n * - Under 720px the table stacks into label/value rows (CSS-only, driven by\r\n * `data-label` attributes).\r\n */\r\n@Component({\r\n selector: 'fly-data-table',\r\n standalone: true,\r\n imports: [DatePipe, NgTemplateOutlet, TranslatePipe, FlyStateMessageComponent, FlySkeletonComponent],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './data-table.component.html',\r\n styleUrl: './data-table.component.scss',\r\n})\r\nexport class FlyDataTableComponent {\r\n readonly columns = input.required<FlyColumn[]>();\r\n readonly rows = input.required<readonly unknown[]>();\r\n readonly loading = input(false);\r\n /** i18n key for the table's accessible name (`<table aria-label>`). */\r\n readonly ariaLabelKey = input<string>();\r\n /** Controlled sort state — the page owns it and applies the actual ordering. */\r\n readonly sort = input<FlySort | null>(null);\r\n readonly sortChange = output<FlySort | null>();\r\n /** Row click / Enter — emits the row object. */\r\n readonly rowActivated = output<unknown>();\r\n /** `fly-state-message` key when `rows` is empty (omit to render nothing). */\r\n readonly emptyKey = input<string>();\r\n readonly emptyIconClass = input<string>();\r\n\r\n protected readonly skeletonRows = [0, 1, 2, 3, 4];\r\n\r\n private readonly cellTemplates = contentChildren(FlyCellDirective);\r\n\r\n private readonly templateMap = computed(() => {\r\n const map = new Map<string, TemplateRef<FlyCellContext>>();\r\n for (const cell of this.cellTemplates()) map.set(cell.flyCell(), cell.template);\r\n return map;\r\n });\r\n\r\n protected templateFor(columnId: string): TemplateRef<FlyCellContext> | undefined {\r\n return this.templateMap().get(columnId);\r\n }\r\n\r\n /**\r\n * Row activation ignores click/Enter originating from interactive elements\r\n * projected into cells (links, buttons, form controls, menus) — mirrors the\r\n * fly-card contract where `fly-card-actions` swallows activation.\r\n */\r\n protected onRowActivate(event: Event, row: unknown): void {\r\n const target = event.target;\r\n if (target instanceof Element && target.closest('a,button,input,select,label,[role=\"menu\"]')) {\r\n return;\r\n }\r\n this.rowActivated.emit(row);\r\n }\r\n\r\n protected cellValue(row: unknown, col: FlyColumn): unknown {\r\n return resolveCellValue(row, col);\r\n }\r\n\r\n /** Default text rendering — em-dash for absent values, verbatim otherwise. */\r\n protected displayValue(row: unknown, col: FlyColumn): string {\r\n const value = resolveCellValue(row, col);\r\n return value === null || value === '' ? '—' : String(value);\r\n }\r\n\r\n protected headerAriaSort(col: FlyColumn): string | null {\r\n return ariaSort(this.sort(), col);\r\n }\r\n\r\n protected sortDirFor(col: FlyColumn): string | null {\r\n const sort = this.sort();\r\n return sort?.id === col.id ? sort.dir : null;\r\n }\r\n\r\n protected onHeaderClick(col: FlyColumn): void {\r\n this.sortChange.emit(nextSort(this.sort(), col.id));\r\n }\r\n}\r\n","<table class=\"dt\" [attr.aria-label]=\"ariaLabelKey() ? (ariaLabelKey()! | translate) : null\">\r\n <thead>\r\n <tr>\r\n @for (col of columns(); track col.id) {\r\n <th\r\n scope=\"col\"\r\n [class.dt__th--end]=\"col.align === 'end'\"\r\n [attr.aria-sort]=\"headerAriaSort(col)\"\r\n >\r\n @if (col.sortable) {\r\n <button type=\"button\" class=\"dt__sort\" (click)=\"onHeaderClick(col)\">\r\n <span>{{ col.headerKey | translate }}</span>\r\n <span class=\"dt__sort-icon\" [attr.data-dir]=\"sortDirFor(col)\" aria-hidden=\"true\"></span>\r\n </button>\r\n } @else {\r\n {{ col.headerKey | translate }}\r\n }\r\n </th>\r\n }\r\n </tr>\r\n </thead>\r\n <tbody>\r\n @if (loading()) {\r\n @for (i of skeletonRows; track i) {\r\n <tr class=\"dt__row dt__row--skel\">\r\n <td [attr.colspan]=\"columns().length\">\r\n <!-- shape=\"lines\" is the DS skeleton's no-chrome text shimmer\r\n (the kit's former shape=\"text\"); one line per collapsed row.\r\n No backticks in here: this is an INLINE template literal. -->\r\n <fly-skeleton shape=\"lines\" [lines]=\"1\" />\r\n </td>\r\n </tr>\r\n }\r\n } @else {\r\n @for (row of rows(); track $index) {\r\n <tr\r\n class=\"dt__row\"\r\n tabindex=\"0\"\r\n (click)=\"onRowActivate($event, row)\"\r\n (keydown.enter)=\"onRowActivate($event, row)\"\r\n >\r\n @for (col of columns(); track col.id) {\r\n <td\r\n [class.dt__td--end]=\"col.align === 'end'\"\r\n [class.mono]=\"col.kind === 'mono'\"\r\n [class.dt__td--date]=\"col.kind === 'date'\"\r\n [class.dt__td--num]=\"col.kind === 'number'\"\r\n [attr.data-label]=\"col.headerKey | translate\"\r\n >\r\n @if (templateFor(col.id); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: row }\" />\r\n } @else {\r\n @switch (col.kind ?? 'text') {\r\n @case ('date') {\r\n @if (cellValue(row, col); as value) {\r\n {{ $any(value) | date: 'yyyy-MM-dd' : 'UTC' }}\r\n } @else { — }\r\n }\r\n @default {\r\n {{ displayValue(row, col) }}\r\n }\r\n }\r\n }\r\n </td>\r\n }\r\n </tr>\r\n }\r\n }\r\n </tbody>\r\n</table>\r\n@if (!loading() && rows().length === 0 && emptyKey()) {\r\n <fly-state-message kind=\"empty\" [messageKey]=\"emptyKey()\" [iconClass]=\"emptyIconClass()\" />\r\n}\r\n","import { Signal, WritableSignal, computed, signal } from '@angular/core';\r\n\r\nexport interface FilterGroup<T extends Record<string, string | number | null>> {\r\n /** One writable signal per filter field, initialized to its default. */\r\n fields: { [K in keyof T]: WritableSignal<T[K]> };\r\n /** True while any field differs from its default. */\r\n isActive: Signal<boolean>;\r\n /** Resets every field to its default. */\r\n clear(): void;\r\n /** Current values as a plain object (e.g. to build query params). */\r\n snapshot(): T;\r\n}\r\n\r\n/**\r\n * Plain-signals factory (no DI) replacing the per-page boilerplate of\r\n * 8–12 filter signals + `clearFilters()` + `hasActiveFilters()`:\r\n *\r\n * const filters = filterGroup({ status: '', maturity: '', minScore: null });\r\n * filters.fields.status.set('Draft');\r\n * filters.isActive(); // true\r\n * filters.snapshot(); // { status: 'Draft', maturity: '', minScore: null }\r\n * filters.clear();\r\n */\r\nexport function filterGroup<T extends Record<string, string | number | null>>(\r\n defaults: T,\r\n): FilterGroup<T> {\r\n const keys = Object.keys(defaults) as (keyof T)[];\r\n\r\n const fields = {} as { [K in keyof T]: WritableSignal<T[K]> };\r\n for (const key of keys) fields[key] = signal(defaults[key]);\r\n\r\n const isActive = computed(() => keys.some(key => fields[key]() !== defaults[key]));\r\n\r\n const clear = (): void => {\r\n for (const key of keys) fields[key].set(defaults[key]);\r\n };\r\n\r\n const snapshot = (): T => {\r\n const out = {} as T;\r\n for (const key of keys) out[key] = fields[key]();\r\n return out;\r\n };\r\n\r\n return { fields, isActive, clear, snapshot };\r\n}\r\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\nexport type ProgressTone = 'accent' | 'success' | 'warning' | 'danger';\r\n\r\n/**\r\n * Horizontal percentage bar (anatomy from the gap-analysis proficiency bars:\r\n * pill track + tone-colored fill + optional trailing % figure).\r\n * `role=\"progressbar\"` with `aria-valuenow`; pass `labelKey` for an\r\n * accessible name + visible label row, `showValue` for the % text.\r\n */\r\n@Component({\r\n selector: 'fly-progress',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '[attr.data-tone]': 'tone()' },\r\n template: `\r\n @if (labelKey(); as key) {\r\n <span class=\"prg__label\">{{ key | translate }}</span>\r\n }\r\n <div\r\n class=\"prg__track\"\r\n role=\"progressbar\"\r\n [attr.aria-valuenow]=\"clamped()\"\r\n aria-valuemin=\"0\"\r\n aria-valuemax=\"100\"\r\n [attr.aria-label]=\"labelKey() ? (labelKey()! | translate) : null\"\r\n >\r\n <div class=\"prg__fill\" [style.inline-size.%]=\"clamped()\"></div>\r\n </div>\r\n @if (showValue()) {\r\n <span class=\"prg__value mono\">{{ clamped() }}%</span>\r\n }\r\n `,\r\n styleUrl: './progress.component.scss',\r\n})\r\nexport class FlyProgressComponent {\r\n /** 0–100 (clamped for both the fill and `aria-valuenow`). */\r\n readonly value = input.required<number>();\r\n readonly tone = input<ProgressTone>('accent');\r\n readonly labelKey = input<string>();\r\n /** Renders the trailing percentage figure. */\r\n readonly showValue = input(false);\r\n\r\n protected readonly clamped = computed(() =>\r\n Math.round(Math.min(100, Math.max(0, this.value()))),\r\n );\r\n}\r\n","/**\r\n * Maps a numeric series onto SVG path coordinates inside a `width × height`\r\n * viewBox (1px vertical inset so the stroke never clips at the extremes).\r\n * A flat or single-value series renders as a midline.\r\n */\r\nexport function sparklinePoints(\r\n points: readonly number[],\r\n width: number,\r\n height: number,\r\n): { x: number; y: number }[] {\r\n if (points.length === 0) return [];\r\n const inset = 1;\r\n const usable = height - inset * 2;\r\n const min = Math.min(...points);\r\n const max = Math.max(...points);\r\n const span = max - min;\r\n const stepX = points.length > 1 ? width / (points.length - 1) : 0;\r\n return points.map((value, i) => {\r\n const norm = span === 0 ? 0.5 : (value - min) / span;\r\n return {\r\n x: round(points.length > 1 ? i * stepX : width / 2),\r\n y: round(inset + (1 - norm) * usable),\r\n };\r\n });\r\n}\r\n\r\n/** SVG path (`M x y L x y …`) for the series; empty string when no points. */\r\nexport function sparklinePath(\r\n points: readonly number[],\r\n width: number,\r\n height: number,\r\n): string {\r\n const coords = sparklinePoints(points, width, height);\r\n if (coords.length === 0) return '';\r\n return coords\r\n .map((p, i) => `${i === 0 ? 'M' : 'L'}${p.x} ${p.y}`)\r\n .join(' ');\r\n}\r\n\r\nfunction round(n: number): number {\r\n return Math.round(n * 100) / 100;\r\n}\r\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\r\nimport { sparklinePath } from './sparkline.logic';\r\n\r\n/**\r\n * Inline trend sparkline (the trend-card footer chart, generalized): a single\r\n * polyline over a numeric series, stroked with `currentColor` — callers set\r\n * the colour via a class / `color` token on the host. Decorative\r\n * (`aria-hidden`); pair with visible figures for the actual data.\r\n */\r\n@Component({\r\n selector: 'fly-sparkline',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { 'aria-hidden': 'true' },\r\n template: `\r\n <svg [attr.viewBox]=\"viewBox()\" preserveAspectRatio=\"none\" focusable=\"false\">\r\n <path [attr.d]=\"path()\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" />\r\n </svg>\r\n `,\r\n styles: `\r\n :host {\r\n display: block;\r\n /* Default stroke; callers override via the CSS color property.\r\n No backticks in here, even escaped: Angular's JIT test pipeline\r\n re-wraps this CSS in a template literal without re-escaping, so a\r\n backtick breaks the parse for every spec that loads the DS. */\r\n color: var(--accent);\r\n }\r\n\r\n svg {\r\n display: block;\r\n width: 100%;\r\n height: 100%;\r\n }\r\n `,\r\n})\r\nexport class FlySparklineComponent {\r\n readonly points = input.required<readonly number[]>();\r\n /** viewBox metrics — the rendered size stretches to the host box. */\r\n readonly width = input(120);\r\n readonly height = input(32);\r\n\r\n protected readonly viewBox = computed(() => `0 0 ${this.width()} ${this.height()}`);\r\n protected readonly path = computed(() =>\r\n sparklinePath(this.points(), this.width(), this.height()),\r\n );\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n EventEmitter,\r\n Input,\r\n Output,\r\n} from '@angular/core';\r\nimport { NgClass } from '@angular/common';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\n/**\r\n * One crumb in the breadcrumb chain.\r\n * - `label` — already-translated string (caller handles i18n)\r\n * - `labelKey` — translation key, applied via `translate` pipe\r\n * - `link` — route segments for `routerLink` style navigation\r\n * - `onClick` — callback to invoke instead of following a link\r\n * The last crumb in the array is rendered as the active page (no link).\r\n */\r\nexport interface BreadcrumbItem {\r\n label?: string;\r\n labelKey?: string;\r\n href?: string; // legacy hard link (kept for backwards-compat)\r\n // routerLink target — preferred for SPA nav. `any[]`, matching Angular's own\r\n // Router.navigate()/routerLink typing, deliberately: 3.19.0 briefly narrowed\r\n // this to `unknown[]` to clear @typescript-eslint/no-explicit-any, but that is\r\n // a STRUCTURAL break for any consumer typing its own crumb-click handler as\r\n // `{ link?: string | string[] }` (Circles' entity-merges/entity-suggestions\r\n // did) — `unknown[]` is not assignable to `string[]`, so their build failed\r\n // the moment they adopted 3.19.0. Segments are only ever stringified here\r\n // (see resolveHref below), so the looseness costs nothing; the DS itself\r\n // never reads element types.\r\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\r\n link?: any[] | string;\r\n onClick?: () => void;\r\n /** Force this crumb to render as the active (non-link) tail. */\r\n ariaCurrent?: boolean;\r\n}\r\n\r\nexport type PageHeaderVariant =\r\n | 'listing' // big h1 + subtitle + right-side metric (listing pages)\r\n | 'detail' // mono eyebrow + h1 + AR title + status chip + action row (detail pages)\r\n | 'circles' // legacy: list pages with toolbar + projected actions\r\n | 'module' // legacy: module-level header\r\n | 'detail-legacy'; // legacy: previous detail variant — kept for any callers still using it\r\n\r\n@Component({\r\n selector: 'fly-page-header',\r\n standalone: true,\r\n imports: [NgClass, TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './page-header.component.html',\r\n styleUrl: './page-header.component.scss',\r\n \r\n})\r\nexport class PageHeaderComponent {\r\n /** Layout variant — drives spacing/alignment hooks. */\r\n @Input() variant: PageHeaderVariant = 'listing';\r\n\r\n /** Title (already translated). */\r\n @Input() title?: string;\r\n /** Translation key for the title. Wins over `title` when both are provided. */\r\n @Input() titleKey?: string;\r\n\r\n /** Subtitle (already translated). Listing-style descriptive sub-line under the title. */\r\n @Input() subtitle?: string | null;\r\n @Input() subtitleKey?: string | null;\r\n\r\n /** Detail-only — secondary Arabic title rendered RTL beneath the h1. */\r\n @Input() titleAr?: string | null;\r\n\r\n /** Detail-only — small uppercase eyebrow above the title (e.g. a mono record id). */\r\n @Input() eyebrow?: string | null;\r\n @Input() eyebrowKey?: string | null;\r\n\r\n /** Listing-only — right-side mono metric value + label. */\r\n @Input() metricValue?: string | number | null;\r\n @Input() metricLabel?: string | null;\r\n @Input() metricLabelKey?: string | null;\r\n\r\n /** Breadcrumb chain. The last item is rendered as the active (non-link) tail. */\r\n @Input() breadcrumbs?: BreadcrumbItem[];\r\n\r\n /** Emits when a clickable crumb is activated (carries the crumb itself). */\r\n @Output() crumbClick = new EventEmitter<BreadcrumbItem>();\r\n\r\n onCrumb(bc: BreadcrumbItem): void {\r\n this.crumbClick.emit(bc);\r\n bc.onClick?.();\r\n }\r\n\r\n hrefFor(bc: BreadcrumbItem): string {\r\n if (typeof bc.link === 'string') return bc.link;\r\n if (Array.isArray(bc.link)) return '/' + bc.link.map(seg => String(seg)).filter(Boolean).join('/');\r\n return '#';\r\n }\r\n}\r\n","<header class=\"ph\" [ngClass]=\"'ph--' + variant\">\r\n <!-- ─── Breadcrumbs ─── -->\r\n @if (breadcrumbs?.length) {\r\n <nav class=\"crumbs\" [attr.aria-label]=\"'ui.nav.breadcrumbs' | translate\">\r\n @for (bc of breadcrumbs; track $index; let i = $index, last = $last) {\r\n @if (i > 0) {\r\n <span class=\"crumb__sep\" aria-hidden=\"true\">/</span>\r\n }\r\n @if (last || bc.ariaCurrent) {\r\n <span class=\"crumb crumb--active\" aria-current=\"page\">\r\n {{ bc.labelKey ? (bc.labelKey | translate) : bc.label }}\r\n </span>\r\n } @else if (bc.onClick) {\r\n <button type=\"button\" class=\"crumb crumb--link\" (click)=\"onCrumb(bc)\">\r\n {{ bc.labelKey ? (bc.labelKey | translate) : bc.label }}\r\n </button>\r\n } @else if (bc.link) {\r\n <a class=\"crumb crumb--link\" (click)=\"onCrumb(bc); $event.preventDefault()\" [attr.href]=\"hrefFor(bc)\">\r\n {{ bc.labelKey ? (bc.labelKey | translate) : bc.label }}\r\n </a>\r\n } @else if (bc.href) {\r\n <a class=\"crumb crumb--link\" [attr.href]=\"bc.href\">\r\n {{ bc.labelKey ? (bc.labelKey | translate) : bc.label }}\r\n </a>\r\n } @else {\r\n <span class=\"crumb\">\r\n {{ bc.labelKey ? (bc.labelKey | translate) : bc.label }}\r\n </span>\r\n }\r\n }\r\n </nav>\r\n }\r\n\r\n <!-- ─── Title row ─── -->\r\n <div class=\"ph__row\">\r\n <div class=\"ph__l\">\r\n @if (eyebrow || eyebrowKey) {\r\n <div class=\"ph__eyebrow\">\r\n @if (eyebrow) { <span class=\"mono\">{{ eyebrow }}</span> }\r\n @if (eyebrowKey) { <span>{{ eyebrowKey | translate }}</span> }\r\n </div>\r\n }\r\n <h1 class=\"ph__title\" [ngClass]=\"{ 'ph__title--detail': variant === 'detail' }\">\r\n {{ titleKey ? (titleKey | translate) : title }}\r\n </h1>\r\n @if (subtitle || subtitleKey) {\r\n <p class=\"ph__sub\">{{ subtitleKey ? (subtitleKey | translate) : subtitle }}</p>\r\n }\r\n @if (titleAr) {\r\n <p class=\"ph__title-ar\">{{ titleAr }}</p>\r\n }\r\n </div>\r\n\r\n <div class=\"ph__r\">\r\n <!-- Right-side metric (listing) -->\r\n @if (metricValue || metricLabel || metricLabelKey) {\r\n <div class=\"ph__metric\">\r\n @if (metricValue) { <div class=\"ph__metric-v mono\">{{ metricValue }}</div> }\r\n <div class=\"ph__metric-l\">{{ metricLabelKey ? (metricLabelKey | translate) : metricLabel }}</div>\r\n </div>\r\n }\r\n\r\n <!-- Status chip (detail) stacked over the action button row. Listing/circles/module\r\n project no status, so this collapses to just the right-aligned action row.\r\n NOTE: a single [page-header-actions] slot — duplicating it across @if branches\r\n silently drops projected content in the non-first branch (Angular binds projection\r\n to the first declared matching <ng-content>). -->\r\n <div class=\"ph__hd-actions\">\r\n <ng-content select=\"[page-header-status]\"></ng-content>\r\n <div class=\"ph__hd-btns\">\r\n <ng-content select=\"[page-header-actions]\"></ng-content>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <!-- Default slot: anything the consumer wants directly below the title row\r\n (e.g. a detail-page stat bar). -->\r\n <ng-content></ng-content>\r\n</header>\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\n/**\r\n * Section header — the detail-page card header anatomy\r\n * (`.card__hd` / `.card__t` / `.card__a` from the signal-detail reference)\r\n * extracted as a reusable shell. Sits at the top of a `card-surface` section;\r\n * the title comes from `titleKey` or projects through `[section-title]`, and\r\n * trailing actions project through `[section-actions]`.\r\n *\r\n * Plain `<a>`/`<button>` elements projected into `[section-actions]` get the\r\n * reference accent text-action skin (`.card__a`); `fly-button` /\r\n * `fly-icon-button` actions keep their own styling.\r\n *\r\n * Until the detail pages migrate (P4/P5), pages keep their\r\n * `<section class=\"card\">` markup — see the card-section note in\r\n * docs/COMPONENTS.md.\r\n */\r\n@Component({\r\n selector: 'fly-section-header',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <header class=\"sh\">\r\n <h2 class=\"sh__t\">\r\n @if (titleKey(); as key) {\r\n {{ key | translate }}\r\n }\r\n <ng-content select=\"[section-title]\" />\r\n </h2>\r\n <div class=\"sh__a\">\r\n <ng-content select=\"[section-actions]\" />\r\n </div>\r\n </header>\r\n `,\r\n styleUrl: './section-header.component.scss',\r\n})\r\nexport class FlySectionHeaderComponent {\r\n /** i18n key for the section title; alternatively project `[section-title]`. */\r\n readonly titleKey = input<string>();\r\n}\r\n","import type { FlyAppModule, FlyAppModuleSection } from './app-topbar.types';\r\n\r\n/** Every module across every section, in visual order. */\r\nexport function flattenModules(sections: readonly FlyAppModuleSection[]): FlyAppModule[] {\r\n return sections.flatMap(s => s.modules);\r\n}\r\n\r\n/**\r\n * The module `activeKey` names, or `null`.\r\n *\r\n * Returns null for an unknown key rather than falling back to the first module:\r\n * the topbar label would otherwise claim the user is somewhere they are not,\r\n * which is worse than showing the neutral \"pick a module\" state. (Contrast\r\n * `resolveActiveTab`, where a stale id SHOULD fall back — a tab strip must\r\n * always have one selected tab, a switcher need not.)\r\n */\r\nexport function resolveActiveModule(\r\n sections: readonly FlyAppModuleSection[],\r\n activeKey: string | null | undefined,\r\n): FlyAppModule | null {\r\n if (!activeKey) return null;\r\n return flattenModules(sections).find(m => m.key === activeKey) ?? null;\r\n}\r\n\r\n/**\r\n * Next focusable row index for roving keyboard navigation, skipping disabled\r\n * rows and wrapping at both ends.\r\n *\r\n * `step` is +1/-1 in VISUAL order; the caller flips it for RTL. Returns `from`\r\n * unchanged when nothing is focusable, so a fully-disabled menu cannot spin.\r\n */\r\nexport function nextModuleIndex(\r\n modules: readonly FlyAppModule[],\r\n from: number,\r\n step: 1 | -1,\r\n): number {\r\n const n = modules.length;\r\n if (n === 0) return from;\r\n for (let i = 1; i <= n; i++) {\r\n const candidate = (((from + step * i) % n) + n) % n;\r\n if (!modules[candidate]?.disabled) return candidate;\r\n }\r\n return from;\r\n}\r\n\r\n/** First focusable row, or -1 when every row is disabled. */\r\nexport function firstModuleIndex(modules: readonly FlyAppModule[]): number {\r\n return modules.findIndex(m => !m.disabled);\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n Directive,\r\n ElementRef,\r\n TemplateRef,\r\n computed,\r\n contentChildren,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n viewChildren,\r\n} from '@angular/core';\r\nimport { NgTemplateOutlet } from '@angular/common';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { I18nService } from '../../../services/i18n.service';\r\nimport { FlyClickOutsideDirective } from '../../../directives/fly-click-outside.directive';\r\nimport { OverlayHandle, overlayStack } from '../../../overlays/overlay-stack';\r\nimport {\r\n firstModuleIndex,\r\n flattenModules,\r\n nextModuleIndex,\r\n resolveActiveModule,\r\n} from './app-topbar.logic';\r\nimport type { FlyAppModule, FlyAppModuleSection } from './app-topbar.types';\r\n\r\n/**\r\n * Per-module icon template: `<ng-template flyModuleIcon=\"signals\">…</ng-template>`.\r\n *\r\n * A directive rather than an `iconClass` string because real module icons are\r\n * bespoke inline SVGs, not font glyphs. `iconClass` stays as the cheap option.\r\n */\r\n@Directive({ selector: 'ng-template[flyModuleIcon]', standalone: true })\r\nexport class FlyModuleIconDirective {\r\n readonly flyModuleIcon = input.required<string>();\r\n readonly template = inject<TemplateRef<unknown>>(TemplateRef);\r\n}\r\n\r\n/**\r\n * `<fly-app-topbar>` — brand + module switcher for a business app's own chrome.\r\n *\r\n * This is the in-APP navigation (which module of this app am I in), distinct\r\n * from the desktop shell's dock (which app am I in). An app renders it once at\r\n * the top of its root component.\r\n *\r\n * ```html\r\n * <fly-app-topbar\r\n * brandLabelKey=\"common.label.thoughts\"\r\n * [sections]=\"navSections\"\r\n * [activeKey]=\"activeModule()\"\r\n * (moduleSelected)=\"go($event)\"\r\n * (brandSelected)=\"goHome()\">\r\n * <ng-template flyModuleIcon=\"ideas\"><svg …></svg></ng-template>\r\n * <div app-topbar-actions><!-- optional right-hand slot --></div>\r\n * </fly-app-topbar>\r\n * ```\r\n *\r\n * Generalized from the Circles topbar, whose structure was sound but whose\r\n * content was hardcoded — one `@if (fooActive())` branch and one inline `<svg>`\r\n * per module, so adding a module meant editing the component. Here the modules\r\n * are data ({@link FlyAppModule}) and the icons are projected templates.\r\n *\r\n * a11y: the trigger is `aria-haspopup=\"menu\"` + `aria-expanded`; the popover is\r\n * `role=\"menu\"` with `role=\"menuitem\"` rows carrying `aria-current=\"page\"` on\r\n * the active one. Arrow keys rove (RTL-aware, wrapping, skipping disabled),\r\n * Home/End jump, Escape closes and returns focus to the trigger, and a click\r\n * outside closes. Only the topmost overlay answers Escape, so a switcher opened\r\n * over a drawer closes alone.\r\n */\r\n@Component({\r\n selector: 'fly-app-topbar',\r\n standalone: true,\r\n imports: [TranslatePipe, FlyClickOutsideDirective, NgTemplateOutlet],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '(document:keydown.escape)': 'onEscape()' },\r\n templateUrl: './app-topbar.component.html',\r\n styleUrl: './app-topbar.component.scss',\r\n})\r\nexport class FlyAppTopbarComponent {\r\n /** Brand name, as an i18n key. Omit to show only the projected brand mark. */\r\n readonly brandLabelKey = input<string | null>(null);\r\n\r\n /** The switcher's contents, one entry per popover column. */\r\n readonly sections = input<readonly FlyAppModuleSection[]>([]);\r\n\r\n /** Key of the module currently shown. Unknown/absent ⇒ neutral state. */\r\n readonly activeKey = input<string | null>(null);\r\n\r\n /** Free text pinned at the popover's foot (build number, environment, …). */\r\n readonly footerLabel = input<string | null>(null);\r\n\r\n /** A module row was activated. The host owns routing. */\r\n readonly moduleSelected = output<FlyAppModule>();\r\n\r\n /** The brand was clicked — conventionally \"go to this app's home\". */\r\n readonly brandSelected = output<void>();\r\n\r\n private readonly i18n = inject(I18nService);\r\n private readonly icons = contentChildren(FlyModuleIconDirective);\r\n private readonly rows = viewChildren<ElementRef<HTMLButtonElement>>('row');\r\n private readonly trigger = viewChildren<ElementRef<HTMLButtonElement>>('trigger');\r\n\r\n protected readonly open = signal(false);\r\n protected readonly focusIndex = signal(0);\r\n private stackHandle: OverlayHandle | null = null;\r\n\r\n /**\r\n * Set when the menu opens, cleared once focus has actually landed on a row.\r\n *\r\n * Focus cannot be moved in `openMenu()`: the rows live inside `@if (open())`,\r\n * so they do not exist until Angular re-renders, and `rows()` is still empty\r\n * at that point — the focus call would be a silent no-op. `rows` is a\r\n * viewChildren signal, so this effect re-runs the moment the rows appear.\r\n */\r\n private readonly pendingFocus = signal(false);\r\n\r\n protected readonly flat = computed(() => flattenModules(this.sections()));\r\n protected readonly activeModule = computed(() =>\r\n resolveActiveModule(this.sections(), this.activeKey()),\r\n );\r\n protected readonly brandAriaLabel = computed(() => this.i18n.t('ui.nav.home'));\r\n protected readonly switchAriaLabel = computed(() => this.i18n.t('ui.nav.switchModule'));\r\n\r\n constructor() {\r\n inject(DestroyRef).onDestroy(() => overlayStack.remove(this.stackHandle));\r\n\r\n effect(() => {\r\n const rows = this.rows();\r\n if (!this.pendingFocus() || rows.length === 0) return;\r\n rows[this.focusIndex()]?.nativeElement.focus();\r\n this.pendingFocus.set(false);\r\n });\r\n }\r\n\r\n protected iconFor(key: string): TemplateRef<unknown> | null {\r\n return this.icons().find(d => d.flyModuleIcon() === key)?.template ?? null;\r\n }\r\n\r\n protected indexOf(mod: FlyAppModule): number {\r\n return this.flat().findIndex(m => m.key === mod.key);\r\n }\r\n\r\n protected toggle(): void {\r\n if (this.open()) this.close();\r\n else this.openMenu();\r\n }\r\n\r\n private openMenu(): void {\r\n // Start focus on the active row when there is one, so the keyboard lands\r\n // where the user already is rather than at the top of the list.\r\n const active = this.activeKey();\r\n const activeIdx = active ? this.flat().findIndex(m => m.key === active && !m.disabled) : -1;\r\n this.focusIndex.set(activeIdx >= 0 ? activeIdx : firstModuleIndex(this.flat()));\r\n this.stackHandle = overlayStack.push();\r\n this.open.set(true);\r\n this.pendingFocus.set(true);\r\n }\r\n\r\n protected close(restoreFocus = false): void {\r\n if (!this.open()) return;\r\n overlayStack.remove(this.stackHandle);\r\n this.stackHandle = null;\r\n this.open.set(false);\r\n this.pendingFocus.set(false);\r\n if (restoreFocus) this.trigger()[0]?.nativeElement.focus();\r\n }\r\n\r\n protected select(mod: FlyAppModule): void {\r\n if (mod.disabled) return;\r\n this.close(true);\r\n this.moduleSelected.emit(mod);\r\n }\r\n\r\n protected onEscape(): void {\r\n // Stack arbitration: only the topmost overlay answers Escape, so a switcher\r\n // opened over a drawer closes alone on the first press.\r\n if (this.open() && overlayStack.isTop(this.stackHandle)) this.close(true);\r\n }\r\n\r\n protected onTriggerKeydown(event: KeyboardEvent): void {\r\n if (event.key !== 'ArrowDown' && event.key !== 'Enter' && event.key !== ' ') return;\r\n if (event.key === 'ArrowDown' && !this.open()) {\r\n event.preventDefault();\r\n this.openMenu();\r\n }\r\n }\r\n\r\n protected onRowKeydown(event: KeyboardEvent): void {\r\n // RTL flips what \"next\" means for the horizontal keys; vertical keys are\r\n // unaffected by writing direction.\r\n const rtl = this.i18n.direction() === 'rtl';\r\n const mods = this.flat();\r\n // No initializer: every switch arm either assigns `next` or returns, so an\r\n // initial null would be dead (no-useless-assignment).\r\n let next: number | null;\r\n\r\n switch (event.key) {\r\n case 'ArrowDown':\r\n next = nextModuleIndex(mods, this.focusIndex(), 1);\r\n break;\r\n case 'ArrowUp':\r\n next = nextModuleIndex(mods, this.focusIndex(), -1);\r\n break;\r\n case 'ArrowRight':\r\n next = nextModuleIndex(mods, this.focusIndex(), rtl ? -1 : 1);\r\n break;\r\n case 'ArrowLeft':\r\n next = nextModuleIndex(mods, this.focusIndex(), rtl ? 1 : -1);\r\n break;\r\n case 'Home':\r\n next = firstModuleIndex(mods);\r\n break;\r\n case 'End':\r\n next = nextModuleIndex(mods, firstModuleIndex(mods), -1);\r\n break;\r\n case 'Tab':\r\n this.close();\r\n return;\r\n default:\r\n return;\r\n }\r\n\r\n if (next === null || next < 0) return;\r\n event.preventDefault();\r\n this.focusIndex.set(next);\r\n this.focusRow(next);\r\n }\r\n\r\n private focusRow(index: number): void {\r\n this.rows()[index]?.nativeElement.focus();\r\n }\r\n}\r\n","<header class=\"fly-topbar\">\r\n <div class=\"fly-topbar__lead\">\r\n <button\r\n type=\"button\"\r\n class=\"fly-topbar__brand\"\r\n (click)=\"brandSelected.emit()\"\r\n [attr.aria-label]=\"brandAriaLabel()\"\r\n >\r\n <span class=\"fly-topbar__brand-mark\"><ng-content select=\"[app-topbar-brand]\" /></span>\r\n @if (brandLabelKey(); as key) {\r\n <span class=\"fly-topbar__brand-name\">{{ key | translate }}</span>\r\n }\r\n </button>\r\n\r\n @if (activeModule()) {\r\n <span class=\"fly-topbar__sep\" aria-hidden=\"true\">/</span>\r\n }\r\n\r\n <div class=\"fly-topbar__anchor\" (flyClickOutside)=\"close()\" [flyClickOutsideEnabled]=\"open()\">\r\n <button\r\n #trigger\r\n type=\"button\"\r\n class=\"fly-topbar__module\"\r\n [class.fly-topbar__module--on]=\"open()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKeydown($event)\"\r\n aria-haspopup=\"menu\"\r\n [attr.aria-expanded]=\"open()\"\r\n [attr.aria-label]=\"switchAriaLabel()\"\r\n >\r\n @if (activeModule(); as active) {\r\n <span class=\"fly-topbar__module-icon\">\r\n @if (iconFor(active.key); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl\" />\r\n } @else if (active.iconClass) {\r\n <i [class]=\"active.iconClass\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n <span class=\"fly-topbar__module-label\">{{ active.labelKey | translate }}</span>\r\n } @else {\r\n <span class=\"fly-topbar__module-label fly-topbar__module-label--empty\">\r\n {{ 'ui.nav.selectModule' | translate }}\r\n </span>\r\n }\r\n <svg class=\"fly-topbar__chevron\" width=\"11\" height=\"11\" viewBox=\"0 0 24 24\" fill=\"none\"\r\n stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\r\n aria-hidden=\"true\">\r\n <polyline points=\"6 9 12 15 18 9\" />\r\n </svg>\r\n </button>\r\n\r\n @if (open()) {\r\n <div class=\"fly-topbar__pop\" role=\"menu\" [attr.aria-label]=\"switchAriaLabel()\">\r\n <div class=\"fly-topbar__cols\">\r\n @for (section of sections(); track $index) {\r\n <div class=\"fly-topbar__col\">\r\n @if (section.titleKey; as titleKey) {\r\n <div class=\"fly-topbar__col-title\">{{ titleKey | translate }}</div>\r\n }\r\n @for (mod of section.modules; track mod.key) {\r\n <button\r\n #row\r\n type=\"button\"\r\n class=\"fly-topbar__item\"\r\n [class.fly-topbar__item--on]=\"mod.key === activeKey()\"\r\n role=\"menuitem\"\r\n [disabled]=\"mod.disabled ?? false\"\r\n [attr.tabindex]=\"indexOf(mod) === focusIndex() ? 0 : -1\"\r\n [attr.aria-current]=\"mod.key === activeKey() ? 'page' : null\"\r\n (click)=\"select(mod)\"\r\n (keydown)=\"onRowKeydown($event)\"\r\n >\r\n <span class=\"fly-topbar__item-icon\">\r\n @if (iconFor(mod.key); as tpl) {\r\n <ng-container *ngTemplateOutlet=\"tpl\" />\r\n } @else if (mod.iconClass) {\r\n <i [class]=\"mod.iconClass\" aria-hidden=\"true\"></i>\r\n }\r\n </span>\r\n <span class=\"fly-topbar__item-main\">\r\n <span class=\"fly-topbar__item-label\">{{ mod.labelKey | translate }}</span>\r\n @if (mod.descKey; as descKey) {\r\n <span class=\"fly-topbar__item-desc\">{{ descKey | translate }}</span>\r\n }\r\n </span>\r\n </button>\r\n }\r\n </div>\r\n }\r\n </div>\r\n @if (footerLabel()) {\r\n <div class=\"fly-topbar__foot\">{{ footerLabel() }}</div>\r\n }\r\n </div>\r\n }\r\n </div>\r\n </div>\r\n\r\n <div class=\"fly-topbar__actions\"><ng-content select=\"[app-topbar-actions]\" /></div>\r\n</header>\r\n","/** One segment of a fly-segmented radiogroup. */\r\nexport interface SegmentedOption {\r\n value: string;\r\n labelKey: string;\r\n /** Optional count badge (the legacy status-filter pill counter). */\r\n count?: number;\r\n}\r\n\r\n/**\r\n * Roving-focus target for a radiogroup keydown. Pure so the wrap-around and\r\n * RTL mirroring are unit-testable without the DOM.\r\n *\r\n * - ArrowRight/ArrowDown advance, ArrowLeft/ArrowUp go back — horizontal\r\n * arrows mirror under RTL (visual \"right\" stays visual \"right\").\r\n * - Home/End jump to the edges.\r\n * - Returns null for any other key (caller must not preventDefault).\r\n * - With no current selection (current < 0) navigation starts from index 0.\r\n */\r\nexport function nextSegmentIndex(\r\n current: number,\r\n key: string,\r\n length: number,\r\n rtl: boolean,\r\n): number | null {\r\n if (length === 0) return null;\r\n if (key === 'Home') return 0;\r\n if (key === 'End') return length - 1;\r\n\r\n const forward = key === 'ArrowDown' || key === (rtl ? 'ArrowLeft' : 'ArrowRight');\r\n const backward = key === 'ArrowUp' || key === (rtl ? 'ArrowRight' : 'ArrowLeft');\r\n if (!forward && !backward) return null;\r\n\r\n const base = current < 0 ? 0 : current;\r\n return forward ? (base + 1) % length : (base - 1 + length) % length;\r\n}\r\n","/**\r\n * Resolve which tab is active: the selected id when it exists in the tab set,\r\n * otherwise the first tab (or null with no tabs). Pure so the fallback rules\r\n * are unit-testable without the DOM.\r\n */\r\nexport function resolveActiveTab(\r\n ids: readonly string[],\r\n selected: string | undefined,\r\n): string | null {\r\n if (ids.length === 0) return null;\r\n if (selected !== undefined && ids.includes(selected)) return selected;\r\n return ids[0];\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n computed,\r\n contentChildren,\r\n forwardRef,\r\n inject,\r\n input,\r\n model,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { I18nService } from '../../../services/i18n.service';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { nextSegmentIndex } from '../../forms/segmented/segmented.logic';\r\nimport { resolveActiveTab } from './tabs.logic';\r\n\r\nlet nextTabsUid = 0;\r\n\r\n/**\r\n * Underline tab row + panels — visual port of the signal-detail sidecard tab\r\n * row (`.llc__tabs` / `.llc__tab`); also replaces the job-profile\r\n * `.create-form__tabs` anatomy.\r\n *\r\n * Usage: project `fly-tab`s, each owning its panel content.\r\n *\r\n * ```html\r\n * <fly-tabs [(selected)]=\"activeTab\">\r\n * <fly-tab id=\"overview\" labelKey=\"common.label.overview\">…</fly-tab>\r\n * <fly-tab id=\"history\" labelKey=\"common.label.history\" [count]=\"revisions().length\">…</fly-tab>\r\n * </fly-tabs>\r\n * ```\r\n *\r\n * a11y: `role=\"tablist\"`/`tab`/`tabpanel` with `aria-selected`/`aria-controls`\r\n * wiring, roving tabindex (active tab is the tab stop), RTL-aware arrow-key\r\n * navigation with wrap-around and Home/End; arrows move both selection and\r\n * focus (automatic activation). With no/unknown `selected`, the first tab is\r\n * active (see {@link resolveActiveTab}).\r\n */\r\n@Component({\r\n selector: 'fly-tabs',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <div\r\n #tablist\r\n class=\"tb\"\r\n role=\"tablist\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"ariaLabelKey() ? (ariaLabelKey()! | translate) : null\"\r\n (keydown)=\"onKey($event)\"\r\n >\r\n @for (tab of tabItems(); track tab.id()) {\r\n <button\r\n type=\"button\"\r\n class=\"tb__tab\"\r\n role=\"tab\"\r\n [id]=\"tabId(tab.id())\"\r\n [class.tb__tab--active]=\"activeId() === tab.id()\"\r\n [attr.aria-selected]=\"activeId() === tab.id()\"\r\n [attr.aria-controls]=\"panelId(tab.id())\"\r\n [attr.tabindex]=\"activeId() === tab.id() ? 0 : -1\"\r\n (click)=\"select(tab.id())\"\r\n >\r\n {{ tab.labelKey() | translate }}\r\n @if (tab.count() !== null) {\r\n <span class=\"tb__count\">{{ tab.count() }}</span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n <ng-content />\r\n `,\r\n styleUrl: './tabs.component.scss',\r\n})\r\nexport class FlyTabsComponent {\r\n private readonly i18n = inject(I18nService);\r\n private readonly uid = `fly-tabs-${nextTabsUid++}`;\r\n\r\n // Roving focus queries the tablist element only — querying the whole host\r\n // would also catch nested tab structures inside kept-mounted panels.\r\n private readonly tablist = viewChild.required<ElementRef<HTMLElement>>('tablist');\r\n\r\n /** Active tab id (two-way). Unset/unknown → first tab. */\r\n readonly selected = model<string>();\r\n /** Group label for the tablist. */\r\n readonly ariaLabelKey = input<string>();\r\n\r\n protected readonly tabItems = contentChildren(forwardRef(() => FlyTabComponent));\r\n\r\n readonly activeId = computed(() =>\r\n resolveActiveTab(this.tabItems().map(t => t.id()), this.selected()),\r\n );\r\n\r\n tabId(id: string): string {\r\n return `${this.uid}-tab-${id}`;\r\n }\r\n\r\n panelId(id: string): string {\r\n return `${this.uid}-panel-${id}`;\r\n }\r\n\r\n protected select(id: string): void {\r\n this.selected.set(id);\r\n }\r\n\r\n protected onKey(event: KeyboardEvent): void {\r\n const tabs = this.tabItems();\r\n const current = tabs.findIndex(t => t.id() === this.activeId());\r\n const next = nextSegmentIndex(current, event.key, tabs.length, this.i18n.isRtl());\r\n if (next === null) return;\r\n event.preventDefault();\r\n this.select(tabs[next].id());\r\n const tabButtons = this.tablist().nativeElement.querySelectorAll<HTMLButtonElement>(\r\n '[role=\"tab\"]',\r\n );\r\n tabButtons[next]?.focus();\r\n }\r\n}\r\n\r\n/**\r\n * One tab of a `fly-tabs` group: declares the tab button (id, label, optional\r\n * count pill) and owns the matching panel content. Inactive panels stay\r\n * mounted but `hidden`, so projected component state survives tab switches.\r\n */\r\n@Component({\r\n selector: 'fly-tab',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <div\r\n role=\"tabpanel\"\r\n tabindex=\"0\"\r\n [id]=\"tabs.panelId(id())\"\r\n [attr.aria-labelledby]=\"tabs.tabId(id())\"\r\n [hidden]=\"!active()\"\r\n >\r\n <ng-content />\r\n </div>\r\n `,\r\n styles: ':host { display: block; }',\r\n})\r\nexport class FlyTabComponent {\r\n protected readonly tabs = inject(FlyTabsComponent);\r\n\r\n readonly id = input.required<string>();\r\n readonly labelKey = input.required<string>();\r\n /** Optional count pill beside the label. */\r\n readonly count = input<number | null>(null);\r\n\r\n protected readonly active = computed(() => this.tabs.activeId() === this.id());\r\n}\r\n","import { ChangeDetectionStrategy, Component, input, model } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\nlet nextCollapsibleUid = 0;\r\n\r\n/**\r\n * Collapsible section — port of the home-page supporting-modules collapse\r\n * (`.home__supporting-*`): a full-width header button with a rotating chevron,\r\n * title, optional count pill and trailing hint; the body renders via `@if`\r\n * (the source has no height animation — only the chevron animates).\r\n *\r\n * Header content beyond the title can project through `[collapsible-header]`\r\n * (rendered between the title and the count pill).\r\n *\r\n * a11y: `aria-expanded` on the header button; `aria-controls` binds only\r\n * while expanded — the body leaves the DOM when collapsed, and a dangling id\r\n * reference is an a11y defect. RTL: the\r\n * collapsed chevron mirrors (`scaleX(-1)`), the open chevron's `rotate(90deg)`\r\n * is direction-neutral — both ported from the source.\r\n */\r\n@Component({\r\n selector: 'fly-collapsible',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <button\r\n type=\"button\"\r\n class=\"cl__hd\"\r\n [attr.aria-expanded]=\"expanded()\"\r\n [attr.aria-controls]=\"expanded() ? bodyId : null\"\r\n (click)=\"expanded.set(!expanded())\"\r\n >\r\n <svg\r\n class=\"cl__chev\"\r\n [class.is-open]=\"expanded()\"\r\n width=\"14\"\r\n height=\"14\"\r\n viewBox=\"0 0 24 24\"\r\n fill=\"none\"\r\n stroke=\"currentColor\"\r\n stroke-width=\"2.4\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n aria-hidden=\"true\"\r\n >\r\n <polyline points=\"9 6 15 12 9 18\" />\r\n </svg>\r\n @if (titleKey(); as key) {\r\n <span class=\"cl__t\">{{ key | translate }}</span>\r\n }\r\n <ng-content select=\"[collapsible-header]\" />\r\n @if (count() !== null) {\r\n <span class=\"cl__count\">{{ count() }}</span>\r\n }\r\n @if (hintKey(); as hint) {\r\n <span class=\"cl__hint\">{{ hint | translate }}</span>\r\n }\r\n </button>\r\n\r\n @if (expanded()) {\r\n <div class=\"cl__body\" [id]=\"bodyId\">\r\n <ng-content />\r\n </div>\r\n }\r\n `,\r\n styleUrl: './collapsible.component.scss',\r\n})\r\nexport class FlyCollapsibleComponent {\r\n /** Expansion state (two-way). */\r\n readonly expanded = model(false);\r\n /** i18n key for the header title; alternatively project `[collapsible-header]`. */\r\n readonly titleKey = input<string>();\r\n /** Optional count pill after the title. */\r\n readonly count = input<number | null>(null);\r\n /** Optional trailing hint, pushed to the end edge. */\r\n readonly hintKey = input<string>();\r\n\r\n protected readonly bodyId = `fly-collapsible-${nextCollapsibleUid++}`;\r\n}\r\n","import { Directive, ElementRef, inject, input } from '@angular/core';\r\n\r\n/**\r\n * Marks a native `input` / `select` / `textarea` as a library form control.\r\n *\r\n * The visual skin (the legacy `.ff__i` / `.ff__s` / `.ff__ta` / `.ff__multi`\r\n * anatomy) is carried by the wrapping {@link FlyFieldComponent} stylesheet —\r\n * directives cannot ship styles, and emitting the skin globally would grow the\r\n * library's global CSS surface. A `[flyControl]` therefore always lives inside\r\n * a `<fly-field>`. Date and number inputs are covered by the same skin (the\r\n * planned `fly-date-input` / `fly-number-input` wrappers were folded into this\r\n * directive — a plain `<input type=\"date|number\" flyControl>` is the API).\r\n *\r\n * `fly-field` also uses this directive as its content-child handle to wire\r\n * `aria-invalid` / `aria-describedby` / `aria-labelledby` onto the control.\r\n */\r\n@Directive({\r\n selector: 'input[flyControl], select[flyControl], textarea[flyControl]',\r\n standalone: true,\r\n host: { '[class.mono]': 'mono()' },\r\n})\r\nexport class FlyControlDirective {\r\n /** Monospace value rendering (URLs, ids, numbers) — the legacy `.ff__i.mono`. */\r\n readonly mono = input(false);\r\n\r\n readonly element: HTMLElement = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n contentChild,\r\n effect,\r\n input,\r\n} from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { FlyControlDirective } from '../control.directive';\r\n\r\n/**\r\n * Label + hint + error shell around any projected form control — unifies the\r\n * legacy `.fld`/`.ff__*` (drawer forms) and `.field-*` (job-profile) systems.\r\n *\r\n * The projected control opts into the field skin with the `flyControl`\r\n * directive; composite controls (`fly-bilingual-field`, `fly-tags-input`,\r\n * `fly-slider`) carry their own skin and project without it.\r\n *\r\n * `error` takes ALREADY-TRANSLATED text and renders it verbatim. (Verified\r\n * convention: signal-form stores literal strings in `fieldErrors`,\r\n * scenario-form stores `i18n.t()` output — neither stores raw keys, so the\r\n * field must not translate again. Callers translate keys themselves.)\r\n *\r\n * Additive a11y the legacy forms lacked: when a `[flyControl]` is projected,\r\n * the field wires `aria-invalid`, `aria-describedby` (hint + error) and —\r\n * unless the control brings its own `aria-label` — `aria-labelledby`.\r\n * Clicking the label focuses the control (the legacy `<label class=\"fld\">`\r\n * wrapper is not portable: composite children may contain their own labels,\r\n * and nested labels are invalid HTML).\r\n */\r\n@Component({\r\n selector: 'fly-field',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '[class.full]': 'fullWidth()' },\r\n template: `\r\n <div class=\"fld\">\r\n @if (labelKey(); as key) {\r\n <span\r\n class=\"fld__l\"\r\n [id]=\"labelId\"\r\n tabindex=\"0\"\r\n (click)=\"focusControl()\"\r\n (keydown.enter)=\"focusControl()\"\r\n (keydown.space)=\"focusControl(); $event.preventDefault()\"\r\n >{{ key | translate }}@if (required()) {<i class=\"fld__req\" aria-hidden=\"true\">*</i>}</span\r\n >\r\n }\r\n @if (hintKey(); as key) {\r\n <span class=\"fld__hint\" [id]=\"hintId\">{{ key | translate }}</span>\r\n }\r\n <ng-content />\r\n @if (error(); as message) {\r\n <div class=\"fld__err\" [id]=\"errorId\">{{ message }}</div>\r\n }\r\n </div>\r\n `,\r\n styleUrl: './form-field.component.scss',\r\n})\r\nexport class FlyFieldComponent {\r\n private static nextId = 0;\r\n protected readonly uid = `fly-field-${++FlyFieldComponent.nextId}`;\r\n\r\n readonly labelKey = input<string>();\r\n /** Renders the required asterisk (visual only — validation stays in the page). */\r\n readonly required = input(false);\r\n readonly hintKey = input<string>();\r\n /** Already-translated error text (NOT an i18n key) — see class docs. */\r\n readonly error = input<string | null>(null);\r\n /** Spans the full row of a wrapping fly-form-grid (legacy `.fld--full`). */\r\n readonly fullWidth = input(false);\r\n\r\n private readonly control = contentChild(FlyControlDirective);\r\n\r\n protected get labelId(): string { return `${this.uid}-l`; }\r\n protected get hintId(): string { return `${this.uid}-h`; }\r\n protected get errorId(): string { return `${this.uid}-e`; }\r\n\r\n constructor() {\r\n effect(() => {\r\n const ctrl = this.control()?.element;\r\n if (!ctrl) return;\r\n const err = this.error();\r\n if (err) ctrl.setAttribute('aria-invalid', 'true');\r\n else ctrl.removeAttribute('aria-invalid');\r\n\r\n const describedBy = [\r\n this.hintKey() ? this.hintId : null,\r\n err ? this.errorId : null,\r\n ].filter(Boolean).join(' ');\r\n if (describedBy) ctrl.setAttribute('aria-describedby', describedBy);\r\n else ctrl.removeAttribute('aria-describedby');\r\n\r\n if (this.labelKey() && !ctrl.hasAttribute('aria-label')) {\r\n ctrl.setAttribute('aria-labelledby', this.labelId);\r\n }\r\n });\r\n }\r\n\r\n protected focusControl(): void {\r\n this.control()?.element.focus();\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component, input, model } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\n/**\r\n * Card-style checkbox row (port of the legacy `.cb-row` — e.g. the\r\n * signal-form \"weak signal\" toggle): hidden native input, custom gradient box,\r\n * label + optional hint. Custom label content projects into the default slot\r\n * when no `labelKey` is given.\r\n */\r\n@Component({\r\n selector: 'fly-checkbox',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <label class=\"cb\">\r\n <input\r\n type=\"checkbox\"\r\n [checked]=\"checked()\"\r\n [disabled]=\"disabled()\"\r\n (change)=\"onChange($event)\"\r\n />\r\n <span class=\"cb__box\" aria-hidden=\"true\"></span>\r\n <span class=\"cb__l\">\r\n <span class=\"cb__text\">\r\n @if (labelKey(); as key) {\r\n {{ key | translate }}\r\n } @else {\r\n <ng-content />\r\n }\r\n </span>\r\n @if (hintKey(); as key) {\r\n <i class=\"cb__hint\">{{ key | translate }}</i>\r\n }\r\n </span>\r\n </label>\r\n `,\r\n styleUrl: './checkbox.component.scss',\r\n})\r\nexport class FlyCheckboxComponent {\r\n readonly checked = model(false);\r\n readonly disabled = input(false);\r\n readonly labelKey = input<string>();\r\n readonly hintKey = input<string>();\r\n\r\n protected onChange(event: Event): void {\r\n this.checked.set((event.target as HTMLInputElement).checked);\r\n }\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n computed,\r\n inject,\r\n input,\r\n model,\r\n} from '@angular/core';\r\nimport { I18nService } from '../../../services/i18n.service';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { SegmentedOption, nextSegmentIndex } from './segmented.logic';\r\n\r\n/**\r\n * Segmented radiogroup — one anatomy for form segmented controls (the\r\n * llm-throttle level picker) and list status-pill filters (the legacy\r\n * `.signals-page-statusfilter`, which is also the visual source).\r\n *\r\n * a11y: `role=\"radiogroup\"` + `role=\"radio\"` segments, roving tabindex\r\n * (selected segment is the tab stop), RTL-aware arrow-key navigation with\r\n * wrap-around; arrows move both selection and focus.\r\n */\r\n@Component({\r\n selector: 'fly-segmented',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <div\r\n class=\"seg\"\r\n role=\"radiogroup\"\r\n tabindex=\"-1\"\r\n [attr.aria-label]=\"ariaLabelKey() ? (ariaLabelKey()! | translate) : null\"\r\n (keydown)=\"onKey($event)\"\r\n >\r\n @for (opt of options(); track opt.value) {\r\n <button\r\n type=\"button\"\r\n class=\"seg__btn\"\r\n role=\"radio\"\r\n [class.on]=\"value() === opt.value\"\r\n [attr.aria-checked]=\"value() === opt.value\"\r\n [attr.tabindex]=\"tabIndexFor($index)\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"select(opt.value)\"\r\n >\r\n {{ opt.labelKey | translate }}\r\n @if (opt.count !== undefined) {\r\n <span class=\"seg__count\">{{ opt.count }}</span>\r\n }\r\n </button>\r\n }\r\n </div>\r\n `,\r\n styleUrl: './segmented.component.scss',\r\n})\r\nexport class FlySegmentedComponent {\r\n private readonly i18n = inject(I18nService);\r\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\r\n\r\n readonly options = input.required<SegmentedOption[]>();\r\n readonly value = model<string | undefined>(undefined);\r\n readonly disabled = input(false);\r\n readonly ariaLabelKey = input<string>();\r\n\r\n protected readonly selectedIndex = computed(() =>\r\n this.options().findIndex(o => o.value === this.value()),\r\n );\r\n\r\n protected tabIndexFor(index: number): number {\r\n const selected = this.selectedIndex();\r\n return index === (selected >= 0 ? selected : 0) ? 0 : -1;\r\n }\r\n\r\n protected select(value: string): void {\r\n if (!this.disabled()) this.value.set(value);\r\n }\r\n\r\n protected onKey(event: KeyboardEvent): void {\r\n if (this.disabled()) return;\r\n const next = nextSegmentIndex(\r\n this.selectedIndex(),\r\n event.key,\r\n this.options().length,\r\n this.i18n.isRtl(),\r\n );\r\n if (next === null) return;\r\n event.preventDefault();\r\n this.select(this.options()[next].value);\r\n this.el.nativeElement.querySelectorAll<HTMLButtonElement>('[role=\"radio\"]')[next]?.focus();\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component, input, model } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\n/**\r\n * Switch toggle (`role=\"switch\"`). No legacy visual source existed — minimal\r\n * library design: 34×20 track, accent fill when on, `--t-state` transition.\r\n * RTL-safe (knob travel mirrors under `dir=\"rtl\"`).\r\n */\r\n@Component({\r\n selector: 'fly-toggle',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <button\r\n type=\"button\"\r\n class=\"tg\"\r\n role=\"switch\"\r\n [attr.aria-checked]=\"checked()\"\r\n [attr.aria-label]=\"labelKey() ? null : (ariaLabelKey() ? (ariaLabelKey()! | translate) : null)\"\r\n [disabled]=\"disabled()\"\r\n (click)=\"checked.set(!checked())\"\r\n >\r\n <span class=\"tg__track\" aria-hidden=\"true\"><span class=\"tg__knob\"></span></span>\r\n @if (labelKey(); as key) {\r\n <span class=\"tg__l\">{{ key | translate }}</span>\r\n }\r\n </button>\r\n `,\r\n styleUrl: './toggle.component.scss',\r\n})\r\nexport class FlyToggleComponent {\r\n readonly checked = model(false);\r\n readonly disabled = input(false);\r\n readonly labelKey = input<string>();\r\n /** Accessible name when no visible label is rendered. */\r\n readonly ariaLabelKey = input<string>();\r\n}\r\n","/** Clamp a slider value into [min, max]; NaN collapses to min. */\r\nexport function clampSliderValue(value: number, min: number, max: number): number {\r\n if (Number.isNaN(value)) return min;\r\n return Math.min(max, Math.max(min, value));\r\n}\r\n\r\n/**\r\n * Resolve what a typed number-box edit commits to the slider model.\r\n *\r\n * - empty string → `null` (cleared — page-level \"required\" validation stays\r\n * reachable instead of silently keeping the last value)\r\n * - unparseable → `undefined` (in-progress edit like `-` or `1e` — caller\r\n * keeps the current model value)\r\n * - parseable → clamped into [min, max] when `clamp`, otherwise RAW (page\r\n * owns range validation)\r\n */\r\nexport function commitSliderInput(\r\n raw: string,\r\n min: number,\r\n max: number,\r\n clamp: boolean,\r\n): number | null | undefined {\r\n if (raw.trim() === '') return null;\r\n const parsed = Number(raw);\r\n if (Number.isNaN(parsed)) return undefined;\r\n return clamp ? clampSliderValue(parsed, min, max) : parsed;\r\n}\r\n\r\n/**\r\n * Gradient fill for the range track (the legacy confidence-slider\r\n * `--rng-track`): brand teal→purple up to the value, rest neutral. All colour\r\n * stops resolve through tokens so themes restyle the track. Mirrored under RTL\r\n * (native range inputs flip, `to right` would not).\r\n */\r\nexport function sliderTrackGradient(\r\n value: number,\r\n min: number,\r\n max: number,\r\n rtl: boolean,\r\n): string {\r\n const span = max - min;\r\n const pct = span <= 0 ? 0 : ((clampSliderValue(value, min, max) - min) / span) * 100;\r\n const direction = rtl ? 'to left' : 'to right';\r\n return `linear-gradient(${direction}, var(--teal), var(--purple) ${pct}%, var(--line-2) ${pct}%)`;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n model,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { I18nService } from '../../../services/i18n.service';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { clampSliderValue, commitSliderInput, sliderTrackGradient } from './slider.logic';\r\n\r\n/**\r\n * Range + synced number + unit suffix (port of the legacy confidence `.rng`\r\n * pattern in signal-form/trend-form). The gradient track is computed per value\r\n * and bound as the `--rng-track` custom property, exactly like the source's\r\n * `confidenceTrackBg()`.\r\n *\r\n * Model is `number | null` — clearing the number box commits `null`, so\r\n * page-level \"required\" validation stays reachable. With `clampOnInput`\r\n * (default), typed values clamp into [min, max]; when disabled they pass RAW\r\n * to the model (the page owns range validation — the range track itself stays\r\n * natively clamped either way). While the user types in the number box, the\r\n * box is never rewritten from the model; it re-syncs on blur or when the\r\n * change originated elsewhere (range drag, programmatic set).\r\n */\r\n@Component({\r\n selector: 'fly-slider',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <div class=\"rng\">\r\n <input\r\n type=\"range\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [step]=\"step()\"\r\n [value]=\"value() ?? min()\"\r\n [disabled]=\"disabled()\"\r\n [style.--rng-track]=\"trackBg()\"\r\n [attr.aria-label]=\"ariaLabelKey() ? (ariaLabelKey()! | translate) : null\"\r\n (input)=\"onRangeInput($event)\"\r\n />\r\n <input\r\n #num\r\n class=\"rng__num\"\r\n type=\"number\"\r\n [min]=\"min()\"\r\n [max]=\"max()\"\r\n [disabled]=\"disabled()\"\r\n [attr.aria-label]=\"ariaLabelKey() ? (ariaLabelKey()! | translate) : null\"\r\n (input)=\"onNumberInput($event)\"\r\n (blur)=\"onNumberBlur($event)\"\r\n />\r\n <span class=\"rng__pct\" aria-hidden=\"true\">{{ unit() }}</span>\r\n </div>\r\n `,\r\n styleUrl: './slider.component.scss',\r\n})\r\nexport class FlySliderComponent {\r\n private readonly i18n = inject(I18nService);\r\n\r\n readonly value = model<number | null>(null);\r\n readonly min = input(0);\r\n readonly max = input(100);\r\n readonly step = input(5);\r\n readonly unit = input('%');\r\n readonly disabled = input(false);\r\n /** When false, out-of-range typed values pass through raw — page validates. */\r\n readonly clampOnInput = input(true);\r\n /** Accessible name for both inputs (a fly-field label does not reach them). */\r\n readonly ariaLabelKey = input<string>();\r\n\r\n private readonly numberBox = viewChild<ElementRef<HTMLInputElement>>('num');\r\n private typing = false;\r\n\r\n protected readonly trackBg = computed(() =>\r\n sliderTrackGradient(this.value() ?? this.min(), this.min(), this.max(), this.i18n.isRtl()),\r\n );\r\n\r\n constructor() {\r\n effect(() => {\r\n const v = this.value();\r\n const el = this.numberBox()?.nativeElement;\r\n if (!el || this.typing) return; // user-originated — never rewrite in-progress text\r\n el.value = v === null ? '' : String(v);\r\n });\r\n }\r\n\r\n protected onRangeInput(event: Event): void {\r\n const parsed = Number((event.target as HTMLInputElement).value);\r\n this.value.set(clampSliderValue(parsed, this.min(), this.max()));\r\n }\r\n\r\n protected onNumberInput(event: Event): void {\r\n this.typing = true;\r\n const raw = (event.target as HTMLInputElement).value;\r\n const next = commitSliderInput(raw, this.min(), this.max(), this.clampOnInput());\r\n if (next !== undefined) this.value.set(next);\r\n }\r\n\r\n protected onNumberBlur(event: Event): void {\r\n this.typing = false;\r\n const v = this.value();\r\n (event.target as HTMLInputElement).value = v === null ? '' : String(v);\r\n }\r\n}\r\n","/** Separator semantics for free-text tag parsing.\r\n * - `'whitespace-comma'` — split on any run of whitespace and/or commas\r\n * (single-word tags only).\r\n * - `'comma'` — split on commas only, so multi-word tags survive. */\r\nexport type TagSeparators = 'whitespace-comma' | 'comma';\r\n\r\n/** Parse free text into tags. Default mode splits on any run of whitespace\r\n * and/or commas; `'comma'` mode splits only on commas (multi-word tags\r\n * survive). Optional `dedupe` drops case-insensitive duplicates, keeping the\r\n * first occurrence. */\r\nexport function parseTags(\r\n text: string,\r\n separators: TagSeparators = 'whitespace-comma',\r\n dedupe = false,\r\n): string[] {\r\n const parts = text\r\n .split(separators === 'comma' ? ',' : /[\\s,]+/)\r\n .map(t => t.trim())\r\n .filter(Boolean);\r\n if (!dedupe) return parts;\r\n const seen = new Set<string>();\r\n const out: string[] = [];\r\n for (const tag of parts) {\r\n const key = tag.toLowerCase();\r\n if (!seen.has(key)) {\r\n seen.add(key);\r\n out.push(tag);\r\n }\r\n }\r\n return out;\r\n}\r\n\r\n/** Join tags back into editable text — the inverse of `parseTags` for the\r\n * active separator mode (`', '` in comma mode, `' '` otherwise). */\r\nexport function joinTags(tags: string[], separators: TagSeparators = 'whitespace-comma'): string {\r\n return tags.join(separators === 'comma' ? ', ' : ' ');\r\n}\r\n\r\n/** Order-sensitive tag-array equality (tags keep authoring order). */\r\nexport function sameTags(a: string[], b: string[]): boolean {\r\n return a.length === b.length && a.every((tag, i) => tag === b[i]);\r\n}\r\n\r\n/**\r\n * Suggestions for the fragment currently being typed (the last\r\n * whitespace-separated part), capped at `limit`. Empty/blank fragment shows\r\n * the first `limit` suggestions — mirroring the source behavior.\r\n */\r\nexport function filterSuggestions(all: string[], text: string, limit = 10): string[] {\r\n if (!text) return all.slice(0, limit);\r\n const parts = text.split(/\\s+/);\r\n const last = parts[parts.length - 1].trim().toLowerCase();\r\n if (!last) return all.slice(0, limit);\r\n return all.filter(t => t.toLowerCase().includes(last)).slice(0, limit);\r\n}\r\n\r\n/** Replace the fragment being typed with the picked suggestion and re-open a\r\n * trailing space for the next tag — source `applyTagSuggestion` semantics. */\r\nexport function applySuggestion(text: string, tag: string): string {\r\n const parts = text.split(/\\s+/).map(p => p.trim()).filter(Boolean);\r\n if (parts.length === 0) parts.push(tag);\r\n else parts[parts.length - 1] = tag;\r\n return parts.join(' ') + ' ';\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n effect,\r\n input,\r\n model,\r\n signal,\r\n untracked,\r\n} from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport {\r\n applySuggestion,\r\n filterSuggestions,\r\n joinTags,\r\n parseTags,\r\n sameTags,\r\n type TagSeparators,\r\n} from './tags-input.logic';\r\n\r\n/**\r\n * Free-text tags input: typed text is parsed into the `tags` model on every\r\n * change, with a suggestions strip (filtered by the fragment being typed)\r\n * below the input. `separators` selects the parse semantics — the default\r\n * `'whitespace-comma'` mode (signal-form heritage) splits on whitespace and\r\n * commas, while `'comma'` mode (trend-form heritage) splits only on commas so\r\n * multi-word tags survive; `dedupe` adds trend-form's case-insensitive\r\n * first-wins dedup. Validation stays in the page — pass the offending tags\r\n * through `invalidTags` and project the error message into the `[tags-error]`\r\n * slot.\r\n */\r\n@Component({\r\n selector: 'fly-tags-input',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <input\r\n class=\"ti__input\"\r\n type=\"text\"\r\n [class.invalid]=\"invalidTags().length > 0\"\r\n [value]=\"text()\"\r\n [placeholder]=\"placeholderKey() ? (placeholderKey()! | translate) : ''\"\r\n [attr.aria-label]=\"ariaLabelKey() ? (ariaLabelKey()! | translate) : null\"\r\n [attr.aria-invalid]=\"invalidTags().length > 0 ? 'true' : null\"\r\n [disabled]=\"disabled()\"\r\n (input)=\"onInput($event)\"\r\n />\r\n @if (openSuggestions().length > 0) {\r\n <ul class=\"ti__suggestions\">\r\n @for (tag of openSuggestions(); track tag) {\r\n <li><button type=\"button\" (click)=\"apply(tag)\">{{ tag }}</button></li>\r\n }\r\n </ul>\r\n }\r\n @if (invalidTags().length > 0) {\r\n <div class=\"ti__err\"><ng-content select=\"[tags-error]\" /></div>\r\n }\r\n `,\r\n styleUrl: './tags-input.component.scss',\r\n})\r\nexport class FlyTagsInputComponent {\r\n readonly tags = model<string[]>([]);\r\n readonly suggestions = input<string[]>([]);\r\n readonly placeholderKey = input<string>();\r\n /** Tags the page rejected — renders the projected `[tags-error]` slot. */\r\n readonly invalidTags = input<string[]>([]);\r\n readonly disabled = input(false);\r\n readonly ariaLabelKey = input<string>();\r\n /** Parse mode: `'whitespace-comma'` (default) or `'comma'` (multi-word tags). */\r\n readonly separators = input<TagSeparators>('whitespace-comma');\r\n /** Case-insensitive dedup keeping the first occurrence. */\r\n readonly dedupe = input(false);\r\n\r\n protected readonly text = signal('');\r\n /** Suggestions opened by the latest edit; cleared on pick (source behavior). */\r\n protected readonly openSuggestions = signal<string[]>([]);\r\n\r\n constructor() {\r\n // External tags (edit-mode load, programmatic reset) re-seed the text.\r\n // No feedback loop: text edits write tags whose parse equals the text.\r\n effect(() => {\r\n const external = this.tags();\r\n const current = untracked(this.text);\r\n if (!sameTags(this.parse(current), external)) {\r\n this.text.set(joinTags(external, this.separators()));\r\n this.openSuggestions.set([]);\r\n }\r\n });\r\n }\r\n\r\n protected onInput(event: Event): void {\r\n const value = (event.target as HTMLInputElement).value;\r\n this.text.set(value);\r\n this.tags.set(this.parse(value));\r\n this.openSuggestions.set(filterSuggestions(this.suggestions(), value));\r\n }\r\n\r\n protected apply(tag: string): void {\r\n const next = applySuggestion(this.text(), tag);\r\n this.text.set(next);\r\n this.tags.set(this.parse(next));\r\n this.openSuggestions.set([]);\r\n }\r\n\r\n private parse(text: string): string[] {\r\n return parseTags(text, this.separators(), this.dedupe());\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { TranslatePipe } from '../../pipes/translate.pipe';\r\n\r\n/**\r\n * Labeled form section (port of the legacy `.dr__sec`/`.dr__sec-l`): a sticky\r\n * 140px uppercase label column beside the content, collapsing to a stacked\r\n * layout under 720px.\r\n */\r\n@Component({\r\n selector: 'fly-form-section',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <div class=\"sec__l\">\r\n @if (labelKey(); as key) {\r\n {{ key | translate }}\r\n }\r\n </div>\r\n <div class=\"sec__c\"><ng-content /></div>\r\n `,\r\n styleUrl: './form-section.component.scss',\r\n})\r\nexport class FlyFormSectionComponent {\r\n readonly labelKey = input<string>();\r\n}\r\n\r\n/**\r\n * Responsive field grid (port of the legacy `.dr__grid/--2/--3`): 1–3 equal\r\n * columns, single column under 720px. `cols=\"auto\"` instead packs as many\r\n * 180px-min columns as fit (`repeat(auto-fit, minmax(180px, 1fr))`) — the\r\n * inline single-row layout on wide screens. A `fly-field` with `[fullWidth]`\r\n * spans the full row.\r\n */\r\n@Component({\r\n selector: 'fly-form-grid',\r\n standalone: true,\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '[attr.data-cols]': 'cols()' },\r\n template: '<ng-content />',\r\n styleUrl: './form-grid.component.scss',\r\n})\r\nexport class FlyFormGridComponent {\r\n readonly cols = input<1 | 2 | 3 | 'auto'>(1);\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\n/**\r\n * Form/drawer footer bar (port of the legacy `.dr__ft`): optional pulsing\r\n * auto-save hint at the start, actions projected at the end. Designed to sit\r\n * in a `fly-drawer`'s `[drawer-footer]` slot but works standalone.\r\n */\r\n@Component({\r\n selector: 'fly-form-footer',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n @if (autosaveHint()) {\r\n <span class=\"ft__hint\">\r\n <span class=\"ft__dot\" aria-hidden=\"true\"></span>\r\n {{ 'ui.form.autoSaving' | translate }}\r\n </span>\r\n }\r\n <div class=\"ft__actions\"><ng-content /></div>\r\n `,\r\n styleUrl: './form-footer.component.scss',\r\n})\r\nexport class FlyFormFooterComponent {\r\n /** Renders the pulsing-dot \"auto-saving\" hint (legacy `.dr__ft-hint`). */\r\n readonly autosaveHint = input(false);\r\n}\r\n","import { ChangeDetectionStrategy, Component, input } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\nexport type FormBannerKind = 'error' | 'success' | 'warning' | 'info';\r\n\r\n/**\r\n * Inline feedback banner for forms (port of the legacy `.dr__banner--error` /\r\n * `--success`, with warning/info added via tokens). Message via `messageKey`\r\n * or projected content. `error` announces as `role=\"alert\"`, the rest as\r\n * `role=\"status\"`.\r\n */\r\n@Component({\r\n selector: 'fly-form-banner',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '[attr.data-kind]': 'kind()',\r\n '[attr.role]': 'kind() === \"error\" ? \"alert\" : \"status\"',\r\n },\r\n template: `\r\n @if (messageKey(); as key) {\r\n {{ key | translate }}\r\n }\r\n <ng-content />\r\n `,\r\n styleUrl: './form-banner.component.scss',\r\n})\r\nexport class FlyFormBannerComponent {\r\n readonly kind = input<FormBannerKind>('error');\r\n readonly messageKey = input<string>();\r\n}\r\n","import { ChangeDetectionStrategy, Component, computed, input, model } from '@angular/core';\r\nimport { FormsModule } from '@angular/forms';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\n\r\n/**\r\n * Paired EN/AR text inputs (adopted into the ui library from\r\n * `circles/shared/components` — selector, API and class names unchanged).\r\n * The EN row strips Arabic codepoints, the AR row strips Latin letters.\r\n */\r\n@Component({\r\n selector: 'fly-bilingual-field',\r\n standalone: true,\r\n imports: [FormsModule, TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n templateUrl: './bilingual-field.component.html',\r\n styleUrl: './bilingual-field.component.scss',\r\n \r\n})\r\nexport class BilingualFieldComponent {\r\n private static _nextId = 0;\r\n labelEnKey = input<string>('');\r\n labelArKey = input<string>('');\r\n placeholderEn = input<string>('');\r\n placeholderAr = input<string>('');\r\n multiline = input<boolean>(false);\r\n rows = input<number>(3);\r\n /** Optional stable id prefix; auto-generated if omitted */\r\n fieldId = input<string>(`bilingual-${++BilingualFieldComponent._nextId}`);\r\n\r\n valueEn = model<string | undefined>('');\r\n valueAr = model<string | undefined>('');\r\n\r\n fieldIdEn = computed(() => `${this.fieldId()}-en`);\r\n fieldIdAr = computed(() => `${this.fieldId()}-ar`);\r\n\r\n onEnInput(event: Event): void {\r\n const el = event.target as HTMLInputElement | HTMLTextAreaElement;\r\n const raw = el.value ?? '';\r\n const cleaned = raw.replace(/[\\u0600-\\u06FF]/g, '');\r\n if (cleaned !== raw) {\r\n el.value = cleaned;\r\n }\r\n this.valueEn.set(cleaned);\r\n }\r\n\r\n onArInput(event: Event): void {\r\n const el = event.target as HTMLInputElement | HTMLTextAreaElement;\r\n const raw = el.value ?? '';\r\n const cleaned = raw.replace(/[A-Za-z]/g, '');\r\n if (cleaned !== raw) {\r\n el.value = cleaned;\r\n }\r\n this.valueAr.set(cleaned);\r\n }\r\n}\r\n","<div class=\"bilingual-field\">\r\n <div class=\"bilingual-field__row\">\r\n <!-- UAE DS 3.0 — explicit for/id association required -->\r\n <label [for]=\"fieldIdEn()\" class=\"bilingual-field__label\">{{ labelEnKey() | translate }}</label>\r\n @if (multiline()) {\r\n <textarea\r\n [id]=\"fieldIdEn()\"\r\n class=\"bilingual-field__input\"\r\n [placeholder]=\"placeholderEn()\"\r\n [value]=\"valueEn() ?? ''\"\r\n (input)=\"onEnInput($event)\"\r\n [rows]=\"rows()\"\r\n ></textarea>\r\n } @else {\r\n <input\r\n [id]=\"fieldIdEn()\"\r\n class=\"bilingual-field__input\"\r\n type=\"text\"\r\n [placeholder]=\"placeholderEn()\"\r\n [value]=\"valueEn() ?? ''\"\r\n (input)=\"onEnInput($event)\"\r\n />\r\n }\r\n </div>\r\n <div class=\"bilingual-field__row bilingual-field__row--rtl\">\r\n <label [for]=\"fieldIdAr()\" class=\"bilingual-field__label\">{{ labelArKey() | translate }}</label>\r\n @if (multiline()) {\r\n <textarea\r\n [id]=\"fieldIdAr()\"\r\n class=\"bilingual-field__input\"\r\n dir=\"rtl\"\r\n lang=\"ar\"\r\n [placeholder]=\"placeholderAr()\"\r\n [value]=\"valueAr() ?? ''\"\r\n (input)=\"onArInput($event)\"\r\n [rows]=\"rows()\"\r\n ></textarea>\r\n } @else {\r\n <input\r\n [id]=\"fieldIdAr()\"\r\n class=\"bilingual-field__input\"\r\n type=\"text\"\r\n dir=\"rtl\"\r\n lang=\"ar\"\r\n [placeholder]=\"placeholderAr()\"\r\n [value]=\"valueAr() ?? ''\"\r\n (input)=\"onArInput($event)\"\r\n />\r\n }\r\n </div>\r\n</div>\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n} from '@angular/core';\r\nimport { CdkTrapFocus } from '@angular/cdk/a11y';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { OverlayHandle, overlayStack } from '../../../overlays/overlay-stack';\r\n\r\n/**\r\n * Centered modal dialog — the generic shell behind the legacy\r\n * `.circles-overlay/__panel` global classes and the foresight drill-down\r\n * (`.dd`) popup: scrim, centered panel, header with ×, scrollable body\r\n * (default slot) and a `[modal-footer]` slot.\r\n *\r\n * `closed` fires on scrim click, Esc and the × button — the page owns the\r\n * open state and decides whether to tear down.\r\n *\r\n * Sizes (max-width, from the source overlay panels): `sm` 400px (confirm\r\n * variant) · `md` 640px (drill-down) · `lg` 920px (import/dedup overlays).\r\n *\r\n * Focus is trapped (CDK) while open. Same kept-mounted a11y treatment as\r\n * `fly-drawer`: the scale/fade animation plays when the modal stays mounted\r\n * and `open` toggles; while closed but kept mounted, the panel is\r\n * `visibility: hidden` + `inert` (unreachable by keyboard and assistive\r\n * tech); on close, focus returns to the element focused before opening.\r\n */\r\n@Component({\r\n selector: 'fly-modal',\r\n standalone: true,\r\n imports: [TranslatePipe, CdkTrapFocus],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: { '(document:keydown.escape)': 'onEscape()' },\r\n template: `\r\n <div class=\"mo\" [class.mo--open]=\"open()\" [attr.aria-hidden]=\"open() ? null : true\">\r\n <div class=\"mo__scrim\" role=\"presentation\" (click)=\"closed.emit()\"></div>\r\n <div\r\n class=\"mo__panel\"\r\n role=\"dialog\"\r\n aria-modal=\"true\"\r\n [attr.data-size]=\"size()\"\r\n [attr.inert]=\"open() ? null : ''\"\r\n [cdkTrapFocus]=\"open()\"\r\n [cdkTrapFocusAutoCapture]=\"open()\"\r\n [attr.aria-label]=\"titleKey() ? (titleKey()! | translate) : null\"\r\n >\r\n <header class=\"mo__hd\">\r\n @if (titleKey(); as key) {\r\n <h2 class=\"mo__t\">{{ key | translate }}</h2>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"mo__close\"\r\n (click)=\"closed.emit()\"\r\n [attr.aria-label]=\"'ui.action.close' | translate\"\r\n >×</button>\r\n </header>\r\n <div class=\"mo__body\"><ng-content /></div>\r\n <ng-content select=\"[modal-footer]\" />\r\n </div>\r\n </div>\r\n `,\r\n styleUrl: './modal.component.scss',\r\n})\r\nexport class FlyModalComponent {\r\n readonly open = input.required<boolean>();\r\n readonly titleKey = input<string>();\r\n /** Panel max-width: `sm` 400px · `md` 640px · `lg` 920px. */\r\n readonly size = input<'sm' | 'md' | 'lg'>('md');\r\n /** Scrim click, Esc, or the × button — consumer owns the open state. */\r\n readonly closed = output<void>();\r\n\r\n private wasOpen = false;\r\n private restoreFocusTo: HTMLElement | null = null;\r\n private stackHandle: OverlayHandle | null = null;\r\n\r\n constructor() {\r\n // Runs before the template (and thus the CDK focus trap's auto-capture)\r\n // is checked for the same change, so activeElement is still the trigger.\r\n effect(() => {\r\n const isOpen = this.open();\r\n if (isOpen && !this.wasOpen) {\r\n this.stackHandle = overlayStack.push();\r\n const active = document.activeElement;\r\n this.restoreFocusTo = active instanceof HTMLElement ? active : null;\r\n } else if (!isOpen && this.wasOpen) {\r\n overlayStack.remove(this.stackHandle);\r\n this.stackHandle = null;\r\n if (this.restoreFocusTo?.isConnected) this.restoreFocusTo.focus();\r\n this.restoreFocusTo = null;\r\n }\r\n this.wasOpen = isOpen;\r\n });\r\n inject(DestroyRef).onDestroy(() => overlayStack.remove(this.stackHandle));\r\n }\r\n\r\n protected onEscape(): void {\r\n // Stack arbitration: only the topmost open overlay answers Esc, so a\r\n // confirm stacked over this modal closes alone on the first press.\r\n if (this.open() && overlayStack.isTop(this.stackHandle)) this.closed.emit();\r\n }\r\n}\r\n","/** Tint of a fly-confirm-dialog. */\r\nexport type ConfirmKind = 'danger' | 'warn' | 'neutral';\r\n\r\n/**\r\n * Type-to-confirm gate: with no required text the confirm is always allowed;\r\n * otherwise the typed value (trimmed) must match the required text exactly —\r\n * case-sensitive. Pure so the gate is unit-testable without the DOM.\r\n */\r\nexport function canConfirm(requireText: string | null, typed: string): boolean {\r\n if (!requireText) return true;\r\n return typed.trim() === requireText;\r\n}\r\n\r\n/**\r\n * Document-level Enter arbitration: true when the focused element's native\r\n * Enter activation must win and the dialog's Enter-to-confirm has to stand\r\n * down. Without this gate, Enter on the Cancel button both cancels (native\r\n * click) and confirms (document handler) — the double-fire blocker.\r\n *\r\n * Buttons, links, selects, textareas and button-like/checkable inputs\r\n * activate natively; text-like inputs (the type-to-confirm gate) do not, so\r\n * the document handler keeps confirming for them. Pure (tag/type strings\r\n * only) so the gate is unit-testable without the DOM.\r\n */\r\nexport function enterActivatesNatively(tagName: string, inputType: string | null = null): boolean {\r\n const tag = tagName.toLowerCase();\r\n if (tag === 'button' || tag === 'a' || tag === 'select' || tag === 'textarea' || tag === 'summary') {\r\n return true;\r\n }\r\n if (tag !== 'input') return false;\r\n const type = (inputType ?? 'text').toLowerCase();\r\n return (\r\n type === 'button' ||\r\n type === 'submit' ||\r\n type === 'reset' ||\r\n type === 'checkbox' ||\r\n type === 'radio' ||\r\n type === 'file'\r\n );\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n DestroyRef,\r\n ElementRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n} from '@angular/core';\r\nimport { CdkTrapFocus } from '@angular/cdk/a11y';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { FlyButtonComponent } from '../../components/button/button.component';\r\nimport { ConfirmKind, canConfirm, enterActivatesNatively } from './confirm-dialog.logic';\r\nimport { OverlayHandle, overlayStack } from '../../../overlays/overlay-stack';\r\n\r\n/**\r\n * Confirmation dialog — the domain-free generalization of the legacy\r\n * `signal-confirm` overlay (`.cf` anatomy: scrim, centered panel, tinted icon,\r\n * footer actions; entrance animation and z-index preserved). The legacy\r\n * component keeps its archive/delete/restore copy and migrates onto this\r\n * shell in P4.\r\n *\r\n * - `kind` tints the panel border, icon disc and confirm button\r\n * (`danger` → danger-fill confirm).\r\n * - Message via `messageKey` and/or the default slot (consequence lists,\r\n * target metadata, …).\r\n * - `requireText` arms the type-to-confirm gate: confirm stays disabled until\r\n * the typed value matches exactly (see {@link canConfirm}); the prompt uses\r\n * `ui.confirm.typeToConfirm` with the `{text}` param.\r\n * - `busy` puts the confirm button in its loading state.\r\n * - Esc and the × emit `cancelled`; Enter confirms via the document handler\r\n * unless focus sits on a natively Enter-activated element inside the panel\r\n * (Cancel/Confirm buttons — their own click wins, see\r\n * {@link enterActivatesNatively}) or the type-to-confirm gate is unmet.\r\n *\r\n * The dialog renders only while `open` (entrance keyframes play per open);\r\n * focus is trapped while open and returns to the prior element on close.\r\n */\r\n@Component({\r\n selector: 'fly-confirm-dialog',\r\n standalone: true,\r\n imports: [TranslatePipe, CdkTrapFocus, FlyButtonComponent],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n host: {\r\n '(document:keydown.escape)': 'onEscape()',\r\n '(document:keydown.enter)': 'onEnter()',\r\n },\r\n templateUrl: './confirm-dialog.component.html',\r\n styleUrl: './confirm-dialog.component.scss',\r\n})\r\nexport class FlyConfirmDialogComponent {\r\n readonly open = input.required<boolean>();\r\n readonly kind = input<ConfirmKind>('neutral');\r\n readonly titleKey = input.required<string>();\r\n /** Body copy; project the default slot for richer content. */\r\n readonly messageKey = input<string>();\r\n readonly confirmLabelKey = input('ui.action.confirm');\r\n readonly cancelLabelKey = input('ui.action.cancel');\r\n /** Type-to-confirm gate: confirm stays disabled until this exact text is typed. */\r\n readonly requireText = input<string | null>(null);\r\n /** Confirm button loading state while the consumer's action runs. */\r\n readonly busy = input(false);\r\n readonly confirmed = output<void>();\r\n readonly cancelled = output<void>();\r\n\r\n protected readonly typed = signal('');\r\n protected readonly allowConfirm = computed(() => canConfirm(this.requireText(), this.typed()));\r\n\r\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private wasOpen = false;\r\n private restoreFocusTo: HTMLElement | null = null;\r\n private stackHandle: OverlayHandle | null = null;\r\n\r\n constructor() {\r\n // Same restore-focus treatment as fly-drawer / fly-modal; also resets the\r\n // type-to-confirm input on every open/close edge.\r\n effect(() => {\r\n const isOpen = this.open();\r\n if (isOpen && !this.wasOpen) {\r\n this.stackHandle = overlayStack.push();\r\n this.typed.set('');\r\n const active = document.activeElement;\r\n this.restoreFocusTo = active instanceof HTMLElement ? active : null;\r\n } else if (!isOpen && this.wasOpen) {\r\n overlayStack.remove(this.stackHandle);\r\n this.stackHandle = null;\r\n this.typed.set('');\r\n if (this.restoreFocusTo?.isConnected) this.restoreFocusTo.focus();\r\n this.restoreFocusTo = null;\r\n }\r\n this.wasOpen = isOpen;\r\n });\r\n inject(DestroyRef).onDestroy(() => overlayStack.remove(this.stackHandle));\r\n }\r\n\r\n protected onEscape(): void {\r\n // Stack arbitration: only the topmost open overlay answers Esc, so this\r\n // confirm stacked over a drawer/modal closes alone on the first press.\r\n if (this.open() && overlayStack.isTop(this.stackHandle)) this.cancel();\r\n }\r\n\r\n protected onEnter(): void {\r\n if (!this.open() || this.busy()) return;\r\n // Native activation wins: Enter on a focused button inside the panel\r\n // already fires its click (Cancel only cancels, Confirm confirms once).\r\n // Focus elsewhere — e.g. the type-to-confirm input — confirms here, with\r\n // confirm() still enforcing the gate.\r\n const active = document.activeElement;\r\n if (\r\n active instanceof HTMLElement &&\r\n this.el.nativeElement.contains(active) &&\r\n enterActivatesNatively(active.tagName, active.getAttribute('type'))\r\n ) {\r\n return;\r\n }\r\n this.confirm();\r\n }\r\n\r\n protected cancel(): void {\r\n this.cancelled.emit();\r\n }\r\n\r\n protected confirm(): void {\r\n if (!this.allowConfirm() || this.busy()) return;\r\n this.confirmed.emit();\r\n }\r\n}\r\n","@if (open()) {\r\n <div class=\"cf\" role=\"presentation\">\r\n <div class=\"cf__scrim\" role=\"presentation\" (click)=\"cancel()\"></div>\r\n <div\r\n class=\"cf__panel\"\r\n [attr.data-kind]=\"kind()\"\r\n role=\"alertdialog\"\r\n aria-modal=\"true\"\r\n cdkTrapFocus\r\n cdkTrapFocusAutoCapture\r\n [attr.aria-label]=\"titleKey() | translate\"\r\n >\r\n <div class=\"cf__head\">\r\n <div class=\"cf__icon\" [attr.data-kind]=\"kind()\" aria-hidden=\"true\">\r\n @switch (kind()) {\r\n @case ('danger') {\r\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <circle cx=\"12\" cy=\"12\" r=\"9\"/>\r\n <path d=\"M12 8v5M12 16h.01\"/>\r\n </svg>\r\n }\r\n @case ('warn') {\r\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <path d=\"M12 9v4M12 17h.01\"/>\r\n <path d=\"M10.3 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z\"/>\r\n </svg>\r\n }\r\n @default {\r\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <circle cx=\"12\" cy=\"12\" r=\"9\"/>\r\n <path d=\"M12 8v.01M12 11v5\"/>\r\n </svg>\r\n }\r\n }\r\n </div>\r\n <h3 class=\"cf__title\">{{ titleKey() | translate }}</h3>\r\n <button\r\n type=\"button\"\r\n class=\"cf__close\"\r\n (click)=\"cancel()\"\r\n [attr.aria-label]=\"'ui.action.close' | translate\"\r\n >×</button>\r\n </div>\r\n\r\n <div class=\"cf__body\">\r\n @if (messageKey(); as key) {\r\n <p class=\"cf__msg\">{{ key | translate }}</p>\r\n }\r\n <ng-content />\r\n\r\n @if (requireText(); as text) {\r\n <label class=\"cf__gate\">\r\n <span class=\"cf__gate-l\">{{ 'ui.confirm.typeToConfirm' | translate: { text: text } }}</span>\r\n <input\r\n class=\"cf__gate-i mono\"\r\n [value]=\"typed()\"\r\n (input)=\"typed.set($any($event.target).value)\"\r\n [placeholder]=\"text\"\r\n autocomplete=\"off\"\r\n />\r\n </label>\r\n }\r\n </div>\r\n\r\n <div class=\"cf__ft\">\r\n <button type=\"button\" fly-button (click)=\"cancel()\">\r\n {{ cancelLabelKey() | translate }}\r\n </button>\r\n <button\r\n type=\"button\"\r\n fly-button\r\n [variant]=\"kind() === 'danger' ? 'danger-fill' : 'primary'\"\r\n [loading]=\"busy()\"\r\n [disabled]=\"!allowConfirm()\"\r\n (click)=\"confirm()\"\r\n >\r\n {{ confirmLabelKey() | translate }}\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n}\r\n","/** One entry of a fly-action-menu. */\r\nexport interface ActionMenuItem {\r\n id: string;\r\n labelKey: string;\r\n /** PrimeIcons class (e.g. `pi-trash`). */\r\n icon?: string;\r\n danger?: boolean;\r\n disabled?: boolean;\r\n}\r\n\r\n/**\r\n * First enabled item scanning from the given edge (`1` = from the start,\r\n * `-1` = from the end). Returns -1 when every item is disabled.\r\n */\r\nexport function firstEnabledIndex(\r\n items: readonly ActionMenuItem[],\r\n direction: 1 | -1 = 1,\r\n): number {\r\n const indices = items.map((_, i) => i);\r\n if (direction === -1) indices.reverse();\r\n for (const i of indices) {\r\n if (!items[i].disabled) return i;\r\n }\r\n return -1;\r\n}\r\n\r\n/**\r\n * Roving-focus target for a menu keydown. Pure so the wrap-around and\r\n * disabled-skipping are unit-testable without the DOM.\r\n *\r\n * - ArrowDown advances, ArrowUp goes back — wrapping and skipping disabled\r\n * items (vertical menu: no RTL mirroring).\r\n * - Home/End jump to the first/last enabled item.\r\n * - Returns null for any other key, and when no item is enabled.\r\n * - With no current focus (current < 0) ArrowDown starts at the first enabled\r\n * item and ArrowUp at the last.\r\n */\r\nexport function nextEnabledIndex(\r\n items: readonly ActionMenuItem[],\r\n current: number,\r\n key: string,\r\n): number | null {\r\n if (items.length === 0 || items.every(i => i.disabled)) return null;\r\n if (key === 'Home') return firstEnabledIndex(items, 1);\r\n if (key === 'End') return firstEnabledIndex(items, -1);\r\n if (key !== 'ArrowDown' && key !== 'ArrowUp') return null;\r\n\r\n const step = key === 'ArrowDown' ? 1 : -1;\r\n if (current < 0) return firstEnabledIndex(items, step);\r\n\r\n let i = current;\r\n do {\r\n i = (i + step + items.length) % items.length;\r\n } while (items[i].disabled && i !== current);\r\n return items[i].disabled ? null : i;\r\n}\r\n","import {\r\n ChangeDetectionStrategy,\r\n Component,\r\n ElementRef,\r\n afterNextRender,\r\n inject,\r\n Injector,\r\n input,\r\n output,\r\n signal,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { CdkConnectedOverlay, CdkOverlayOrigin, ConnectedPosition } from '@angular/cdk/overlay';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { FlyIconButtonComponent } from '../../components/button/button.component';\r\nimport { ActionMenuItem, firstEnabledIndex, nextEnabledIndex } from './action-menu.logic';\r\n\r\n/**\r\n * Overflow action menu — a ⋯ icon-button trigger opening a CDK connected\r\n * dropdown of actions. New library component (the legacy pages have no\r\n * shared overflow menu).\r\n *\r\n * Items are config (`{ id, labelKey, icon?, danger?, disabled? }`); a chosen\r\n * item emits `selected` with its id and closes the menu.\r\n *\r\n * a11y: trigger carries `aria-haspopup`/`aria-expanded`; panel is\r\n * `role=\"menu\"` with `role=\"menuitem\"` buttons. Keyboard: Enter/Space/\r\n * ArrowDown open and focus the first enabled item (ArrowUp the last); arrows\r\n * rove with wrap-around skipping disabled items (see\r\n * {@link nextEnabledIndex}); Home/End jump; Esc, Tab and item activation\r\n * close and return focus to the trigger. Positioning uses logical start/end\r\n * connected positions, so the dropdown mirrors under RTL; it flips above the\r\n * trigger when out of viewport.\r\n */\r\n@Component({\r\n selector: 'fly-action-menu',\r\n standalone: true,\r\n imports: [TranslatePipe, CdkConnectedOverlay, CdkOverlayOrigin, FlyIconButtonComponent],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <button\r\n type=\"button\"\r\n fly-icon-button\r\n cdkOverlayOrigin\r\n #origin=\"cdkOverlayOrigin\"\r\n [tooltipKey]=\"triggerTooltipKey()\"\r\n aria-haspopup=\"menu\"\r\n [attr.aria-expanded]=\"open()\"\r\n (click)=\"toggle()\"\r\n (keydown)=\"onTriggerKey($event)\"\r\n >\r\n <i class=\"pi pi-ellipsis-h\" aria-hidden=\"true\"></i>\r\n </button>\r\n\r\n <ng-template\r\n cdkConnectedOverlay\r\n [cdkConnectedOverlayOrigin]=\"origin\"\r\n [cdkConnectedOverlayOpen]=\"open()\"\r\n [cdkConnectedOverlayPositions]=\"positions\"\r\n (overlayOutsideClick)=\"onOutsideClick($event)\"\r\n (attach)=\"onAttach()\"\r\n >\r\n <div class=\"am\" role=\"menu\" tabindex=\"-1\" #menu (keydown)=\"onMenuKey($event)\">\r\n @for (item of items(); track item.id) {\r\n <button\r\n type=\"button\"\r\n class=\"am__item\"\r\n role=\"menuitem\"\r\n tabindex=\"-1\"\r\n [class.am__item--danger]=\"item.danger\"\r\n [attr.aria-disabled]=\"item.disabled ? 'true' : null\"\r\n (click)=\"activate(item)\"\r\n >\r\n @if (item.icon) {\r\n <i class=\"pi {{ item.icon }}\" aria-hidden=\"true\"></i>\r\n }\r\n <span class=\"am__label\">{{ item.labelKey | translate }}</span>\r\n </button>\r\n }\r\n </div>\r\n </ng-template>\r\n `,\r\n styleUrl: './action-menu.component.scss',\r\n})\r\nexport class FlyActionMenuComponent {\r\n private readonly el = inject<ElementRef<HTMLElement>>(ElementRef);\r\n private readonly injector = inject(Injector);\r\n\r\n readonly items = input.required<ActionMenuItem[]>();\r\n readonly triggerTooltipKey = input('ui.table.actions');\r\n /** Id of the activated item. */\r\n readonly selected = output<string>();\r\n\r\n protected readonly open = signal(false);\r\n private readonly menu = viewChild<ElementRef<HTMLElement>>('menu');\r\n private pendingFocus = -1;\r\n\r\n // Logical start/end pairs — the CDK resolves them per direction, so the\r\n // panel hugs the trigger's end edge in LTR and RTL alike; vertical fallback\r\n // flips above the trigger.\r\n protected readonly positions: ConnectedPosition[] = [\r\n { originX: 'end', originY: 'bottom', overlayX: 'end', overlayY: 'top', offsetY: 4 },\r\n { originX: 'end', originY: 'top', overlayX: 'end', overlayY: 'bottom', offsetY: -4 },\r\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top', offsetY: 4 },\r\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom', offsetY: -4 },\r\n ];\r\n\r\n protected toggle(): void {\r\n if (this.open()) {\r\n this.close();\r\n } else {\r\n this.openMenu(firstEnabledIndex(this.items(), 1));\r\n }\r\n }\r\n\r\n protected onTriggerKey(event: KeyboardEvent): void {\r\n // Enter/Space already activate the button natively (→ toggle).\r\n if (event.key !== 'ArrowDown' && event.key !== 'ArrowUp') return;\r\n event.preventDefault();\r\n this.openMenu(firstEnabledIndex(this.items(), event.key === 'ArrowDown' ? 1 : -1));\r\n }\r\n\r\n protected onAttach(): void {\r\n // The overlay view exists but isn't painted yet — focus after render.\r\n afterNextRender(() => this.focusItem(this.pendingFocus), { injector: this.injector });\r\n }\r\n\r\n protected onOutsideClick(event: MouseEvent): void {\r\n // Trigger clicks toggle on their own — closing here too would reopen.\r\n if (event.target instanceof Node && this.el.nativeElement.contains(event.target)) return;\r\n this.open.set(false);\r\n }\r\n\r\n protected onMenuKey(event: KeyboardEvent): void {\r\n if (event.key === 'Escape') {\r\n event.preventDefault();\r\n this.close();\r\n return;\r\n }\r\n if (event.key === 'Tab') {\r\n // Same contract as Esc: the overlay-detached menu has no sequential\r\n // successor, so close and hand focus back to the trigger.\r\n event.preventDefault();\r\n this.close();\r\n return;\r\n }\r\n const next = nextEnabledIndex(this.items(), this.focusedIndex(), event.key);\r\n if (next === null) return;\r\n event.preventDefault();\r\n this.focusItem(next);\r\n }\r\n\r\n protected activate(item: ActionMenuItem): void {\r\n if (item.disabled) return;\r\n this.selected.emit(item.id);\r\n this.close();\r\n }\r\n\r\n private openMenu(focusIndex: number): void {\r\n this.pendingFocus = focusIndex;\r\n this.open.set(true);\r\n }\r\n\r\n private close(): void {\r\n this.open.set(false);\r\n this.el.nativeElement.querySelector('button')?.focus();\r\n }\r\n\r\n private menuItems(): HTMLButtonElement[] {\r\n const host = this.menu()?.nativeElement;\r\n return host ? Array.from(host.querySelectorAll<HTMLButtonElement>('[role=\"menuitem\"]')) : [];\r\n }\r\n\r\n private focusedIndex(): number {\r\n return this.menuItems().findIndex(b => b === document.activeElement);\r\n }\r\n\r\n private focusItem(index: number): void {\r\n if (index < 0) return;\r\n this.menuItems()[index]?.focus();\r\n }\r\n}\r\n","import { Injectable, signal } from '@angular/core';\r\n\r\nexport type ToastVariant = 'success' | 'warn' | 'danger' | 'neutral';\r\n\r\nexport interface ToastAction {\r\n label: string;\r\n onClick: () => void;\r\n}\r\n\r\nexport interface ToastOptions {\r\n variant?: ToastVariant;\r\n title?: string;\r\n body?: string;\r\n action?: ToastAction;\r\n /** Auto-dismiss after N ms. Default 4500. Pass 0 to keep until dismissed. */\r\n duration?: number;\r\n}\r\n\r\nexport interface ToastEntry extends Required<Pick<ToastOptions, 'variant' | 'title' | 'body'>> {\r\n id: string;\r\n action: ToastAction | null;\r\n duration: number;\r\n leaving: boolean;\r\n}\r\n\r\n/** Matches the leave animation in toast-host.component.scss (ts-out). */\r\nconst LEAVE_MS = 220;\r\nconst MAX_STACK = 5;\r\n\r\n/**\r\n * Injectable toast queue — the API surface of the toast system. The\r\n * `fly-toast-host` component (mounted once at the app root) renders this\r\n * queue; the legacy `window.toast` global bridges onto the same instance\r\n * until its P6 removal.\r\n *\r\n * Titles/bodies/action labels are plain, already-translated strings (the\r\n * `window.toast` contract) — callers translate keys themselves.\r\n */\r\n@Injectable({ providedIn: 'root' })\r\nexport class FlyToastService {\r\n private readonly _toasts = signal<ToastEntry[]>([]);\r\n private readonly timers = new Map<string, ReturnType<typeof setTimeout>>();\r\n\r\n /** Live queue, newest first — rendered by fly-toast-host. */\r\n readonly toasts = this._toasts.asReadonly();\r\n\r\n show(opts: ToastOptions): string {\r\n const id = Math.random().toString(36).slice(2, 9);\r\n const entry: ToastEntry = {\r\n id,\r\n variant: opts.variant ?? 'neutral',\r\n title: opts.title ?? '',\r\n body: opts.body ?? '',\r\n action: opts.action ?? null,\r\n duration: opts.duration ?? 4500,\r\n leaving: false,\r\n };\r\n this._toasts.update(list => [entry, ...list].slice(0, MAX_STACK));\r\n\r\n if (entry.duration > 0) {\r\n const t = setTimeout(() => this.dismiss(id), entry.duration);\r\n this.timers.set(id, t);\r\n }\r\n return id;\r\n }\r\n\r\n success(title: string, body?: string, opts?: Omit<ToastOptions, 'variant' | 'title' | 'body'>): string {\r\n return this.show({ ...opts, variant: 'success', title, body });\r\n }\r\n\r\n warn(title: string, body?: string, opts?: Omit<ToastOptions, 'variant' | 'title' | 'body'>): string {\r\n return this.show({ ...opts, variant: 'warn', title, body });\r\n }\r\n\r\n danger(title: string, body?: string, opts?: Omit<ToastOptions, 'variant' | 'title' | 'body'>): string {\r\n return this.show({ ...opts, variant: 'danger', title, body });\r\n }\r\n\r\n info(title: string, body?: string, opts?: Omit<ToastOptions, 'variant' | 'title' | 'body'>): string {\r\n return this.show({ ...opts, variant: 'neutral', title, body });\r\n }\r\n\r\n dismiss(id: string): void {\r\n const t = this.timers.get(id);\r\n if (t) {\r\n clearTimeout(t);\r\n this.timers.delete(id);\r\n }\r\n this._toasts.update(list => list.map(item => (item.id === id ? { ...item, leaving: true } : item)));\r\n setTimeout(() => {\r\n this._toasts.update(list => list.filter(item => item.id !== id));\r\n }, LEAVE_MS);\r\n }\r\n\r\n clearTimers(): void {\r\n this.timers.forEach(t => clearTimeout(t));\r\n this.timers.clear();\r\n }\r\n}\r\n","import { ChangeDetectionStrategy, Component, DestroyRef, inject } from '@angular/core';\r\nimport { TranslatePipe } from '../../../pipes/translate.pipe';\r\nimport { FlyToastService, ToastEntry, ToastOptions } from '../toast.service';\r\n\r\nexport type { ToastAction, ToastEntry, ToastOptions, ToastVariant } from '../toast.service';\r\n\r\ndeclare global {\r\n interface Window {\r\n /** @deprecated Inject {@link FlyToastService} instead — bridge removed in P6. */\r\n toast?: ToastApi;\r\n }\r\n}\r\n\r\ninterface ToastApi {\r\n (opts: ToastOptions): string;\r\n dismiss: (id: string) => void;\r\n}\r\n\r\n/**\r\n * Toast stack host — adopted from `circles/shared/components/toast-host`\r\n * (selector, DOM and behavior unchanged; colors tokenized, physical offsets\r\n * made logical so the stack mirrors under RTL). Mount once at the app root;\r\n * enqueue through {@link FlyToastService}.\r\n *\r\n * The legacy `window.toast` global is registered while this host is mounted\r\n * and shares the service queue. It is deprecated and goes away in the P6\r\n * sweep — new code must inject the service.\r\n */\r\n@Component({\r\n selector: 'fly-toast-host',\r\n standalone: true,\r\n imports: [TranslatePipe],\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: `\r\n <div class=\"ts\" role=\"region\" [attr.aria-label]=\"'ui.toast.label' | translate\">\r\n @for (t of service.toasts(); track t.id) {\r\n <div class=\"ts__t ts__t--{{ t.variant }}\" [class.ts__t--leave]=\"t.leaving\" role=\"status\">\r\n <span class=\"ts__icon ts__icon--{{ t.variant }}\" aria-hidden=\"true\">\r\n @switch (t.variant) {\r\n @case ('success') {\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <path d=\"M5 12l5 5L20 7\"/>\r\n </svg>\r\n }\r\n @case ('warn') {\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <path d=\"M12 9v4M12 17h.01\"/>\r\n <path d=\"M10.3 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0Z\"/>\r\n </svg>\r\n }\r\n @case ('danger') {\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <circle cx=\"12\" cy=\"12\" r=\"9\"/>\r\n <path d=\"M12 8v5M12 16h.01\"/>\r\n </svg>\r\n }\r\n @default {\r\n <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\r\n <circle cx=\"12\" cy=\"12\" r=\"9\"/>\r\n <path d=\"M12 8v4M12 16h.01\"/>\r\n </svg>\r\n }\r\n }\r\n </span>\r\n <div class=\"ts__body\">\r\n @if (t.title) { <div class=\"ts__title\">{{ t.title }}</div> }\r\n @if (t.body) { <div class=\"ts__msg\">{{ t.body }}</div> }\r\n </div>\r\n @if (t.action; as action) {\r\n <button type=\"button\" class=\"ts__action\" (click)=\"onAction(t)\">{{ action.label }}</button>\r\n }\r\n <button\r\n type=\"button\"\r\n class=\"ts__close\"\r\n (click)=\"service.dismiss(t.id)\"\r\n [attr.aria-label]=\"'ui.action.dismiss' | translate\"\r\n >×</button>\r\n </div>\r\n }\r\n </div>\r\n `,\r\n styleUrl: './toast-host.component.scss',\r\n})\r\nexport class ToastHostComponent {\r\n protected readonly service = inject(FlyToastService);\r\n\r\n constructor() {\r\n const destroyRef = inject(DestroyRef);\r\n\r\n if (typeof window !== 'undefined') {\r\n // Deprecated global bridge — same queue as the injectable service.\r\n const api = ((opts: ToastOptions) => this.service.show(opts)) as ToastApi;\r\n api.dismiss = (id: string) => this.service.dismiss(id);\r\n window.toast = api;\r\n }\r\n\r\n destroyRef.onDestroy(() => {\r\n this.service.clearTimers();\r\n if (typeof window !== 'undefined' && window.toast) {\r\n delete window.toast;\r\n }\r\n });\r\n }\r\n\r\n protected onAction(entry: ToastEntry): void {\r\n entry.action?.onClick();\r\n this.service.dismiss(entry.id);\r\n }\r\n}\r\n","// Barrel for the app-surface component library — the business-app CRUD/list/form\r\n// kit, absorbed from Circles' internal `src/app/ui/`. Re-exported from the DS\r\n// `public-api.ts`, so consumers import from '@flyos/design-system'.\r\n//\r\n// Five members of the original kit are deliberately ABSENT because the DS already\r\n// shipped a richer equivalent under the same selector/symbol; consumers use the\r\n// platform one instead:\r\n// fly-search-input · fly-skeleton · fly-drawer · overlayStack · [flyTooltip]\r\n// The DS `[flyTooltip]` takes already-translated TEXT (the kit's took an i18n\r\n// key), so call sites migrating off the kit must add `| translate`.\r\n\r\nexport {\r\n FlyButtonComponent,\r\n FlyIconButtonComponent,\r\n type ButtonVariant,\r\n type ButtonSize,\r\n type IconButtonVariant,\r\n} from './components/button/button.component';\r\nexport { FlyChipComponent, type ChipTone } from './components/chip/chip.component';\r\nexport { FlyStateMessageComponent } from './components/state-message/state-message.component';\r\nexport {\r\n type StateMessageKind,\r\n STATE_DEFAULT_ICONS,\r\n STATE_DEFAULT_MESSAGE_KEYS,\r\n resolveStateIcon,\r\n resolveStateMessageKey,\r\n} from './components/state-message/state-message.logic';\r\nexport { FlySpinnerComponent } from './components/spinner.component';\r\nexport { FlyActionStackComponent } from './components/action-stack/action-stack.component';\r\nexport { StatusBadgeComponent } from './components/status-badge/status-badge.component';\r\nexport { DashboardKpiComponent } from './components/kpi.component';\r\nexport { FlyMetaListComponent, type FlyMetaItem } from './components/meta-list/meta-list.component';\r\n\r\nexport { FlyPaginationComponent } from './listing/pagination/pagination.component';\r\nexport { canGoPrev, canGoNext, clampPage } from './listing/pagination/pagination.logic';\r\nexport { FlyCardComponent, type CardLayout } from './listing/card/card.component';\r\nexport {\r\n FlyCardActionsComponent,\r\n FlyCardBodyComponent,\r\n FlyCardFooterComponent,\r\n FlyCardMediaComponent,\r\n FlyCardMetaComponent,\r\n FlyCardStatusComponent,\r\n FlyCardTitleComponent,\r\n} from './listing/card-slots';\r\nexport { FlyFilterPanelComponent } from './listing/filter-panel/filter-panel.component';\r\nexport { FlyDataTableComponent } from './listing/data-table/data-table.component';\r\nexport { FlyCellDirective, type FlyCellContext } from './listing/cell.directive';\r\nexport { type FlyColumn, type FlyColumnKind, type FlySort } from './listing/data-table/data-table.types';\r\nexport { ariaSort, nextSort, resolveCellValue } from './listing/data-table/data-table.logic';\r\nexport { filterGroup, type FilterGroup } from './listing/filter-group';\r\nexport { FlyProgressComponent, type ProgressTone } from './listing/progress/progress.component';\r\nexport { FlySparklineComponent } from './listing/sparkline.component';\r\nexport { sparklinePath, sparklinePoints } from './listing/sparkline.logic';\r\n\r\nexport {\r\n PageHeaderComponent,\r\n type PageHeaderVariant,\r\n type BreadcrumbItem,\r\n} from './layout/page-header/page-header.component';\r\nexport { FlySectionHeaderComponent } from './layout/section-header/section-header.component';\r\nexport {\r\n FlyAppTopbarComponent,\r\n FlyModuleIconDirective,\r\n} from './layout/app-topbar/app-topbar.component';\r\nexport type { FlyAppModule, FlyAppModuleSection } from './layout/app-topbar/app-topbar.types';\r\nexport {\r\n firstModuleIndex,\r\n flattenModules,\r\n nextModuleIndex,\r\n resolveActiveModule,\r\n} from './layout/app-topbar/app-topbar.logic';\r\nexport { FlyTabsComponent, FlyTabComponent } from './layout/tabs/tabs.component';\r\nexport { resolveActiveTab } from './layout/tabs/tabs.logic';\r\nexport { FlyCollapsibleComponent } from './layout/collapsible/collapsible.component';\r\n\r\nexport { FlyControlDirective } from './forms/control.directive';\r\nexport { FlyFieldComponent } from './forms/form-field/form-field.component';\r\nexport { FlyCheckboxComponent } from './forms/checkbox/checkbox.component';\r\nexport { FlySegmentedComponent } from './forms/segmented/segmented.component';\r\nexport { type SegmentedOption, nextSegmentIndex } from './forms/segmented/segmented.logic';\r\nexport { FlyToggleComponent } from './forms/toggle/toggle.component';\r\nexport { FlySliderComponent } from './forms/slider/slider.component';\r\nexport { clampSliderValue, sliderTrackGradient } from './forms/slider/slider.logic';\r\nexport { FlyTagsInputComponent } from './forms/tags-input/tags-input.component';\r\nexport {\r\n applySuggestion,\r\n filterSuggestions,\r\n parseTags,\r\n sameTags,\r\n} from './forms/tags-input/tags-input.logic';\r\nexport { FlyFormGridComponent, FlyFormSectionComponent } from './forms/form-layout.component';\r\nexport { FlyFormFooterComponent } from './forms/form-footer/form-footer.component';\r\nexport { FlyFormBannerComponent, type FormBannerKind } from './forms/form-banner/form-banner.component';\r\nexport { BilingualFieldComponent } from './forms/bilingual-field/bilingual-field.component';\r\n\r\nexport { FlyModalComponent } from './overlays/modal/modal.component';\r\nexport { FlyConfirmDialogComponent } from './overlays/confirm-dialog/confirm-dialog.component';\r\nexport {\r\n type ConfirmKind,\r\n canConfirm,\r\n enterActivatesNatively,\r\n} from './overlays/confirm-dialog/confirm-dialog.logic';\r\nexport { FlyActionMenuComponent } from './overlays/action-menu/action-menu.component';\r\nexport {\r\n type ActionMenuItem,\r\n firstEnabledIndex,\r\n nextEnabledIndex,\r\n} from './overlays/action-menu/action-menu.logic';\r\nexport {\r\n ToastHostComponent,\r\n type ToastAction,\r\n type ToastOptions,\r\n type ToastVariant,\r\n} from './overlays/toast-host/toast-host.component';\r\nexport { FlyToastService, type ToastEntry } from './overlays/toast.service';\r\n","/* eslint-disable max-lines -- skills/coding-conventions.md §1 exempt taxonomy: this is a\r\n * pure re-export barrel (~130 `export … from './lib/…'` lines + one side-effect import, zero\r\n * logic). It grows one line per new DS export, so a line-count cap is endless churn and a\r\n * \"split-on-touch\" carve is meaningless for a barrel. Also path-exempt from the file-size\r\n * guard in tools/conventions-guard/config.yaml — this keeps the ESLint lane in agreement. */\r\n/*\r\n * @flyos/design-system — Public API\r\n * https://www.npmjs.com/package/@flyos/design-system\r\n *\r\n * This is the single entry point for Business / Supporting App developers.\r\n * Import everything from '@flyos/design-system' — never from relative shell paths.\r\n *\r\n * NOTE: This package is published under @flyos/design-system until the @fly\r\n * npm org is created. It will be republished as @fly/design-system once available.\r\n *\r\n * v1.3.0: FlyThemeService (html theme classes), hardened I18nService (AbortSignal, ErrorHandler, RTL helpers).\r\n * v1.3.1: loadBundle normalizes locale JSON (flat or nested objects; rejects invalid leaves).\r\n * v1.3.2: loadBundle returns boolean; LoadBundleOptions.silent skips ErrorHandler on failure.\r\n * v1.3.7: MockAuthService base class + MockAuthConfig for Business App mock auth via fileReplacements.\r\n * User model extended with optional avatar, source, twoFactorEnabled, createdAt fields.\r\n * v1.3.8: AuthService.init() no-op added so Business Apps can call init() in APP_INITIALIZER\r\n * without branching between standalone and embedded modes.\r\n * v1.3.9: MockAuthService field initializers moved into constructor to fix ngDevMode ReferenceError\r\n * when the package is loaded in a production-mode bundle (no ngDevMode global defined).\r\n * v1.4.0: ContextMenuComponent (positioned menu, keyboard nav, focus management) moved from desktop\r\n * shell to design system. MessageBoxService + MessageBoxComponent added (Windows Forms-style\r\n * modal dialogs with localized button labels, focus management, and Escape key support).\r\n * MessageBoxButtons, MessageBoxIcon, DialogResult, MessageBoxOptions, MessageBoxButton exported.\r\n * v1.5.0: SharePanelComponent — generic share/ACL overlay; host supplies API callbacks and optional\r\n * permission level options (file ACL vs note-style View/Edit).\r\n * v1.6.0: SharePanelComponent — `loadOuTree(chartId: string | null)`; optional `loadChartOptions` for\r\n * default vs alternative org charts (OU grants still use real OU ids). `ShareOrgChartOption` exported.\r\n * v1.7.0: SharePanelComponent — `loadChartOptions` and `loadOuLabelMap` are required; chart tree loads after\r\n * options resolve (no spurious null fetch). `loadOuLabelMap` supplies default-tree labels for OU rows.\r\n * v1.8.0: `WindowInstance` optional `contentUiBlocked` / `contentUiBlockMessageKey`; `WindowManagerService`\r\n * `beginContentUiBlock` / `endContentUiBlock` default no-ops; `FlyBlockUiComponent` for shell window overlay.\r\n * v1.10.0: SharePanelComponent — `supportsDeny` input + `isDeny?` on `SharePermissionEntry`. Surfaces an\r\n * \"Add as deny\" toggle in the add-permission row and renders existing deny grants with red\r\n * accent + ban icon. `grantToUser` / `grantToOu` callbacks gain a fourth `isDeny: boolean`\r\n * parameter (additive — existing 3-arg callers won't compile until updated). New locale keys\r\n * `files.share.add_as_deny`, `files.share.deny_help`, `files.share.denied` (en/ar/fr/ur).\r\n * Backed by Files Manager `FilePermission.IsDeny` and Notes `NoteShareLevel.Deny`.\r\n * v2.0.0: BREAKING — `SharePermissionEntry` adopts the `SharePrincipal` discriminated union\r\n * (`{ kind: 'user' | 'role' | 'ou' | 'app-everyone', ... }`) instead of the v1\r\n * `grantedToUserId` / `grantedToOuId` / `grantedToAppId` set-which-is-set fields.\r\n * Hosts must translate domain DTOs to/from the new shape (see\r\n * `file-access-control.component.ts` and `notes.component.ts` for migration patterns).\r\n * The `role` kind is reserved for the planned apps-chart role-as-principal flow;\r\n * hosts should not emit it until the backend's `PermissionResolver` enumerates a\r\n * user's full OU set (direct + computed-from-role memberships).\r\n * v2.1.0: AudienceBuilderComponent — generic <fly-audience-builder> form-control for composing\r\n * a `Fly.Sdk.Core.Audience.AudienceFilter`. TypeScript model (`AudienceFilter`,\r\n * `AudienceTerm` discriminated union, `AUDIENCE_LIMITS`) mirrors the C# polymorphic\r\n * shape byte-for-byte (`kind` discriminator: users/roles/ou/app-everyone/chart/preset).\r\n * Reuses share-panel callback shapes (searchUsers, loadOuTree, loadChartOptions,\r\n * loadRoleOus). Distinct from share-panel: emits `(audienceChange)` + `(validityChange)`\r\n * instead of auto-persisting; hosts save on submit. New `audience.*` locale namespace.\r\n * v2.3.0: Deep-link launch contract — `LAUNCH_CONTEXT` injection token + `LaunchContext`\r\n * type for federated remotes to receive a route + params payload when the host\r\n * opens (or re-opens) their window via a `?app=&route=&params=` URL on the shell.\r\n * Token resolves to `Signal<LaunchContext | null>`; `null` when no host provider.\r\n * Backed by `Fly.Sdk.Core.Apps.IDeepLinkBuilder` for outbound URL generation.\r\n * v2.2.0: AudienceBuilderComponent now implements `ControlValueAccessor` + `Validator` so\r\n * hosts can bind via `formControl` / `formControlName` / `[(ngModel)]`. Existing\r\n * `[value]` + `(audienceChange)` + `(validityChange)` API still works (forms wiring\r\n * is purely additive). `AUDIENCE_PRESETS` const exported for hosts that build their\r\n * own preset pickers. `OuTerm.chartId` and `OuTerm.includeDescendants` are now\r\n * REQUIRED (no longer optional) so wire round-trips are deterministic — emit explicit\r\n * `null` / `boolean` rather than `undefined`. New `AudienceErrorCodes` mirror added.\r\n * v2.4.0: SharePanelComponent + AudienceBuilderComponent — `defaultChartSystemKey` and\r\n * `defaultChartId` inputs let hosts pre-select a specific chart in the OU picker\r\n * without knowing the tenant-scoped Guid. `ShareOrgChartOption` gains an optional\r\n * `systemKey` field so platform-managed charts (`'apps'`, `'default-company'`) are\r\n * identifiable across tenants. New `SHARE_ORG_CHART_SYSTEM_KEY_APPS` /\r\n * `SHARE_ORG_CHART_SYSTEM_KEY_DEFAULT` constants exported.\r\n * v2.5.0: Agent input contracts (Phase 1 of the `<fly-agent-input>` plan) — additive only.\r\n * `AgentCommandRegistry` + `AgentDropRegistry` (singletons via `providedIn: 'root'`,\r\n * shared across federation), `flyAgentDraggable` directive, payload-guard helpers\r\n * (`validateAgentPayload`, `trimAgentPayload`, `trimAgentString`, `utf8ByteLength`),\r\n * and the cross-cutting `FLY_LOCALE_CATALOG` (31 entries, frozen — verbatim port of\r\n * `Fly.Sdk.Core.LanguageDTO[]`). Three RTL flagged: `he-IL`, `ur-IN`, `ar-AE`.\r\n * The catalog's RTL helper is exported as `isRtlLocaleEntry` to avoid colliding with\r\n * the existing `isRtlLocale(lang: string)` from `i18n.service.ts`.\r\n * No UI consumers yet — Phase 2 wires the registries into the shell input component.\r\n * v2.9.0: Federation-safe cross-app deep-linking contract. The shell publishes\r\n * every launch onto a `FLYOS_LAUNCH_EVENT` (`'flyos:launch'`) window\r\n * CustomEvent AND a `globalThis[FlyosPendingLaunchesGlobalKey]` registry,\r\n * both keyed by `appId`. New exports: `FLYOS_LAUNCH_EVENT`,\r\n * `FlyosPendingLaunchesGlobalKey`, `FlyLaunchEventDetail`,\r\n * `FlyosPendingLaunches`. `LAUNCH_CONTEXT` is now documented as\r\n * shell-internal — Native Federation can split the InjectionToken across\r\n * host/remote bundles, so federated remotes must consume the\r\n * event + registry surfaces. See `skills/cross-app-deep-linking.md`.\r\n * Also: new `SourceAppResolver` service + `APP_LOOKUP` adapter token,\r\n * centralising the canonicalization rule that strips `-service` from\r\n * JWT client_ids (`circles-service` → `circles`) so chips, banners,\r\n * and launchers stay consistent across the shell.\r\n * v2.6.0: Agent action bus + flight animator. New imperative sibling to\r\n * `AgentCommandRegistry` / `AgentDropRegistry`: `AgentActionBus` lets\r\n * any app push a typed `AgentAction { verb, payload, dispatch, originRect }`\r\n * to the agent panel without going through drag-drop. `AgentFlightAnimator`\r\n * plays a FLIP-style transform animation from the source DOM rect to the\r\n * registered panel-header rect (hardcoded 420 ms / cubic-bezier; honours\r\n * prefers-reduced-motion). Phase 1 supports `dispatch: 'stage'` only —\r\n * `'auto'` throws `AgentActionUnsupportedDispatchError` until\r\n * `AgentInputComponent.programmaticSubmit` ships. Re-uses\r\n * `AgentDragPayload<T>` as the wire envelope so drag and programmatic\r\n * transports never fork. New verbs: `explain`, `why-empty`,\r\n * `compose-query`, `compare`, `summarize`. (`forecast` was removed —\r\n * no producer ever shipped and the executor aggregates, it doesn't\r\n * extrapolate; see `.workflow/plans/dashboard-analyst-robot-plan.md` §9.)\r\n * v2.10.0: Per-window help-deeplink contract. The shell renders a help-icon\r\n * button in every non-chromeless `<fly-window>` titlebar. By default\r\n * the deeplink uses `win.appId`; apps override or augment via the\r\n * new `WINDOW_HELP_HINT` InjectionToken (a `WritableSignal<WindowHelpHint | null>`)\r\n * provided per-window. `WindowHelpHint` is `{ appId?, topic? }` —\r\n * `topic` is a free-form search-query seed updated dynamically as the\r\n * user navigates within the app. New federation-safe channel\r\n * `FLY_WINDOW_HELP_HINT_EVENT` mirrors the DI surface for federated\r\n * remotes. New exports: `WindowHelpHint`, `WINDOW_HELP_HINT`,\r\n * `FLY_WINDOW_HELP_HINT_EVENT`, `FlyWindowHelpHintEventDetail`.\r\n * Backed by the help-center reader's new `params.topic` launch payload\r\n * and \"no help for this app yet\" empty-state. See\r\n * `skills/help-center.md` and `skills/desktop-shell-angular.md`.\r\n * v2.20.0: Centralized identity gating (Layers 1–3 of the auth-gate hardening).\r\n * `AuthService` is now the single identity source of truth and gains a\r\n * gate surface: `roles`, `isAdmin`, `hasAnyRole()`, plus `expiresAt` /\r\n * `patchProfile()` so host auth services delegate to it instead of\r\n * keeping a private session copy (kills the dual-store drift behind the\r\n * \"admin nav hidden for an admin\" bug). New `FLY_ADMIN_ROLES` const +\r\n * `hasAnyRoleIn` / `normalizeRoles` helpers; `*flyIfRole` / `*flyIfAdmin`\r\n * structural directives (reactive — can't capture a stale verdict);\r\n * `flyRoleGuard(roles)` / `flyAdminGuard` route guards. Layer 2\r\n * regression surface: `isFlyAuthStorePopulated` + `warnIfEmbeddedSessionMissing`.\r\n * All additive. See `skills/business-app-angular-remote.md`.\r\n * v2.21.0: `connectRemoteLaunch({ appId, navigate, enabled })` — federation-safe\r\n * deep-link RECEIVER helper for remote roots; the remote-side counterpart\r\n * of the shell's `connectWindowRoute`. Collapses the hand-rolled\r\n * drain-the-pending-registry + version-dedupe + `FLYOS_LAUNCH_EVENT`\r\n * listener + `DestroyRef` cleanup boilerplate into one constructor call,\r\n * baking in the correct contract (drain-then-delete so no stale entry\r\n * re-applies on re-mount, mandatory `appId` filter, null-route no-op,\r\n * reload-safety via the shell's single-writer republish). Additive — old\r\n * hand-rolled receivers keep working. New exports: `connectRemoteLaunch`,\r\n * `ConnectRemoteLaunchOptions`. See `skills/cross-app-deep-linking.md`.\r\n * v2.5.1: New `MessageBoxService.showAcknowledged()` entry point returning\r\n * `DialogResultWithAcknowledgement` for \"Don't ask again\"-style flows.\r\n * The `dontAskAgain` config (`MessageBoxDontAskAgainConfig`) lives ONLY on\r\n * `MessageBoxOptionsWithAcknowledgement` — the base `MessageBoxOptions`\r\n * no longer carries it, so the type system enforces \"checkbox ⇒ caller\r\n * MUST use `showAcknowledged()`\" and eliminates the silent-discard path\r\n * on `show()`. Existing `show()` callers are unaffected. Case-insensitive\r\n * `findLocaleByDialect` / `findLocaleByPrefix` (BCP-47 §2.1.1). See\r\n * `.workflow/plans/agent-input-component.md` Phase 2b-1.\r\n * v2.24.0: `printConsoleSecurityWarning()` — shared self-XSS DevTools notice,\r\n * previously hand-copied into the desktop shell and admin portal. Only\r\n * prints on production builds (skipped under dev/debug to avoid\r\n * drowning developer logs). Call once from each app's bootstrap/main\r\n * before render. Federated hosts MUST pass `{ isDevBuild }` (their own\r\n * build-time `ngDevMode`): across the federation boundary the bundled\r\n * `isDevMode()` reads the shared `@angular/core` singleton, which\r\n * Native Federation builds with `ngDevMode=false` even under\r\n * `ng serve`, so it would wrongly print on localhost.\r\n * v2.25.0: FlyCronBuilderComponent — generic `<fly-cron-builder>` form-control for\r\n * composing a cron expression from a friendly mode-based UI (every-N-minutes,\r\n * hourly, daily, weekly, monthly) with an `advanced` raw-field escape hatch.\r\n * The control value IS the cron string (`string | null`, `null` = no schedule),\r\n * so it binds via `formControl` / `formControlName` / `[(ngModel)]` and round-\r\n * trips an existing expression on write. Implements `ControlValueAccessor` +\r\n * `Validator` ({ cronInvalid } / { cronRequired }). Targets the Tasks-service\r\n * **Cronos** dialect (5-field standard; opt-in 6-field seconds via `[seconds]`);\r\n * the backend parser stays authoritative — the inline check is a conservative\r\n * client-side approximation. Native, zero runtime deps. New self-sufficient\r\n * `cron.*` baseline-locale namespace (en/ar/fr/ur). Pure `buildCron` / `parseCron`\r\n * / `isValidCron` helpers + `CronMode` / `CronParts` types exported for hosts.\r\n * v2.27.0: Chunk-load self-heal — `provideFlyChunkReloadRecovery()` one-line provider (and the\r\n * underlying `FlyChunkReloadErrorHandler` / `isChunkLoadError` / `reloadOnceForChunkError`\r\n * helpers). Recovers a stale client after a redeploy: a lazy `import()` for a deleted\r\n * content-hashed chunk (webpack, native-import, or es-module-shims/Native-Federation\r\n * error shapes) triggers ONE reload per tab session to pick up the fresh index.html →\r\n * current chunk map. External App standalone builds add it to their `ApplicationConfig`.\r\n * v2.28.0: `MessageBoxComponent` gains an optional `[service]` input. When bound, the\r\n * component renders THAT `MessageBoxService` instance instead of the injected\r\n * root singleton — the mechanism the desktop shell uses to host a WINDOW-SCOPED\r\n * message box: the shell provisions a per-window `MessageBoxService` in each\r\n * window's injector, apps resolve it via DI, and `<fly-window>` hosts\r\n * `<fly-message-box [service]=\"…\">` inside the window chrome so the backdrop is\r\n * clipped to the app window (agent panel, dock, topbar, and other windows stay\r\n * interactive) rather than blanking the whole desktop. Unbound (the shell-global\r\n * host, HTTP-error/notification callers) → the root singleton, full-screen as\r\n * before. Purely additive; existing `<fly-message-box />` usages unchanged.\r\n * v3.3.0: Two new platform surfaces. `FlySurveyFormComponent` (`<fly-survey-form>`) — a\r\n * data-contract-driven renderer for a `FlySurveyFormDefinition` (14 question types),\r\n * with conditional branching (option `linkedQuestionIds` reveal `isBranchTarget`\r\n * questions), per-visible-question required validation (`(validityChange)`), a\r\n * declaration acceptance gate, and a `[readonly]` replay mode. File / Image /\r\n * MultiFile questions surface the raw selection via `(fileSelected)` and emit\r\n * `fileIds` empty — the DS component never touches an upload API. Ships a bundled\r\n * ISO-3166 `FLY_COUNTRIES` list for `Country` questions (zero fetch). New `survey.*`\r\n * baseline-locale namespace (en/ar/fr/ur). `FlyCaptchaComponent` (`<fly-captcha>`) —\r\n * a `ControlValueAccessor` client for the self-hosted `Fly.Sdk.Captcha` proof-of-\r\n * work challenge: brute-forces `n` in `[0, maxNumber)` (chunked on rAF, non-blocking)\r\n * until `sha256HexLower(salt + n)` equals `challenge`, then emits the base64 token\r\n * `CaptchaSolution.FromToken` decodes. Auto-starts on `[challenge]`, handles expiry\r\n * via `(expired)`. New `captcha.*` baseline-locale namespace. Pure helpers\r\n * `flyCaptchaSha256Hex` / `flyCaptchaBase64Utf8` / `flyCaptchaBuildToken` exported.\r\n *\r\n * ── Theming (same release; VISIBLE CHANGES, no code edit required) ──\r\n * `--accent` (#9333EA) is now the single knob the whole accent system derives from, and\r\n * `FlyThemeService.applyAccent(color | null)` re-skins the platform at runtime — the\r\n * tenant/user branding hook. It writes an INLINE `--accent` on <html>, so it outranks the\r\n * theme classes and survives `applyTheme()`. Returns false and keeps the previous accent\r\n * if the value is not a colour (`isAccentColor` = structural charset + url() ban, then\r\n * `CSS.supports`) — the value typically comes from config, and a custom property would\r\n * otherwise swallow `url(...)` whole. Custom properties are document-scoped, so ONE write\r\n * re-skins a remote too: no per-app plumbing.\r\n *\r\n * `--primary-color` is now DEFINED (as `var(--accent)`). It never was, so every\r\n * `var(--primary-color, <fallback>)` shipped its fallback and the platform rendered seven\r\n * different accents at once (#E8732A orange most often, plus #3b82f6 / #0071e3 / #6366f1).\r\n * **Consumers relying on that accidental colour will now render purple** — including\r\n * anything that inherited emoji-picker / markdown-editor / symbol-picker / fly-select\r\n * chrome. `--accent-soft` / `--focus-ring` derive via color-mix; `--accent-orange` now\r\n * aliases `--system-orange` (it is a semantic status colour, not the brand).\r\n *\r\n * New global partials, both auto-included via `@use 'fly-theme'` — no import to add:\r\n * - `scss/_native-select.scss` — repaints native `<select>` popups with Canvas/CanvasText\r\n * so the OS listbox follows the theme instead of rendering white-on-white on dark.\r\n * **Do not pin `color-scheme` locally** — that fights the inherited value and breaks\r\n * the opposite theme. Prefer `<fly-select>`, which renders its own panel.\r\n * - `scss/_menu-anchor.scss` — paints the `[data-fly-menu-open]` state that\r\n * `fly-context-menu` now stamps on its `[anchor]`.\r\n *\r\n * `fly-context-menu`: new `[anchor]` + `[align]` ('start' | 'end') for dropdown-style\r\n * menus — the DS derives position, measures its own width, resolves align against the\r\n * anchor's computed direction (RTL free), clamps to the anchor's containing box (NOT the\r\n * viewport, which is no bound inside a windowed shell) and flips on overflow. It also sets\r\n * aria-expanded / aria-haspopup on the anchor. `[x]`/`[y]` are unchanged for pointer menus\r\n * and are now optional.\r\n *\r\n * `fly-select`: chrome inputs (placeholder, searchPlaceholder, noResultsLabel,\r\n * selectAllLabel, deselectAllLabel, clearLabel, summaryFormatter) changed from\r\n * `string`/fn defaults to `string | null` = \"use the localized `select.*` baseline\"\r\n * (en/ar/fr/ur). Passing them still wins; **omit them now** — they used to default to\r\n * hardcoded English, so searchable selects read \"Search…\" under ar/fr/ur. Only breaks code\r\n * that READS those signals and assumed a non-null string. New `select.*` baseline keys.\r\n *\r\n * `fly-survey-form`: every SingleSelect renders via `<fly-select>` now (`hasSearch` gates\r\n * only the panel's search box, not the control), so no native `<select>` remains. New\r\n * `[hideSubmit]` hides the submit button while leaving controls live (author preview).\r\n * v3.5.0: Standalone-auth vertical + federation factory + shared fonts (all additive).\r\n * `provideFlyStandaloneAuth({ appId, scope? })` — the one-line standalone PKCE / BFF auth\r\n * wiring FlyOS External Apps used to copy verbatim (auth.service + guard + interceptor +\r\n * callback). Ships `FlyStandaloneAuthService` (PKCE authorize/callback code-exchange against\r\n * `/api/{appId}/auth/*` + the STS, single-flight silent refresh via the HttpOnly-cookie BFF,\r\n * `startLogin({ prompt, maxAge })` for step-up re-auth; delegates identity to the shared\r\n * `AuthService` store; init is a no-op when embedded — `WINDOW_DATA` present),\r\n * `flyStandaloneAuthGuard`, `flyStandaloneAuthInterceptor`,\r\n * `FlyStandaloneAuthCallbackComponent`, and `FLY_STANDALONE_AUTH_CONFIG`. The provider also\r\n * supplies `STEP_UP_REAUTH_HANDLER` so the existing `StepUpService` drives re-auth. New pure\r\n * `stepUpReturnKey(appId?)` helper (appId-scoped step-up return key) + `auth.callback.*`\r\n * baseline-locale namespace (en/ar/fr/ur). Shipped-with-the-package (not a TS export):\r\n * `federation/with-fly-federation.cjs` exporting `withFlyFederation({ name, exposes,\r\n * extraShared?, extraSkip? })` — the canonical Native Federation shared block; and\r\n * `ui-fonts/` (self-hosted Geist + primeicons) for apps to consume via an angular.json assets\r\n * glob. See `lib/auth/standalone/README.md`.\r\n * v3.6.0: `FlyCommentThreadComponent` (`<fly-comment-thread>`) — a generic, transport-agnostic\r\n * threaded-comments renderer for the `comments` core-app REST contract. Nested replies load\r\n * lazily on expand (never eager-load-all), each depth pages independently, and the host owns\r\n * HTTP + optimistic-insert reconciliation + any live-update channel — the component only\r\n * renders `[rootPage]` / `[repliesByParent]` and emits typed requests (`loadReplies`,\r\n * `loadMore`, `submit`, `edit`, `delete`, `report`, `lockToggle`). Tombstone rendering for\r\n * soft-deleted comments; a typed report-with-reason dialog (`FlyCommentReportReason` mirrors\r\n * the backend enum); moderator affordances (thread lock/unlock, delete-any) gated by the\r\n * per-comment `canModerate` flag and the additive `[canModerateThread]` input. New `comment.*`\r\n * baseline-locale namespace (en/ar/fr/ur).\r\n * v3.8.0: `FlyWindowTitleService` (`forWindow(windowId, appId?).setTitle(title|null)`) +\r\n * `FLY_WINDOW_PAGE_TITLE_EVENT` / `FlyWindowPageTitleEventDetail` — the publisher twin\r\n * of the shell's `DocumentTitleService`, which is the SINGLE writer of `document.title`.\r\n * Any app (in-shell or federated remote) sets its browser-tab title the same way; the\r\n * shell reflects the focused window's title (baseline = app name) and honours per-page\r\n * overrides. Fixes federated remotes being unable to drive the tab (their Angular `Title`\r\n * writes to a DOM adapter that isn't the host's real `document`). Standalone falls back to\r\n * `document.title` directly, so the one call works in both modes. Pairs with\r\n * `FLY_WINDOW_HELP_HINT_EVENT`.\r\n * v3.11.0: UI-primitive consolidation — the layer every app was rebuilding. An audit of\r\n * Circles, GRC, and Thoughts found the same `app/ui/` folder reimplemented in\r\n * two of them (GRC was reference-copied from Circles, so the duplication is\r\n * baked into the External-App scaffold rather than being organic drift), while\r\n * only two or three DS widgets were consumed. These are the promoted\r\n * primitives. All additive — nothing existing changes shape.\r\n *\r\n * **Overlays** — `overlayStack` / `OverlayStack` / `OverlayHandle`: the\r\n * document-wide Escape-arbitration stack, so a confirm-over-drawer takes two\r\n * Escapes to unwind instead of collapsing the pile on the first. Pairs with\r\n * `FlyClickOutsideDirective` (`flyClickOutside`, hoisted from the desktop\r\n * shell) for pointer dismissal — `pointerdown` + `composedPath()` containment,\r\n * immune to z-index, stacking contexts, and the `backdrop-filter` containing\r\n * blocks that silently clamp `position: fixed` backdrops in the shell's glass\r\n * chrome. `captureFocus` / `restoreFocus` complete the set, guarding the\r\n * removed-while-open and disabled-while-open cases that naive\r\n * `restoreFocusTo.focus()` misses. Three separate primitives on purpose: a\r\n * lightweight dropdown takes only the piece it needs.\r\n *\r\n * **Debounce** — `FlyDebouncer` (with `cancel` / `flush` / `setDelay`) and the\r\n * `flyDebounced()` injection-context factory that binds cancellation to\r\n * `DestroyRef`. Replaces ~20 hand-rolled `setTimeout` pairs across Circles and\r\n * GRC, most of which never cleared on destroy and so could fire against a torn-\r\n * down component. `FLY_SEARCH_DEBOUNCE_MS` (300) / `FLY_RELOAD_DEBOUNCE_MS` (150).\r\n *\r\n * **`FlySearchInputComponent`** (`<fly-search-input>`) — the debounced filter\r\n * box; `[(value)]` is the live text, `(queryChange)` the settled query (named\r\n * so because `search` is a native DOM event). Enter flushes the pending\r\n * debounce before emitting `(submitted)`, so a host never acts on the previous\r\n * query; Escape clears but only swallows the key when there is text to clear,\r\n * so a search box inside a drawer doesn't trap Escape and break the overlay's\r\n * own dismiss. Deliberately NOT a `ControlValueAccessor` — it has two\r\n * meaningfully different values (live text vs settled query) and a form control\r\n * has one. New `search.*` baseline-locale keys (en/ar/fr/ur).\r\n *\r\n * **Formatting** — `flyCompactNumber` / `flyFullNumber` / `flyDecimalNumber` /\r\n * `flySignedCompact` / `flyFormatBytes` / `flyRelativeTime` / `flyDuration` /\r\n * `flyFormatDate` / `flyFormatTime` / `flyFormatDateTime` / `flyToDateOnly`,\r\n * plus `| flyCompact`, `| flyFull`, `| flyDecimal`, `| flyBytes`,\r\n * `| flyRelativeTime`, `| flyDuration`, `| flyDate`, `| flyTime`,\r\n * `| flyDateTime`. This is a **correctness** surface, not a convenience one:\r\n * the code it replaces concatenates hardcoded English units (\"1.4 MB\", \"5m\r\n * ago\") or reads the *browser's* locale instead of the app's, both of which\r\n * render wrong under `ar`/`ur` on an i18n-mandatory platform. All `Intl`-backed\r\n * and locale-explicit. The pipes are **pure** — pass the locale signal\r\n * (`| flyBytes: i18n.locale()`) in any view that must re-render on a live\r\n * language toggle. Byte sizes are base-1024 with SI symbols (\"1 kB\", matching\r\n * Explorer/Finder, since `Intl` has no binary-prefix units) and spell out raw\r\n * bytes so they pluralize and localize (\"482 bytes\" / \"482 octets\").\r\n *\r\n * **Keyboard navigation** — headless, not components: `flyNextEnabledIndex`\r\n * (vertical menu roving focus, wrap + skip-disabled + Home/End),\r\n * `flyNextSegmentIndex` (radiogroup, with RTL mirroring of horizontal arrows),\r\n * `flyFirstEnabledIndex`, `flyResolveActiveTab` (stale-selection fallback).\r\n * Shipping the decision layer alone lets an app adopt correct behaviour without\r\n * adopting our DOM — the difference between a primitive that gets used and one\r\n * that gets reimplemented.\r\n *\r\n * **`flyDownloadBlob` / `flyExportFileName`** — the cross-browser blob-save\r\n * dance. Carries the WebKit fix the copies in the estate lack: revoking the\r\n * object URL synchronously (or on a ~1s timer) works in Chromium but makes\r\n * Safari abandon the `download` hint and *navigate* to the blob URL, saving a\r\n * GUID-named, extension-less file. Cleanup is deferred well past download\r\n * initiation. Do not tune that delay down.\r\n *\r\n * Also in this release: `FlyTooltipDirective` now schedules its hover delay and\r\n * measure pass via `NgZone.runOutsideAngular`. In-zone timers turned a mouse\r\n * sweep across a dense toolbar into a burst of full change-detection cycles —\r\n * the shell's weather widget alone carries 30 tooltips. No API change.\r\n * v3.12.0: `FlyBreadcrumbComponent` (`<fly-breadcrumb>`) — ordered ancestor trail; the\r\n * last item always renders as plain text with `aria-current=\"page\"` (never a\r\n * link, even if it carries `href`). Past `[maxVisible]` (default 4) the middle\r\n * collapses into one non-interactive \"…\" crumb, keeping the first item and the\r\n * last two. Separator is a rotated-border chevron (not a hardcoded \"/\" or \"›\"),\r\n * so it mirrors under RTL with one selector. New `breadcrumb.*` baseline-locale\r\n * namespace (en/ar/fr/ur). Companion navigation/layout primitives from the same\r\n * wave: `FlyTreeNavComponent` (`<fly-tree-nav>`) and `FlyCardGridComponent`\r\n * (`<fly-card-grid>`, container-driven `auto-fill` columns, no breakpoints).\r\n * v3.14.2: REMOVED — `FlyCardComponent` (`<fly-card>`, input-based), `FlyPaginationComponent`\r\n * (`<fly-pagination>`), `FlySegmentedTabsComponent` (`<fly-segmented-tabs>`,\r\n * with `FlySegmentedTabItem`) and `FlyEmptyStateComponent` (`<fly-empty-state>`,\r\n * with `FlyEmptyStateSize`). All four were superseded by the app-surface kit\r\n * absorbed from Circles in v3.14.0 (`./lib/app-surface`, re-exported below):\r\n * the kit ships `fly-card` (slot-based, same selector AND class name — the two\r\n * could not coexist in one build), `fly-pagination` (same selector and class),\r\n * `fly-segmented` / `fly-tabs` (whose `segmented.logic` / `tabs.logic` are the\r\n * originals the removed wrapper copied), and `fly-state-message`. The kit is the\r\n * published, Circles-consumed surface, so keeping a renamed twin alongside it\r\n * would be exactly the duplication `skills/rad-platform-mindset.md` forbids.\r\n * Migration: `fly-card` inputs → `<fly-card-title>` / `<fly-card-meta>` slots\r\n * inside a `role=\"list\"` container (`interactive` now defaults **true**; there\r\n * is no `href` mode — use `(activated)`); `fly-pagination` `[total]`/`[pageSize]`\r\n * → `[totalPages]` + a caller-computed `[rangeText]`; `fly-segmented-tabs`\r\n * `[tabs]`/`[(selectedId)]` → `fly-segmented` `[options]` (`{value,labelKey,count}`)\r\n * + `[(value)]`; `fly-empty-state` → `fly-state-message` `[kind]`/`[messageKey]`.\r\n * The `pagination.*` baseline-locale namespace went with them (the kit uses\r\n * `ui.pagination.*`); `breadcrumb.*` and `tree_nav.*` remain.\r\n * See docs/ExternalAppsGuide/03-frontend-app.md.\r\n */\r\n\r\n// ─── Federation singleton self-check (side effect; must run first) ───────────\r\n// Loud console.error if a federated remote forks its own DS copy instead of\r\n// binding to the shell's shared singleton. See the module doc.\r\nimport './lib/fly-federation-singleton-guard';\r\n\r\n// ─── Models ──────────────────────────────────────────────────────────────────\r\nexport type { DesktopApp, DesktopAppKind, DesktopAppCategory } from './lib/models/app.model';\r\nexport type {\r\n WindowInstance,\r\n WindowState,\r\n ChildWindowData,\r\n LaunchContext,\r\n FlyLaunchEventDetail,\r\n FlyosPendingLaunches,\r\n FlyLaunchRequestDetail,\r\n FlyRemoteRouteEventDetail,\r\n WindowHelpHint,\r\n FlyWindowHelpHintEventDetail,\r\n FlyWindowPageTitleEventDetail,\r\n} from './lib/models/window.model';\r\nexport {\r\n WINDOW_DATA,\r\n LAUNCH_CONTEXT,\r\n FLYOS_LAUNCH_EVENT,\r\n FlyosPendingLaunchesGlobalKey,\r\n FLYOS_LAUNCH_REQUEST_EVENT,\r\n FlyosShellHandlesLaunchRequestsGlobalKey,\r\n FLYOS_REMOTE_ROUTE_EVENT,\r\n FlyosShellOwnsHistoryGlobalKey,\r\n WINDOW_HELP_HINT,\r\n FLY_WINDOW_HELP_HINT_EVENT,\r\n FLY_WINDOW_PAGE_TITLE_EVENT,\r\n} from './lib/models/window.model';\r\nexport type { User } from './lib/models/user.model';\r\n\r\nexport type {\r\n SharePermissionEntry,\r\n SharePrincipal,\r\n SharePrincipalKind,\r\n UserPrincipal,\r\n RolePrincipal,\r\n OuPrincipal,\r\n AppEveryonePrincipal,\r\n ShareUserResult,\r\n ShareOuNode,\r\n ShareOrgChartOption,\r\n SharePanelLevelOption,\r\n} from './lib/models/share-panel.model';\r\nexport {\r\n SHARE_ORG_CHART_SYSTEM_KEY_DEFAULT,\r\n SHARE_ORG_CHART_SYSTEM_KEY_APPS,\r\n} from './lib/models/share-panel.model';\r\n\r\n// ─── Audience Targeting ──────────────────────────────────────────────────────\r\nexport type {\r\n AudienceFilter,\r\n AudienceTerm,\r\n AudienceTermKind,\r\n UsersTerm,\r\n RolesTerm,\r\n OuTerm,\r\n AppEveryoneTerm,\r\n ChartTerm,\r\n PresetTerm,\r\n AudiencePresetKind,\r\n AudienceOptions,\r\n} from './lib/models/audience.model';\r\nexport {\r\n AUDIENCE_LIMITS,\r\n AUDIENCE_TERM_KINDS,\r\n AUDIENCE_PRESETS,\r\n} from './lib/models/audience.model';\r\n\r\n/**\r\n * Stable error codes returned by audience-aware backend endpoints. Mirror of\r\n * `Fly.Sdk.Core.Audience.AudienceErrorCodes`. Compare on these strings, not on HTTP\r\n * status, so localized messages can change without breaking integrations.\r\n */\r\nexport const AUDIENCE_ERROR_CODES = {\r\n invalidFilter: 'INVALID_AUDIENCE_FILTER',\r\n audienceTooLarge: 'AUDIENCE_TOO_LARGE',\r\n resolverUnavailable: 'AUDIENCE_RESOLVER_UNAVAILABLE',\r\n invalidAudienceKind: 'INVALID_AUDIENCE_KIND',\r\n} as const;\r\nexport type AudienceErrorCode =\r\n (typeof AUDIENCE_ERROR_CODES)[keyof typeof AUDIENCE_ERROR_CODES];\r\n\r\nexport type { AudienceEditTarget } from './lib/components/audience-builder/audience-builder.component';\r\n\r\n// ─── Remote App Registration ─────────────────────────────────────────────────\r\nexport type { RemoteAppDef } from './lib/models/remote-app.model';\r\n\r\n// ─── Auth: identity store + role gating ──────────────────────────────────────\r\nexport { AuthService } from './lib/services/auth.service';\r\nexport {\r\n FLY_ADMIN_ROLES,\r\n hasAnyRoleIn,\r\n normalizeRoles,\r\n} from './lib/auth/fly-roles';\r\nexport {\r\n FlyIfRoleDirective,\r\n FlyIfAdminDirective,\r\n} from './lib/directives/fly-if-role.directive';\r\nexport { flyRoleGuard, flyAdminGuard } from './lib/auth/fly-role.guard';\r\nexport {\r\n isFlyAuthStorePopulated,\r\n warnIfEmbeddedSessionMissing,\r\n type FlyAuthStoreReadable,\r\n type EmbeddedSessionProbe,\r\n} from './lib/auth/fly-auth-contract';\r\n\r\n// ─── Auth: step-up (MFA re-auth) ──────────────────────────────────────────\r\nexport {\r\n STEP_UP_CODE,\r\n STEP_UP_RETURN_KEY,\r\n stepUpReturnKey,\r\n parseStepUpChallenge,\r\n type StepUpChallenge,\r\n} from './lib/auth/step-up/step-up.logic';\r\nexport {\r\n StepUpService,\r\n STEP_UP_REAUTH_HANDLER,\r\n type StepUpReauthHandler,\r\n type StepUpReauthRequest,\r\n} from './lib/auth/step-up/step-up.service';\r\nexport { stepUpInterceptor } from './lib/auth/step-up/step-up.interceptor';\r\n\r\n// ─── Auth: standalone PKCE / BFF vertical (provideFlyStandaloneAuth) ───────\r\n// The shared one-line standalone-auth wiring for FlyOS External Apps — the canonical port of the\r\n// auth.service/guard/interceptor/callback each app used to copy verbatim. No-op when embedded in the\r\n// shell (the shell owns identity). See the auth/standalone README.\r\nexport {\r\n FLY_STANDALONE_AUTH_CONFIG,\r\n type FlyStandaloneAuthConfig,\r\n} from './lib/auth/standalone/fly-standalone-auth.config';\r\nexport { FlyStandaloneAuthService } from './lib/auth/standalone/fly-standalone-auth.service';\r\nexport { flyStandaloneAuthGuard } from './lib/auth/standalone/fly-standalone-auth.guard';\r\nexport { flyStandaloneAuthInterceptor } from './lib/auth/standalone/fly-standalone-auth.interceptor';\r\nexport { FlyStandaloneAuthCallbackComponent } from './lib/auth/standalone/fly-standalone-auth-callback.component';\r\nexport { provideFlyStandaloneAuth } from './lib/auth/standalone/provide-fly-standalone-auth';\r\n\r\n// ─── Realtime / live auth-refresh (shared across shell + External Apps) ──────\r\nexport { FlyHubClient } from './lib/realtime/fly-hub-client';\r\nexport type { FlyAuthRefreshPayload } from './lib/realtime/fly-hub-client';\r\nexport { FlyAuthLiveRefresh } from './lib/realtime/fly-auth-live-refresh';\r\nexport type { FlyLiveRefreshOptions } from './lib/realtime/fly-auth-live-refresh';\r\n\r\n// ─── Services ────────────────────────────────────────────────────────────────\r\nexport type { LoadBundleOptions } from './lib/services/i18n.service';\r\nexport { I18nService, RTL_LOCALE_SET, isRtlLocale } from './lib/services/i18n.service';\r\n// Built-in DS component strings (lowest-priority I18nService layer). Exported so a\r\n// standalone consumer can introspect/extend the keys DS components rely on.\r\nexport { DS_BASELINE_LOCALES } from './lib/i18n/baseline-locales';\r\nexport {\r\n FlyThemeService,\r\n type FlyThemeMode,\r\n DEFAULT_FLY_THEME_MODE,\r\n FLY_ACCENT_PROPERTY,\r\n FLY_THEME_MODE_IDS,\r\n isAccentColor,\r\n normalizeFlyTheme,\r\n} from './lib/services/fly-theme.service';\r\nexport {\r\n WindowManagerService,\r\n StandaloneWindowManagerService,\r\n type OpenWindowOptions,\r\n} from './lib/services/window-manager.service';\r\nexport { FlyRemoteRouter } from './lib/services/fly-remote-router.service';\r\nexport {\r\n requestAppLaunch,\r\n type RequestAppLaunchOptions,\r\n} from './lib/services/request-app-launch';\r\nexport {\r\n connectRemoteLaunch,\r\n type ConnectRemoteLaunchOptions,\r\n} from './lib/services/connect-remote-launch';\r\nexport {\r\n FlyRemoteContextService,\r\n type FlyRemoteContext,\r\n FLY_REMOTE_CONTEXT_STORE_KEY,\r\n FLY_REMOTE_CONTEXT_EVENT,\r\n} from './lib/services/fly-remote-context.service';\r\nexport {\r\n SourceAppResolver,\r\n APP_LOOKUP,\r\n type AppLookup,\r\n type AppLookupEntry,\r\n} from './lib/services/source-app-resolver.service';\r\nexport { FlyWindowHelpService, type FlyWindowHelpPublisher } from './lib/services/fly-window-help.service';\r\nexport { FlyWindowTitleService, type FlyWindowTitlePublisher } from './lib/services/fly-window-title.service';\r\nexport {\r\n loadRemoteStyles,\r\n unloadRemoteStyles,\r\n} from './lib/services/fly-remote-styles';\r\nexport {\r\n FLY_REMOTE_ROUTES,\r\n FLY_REMOTE_BASE_PATH,\r\n type FlyRemoteRoute,\r\n type FlyRemoteMatch,\r\n matchFlyRoutePattern,\r\n} from './lib/services/fly-remote-router.types';\r\nexport { FlyRemoteRouterOutletComponent } from './lib/components/remote-router-outlet/remote-router-outlet.component';\r\n\r\n// ─── Pipes ───────────────────────────────────────────────────────────────────\r\nexport { TranslatePipe } from './lib/pipes/translate.pipe';\r\n\r\n// ─── Mock Auth (for fileReplacements in dev/mock builds) ─────────────────────\r\nexport { MockAuthService, type MockAuthConfig } from './lib/services/auth.service.mock';\r\n\r\n// ─── Components ──────────────────────────────────────────────────────────────\r\nexport { EntityLookupComponent } from './lib/components/entity-lookup/entity-lookup.component';\r\nexport { type EntityLinkSelection } from './lib/components/entity-lookup/entity-lookup.types';\r\n\r\n// NOTE: the rich-text editing surface (fly-markdown-editor, fly-chat-composer,\r\n// fly-symbol-picker, the Tiptap extensions and the bilingual markdown field) now\r\n// lives in the sibling package `@flyos/design-system-editor` — it carries the\r\n// Tiptap/KaTeX stack, which only editor-using apps should pay for.\r\n\r\n// Reusable emoji / marker picker over a curated work-emoji catalogue — used for tagging nodes,\r\n// cards and documents. Hosts persist the ENTRY ID (never the glyph, never a toned glyph) and render\r\n// it back through `flyEmojiFor(id, tone)`; ids are a frozen contract, see `emoji-catalog.ts`.\r\nexport {\r\n FlyEmojiPickerComponent,\r\n type FlyEmojiCell,\r\n type FlyEmojiSection,\r\n type FlyEmojiPickerTab,\r\n type FlyEmojiPickerSize,\r\n} from './lib/components/emoji-picker/emoji-picker.component';\r\n// Animated emoji — OPT-IN. Everything below is inert unless a consumer installs\r\n// `@flyos/design-system-emoji-pack` and calls `provideFlyEmojiPack()`; the picker's\r\n// default `emojiAnimation=\"off\"` never touches the token.\r\nexport { FlyAnimatedEmojiComponent } from './lib/components/animated-emoji/animated-emoji.component';\r\nexport {\r\n FLY_EMOJI_PACK,\r\n FLY_EMOJI_PACK_MISSING_MESSAGE,\r\n provideFlyEmojiPack,\r\n flyEmojiPackUrl,\r\n type FlyEmojiPack,\r\n type FlyEmojiPackEntry,\r\n type FlyEmojiPackManifest,\r\n} from './lib/components/emoji-picker/emoji-pack';\r\nexport {\r\n FLY_EMOJI_CATEGORIES,\r\n FLY_EMOJI_CATEGORY_BY_ID,\r\n FLY_EMOJI_DEFAULT_CATEGORIES,\r\n FLY_EMOJI_BY_ID,\r\n FLY_EMOJI_PREVIEW_COUNT,\r\n FLY_SKIN_TONES,\r\n applySkinTone,\r\n flyEmojiFor,\r\n flyEmojiIsTonable,\r\n flySkinToneLabelKey,\r\n type FlyEmojiCategory,\r\n type FlyEmojiEntry,\r\n type FlySkinTone,\r\n} from './lib/components/emoji-picker/emoji-catalog';\r\n\r\nexport {\r\n ContextMenuComponent,\r\n type ContextMenuAlign,\r\n type ContextMenuItem,\r\n type ContextMenuSection,\r\n} from './lib/components/context-menu/context-menu.component';\r\n\r\nexport {\r\n MessageBoxComponent,\r\n} from './lib/components/message-box/message-box.component';\r\n\r\nexport {\r\n MessageBoxService,\r\n MessageBoxButtons,\r\n MessageBoxIcon,\r\n DialogResult,\r\n type MessageBoxOptions,\r\n type MessageBoxOptionsWithAcknowledgement,\r\n type MessageBoxDontAskAgainConfig,\r\n type MessageBoxButton,\r\n type DialogResultWithAcknowledgement,\r\n} from './lib/components/message-box/message-box.service';\r\n\r\nexport {\r\n SharePanelComponent,\r\n SHARE_PANEL_DEFAULT_FILE_LEVELS,\r\n type RoleOuLookupRow,\r\n} from './lib/components/share-panel/share-panel.component';\r\n\r\nexport {\r\n AudienceBuilderComponent,\r\n} from './lib/components/audience-builder/audience-builder.component';\r\n\r\nexport { FlyBlockUiComponent } from './lib/components/block-ui/block-ui.component';\r\n\r\n// ─── Card grid (container-driven responsive grid for `fly-card`) ────────────\r\n// The card itself is the app-surface kit's `FlyCardComponent` (slot-based),\r\n// re-exported from `./lib/app-surface` below.\r\nexport { FlyCardGridComponent } from './lib/components/card-grid/card-grid.component';\r\n\r\n// ─── Breadcrumb (ordered ancestor trail, overflow-collapsing) ───────────────\r\nexport {\r\n FlyBreadcrumbComponent,\r\n type FlyBreadcrumbItem,\r\n} from './lib/components/breadcrumb/breadcrumb.component';\r\n\r\n// ─── Tree nav (two-level disclosure navigation list — sections + pages) ─────\r\nexport { FlyTreeNavComponent } from './lib/components/tree-nav/tree-nav.component';\r\nexport { type FlyTreeNavNode } from './lib/components/tree-nav/tree-nav.types';\r\n\r\nexport {\r\n FlySkeletonComponent,\r\n type FlySkeletonShape,\r\n type FlySkeletonLayout,\r\n type FlySkeletonAnimation,\r\n} from './lib/components/skeleton/skeleton.component';\r\n\r\nexport {\r\n FlyDrawerComponent,\r\n type FlyDrawerSize,\r\n type FlyDrawerSide,\r\n} from './lib/components/drawer/drawer.component';\r\n\r\n// ─── File Upload Components ─────────────────────────────────────────────────\r\nexport type { FlyFileInfo } from './lib/models/file.model';\r\n\r\nexport { FlyImageUploadComponent } from './lib/components/image-upload/image-upload.component';\r\n\r\nexport { FlyFileUploadComponent } from './lib/components/file-upload/file-upload.component';\r\n\r\nexport { FlySelectComponent } from './lib/components/select/select.component';\r\nexport {\r\n type FlySelectOption,\r\n type FlySelectValue,\r\n} from './lib/components/select/select.types';\r\n\r\n// ─── Async typeahead (fly-typeahead) ─────────────────────────────────────────\r\nexport { FlyTypeaheadComponent } from './lib/components/typeahead/typeahead.component';\r\nexport { type FlyTypeaheadOption } from './lib/components/typeahead/typeahead.types';\r\n\r\n// ─── Cron expression builder ──────────────────────────────────────────────────\r\nexport { FlyCronBuilderComponent } from './lib/components/cron-builder/cron-builder.component';\r\nexport {\r\n CRON_MODES,\r\n CRON_WEEKDAYS,\r\n type CronMode,\r\n type CronWeekday,\r\n type CronParts,\r\n type CronAdvancedFieldDef,\r\n} from './lib/components/cron-builder/cron-builder.types';\r\nexport {\r\n buildCron,\r\n parseCron,\r\n isValidCron,\r\n isValidSingleField,\r\n} from './lib/components/cron-builder/cron-builder.utils';\r\n\r\n// ─── Gantt chart (fly-gantt) ─────────────────────────────────────────────────\r\nexport { FlyGanttComponent } from './lib/components/gantt/gantt.component';\r\nexport {\r\n type GanttRow,\r\n type GanttRowKind,\r\n type GanttDependency,\r\n type GanttZoom,\r\n type GanttRowDatesChange,\r\n type GanttDependencyCreate,\r\n GANTT_ZOOMS,\r\n} from './lib/components/gantt/gantt.types';\r\n\r\n// ─── Dynamic form (fly-dynamic-form) ─────────────────────────────────────────\r\n// The generalised, domain-agnostic form renderer. `fly-survey-form` (below) is a\r\n// backward-compatible alias of this same component.\r\nexport { FlyDynamicFormComponent } from './lib/components/dynamic-form/dynamic-form.component';\r\nexport type {\r\n FlyFormQuestionType,\r\n FlyFormOption,\r\n FlyFormFieldOptions,\r\n FlyFormQuestion,\r\n FlyFormDefinition,\r\n FlyFormScoreDisplay,\r\n FlyFormAnswerValue,\r\n FlyFormAnswer,\r\n FlyFileSelection,\r\n} from './lib/components/dynamic-form/dynamic-form.types';\r\nexport { FLY_COUNTRIES, type FlyCountry } from './lib/components/dynamic-form/countries';\r\n\r\n// ─── Survey form (fly-survey-form) — retained alias of fly-dynamic-form ───────\r\nexport { FlySurveyFormComponent } from './lib/components/dynamic-form/survey-form-alias';\r\nexport type {\r\n FlySurveyQuestionType,\r\n FlySurveyFormOption,\r\n FlySurveyFormFieldOptions,\r\n FlySurveyFormQuestion,\r\n FlySurveyFormDefinition,\r\n FlySurveyFormAnswerValue,\r\n FlySurveyFormAnswer,\r\n FlySurveyFileSelection,\r\n} from './lib/components/dynamic-form/survey-form-alias';\r\n\r\n// ─── Comment thread (fly-comment-thread) ─────────────────────────────────────\r\nexport { FlyCommentThreadComponent } from './lib/components/comment-thread/comment-thread.component';\r\nexport type {\r\n FlyComment,\r\n FlyCommentPage,\r\n FlyCommentReportReason,\r\n FlyCommentReportStatus,\r\n FlyCommentLoadRepliesRequest,\r\n FlyCommentLoadMoreRequest,\r\n FlyCommentSubmitRequest,\r\n FlyCommentEditRequest,\r\n FlyCommentDeleteRequest,\r\n FlyCommentReportRequest,\r\n FlyCommentLockToggleRequest,\r\n} from './lib/components/comment-thread/comment-thread.types';\r\n\r\n// ─── Captcha (fly-captcha) — Fly.Sdk.Captcha PoW solver ───────────────────\r\nexport { FlyCaptchaComponent } from './lib/components/captcha/captcha.component';\r\nexport {\r\n flyCaptchaSha256Hex,\r\n flyCaptchaBase64Utf8,\r\n flyCaptchaBuildToken,\r\n} from './lib/components/captcha/captcha.component';\r\nexport type {\r\n FlyCaptchaChallenge,\r\n FlyCaptchaSolution,\r\n FlyCaptchaState,\r\n} from './lib/components/captcha/captcha.types';\r\n\r\n// ─── Agent input — registries, directives, types (Phase 1) ──────────────────\r\nexport {\r\n AgentCommandRegistry,\r\n AgentLookupRegistry,\r\n AgentDropRegistry,\r\n AgentActionBus,\r\n AgentFlightAnimator,\r\n} from './lib/services/agent-input';\r\n\r\nexport type {\r\n AgentAction,\r\n AgentActionVerb,\r\n AgentActionDispatch,\r\n} from './lib/models/agent-action.model';\r\n\r\nexport { AgentActionUnsupportedDispatchError } from './lib/models/agent-action.model';\r\n\r\nexport { FlyAgentDraggableDirective } from './lib/directives/fly-agent-draggable.directive';\r\nexport {\r\n FlySecureSrcDirective,\r\n type FlySecureSrcState,\r\n} from './lib/directives/fly-secure-src.directive';\r\n\r\n// ─── Tooltip directive (body-parented, theme-aware, a11y hover/focus tip) ────\r\nexport {\r\n FlyTooltipDirective,\r\n type FlyTooltipPlacement,\r\n} from './lib/directives/fly-tooltip.directive';\r\n\r\nexport {\r\n AGENT_DRAG_MIME,\r\n AGENT_PAYLOAD_VERSION,\r\n SUPPORTED_AGENT_PAYLOAD_VERSIONS,\r\n DEFAULT_AGENT_PAYLOAD_LIMITS,\r\n} from './lib/models/agent-input.model';\r\n\r\nexport type {\r\n AgentCommand,\r\n AgentCommandScope,\r\n AgentCommandHandle,\r\n AgentCommandRegistration,\r\n AgentCommandSlashSpec,\r\n AgentCommandContextBinding,\r\n LookupSearch,\r\n LookupDescriptor,\r\n LookupRegistration,\r\n LookupResult,\r\n LookupHandle,\r\n AgentDragPayload,\r\n AgentMessageEnvelope,\r\n AgentEnvelopeAttachment,\r\n AgentMcpScope,\r\n AgentDropChipMode,\r\n AgentChipHostInputs,\r\n AgentDraggableItem,\r\n AgentDropRendererRegistration,\r\n AgentPayloadLimits,\r\n AgentPayloadValidationResult,\r\n} from './lib/models/agent-input.model';\r\n\r\nexport {\r\n utf8ByteLength,\r\n trimAgentString,\r\n trimAgentPayload,\r\n validateAgentPayload,\r\n AgentPayloadOversizeError,\r\n} from './lib/utils/agent-payload-guards';\r\n\r\n// ─── Security: self-XSS console warning ──────────────────────────────────────\r\nexport { printConsoleSecurityWarning } from './lib/utils/console-security-warning';\r\n\r\n// ─── Cross-cutting locale catalog (dictation today, future translation feature) ──\r\nexport type { FlyLocaleEntry } from './lib/models/fly-locale-catalog.model';\r\nexport {\r\n FLY_LOCALE_CATALOG,\r\n findLocaleByDialect,\r\n findLocaleByPrefix,\r\n isRtlLocaleEntry,\r\n} from './lib/models/fly-locale-catalog';\r\n\r\n// ─── Chunk-load self-heal (stale-client-after-redeploy recovery) ─────────────\r\nexport {\r\n isChunkLoadError,\r\n reloadOnceForChunkError,\r\n FLY_CHUNK_RELOAD_FLAG,\r\n isNativeFederationCacheError,\r\n healNativeFederationCacheOnce,\r\n FLY_NF_CACHE_HEAL_FLAG,\r\n} from './lib/utils/chunk-load-error';\r\nexport {\r\n FlyChunkReloadErrorHandler,\r\n provideFlyChunkReloadRecovery,\r\n} from './lib/services/chunk-reload-error-handler';\r\n\r\n// ─── Badges UI kit (fly-badge-wall / -achievement-progress / -points-tier / -leaderboard) ───\r\nexport { FlyBadgeWallComponent } from './lib/components/badges/badge-wall/badge-wall.component';\r\nexport { FlyAchievementProgressComponent } from './lib/components/badges/achievement-progress/achievement-progress.component';\r\nexport { FlyPointsTierComponent } from './lib/components/badges/points-tier/points-tier.component';\r\nexport { FlyLeaderboardComponent } from './lib/components/badges/leaderboard/leaderboard.component';\r\nexport type {\r\n FlyBadgeTile, FlyAchievementRow, FlyPointsSummary, FlyLeaderboardRow,\r\n} from './lib/components/badges/badges.types';\r\n\r\n// ─── Moderation queue (fly-moderation-queue) — pending 3.9.0 batch release ───\r\n// Transport-agnostic comment-report moderation queue for the `comments` core app's\r\n// `CommentReportsController` surface (list/status-filter/resolve) + per-report thread lock.\r\n// Reuses `FlyCommentReportReason` / `FlyCommentReportStatus` from comment-thread.types — see\r\n// moderation-queue.types.ts for the \"one canonical contract\" rationale.\r\nexport { FlyModerationQueueComponent } from './lib/components/moderation-queue/moderation-queue.component';\r\nexport type {\r\n FlyModerationReport,\r\n FlyModerationReportPage,\r\n FlyModerationResolutionStatus,\r\n FlyModerationLoadPageRequest,\r\n FlyModerationResolveRequest,\r\n FlyModerationLockThreadRequest,\r\n FlyModerationOpenSubjectRequest,\r\n} from './lib/components/moderation-queue/moderation-queue.types';\r\n\r\n// ─── People picker (fly-people-picker) — pending 3.9.0 batch release ───\r\n// Thin wrapper over fly-typeahead pre-canned for the Controller's `GET /api/users/lookup`\r\n// contract: single/multi selection with avatar-or-initials chips, `excludeIds`, emits `Guid[]`.\r\nexport { FlyPeoplePickerComponent } from './lib/components/people-picker/people-picker.component';\r\nexport type {\r\n FlyPeoplePickerOption,\r\n FlyPeoplePickerMode,\r\n} from './lib/components/people-picker/people-picker.types';\r\n\r\n// ─── Overlays: dismiss stack, click-outside, focus restore ───────────────────\r\n// The three pieces of a correctly-behaved overlay. Deliberately separate primitives\r\n// so a lightweight dropdown can take only click-outside without buying the rest.\r\nexport {\r\n OverlayStack,\r\n overlayStack,\r\n type OverlayHandle,\r\n} from './lib/overlays/overlay-stack';\r\nexport {\r\n captureFocus,\r\n restoreFocus,\r\n type FocusRestore,\r\n} from './lib/overlays/focus-restore';\r\nexport { FlyClickOutsideDirective } from './lib/directives/fly-click-outside.directive';\r\n\r\n// ─── Debounce ────────────────────────────────────────────────────────────────\r\nexport {\r\n FlyDebouncer,\r\n flyDebounced,\r\n FLY_SEARCH_DEBOUNCE_MS,\r\n FLY_RELOAD_DEBOUNCE_MS,\r\n} from './lib/utils/debounce';\r\n\r\n// ─── Search input ────────────────────────────────────────────────────────────\r\nexport {\r\n FlySearchInputComponent,\r\n type FlySearchExpandTrigger,\r\n type FlySearchInputSize,\r\n} from './lib/components/search-input/search-input.component';\r\n\r\n// ─── Headless keyboard navigation (menus, radiogroups, tablists) ─────────────\r\nexport {\r\n flyFirstEnabledIndex,\r\n flyNextEnabledIndex,\r\n flyNextSegmentIndex,\r\n flyResolveActiveTab,\r\n type FlyNavigableItem,\r\n} from './lib/utils/keyboard-nav';\r\n\r\n// ─── File download (cross-browser blob save + Content-Disposition parsing) ───\r\nexport { flyDownloadBlob, flyExportFileName } from './lib/utils/file-download';\r\n\r\n// ─── Locale-aware formatting (pure helpers + template pipes) ─────────────────\r\nexport {\r\n FLY_EMPTY_VALUE,\r\n FLY_COMPACT_THRESHOLD,\r\n flyCompactNumber,\r\n flyFullNumber,\r\n flyDecimalNumber,\r\n flySignedCompact,\r\n flyFormatBytes,\r\n flyRelativeTime,\r\n flyDuration,\r\n flyFormatDate,\r\n flyFormatTime,\r\n flyFormatDateTime,\r\n flyToDateOnly,\r\n} from './lib/utils/format';\r\nexport {\r\n FlyCompactNumberPipe,\r\n FlyFullNumberPipe,\r\n FlyDecimalNumberPipe,\r\n FlyBytesPipe,\r\n FlyRelativeTimePipe,\r\n FlyDurationPipe,\r\n FlyDatePipe,\r\n FlyTimePipe,\r\n FlyDateTimePipe,\r\n} from './lib/pipes/format.pipes';\r\n\r\n/* ── App-surface component library ─────────────────────────────────────────\r\n * Business-app CRUD / list / form kit (cards, tables, filters, forms, tabs,\r\n * modals, toasts). Absorbed from Circles' internal ui/ library; themed by the\r\n * --ink/--bg/--sp/--r token family in scss/_app-surface-tokens.scss. */\r\nexport * from './lib/app-surface';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["isSignal","DOCUMENT","i1","i2"],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BG;AAEH;AACA;AACO,MAAM,cAAc,GAAG,OAAO;AAE9B,MAAM,mBAAmB,GAAG,sBAAsB;AAMzD;;;;;AAKG;AACG,SAAU,4BAA4B,CAC1C,KAAwD,EACxD,OAAe,EAAA;AAEf,IAAA,MAAM,QAAQ,IAA2B,KAAK,CAAC,mBAAmB,CAAC,KAAK,EAAE,QAAQ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