{"version":3,"file":"mn-angular-lib-forms.mjs","sources":["../../../projects/mn-angular-lib/forms/src/mn-input-field/mn-input-field-adapters.ts","../../../projects/mn-angular-lib/forms/src/mn-input-field/mn-input-fieldVariants.ts","../../../projects/mn-angular-lib/forms/src/mn-error-message/mn-error-message.ts","../../../projects/mn-angular-lib/forms/src/mn-error-message/mn-error-message.html","../../../projects/mn-angular-lib/forms/src/mn-input-field/mn-input-field.ts","../../../projects/mn-angular-lib/forms/src/mn-input-field/mn-input-field.html","../../../projects/mn-angular-lib/forms/src/mn-checkbox/mn-checkboxVariants.ts","../../../projects/mn-angular-lib/forms/src/mn-checkbox/mn-checkbox.ts","../../../projects/mn-angular-lib/forms/src/mn-checkbox/mn-checkbox.html","../../../projects/mn-angular-lib/forms/src/mn-textarea/mn-textareaVariants.ts","../../../projects/mn-angular-lib/forms/src/mn-textarea/mn-textarea.ts","../../../projects/mn-angular-lib/forms/src/mn-textarea/mn-textarea.html","../../../projects/mn-angular-lib/forms/src/mn-datetime/mn-datetimeVariants.ts","../../../projects/mn-angular-lib/forms/src/mn-datetime/mn-datetime.ts","../../../projects/mn-angular-lib/forms/src/mn-datetime/mn-datetime.html","../../../projects/mn-angular-lib/forms/src/mn-file-input/mn-file-inputVariants.ts","../../../projects/mn-angular-lib/forms/src/mn-file-input/mn-file-input.ts","../../../projects/mn-angular-lib/forms/src/mn-file-input/mn-file-input.html","../../../projects/mn-angular-lib/forms/src/shared/anchored-panel-placement.ts","../../../projects/mn-angular-lib/forms/src/shared/listbox-navigation.ts","../../../projects/mn-angular-lib/forms/src/mn-select/mn-selectVariants.ts","../../../projects/mn-angular-lib/forms/src/mn-select/mn-select.ts","../../../projects/mn-angular-lib/forms/src/mn-select/mn-select.html","../../../projects/mn-angular-lib/forms/src/mn-multi-select/mn-multi-selectVariants.ts","../../../projects/mn-angular-lib/forms/src/mn-multi-select/mn-multi-select.ts","../../../projects/mn-angular-lib/forms/src/mn-multi-select/mn-multi-select.html","../../../projects/mn-angular-lib/forms/src/mn-dropdown/mn-dropdownVariants.ts","../../../projects/mn-angular-lib/forms/src/mn-dropdown/mn-dropdown.ts","../../../projects/mn-angular-lib/forms/src/mn-dropdown/mn-dropdown.html","../../../projects/mn-angular-lib/forms/public-api.ts","../../../projects/mn-angular-lib/forms/mn-angular-lib-forms.ts"],"sourcesContent":["/**\n * MnInputField Adapters\n *\n * This module implements the Adapter Pattern to handle type-specific behavior\n * for different HTML input types in the MnInputField component.\n *\n * The adapter pattern allows the component to support multiple input types\n * (text, number, date, time, etc.) without coupling the component logic to\n * type-specific implementations. Each adapter handles:\n * - Parsing: converting raw string input to the appropriate data type\n * - Formatting: converting typed values back to string for display\n * - Attributes: providing type-specific DOM attributes (min, max, step, inputmode)\n * - Validation: implementing type-specific validation rules\n *\n * This approach keeps the component code clean and makes it easy to add\n * support for new input types by creating new adapters.\n */\n\nimport { AbstractControl, ValidationErrors } from '@angular/forms';\nimport { MnInputDateTimeProps, MnInputProps, MnInputType } from './mn-input-fieldTypes';\n\n/**\n * DOM attributes that can be dynamically set on input elements.\n * These attributes are type-specific and provided by adapters.\n */\nexport type MnDomAttrs = {\n  /** Minimum value for date/time/number inputs */\n  min?: string | null;\n  /** Maximum value for date/time/number inputs */\n  max?: string | null;\n  /** Step increment for number/date/time inputs */\n  step?: string | null;\n  /** Mobile keyboard hint (e.g., 'decimal' for number inputs) */\n  inputmode?: string | null;\n};\n\n/**\n * Adapter interface for handling input type-specific behavior.\n *\n * Each adapter implementation defines how to handle a specific input type\n * (or group of related types) throughout the component lifecycle.\n *\n * @template TOut - The output type after parsing (e.g., string | null, number | null)\n */\nexport type MnInputAdapter<TOut = string | null> = {\n  /**\n   * Parses the raw string value from the input element into the typed value\n   * that will be sent to the FormControl.\n   *\n   * @param raw - Raw string value from the input element\n   * @returns Typed value to store in the FormControl\n   *\n   * @example\n   * // Text adapter\n   * parse('hello') // => 'hello'\n   * parse('') // => null\n   *\n   * // Number adapter\n   * parse('42') // => 42\n   * parse('') // => null\n   * parse('abc') // => null\n   */\n  parse(raw: string): TOut;\n\n  /**\n   * Formats the typed value from the FormControl into a string\n   * that will be displayed in the input element.\n   *\n   * @param val - Typed value from the FormControl\n   * @returns String representation for the input element's value attribute\n   *\n   * @example\n   * // Text adapter\n   * format('hello') // => 'hello'\n   * format(null) // => ''\n   *\n   * // Number adapter\n   * format(42) // => '42'\n   * format(null) // => ''\n   */\n  format(val: unknown): string;\n\n  /**\n   * Returns type-specific DOM attributes for the input element.\n   * These attributes are applied dynamically based on the input type and props.\n   *\n   * @param props - Input field properties\n   * @returns Object containing DOM attributes (min, max, step, inputmode)\n   *\n   * @example\n   * // Date adapter with date range\n   * attrs({ startDate: '2024-01-01', endDate: '2024-12-31' })\n   * // => { min: '2024-01-01', max: '2024-12-31' }\n   *\n   * // Number adapter\n   * attrs({}) // => { inputmode: 'decimal' }\n   */\n  attrs(props: MnInputProps): MnDomAttrs;\n\n  /**\n   * Performs type-specific validation on the current input value.\n   * This validation runs in addition to Angular's built-in validators.\n   *\n   * @param props - Input field properties (may contain validation constraints)\n   * @param control - The AbstractControl being validated\n   * @param currentRaw - Current raw string value from the input element\n   * @returns ValidationErrors object if invalid, null if valid\n   *\n   * @example\n   * // Date adapter validation\n   * validate(props, control, '2024-06-15')\n   * // Returns { mnMin: { min: '2024-07-01', actual: '2024-06-15' } }\n   * // if startDate is '2024-07-01'\n   */\n  validate(props: MnInputProps, control: AbstractControl, currentRaw: string | null): ValidationErrors | null;\n\n  /**\n   * Applies a mask to the raw input value.\n   */\n  applyMask?(value: string, mask: string): string;\n}\n\n/**\n * Utility function to convert empty strings to null.\n * This is a common pattern for optional form fields where empty input\n * should be treated as \"no value\" rather than an empty string.\n *\n * @param raw - Raw input string\n * @returns The input string if non-empty, null if empty\n *\n * @example\n * emptyToNull('hello') // => 'hello'\n * emptyToNull('') // => null\n */\nconst emptyToNull = (raw: string): string | null => (raw === '' ? null : raw);\n\n/**\n * Default adapter for text-based input types.\n * Used for: text, email, password, search, tel, url\n *\n * Behavior:\n * - Empty strings are converted to null\n * - Values are stored as strings in the FormControl\n * - No special DOM attributes\n * - No additional validation (relies on Angular's built-in validators)\n * - Supports simple masking (0 for digit, A for alpha, * for any)\n */\nexport const defaultTextAdapter: MnInputAdapter<string | null> = {\n  parse: (raw) => emptyToNull(raw),\n  format: (val) => (val == null ? '' : String(val)),\n  attrs: () => ({}),\n  validate: () => null,\n  applyMask: (value: string, mask: string): string => {\n    if (!mask || !value) return value;\n\n    let result = '';\n    let maskIndex = 0;\n    let dataIndex = 0;\n\n    // Remove non-alphanumeric if we want to re-mask from clean data\n    // But usually we just want to restrict input.\n    // A simple implementation:\n    while (maskIndex < mask.length && dataIndex < value.length) {\n      const maskChar = mask[maskIndex];\n      const dataChar = value[dataIndex];\n\n      if (maskChar === '0') {\n        if (/\\d/.test(dataChar)) {\n          result += dataChar;\n          dataIndex++;\n          maskIndex++;\n        } else {\n          dataIndex++; // skip invalid\n        }\n      } else if (maskChar === 'A') {\n        if (/[a-zA-Z]/.test(dataChar)) {\n          result += dataChar;\n          dataIndex++;\n          maskIndex++;\n        } else {\n          dataIndex++; // skip invalid\n        }\n      } else if (maskChar === '*') {\n        result += dataChar;\n        dataIndex++;\n        maskIndex++;\n      } else {\n        result += maskChar;\n        if (dataChar === maskChar) {\n          dataIndex++;\n        }\n        maskIndex++;\n      }\n    }\n\n    // Auto-append static characters if next in mask\n    while (maskIndex < mask.length && !/[0A*]/.test(mask[maskIndex])) {\n      result += mask[maskIndex];\n      maskIndex++;\n    }\n\n    return result;\n  }\n};\n\n/**\n * Adapter for date and time input types.\n * Used for: date, time, datetime-local\n *\n * Behavior:\n * - Empty strings are converted to null\n * - Values are stored as ISO 8601 strings in the FormControl\n * - Provides min/max attributes from startDate/endDate props\n * - Validates date/time ranges using string comparison\n *\n * Note: String comparison works for ISO 8601 dates/times because they are\n * lexicographically ordered (e.g., '2024-01-15' < '2024-12-31').\n */\nexport const dateTimeAdapter: MnInputAdapter<string | null> = {\n  parse: (raw) => emptyToNull(raw),\n  format: (val) => (val == null ? '' : String(val)),\n  attrs: (props) => ({\n    min: (props as MnInputDateTimeProps).startDate ?? null,\n    max: (props as MnInputDateTimeProps).endDate ?? null,\n  }),\n  validate: (props, _control, currentRaw) => {\n    const value = currentRaw;\n    if (!value) return null; // Don't validate empty values (use 'required' validator for that)\n\n    const min = (props as MnInputDateTimeProps).startDate as string | undefined;\n    const max = (props as MnInputDateTimeProps).endDate as string | undefined;\n\n    // Validate minimum date/time constraint\n    if (min && value < min) {\n      return { mnMin: { min, actual: value } };\n    }\n\n    // Validate maximum date/time constraint\n    if (max && value > max) {\n      return { mnMax: { max, actual: value } };\n    }\n\n    return null;\n  },\n};\n\n/**\n * Adapter for number input type.\n *\n * Behavior:\n * - Empty strings are converted to null\n * - Valid numbers are parsed to number type\n * - Invalid numbers (NaN, Infinity) are converted to null\n * - Values are stored as numbers (or null) in the FormControl\n * - Sets inputmode='decimal' for optimized mobile keyboards\n * - No additional validation (relies on Angular's built-in validators)\n *\n * Note: The browser's native number input validation handles\n * basic number format validation automatically.\n */\nexport const numberAdapter: MnInputAdapter<number | null> = {\n  parse: (raw) => {\n    if (raw === '') return null;\n    const num = Number(raw);\n    return Number.isFinite(num) ? num : null;\n  },\n  format: (val) => (val == null ? '' : String(val)),\n  attrs: () => ({\n    inputmode: 'decimal',\n  }),\n  validate: () => null,\n};\n\n/**\n * Selects the appropriate adapter based on the input type.\n * This is the main factory function used by the MnInputField component\n * to determine which adapter to use for a given input type.\n *\n * @param type - The input type (e.g., 'text', 'email', 'date', 'number')\n * @returns The appropriate adapter instance\n *\n * @example\n * pickAdapter('text') // => defaultTextAdapter\n * pickAdapter('email') // => defaultTextAdapter\n * pickAdapter('date') // => dateTimeAdapter\n * pickAdapter('number') // => numberAdapter\n */\nexport function pickAdapter(type: MnInputType): MnInputAdapter<string | null | number> {\n  // Date/time inputs use the dateTimeAdapter for range validation\n  if (type === 'date' || type === 'time' || type === 'datetime-local') {\n    return dateTimeAdapter;\n  }\n\n  // Number inputs use the numberAdapter for type conversion\n  if (type === 'number') {\n    return numberAdapter;\n  }\n\n  // All other input types use the default text adapter\n  return defaultTextAdapter;\n}\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnInputFieldVariants = tv({\n  base: 'bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm outline-none focus:ring-1 focus:ring-primary',\n  variants: {\n\n    shadow: {\n      true: 'shadow-lg',\n    },\n    size: {\n      sm: 'p-2',\n      md: 'p-3',\n      lg: 'p-4',\n    },\n    borderRadius: {\n      none: 'rounded-none',\n      xs: 'rounded-xs',\n      sm: 'rounded-sm',\n      md: 'rounded-md',\n      lg: 'rounded-lg',\n      xl: 'rounded-xl',\n      two_xl: 'rounded-2xl',\n      three_xl: 'rounded-3xl',\n      four_xl: 'rounded-4xl',\n    },\n    fullWidth: {\n      true: 'w-full',\n    },\n    hover: {\n      true: 'hover:cursor-pointer hover:bg-base-200 transition-colors duration-300 ease-in-out',\n    },\n    disabled: {\n      true: 'opacity-50 cursor-not-allowed',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    borderRadius: 'md',\n    hover: true,\n  }\n});\n\nexport type MnInputVariants = VariantProps<typeof mnInputFieldVariants>;\n","import { Component, Input } from '@angular/core';\n\n@Component({\n  selector: 'mn-error-message',\n  imports: [],\n  templateUrl: './mn-error-message.html',\n})\nexport class MnErrorMessage {\n  @Input({ required: true }) errorMessage!: string;\n  @Input({ required: true }) id!: string;\n}\n","<div [id]=\"id + '-error'\" role=\"alert\" class=\"text-error mt-2 text-sm\">\n  {{ errorMessage }}\n</div>\n","import {\n  ChangeDetectorRef,\n  Component,\n  DestroyRef,\n  ElementRef,\n  inject,\n  InjectionToken,\n  Input,\n  OnInit,\n} from '@angular/core';\nimport { CommonModule, NgClass } from '@angular/common';\nimport { MnErrorMessageData, MnInputFieldUIConfig, MnInputProps } from './mn-input-fieldTypes';\nimport {\n  AbstractControl,\n  FormsModule,\n  NgControl,\n  ValidationErrors,\n  Validators,\n} from '@angular/forms';\nimport { pickAdapter } from './mn-input-field-adapters';\nimport { mnInputFieldVariants } from './mn-input-fieldVariants';\nimport { MnErrorMessage } from '../mn-error-message/mn-error-message';\nimport { MnConfigService } from 'mn-angular-lib/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from 'mn-angular-lib/core';\nimport { MnLanguageService } from 'mn-angular-lib/core';\nimport { skip } from 'rxjs';\n\nexport const MN_INPUT_FIELD_CONFIG = new InjectionToken<MnInputFieldUIConfig>(\n  'MN_INPUT_FIELD_CONFIG',\n);\n\n/**\n * MnInputField Component\n *\n * A flexible, accessible input field component that implements Angular's ControlValueAccessor\n * and Validator interfaces. Supports multiple input types, custom validation messages,\n * and configurable error display (single or multiple errors).\n *\n * Features:\n * - Works with Angular Reactive Forms (FormControl, FormGroup)\n * - Supports standard and date/time input types\n * - Built-in error messages with internationalization support\n * - Custom error messages per field\n * - Priority-based error display or show all errors\n * - Full accessibility (ARIA attributes)\n * - Type-safe adapter pattern for different input types\n *\n * @example\n * ```typescript\n * <mn-input-field\n *   formControlName=\"email\"\n *   [props]=\"{\n *     id: 'email',\n *     type: 'email',\n *     label: 'Email Address',\n *     size: 'md',\n *     borderRadius: 'md',\n *     errorMessages: { required: 'Email is required' }\n *   }\"\n * ></mn-input-field>\n * ```\n */\n@Component({\n  selector: 'mn-lib-input-field',\n  standalone: true,\n  imports: [CommonModule, NgClass, MnErrorMessage, FormsModule],\n  templateUrl: './mn-input-field.html',\n  // The native `type=\"search\"` clear affordance (the ✕) is a shadow pseudo-element, so it\n  // can't take a Tailwind class — give it a pointer cursor here. Only search inputs render\n  // this pseudo, so it needs no type qualifier.\n  styles: [\n    `\n      input::-webkit-search-cancel-button {\n        cursor: pointer;\n      }\n    `,\n  ],\n  host: {\n    // Native inputs (notably `type=\"date\"`) have a platform-specific intrinsic width.\n    // Without an explicit host width the inline host collapses to that intrinsic size,\n    // so the input's `w-full` (width:100%) resolves against a content-sized box and\n    // fails to fill the parent on real mobile devices (desktop devtools hides this\n    // because it still renders the control with the desktop engine). Give the host a\n    // real width when fullWidth is requested so 100% has something to fill.\n    '[style.display]': \"props?.fullWidth ? 'block' : null\",\n    '[style.width]': \"props?.fullWidth ? '100%' : null\",\n  },\n})\nexport class MnInputField implements OnInit {\n  ngControl = inject(NgControl, { optional: true, self: true });\n\n  /** Resolved UI configuration for the input field */\n  protected uiConfig: MnInputFieldUIConfig = {};\n\n  private readonly el = inject(ElementRef);\n\n  /** Configuration properties for the input field */\n  @Input({ required: true }) props!: MnInputProps;\n\n  private readonly configService = inject(MnConfigService);\n  private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n  private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n  /** Marks the view when a locale change re-resolves the config (OnPush). */\n  private readonly cdr = inject(ChangeDetectorRef);\n  private readonly lang = inject(MnLanguageService);\n  private readonly destroyRef = inject(DestroyRef);\n\n  /** Current raw string value of the input element */\n  value: string | null = null;\n\n  /** Whether the input is disabled */\n  isDisabled = false;\n\n  /** Callback function to notify Angular forms of value changes */\n  private onChange: (val: unknown) => void = () => {};\n\n  /** Callback function to notify Angular forms when input is touched/blurred */\n  private onTouched: () => void = () => {};\n\n  /**\n   * Built-in default error messages in English.\n   * These are used when useBuiltInErrorMessages is true (default).\n   * Can be overridden per-field using props.errorMessages.\n   */\n  private readonly builtInErrorMessages: Record<string, MnErrorMessageData> = {\n    required: 'This field is required',\n    email: 'Please enter a valid email address',\n    minlength: (args) => `Minimum ${args.requiredLength} characters required`,\n    maxlength: (args) => `Maximum ${args.requiredLength} characters allowed`,\n    mnMin: (args) => `Date/time must be from ${args.min} onwards`,\n    mnMax: (args) => `Date/time must be up to ${args.max}`,\n  };\n\n  /**\n   * Constructor - Registers this component as the ControlValueAccessor\n   * for the injected NgControl (FormControl).\n   *\n   */\n  constructor() {\n    if (this.ngControl) this.ngControl.valueAccessor = this;\n  }\n\n  ngOnInit() {\n    // `showError` reads the control's touched/dirty/invalid state straight off the form.\n    // Those move from the forms API — `markAllAsTouched()` when the user tries to submit, a\n    // programmatic `setErrors` — never through an event on this component, so under OnPush\n    // the message would never appear. `events` covers value, status, touched and pristine.\n    const formControl = this.ngControl?.control;\n    if (formControl) {\n      const stateSub = formControl.events.subscribe(() => this.cdr.markForCheck());\n      this.destroyRef.onDestroy(() => stateSub.unsubscribe());\n    }\n\n    this.resolveConfig();\n\n    const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n      this.resolveConfig();\n      // `resolveConfig` rewrites plain fields the template reads; under OnPush nothing else\n      // marks this view for the locale change.\n      this.cdr.markForCheck();\n    });\n    this.destroyRef.onDestroy(() => sub.unsubscribe());\n\n    if (this.props.autoFocus) {\n      setTimeout(() => this.focus(), 0);\n    }\n  }\n\n  /**\n   * Focuses the input element.\n   */\n  focus(): void {\n    const input = this.el.nativeElement.querySelector('input');\n    // `preventScroll` so autofocusing inside a popover (e.g. mn-dropdown's search) never\n    // scrolls the input into view — a scroll would trip the host's scroll-to-close logic.\n    if (input) input.focus({ preventScroll: true });\n  }\n\n  private resolveConfig() {\n    const instanceId = this.explicitInstanceId || `mn-input-${this.props.id}`;\n    this.uiConfig = this.configService.resolve<MnInputFieldUIConfig>(\n      'mn-input-field',\n      this.sectionPath,\n      instanceId,\n    );\n\n    // Allow props to override uiConfig for label and placeholder\n    if (this.props) {\n      this.uiConfig = { ...this.uiConfig, label: this.props.label };\n      this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n      if (this.props.ariaLabel) {\n        this.uiConfig = { ...this.uiConfig, ariaLabel: this.props.ariaLabel };\n      }\n    }\n  }\n\n  /**\n   * Gets the appropriate adapter based on the input type.\n   * Adapters handle type-specific formatting, parsing, and validation.\n   */\n  private get adapter() {\n    return pickAdapter(this.props.type);\n  }\n\n  // ========== ControlValueAccessor Implementation ==========\n\n  /**\n   * Writes a new value to the input element (called by Angular Forms).\n   * Formats the value using the type-specific adapter.\n   *\n   * @param val - The value to write (type depends on input type)\n   */\n  writeValue(val: unknown): void {\n    this.value = this.adapter.format(val);\n    // The forms API writes in from outside (setValue, reset, patch); nothing marks\n    // this view for it.\n    this.cdr.markForCheck();\n  }\n\n  /**\n   * Registers a callback function to be called when the input value changes.\n   *\n   * @param fn - Callback function to notify Angular Forms of changes\n   */\n  registerOnChange(fn: (val: unknown) => void): void {\n    this.onChange = fn;\n  }\n\n  /**\n   * Registers a callback function to be called when the input is touched/blurred.\n   *\n   * @param fn - Callback function to notify Angular Forms of touch events\n   */\n  registerOnTouched(fn: () => void): void {\n    this.onTouched = fn;\n  }\n\n  /**\n   * Sets the disabled state of the input element.\n   *\n   * @param isDisabled - Whether the input should be disabled\n   */\n  setDisabledState(isDisabled: boolean): void {\n    this.isDisabled = isDisabled;\n    // `control.disable()` / `.enable()` reaches us the same way `writeValue` does —\n    // from the forms API, with no event behind it.\n    this.cdr.markForCheck();\n  }\n\n  // ========== Event Handlers ==========\n\n  /**\n   * Handles input events from the input element.\n   * Parses the raw string value and notifies Angular Forms.\n   *\n   * @param raw - Raw string value from the input element\n   */\n  handleInput(raw: string): void {\n    let finalValue = raw;\n\n    // Apply mask if available\n    if (this.props.mask && typeof this.adapter.applyMask === 'function') {\n      finalValue = this.adapter.applyMask(raw, this.props.mask);\n\n      // Force-update the DOM input when the mask stripped characters,\n      // because Angular won't re-render if this.value hasn't changed.\n      if (finalValue !== raw) {\n        const input = this.el.nativeElement.querySelector('input');\n        if (input) input.value = finalValue;\n      }\n    }\n\n    this.value = finalValue;\n    this.onChange(this.adapter.parse(finalValue));\n  }\n\n  /**\n   * Handles blur events from the input element.\n   * Notifies Angular Forms that the input has been touched.\n   */\n  handleBlur(): void {\n    this.onTouched();\n  }\n\n  // ========== Validator Implementation ==========\n\n  /**\n   * Validates the control using the type-specific adapter.\n   * Called by Angular Forms during validation.\n   *\n   * @param control - The AbstractControl to validate\n   * @returns ValidationErrors if invalid, null if valid\n   */\n  validate(control: AbstractControl): ValidationErrors | null {\n    return this.adapter.validate(this.props, control, this.value);\n  }\n\n  // ========== Template Attribute Getters ==========\n\n  /**\n   * Gets all DOM attributes from the adapter.\n   * These are input-type-specific attributes (min, max, step, inputmode).\n   */\n  get domAttrs() {\n    return this.adapter.attrs(this.props);\n  }\n\n  /** Min attribute for date/time/number inputs */\n  get minAttr() {\n    return this.domAttrs.min ?? null;\n  }\n\n  /** Max attribute for date/time/number inputs */\n  get maxAttr() {\n    return this.domAttrs.max ?? null;\n  }\n\n  /** Step attribute for number/date/time inputs */\n  get stepAttr() {\n    return this.domAttrs.step ?? null;\n  }\n\n  /** Inputmode attribute for mobile keyboard optimization */\n  get inputmodeAttr() {\n    return this.domAttrs.inputmode ?? null;\n  }\n\n  // ========== Error Handling ==========\n\n  /**\n   * Gets the FormControl instance from Angular Forms.\n   * Returns null if no control is attached.\n   */\n  get control() {\n    return this.ngControl?.control ?? null;\n  }\n\n  /**\n   * Determines whether to show error messages.\n   * Errors are shown when the control is invalid and has been touched or modified.\n   */\n  /**\n   * Ids of the rendered error messages, space-separated, for `aria-describedby`. Mirrors the\n   * `{id}-error` / `{id}-{index}-error` ids `mn-error-message` renders in single and show-all mode.\n   */\n  get errorDescribedBy(): string {\n    return this.props.showAllErrors\n      ? this.errorMessages.map((_, index) => `${this.resolvedId}-${index}-error`).join(' ')\n      : `${this.resolvedId}-error`;\n  }\n\n  get showError(): boolean {\n    const c = this.control;\n    return !!c && c.invalid && (c.touched || c.dirty);\n  }\n\n  /**\n   * Picks the error key to display based on errorPriority.\n   * Used when showAllErrors is false (default).\n   *\n   * @param errors - ValidationErrors object from the control\n   * @returns The error key to display\n   */\n  private pickErrorKey(errors: ValidationErrors): string {\n    // If priority is specified, use the first matching error from the priority list\n    if (this.props.errorPriority) {\n      for (const key of this.props.errorPriority) {\n        if (errors[key] !== undefined) {\n          return key;\n        }\n      }\n    }\n    // Otherwise, use the first error key\n    return Object.keys(errors)[0];\n  }\n\n  protected isRequired(): boolean {\n    if (!this.control) return false;\n    return this.control.hasValidator(Validators.required);\n  }\n\n  /**\n   * Resolves a single error message for a specific error key.\n   * Checks custom messages, built-in messages, and fallback in order.\n   *\n   * @param errorKey - The error key (e.g., 'required', 'email')\n   * @param errors - All validation errors on the control\n   * @returns The resolved error message string\n   */\n  private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n    const errorArgs = errors[errorKey];\n\n    // Priority: custom (props) > config > built-in > fallback > default\n    const customMsg = this.props.errorMessages?.[errorKey];\n    const configMsg = this.uiConfig.errorMessages?.[errorKey];\n    const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n    const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n    const fallbackMsg = this.props.defaultErrorMessage;\n\n    const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n    // If the message is a function, call it with error arguments\n    if (typeof msgDef === 'function') {\n      return msgDef(errorArgs, errors);\n    }\n    // Interpolate {{placeholder}} tokens with error arguments (e.g. {{requiredLength}})\n    if (errorArgs && typeof errorArgs === 'object') {\n      return msgDef.replace(/\\{\\{(\\w+)}}/g, (_: string, key: string) =>\n        errorArgs[key] !== undefined ? String(errorArgs[key]) : `{{${key}}}`,\n      );\n    }\n    return msgDef;\n  }\n\n  /**\n   * Gets all error messages for the current control state.\n   * Returns an array of error messages (used when showAllErrors is true).\n   *\n   * @returns Array of error message strings\n   */\n  get errorMessages(): string[] {\n    const errors = this.control?.errors;\n    if (!errors) return [];\n\n    const errorKeys = Object.keys(errors);\n    return errorKeys.map((key) => this.resolveErrorMessageForKey(key, errors));\n  }\n\n  /**\n   * Gets a single error message for the current control state.\n   * Uses errorPriority to determine which error to show (when showAllErrors is false).\n   *\n   * @returns Single error message string, or null if no errors\n   */\n  get errorMessage(): string | null {\n    const errors = this.control?.errors;\n    if (!errors) return null;\n\n    const errorKey = this.pickErrorKey(errors);\n    return this.resolveErrorMessageForKey(errorKey, errors);\n  }\n\n  // ========== Resolved Properties ==========\n\n  /** Resolved ID for the input element */\n  get resolvedId(): string {\n    return this.props.id;\n  }\n\n  /** Resolved name attribute for the input element */\n  get resolvedName(): string | null {\n    return this.props?.name ?? null;\n  }\n\n  /**\n   * Computes the CSS classes from tailwind-variants based on the props.\n   * Returns the variant classes for styling the input element.\n   */\n  get inputClasses(): string {\n    return mnInputFieldVariants({\n      size: this.props.size,\n      borderRadius: this.props.borderRadius,\n      shadow: this.props.shadow,\n      fullWidth: this.props.fullWidth,\n      hover: this.isDisabled ? false : this.props.hover,\n      disabled: this.isDisabled,\n    });\n  }\n}\n","<div class=\"flex flex-col h-full\" [class.is-fullwidth]=\"props.fullWidth\">\n  <!-- Label -->\n  @if (uiConfig.label) {\n    <label class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\" [attr.for]=\"resolvedId\">\n      <p>{{ uiConfig.label }}</p>\n      @if (isRequired()) {\n        <span class=\"text-error\" aria-hidden=\"true\">*</span>\n      }\n    </label>\n  }\n\n  <!-- Input Element -->\n  <input\n    [id]=\"resolvedId\"\n    [attr.aria-required]=\"isRequired() || null\"\n    [attr.name]=\"resolvedName\"\n    [type]=\"props.type\"\n    [attr.placeholder]=\"uiConfig.placeholder || null\"\n    [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || null\"\n    [attr.aria-invalid]=\"showError || null\"\n    [attr.aria-describedby]=\"showError ? errorDescribedBy : null\"\n    [attr.aria-activedescendant]=\"props.ariaActiveDescendant || null\"\n    [disabled]=\"isDisabled\"\n    [attr.autocomplete]=\"props.autocomplete || null\"\n    [attr.min]=\"minAttr\"\n    [attr.max]=\"maxAttr\"\n    [ngModel]=\"value\"\n    [ngClass]=\"inputClasses\"\n    (input)=\"handleInput(($any($event.target)).value)\"\n    (search)=\"handleInput(($any($event.target)).value)\"\n    (blur)=\"handleBlur()\"\n  />\n\n  <!-- Error Messages -->\n  @if (showError) {\n    <!-- Show all errors mode -->\n    @if (props.showAllErrors) {\n      <div class=\"flex flex-col gap-y-1\">\n        @for (error of errorMessages; track $index) {\n          <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n        }\n      </div>\n    } @else {\n    @if (errorMessage !== null) {\n      <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n\n      }\n    }\n  }\n</div>\n","import {tv, type VariantProps} from 'tailwind-variants';\n\nexport const mnCheckboxVariants = tv({\n  base: 'mn-checkbox',\n  variants: {\n    size: {\n      xs: 'size-4 p-0.5',\n      sm: 'size-5 p-[0.1875rem]',\n      md: 'size-6 p-1',\n      lg: 'size-7 p-[0.3125rem]',\n      xl: 'size-8 p-1.5',\n    },\n    color: {\n      primary:   'border-primary   checked:bg-primary   indeterminate:bg-primary   focus-visible:outline-primary   text-primary-content',\n      secondary: 'border-secondary checked:bg-secondary indeterminate:bg-secondary focus-visible:outline-secondary text-secondary-content',\n      accent:    'border-accent    checked:bg-accent    indeterminate:bg-accent    focus-visible:outline-accent    text-accent-content',\n      neutral:   'border-neutral   checked:bg-neutral   indeterminate:bg-neutral   focus-visible:outline-neutral   text-neutral-content',\n      info:      'border-info      checked:bg-info      indeterminate:bg-info      focus-visible:outline-info      text-info-content',\n      success:   'border-success   checked:bg-success   indeterminate:bg-success   focus-visible:outline-success   text-success-content',\n      warning:   'border-warning   checked:bg-warning   indeterminate:bg-warning   focus-visible:outline-warning   text-warning-content',\n      error:     'border-error     checked:bg-error     indeterminate:bg-error     focus-visible:outline-error     text-error-content',\n    },\n    borderRadius: {\n      none: 'rounded-none',\n      xs:   'rounded-xs',\n      sm:   'rounded-sm',\n      md:   'rounded-md',\n      lg:   'rounded-lg',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    color: 'primary',\n    borderRadius: 'sm',\n  },\n});\n\nexport const mnCheckboxWrapperVariants = tv({\n  base: 'text-base-content',\n  variants: {\n    size: {\n      xs: 'text-sm',\n      sm: 'text-sm',\n      md: 'text-sm',\n      lg: 'text-base',\n      xl: 'text-base',\n    },\n    fullWidth: {\n      true: 'w-full',\n    },\n    hover: {\n      true: 'hover:bg-base-200 rounded-md transition-colors duration-200 ease-in-out px-2 -mx-2',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    hover: false,\n  },\n});\n\nexport type MnCheckboxVariants = VariantProps<typeof mnCheckboxVariants>;\nexport type MnCheckboxWrapperVariants = VariantProps<typeof mnCheckboxWrapperVariants>;\n","import {\n  ChangeDetectorRef,\n  Component,\n  DestroyRef,\n  EventEmitter,\n  inject,\n  InjectionToken,\n  Input,\n  OnChanges,\n  OnInit,\n  Output,\n} from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport {\n  MnCheckboxErrorMessageData,\n  MnCheckboxProps,\n  MnCheckboxUIConfig,\n} from './mn-checkboxTypes';\nimport { NgControl, ValidationErrors, Validators } from '@angular/forms';\nimport { mnCheckboxVariants, mnCheckboxWrapperVariants } from './mn-checkboxVariants';\nimport { MnErrorMessage } from '../mn-error-message/mn-error-message';\nimport { MnConfigService } from 'mn-angular-lib/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from 'mn-angular-lib/core';\nimport { MnLanguageService } from 'mn-angular-lib/core';\nimport { skip } from 'rxjs';\n\nexport const MN_CHECKBOX_CONFIG = new InjectionToken<MnCheckboxUIConfig>('MN_CHECKBOX_CONFIG');\n\n@Component({\n  selector: 'mn-lib-checkbox',\n  standalone: true,\n  imports: [NgClass, MnErrorMessage],\n  templateUrl: './mn-checkbox.html',\n  styleUrl: './mn-checkbox.css',\n})\nexport class MnCheckbox implements OnInit, OnChanges {\n  ngControl = inject(NgControl, { optional: true, self: true });\n\n  protected uiConfig: MnCheckboxUIConfig = {};\n\n  @Input({ required: true }) props!: MnCheckboxProps;\n\n  /** Direct checked binding for non-form usage */\n  @Input() checked?: boolean;\n\n  /** Emits when checked state changes (for non-form usage) */\n  @Output() checkedChange = new EventEmitter<boolean>();\n\n  private readonly configService = inject(MnConfigService);\n  private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n  private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n  /** Marks the view when a locale change re-resolves the config (OnPush). */\n  private readonly cdr = inject(ChangeDetectorRef);\n  private readonly lang = inject(MnLanguageService);\n  private readonly destroyRef = inject(DestroyRef);\n\n  value = false;\n  isDisabled = false;\n\n  private onChange: (val: unknown) => void = () => {};\n  private onTouched: () => void = () => {};\n\n  private readonly builtInErrorMessages: Record<string, MnCheckboxErrorMessageData> = {\n    required: 'This field is required',\n  };\n\n  constructor() {\n    if (this.ngControl) this.ngControl.valueAccessor = this;\n  }\n\n  ngOnInit() {\n    // `showError` reads the control's touched/dirty/invalid state straight off the form.\n    // Those move from the forms API — `markAllAsTouched()` when the user tries to submit, a\n    // programmatic `setErrors` — never through an event on this component, so under OnPush\n    // the message would never appear. `events` covers value, status, touched and pristine.\n    const formControl = this.ngControl?.control;\n    if (formControl) {\n      const stateSub = formControl.events.subscribe(() => this.cdr.markForCheck());\n      this.destroyRef.onDestroy(() => stateSub.unsubscribe());\n    }\n\n    this.resolveConfig();\n\n    const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n      this.resolveConfig();\n      // `resolveConfig` rewrites plain fields the template reads; under OnPush nothing else\n      // marks this view for the locale change.\n      this.cdr.markForCheck();\n    });\n    this.destroyRef.onDestroy(() => sub.unsubscribe());\n  }\n\n  private resolveConfig() {\n    const instanceId = this.explicitInstanceId || `mn-checkbox-${this.props.id}`;\n    this.uiConfig = this.configService.resolve<MnCheckboxUIConfig>(\n      'mn-checkbox',\n      this.sectionPath,\n      instanceId,\n    );\n\n    if (this.props.label) {\n      this.uiConfig = { ...this.uiConfig, label: this.props.label };\n    }\n  }\n\n  // ========== ControlValueAccessor Implementation ==========\n\n  writeValue(val: unknown): void {\n    this.value = !!val;\n    // The forms API writes in from outside (setValue, reset, patch); nothing marks\n    // this view for it.\n    this.cdr.markForCheck();\n  }\n\n  /** Sync value from checked input when not using forms */\n  ngOnChanges(): void {\n    if (this.checked !== undefined) {\n      this.value = this.checked;\n    }\n  }\n\n  registerOnChange(fn: (val: unknown) => 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.isDisabled = isDisabled;\n    // `control.disable()` / `.enable()` reaches us the same way `writeValue` does —\n    // from the forms API, with no event behind it.\n    this.cdr.markForCheck();\n  }\n\n  // ========== Event Handlers ==========\n\n  handleChange(checked: boolean): void {\n    this.value = checked;\n    this.onChange(checked);\n    this.checkedChange.emit(checked);\n  }\n\n  handleBlur(): void {\n    this.onTouched();\n  }\n\n  // ========== Error Handling ==========\n\n  get control() {\n    return this.ngControl?.control ?? null;\n  }\n\n  get showError(): boolean {\n    const c = this.control;\n    return !!c && c.invalid && (c.touched || c.dirty);\n  }\n\n  private pickErrorKey(errors: ValidationErrors): string {\n    if (this.props.errorPriority) {\n      for (const key of this.props.errorPriority) {\n        if (errors[key] !== undefined) {\n          return key;\n        }\n      }\n    }\n    return Object.keys(errors)[0];\n  }\n\n  protected isRequired(): boolean {\n    if (!this.control) return false;\n    return this.control.hasValidator(Validators.required);\n  }\n\n  private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n    const errorArgs = errors[errorKey];\n    const customMsg = this.props.errorMessages?.[errorKey];\n    const configMsg = this.uiConfig.errorMessages?.[errorKey];\n    const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n    const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n    const fallbackMsg = this.props.defaultErrorMessage;\n    const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n    if (typeof msgDef === 'function') {\n      return msgDef(errorArgs, errors);\n    }\n    return msgDef;\n  }\n\n  get errorMessages(): string[] {\n    const errors = this.control?.errors;\n    if (!errors) return [];\n    return Object.keys(errors).map((key) => this.resolveErrorMessageForKey(key, errors));\n  }\n\n  get errorMessage(): string | null {\n    const errors = this.control?.errors;\n    if (!errors) return null;\n    const errorKey = this.pickErrorKey(errors);\n    return this.resolveErrorMessageForKey(errorKey, errors);\n  }\n\n  // ========== Resolved Properties ==========\n\n  get resolvedId(): string {\n    return this.props.id;\n  }\n\n  get resolvedName(): string | null {\n    return this.props?.name ?? null;\n  }\n\n  get checkboxClasses(): string {\n    return mnCheckboxVariants({\n      size: this.props.size,\n      color: this.props.color,\n      borderRadius: this.props.borderRadius,\n    });\n  }\n\n  get wrapperClasses(): string {\n    return mnCheckboxWrapperVariants({\n      size: this.props.size,\n      fullWidth: this.props.fullWidth,\n      hover: this.props.hover,\n    });\n  }\n}\n","<div [class.is-fullwidth]=\"props.fullWidth\" class=\"flex flex-col items-start\">\n  <label [attr.for]=\"resolvedId\" [ngClass]=\"wrapperClasses\"\n         class=\"flex flex-row items-center gap-x-2 select-none cursor-pointer\">\n    <input\n      type=\"checkbox\"\n      [id]=\"resolvedId\"\n    [attr.aria-required]=\"isRequired() || null\"\n      [attr.name]=\"resolvedName\"\n      [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || props.label || null\"\n      [attr.aria-invalid]=\"showError || null\"\n      [attr.aria-describedby]=\"showError ? resolvedId + '-error' : null\"\n      [disabled]=\"isDisabled\"\n      [checked]=\"value\"\n      [ngClass]=\"checkboxClasses\"\n      (change)=\"handleChange($any($event.target).checked)\"\n      (blur)=\"handleBlur()\"\n    />\n    @if (uiConfig.label || props.label) {\n      <span class=\"flex flex-row items-center gap-x-0.5\">\n        <span>{{ uiConfig.label || props.label }}</span>\n        @if (isRequired()) {\n          <span class=\"text-error\" aria-hidden=\"true\">*</span>\n        }\n      </span>\n    }\n  </label>\n\n  @if (showError) {\n    @if (props.showAllErrors) {\n      <div class=\"flex flex-col gap-y-1 mt-1\">\n        @for (error of errorMessages; track $index) {\n          <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n        }\n      </div>\n    } @else {\n      @if (errorMessage !== null) {\n        <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n      }\n    }\n  }\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnTextareaVariants = tv({\n  base: 'bg-base-100 border-1 border-base-300 placeholder-base-content/50 text-base-content text-sm outline-none focus:ring-1 focus:ring-primary',\n  variants: {\n\n    shadow: {\n      true: 'shadow-lg',\n    },\n    size: {\n      sm: 'p-2',\n      md: 'p-3',\n      lg: 'p-4',\n    },\n    borderRadius: {\n      none: 'rounded-none',\n      xs: 'rounded-xs',\n      sm: 'rounded-sm',\n      md: 'rounded-md',\n      lg: 'rounded-lg',\n      xl: 'rounded-xl',\n      two_xl: 'rounded-2xl',\n      three_xl: 'rounded-3xl',\n      four_xl: 'rounded-4xl',\n    },\n    fullWidth: {\n      true: 'w-full',\n    },\n    resize: {\n      none: 'resize-none',\n      vertical: 'resize-y',\n      horizontal: 'resize-x',\n      both: 'resize',\n    }\n  },\n  defaultVariants: {\n    size: 'md',\n    borderRadius: 'md',\n    resize: 'vertical',\n  }\n});\n\nexport type MnTextareaVariants = VariantProps<typeof mnTextareaVariants>;\n","import {\n  ChangeDetectorRef,\n  Component,\n  DestroyRef,\n  ElementRef,\n  inject,\n  InjectionToken,\n  Input,\n  OnInit,\n} from '@angular/core';\nimport { NgClass } from '@angular/common';\nimport {\n  MnTextareaErrorMessageData,\n  MnTextareaProps,\n  MnTextareaUIConfig,\n} from './mn-textareaTypes';\nimport { NgControl, ValidationErrors, Validators } from '@angular/forms';\nimport { mnTextareaVariants } from './mn-textareaVariants';\nimport { MnErrorMessage } from '../mn-error-message/mn-error-message';\nimport { MnConfigService } from 'mn-angular-lib/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from 'mn-angular-lib/core';\nimport { MnLanguageService } from 'mn-angular-lib/core';\nimport { skip } from 'rxjs';\n\nexport const MN_TEXTAREA_CONFIG = new InjectionToken<MnTextareaUIConfig>('MN_TEXTAREA_CONFIG');\n\n/**\n * MnTextarea Component\n *\n * A flexible, accessible textarea component that implements Angular's ControlValueAccessor\n * and Validator interfaces. Works similarly to MnInputField but uses a textarea element,\n * allowing users to set the height (rows), width (cols), and resize behavior.\n *\n * Features:\n * - Works with Angular Reactive Forms (FormControl, FormGroup)\n * - Configurable rows, cols, and resize behavior\n * - Built-in error messages with internationalization support\n * - Custom error messages per field\n * - Priority-based error display or show all errors\n * - Full accessibility (ARIA attributes)\n *\n * @example\n * ```typescript\n * <mn-textarea\n *   formControlName=\"description\"\n *   [props]=\"{\n *     id: 'description',\n *     rows: 5,\n *     label: 'Description',\n *     size: 'md',\n *     borderRadius: 'md',\n *     resize: 'vertical',\n *     errorMessages: { required: 'Description is required' }\n *   }\"\n * ></mn-textarea>\n * ```\n */\n@Component({\n  selector: 'mn-lib-textarea',\n  standalone: true,\n  imports: [NgClass, MnErrorMessage],\n  templateUrl: './mn-textarea.html',\n})\nexport class MnTextarea implements OnInit {\n  ngControl = inject(NgControl, { optional: true, self: true });\n\n  /** Resolved UI configuration for the textarea */\n  protected uiConfig: MnTextareaUIConfig = {};\n\n  private readonly el = inject(ElementRef);\n\n  /** Configuration properties for the textarea */\n  @Input({ required: true }) props!: MnTextareaProps;\n\n  private readonly configService = inject(MnConfigService);\n  private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n  private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n  /** Marks the view when a locale change re-resolves the config (OnPush). */\n  private readonly cdr = inject(ChangeDetectorRef);\n  private readonly lang = inject(MnLanguageService);\n  private readonly destroyRef = inject(DestroyRef);\n\n  /** Current raw string value of the textarea element */\n  value: string | null = null;\n\n  /** Whether the textarea is disabled */\n  isDisabled = false;\n\n  /** Callback function to notify Angular forms of value changes */\n  private onChange: (val: unknown) => void = () => {};\n\n  /** Callback function to notify Angular forms when textarea is touched/blurred */\n  private onTouched: () => void = () => {};\n\n  /**\n   * Built-in default error messages in English.\n   * These are used when useBuiltInErrorMessages is true (default).\n   * Can be overridden per-field using props.errorMessages.\n   */\n  private readonly builtInErrorMessages: Record<string, MnTextareaErrorMessageData> = {\n    required: 'This field is required',\n    minlength: (args) => `Minimum ${args.requiredLength} characters required`,\n    maxlength: (args) => `Maximum ${args.requiredLength} characters allowed`,\n  };\n\n  /**\n   * Constructor - Registers this component as the ControlValueAccessor\n   * for the injected NgControl (FormControl).\n   *\n   */\n  constructor() {\n    if (this.ngControl) this.ngControl.valueAccessor = this;\n  }\n\n  ngOnInit() {\n    // `showError` reads the control's touched/dirty/invalid state straight off the form.\n    // Those move from the forms API — `markAllAsTouched()` when the user tries to submit, a\n    // programmatic `setErrors` — never through an event on this component, so under OnPush\n    // the message would never appear. `events` covers value, status, touched and pristine.\n    const formControl = this.ngControl?.control;\n    if (formControl) {\n      const stateSub = formControl.events.subscribe(() => this.cdr.markForCheck());\n      this.destroyRef.onDestroy(() => stateSub.unsubscribe());\n    }\n\n    this.resolveConfig();\n\n    const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n      this.resolveConfig();\n      // `resolveConfig` rewrites plain fields the template reads; under OnPush nothing else\n      // marks this view for the locale change.\n      this.cdr.markForCheck();\n    });\n    this.destroyRef.onDestroy(() => sub.unsubscribe());\n\n    if (this.props.autoFocus) {\n      setTimeout(() => this.focus(), 0);\n    }\n  }\n\n  /**\n   * Focuses the textarea element.\n   */\n  focus(): void {\n    const textarea = this.el.nativeElement.querySelector('textarea');\n    if (textarea) textarea.focus();\n  }\n\n  private resolveConfig() {\n    const instanceId = this.explicitInstanceId || `mn-textarea-${this.props.id}`;\n    this.uiConfig = this.configService.resolve<MnTextareaUIConfig>(\n      'mn-textarea',\n      this.sectionPath,\n      instanceId,\n    );\n\n    // Allow props to override uiConfig for label and placeholder\n    if (this.props.label) {\n      this.uiConfig = { ...this.uiConfig, label: this.props.label };\n    }\n    if (this.props.placeholder) {\n      this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n    }\n  }\n\n  // ========== ControlValueAccessor Implementation ==========\n\n  /**\n   * Writes a new value to the textarea element (called by Angular Forms).\n   *\n   * @param val - The value to write\n   */\n  writeValue(val: unknown): void {\n    this.value = val != null ? String(val) : null;\n    // The forms API writes in from outside (setValue, reset, patch); nothing marks\n    // this view for it.\n    this.cdr.markForCheck();\n  }\n\n  /**\n   * Registers a callback function to be called when the textarea value changes.\n   *\n   * @param fn - Callback function to notify Angular Forms of changes\n   */\n  registerOnChange(fn: (val: unknown) => void): void {\n    this.onChange = fn;\n  }\n\n  /**\n   * Registers a callback function to be called when the textarea is touched/blurred.\n   *\n   * @param fn - Callback function to notify Angular Forms of touch events\n   */\n  registerOnTouched(fn: () => void): void {\n    this.onTouched = fn;\n  }\n\n  /**\n   * Sets the disabled state of the textarea element.\n   *\n   * @param isDisabled - Whether the textarea should be disabled\n   */\n  setDisabledState(isDisabled: boolean): void {\n    this.isDisabled = isDisabled;\n    // `control.disable()` / `.enable()` reaches us the same way `writeValue` does —\n    // from the forms API, with no event behind it.\n    this.cdr.markForCheck();\n  }\n\n  // ========== Event Handlers ==========\n\n  /**\n   * Handles input events from the textarea element.\n   * Notifies Angular Forms of the new value.\n   *\n   * @param raw - Raw string value from the textarea element\n   */\n  handleInput(raw: string): void {\n    this.value = raw;\n    this.onChange(raw);\n  }\n\n  /**\n   * Handles blur events from the textarea element.\n   * Notifies Angular Forms that the textarea has been touched.\n   */\n  handleBlur(): void {\n    this.onTouched();\n  }\n\n  // ========== Error Handling ==========\n\n  /**\n   * Gets the FormControl instance from Angular Forms.\n   * Returns null if no control is attached.\n   */\n  get control() {\n    return this.ngControl?.control ?? null;\n  }\n\n  /**\n   * Determines whether to show error messages.\n   * Errors are shown when the control is invalid and has been touched or modified.\n   */\n  /**\n   * Ids of the rendered error messages, space-separated, for `aria-describedby`. Mirrors the\n   * `{id}-error` / `{id}-{index}-error` ids `mn-error-message` renders in single and show-all mode.\n   */\n  get errorDescribedBy(): string {\n    return this.props.showAllErrors\n      ? this.errorMessages.map((_, index) => `${this.resolvedId}-${index}-error`).join(' ')\n      : `${this.resolvedId}-error`;\n  }\n\n  get showError(): boolean {\n    const c = this.control;\n    return !!c && c.invalid && (c.touched || c.dirty);\n  }\n\n  /**\n   * Picks the error key to display based on errorPriority.\n   * Used when showAllErrors is false (default).\n   *\n   * @param errors - ValidationErrors object from the control\n   * @returns The error key to display\n   */\n  private pickErrorKey(errors: ValidationErrors): string {\n    if (this.props.errorPriority) {\n      for (const key of this.props.errorPriority) {\n        if (errors[key] !== undefined) {\n          return key;\n        }\n      }\n    }\n    return Object.keys(errors)[0];\n  }\n\n  protected isRequired(): boolean {\n    if (!this.control) return false;\n    return this.control.hasValidator(Validators.required);\n  }\n\n  /**\n   * Resolves a single error message for a specific error key.\n   *\n   * @param errorKey - The error key (e.g., 'required', 'minlength')\n   * @param errors - All validation errors on the control\n   * @returns The resolved error message string\n   */\n  private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n    const errorArgs = errors[errorKey];\n\n    const customMsg = this.props.errorMessages?.[errorKey];\n    const configMsg = this.uiConfig.errorMessages?.[errorKey];\n    const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n    const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n    const fallbackMsg = this.props.defaultErrorMessage;\n\n    const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n    if (typeof msgDef === 'function') {\n      return msgDef(errorArgs, errors);\n    }\n    // Interpolate {{placeholder}} tokens with validation error args\n    if (errorArgs && typeof errorArgs === 'object') {\n      return msgDef.replace(/\\{\\{(\\w+)}}/g, (_, key) => errorArgs[key] ?? _);\n    }\n    return msgDef;\n  }\n\n  /**\n   * Gets all error messages for the current control state.\n   *\n   * @returns Array of error message strings\n   */\n  get errorMessages(): string[] {\n    const errors = this.control?.errors;\n    if (!errors) return [];\n\n    const errorKeys = Object.keys(errors);\n    return errorKeys.map((key) => this.resolveErrorMessageForKey(key, errors));\n  }\n\n  /**\n   * Gets a single error message for the current control state.\n   *\n   * @returns Single error message string, or null if no errors\n   */\n  get errorMessage(): string | null {\n    const errors = this.control?.errors;\n    if (!errors) return null;\n\n    const errorKey = this.pickErrorKey(errors);\n    return this.resolveErrorMessageForKey(errorKey, errors);\n  }\n\n  // ========== Resolved Properties ==========\n\n  /** Resolved ID for the textarea element */\n  get resolvedId(): string {\n    return this.props.id;\n  }\n\n  /** Resolved name attribute for the textarea element */\n  get resolvedName(): string | null {\n    return this.props?.name ?? null;\n  }\n\n  /**\n   * Computes the CSS classes from tailwind-variants based on the props.\n   * Returns the variant classes for styling the textarea element.\n   */\n  get textareaClasses(): string {\n    return mnTextareaVariants({\n      size: this.props.size,\n      borderRadius: this.props.borderRadius,\n      shadow: this.props.shadow,\n      fullWidth: this.props.fullWidth,\n      resize: this.props.resize,\n    });\n  }\n}\n","<div class=\"flex flex-col h-full\" [class.is-fullwidth]=\"props.fullWidth\">\n  <!-- Label -->\n  @if (uiConfig.label || props.label) {\n    <label class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\" [attr.for]=\"resolvedId\">\n      <p>{{ uiConfig.label || props.label }}</p>\n      @if (isRequired()) {\n        <span class=\"text-error\" aria-hidden=\"true\">*</span>\n      }\n    </label>\n  }\n\n  <!-- Textarea Element -->\n  <textarea\n    [id]=\"resolvedId\"\n    [attr.aria-required]=\"isRequired() || null\"\n    [attr.name]=\"resolvedName\"\n    [attr.placeholder]=\"uiConfig.placeholder || null\"\n    [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || null\"\n    [attr.aria-invalid]=\"showError || null\"\n    [attr.aria-describedby]=\"showError ? errorDescribedBy : null\"\n    [disabled]=\"isDisabled\"\n    [attr.autocomplete]=\"props.autocomplete || null\"\n    [attr.rows]=\"props.rows ?? null\"\n    [attr.cols]=\"props.cols ?? null\"\n    [ngClass]=\"textareaClasses\"\n    (input)=\"handleInput(($any($event.target)).value)\"\n    (blur)=\"handleBlur()\"\n  >{{ value ?? '' }}</textarea>\n\n  <!-- Error Messages -->\n  @if (showError) {\n    <!-- Show all errors mode -->\n    @if (props.showAllErrors) {\n      <div class=\"flex flex-col gap-y-1\">\n        @for (error of errorMessages; track $index) {\n          <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n        }\n      </div>\n    } @else {\n    @if (errorMessage !== null) {\n      <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n      }\n    }\n  }\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnDatetimeVariants = tv({\n  base: 'bg-base-100 border-1 border-base-300 placeholder-base-content/50 cursor-pointer text-base-content text-sm',\n  variants: {\n    shadow: {\n      true: 'shadow-lg',\n    },\n    size: {\n      sm: 'px-2 py-1.5',\n      md: 'px-3 py-2',\n      lg: 'px-4 py-3',\n    },\n    borderRadius: {\n      none: 'rounded-none',\n      xs: 'rounded-xs',\n      sm: 'rounded-sm',\n      md: 'rounded-md',\n      lg: 'rounded-lg',\n      xl: 'rounded-xl',\n      two_xl: 'rounded-2xl',\n      three_xl: 'rounded-3xl',\n      four_xl: 'rounded-4xl',\n    },\n    fullWidth: {\n      true: 'w-full',\n    },\n    hover: {\n      true: 'hover:cursor-pointer hover:bg-base-200 transition-colors duration-300 ease-in-out',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    borderRadius: 'md',\n    hover: true,\n  },\n});\n\nexport type MnDatetimeVariants = VariantProps<typeof mnDatetimeVariants>;\n","import {\n  ChangeDetectorRef,\n  Component,\n  DestroyRef,\n  inject,\n  InjectionToken,\n  Input,\n  OnInit,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { LucideDynamicIcon } from '@lucide/angular';\nimport {\n  MnDatetimeErrorMessageData,\n  MnDatetimeMode,\n  MnDatetimeProps,\n  MnDatetimeUIConfig,\n} from './mn-datetimeTypes';\nimport { NgControl, ValidationErrors, Validators } from '@angular/forms';\nimport { mnDatetimeVariants } from './mn-datetimeVariants';\nimport { MnErrorMessage } from '../mn-error-message/mn-error-message';\nimport { MnConfigService } from 'mn-angular-lib/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from 'mn-angular-lib/core';\nimport { MnLanguageService } from 'mn-angular-lib/core';\nimport { skip } from 'rxjs';\nimport * as lucide from 'lucide';\nimport { lucideIcons } from 'mn-angular-lib/core';\n\n/** Lucide icons this file renders. */\nconst ICONS = lucideIcons({ CalendarDays: lucide.CalendarDays });\n\nexport const MN_DATETIME_CONFIG = new InjectionToken<MnDatetimeUIConfig>('MN_DATETIME_CONFIG');\n\n@Component({\n  selector: 'mn-lib-datetime',\n  standalone: true,\n  imports: [NgClass, NgTemplateOutlet, MnErrorMessage, LucideDynamicIcon],\n  templateUrl: './mn-datetime.html',\n  styles: `\n    input::-webkit-calendar-picker-indicator {\n      cursor: pointer;\n    }\n\n    /*\n     * iOS Safari renders native date/time inputs with a large, fixed intrinsic\n     * width and largely ignores the CSS box model (width / flex shrinking) while\n     * the native appearance is active. In a fullWidth / flex layout this makes the\n     * control overflow narrow screens (\"too big, doesn't fit\") on iPhone, even\n     * though Android and desktop honour the width. Resetting the native appearance\n     * and clearing the intrinsic min-width lets width:100% take effect so the input\n     * shrinks to its container. Scoped to coarse pointers so mouse-driven desktop\n     * browsers keep their native calendar-picker indicator untouched.\n     */\n    @media (pointer: coarse) {\n      input[type='date'],\n      input[type='datetime-local'],\n      input[type='time'],\n      input[type='month'],\n      input[type='week'] {\n        -webkit-appearance: none;\n        appearance: none;\n        min-width: 0;\n        box-sizing: border-box;\n      }\n    }\n  `,\n  host: {\n    // Native date/time inputs have a platform-specific intrinsic width. Without an\n    // explicit host width the inline host collapses to that intrinsic size, so the\n    // input's `w-full` (width:100%) resolves against a content-sized box and fails to\n    // fill the parent on real mobile devices (desktop devtools hides this because it\n    // still renders the control with the desktop engine). Give the host a real width\n    // when fullWidth is requested so 100% has something to fill.\n    '[style.display]': \"props?.fullWidth ? 'block' : null\",\n    '[style.width]': \"props?.fullWidth ? '100%' : null\",\n  },\n})\nexport class MnDatetime implements OnInit {\n  /** Lucide icons the template renders. */\n  protected readonly icons = ICONS;\n\n  ngControl = inject(NgControl, { optional: true, self: true });\n\n  protected uiConfig: MnDatetimeUIConfig = {};\n\n  @Input({ required: true }) props!: MnDatetimeProps;\n\n  private readonly configService = inject(MnConfigService);\n  private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n  private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n  /** Marks the view when a locale change re-resolves the config (OnPush). */\n  private readonly cdr = inject(ChangeDetectorRef);\n  private readonly lang = inject(MnLanguageService);\n  private readonly destroyRef = inject(DestroyRef);\n\n  value: string | null = null;\n  isDisabled = false;\n\n  private onChange: (val: unknown) => void = () => {};\n  private onTouched: () => void = () => {};\n\n  private readonly builtInErrorMessages: Record<string, MnDatetimeErrorMessageData> = {\n    required: 'This field is required',\n    mnMin: (args) => `Date/time must be from ${args.min} onwards`,\n    mnMax: (args) => `Date/time must be up to ${args.max}`,\n  };\n\n  constructor() {\n    if (this.ngControl) this.ngControl.valueAccessor = this;\n  }\n\n  ngOnInit() {\n    // `showError` reads the control's touched/dirty/invalid state straight off the form.\n    // Those move from the forms API — `markAllAsTouched()` when the user tries to submit, a\n    // programmatic `setErrors` — never through an event on this component, so under OnPush\n    // the message would never appear. `events` covers value, status, touched and pristine.\n    const formControl = this.ngControl?.control;\n    if (formControl) {\n      const stateSub = formControl.events.subscribe(() => this.cdr.markForCheck());\n      this.destroyRef.onDestroy(() => stateSub.unsubscribe());\n    }\n\n    this.resolveConfig();\n\n    const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n      this.resolveConfig();\n      // `resolveConfig` rewrites plain fields the template reads; under OnPush nothing else\n      // marks this view for the locale change.\n      this.cdr.markForCheck();\n    });\n    this.destroyRef.onDestroy(() => sub.unsubscribe());\n  }\n\n  private resolveConfig() {\n    const instanceId = this.explicitInstanceId || `mn-datetime-${this.props.id}`;\n    this.uiConfig = this.configService.resolve<MnDatetimeUIConfig>(\n      'mn-datetime',\n      this.sectionPath,\n      instanceId,\n    );\n\n    if (this.props.label) {\n      this.uiConfig = { ...this.uiConfig, label: this.props.label };\n    }\n    if (this.props.placeholder) {\n      this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n    }\n  }\n\n  // ========== ControlValueAccessor Implementation ==========\n\n  writeValue(val: unknown): void {\n    if (val != null) {\n      let str = String(val);\n      // Convert ISO 8601 strings (e.g. \"2025-01-01T10:00:00.000Z\") to datetime-local format\n      if (str.includes('T') && (str.endsWith('Z') || /[+-]\\d{2}:\\d{2}$/.test(str))) {\n        const date = new Date(str);\n        if (!isNaN(date.getTime())) {\n          const pad = (n: number) => n.toString().padStart(2, '0');\n          str = `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}T${pad(date.getHours())}:${pad(date.getMinutes())}`;\n        }\n      }\n      this.value = str;\n    } else {\n      this.value = null;\n    }\n    // The forms API writes in from outside (setValue, reset, patch); nothing marks\n    // this view for it.\n    this.cdr.markForCheck();\n  }\n\n  registerOnChange(fn: (val: unknown) => 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.isDisabled = isDisabled;\n    // `control.disable()` / `.enable()` reaches us the same way `writeValue` does —\n    // from the forms API, with no event behind it.\n    this.cdr.markForCheck();\n  }\n\n  // ========== Event Handlers ==========\n\n  handleInput(raw: string): void {\n    this.value = raw;\n    this.onChange(raw);\n  }\n\n  handleBlur(): void {\n    this.onTouched();\n  }\n\n  handleClick(input: HTMLInputElement): void {\n    try {\n      input.showPicker();\n    } catch {\n      // picker already open (icon click) or browser restriction\n    }\n  }\n\n  // ========== Error Handling ==========\n\n  get control() {\n    return this.ngControl?.control ?? null;\n  }\n\n  get showError(): boolean {\n    const c = this.control;\n    return !!c && c.invalid && (c.touched || c.dirty);\n  }\n\n  private pickErrorKey(errors: ValidationErrors): string {\n    if (this.props.errorPriority) {\n      for (const key of this.props.errorPriority) {\n        if (errors[key] !== undefined) {\n          return key;\n        }\n      }\n    }\n    return Object.keys(errors)[0];\n  }\n\n  protected isRequired(): boolean {\n    if (!this.control) return false;\n    return this.control.hasValidator(Validators.required);\n  }\n\n  private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n    const errorArgs = errors[errorKey];\n    const customMsg = this.props.errorMessages?.[errorKey];\n    const configMsg = this.uiConfig.errorMessages?.[errorKey];\n    const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n    const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n    const fallbackMsg = this.props.defaultErrorMessage;\n    const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n    if (typeof msgDef === 'function') {\n      return msgDef(errorArgs, errors);\n    }\n    return msgDef;\n  }\n\n  get errorMessages(): string[] {\n    const errors = this.control?.errors;\n    if (!errors) return [];\n    return Object.keys(errors).map((key) => this.resolveErrorMessageForKey(key, errors));\n  }\n\n  get errorMessage(): string | null {\n    const errors = this.control?.errors;\n    if (!errors) return null;\n    const errorKey = this.pickErrorKey(errors);\n    return this.resolveErrorMessageForKey(errorKey, errors);\n  }\n\n  // ========== Resolved Properties ==========\n\n  get resolvedId(): string {\n    return this.props.id;\n  }\n\n  get resolvedName(): string | null {\n    return this.props?.name ?? null;\n  }\n\n  get resolvedMode(): MnDatetimeMode {\n    return this.props.mode ?? 'datetime-local';\n  }\n\n  /** Whether the control renders as an icon-only button rather than a full input. */\n  get iconOnly(): boolean {\n    return this.props.iconOnly === true;\n  }\n\n  /**\n   * Accessible name for the input. Prefers an explicit ariaLabel/label; for the\n   * icon-only variant — which has no visible text — it falls back to the\n   * placeholder so the button is never left unnamed.\n   */\n  get resolvedAriaLabel(): string | null {\n    const explicit = this.uiConfig.ariaLabel || this.uiConfig.label || this.props.label;\n    if (explicit) return explicit;\n    return this.iconOnly ? this.uiConfig.placeholder || this.props.placeholder || null : null;\n  }\n\n  /** Lucide icon size (px) tracking the field size, used only in the icon-only variant. */\n  get iconSize(): number {\n    if (this.props.size === 'sm') return 16;\n    if (this.props.size === 'lg') return 20;\n    return 18;\n  }\n\n  get inputClasses(): string {\n    // Icon-only: the input becomes a transparent click target filling the icon box,\n    // which carries the visible styling. `iconBoxClasses` provides the box itself.\n    if (this.iconOnly) {\n      return 'absolute inset-0 h-full w-full cursor-pointer opacity-0';\n    }\n    return mnDatetimeVariants({\n      size: this.props.size,\n      borderRadius: this.props.borderRadius,\n      shadow: this.props.shadow,\n      fullWidth: this.props.fullWidth,\n      hover: this.props.hover,\n    });\n  }\n\n  /**\n   * Classes for the icon-only box: the same border/background/radius/hover the full\n   * input would wear (reused from the variant), made a positioning context for the\n   * overlaid input, with a `focus-within` ring standing in for the transparent\n   * input's own focus outline.\n   */\n  get iconBoxClasses(): string {\n    return [\n      mnDatetimeVariants({\n        size: this.props.size,\n        borderRadius: this.props.borderRadius,\n        shadow: this.props.shadow,\n        hover: this.props.hover,\n      }),\n      'relative inline-flex items-center justify-center text-base-content/70',\n      'focus-within:outline-2 focus-within:outline-offset-2 focus-within:outline-primary',\n    ].join(' ');\n  }\n}\n","<div class=\"flex flex-col h-full\" [class.is-fullwidth]=\"props.fullWidth\">\n  @if (uiConfig.label || props.label) {\n    <label class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\" [attr.for]=\"resolvedId\">\n      <p>{{ uiConfig.label || props.label }}</p>\n      @if (isRequired()) {\n        <span class=\"text-error\" aria-hidden=\"true\">*</span>\n      }\n    </label>\n  }\n\n  @if (iconOnly) {\n    <!--\n      Icon-only variant: a bordered box holding a calendar icon, with the native\n      input layered on top at zero opacity. The box carries the look (border,\n      background, radius, hover, focus ring); the input stays a real, focusable\n      form control that opens the picker on click. `focus-within` on the box\n      surfaces the keyboard focus ring, since the input itself is transparent.\n    -->\n    <div [ngClass]=\"iconBoxClasses\">\n      <svg [size]=\"iconSize\" [lucideIcon]=\"icons.CalendarDays\" aria-hidden=\"true\" class=\"pointer-events-none\"></svg>\n      <ng-container [ngTemplateOutlet]=\"inputTemplate\"></ng-container>\n    </div>\n  } @else {\n    <ng-container [ngTemplateOutlet]=\"inputTemplate\"></ng-container>\n  }\n\n  @if (showError) {\n    @if (props.showAllErrors) {\n      <div class=\"flex flex-col gap-y-1\">\n        @for (error of errorMessages; track $index) {\n          <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n        }\n      </div>\n    } @else {\n      @if (errorMessage !== null) {\n        <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n      }\n    }\n  }\n</div>\n\n<!-- Single input definition, rendered either bare or inside the icon box above,\n     so both variants share exactly the same bindings and behaviour. -->\n<ng-template #inputTemplate>\n  <input\n    #dateInput\n    [id]=\"resolvedId\"\n    [attr.aria-required]=\"isRequired() || null\"\n    [attr.name]=\"resolvedName\"\n    [type]=\"resolvedMode\"\n    [attr.placeholder]=\"uiConfig.placeholder || props.placeholder || null\"\n    [attr.aria-label]=\"resolvedAriaLabel\"\n    [attr.aria-invalid]=\"showError || null\"\n    [attr.aria-describedby]=\"showError ? resolvedId + '-error' : null\"\n    [disabled]=\"isDisabled\"\n    [attr.min]=\"props.min || null\"\n    [attr.max]=\"props.max || null\"\n    [attr.step]=\"props.step || null\"\n    [value]=\"value ?? ''\"\n    [ngClass]=\"inputClasses\"\n    (click)=\"handleClick(dateInput)\"\n    (input)=\"handleInput(($any($event.target)).value)\"\n    (blur)=\"handleBlur()\"\n  />\n</ng-template>\n","import {tv, type VariantProps} from 'tailwind-variants';\n\n/**\n * Tailwind-variants definition for the MnFileInput component.\n *\n * Mirrors the styling vocabulary of {@link mnInputFieldVariants} (size,\n * borderRadius, shadow, fullWidth, disabled) so a file input visually matches the\n * rest of the input family, and adds a `dropzone` toggle for the large dashed\n * drop area used by the default display mode plus a `dragging` toggle for the\n * \"release to drop\" state while files hover over that dropzone.\n */\nexport const mnFileInputVariants = tv({\n  base: 'bg-base-100 border-1 border-base-300 text-base-content text-sm outline-none transition-all duration-300 ease-in-out',\n  variants: {\n    /** Inner padding scale of the clickable control. */\n    size: {\n      sm: 'p-2',\n      md: 'p-3',\n      lg: 'p-4',\n    },\n    /** Corner rounding of the control. */\n    borderRadius: {\n      none: 'rounded-none',\n      xs: 'rounded-xs',\n      sm: 'rounded-sm',\n      md: 'rounded-md',\n      lg: 'rounded-lg',\n      xl: 'rounded-xl',\n      two_xl: 'rounded-2xl',\n      three_xl: 'rounded-3xl',\n      four_xl: 'rounded-4xl',\n    },\n    /** Drop shadow toggle. */\n    shadow: {\n      true: 'shadow-lg',\n    },\n    /** Stretch the control to the full width of its container. */\n    fullWidth: {\n      true: 'w-full',\n    },\n    /** Renders the control as a large dashed dropzone with a hover accent. */\n    dropzone: {\n      true: 'flex flex-col items-center justify-center gap-2 p-6 border-2 border-dashed text-center cursor-pointer hover:border-primary',\n    },\n    /** Highlighted \"release to drop\" appearance while files hover the dropzone. */\n    dragging: {\n      true: 'border-primary bg-primary/10 ring-4 ring-primary/20 scale-[1.01] duration-150',\n    },\n    /** Dimmed, non-interactive appearance. */\n    disabled: {\n      true: 'opacity-50 cursor-not-allowed pointer-events-none',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    borderRadius: 'lg',\n  },\n});\n\n/** Variant prop types derived from {@link mnFileInputVariants}. */\nexport type MnFileInputVariants = VariantProps<typeof mnFileInputVariants>;\n","import {\n  ChangeDetectorRef,\n  Component,\n  computed,\n  DestroyRef,\n  EventEmitter,\n  inject,\n  Input,\n  OnInit,\n  Output,\n  signal,\n} from '@angular/core';\nimport { CommonModule, NgClass } from '@angular/common';\nimport { NgControl, ValidationErrors, Validators } from '@angular/forms';\nimport { skip } from 'rxjs';\nimport {\n  MnFileInputDisplayMode,\n  MnFileInputErrorMessageData,\n  MnFileInputProps,\n  MnFileInputUIConfig,\n} from './mn-file-inputTypes';\nimport { mnFileInputVariants } from './mn-file-inputVariants';\nimport { MnErrorMessage } from '../mn-error-message/mn-error-message';\nimport { LucideDynamicIcon } from '@lucide/angular';\nimport { MnConfigService } from 'mn-angular-lib/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from 'mn-angular-lib/core';\nimport { MnLanguageService } from 'mn-angular-lib/core';\nimport { MnValidationErrorArgs } from 'mn-angular-lib/core';\nimport * as lucide from 'lucide';\nimport { lucideIcons } from 'mn-angular-lib/core';\n\n/** Lucide icons this file renders. */\nconst ICONS = lucideIcons({\n  File: lucide.File,\n  ImagePlus: lucide.ImagePlus,\n  Trash2: lucide.Trash2,\n  Upload: lucide.Upload,\n  X: lucide.X,\n});\n\n/** A single renderable entry in the file input (a newly-selected file or an existing image). */\nexport type MnFileDisplayItem = {\n  /** File name (new files) or a derived name (existing images). */\n  name: string;\n  /** Whether the entry should render as an image preview. */\n  isImage: boolean;\n  /** Object-URL (new image files) or saved URL (existing images), else null. */\n  previewUrl: string | null;\n  /** Human-readable size for new files, else null. */\n  sizeLabel: string | null;\n  /** Index used by the remove action. */\n  index: number;\n  /** True for an already-saved image passed via `currentUrl(s)`. */\n  existing: boolean;\n};\n\n/**\n * MnFileInput Component\n *\n * A generic, accessible file input that implements Angular's ControlValueAccessor.\n * It styles selection to match the rest of the input family, shows image previews\n * (and a file icon + name for non-images), supports single or multiple selection,\n * several display layouts, and client-side `accept` / `maxSize` / `maxFiles` limits.\n *\n * Every display mode but `compact` is also a real drop target: dragging files\n * over it switches the area to a highlighted \"release to drop\" state, and\n * dropping runs the files through the same validation as the file picker.\n *\n * The form control value is the plain selection: `File | null` (single) or\n * `File[]` (multiple). An optional `currentUrl`/`currentUrls` renders an\n * already-saved image; removing it leaves the value untouched and emits `cleared`.\n *\n * @example\n * ```html\n * <mn-lib-file-input\n *   formControlName=\"image\"\n *   [props]=\"{ id: 'image', label: 'Cover', accept: 'image/*', displayMode: 'dropzone' }\"\n *   (cleared)=\"onRemoveExisting()\">\n * </mn-lib-file-input>\n * ```\n */\n@Component({\n  selector: 'mn-lib-file-input',\n  standalone: true,\n  imports: [CommonModule, NgClass, MnErrorMessage, LucideDynamicIcon],\n  templateUrl: './mn-file-input.html',\n})\nexport class MnFileInput implements OnInit {\n  /** Lucide icons the template renders. */\n  protected readonly icons = ICONS;\n\n  ngControl = inject(NgControl, { optional: true, self: true });\n  /** Configuration properties for the file input. */\n  @Input({ required: true }) props!: MnFileInputProps;\n  /** Emits whenever the selected file(s) change (in addition to the form control). */\n  @Output() filesChange = new EventEmitter<File | File[] | null>();\n  /** Emits when the user removes an already-saved image (`currentUrl(s)`). */\n  @Output() cleared = new EventEmitter<void>();\n  /** Resolved UI configuration for the file input. */\n  protected uiConfig: MnFileInputUIConfig = {};\n  /** Currently selected files (always an array internally). */\n  protected readonly files = signal<File[]>([]);\n  /** True while files are dragged over the dropzone (\"release to drop\" state). */\n  protected readonly isDragging = signal(false);\n  /** Transient message for a rejected selection (accept/maxSize/maxFiles). */\n  protected readonly internalError = signal<string | null>(null);\n  private readonly configService = inject(MnConfigService);\n  private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n  private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n  /** Marks the view when a locale change re-resolves the config (OnPush). */\n  private readonly cdr = inject(ChangeDetectorRef);\n  private readonly lang = inject(MnLanguageService);\n  private readonly destroyRef = inject(DestroyRef);\n  /** Object-URL previews aligned to {@link files}; null for non-image entries. */\n  private readonly previewUrls = signal<(string | null)[]>([]);\n  /** True once the user removed the single existing image. */\n  private readonly currentCleared = signal(false);\n  /** Indices of removed existing images (multiple mode). */\n  private readonly removedExisting = signal<Set<number>>(new Set());\n  /** Renderable entries: existing images (when nothing newer hides them) then new files. */\n  readonly displayItems = computed<MnFileDisplayItem[]>(() => {\n    const items: MnFileDisplayItem[] = [];\n\n    if (this.props.multiple) {\n      const urls = this.props.currentUrls ?? [];\n      const removed = this.removedExisting();\n      urls.forEach((url, i) => {\n        if (!removed.has(i)) items.push(this.existingItem(url, i));\n      });\n    } else if (this.files().length === 0 && this.props.currentUrl && !this.currentCleared()) {\n      items.push(this.existingItem(this.props.currentUrl, 0));\n    }\n\n    const previews = this.previewUrls();\n    this.files().forEach((file, i) => {\n      items.push({\n        name: file.name,\n        isImage: this.isImage(file),\n        previewUrl: previews[i] ?? null,\n        sizeLabel: this.humanFileSize(file.size),\n        index: i,\n        existing: false,\n      });\n    });\n\n    return items;\n  });\n  /** Disabled state pushed by the forms API. */\n  private formDisabled = false;\n  /**\n   * Nesting depth of the current drag, so that moving across child elements of\n   * the dropzone does not flicker {@link isDragging} off and on again.\n   */\n  private dragDepth = 0;\n  /**\n   * Built-in default error messages in English.\n   * Used when `useBuiltInErrorMessages` is true (default); overridable per-field.\n   */\n  private readonly builtInErrorMessages: Record<string, MnFileInputErrorMessageData> = {\n    required: 'This field is required',\n    accept: 'This file type is not allowed',\n    maxSize: (args) => `File is too large (max ${args.max})`,\n    maxFiles: (args) => `Too many files (max ${args.max})`,\n  };\n\n  /** Registers this component as the ControlValueAccessor for the injected control. */\n  constructor() {\n    if (this.ngControl) this.ngControl.valueAccessor = this;\n  }\n\n  /** The effective display mode. */\n  get displayMode(): MnFileInputDisplayMode {\n    return this.props.displayMode ?? 'dropzone';\n  }\n\n  /**\n   * Whether the current display mode acts as a drop target. `compact` is an\n   * inline button sized for a form row, too small to aim a drag at.\n   */\n  get supportsDrop(): boolean {\n    return this.displayMode !== 'compact';\n  }\n\n  /** Whether the control is disabled (via props or the forms API). */\n  get isDisabled(): boolean {\n    return this.formDisabled || !!this.props.disabled;\n  }\n\n  /** Native `accept` attribute value, or null for no restriction when unset. */\n  get acceptAttr(): string | null {\n    return this.props.accept ?? null;\n  }\n\n  // ========== ControlValueAccessor Implementation ==========\n\n  /** Resolved id for the file input element. */\n  get resolvedId(): string {\n    return this.props.id;\n  }\n\n  /** Resolved name attribute for the file input element. */\n  get resolvedName(): string | null {\n    return this.props.name ?? null;\n  }\n\n  /** Tailwind-variant classes for the clickable control. */\n  get controlClasses(): string {\n    return mnFileInputVariants({\n      size: this.props.size,\n      borderRadius: this.props.borderRadius,\n      shadow: this.props.shadow,\n      fullWidth: this.props.fullWidth ?? this.displayMode !== 'compact',\n      dropzone: this.displayMode === 'dropzone',\n      dragging: this.isDragging(),\n      disabled: this.isDisabled,\n    });\n  }\n\n  /** The attached form control, if any. */\n  get control() {\n    return this.ngControl?.control ?? null;\n  }\n\n  // ========== Selection handling ==========\n\n  /** Whether to show control validation errors. */\n  get showError(): boolean {\n    const c = this.control;\n    return !!c && c.invalid && (c.touched || c.dirty);\n  }\n\n  /** All control error messages (used when `showAllErrors` is true). */\n  get errorMessages(): string[] {\n    const errors = this.control?.errors;\n    if (!errors) return [];\n    return Object.keys(errors).map((key) => this.resolveControlError(key, errors));\n  }\n\n  /** Single control error message (priority-aware). */\n  get errorMessage(): string | null {\n    const errors = this.control?.errors;\n    if (!errors) return null;\n    return this.resolveControlError(this.pickErrorKey(errors), errors);\n  }\n\n  ngOnInit(): void {\n    // `showError` reads the control's touched/dirty/invalid state straight off the form.\n    // Those move from the forms API — `markAllAsTouched()` when the user tries to submit, a\n    // programmatic `setErrors` — never through an event on this component, so under OnPush\n    // the message would never appear. `events` covers value, status, touched and pristine.\n    const formControl = this.ngControl?.control;\n    if (formControl) {\n      const stateSub = formControl.events.subscribe(() => this.cdr.markForCheck());\n      this.destroyRef.onDestroy(() => stateSub.unsubscribe());\n    }\n\n    this.resolveConfig();\n\n    const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n      this.resolveConfig();\n      // See mn-input-field: OnPush needs the locale change announced.\n      this.cdr.markForCheck();\n    });\n    this.destroyRef.onDestroy(() => sub.unsubscribe());\n    this.destroyRef.onDestroy(() => this.revokeAll());\n  }\n\n  /**\n   * Writes a value from the form into the control.\n   * @param val A `File`, an array of `File`, or null/undefined.\n   */\n  writeValue(val: unknown): void {\n    const next = Array.isArray(val)\n      ? val.filter((f): f is File => f instanceof File)\n      : val instanceof File\n        ? [val]\n        : [];\n    this.setFiles(next);\n    // The forms API writes in from outside (setValue, reset, patch); nothing marks\n    // this view for it.\n    this.cdr.markForCheck();\n  }\n\n  /**\n   * Registers the form's change callback.\n   * @param fn Callback invoked with the new value.\n   */\n  registerOnChange(fn: (val: unknown) => void): void {\n    this.onChange = fn;\n  }\n\n  /**\n   * Registers the form's touched callback.\n   * @param fn Callback invoked when the control is touched.\n   */\n  registerOnTouched(fn: () => void): void {\n    this.onTouched = fn;\n  }\n\n  // ========== Derived view state ==========\n\n  /**\n   * Sets the disabled state of the control.\n   * @param isDisabled Whether the control should be disabled.\n   */\n  setDisabledState(isDisabled: boolean): void {\n    this.formDisabled = isDisabled;\n    // `control.disable()` / `.enable()` reaches us the same way `writeValue` does —\n    // from the forms API, with no event behind it.\n    this.cdr.markForCheck();\n  }\n\n  /**\n   * Handles a file-picker change: validates the incoming files against the\n   * configured limits and updates the selection.\n   * @param event The native change event from the hidden file input.\n   */\n  onFileSelected(event: Event): void {\n    const input = event.target as HTMLInputElement;\n    const incoming = Array.from(input.files ?? []);\n    input.value = '';\n    if (incoming.length === 0) return;\n    this.addFiles(incoming);\n  }\n\n  /**\n   * Arms the \"release to drop\" state when a file drag enters the dropzone.\n   * @param event The native dragenter event.\n   */\n  onDragEnter(event: DragEvent): void {\n    if (!this.acceptsDrag(event)) return;\n    event.preventDefault();\n    this.dragDepth++;\n    this.isDragging.set(true);\n  }\n\n  /**\n   * Keeps the drop target alive; without a prevented dragover the browser never\n   * fires a drop event.\n   * @param event The native dragover event.\n   */\n  onDragOver(event: DragEvent): void {\n    if (!this.acceptsDrag(event)) return;\n    event.preventDefault();\n    if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy';\n    this.isDragging.set(true);\n  }\n\n  /**\n   * Disarms the \"release to drop\" state once the drag has left the dropzone\n   * entirely (and not merely crossed into one of its children).\n   * @param event The native dragleave event.\n   */\n  onDragLeave(event: DragEvent): void {\n    if (!this.isDragging()) return;\n    event.preventDefault();\n    this.dragDepth = Math.max(0, this.dragDepth - 1);\n    if (this.dragDepth === 0) this.isDragging.set(false);\n  }\n\n  /**\n   * Accepts the dropped files through the same validation as the file picker.\n   * @param event The native drop event.\n   */\n  onDrop(event: DragEvent): void {\n    if (!this.acceptsDrag(event)) return;\n    event.preventDefault();\n    this.resetDrag();\n    const dropped = Array.from(event.dataTransfer?.files ?? []);\n    if (dropped.length === 0) return;\n    this.addFiles(dropped);\n  }\n\n  /**\n   * Removes a newly-selected file by index.\n   * @param index Index into the current selection.\n   */\n  removeFile(index: number): void {\n    const next = this.files().filter((_, i) => i !== index);\n    this.internalError.set(null);\n    this.setFiles(next);\n    this.emit();\n  }\n\n  /**\n   * Removes an already-saved image and notifies the consumer via `cleared`.\n   * @param index Index of the existing image (0 in single mode).\n   */\n  removeExisting(index: number): void {\n    if (this.props.multiple) {\n      const set = new Set(this.removedExisting());\n      set.add(index);\n      this.removedExisting.set(set);\n    } else {\n      this.currentCleared.set(true);\n    }\n    this.cleared.emit();\n    this.onTouched();\n  }\n\n  /** Whether the attached control carries a `required` validator. */\n  protected isRequired(): boolean {\n    return this.control?.hasValidator(Validators.required) ?? false;\n  }\n\n  /** Stable track key for a display item across renders. */\n  protected itemKey(item: MnFileDisplayItem): string {\n    return `${item.existing ? 'e' : 'f'}-${item.index}`;\n  }\n\n  /** Whether a file should render as an image. */\n  protected isImage(file: File): boolean {\n    return (file.type ?? '').startsWith('image/');\n  }\n\n  /** Callback to notify Angular forms of value changes. */\n  private onChange: (val: unknown) => void = () => {};\n\n  // ========== Error handling (control validators) ==========\n\n  /** Callback to notify Angular forms when the control is touched. */\n  private onTouched: () => void = () => {};\n\n  /** Resolves UI strings from config, layering built-in defaults and prop overrides. */\n  private resolveConfig(): void {\n    const instanceId = this.explicitInstanceId || `mn-file-input-${this.props.id}`;\n    const resolved = this.configService.resolve<MnFileInputUIConfig>(\n      'mn-file-input',\n      this.sectionPath,\n      instanceId,\n    );\n\n    const builtIn: MnFileInputUIConfig = {\n      dropzoneHint: 'Click to upload or drag and drop',\n      dropActiveHint: 'Release to drop',\n      replaceLabel: 'Replace',\n      removeLabel: 'Remove',\n    };\n\n    this.uiConfig = { ...builtIn, ...resolved };\n    if (this.props.label) this.uiConfig = { ...this.uiConfig, label: this.props.label };\n    if (this.props.dropzoneHint)\n      this.uiConfig = { ...this.uiConfig, dropzoneHint: this.props.dropzoneHint };\n    if (this.props.dropActiveHint)\n      this.uiConfig = { ...this.uiConfig, dropActiveHint: this.props.dropActiveHint };\n    if (this.props.replaceLabel)\n      this.uiConfig = { ...this.uiConfig, replaceLabel: this.props.replaceLabel };\n    if (this.props.removeLabel)\n      this.uiConfig = { ...this.uiConfig, removeLabel: this.props.removeLabel };\n  }\n\n  /**\n   * Validates and merges newly-picked files into the current selection.\n   * @param incoming The files chosen by the user.\n   */\n  private addFiles(incoming: File[]): void {\n    this.internalError.set(null);\n    let errorKey: string | null = null;\n    let errorArgs: MnValidationErrorArgs = {};\n\n    let accepted = incoming.filter((f) => this.matchesAccept(f));\n    if (accepted.length < incoming.length) errorKey = 'accept';\n\n    if (this.props.maxSize != null) {\n      const max = this.props.maxSize;\n      const withinSize = accepted.filter((f) => f.size <= max);\n      if (withinSize.length < accepted.length) {\n        errorKey = 'maxSize';\n        errorArgs = { max: this.humanFileSize(max) };\n      }\n      accepted = withinSize;\n    }\n\n    let next = this.props.multiple ? [...this.files(), ...accepted] : accepted.slice(-1);\n\n    if (this.props.multiple && this.props.maxFiles != null && next.length > this.props.maxFiles) {\n      next = next.slice(0, this.props.maxFiles);\n      errorKey = 'maxFiles';\n      errorArgs = { max: this.props.maxFiles };\n    }\n\n    if (errorKey) this.internalError.set(this.resolveMessage(errorKey, errorArgs));\n\n    this.setFiles(next);\n    this.emit();\n  }\n\n  /** Replaces the internal selection and rebuilds image previews. */\n  private setFiles(next: File[]): void {\n    this.revokeAll();\n    this.files.set(next);\n    this.previewUrls.set(next.map((f) => (this.isImage(f) ? URL.createObjectURL(f) : null)));\n  }\n\n  /** Emits the current value to the form and any listeners. */\n  private emit(): void {\n    const value = this.props.multiple ? this.files() : (this.files()[0] ?? null);\n    this.onChange(value);\n    this.onTouched();\n    this.filesChange.emit(value);\n  }\n\n  /** Revokes any outstanding object-URL previews to avoid leaks. */\n  private revokeAll(): void {\n    for (const url of this.previewUrls()) {\n      if (url) URL.revokeObjectURL(url);\n    }\n  }\n\n  /** Builds a display item for an already-saved image. */\n  private existingItem(url: string, index: number): MnFileDisplayItem {\n    return {\n      name: this.fileNameFromUrl(url),\n      isImage: true,\n      previewUrl: url,\n      sizeLabel: null,\n      index,\n      existing: true,\n    };\n  }\n\n  /** Picks which control error key to display. */\n  private pickErrorKey(errors: ValidationErrors): string {\n    if (this.props.errorPriority) {\n      for (const key of this.props.errorPriority) {\n        if (errors[key] !== undefined) return key;\n      }\n    }\n    return Object.keys(errors)[0];\n  }\n\n  // ========== Helpers ==========\n\n  /** Resolves a control error key to a message, interpolating its args. */\n  private resolveControlError(key: string, errors: ValidationErrors): string {\n    return this.resolveMessage(key, errors[key] as MnValidationErrorArgs);\n  }\n\n  /**\n   * Resolves a message for an error key using the same precedence as the other\n   * inputs: custom props > config > built-in > fallback > default.\n   */\n  private resolveMessage(key: string, args: MnValidationErrorArgs | undefined): string {\n    const customMsg = this.props.errorMessages?.[key];\n    const configMsg = this.uiConfig.errorMessages?.[key];\n    const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n    const builtInMsg = useBuiltIn ? this.builtInErrorMessages[key] : undefined;\n    const fallbackMsg = this.props.defaultErrorMessage;\n\n    const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n    if (typeof msgDef === 'function') {\n      return msgDef(args ?? {}, {});\n    }\n    if (args && typeof args === 'object') {\n      return msgDef.replace(/\\{\\{(\\w+)}}/g, (_match: string, token: string) => {\n        const value = (args as Record<string, unknown>)[token];\n        return value !== undefined ? String(value) : `{{${token}}}`;\n      });\n    }\n    return msgDef;\n  }\n\n  /**\n   * Whether a drag event should be treated as a file drop on this control.\n   * Ignores disabled controls, modes without a drop target, and drags that\n   * carry something other than files (selected text, a link, …) so the page\n   * keeps its default behaviour.\n   */\n  private acceptsDrag(event: DragEvent): boolean {\n    if (this.isDisabled || !this.supportsDrop) return false;\n    const types = event.dataTransfer?.types;\n    return !types || Array.from(types).includes('Files');\n  }\n\n  /** Clears the drag state and its nesting counter. */\n  private resetDrag(): void {\n    this.dragDepth = 0;\n    this.isDragging.set(false);\n  }\n\n  /** Checks a file against the configured `accept` filter (extensions and MIME globs). */\n  private matchesAccept(file: File): boolean {\n    const accept = this.props.accept;\n    if (!accept) return true;\n    const tokens = accept\n      .split(',')\n      .map((t) => t.trim().toLowerCase())\n      .filter(Boolean);\n    if (tokens.length === 0) return true;\n    const name = file.name.toLowerCase();\n    const type = (file.type ?? '').toLowerCase();\n    return tokens.some((token) => {\n      if (token.startsWith('.')) return name.endsWith(token);\n      if (token.endsWith('/*')) return type.startsWith(token.slice(0, -1));\n      return type === token;\n    });\n  }\n\n  /** Formats a byte count as a human-readable size. */\n  private humanFileSize(bytes: number): string {\n    if (bytes < 1024) return `${bytes} B`;\n    if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;\n    return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;\n  }\n\n  /** Derives a display name from a URL (last path segment). */\n  private fileNameFromUrl(url: string): string {\n    const clean = url.split('?')[0].split('#')[0];\n    const segment = clean.substring(clean.lastIndexOf('/') + 1);\n    return segment || 'image';\n  }\n}\n","<!--\n  Drag handling sits on the wrapper so a drop anywhere inside the control counts.\n  onDragEnter/onDragLeave balance out as the drag crosses children, and\n  acceptsDrag() ignores the modes that have no drop target.\n-->\n<div\n  (dragenter)=\"onDragEnter($event)\"\n  (dragleave)=\"onDragLeave($event)\"\n  (dragover)=\"onDragOver($event)\"\n  (drop)=\"onDrop($event)\"\n  [class.w-full]=\"props.fullWidth !== false && displayMode !== 'compact'\"\n  class=\"flex flex-col\">\n  <!-- Label -->\n  @if (uiConfig.label) {\n    <label [attr.for]=\"resolvedId\" class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\">\n      <p>{{ uiConfig.label }}</p>\n      @if (isRequired()) {\n        <span class=\"text-error\" aria-hidden=\"true\">*</span>\n      }\n    </label>\n  }\n\n  <!-- Hidden native file input shared by every trigger -->\n  <input\n    #fileInput\n    (change)=\"onFileSelected($event)\"\n    [accept]=\"acceptAttr\"\n    [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || null\"\n    [attr.multiple]=\"props.multiple || null\"\n    [attr.name]=\"resolvedName\"\n    [disabled]=\"isDisabled\"\n    [id]=\"resolvedId\"\n    [attr.aria-required]=\"isRequired() || null\"\n    class=\"hidden\"\n    type=\"file\"\n  />\n\n  @switch (displayMode) {\n    <!-- Compact: inline button + filename chips -->\n    @case ('compact') {\n      <div class=\"flex flex-wrap items-center gap-2\">\n        <button\n          (click)=\"fileInput.click()\"\n          [disabled]=\"isDisabled\"\n          [ngClass]=\"controlClasses\"\n          class=\"inline-flex items-center gap-2 cursor-pointer hover:bg-base-200\"\n          type=\"button\">\n          <svg [lucideIcon]=\"icons.Upload\" [size]=\"18\"></svg>\n          <span class=\"text-sm\">{{ uiConfig.replaceLabel }}</span>\n        </button>\n        @for (item of displayItems(); track itemKey(item)) {\n          <span class=\"inline-flex items-center gap-1 text-sm text-base-content/70\">\n            @if (item.isImage && item.previewUrl) {\n              <img [src]=\"item.previewUrl\" alt=\"\" class=\"h-6 w-6 rounded object-cover\"/>\n            } @else {\n              <svg [lucideIcon]=\"icons.File\" [size]=\"16\" class=\"text-base-content/50\"></svg>\n            }\n            <span class=\"max-w-40 truncate\">{{ item.name }}</span>\n            <button\n              (click)=\"item.existing ? removeExisting(item.index) : removeFile(item.index)\"\n              [attr.aria-label]=\"uiConfig.removeLabel\"\n              class=\"text-base-content/50 hover:text-error cursor-pointer\"\n              type=\"button\">\n              <svg [lucideIcon]=\"icons.X\" [size]=\"14\"></svg>\n            </button>\n          </span>\n        }\n      </div>\n    }\n\n    <!-- List: compact rows of file icon + name + size -->\n    @case ('list') {\n    <div class=\"relative flex flex-col\">\n      <button\n        (click)=\"fileInput.click()\"\n        [disabled]=\"isDisabled\"\n        [ngClass]=\"controlClasses\"\n        class=\"flex flex-row items-center justify-center gap-2 cursor-pointer hover:bg-base-200\"\n        type=\"button\">\n        <svg [lucideIcon]=\"icons.Upload\" [size]=\"18\"></svg>\n        <span class=\"text-sm\">{{ uiConfig.replaceLabel }}</span>\n      </button>\n      @if (displayItems().length > 0) {\n        <div class=\"mt-2 flex flex-col gap-1\">\n          @for (item of displayItems(); track itemKey(item)) {\n            <div class=\"flex items-center gap-2 rounded-lg bg-base-200 px-3 py-1.5 text-sm\">\n              <svg [lucideIcon]=\"icons.File\" [size]=\"16\" class=\"text-base-content/50\"></svg>\n              <span class=\"flex-1 truncate text-base-content\">{{ item.name }}</span>\n              @if (item.sizeLabel) {\n                <span class=\"text-base-content/50\">{{ item.sizeLabel }}</span>\n              }\n              <button\n                (click)=\"item.existing ? removeExisting(item.index) : removeFile(item.index)\"\n                [attr.aria-label]=\"uiConfig.removeLabel\"\n                class=\"text-base-content/50 hover:text-error cursor-pointer\"\n                type=\"button\">\n                <svg [lucideIcon]=\"icons.X\" [size]=\"16\"></svg>\n              </button>\n            </div>\n          }\n        </div>\n      }\n      @if (isDragging()) {\n        <ng-container [ngTemplateOutlet]=\"dropOverlay\"></ng-container>\n      }\n    </div>\n    }\n\n    <!-- Thumbnail: grid of tiles with overlay remove + add tile -->\n    @case ('thumbnail') {\n    <div class=\"relative flex flex-wrap gap-3\">\n        @for (item of displayItems(); track itemKey(item)) {\n          <div class=\"relative h-24 w-24 overflow-hidden rounded-xl border border-base-300 bg-base-100\">\n            @if (item.isImage && item.previewUrl) {\n              <img [src]=\"item.previewUrl\" alt=\"\" class=\"h-full w-full object-cover\"/>\n            } @else {\n              <div class=\"flex h-full w-full flex-col items-center justify-center gap-1 p-1 text-center\">\n                <svg [lucideIcon]=\"icons.File\" [size]=\"22\" class=\"text-base-content/50\"></svg>\n                <span class=\"w-full truncate text-xs text-base-content/60\">{{ item.name }}</span>\n              </div>\n            }\n            <button\n              (click)=\"item.existing ? removeExisting(item.index) : removeFile(item.index)\"\n              [attr.aria-label]=\"uiConfig.removeLabel\"\n              class=\"inline-flex h-6 w-6 items-center justify-center rounded-full cursor-pointer transition-colors absolute top-1 right-1 border-none bg-black/60 text-white hover:bg-black/80\"\n              type=\"button\">\n              <svg [lucideIcon]=\"icons.X\" [size]=\"14\"></svg>\n            </button>\n          </div>\n        }\n        @if (props.multiple || displayItems().length === 0) {\n          <button\n            (click)=\"fileInput.click()\"\n            [disabled]=\"isDisabled\"\n            class=\"flex h-24 w-24 flex-col items-center justify-center gap-1 rounded-xl border-2 border-dashed border-base-300 text-base-content/50 hover:border-primary cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed\"\n            type=\"button\">\n            <svg [lucideIcon]=\"icons.ImagePlus\" [size]=\"22\"></svg>\n          </button>\n        }\n      @if (isDragging()) {\n        <ng-container [ngTemplateOutlet]=\"dropOverlay\"></ng-container>\n      }\n      </div>\n    }\n\n    <!-- Dropzone (default): large dashed area + preview rows -->\n    @default {\n      <button\n        (click)=\"fileInput.click()\"\n        [disabled]=\"isDisabled\"\n        [ngClass]=\"controlClasses\"\n        type=\"button\">\n        <!-- Inert so a drag crossing the icon/hint never reads as leaving the zone -->\n        <span aria-live=\"polite\" class=\"pointer-events-none flex flex-col items-center gap-2\">\n          @if (isDragging()) {\n            <svg [size]=\"28\" class=\"animate-bounce text-primary\" [lucideIcon]=\"icons.Upload\"></svg>\n            <span class=\"text-sm font-medium text-primary\">{{ uiConfig.dropActiveHint }}</span>\n          } @else {\n            <svg [size]=\"28\" class=\"text-base-content/40\" [lucideIcon]=\"icons.ImagePlus\"></svg>\n            <span class=\"text-sm text-base-content/60\">{{ uiConfig.dropzoneHint }}</span>\n          }\n        </span>\n      </button>\n      @if (displayItems().length > 0) {\n        <div class=\"mt-2 flex flex-col gap-2\">\n          @for (item of displayItems(); track itemKey(item)) {\n            <div class=\"flex items-center gap-3 rounded-lg bg-base-200 p-2\">\n              @if (item.isImage && item.previewUrl) {\n                <img [src]=\"item.previewUrl\" alt=\"\" class=\"h-12 w-12 rounded-md object-cover\"/>\n              } @else {\n                <svg [lucideIcon]=\"icons.File\" [size]=\"24\" class=\"text-base-content/50\"></svg>\n              }\n              <span class=\"flex-1 truncate text-sm text-base-content\">{{ item.name }}</span>\n              @if (item.sizeLabel) {\n                <span class=\"text-sm text-base-content/50\">{{ item.sizeLabel }}</span>\n              }\n              <button\n                (click)=\"item.existing ? removeExisting(item.index) : removeFile(item.index)\"\n                [attr.aria-label]=\"uiConfig.removeLabel\"\n                class=\"inline-flex h-8 w-8 items-center justify-center rounded-full cursor-pointer transition-colors text-error hover:bg-error/10\"\n                type=\"button\">\n                <svg [lucideIcon]=\"icons.Trash2\" [size]=\"16\"></svg>\n              </button>\n            </div>\n          }\n        </div>\n      }\n    }\n  }\n\n  <!-- Selection-limit error (accept / maxSize / maxFiles) -->\n  @if (internalError(); as msg) {\n    <mn-error-message [errorMessage]=\"msg\" [id]=\"resolvedId + '-selection'\"></mn-error-message>\n  }\n\n  <!-- Control validation errors -->\n  @if (showError) {\n    @if (props.showAllErrors) {\n      <div class=\"flex flex-col gap-y-1\">\n        @for (error of errorMessages; track $index) {\n          <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n        }\n      </div>\n    } @else if (errorMessage !== null) {\n      <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n    }\n  }\n</div>\n\n<!--\n  \"Release to drop\" cover for the modes that render their own layout instead of a\n  dropzone. Absolutely positioned so arming it never shifts the layout, and inert\n  so the drag keeps reaching the elements underneath.\n-->\n<ng-template #dropOverlay>\n  <div\n    aria-live=\"polite\"\n    class=\"pointer-events-none absolute inset-0 z-10 flex flex-col items-center justify-center gap-2 rounded-xl border-2 border-dashed border-primary bg-base-100/90 text-center\">\n    <svg [size]=\"24\" class=\"animate-bounce text-primary\" [lucideIcon]=\"icons.Upload\"></svg>\n    <span class=\"px-2 text-sm font-medium text-primary\">{{ uiConfig.dropActiveHint }}</span>\n  </div>\n</ng-template>\n","/**\n * Where a `position: fixed` panel anchored to a trigger should open, and how tall it may be.\n *\n * Shared by the select, the multi-select and the dropdown, which all used to pin their panel\n * to the trigger's bottom edge unconditionally — so a trigger near the bottom of the viewport\n * (a table's \"items per page\" picker is the classic case) opened a list that ran off screen.\n */\nexport type AnchoredPanelPlacement = {\n  /** The `top` style, or `auto` when the panel opens above the trigger. */\n  top: string;\n  /** The `bottom` style, or `auto` when the panel opens below the trigger. */\n  bottom: string;\n  /**\n   * The `max-height` style: the room on the chosen side, so a long list scrolls inside the\n   * viewport instead of past its edge, or `null` when the panel's own cap is smaller anyway.\n   */\n  maxHeight: string | null;\n};\n\n/** Breathing room kept between the panel and the viewport edge, in pixels. */\nexport const PANEL_VIEWPORT_MARGIN_PX = 8;\n\n/**\n * The least room below the trigger before the panel is flipped above it, in pixels: roughly\n * four rows, so a picker that still fits its usual few options never flips for no reason.\n */\nexport const PANEL_FLIP_THRESHOLD_PX = 160;\n\n/**\n * Chooses the side of the trigger with room for the panel.\n *\n * Below by default. Above only when the space below is under {@link PANEL_FLIP_THRESHOLD_PX}\n * and the space above is larger: flipping is the exception, because a list that opens upward\n * reads backwards from what the trigger's chevron promised.\n * @param trigger The trigger's viewport rectangle.\n * @param viewportHeight The viewport's inner height.\n * @param gap Distance between trigger and panel, in pixels.\n * @param panelMaxHeight The panel's own height cap in pixels, so the available room only\n * becomes the cap when it is the smaller of the two.\n * @returns The styles to bind on the panel.\n */\nexport function anchoredPanelPlacement(\n  trigger: Pick<DOMRect, 'top' | 'bottom'>,\n  viewportHeight: number,\n  gap: number,\n  panelMaxHeight: number,\n): AnchoredPanelPlacement {\n  const below = viewportHeight - trigger.bottom - gap - PANEL_VIEWPORT_MARGIN_PX;\n  const above = trigger.top - gap - PANEL_VIEWPORT_MARGIN_PX;\n  const openAbove = below < PANEL_FLIP_THRESHOLD_PX && above > below;\n  const room = Math.max(openAbove ? above : below, 0);\n  return {\n    top: openAbove ? 'auto' : `${trigger.bottom + gap}px`,\n    bottom: openAbove ? `${viewportHeight - trigger.top + gap}px` : 'auto',\n    maxHeight: room < panelMaxHeight ? `${room}px` : null,\n  };\n}\n","/**\n * Keyboard navigation shared by mn-select and mn-multi-select. Both follow the WAI-ARIA combobox\n * pattern: focus stays on the trigger (or the search box) and `aria-activedescendant` names the\n * option the arrow keys are on, so the options themselves are never Tab stops.\n */\n\n/**\n * The index of the next option that can be chosen, stepping from `from` in one direction without\n * wrapping. From no active option (-1), a forward step lands on the first enabled option and a\n * backward step on the last, which is also how Home and End are answered.\n * @param options - The options as rendered, in order.\n * @param from - The current active index, or -1 for none.\n * @param step - 1 to move down the list, -1 to move up.\n * @param isEnabled - Whether an option can be highlighted; disabled rows are skipped.\n * @returns The new index; `from` when nothing enabled lies that way, or -1 when `from` is out of range.\n */\nexport function stepEnabledIndex<T>(\n  options: readonly T[],\n  from: number,\n  step: 1 | -1,\n  isEnabled: (option: T) => boolean,\n): number {\n  const valid = from >= 0 && from < options.length;\n  let index = valid ? from : step === 1 ? -1 : options.length;\n  for (index += step; index >= 0 && index < options.length; index += step) {\n    if (isEnabled(options[index])) return index;\n  }\n  return valid ? from : -1;\n}\n\n/**\n * Scrolls the nearest scrollable ancestor just far enough to show an option. Written out rather than\n * `scrollIntoView` because that also scrolls the page, and a page scroll closes an anchored panel.\n * @param option - The option element, or null when it is not rendered.\n */\nexport function scrollOptionIntoView(option: HTMLElement | null): void {\n  if (!option) return;\n  let scroller = option.parentElement;\n  while (scroller && scroller !== document.body && scroller.scrollHeight <= scroller.clientHeight) {\n    scroller = scroller.parentElement;\n  }\n  if (!scroller || scroller === document.body) return;\n  const box = scroller.getBoundingClientRect();\n  const row = option.getBoundingClientRect();\n  if (row.top < box.top) {\n    scroller.scrollTop -= box.top - row.top;\n  } else if (row.bottom > box.bottom) {\n    scroller.scrollTop += row.bottom - box.bottom;\n  }\n}\n","import {tv, type VariantProps} from 'tailwind-variants';\n\nexport const mnSelectVariants = tv({\n  base: 'bg-base-100 border-1 border-base-300 text-base-content text-sm cursor-pointer hover:bg-base-200 transition-colors duration-300',\n  variants: {\n    shadow: {\n      true: 'shadow-lg',\n    },\n    size: {\n      sm: 'p-2',\n      md: 'p-3',\n      lg: 'p-4',\n    },\n    borderRadius: {\n      none: 'rounded-none',\n      xs: 'rounded-xs',\n      sm: 'rounded-sm',\n      md: 'rounded-md',\n      lg: 'rounded-lg',\n      xl: 'rounded-xl',\n      two_xl: 'rounded-2xl',\n      three_xl: 'rounded-3xl',\n      four_xl: 'rounded-4xl',\n    },\n    fullWidth: {\n      true: 'w-full',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    borderRadius: 'md',\n  },\n});\n\nexport type MnSelectVariants = VariantProps<typeof mnSelectVariants>;\n","import { anchoredPanelPlacement } from '../shared/anchored-panel-placement';\nimport { scrollOptionIntoView, stepEnabledIndex } from '../shared/listbox-navigation';\nimport {\n  afterNextRender,\n  ChangeDetectorRef,\n  Component,\n  DestroyRef,\n  ElementRef,\n  HostListener,\n  inject,\n  InjectionToken,\n  Injector,\n  Input,\n  OnInit,\n  Renderer2,\n  ViewChild,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n  MnSelectErrorMessageData,\n  MnSelectOption,\n  MnSelectProps,\n  MnSelectUIConfig,\n} from './mn-selectTypes';\nimport { FormsModule, NgControl, ValidationErrors, Validators } from '@angular/forms';\nimport { mnSelectVariants } from './mn-selectVariants';\nimport { MnErrorMessage } from '../mn-error-message/mn-error-message';\nimport { MnInputField } from '../mn-input-field';\nimport { MnBottomSheet } from 'mn-angular-lib/bottom-sheet';\nimport { MnConfigService } from 'mn-angular-lib/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from 'mn-angular-lib/core';\nimport { MnLanguageService } from 'mn-angular-lib/core';\nimport { skip } from 'rxjs';\nimport { LucideDynamicIcon } from '@lucide/angular';\nimport * as lucide from 'lucide';\nimport { lucideIcons } from 'mn-angular-lib/core';\n\n/** Lucide icons this file renders. */\nconst ICONS = lucideIcons({ Check: lucide.Check, ChevronDown: lucide.ChevronDown });\n\nexport const MN_SELECT_CONFIG = new InjectionToken<MnSelectUIConfig>('MN_SELECT_CONFIG');\n\n/** The keys that open a closed select from its trigger. */\nconst OPEN_KEYS = ['ArrowDown', 'ArrowUp', 'Enter', ' '];\n\n/**\n * Whether the keyboard may highlight an option.\n * @param option - The option.\n * @returns False for a disabled option.\n */\nfunction isChoosable(option: MnSelectOption): boolean {\n  return !option.disabled;\n}\n\n/**\n * Takes a key for the select: no default action (no scroll, no form submit) and no bubbling to a\n * surrounding modal's own Enter or Escape handling.\n * @param event - The keydown to claim.\n */\nfunction claim(event: KeyboardEvent): void {\n  event.preventDefault();\n  event.stopPropagation();\n}\n\n/**\n * A single-value picker. The trigger opens a `role=\"listbox\"` of {@link MnSelectOption}s;\n * choosing one sets the value and closes — this is the value-picker twin of the ⋯\n * command menu mn-dropdown, so it *is* a ControlValueAccessor.\n *\n * Presentation mirrors mn-multi-select: one custom field trigger at every size, an\n * anchored popover on desktop and the shared {@link MnBottomSheet} on mobile (< 640px) —\n * the same sheet mn-dropdown itself wraps. Both the popover and the sheet host are\n * portalled to `document.body` so their `position: fixed` anchors to the viewport rather\n * than any transformed/filtered ancestor (a table cell, a card) — the same root-cause fix\n * the multi-select applies.\n */\n@Component({\n  selector: 'mn-lib-select',\n  standalone: true,\n  imports: [\n    NgClass,\n    NgTemplateOutlet,\n    FormsModule,\n    MnErrorMessage,\n    MnInputField,\n    MnBottomSheet,\n    LucideDynamicIcon,\n  ],\n  templateUrl: './mn-select.html',\n  host: {\n    // Without an explicit host width the inline host collapses to its content size, so\n    // the trigger's `w-full` (width:100%) resolves against a content-sized box and fails\n    // to fill the parent. Give the host a real width when fullWidth is requested.\n    '[style.display]': \"props?.fullWidth ? 'block' : null\",\n    '[style.width]': \"props?.fullWidth ? '100%' : null\",\n  },\n})\nexport class MnSelect implements OnInit {\n  /** Lucide icons the template renders. */\n  protected readonly icons = ICONS;\n\n  ngControl = inject(NgControl, { optional: true, self: true });\n\n  @Input({ required: true }) props!: MnSelectProps;\n\n  /** Currently selected value */\n  selectedValue: unknown = null;\n  isOpen = false;\n  isDisabled = false;\n  searchTerm = '';\n\n  /**\n   * Position in `filteredOptions` of the option the keyboard is on, or -1 for none. Reset when the\n   * list it indexes changes (a search) or goes away (close), so it never points at a stale row.\n   */\n  activeIndex = -1;\n\n  protected uiConfig: MnSelectUIConfig = {};\n\n  private readonly configService = inject(MnConfigService);\n  private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n  private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n  private readonly elRef = inject(ElementRef);\n  private readonly lang = inject(MnLanguageService);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly renderer = inject(Renderer2);\n  private readonly cdr = inject(ChangeDetectorRef);\n  private readonly injector = inject(Injector);\n\n  /** Lucide data for the trailing check shown on the selected row. */\n  protected readonly checkIcon = ICONS.Check;\n\n  /** Reference to the trigger element for positioning the dropdown. */\n  @ViewChild('trigger', { static: false }) triggerRef!: ElementRef<HTMLElement>;\n\n  /** Layout classes for the anchored popover panel. The mobile sheet is rendered by\n   *  mn-bottom-sheet instead, so it no longer needs a branch here. */\n  readonly panelClasses =\n    'fixed z-9999 w-max bg-base-100 border border-base-300 rounded-md shadow-lg max-h-60 overflow-auto';\n\n  /** The panel's own height cap in pixels: the `max-h-60` above, restated for the placement maths. */\n  static readonly PANEL_MAX_HEIGHT_PX = 240;\n  /** Space kept between a widened panel and the viewport's right edge. */\n  static readonly PANEL_EDGE_GAP_PX = 8;\n  /** Layout classes for the invisible click shield rendered under the anchored panel.\n   *  One step below the panel's z-index so the panel itself stays clickable, and above\n   *  any modal/drawer chrome (which tops out well under 9998). */\n  readonly shieldClasses = 'fixed inset-0 z-9998';\n\n  /** Option count at which the search input auto-enables when `searchable` is unset. */\n  private static readonly DEFAULT_SEARCH_THRESHOLD = 8;\n\n  /** Tailwind's `sm` breakpoint — below this the panel renders as a bottom sheet.\n   *  Kept in step with the same constant in mn-bottom-sheet / mn-multi-select. */\n  private static readonly SHEET_MAX_WIDTH = 639.98;\n\n  /** The anchored popover panel currently moved into `document.body`, if any. */\n  private movedPanel: HTMLElement | null = null;\n  /** The click shield currently moved into `document.body`, if any. */\n  private movedShield: HTMLElement | null = null;\n  /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */\n  private sheetHost: HTMLElement | null = null;\n\n  /** Whether the viewport is currently narrow enough for the sheet layout. */\n  private isNarrowViewport = false;\n  /** Live breakpoint match, so rotating the device re-evaluates the layout. */\n  private sheetMedia: MediaQueryList | null = null;\n  /** The listener registered on `sheetMedia`, retained for teardown. */\n  private sheetMediaListener: ((event: MediaQueryListEvent) => void) | null = null;\n\n  /** `document.body`'s inline `overflow` before the sheet locked it, restored on close. */\n  private previousBodyOverflow: string | null = null;\n\n  /**\n   * The sheet's height (px) captured the moment it opened, before any search. Re-applied\n   * as a `min-height` floor so filtering the option list shorter cannot shrink the sheet\n   * mid-type. Null while anchored or closed, so the popover and desktop path are untouched.\n   */\n  sheetFloorPx: number | null = null;\n\n  /**\n   * Watches the trigger while the panel is open. The panel lives in `document.body`, so it\n   * survives its own trigger being hidden by an ancestor — a wizard step or a tab switched\n   * away with `display: none`. When the trigger stops being visible the panel goes with it.\n   */\n  private visibilityObserver: IntersectionObserver | null = null;\n\n  /**\n   * Capture-phase scroll listener installed while open. `window:scroll` only fires for the\n   * document scroller, so scrolling an inner container (a modal body, a scrollable card)\n   * would otherwise leave the portalled panel floating at its stale coordinates.\n   */\n  private scrollCapture: ((event: Event) => void) | null = null;\n\n  /** Dropdown position calculated from the trigger's bounding rect. */\n  /** Inline placement of the anchored panel; `maxHeight` only binds when the viewport is the tighter cap. */\n  dropdownStyle: {\n    top: string;\n    bottom: string;\n    left: string;\n    minWidth: string;\n    maxWidth: string;\n    maxHeight: string | null;\n  } = {\n    top: '0px',\n    bottom: 'auto',\n    left: '0px',\n    minWidth: '0px',\n    maxWidth: 'none',\n    maxHeight: null,\n  };\n\n  private onChange: (val: unknown) => void = () => {};\n  private onTouched: () => void = () => {};\n\n  private readonly builtInErrorMessages: Record<string, MnSelectErrorMessageData> = {\n    required: 'Please select an option',\n  };\n\n  constructor() {\n    if (this.ngControl) this.ngControl.valueAccessor = this;\n  }\n\n  /**\n   * The dropdown panel element, queried while it is rendered by the `@if` block. The setter\n   * relocates the panel to `document.body` so that its `position: fixed` coordinates resolve\n   * against the viewport rather than any transformed/filtered ancestor (which would otherwise\n   * become the containing block and push the panel to the middle of the screen — also broken\n   * on iOS). Cleanup is handled when the query clears on close/destroy.\n   */\n  @ViewChild('dropdown', { static: false })\n  set dropdownRef(ref: ElementRef<HTMLElement> | undefined) {\n    this.movedPanel = this.portal(ref?.nativeElement ?? null, this.movedPanel);\n  }\n\n  /**\n   * The click shield sitting under the anchored panel, portalled alongside it for the same\n   * reason: `position: fixed` must resolve against the viewport, not a transformed ancestor.\n   */\n  @ViewChild('shield', { static: false })\n  set shieldRef(ref: ElementRef<HTMLElement> | undefined) {\n    this.movedShield = this.portal(ref?.nativeElement ?? null, this.movedShield);\n  }\n\n  /**\n   * The bottom-sheet host, kept as a reference for outside-click tests. The sheet relocates\n   * itself to `document.body`, so nothing is moved here. On open its container height is\n   * captured as the sheet's `min-height` floor.\n   */\n  @ViewChild('sheet', { static: false, read: ElementRef })\n  set sheetRef(ref: ElementRef<HTMLElement> | undefined) {\n    const el = ref?.nativeElement ?? null;\n    this.sheetHost = el;\n    if (el) {\n      this.captureSheetFloor(el);\n    } else {\n      this.sheetFloorPx = null;\n    }\n  }\n\n  get control() {\n    return this.ngControl?.control ?? null;\n  }\n\n  get selectedOption(): MnSelectOption | undefined {\n    return this.props.options.find((o) => o.value === this.selectedValue);\n  }\n\n  /** The label shown in the trigger: the selected option, else the placeholder. */\n  get displayText(): string {\n    return this.selectedOption?.label ?? this.placeholderLabel;\n  }\n\n  /** Trigger text shown while no option is selected. */\n  get placeholderLabel(): string {\n    return this.resolveLabel(\n      this.props.placeholder,\n      'mnSelect.placeholder',\n      'Select...',\n      this.uiConfig.placeholder,\n    );\n  }\n\n  /** Placeholder and accessible name of the dropdown's search input. */\n  get searchPlaceholderLabel(): string {\n    return this.resolveLabel(\n      this.props.searchPlaceholder,\n      'mnSelect.search',\n      'Search...',\n      this.uiConfig.searchPlaceholder,\n    );\n  }\n\n  /** Empty text shown when the search filters every option away. */\n  get noOptionsLabel(): string {\n    return this.resolveLabel(\n      undefined,\n      'mnSelect.noOptions',\n      'No options found',\n      this.uiConfig.noOptionsFound,\n    );\n  }\n\n  /**\n   * Resolves one of the component's own labels, preferring what the caller gave it\n   * and falling back through the config layer, a conventional translation key and\n   * finally a readable English default.\n   *\n   * Mirrors `MnCollectionBase.resolveLabel` and its twin in `MnMultiSelect`. Without\n   * the key step a consumer could only translate these by repeating the same literal\n   * at every call site, and the search box in particular auto-enables on option\n   * count — it appears without anyone asking for it, so it must be translatable\n   * without anyone asking either.\n   *\n   * @param explicit The label the caller passed through `props`, if any.\n   * @param key The conventional translation key to try next.\n   * @param fallback The English text used when neither resolves.\n   * @param configured The value the config layer resolved, if any.\n   * @returns The resolved label.\n   */\n  private resolveLabel(\n    explicit: string | undefined,\n    key: string,\n    fallback: string,\n    configured?: string,\n  ): string {\n    return explicit ?? configured ?? this.lang.translateIfPresent(key) ?? fallback;\n  }\n\n  get showError(): boolean {\n    const c = this.control;\n    return !!c && c.invalid && (c.touched || c.dirty);\n  }\n\n  get errorMessages(): string[] {\n    const errors = this.control?.errors;\n    if (!errors) return [];\n    return Object.keys(errors).map((key) => this.resolveErrorMessageForKey(key, errors));\n  }\n\n  get errorMessage(): string | null {\n    const errors = this.control?.errors;\n    if (!errors) return null;\n    const errorKey = this.pickErrorKey(errors);\n    return this.resolveErrorMessageForKey(errorKey, errors);\n  }\n\n  get resolvedId(): string {\n    return this.props.id;\n  }\n\n  get resolvedName(): string | null {\n    return this.props?.name ?? null;\n  }\n\n  get triggerClasses(): string {\n    return mnSelectVariants({\n      size: this.props.size,\n      borderRadius: this.props.borderRadius,\n      shadow: this.props.shadow,\n      fullWidth: this.props.fullWidth,\n    });\n  }\n\n  /** Whether the panel should currently render as a bottom sheet. */\n  get isSheet(): boolean {\n    return this.props.mobileSheet !== false && this.isNarrowViewport;\n  }\n\n  /**\n   * Whether the search input is shown: the explicit `searchable` prop when set, otherwise\n   * auto-enabled once the option count reaches the threshold.\n   */\n  get isSearchable(): boolean {\n    if (this.props.searchable !== undefined) return this.props.searchable;\n    const threshold = this.props.searchThreshold ?? MnSelect.DEFAULT_SEARCH_THRESHOLD;\n    return this.props.options.length >= threshold;\n  }\n\n  get filteredOptions(): MnSelectOption[] {\n    if (!this.searchTerm) return this.props.options;\n    const lower = this.searchTerm.toLowerCase();\n    return this.props.options.filter((o) => o.label.toLowerCase().includes(lower));\n  }\n\n  // ========== Lifecycle ==========\n\n  ngOnInit() {\n    // `showError` reads the control's touched/dirty/invalid state straight off the form.\n    // Those move from the forms API — `markAllAsTouched()` when the user tries to submit, a\n    // programmatic `setErrors` — never through an event on this component, so under OnPush\n    // the message would never appear. `events` covers value, status, touched and pristine.\n    const formControl = this.ngControl?.control;\n    if (formControl) {\n      const stateSub = formControl.events.subscribe(() => this.cdr.markForCheck());\n      this.destroyRef.onDestroy(() => stateSub.unsubscribe());\n    }\n\n    this.resolveConfig();\n    this.startWatchingViewport();\n\n    const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n      this.resolveConfig();\n      // `resolveConfig` rewrites plain fields the template reads; under OnPush nothing else\n      // marks this view for the locale change.\n      this.cdr.markForCheck();\n    });\n    this.destroyRef.onDestroy(() => {\n      sub.unsubscribe();\n      this.stopWatchingTrigger();\n      this.stopWatchingViewport();\n      this.unlockBodyScroll();\n      // Guarantee the portalled elements never outlive the component.\n      this.movedPanel = this.portal(null, this.movedPanel);\n      this.movedShield = this.portal(null, this.movedShield);\n      this.sheetHost = null;\n    });\n  }\n\n  // ========== ControlValueAccessor Implementation ==========\n\n  writeValue(val: unknown): void {\n    // Treat empty string as null so the placeholder is shown and the control stays properly invalid.\n    this.selectedValue = val === '' || val == null ? null : val;\n    // The forms API writes in from outside (setValue, reset, patch); nothing marks\n    // this view for it.\n    this.cdr.markForCheck();\n  }\n\n  registerOnChange(fn: (val: unknown) => 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.isDisabled = isDisabled;\n    // `control.disable()` / `.enable()` reaches us the same way `writeValue` does —\n    // from the forms API, with no event behind it.\n    this.cdr.markForCheck();\n  }\n\n  // ========== Dropdown Logic ==========\n\n  toggle(): void {\n    if (this.isDisabled) return;\n    if (this.isOpen) {\n      this.close();\n      return;\n    }\n    // `toggle()` and `close()` are public API: a consumer holding a @ViewChild can\n    // open the panel without an event, and under OnPush nothing else marks this view.\n    this.isOpen = true;\n    this.cdr.markForCheck();\n    if (this.isSheet) {\n      // A sheet is anchored to the viewport, so it needs no trigger tracking — only a\n      // scroll lock so the page behind it stays put while the list is scrolled.\n      this.lockBodyScroll();\n      return;\n    }\n    this.updateDropdownPosition();\n    this.startWatchingTrigger();\n  }\n\n  /** Selects an option, notifies the form and closes — a single choice ends the interaction. */\n  selectOption(option: MnSelectOption): void {\n    if (option.disabled) return;\n    this.selectedValue = option.value;\n    this.onChange(this.selectedValue);\n    this.close();\n  }\n\n  isSelected(option: MnSelectOption): boolean {\n    return this.selectedValue === option.value;\n  }\n\n  /** Filters the options; the first match is highlighted so Enter picks it, none once the box is cleared. */\n  onSearch(term: string | null): void {\n    this.searchTerm = term ?? '';\n    this.activeIndex = this.searchTerm\n      ? stepEnabledIndex(this.filteredOptions, -1, 1, isChoosable)\n      : -1;\n  }\n\n  /** Id of the keyboard-highlighted option, for `aria-activedescendant`; null when none is. */\n  get activeOptionId(): string | null {\n    const inRange = this.activeIndex >= 0 && this.activeIndex < this.filteredOptions.length;\n    return this.isOpen && inRange ? this.optionId(this.activeIndex) : null;\n  }\n\n  /**\n   * The DOM id of the option rendered at a position in `filteredOptions`.\n   * @param index - The option's position.\n   * @returns The id, unique per select.\n   */\n  optionId(index: number): string {\n    return `${this.resolvedId}-option-${index}`;\n  }\n\n  /**\n   * Keyboard handling for the trigger and the search box, the WAI-ARIA combobox pattern. While\n   * closed, ArrowDown, ArrowUp, Enter and Space open the list with an option highlighted. While\n   * open, the arrows move the highlight past disabled options without wrapping, Home and End jump\n   * to the ends, Enter (and Space outside the search box) chooses the highlighted option and returns focus to the trigger, Escape closes and Tab closes and lets focus move on. Enter and Space\n   * stop here, so they can never submit a surrounding form or close a surrounding modal.\n   * @param event - The keydown.\n   * @param fromSearch - True when it came from the search box, where Space, Home and End edit text.\n   */\n  onKeydown(event: KeyboardEvent, fromSearch = false): void {\n    if (this.isDisabled) return;\n    // Only keys pressed on the trigger itself; nothing inside it is focusable today, but stay safe.\n    if (!fromSearch && event.target !== event.currentTarget) return;\n\n    if (!this.isOpen) {\n      if (fromSearch || !OPEN_KEYS.includes(event.key)) return;\n      claim(event);\n      this.toggle();\n      const selected = this.filteredOptions.findIndex((o) => this.isSelected(o) && isChoosable(o));\n      this.activeIndex =\n        selected >= 0\n          ? selected\n          : stepEnabledIndex(\n              this.filteredOptions,\n              -1,\n              event.key === 'ArrowUp' ? -1 : 1,\n              isChoosable,\n            );\n      this.revealActiveOption();\n      return;\n    }\n\n    switch (event.key) {\n      case 'ArrowDown':\n      case 'ArrowUp':\n        claim(event);\n        this.moveActive(this.activeIndex, event.key === 'ArrowDown' ? 1 : -1);\n        return;\n      case 'Home':\n      case 'End':\n        if (fromSearch) return;\n        claim(event);\n        this.moveActive(-1, event.key === 'Home' ? 1 : -1);\n        return;\n      case ' ':\n        if (fromSearch) return;\n        this.chooseActive(event);\n        return;\n      case 'Enter':\n        this.chooseActive(event);\n        return;\n      case 'Escape':\n        claim(event);\n        this.close();\n        this.focusTrigger();\n        return;\n      case 'Tab':\n        // Focus moves on from the trigger, so the search box's Tab order position never matters.\n        this.close();\n        this.focusTrigger();\n        return;\n    }\n  }\n\n  /**\n   * Moves the highlight one enabled option from `from` and scrolls it into view.\n   * @param from - Where to step from; -1 to start at an end.\n   * @param step - 1 for down, -1 for up.\n   */\n  private moveActive(from: number, step: 1 | -1): void {\n    this.activeIndex = stepEnabledIndex(this.filteredOptions, from, step, isChoosable);\n    this.revealActiveOption();\n  }\n\n  /**\n   * Chooses the highlighted option (or just closes when none is) and hands focus back to the trigger,\n   * because the search box that may hold it is removed with the panel.\n   * @param event - The Enter or Space keydown, claimed so a form around the select is not submitted.\n   */\n  private chooseActive(event: KeyboardEvent): void {\n    claim(event);\n    const option = this.filteredOptions[this.activeIndex];\n    if (option) {\n      this.selectOption(option);\n    } else {\n      this.close();\n    }\n    this.focusTrigger();\n  }\n\n  /** Scrolls the highlighted option into view once the render that paints its ring has run. */\n  private revealActiveOption(): void {\n    afterNextRender(\n      () => {\n        const id = this.activeOptionId;\n        scrollOptionIntoView(id ? document.getElementById(id) : null);\n      },\n      { injector: this.injector },\n    );\n  }\n\n  /** Puts focus back on the trigger. */\n  private focusTrigger(): void {\n    this.triggerRef?.nativeElement.focus();\n  }\n\n  /**\n   * The single close path. Every trigger (outside click, Escape, scroll, resize, the trigger\n   * being hidden, a choice) funnels through here so the open-only listeners are always torn\n   * down with the panel and never leak.\n   */\n  close(): void {\n    if (!this.isOpen) return;\n    this.isOpen = false;\n    this.cdr.markForCheck();\n    this.searchTerm = '';\n    this.activeIndex = -1;\n    this.stopWatchingTrigger();\n    this.unlockBodyScroll();\n  }\n\n  handleBlur(): void {\n    this.onTouched();\n  }\n\n  /**\n   * Dismisses the anchored panel from a shield click, and stops the event there.\n   *\n   * Swallowing it is the point: the shield spans the viewport, so the click would otherwise\n   * land on whatever the panel was floating over. Inside a modal that is the modal's own\n   * backdrop, and \"close the dropdown\" would double as \"throw away the modal\". A first click\n   * that only dismisses the overlay is also how native selects and menus behave.\n   */\n  onShieldClick(event: Event): void {\n    event.stopPropagation();\n    event.preventDefault();\n    this.close();\n  }\n\n  @HostListener('document:click', ['$event'])\n  onDocumentClick(event: Event): void {\n    const target = event.target as Node | null;\n    // The panel lives at the body root once open, so it is not a descendant of the host\n    // element — treat clicks inside the portalled panel as \"inside\" too.\n    const insideHost = !!target && this.elRef.nativeElement.contains(target);\n    const insidePanel = !!target && !!this.movedPanel && this.movedPanel.contains(target);\n    // In sheet mode the backdrop tap is handled by mn-bottom-sheet's own (dismiss); the\n    // sheet host counts as \"inside\" here so this listener never double-fires the close.\n    const insideSheet = !!target && !!this.sheetHost && this.sheetHost.contains(target);\n    if (!insideHost && !insidePanel && !insideSheet) {\n      this.close();\n    }\n  }\n\n  /** Closes the dropdown on Escape for keyboard accessibility. */\n  @HostListener('document:keydown.escape')\n  onEscape(): void {\n    this.close();\n  }\n\n  /**\n   * Closes the dropdown when the page or a scrollable parent is scrolled.\n   *\n   * Skipped for a sheet: it is anchored to the viewport, not to the trigger, so it has no\n   * stale position to escape. Crucially, opening the soft keyboard fires a `resize` on\n   * Android — closing on that would dismiss the sheet the instant search is focused. A\n   * genuine layout switch is handled by the `matchMedia` listener instead.\n   */\n  @HostListener('window:scroll', [])\n  @HostListener('window:resize', [])\n  onWindowScrollOrResize(): void {\n    if (this.isSheet) return;\n    this.close();\n  }\n\n  protected isRequired(): boolean {\n    if (!this.control) return false;\n    return this.control.hasValidator(Validators.required);\n  }\n\n  // ========== Viewport / breakpoint watching ==========\n\n  /**\n   * Tracks the sheet breakpoint through `matchMedia` rather than reading `innerWidth` once,\n   * so rotating the device switches layout instead of leaving a panel positioned for the\n   * previous orientation. An open panel is closed on the switch — its anchored coordinates\n   * and its sheet layout are not interchangeable.\n   */\n  private startWatchingViewport(): void {\n    if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n\n    this.sheetMedia = window.matchMedia(`(max-width: ${MnSelect.SHEET_MAX_WIDTH}px)`);\n    this.isNarrowViewport = this.sheetMedia.matches;\n\n    this.sheetMediaListener = (event: MediaQueryListEvent) => {\n      this.isNarrowViewport = event.matches;\n      this.close();\n      // The listener fires outside Angular, so a zoneless app needs an explicit nudge.\n      this.cdr.markForCheck();\n    };\n    this.sheetMedia.addEventListener('change', this.sheetMediaListener);\n  }\n\n  /** Tears down the breakpoint listener. Idempotent. */\n  private stopWatchingViewport(): void {\n    if (this.sheetMedia && this.sheetMediaListener) {\n      this.sheetMedia.removeEventListener('change', this.sheetMediaListener);\n    }\n    this.sheetMedia = null;\n    this.sheetMediaListener = null;\n  }\n\n  // ========== Body scroll lock (sheet only) ==========\n\n  /**\n   * Freezes the page behind an open sheet. The previous inline value is captured and restored\n   * verbatim so a surrounding modal that set its own lock is left intact.\n   */\n  private lockBodyScroll(): void {\n    if (this.previousBodyOverflow !== null) return;\n    this.previousBodyOverflow = document.body.style.overflow;\n    this.renderer.setStyle(document.body, 'overflow', 'hidden');\n  }\n\n  /** Restores the pre-lock `overflow`. Idempotent. */\n  private unlockBodyScroll(): void {\n    if (this.previousBodyOverflow === null) return;\n    if (this.previousBodyOverflow) {\n      this.renderer.setStyle(document.body, 'overflow', this.previousBodyOverflow);\n    } else {\n      this.renderer.removeStyle(document.body, 'overflow');\n    }\n    this.previousBodyOverflow = null;\n  }\n\n  // ========== Positioning ==========\n\n  /**\n   * Calculates the fixed position for the dropdown based on the trigger element: below it\n   * while the viewport has room, above it otherwise, never past the viewport's edge.\n   * The panel is never narrower than the trigger but grows to its widest option, so a compact\n   * trigger (the collection page-size picker) cannot squeeze the selected row's check mark\n   * over its label. It stops at the viewport's right edge, where long labels truncate.\n   */\n  private updateDropdownPosition(): void {\n    if (!this.triggerRef) return;\n    const rect = this.triggerRef.nativeElement.getBoundingClientRect();\n    const roomToRightEdge = window.innerWidth - rect.left - MnSelect.PANEL_EDGE_GAP_PX;\n    this.dropdownStyle = {\n      ...anchoredPanelPlacement(rect, window.innerHeight, 0, MnSelect.PANEL_MAX_HEIGHT_PX),\n      left: `${rect.left}px`,\n      minWidth: `${rect.width}px`,\n      maxWidth: `${Math.max(rect.width, roomToRightEdge)}px`,\n    };\n  }\n\n  /**\n   * Starts the open-only watchers: an `IntersectionObserver` on the trigger (closes the panel\n   * as soon as the trigger stops being rendered/visible) and a capture-phase `scroll` listener\n   * (closes it when any ancestor scroller moves under it). Scrolls that originate inside the\n   * panel's own option list are ignored.\n   */\n  private startWatchingTrigger(): void {\n    this.stopWatchingTrigger();\n\n    const trigger = this.triggerRef?.nativeElement;\n    if (trigger && typeof IntersectionObserver !== 'undefined') {\n      this.visibilityObserver = new IntersectionObserver((entries) => {\n        if (!entries.some((entry) => !entry.isIntersecting)) return;\n        this.close();\n        // The observer fires outside Angular, so a zoneless app needs an explicit nudge.\n        this.cdr.markForCheck();\n      });\n      this.visibilityObserver.observe(trigger);\n    }\n\n    this.scrollCapture = (event: Event) => {\n      const target = event.target as Node | null;\n      if (\n        target &&\n        this.movedPanel &&\n        (this.movedPanel === target || this.movedPanel.contains(target))\n      ) {\n        return;\n      }\n      this.close();\n      this.cdr.markForCheck();\n    };\n    document.addEventListener('scroll', this.scrollCapture, true);\n  }\n\n  /** Tears down the watchers installed by `startWatchingTrigger`. Idempotent. */\n  private stopWatchingTrigger(): void {\n    this.visibilityObserver?.disconnect();\n    this.visibilityObserver = null;\n    if (this.scrollCapture) {\n      document.removeEventListener('scroll', this.scrollCapture, true);\n      this.scrollCapture = null;\n    }\n  }\n\n  // ========== Sheet height floor ==========\n\n  /**\n   * Records the sheet's opened height as its `min-height` floor. Measured on the next frame\n   * so the read reflects the fully-rendered, unfiltered list (the search box is empty on\n   * open) and never forces a reflow mid change-detection. The floor equals the content height\n   * at that instant, so applying it triggers no resize — it only stops a later, shorter\n   * filtered list from pulling the sheet down.\n   *\n   * `hostEl` is the portalled mn-bottom-sheet host (`display: contents`), so the height is\n   * read from its `.mn-sheet-container` child rather than the host itself.\n   */\n  private captureSheetFloor(hostEl: HTMLElement): void {\n    const measure = (): number => {\n      const container = hostEl.querySelector<HTMLElement>('.mn-sheet-container');\n      return container?.offsetHeight ?? hostEl.offsetHeight;\n    };\n    if (typeof requestAnimationFrame !== 'function') {\n      this.sheetFloorPx = measure();\n      return;\n    }\n    requestAnimationFrame(() => {\n      // The sheet may have closed before the frame ran; don't strand a stale floor.\n      if (!this.isOpen || this.sheetHost !== hostEl) return;\n      this.sheetFloorPx = measure();\n      this.cdr.markForCheck();\n    });\n  }\n\n  // ========== Portal helper (see mn-multi-select for the full rationale) ==========\n\n  /**\n   * Move an overlay element to `document.body` when it appears, and detach it when the query\n   * clears. Appending to the body root makes the element immune to ancestor\n   * `transform`/`filter`/`will-change`, so `position: fixed` anchors to the viewport — without\n   * this the panel lands mid-screen (and breaks outright on iOS).\n   *\n   * Returns the element now portalled, so the caller can store it. Idempotent and safe to\n   * call with `null`.\n   */\n  private portal(el: HTMLElement | null, current: HTMLElement | null): HTMLElement | null {\n    if (el) {\n      if (current === el) return current;\n      this.renderer.appendChild(document.body, el);\n      return el;\n    }\n    if (current) {\n      // Angular's view teardown may already have removed it; only detach if still attached.\n      const parent = current.parentNode;\n      if (parent) {\n        this.renderer.removeChild(parent, current);\n      }\n    }\n    return null;\n  }\n\n  // ========== Config / Error Handling ==========\n\n  private resolveConfig() {\n    const instanceId = this.explicitInstanceId || `mn-select-${this.props.id}`;\n    this.uiConfig = this.configService.resolve<MnSelectUIConfig>(\n      'mn-select',\n      this.sectionPath,\n      instanceId,\n    );\n\n    if (this.props.label) {\n      this.uiConfig = { ...this.uiConfig, label: this.props.label };\n    }\n    if (this.props.placeholder) {\n      this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n    }\n    if (this.props.ariaLabel) {\n      this.uiConfig = { ...this.uiConfig, ariaLabel: this.props.ariaLabel };\n    }\n  }\n\n  private pickErrorKey(errors: ValidationErrors): string {\n    if (this.props.errorPriority) {\n      for (const key of this.props.errorPriority) {\n        if (errors[key] !== undefined) {\n          return key;\n        }\n      }\n    }\n    return Object.keys(errors)[0];\n  }\n\n  private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n    const errorArgs = errors[errorKey];\n    const customMsg = this.props.errorMessages?.[errorKey];\n    const configMsg = this.uiConfig.errorMessages?.[errorKey];\n    const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n    const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n    const fallbackMsg = this.props.defaultErrorMessage;\n    const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n    if (typeof msgDef === 'function') {\n      return msgDef(errorArgs, errors);\n    }\n    if (errorArgs && typeof errorArgs === 'object') {\n      return msgDef.replace(/{{(\\w+)}}/g, (_, key) => errorArgs[key] ?? _);\n    }\n    return msgDef;\n  }\n}\n","<div [class.is-fullwidth]=\"props.fullWidth\" class=\"flex flex-col h-full\">\n  @if (uiConfig.label || props.label) {\n    <label [attr.for]=\"resolvedId\" class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\">\n      <p>{{ uiConfig.label || props.label }}</p>\n      @if (isRequired()) {\n        <span class=\"text-error\" aria-hidden=\"true\">*</span>\n      }\n    </label>\n  }\n\n  <!-- Trigger -->\n  <div\n    #trigger\n    (blur)=\"handleBlur()\"\n    (click)=\"toggle()\"\n    (keydown)=\"onKeydown($event)\"\n    [attr.aria-activedescendant]=\"activeOptionId\"\n    [attr.aria-controls]=\"isOpen ? resolvedId + '-listbox' : null\"\n    [attr.aria-describedby]=\"showError ? resolvedId + '-error' : null\"\n    [attr.aria-disabled]=\"isDisabled || null\"\n    [attr.aria-expanded]=\"isOpen\"\n    [attr.aria-invalid]=\"showError || null\"\n    [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || props.label || null\"\n    [class.cursor-not-allowed]=\"isDisabled\"\n    [class.opacity-60]=\"isDisabled\"\n    [id]=\"resolvedId\"\n    [ngClass]=\"triggerClasses\"\n    [tabindex]=\"isDisabled ? -1 : 0\"\n    aria-haspopup=\"listbox\"\n    class=\"relative\"\n    role=\"combobox\"\n    [attr.aria-required]=\"isRequired() || null\"\n  >\n    <!-- `pr-6` reserves the gutter the caret is absolutely positioned in (right-2 + w-4),\n         so the value can never render underneath it. `min-w-0` lets the label shrink below\n         its content width, which is what makes truncation possible. -->\n    <div class=\"flex flex-row items-center min-h-6 min-w-0 pr-6\">\n      <span\n        [attr.title]=\"selectedOption?.label\"\n        [ngClass]=\"selectedOption ? 'text-base-content' : 'text-base-content/50'\"\n        class=\"truncate\"\n      >{{ displayText }}</span>\n    </div>\n    <div class=\"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none\">\n      <svg [size]=\"16\" class=\"text-base-content/50\" [lucideIcon]=\"icons.ChevronDown\"></svg>\n    </div>\n  </div>\n\n  <!-- Dropdown -->\n  @if (isOpen) {\n    @if (isSheet) {\n      <!-- On mobile the panel is presented as a shared bottom sheet: the sheet chrome\n           (backdrop, grabber, swipe/flick-to-dismiss, slide animation) lives in\n           mn-bottom-sheet; this component only projects the field's content into it. The\n           sheet host is portalled to document.body (see the `sheet` ViewChild) so its\n           `position: fixed` anchors to the viewport, not a transformed ancestor. -->\n      <mn-bottom-sheet\n        #sheet\n        (dismiss)=\"close()\"\n        [ariaLabel]=\"uiConfig.ariaLabel || uiConfig.label || props.label || uiConfig.placeholder || props.placeholder\"\n        [maxHeightVh]=\"80\"\n        [minHeightPx]=\"sheetFloorPx\"\n      >\n        <div\n          [id]=\"resolvedId + '-listbox'\"\n          class=\"flex flex-col flex-1 min-h-0 overflow-hidden\"\n          role=\"listbox\"\n        >\n          <!-- The sheet covers its own trigger, so it carries a header to name the field; the\n               way out is the grabber (swipe-to-dismiss) and a backdrop tap. -->\n          <div class=\"px-4 pt-1 pb-2 shrink-0\">\n            <p class=\"text-base font-medium text-base-content truncate\">\n              {{ uiConfig.label || props.label || uiConfig.placeholder || props.placeholder || '' }}\n            </p>\n          </div>\n          <ng-container [ngTemplateOutlet]=\"panelBody\"></ng-container>\n        </div>\n      </mn-bottom-sheet>\n    } @else {\n      <!-- A transparent full-viewport shield behind the panel, so \"click anywhere to dismiss\"\n           is literally true. It also *consumes* that click: without it the click reaches\n           whatever sits underneath — inside a modal that is the modal's own backdrop, so\n           dismissing the dropdown would tear down the whole modal with it. Portalled to\n           document.body for the same reason the panel is. It is aria-hidden and unfocusable:\n           the keyboard equivalent of this click is Escape. -->\n      <div\n        #shield\n        (click)=\"onShieldClick($event)\"\n        [id]=\"resolvedId + '-shield'\"\n        [ngClass]=\"shieldClasses\"\n        aria-hidden=\"true\"\n      ></div>\n      <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n      <div\n        #dropdown\n        (click)=\"$event.stopPropagation()\"\n        [id]=\"resolvedId + '-listbox'\"\n        [ngClass]=\"panelClasses\"\n        [style.left]=\"dropdownStyle.left\"\n        [style.top]=\"dropdownStyle.top\"\n        [style.bottom]=\"dropdownStyle.bottom\"\n        [style.max-height]=\"dropdownStyle.maxHeight\"\n        [style.min-width]=\"dropdownStyle.minWidth\"\n        [style.max-width]=\"dropdownStyle.maxWidth\"\n        role=\"listbox\"\n      >\n        <ng-container [ngTemplateOutlet]=\"panelBody\"></ng-container>\n      </div>\n    }\n  }\n\n  <!-- The search box + option list, shared verbatim by the sheet and the anchored popover.\n       `isSheet` only tunes spacing/sizing and which element scrolls: in sheet mode the list\n       is the flex scroller; anchored, the popover itself scrolls. -->\n  <ng-template #panelBody>\n    @if (isSearchable) {\n      <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n      <div\n        (click)=\"$event.stopPropagation()\"\n        (keydown)=\"onKeydown($event, true)\"\n        [ngClass]=\"isSheet ? 'px-4 py-2' : 'p-2'\"\n        class=\"border-b border-base-300 shrink-0\"\n      >\n        <mn-lib-input-field\n          (ngModelChange)=\"onSearch($event)\"\n          [ngModelOptions]=\"{ standalone: true }\"\n          [ngModel]=\"searchTerm\"\n          [props]=\"{\n            id: resolvedId + '-search',\n            type: 'search',\n            placeholder: searchPlaceholderLabel,\n            ariaLabel: searchPlaceholderLabel,\n            ariaActiveDescendant: activeOptionId,\n            fullWidth: true,\n            size: 'sm',\n            autoFocus: !isSheet\n          }\"\n        ></mn-lib-input-field>\n      </div>\n    }\n    <div [ngClass]=\"isSheet ? 'flex-1 overflow-auto overscroll-contain' : ''\">\n      @for (opt of filteredOptions; track opt.value) {\n        <!-- Options are not Tab stops: the keyboard reaches them with the arrow keys while focus\n             stays on the trigger or the search box, and `aria-activedescendant` names the one it\n             is on. The ring marks that option, since it never receives real focus. -->\n        <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n        <div\n          (click)=\"selectOption(opt); $event.stopPropagation()\"\n          [attr.aria-disabled]=\"opt.disabled || null\"\n          [attr.aria-selected]=\"isSelected(opt)\"\n          [class.opacity-50]=\"opt.disabled\"\n          [class.pointer-events-none]=\"opt.disabled\"\n          [id]=\"optionId($index)\"\n          [ngClass]=\"[isSheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm', isSelected(opt) ? 'bg-primary/10 font-medium' : '', $index === activeIndex ? 'ring-2 ring-inset ring-primary' : '']\"\n          class=\"flex items-center gap-x-2.5 cursor-pointer text-base-content hover:bg-base-200 transition-colors\"\n          role=\"option\"\n        >\n          <span class=\"truncate min-w-0\">{{ opt.label }}</span>\n          <!-- The current choice's marker. Decorative: the state is conveyed to assistive\n               tech by `aria-selected` on the row. -->\n          @if (isSelected(opt)) {\n            <svg\n              [lucideIcon]=\"checkIcon\"\n              [size]=\"isSheet ? 18 : 16\"\n              aria-hidden=\"true\"\n              class=\"ml-auto shrink-0 text-primary\"\n            ></svg>\n          }\n        </div>\n      }\n      @if (filteredOptions.length === 0) {\n        <div [ngClass]=\"isSheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm'\" class=\"text-base-content/50\">\n          {{ noOptionsLabel }}\n        </div>\n      }\n    </div>\n  </ng-template>\n\n  @if (showError) {\n    @if (props.showAllErrors) {\n      <div class=\"flex flex-col gap-y-1 mt-1\">\n        @for (error of errorMessages; track $index) {\n          <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n        }\n      </div>\n    } @else {\n      @if (errorMessage !== null) {\n        <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n      }\n    }\n  }\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\nexport const mnMultiSelectVariants = tv({\n  base: 'bg-base-100 border-1 border-base-300 text-base-content text-sm cursor-pointer',\n  variants: {\n    shadow: {\n      true: 'shadow-lg',\n    },\n    size: {\n      sm: 'p-2',\n      md: 'p-3',\n      lg: 'p-4',\n    },\n    borderRadius: {\n      none: 'rounded-none',\n      xs: 'rounded-xs',\n      sm: 'rounded-sm',\n      md: 'rounded-md',\n      lg: 'rounded-lg',\n      xl: 'rounded-xl',\n      two_xl: 'rounded-2xl',\n      three_xl: 'rounded-3xl',\n      four_xl: 'rounded-4xl',\n    },\n    fullWidth: {\n      true: 'w-full',\n    },\n  },\n  defaultVariants: {\n    size: 'md',\n    borderRadius: 'md',\n  },\n});\n\nexport type MnMultiSelectVariants = VariantProps<typeof mnMultiSelectVariants>;\n","import { anchoredPanelPlacement } from '../shared/anchored-panel-placement';\nimport { scrollOptionIntoView, stepEnabledIndex } from '../shared/listbox-navigation';\nimport {\n  afterNextRender,\n  ChangeDetectorRef,\n  Component,\n  DestroyRef,\n  ElementRef,\n  HostListener,\n  inject,\n  InjectionToken,\n  Injector,\n  Input,\n  OnInit,\n  Renderer2,\n  ViewChild,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport {\n  MnMultiSelectErrorMessageData,\n  MnMultiSelectOption,\n  MnMultiSelectProps,\n  MnMultiSelectUIConfig,\n} from './mn-multi-selectTypes';\nimport { FormsModule, NgControl, ValidationErrors, Validators } from '@angular/forms';\nimport { mnMultiSelectVariants } from './mn-multi-selectVariants';\nimport { MnErrorMessage } from '../mn-error-message/mn-error-message';\nimport { MnButton } from 'mn-angular-lib/button';\nimport { MnInputField } from '../mn-input-field';\nimport { MnBottomSheet } from 'mn-angular-lib/bottom-sheet';\nimport { MnConfigService } from 'mn-angular-lib/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from 'mn-angular-lib/core';\nimport { MnLanguageService } from 'mn-angular-lib/core';\nimport { skip } from 'rxjs';\nimport { LucideDynamicIcon } from '@lucide/angular';\nimport * as lucide from 'lucide';\nimport { lucideIcons } from 'mn-angular-lib/core';\n\n/** Lucide icons this file renders. */\nconst ICONS = lucideIcons({ ChevronDown: lucide.ChevronDown, X: lucide.X });\n\nexport const MN_MULTI_SELECT_CONFIG = new InjectionToken<MnMultiSelectUIConfig>(\n  'MN_MULTI_SELECT_CONFIG',\n);\n\n@Component({\n  selector: 'mn-lib-multi-select',\n  standalone: true,\n  imports: [\n    NgClass,\n    NgTemplateOutlet,\n    FormsModule,\n    MnErrorMessage,\n    MnButton,\n    MnInputField,\n    MnBottomSheet,\n    LucideDynamicIcon,\n  ],\n  templateUrl: './mn-multi-select.html',\n  styleUrl: './mn-multi-select.css',\n})\nexport class MnMultiSelect implements OnInit {\n  /** Lucide icons the template renders. */\n  protected readonly icons = ICONS;\n\n  ngControl = inject(NgControl, { optional: true, self: true });\n\n  protected uiConfig: MnMultiSelectUIConfig = {};\n\n  @Input({ required: true }) props!: MnMultiSelectProps;\n\n  private readonly configService = inject(MnConfigService);\n  private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n  private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n  private readonly elRef = inject(ElementRef);\n  private readonly lang = inject(MnLanguageService);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly renderer = inject(Renderer2);\n  private readonly cdr = inject(ChangeDetectorRef);\n  /** Injector for the after-render scroll of the highlighted option. */\n  private readonly injector = inject(Injector);\n\n  /** Reference to the trigger element for positioning the dropdown */\n  @ViewChild('trigger', { static: false }) triggerRef!: ElementRef<HTMLElement>;\n  /** Layout classes for the anchored popover panel. The mobile sheet is rendered by\n   *  mn-bottom-sheet instead, so it no longer needs a branch here. */\n  readonly panelClasses =\n    'fixed z-9999 bg-base-100 border border-base-300 rounded-md shadow-lg max-h-60 overflow-auto';\n\n  /** The panel's own height cap in pixels: the `max-h-60` above, restated for the placement maths. */\n  static readonly PANEL_MAX_HEIGHT_PX = 240;\n  /** Layout classes for the invisible click shield rendered under the anchored panel.\n   *  One step below the panel's z-index so the panel itself stays clickable, and above\n   *  any modal/drawer chrome (which tops out well under 9998). */\n  readonly shieldClasses = 'fixed inset-0 z-9998';\n  /** The anchored popover panel currently moved into `document.body`, if any. */\n  private movedPanel: HTMLElement | null = null;\n  /** The click shield currently moved into `document.body`, if any. */\n  private movedShield: HTMLElement | null = null;\n\n  /** Option count at which the search input auto-enables when `searchable` is unset. */\n  private static readonly DEFAULT_SEARCH_THRESHOLD = 8;\n\n  /** Tailwind's `sm` breakpoint — below this the panel renders as a bottom sheet.\n   *  Kept in step with the same constant in `MnModalShellComponent`. */\n  private static readonly SHEET_MAX_WIDTH = 639.98;\n\n  /** Whether the viewport is currently narrow enough for the sheet layout. */\n  private isNarrowViewport = false;\n\n  /** Live breakpoint match, so rotating the device re-evaluates the layout. */\n  private sheetMedia: MediaQueryList | null = null;\n\n  /** The listener registered on `sheetMedia`, retained for teardown. */\n  private sheetMediaListener: ((event: MediaQueryListEvent) => void) | null = null;\n\n  /** `document.body`'s inline `overflow` before the sheet locked it, restored on close. */\n  private previousBodyOverflow: string | null = null;\n\n  /**\n   * The sheet's height (px) captured the moment it opened, before any search. Re-applied\n   * as a `min-height` floor so filtering the option list shorter cannot shrink the sheet\n   * mid-type. Null while anchored or closed, so the popover and desktop path are untouched.\n   */\n  sheetFloorPx: number | null = null;\n\n  /**\n   * Watches the trigger while the panel is open. The panel lives in `document.body`,\n   * so it survives its own trigger being hidden by an ancestor — e.g. a wizard step\n   * or a tab that is switched away with `display: none` instead of being destroyed.\n   * When the trigger stops being visible the panel must go with it.\n   */\n  private visibilityObserver: IntersectionObserver | null = null;\n\n  /**\n   * Capture-phase scroll listener installed while open. `window:scroll` only fires for\n   * the document scroller, so scrolling an inner container (a modal body, a scrollable\n   * card) used to leave the portalled panel floating at its stale coordinates.\n   */\n  private scrollCapture: ((event: Event) => void) | null = null;\n  /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */\n  private sheetHost: HTMLElement | null = null;\n\n  /**\n   * The dropdown panel element, queried while it is rendered by the `@if` block.\n   * The setter relocates the panel to `document.body` so that its `position: fixed`\n   * coordinates resolve against the viewport rather than any transformed/filtered\n   * ancestor (which would otherwise become the containing block and push the panel\n   * to the middle of the screen — the root cause of the mis-positioning bug, also\n   * broken on iOS). Cleanup is handled when the query clears on close/destroy.\n   */\n  @ViewChild('dropdown', { static: false })\n  set dropdownRef(ref: ElementRef<HTMLElement> | undefined) {\n    this.movedPanel = this.portal(ref?.nativeElement ?? null, this.movedPanel);\n  }\n\n  /**\n   * The click shield sitting under the anchored panel, portalled alongside it for the same\n   * reason: `position: fixed` must resolve against the viewport, not a transformed ancestor.\n   */\n  @ViewChild('shield', { static: false })\n  set shieldRef(ref: ElementRef<HTMLElement> | undefined) {\n    this.movedShield = this.portal(ref?.nativeElement ?? null, this.movedShield);\n  }\n\n  /** Currently selected values */\n  selectedValues: unknown[] = [];\n  isOpen = false;\n  isDisabled = false;\n  searchTerm = '';\n\n  /**\n   * Position in `filteredOptions` of the option the keyboard is on, or -1 for none. Reset when the\n   * list it indexes changes (a search) or goes away (close), so it never points at a stale row.\n   */\n  activeIndex = -1;\n\n  /** Dropdown position calculated from trigger bounding rect */\n  /** Inline placement of the anchored panel; `maxHeight` only binds when the viewport is the tighter cap. */\n  dropdownStyle: {\n    top: string;\n    bottom: string;\n    left: string;\n    width: string;\n    maxHeight: string | null;\n  } = {\n    top: '0px',\n    bottom: 'auto',\n    left: '0px',\n    width: '0px',\n    maxHeight: null,\n  };\n\n  private onChange: (val: unknown) => void = () => {};\n  private onTouched: () => void = () => {};\n\n  private readonly builtInErrorMessages: Record<string, MnMultiSelectErrorMessageData> = {\n    required: 'At least one option must be selected',\n  };\n\n  constructor() {\n    if (this.ngControl) this.ngControl.valueAccessor = this;\n  }\n\n  /**\n   * The bottom-sheet host, kept as a reference for outside-click tests. The sheet\n   * relocates itself to `document.body`, so nothing is moved here. On open its\n   * container height is captured as the sheet's `min-height` floor.\n   */\n  @ViewChild('sheet', { static: false, read: ElementRef })\n  set sheetRef(ref: ElementRef<HTMLElement> | undefined) {\n    const el = ref?.nativeElement ?? null;\n    this.sheetHost = el;\n    if (el) {\n      this.captureSheetFloor(el);\n    } else {\n      this.sheetFloorPx = null;\n    }\n  }\n\n  /**\n   * Tracks the sheet breakpoint through `matchMedia` rather than reading `innerWidth`\n   * once, so rotating the device switches layout instead of leaving a panel positioned\n   * for the previous orientation. An open panel is closed on the switch — its anchored\n   * coordinates and its sheet layout are not interchangeable.\n   */\n  private startWatchingViewport(): void {\n    if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n\n    this.sheetMedia = window.matchMedia(`(max-width: ${MnMultiSelect.SHEET_MAX_WIDTH}px)`);\n    this.isNarrowViewport = this.sheetMedia.matches;\n\n    this.sheetMediaListener = (event: MediaQueryListEvent) => {\n      this.isNarrowViewport = event.matches;\n      this.close();\n      // The listener fires outside Angular, so a zoneless app needs an explicit nudge.\n      this.cdr.markForCheck();\n    };\n    this.sheetMedia.addEventListener('change', this.sheetMediaListener);\n  }\n\n  /** Tears down the breakpoint listener. Idempotent. */\n  private stopWatchingViewport(): void {\n    if (this.sheetMedia && this.sheetMediaListener) {\n      this.sheetMedia.removeEventListener('change', this.sheetMediaListener);\n    }\n    this.sheetMedia = null;\n    this.sheetMediaListener = null;\n  }\n\n  ngOnInit() {\n    // `showError` reads the control's touched/dirty/invalid state straight off the form.\n    // Those move from the forms API — `markAllAsTouched()` when the user tries to submit, a\n    // programmatic `setErrors` — never through an event on this component, so under OnPush\n    // the message would never appear. `events` covers value, status, touched and pristine.\n    const formControl = this.ngControl?.control;\n    if (formControl) {\n      const stateSub = formControl.events.subscribe(() => this.cdr.markForCheck());\n      this.destroyRef.onDestroy(() => stateSub.unsubscribe());\n    }\n\n    this.resolveConfig();\n    this.startWatchingViewport();\n\n    const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n      this.resolveConfig();\n      // `resolveConfig` rewrites plain fields the template reads; under OnPush nothing else\n      // marks this view for the locale change.\n      this.cdr.markForCheck();\n    });\n    this.destroyRef.onDestroy(() => {\n      sub.unsubscribe();\n      this.stopWatchingTrigger();\n      this.stopWatchingViewport();\n      this.unlockBodyScroll();\n      // Guarantee the portalled elements never outlive the component.\n      this.movedPanel = this.portal(null, this.movedPanel);\n      this.movedShield = this.portal(null, this.movedShield);\n      this.sheetHost = null;\n    });\n  }\n\n  private resolveConfig() {\n    const instanceId = this.explicitInstanceId || `mn-multi-select-${this.props.id}`;\n    this.uiConfig = this.configService.resolve<MnMultiSelectUIConfig>(\n      'mn-multi-select',\n      this.sectionPath,\n      instanceId,\n    );\n\n    if (this.props.label) {\n      this.uiConfig = { ...this.uiConfig, label: this.props.label };\n    }\n    if (this.props.placeholder) {\n      this.uiConfig = { ...this.uiConfig, placeholder: this.props.placeholder };\n    }\n    if (this.props.ariaLabel) {\n      this.uiConfig = { ...this.uiConfig, ariaLabel: this.props.ariaLabel };\n    }\n  }\n\n  // ========== ControlValueAccessor Implementation ==========\n\n  writeValue(val: unknown): void {\n    this.selectedValues = Array.isArray(val) ? val : [];\n    // The forms API writes in from outside (setValue, reset, patch); nothing marks\n    // this view for it.\n    this.cdr.markForCheck();\n  }\n\n  registerOnChange(fn: (val: unknown) => 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.isDisabled = isDisabled;\n    // `control.disable()` / `.enable()` reaches us the same way `writeValue` does —\n    // from the forms API, with no event behind it.\n    this.cdr.markForCheck();\n  }\n\n  // ========== Dropdown Logic ==========\n\n  toggle(): void {\n    if (this.isDisabled) return;\n    if (this.isOpen) {\n      this.close();\n      return;\n    }\n    // `toggle()` and `close()` are public API: a consumer holding a @ViewChild can\n    // open the panel without an event, and under OnPush nothing else marks this view.\n    this.isOpen = true;\n    this.cdr.markForCheck();\n    if (this.isSheet) {\n      // A sheet is anchored to the viewport, so it needs no trigger tracking — only a\n      // scroll lock so the page behind it stays put while the list is scrolled.\n      this.lockBodyScroll();\n      return;\n    }\n    this.updateDropdownPosition();\n    this.startWatchingTrigger();\n  }\n\n  /** Whether the panel should currently render as a bottom sheet. */\n  get isSheet(): boolean {\n    return this.props.mobileSheet !== false && this.isNarrowViewport;\n  }\n\n  /**\n   * Whether the search input is shown: the explicit `searchable` prop when set,\n   * otherwise auto-enabled once the option count reaches the threshold.\n   */\n  get isSearchable(): boolean {\n    if (this.props.searchable !== undefined) return this.props.searchable;\n    const threshold = this.props.searchThreshold ?? MnMultiSelect.DEFAULT_SEARCH_THRESHOLD;\n    return this.props.options.length >= threshold;\n  }\n\n  /**\n   * Dismisses the anchored panel from a shield click, and stops the event there.\n   *\n   * Swallowing it is the point: the shield spans the viewport, so the click would otherwise\n   * land on whatever the panel was floating over. Inside a modal that is the modal's own\n   * backdrop, and \"close the dropdown\" would double as \"throw away the modal\". A first click\n   * that only dismisses the overlay is also how native selects and menus behave.\n   */\n  onShieldClick(event: Event): void {\n    event.stopPropagation();\n    event.preventDefault();\n    this.close();\n  }\n\n  @HostListener('document:click', ['$event'])\n  onDocumentClick(event: Event): void {\n    const target = event.target as Node | null;\n    // The panel lives at the body root once open, so it is not a descendant of the\n    // host element — treat clicks inside the portalled panel as \"inside\" too.\n    const insideHost = !!target && this.elRef.nativeElement.contains(target);\n    const insidePanel = !!target && !!this.movedPanel && this.movedPanel.contains(target);\n    // In sheet mode the backdrop tap is handled by mn-bottom-sheet's own (dismiss); the\n    // sheet host counts as \"inside\" here so this listener never double-fires the close.\n    const insideSheet = !!target && !!this.sheetHost && this.sheetHost.contains(target);\n    if (!insideHost && !insidePanel && !insideSheet) {\n      this.close();\n    }\n  }\n\n  /**\n   * Records the sheet's opened height as its `min-height` floor. Measured on the next\n   * frame so the read reflects the fully-rendered, unfiltered list (the search box is\n   * empty on open) and never forces a reflow mid change-detection. The floor equals the\n   * content height at that instant, so applying it triggers no resize — it only stops a\n   * later, shorter filtered list from pulling the sheet down.\n   *\n   * `hostEl` is the portalled mn-bottom-sheet host (`display: contents`), so the height\n   * is read from its `.mn-sheet-container` child rather than the host itself.\n   */\n  private captureSheetFloor(hostEl: HTMLElement): void {\n    const measure = (): number => {\n      const container = hostEl.querySelector<HTMLElement>('.mn-sheet-container');\n      return container?.offsetHeight ?? hostEl.offsetHeight;\n    };\n    if (typeof requestAnimationFrame !== 'function') {\n      this.sheetFloorPx = measure();\n      return;\n    }\n    requestAnimationFrame(() => {\n      // The sheet may have closed before the frame ran; don't strand a stale floor.\n      if (!this.isOpen || this.sheetHost !== hostEl) return;\n      this.sheetFloorPx = measure();\n      this.cdr.markForCheck();\n    });\n  }\n\n  /** Closes the dropdown on Escape for keyboard accessibility. */\n  @HostListener('document:keydown.escape')\n  onEscape(): void {\n    this.close();\n  }\n\n  /**\n   * Closes the dropdown when the page or a scrollable parent is scrolled.\n   *\n   * Skipped for a sheet: it is anchored to the viewport, not to the trigger, so it has\n   * no stale position to escape. Crucially, opening the soft keyboard fires a `resize`\n   * on Android — closing on that would dismiss the sheet the instant search is focused.\n   * A genuine layout switch is handled by the `matchMedia` listener instead.\n   */\n  @HostListener('window:scroll', [])\n  @HostListener('window:resize', [])\n  onWindowScrollOrResize(): void {\n    if (this.isSheet) return;\n    this.close();\n  }\n\n  /**\n   * The single close path. Every trigger (outside click, Escape, scroll, resize, the\n   * trigger being hidden) funnels through here so the open-only listeners are always\n   * torn down with the panel and never leak.\n   */\n  close(): void {\n    if (!this.isOpen) return;\n    this.isOpen = false;\n    this.cdr.markForCheck();\n    this.searchTerm = '';\n    this.activeIndex = -1;\n    this.stopWatchingTrigger();\n    this.unlockBodyScroll();\n  }\n\n  /**\n   * Freezes the page behind an open sheet. The previous inline value is captured and\n   * restored verbatim so a surrounding modal that set its own lock is left intact.\n   */\n  private lockBodyScroll(): void {\n    if (this.previousBodyOverflow !== null) return;\n    this.previousBodyOverflow = document.body.style.overflow;\n    this.renderer.setStyle(document.body, 'overflow', 'hidden');\n  }\n\n  /** Restores the pre-lock `overflow`. Idempotent. */\n  private unlockBodyScroll(): void {\n    if (this.previousBodyOverflow === null) return;\n    if (this.previousBodyOverflow) {\n      this.renderer.setStyle(document.body, 'overflow', this.previousBodyOverflow);\n    } else {\n      this.renderer.removeStyle(document.body, 'overflow');\n    }\n    this.previousBodyOverflow = null;\n  }\n\n  /**\n   * Calculates the fixed position for the dropdown based on the trigger element: below it\n   * while the viewport has room, above it otherwise, never past the viewport's edge.\n   */\n  private updateDropdownPosition(): void {\n    if (!this.triggerRef) return;\n    const rect = this.triggerRef.nativeElement.getBoundingClientRect();\n    this.dropdownStyle = {\n      ...anchoredPanelPlacement(rect, window.innerHeight, 0, MnMultiSelect.PANEL_MAX_HEIGHT_PX),\n      left: `${rect.left}px`,\n      width: `${rect.width}px`,\n    };\n  }\n\n  /**\n   * Starts the open-only watchers: an `IntersectionObserver` on the trigger (closes the\n   * panel as soon as the trigger stops being rendered/visible) and a capture-phase\n   * `scroll` listener (closes it when any ancestor scroller moves under it). Scrolls\n   * that originate inside the panel's own option list are ignored.\n   */\n  private startWatchingTrigger(): void {\n    this.stopWatchingTrigger();\n\n    const trigger = this.triggerRef?.nativeElement;\n    if (trigger && typeof IntersectionObserver !== 'undefined') {\n      this.visibilityObserver = new IntersectionObserver((entries) => {\n        if (!entries.some((entry) => !entry.isIntersecting)) return;\n        this.close();\n        // The observer fires outside Angular, so a zoneless app needs an explicit nudge.\n        this.cdr.markForCheck();\n      });\n      this.visibilityObserver.observe(trigger);\n    }\n\n    this.scrollCapture = (event: Event) => {\n      const target = event.target as Node | null;\n      if (\n        target &&\n        this.movedPanel &&\n        (this.movedPanel === target || this.movedPanel.contains(target))\n      ) {\n        return;\n      }\n      this.close();\n      this.cdr.markForCheck();\n    };\n    document.addEventListener('scroll', this.scrollCapture, true);\n  }\n\n  /**\n   * Move an overlay element to `document.body` when it appears, and detach it when the\n   * query clears. Appending to the body root makes the element immune to ancestor\n   * `transform`/`filter`/`will-change`, so `position: fixed` anchors to the viewport —\n   * without this the panel lands mid-screen (and breaks outright on iOS).\n   *\n   * Returns the element now portalled, so the caller can store it. Idempotent and safe\n   * to call with `null`.\n   */\n  private portal(el: HTMLElement | null, current: HTMLElement | null): HTMLElement | null {\n    if (el) {\n      if (current === el) return current;\n      this.renderer.appendChild(document.body, el);\n      return el;\n    }\n    if (current) {\n      // Angular's view teardown may already have removed it; only detach if still attached.\n      const parent = current.parentNode;\n      if (parent) {\n        this.renderer.removeChild(parent, current);\n      }\n    }\n    return null;\n  }\n\n  /** Tears down the watchers installed by `startWatchingTrigger`. Idempotent. */\n  private stopWatchingTrigger(): void {\n    this.visibilityObserver?.disconnect();\n    this.visibilityObserver = null;\n    if (this.scrollCapture) {\n      document.removeEventListener('scroll', this.scrollCapture, true);\n      this.scrollCapture = null;\n    }\n  }\n\n  toggleOption(option: MnMultiSelectOption): void {\n    if (option.disabled) return;\n\n    const index = this.selectedValues.indexOf(option.value);\n    if (index > -1) {\n      this.selectedValues = this.selectedValues.filter((v) => v !== option.value);\n    } else {\n      if (this.props.maxSelections && this.selectedValues.length >= this.props.maxSelections) {\n        return;\n      }\n      this.selectedValues = [...this.selectedValues, option.value];\n    }\n    this.onChange(this.selectedValues);\n  }\n\n  removeOption(option: MnMultiSelectOption, event: Event): void {\n    event.stopPropagation();\n    this.selectedValues = this.selectedValues.filter((v) => v !== option.value);\n    this.onChange(this.selectedValues);\n  }\n\n  isSelected(option: MnMultiSelectOption): boolean {\n    return this.selectedValues.includes(option.value);\n  }\n\n  isMaxReached(option: MnMultiSelectOption): boolean {\n    if (!this.props.maxSelections) return false;\n    return this.selectedValues.length >= this.props.maxSelections && !this.isSelected(option);\n  }\n\n  /** Filters the options; the first match is highlighted so Enter toggles it, none once the box is cleared. */\n  onSearch(term: string): void {\n    this.searchTerm = term;\n    this.activeIndex = this.searchTerm\n      ? stepEnabledIndex(this.filteredOptions, -1, 1, this.isChoosable)\n      : -1;\n  }\n\n  /**\n   * Whether the keyboard may highlight an option: not disabled, and not blocked by `maxSelections`.\n   * An arrow function so it can be handed to `stepEnabledIndex` as it is.\n   */\n  private readonly isChoosable = (option: MnMultiSelectOption): boolean =>\n    !option.disabled && !this.isMaxReached(option);\n\n  /** Id of the keyboard-highlighted option, for `aria-activedescendant`; null when none is. */\n  get activeOptionId(): string | null {\n    const inRange = this.activeIndex >= 0 && this.activeIndex < this.filteredOptions.length;\n    return this.isOpen && inRange ? this.optionId(this.activeIndex) : null;\n  }\n\n  /**\n   * The DOM id of the option rendered at a position in `filteredOptions`.\n   * @param index - The option's position.\n   * @returns The id, unique per multi-select.\n   */\n  optionId(index: number): string {\n    return `${this.resolvedId}-option-${index}`;\n  }\n\n  /**\n   * Keyboard handling for the trigger and the search box, the WAI-ARIA combobox pattern. While\n   * closed, ArrowDown, ArrowUp, Enter and Space open the list with an option highlighted. While\n   * open, the arrows move the highlight past disabled options without wrapping, Home and End jump\n   * to the ends, Enter (and Space outside the search box) toggles the highlighted option and keeps the list open for the next one, Escape closes and Tab closes and lets focus move on. Enter and Space\n   * stop here, so they can never submit a surrounding form or close a surrounding modal.\n   * @param event - The keydown.\n   * @param fromSearch - True when it came from the search box, where Space, Home and End edit text.\n   */\n  onKeydown(event: KeyboardEvent, fromSearch = false): void {\n    if (this.isDisabled) return;\n    // Keys on a chip's remove button bubble up through the trigger; they are that button's own.\n    if (!fromSearch && event.target !== event.currentTarget) return;\n\n    if (!this.isOpen) {\n      if (fromSearch || !['ArrowDown', 'ArrowUp', 'Enter', ' '].includes(event.key)) return;\n      this.claim(event);\n      this.toggle();\n      this.moveActive(-1, event.key === 'ArrowUp' ? -1 : 1);\n      return;\n    }\n\n    switch (event.key) {\n      case 'ArrowDown':\n      case 'ArrowUp':\n        this.claim(event);\n        this.moveActive(this.activeIndex, event.key === 'ArrowDown' ? 1 : -1);\n        return;\n      case 'Home':\n      case 'End':\n        if (fromSearch) return;\n        this.claim(event);\n        this.moveActive(-1, event.key === 'Home' ? 1 : -1);\n        return;\n      case ' ':\n        if (fromSearch) return;\n        this.toggleActive(event);\n        return;\n      case 'Enter':\n        this.toggleActive(event);\n        return;\n      case 'Escape':\n        this.claim(event);\n        this.close();\n        this.focusTrigger();\n        return;\n      case 'Tab':\n        // Focus moves on from the trigger, so the search box's Tab order position never matters.\n        this.close();\n        this.focusTrigger();\n        return;\n    }\n  }\n\n  /**\n   * Moves the highlight one enabled option from `from` and scrolls it into view.\n   * @param from - Where to step from; -1 to start at an end.\n   * @param step - 1 for down, -1 for up.\n   */\n  private moveActive(from: number, step: 1 | -1): void {\n    this.activeIndex = stepEnabledIndex(this.filteredOptions, from, step, this.isChoosable);\n    this.revealActiveOption();\n  }\n\n  /**\n   * Toggles the highlighted option. The list stays open, as it does for a click, so several options\n   * can be picked in a row.\n   * @param event - The Enter or Space keydown, claimed so a form around the field is not submitted.\n   */\n  private toggleActive(event: KeyboardEvent): void {\n    this.claim(event);\n    const option = this.filteredOptions[this.activeIndex];\n    if (option && this.isChoosable(option)) {\n      this.toggleOption(option);\n    }\n  }\n\n  /**\n   * Takes a key for the field: no default action (no scroll, no form submit) and no bubbling to a\n   * surrounding modal's own Enter or Escape handling.\n   * @param event - The keydown to claim.\n   */\n  private claim(event: KeyboardEvent): void {\n    event.preventDefault();\n    event.stopPropagation();\n  }\n\n  /** Scrolls the highlighted option into view once the render that paints its ring has run. */\n  private revealActiveOption(): void {\n    afterNextRender(\n      () => {\n        const id = this.activeOptionId;\n        scrollOptionIntoView(id ? document.getElementById(id) : null);\n      },\n      { injector: this.injector },\n    );\n  }\n\n  /** Puts focus back on the trigger. */\n  private focusTrigger(): void {\n    this.triggerRef?.nativeElement.focus();\n  }\n\n  get filteredOptions(): MnMultiSelectOption[] {\n    if (!this.searchTerm) return this.props.options;\n    const lower = this.searchTerm.toLowerCase();\n    return this.props.options.filter((o) => o.label.toLowerCase().includes(lower));\n  }\n\n  get selectedOptions(): MnMultiSelectOption[] {\n    return this.props.options.filter((o) => this.selectedValues.includes(o.value));\n  }\n\n  // ========== Collapse Summary ==========\n\n  /**\n   * Whether the collapse-to-summary feature is opted into. Active when any of\n   * `collapsePlaceholder`, `collapseThreshold` or `allSelectedPlaceholder` is\n   * supplied; existing usages with none of them are unaffected.\n   */\n  get collapseEnabled(): boolean {\n    return (\n      this.props.collapsePlaceholder !== undefined ||\n      this.props.collapseThreshold !== undefined ||\n      this.props.allSelectedPlaceholder !== undefined\n    );\n  }\n\n  /**\n   * Whether every available option is currently selected. False for an empty select, where\n   * \"all of them\" would be a claim about nothing.\n   */\n  get allSelected(): boolean {\n    return (\n      this.props.options.length > 0 && this.selectedOptions.length === this.props.options.length\n    );\n  }\n\n  /**\n   * The threshold above which the trigger collapses. Defaults to 5 when collapsing\n   * is enabled via `collapsePlaceholder` alone (no explicit `collapseThreshold`).\n   */\n  get effectiveCollapseThreshold(): number {\n    return this.props.collapseThreshold ?? 5;\n  }\n\n  /**\n   * Whether the trigger should currently render a summary instead of the individual\n   * chips: when the number of selected options exceeds the effective threshold, or\n   * when every option is selected and a summary for that case was supplied.\n   */\n  get isCollapsed(): boolean {\n    if (!this.collapseEnabled) return false;\n    // \"Everything is selected\" is worth saying at any count, so it collapses on its own rather\n    // than waiting for the threshold a small option list would never reach.\n    if (this.allSelected && this.props.allSelectedPlaceholder !== undefined) return true;\n    return this.selectedOptions.length > this.effectiveCollapseThreshold;\n  }\n\n  /**\n   * The summary text shown while collapsed, with the `{count}` token replaced by\n   * the number of selected options. `allSelectedPlaceholder` wins while everything\n   * is selected, then `collapsePlaceholder`, then `\"{count} selected\"`.\n   */\n  get collapseSummaryText(): string {\n    const allSelectedTemplate = this.allSelected ? this.props.allSelectedPlaceholder : undefined;\n    const template =\n      allSelectedTemplate ??\n      this.props.collapsePlaceholder ??\n      this.resolveLabel(undefined, 'mnMultiSelect.selectedCount', '{count} selected');\n    return template.replace(/\\{count}/g, String(this.selectedOptions.length));\n  }\n\n  /** Trigger text shown while nothing is selected. */\n  get placeholderLabel(): string {\n    return this.resolveLabel(\n      this.props.placeholder,\n      'mnMultiSelect.placeholder',\n      'Select...',\n      this.uiConfig.placeholder,\n    );\n  }\n\n  /**\n   * Placeholder and accessible name of the dropdown's search input.\n   *\n   * Search auto-enables at `searchThreshold` options, so this box appears without any\n   * call site opting in — which is exactly why it must be translatable without one.\n   */\n  get searchPlaceholderLabel(): string {\n    return this.resolveLabel(\n      this.props.searchPlaceholder,\n      'mnMultiSelect.search',\n      'Search...',\n      this.uiConfig.searchPlaceholder,\n    );\n  }\n\n  /** Empty text shown when the search filters every option away. */\n  get noOptionsLabel(): string {\n    return this.resolveLabel(\n      undefined,\n      'mnMultiSelect.noOptions',\n      'No options found',\n      this.uiConfig.noOptionsFound,\n    );\n  }\n\n  /**\n   * Resolves one of the component's own labels, preferring what the caller gave it\n   * and falling back through the config layer, a conventional translation key and\n   * finally a readable English default.\n   *\n   * Mirrors `MnCollectionBase.resolveLabel`. Every string this component puts on\n   * screen that is not caller data goes through here: without the key step a\n   * consumer could only translate these by repeating the same literal at every call\n   * site, which is how \"Search...\" ends up in English on an otherwise Dutch page.\n   *\n   * @param explicit The label the caller passed through `props`, if any.\n   * @param key The conventional translation key to try next.\n   * @param fallback The English text used when neither resolves.\n   * @param configured The value the config layer resolved, if any.\n   * @returns The resolved label.\n   */\n  private resolveLabel(\n    explicit: string | undefined,\n    key: string,\n    fallback: string,\n    configured?: string,\n  ): string {\n    return explicit ?? configured ?? this.lang.translateIfPresent(key) ?? fallback;\n  }\n\n  handleBlur(): void {\n    this.onTouched();\n  }\n\n  // ========== Error Handling ==========\n\n  get control() {\n    return this.ngControl?.control ?? null;\n  }\n\n  get showError(): boolean {\n    const c = this.control;\n    return !!c && c.invalid && (c.touched || c.dirty);\n  }\n\n  private pickErrorKey(errors: ValidationErrors): string {\n    if (this.props.errorPriority) {\n      for (const key of this.props.errorPriority) {\n        if (errors[key] !== undefined) {\n          return key;\n        }\n      }\n    }\n    return Object.keys(errors)[0];\n  }\n\n  protected isRequired(): boolean {\n    if (!this.control) return false;\n    return this.control.hasValidator(Validators.required);\n  }\n\n  private resolveErrorMessageForKey(errorKey: string, errors: ValidationErrors): string {\n    const errorArgs = errors[errorKey];\n    const customMsg = this.props.errorMessages?.[errorKey];\n    const configMsg = this.uiConfig.errorMessages?.[errorKey];\n    const useBuiltIn = this.props.useBuiltInErrorMessages !== false;\n    const builtInMsg = useBuiltIn ? this.builtInErrorMessages[errorKey] : undefined;\n    const fallbackMsg = this.props.defaultErrorMessage;\n    const msgDef = customMsg ?? configMsg ?? builtInMsg ?? fallbackMsg ?? 'Invalid input';\n\n    if (typeof msgDef === 'function') {\n      return msgDef(errorArgs, errors);\n    }\n    // Interpolate {{placeholder}} tokens with validation error args\n    if (errorArgs && typeof errorArgs === 'object') {\n      return msgDef.replace(/\\{\\{(\\w+)}}/g, (_, key) => errorArgs[key] ?? _);\n    }\n    return msgDef;\n  }\n\n  get errorMessages(): string[] {\n    const errors = this.control?.errors;\n    if (!errors) return [];\n    return Object.keys(errors).map((key) => this.resolveErrorMessageForKey(key, errors));\n  }\n\n  get errorMessage(): string | null {\n    const errors = this.control?.errors;\n    if (!errors) return null;\n    const errorKey = this.pickErrorKey(errors);\n    return this.resolveErrorMessageForKey(errorKey, errors);\n  }\n\n  // ========== Resolved Properties ==========\n\n  get resolvedId(): string {\n    return this.props.id;\n  }\n\n  get resolvedName(): string | null {\n    return this.props?.name ?? null;\n  }\n\n  get triggerClasses(): string {\n    return mnMultiSelectVariants({\n      size: this.props.size,\n      borderRadius: this.props.borderRadius,\n      shadow: this.props.shadow,\n      fullWidth: this.props.fullWidth,\n    });\n  }\n}\n","<div class=\"flex flex-col h-full\" [class.is-fullwidth]=\"props.fullWidth\">\n  @if (uiConfig.label || props.label) {\n    <label class=\"pl-2 pb-1 flex flex-row gap-x-0.5! text-base!\" [attr.for]=\"resolvedId\">\n      <p>{{ uiConfig.label || props.label }}</p>\n      @if (isRequired()) {\n        <span class=\"text-error\" aria-hidden=\"true\">*</span>\n      }\n    </label>\n  }\n\n  <!-- Trigger -->\n  <div\n    #trigger\n    [id]=\"resolvedId\"\n    [ngClass]=\"triggerClasses\"\n    class=\"relative\"\n    [attr.aria-label]=\"uiConfig.ariaLabel || uiConfig.label || props.label || null\"\n    [attr.aria-invalid]=\"showError || null\"\n    [attr.aria-describedby]=\"showError ? resolvedId + '-error' : null\"\n    [attr.aria-expanded]=\"isOpen\"\n    [attr.aria-controls]=\"isOpen ? resolvedId + '-listbox' : null\"\n    role=\"combobox\"\n    [attr.aria-required]=\"isRequired() || null\"\n    tabindex=\"0\"\n    (click)=\"toggle()\"\n    (keydown)=\"onKeydown($event)\"\n    [attr.aria-activedescendant]=\"activeOptionId\"\n    (blur)=\"handleBlur()\"\n  >\n    <!-- `pr-6` reserves the gutter the caret is absolutely positioned in (right-2 +\n         w-4), so a value can never render underneath it. `min-w-0` lets the chips\n         shrink below their content width, which is what makes truncation possible. -->\n    <div class=\"flex flex-row items-center gap-x-2 flex-wrap min-h-6 min-w-0 pr-6\">\n      @if (selectedOptions.length === 0) {\n        <span class=\"text-base-content/50\">{{ placeholderLabel }}</span>\n      } @else if (isCollapsed) {\n        <span\n          class=\"inline-flex items-center max-w-full truncate bg-base-200 border border-accent text-base-content text-xs px-2 py-0.5 rounded-md\">\n          {{ collapseSummaryText }}\n        </span>\n      } @else {\n        @for (opt of selectedOptions; track opt.value) {\n          <!-- Only the × removes. The chip body deliberately carries no handler, so a click\n               anywhere on it bubbles to the trigger and just opens/closes the panel — clicking\n               the trigger to dismiss the dropdown must never silently delete a selection. -->\n          <span\n            class=\"inline-flex items-center gap-x-1 max-w-full min-w-0 bg-base-200 border border-accent text-base-content text-xs pl-2 py-0.5 rounded-md\">\n            <span [attr.title]=\"opt.label\" class=\"truncate\">{{ opt.label }}</span>\n            <button\n              mnButton\n              [data]=\"{ size: 'sm', variant: 'text', color: 'secondary', hover: false }\"\n              type=\"button\"\n              class=\"text-base-content/50 cursor-pointer shrink-0\"\n              (click)=\"removeOption(opt, $event)\"\n              [attr.aria-label]=\"'Remove ' + opt.label\"\n            ><svg [lucideIcon]=\"icons.X\" [size]=\"18\"></svg></button>\n          </span>\n        }\n      }\n    </div>\n    <div class=\"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none\">\n      <svg [size]=\"16\" class=\"text-base-content/50\" [lucideIcon]=\"icons.ChevronDown\"></svg>\n    </div>\n  </div>\n\n  <!-- Dropdown -->\n  @if (isOpen) {\n    @if (isSheet) {\n      <!-- On mobile the panel is presented as a shared bottom sheet: the sheet chrome\n           (backdrop, grabber, swipe/flick-to-dismiss, slide animation) lives in\n           mn-bottom-sheet; this component only projects the field's content into it.\n           The sheet host is portalled to document.body (see the `sheet` ViewChild) so\n           its `position: fixed` anchors to the viewport, not a transformed ancestor. -->\n      <mn-bottom-sheet\n        #sheet\n        (dismiss)=\"close()\"\n        [ariaLabel]=\"uiConfig.ariaLabel || uiConfig.label || props.label || uiConfig.placeholder || props.placeholder\"\n        [maxHeightVh]=\"80\"\n        [minHeightPx]=\"sheetFloorPx\"\n      >\n        <div\n          [id]=\"resolvedId + '-listbox'\"\n          aria-multiselectable=\"true\"\n          class=\"flex flex-col flex-1 min-h-0 overflow-hidden\"\n          role=\"listbox\"\n        >\n          <!-- The sheet covers its own trigger, so it carries a header to name the field; the\n               way out is the grabber (swipe-to-dismiss) and a backdrop tap. -->\n          <div class=\"px-4 pt-1 pb-2 shrink-0\">\n            <p class=\"text-base font-medium text-base-content truncate\">\n              {{ uiConfig.label || props.label || uiConfig.placeholder || props.placeholder || '' }}\n            </p>\n          </div>\n          <ng-container [ngTemplateOutlet]=\"panelBody\"></ng-container>\n        </div>\n      </mn-bottom-sheet>\n    } @else {\n      <!-- A transparent full-viewport shield behind the panel, so \"click anywhere to\n           dismiss\" is literally true. It also *consumes* that click: without it the click\n           reaches whatever sits underneath — inside a modal that is the modal's own\n           backdrop, so dismissing the dropdown would tear down the whole modal with it.\n           Portalled to document.body for the same reason the panel is. It is aria-hidden\n           and unfocusable: the keyboard equivalent of this click is Escape. -->\n      <div\n        #shield\n        (click)=\"onShieldClick($event)\"\n        [id]=\"resolvedId + '-shield'\"\n        [ngClass]=\"shieldClasses\"\n        aria-hidden=\"true\"\n      ></div>\n      <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n      <div\n        #dropdown\n        (click)=\"$event.stopPropagation()\"\n        [id]=\"resolvedId + '-listbox'\"\n        [ngClass]=\"panelClasses\"\n        [style.left]=\"dropdownStyle.left\"\n        [style.top]=\"dropdownStyle.top\"\n        [style.bottom]=\"dropdownStyle.bottom\"\n        [style.max-height]=\"dropdownStyle.maxHeight\"\n        [style.width]=\"dropdownStyle.width\"\n        aria-multiselectable=\"true\"\n        role=\"listbox\"\n      >\n        <ng-container [ngTemplateOutlet]=\"panelBody\"></ng-container>\n      </div>\n    }\n  }\n\n  <!-- The search box + option list, shared verbatim by the sheet and the anchored\n       popover. `isSheet` only tunes spacing/sizing and which element scrolls: in sheet\n       mode the list is the flex scroller; anchored, the popover itself scrolls. -->\n  <ng-template #panelBody>\n    @if (isSearchable) {\n      <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n      <div\n        (click)=\"$event.stopPropagation()\"\n        (keydown)=\"onKeydown($event, true)\"\n        [ngClass]=\"isSheet ? 'px-4 py-2' : 'p-2'\"\n        class=\"border-b border-base-300 shrink-0\"\n      >\n        <mn-lib-input-field\n          (ngModelChange)=\"onSearch($event)\"\n          [ngModelOptions]=\"{ standalone: true }\"\n          [ngModel]=\"searchTerm\"\n          [props]=\"{\n            id: resolvedId + '-search',\n            type: 'search',\n            placeholder: searchPlaceholderLabel,\n            ariaLabel: searchPlaceholderLabel,\n            ariaActiveDescendant: activeOptionId,\n            fullWidth: true,\n            size: 'sm'\n          }\"\n        ></mn-lib-input-field>\n      </div>\n    }\n    <div [ngClass]=\"isSheet ? 'flex-1 overflow-auto overscroll-contain' : ''\">\n      @for (opt of filteredOptions; track opt.value) {\n        <!-- Options are not Tab stops: the keyboard reaches them with the arrow keys while focus\n             stays on the trigger or the search box, and `aria-activedescendant` names the one it\n             is on. The ring marks that option, since it never receives real focus. -->\n        <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n        <div\n          (click)=\"toggleOption(opt); $event.stopPropagation()\"\n          [attr.aria-disabled]=\"opt.disabled || isMaxReached(opt) || null\"\n          [attr.aria-selected]=\"isSelected(opt)\"\n          [class.opacity-50]=\"opt.disabled || isMaxReached(opt)\"\n          [class.pointer-events-none]=\"opt.disabled || isMaxReached(opt)\"\n          [id]=\"optionId($index)\"\n          [ngClass]=\"[isSheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm', $index === activeIndex ? 'ring-2 ring-inset ring-primary' : '']\"\n          class=\"flex items-center gap-x-2 cursor-pointer text-base-content hover:bg-base-200\"\n          role=\"option\"\n        >\n          <input\n            [checked]=\"isSelected(opt)\"\n            [disabled]=\"opt.disabled || isMaxReached(opt)\"\n            class=\"w-4 h-4 accent-primary pointer-events-none shrink-0\"\n            tabindex=\"-1\"\n            type=\"checkbox\"\n          />\n          <span>{{ opt.label }}</span>\n        </div>\n      }\n      @if (filteredOptions.length === 0) {\n        <div [ngClass]=\"isSheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm'\" class=\"text-base-content/50\">\n          {{ noOptionsLabel }}\n        </div>\n      }\n    </div>\n  </ng-template>\n\n  @if (showError) {\n    @if (props.showAllErrors) {\n      <div class=\"flex flex-col gap-y-1 mt-1\">\n        @for (error of errorMessages; track $index) {\n          <mn-error-message [errorMessage]=\"error\" [id]=\"resolvedId + '-' + $index\"></mn-error-message>\n        }\n      </div>\n    } @else {\n      @if (errorMessage !== null) {\n        <mn-error-message [errorMessage]=\"errorMessage\" [id]=\"resolvedId\"></mn-error-message>\n      }\n    }\n  }\n</div>\n","import { tv, type VariantProps } from 'tailwind-variants';\n\n/**\n * Layout variants for the trigger button. An icon-only trigger (the default ⋯) is a\n * square affordance; a trigger with a text label grows to fit its content with\n * horizontal padding instead. The `labeled` axis switches between the two.\n */\nexport const mnDropdownTriggerVariants = tv({\n  base: 'inline-flex items-center justify-center gap-x-1.5 text-base-content/80 cursor-pointer',\n  variants: {\n    size: {\n      sm: '',\n      md: '',\n      lg: '',\n    },\n    labeled: {\n      true: '',\n      false: '',\n    },\n    borderRadius: {\n      none: 'rounded-none',\n      xs: 'rounded-xs',\n      sm: 'rounded-sm',\n      md: 'rounded-md',\n      lg: 'rounded-lg',\n      xl: 'rounded-xl',\n      full: 'rounded-full',\n    },\n  },\n  compoundVariants: [\n    // Icon-only: a fixed square box.\n    { labeled: false, size: 'sm', class: 'h-7 w-7' },\n    { labeled: false, size: 'md', class: 'h-9 w-9' },\n    { labeled: false, size: 'lg', class: 'h-11 w-11' },\n    // Labeled: content width with padding.\n    { labeled: true, size: 'sm', class: 'px-2.5 py-1 text-sm' },\n    { labeled: true, size: 'md', class: 'px-3 py-1.5 text-sm' },\n    { labeled: true, size: 'lg', class: 'px-4 py-2 text-base' },\n  ],\n  defaultVariants: {\n    size: 'md',\n    labeled: false,\n    borderRadius: 'md',\n  },\n});\n\nexport type MnDropdownTriggerVariants = VariantProps<typeof mnDropdownTriggerVariants>;\n","import { anchoredPanelPlacement } from '../shared/anchored-panel-placement';\nimport {\n  ChangeDetectorRef,\n  Component,\n  DestroyRef,\n  ElementRef,\n  HostListener,\n  inject,\n  InjectionToken,\n  Input,\n  OnInit,\n  Renderer2,\n  TemplateRef,\n  ViewChild,\n} from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { LucideDynamicIcon, LucideIconData } from '@lucide/angular';\nimport { skip } from 'rxjs';\nimport { MnButton, MnButtonTypes } from 'mn-angular-lib/button';\nimport { MnBottomSheet } from 'mn-angular-lib/bottom-sheet';\nimport { MnInputField } from '../mn-input-field';\nimport { MnConfigService } from 'mn-angular-lib/core';\nimport { MN_INSTANCE_ID, MN_SECTION_PATH } from 'mn-angular-lib/core';\nimport { MnLanguageService } from 'mn-angular-lib/core';\nimport {\n  MnDropdownAction,\n  MnDropdownActionColor,\n  MnDropdownItem,\n  MnDropdownProps,\n  MnDropdownSeparator,\n  MnDropdownUIConfig,\n} from './mn-dropdownTypes';\nimport { mnDropdownTriggerVariants } from './mn-dropdownVariants';\nimport * as lucide from 'lucide';\nimport { lucideIcons } from 'mn-angular-lib/core';\n\n/** Lucide icons this file renders. */\nconst ICONS = lucideIcons({\n  Check: lucide.Check,\n  ChevronDown: lucide.ChevronDown,\n  EllipsisVertical: lucide.EllipsisVertical,\n  SearchX: lucide.SearchX,\n});\n\nexport const MN_DROPDOWN_CONFIG = new InjectionToken<MnDropdownUIConfig>('MN_DROPDOWN_CONFIG');\n\n/** Counter backing the auto-generated {@link MnDropdownProps.id} when a caller omits one. */\nlet nextDropdownId = 0;\n\n/** Foreground class per action colour token, matching mn-button's text variants. */\nconst ACTION_COLOR_CLASS: Record<MnDropdownActionColor, string> = {\n  primary: 'text-primary',\n  secondary: 'text-secondary',\n  danger: 'text-error',\n  warning: 'text-warning',\n  success: 'text-success',\n  accent: 'text-accent',\n  gray: 'text-base-content/70',\n};\n\n/**\n * A ⋯ command menu. The trigger opens a `role=\"menu\"` list of {@link MnDropdownAction}s\n * that each fire and dismiss on choice — a *command* menu, not a value picker, so it is\n * intentionally not a ControlValueAccessor.\n *\n * Presentation mirrors mn-multi-select: an anchored popover on desktop and the shared\n * {@link MnBottomSheet} on mobile (< 640px). Both the popover and the sheet host are\n * portalled to `document.body` so their `position: fixed` anchors to the viewport rather\n * than any transformed/filtered ancestor (a table cell, a card) — the same root-cause fix\n * the multi-select applies.\n */\n@Component({\n  selector: 'mn-lib-dropdown',\n  standalone: true,\n  imports: [\n    NgClass,\n    NgTemplateOutlet,\n    FormsModule,\n    MnButton,\n    MnBottomSheet,\n    MnInputField,\n    LucideDynamicIcon,\n  ],\n  templateUrl: './mn-dropdown.html',\n  styleUrl: './mn-dropdown.css',\n})\nexport class MnDropdown implements OnInit {\n  /** Lucide icons the template renders. */\n  protected readonly icons = ICONS;\n\n  @Input({ required: true }) datasource!: MnDropdownProps;\n\n  protected uiConfig: MnDropdownUIConfig = {};\n\n  /** Lucide data for the trailing check shown on the {@link MnDropdownAction.active} row. */\n  protected readonly checkIcon = ICONS.Check;\n\n  private readonly configService = inject(MnConfigService);\n  private readonly sectionPath = inject(MN_SECTION_PATH, { optional: true }) ?? [];\n  private readonly explicitInstanceId = inject(MN_INSTANCE_ID, { optional: true });\n  private readonly elRef = inject(ElementRef);\n  private readonly lang = inject(MnLanguageService);\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly renderer = inject(Renderer2);\n  private readonly cdr = inject(ChangeDetectorRef);\n\n  /** Reference to the trigger element for positioning the popover. Read as an\n   *  `ElementRef` because `button[mnButton]` is a component — the default query would\n   *  otherwise return the MnButton instance, which has no `nativeElement`. */\n  @ViewChild('trigger', { static: false, read: ElementRef }) triggerRef!: ElementRef<HTMLElement>;\n\n  /**\n   * Layout classes for the anchored popover panel. Searchable menus become a flex column\n   * so the search box can be pinned (`shrink-0`) above a single scrolling list region —\n   * paired with {@link panelFloorPx}, that keeps the popover a fixed height while the\n   * filter runs, instead of the panel resizing on every keystroke. The mobile sheet is\n   * rendered by mn-bottom-sheet instead, so it needs no branch here.\n   */\n  get panelClasses(): string {\n    const base =\n      'fixed z-9999 min-w-48 max-w-[min(20rem,90vw)] bg-base-100 border border-base-300 rounded-md shadow-lg py-1 max-h-[60vh] -translate-x-full';\n    return this.isSearchable ? `${base} flex flex-col overflow-hidden` : `${base} overflow-auto`;\n  }\n\n  /** Tailwind's `sm` breakpoint — below this the menu renders as a bottom sheet.\n   *  Kept in step with the same constant in mn-bottom-sheet / mn-multi-select. */\n  private static readonly SHEET_MAX_WIDTH = 639.98;\n\n  /** The anchored popover panel currently moved into `document.body`, if any. */\n  private movedPanel: HTMLElement | null = null;\n  /** The bottom-sheet host, for outside-click tests. The sheet owns its own placement. */\n  private sheetHost: HTMLElement | null = null;\n\n  /** Whether the viewport is currently narrow enough for the sheet layout. */\n  private isNarrowViewport = false;\n  /** Live breakpoint match, so rotating the device re-evaluates the layout. */\n  private sheetMedia: MediaQueryList | null = null;\n  /** The listener registered on `sheetMedia`, retained for teardown. */\n  private sheetMediaListener: ((event: MediaQueryListEvent) => void) | null = null;\n\n  /** `document.body`'s inline `overflow` before the sheet locked it, restored on close. */\n  private previousBodyOverflow: string | null = null;\n\n  /**\n   * The anchored popover's opened height, locked so a shorter filtered list cannot resize\n   * it mid-type. Captured on the frame after the panel appears (with the full, unfiltered\n   * list), so applying it is jump-free — it only stops a later shrink. Null while closed\n   * or when the menu is not searchable, leaving the plain content-height popover untouched.\n   */\n  panelFloorPx: number | null = null;\n\n  /**\n   * The anchored popover's opened width, locked for the same reason as {@link panelFloorPx}:\n   * the panel is content-sized between its `min-w`/`max-w` bounds, so a filtered list that\n   * drops the widest item would otherwise shrink the popover mid-type. Captured on the same\n   * next-frame pass as the height, so applying it is jump-free. Null while closed or when the\n   * menu is not searchable, leaving the plain content-width popover untouched.\n   */\n  panelWidthPx: number | null = null;\n\n  /**\n   * The mobile sheet's opened height, applied as a `min-height` floor for the same reason\n   * as {@link panelFloorPx} — mirroring mn-multi-select's sheet floor. Null while anchored,\n   * closed, or non-searchable.\n   */\n  sheetFloorPx: number | null = null;\n\n  /** Watches the trigger while open, so the panel closes if the trigger is hidden. */\n  private visibilityObserver: IntersectionObserver | null = null;\n  /** Capture-phase scroll listener installed while open, closing on any ancestor scroll. */\n  private scrollCapture: ((event: Event) => void) | null = null;\n\n  isOpen = false;\n\n  /** Stable fallback id, used when {@link MnDropdownProps.id} is omitted. Generated once per\n   *  instance so the a11y wiring (menu id, `aria-controls`, the search input) stays valid. */\n  private readonly autoId = `mn-dropdown-${++nextDropdownId}`;\n\n  /** Current text in the search input, cleared on close. Only meaningful when the menu\n   *  is {@link MnDropdownProps.searchable}. */\n  searchTerm = '';\n\n  /** Popover position computed from the trigger's bounding rect. */\n  /** Inline placement of the anchored panel; `maxHeight` only binds when the viewport is the tighter cap. */\n  dropdownStyle: { top: string; bottom: string; left: string; maxHeight: string | null } = {\n    top: '0px',\n    bottom: 'auto',\n    left: '0px',\n    maxHeight: null,\n  };\n\n  /**\n   * The popover panel, relocated to `document.body` on appearance (see mn-multi-select's\n   * portal rationale) and detached when the query clears on close/destroy.\n   */\n  @ViewChild('dropdown', { static: false })\n  set dropdownRef(ref: ElementRef<HTMLElement> | undefined) {\n    const el = ref?.nativeElement ?? null;\n    this.movedPanel = this.portal(el, this.movedPanel);\n    if (el && this.isSearchable) {\n      this.capturePanelFloor(el);\n    } else if (!el) {\n      this.panelFloorPx = null;\n      this.panelWidthPx = null;\n    }\n  }\n\n  /**\n   * The bottom-sheet host, relocated to `document.body` so its `position: fixed`\n   * children anchor to the viewport rather than a transformed ancestor.\n   */\n  @ViewChild('sheet', { static: false, read: ElementRef })\n  set sheetRef(ref: ElementRef<HTMLElement> | undefined) {\n    const el = ref?.nativeElement ?? null;\n    this.sheetHost = el;\n    if (el && this.isSearchable) {\n      this.captureSheetFloor(el);\n    } else if (!el) {\n      this.sheetFloorPx = null;\n    }\n  }\n\n  ngOnInit(): void {\n    this.resolveConfig();\n    this.startWatchingViewport();\n\n    const sub = this.lang.locale$.pipe(skip(1)).subscribe(() => {\n      this.resolveConfig();\n      this.cdr.markForCheck();\n    });\n    this.destroyRef.onDestroy(() => {\n      sub.unsubscribe();\n      this.stopWatchingTrigger();\n      this.stopWatchingViewport();\n      this.unlockBodyScroll();\n      // Guarantee the portalled elements never outlive the component.\n      this.movedPanel = this.portal(null, this.movedPanel);\n      this.sheetHost = null;\n    });\n  }\n\n  private resolveConfig(): void {\n    const instanceId = this.explicitInstanceId || `mn-dropdown-${this.resolvedId}`;\n    this.uiConfig = this.configService.resolve<MnDropdownUIConfig>(\n      'mn-dropdown',\n      this.sectionPath,\n      instanceId,\n    );\n  }\n\n  // ── Breakpoint watching ──\n\n  private startWatchingViewport(): void {\n    if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return;\n\n    this.sheetMedia = window.matchMedia(`(max-width: ${MnDropdown.SHEET_MAX_WIDTH}px)`);\n    this.isNarrowViewport = this.sheetMedia.matches;\n\n    this.sheetMediaListener = (event: MediaQueryListEvent) => {\n      this.isNarrowViewport = event.matches;\n      this.close();\n      // The listener fires outside Angular, so a zoneless app needs an explicit nudge.\n      this.cdr.markForCheck();\n    };\n    this.sheetMedia.addEventListener('change', this.sheetMediaListener);\n  }\n\n  private stopWatchingViewport(): void {\n    if (this.sheetMedia && this.sheetMediaListener) {\n      this.sheetMedia.removeEventListener('change', this.sheetMediaListener);\n    }\n    this.sheetMedia = null;\n    this.sheetMediaListener = null;\n  }\n\n  // ── Open / close ──\n\n  toggle(): void {\n    if (this.isOpen) {\n      this.close();\n      return;\n    }\n    if (this.datasource.actions.length === 0) return;\n    // `toggle()` and `close()` are public API: a consumer holding a @ViewChild can\n    // open the panel without an event, and under OnPush nothing else marks this view.\n    this.isOpen = true;\n    this.cdr.markForCheck();\n    if (this.isSheet) {\n      // A sheet is anchored to the viewport, so it needs no trigger tracking — only a\n      // scroll lock so the page behind it stays put.\n      this.lockBodyScroll();\n      return;\n    }\n    this.updateDropdownPosition();\n    this.startWatchingTrigger();\n  }\n\n  /** The single close path, so every open-only listener is torn down with the panel. */\n  close(): void {\n    if (!this.isOpen) return;\n    this.isOpen = false;\n    this.cdr.markForCheck();\n    this.searchTerm = '';\n    this.panelFloorPx = null;\n    this.panelWidthPx = null;\n    this.sheetFloorPx = null;\n    this.stopWatchingTrigger();\n    this.unlockBodyScroll();\n  }\n\n  /** Whether the menu should currently render as a bottom sheet. */\n  get isSheet(): boolean {\n    return this.datasource.mobileSheet !== false && this.isNarrowViewport;\n  }\n\n  /** Fires an action and closes. Ignores disabled items defensively. */\n  select(action: MnDropdownAction): void {\n    if (action.disabled) return;\n    this.close();\n    action.run();\n  }\n\n  // ── Search ──\n\n  /** Whether the filter input is shown — the explicit `searchable` prop, off by default. */\n  get isSearchable(): boolean {\n    return this.datasource.searchable === true;\n  }\n\n  /**\n   * Records the current filter text as the search input changes. The input's\n   * ControlValueAccessor emits `null` for an empty field (its text adapter maps `''` to\n   * `null`), so coerce to `''` — otherwise clearing or backspacing the box would leave\n   * `searchTerm` null and {@link filteredActions}'s `.trim()` would throw, freezing the menu.\n   */\n  onSearch(term: string | null): void {\n    this.searchTerm = term ?? '';\n    // Public, like toggle()/close(): a caller that is not an event handler still has to\n    // see the list narrow.\n    this.cdr.markForCheck();\n  }\n\n  /**\n   * The actions currently passing the filter, in their declared order. Every action when\n   * the menu is not searchable or the box is empty; otherwise those whose resolved label\n   * or {@link MnDropdownAction.keywords} contain the (case-insensitive) query.\n   */\n  get filteredActions(): MnDropdownItem[] {\n    const term = (this.searchTerm ?? '').trim().toLowerCase();\n    if (!this.isSearchable || !term) return this.datasource.actions;\n    // While filtering, separators are dropped — a divider stranded between or after hidden\n    // results is meaningless — so match only real actions.\n    return this.datasource.actions.filter((item) => {\n      if (this.isSeparator(item)) return false;\n      const haystack = `${this.actionLabel(item)} ${item.keywords ?? ''}`.toLowerCase();\n      return haystack.includes(term);\n    });\n  }\n\n  /**\n   * Runs the first still-visible, enabled action — the Enter key's target, matching a\n   * help search where Enter opens the top hit. Skips separators. No-op when nothing matches.\n   */\n  selectFirstVisible(): void {\n    const first = this.filteredActions.find(\n      (item): item is MnDropdownAction => !this.isSeparator(item) && !item.disabled,\n    );\n    if (first) this.select(first);\n  }\n\n  // ── Positioning ──\n\n  private updateDropdownPosition(): void {\n    if (!this.triggerRef) return;\n    const rect = this.triggerRef.nativeElement.getBoundingClientRect();\n    // The panel is right-aligned to the trigger via a `-translate-x-full` class, so\n    // `left` is anchored to the trigger's right edge.\n    // Below the trigger while the viewport has room, above it otherwise, never past the edge;\n    // the cap it competes with is the panel's own 60vh.\n    this.dropdownStyle = {\n      ...anchoredPanelPlacement(rect, window.innerHeight, 4, window.innerHeight * 0.6),\n      left: `${rect.right}px`,\n    };\n  }\n\n  private startWatchingTrigger(): void {\n    this.stopWatchingTrigger();\n\n    const trigger = this.triggerRef?.nativeElement;\n    if (trigger && typeof IntersectionObserver !== 'undefined') {\n      this.visibilityObserver = new IntersectionObserver((entries) => {\n        if (!entries.some((entry) => !entry.isIntersecting)) return;\n        this.close();\n        this.cdr.markForCheck();\n      });\n      this.visibilityObserver.observe(trigger);\n    }\n\n    this.scrollCapture = (event: Event) => {\n      const target = event.target as Node | null;\n      if (\n        target &&\n        this.movedPanel &&\n        (this.movedPanel === target || this.movedPanel.contains(target))\n      ) {\n        return;\n      }\n      this.close();\n      this.cdr.markForCheck();\n    };\n    document.addEventListener('scroll', this.scrollCapture, true);\n  }\n\n  private stopWatchingTrigger(): void {\n    this.visibilityObserver?.disconnect();\n    this.visibilityObserver = null;\n    if (this.scrollCapture) {\n      document.removeEventListener('scroll', this.scrollCapture, true);\n      this.scrollCapture = null;\n    }\n  }\n\n  // ── Global dismissal ──\n\n  @HostListener('document:click', ['$event'])\n  onDocumentClick(event: Event): void {\n    const target = event.target as Node | null;\n    const insideHost = !!target && this.elRef.nativeElement.contains(target);\n    const insidePanel = !!target && !!this.movedPanel && this.movedPanel.contains(target);\n    const insideSheet = !!target && !!this.sheetHost && this.sheetHost.contains(target);\n    if (!insideHost && !insidePanel && !insideSheet) {\n      this.close();\n    }\n  }\n\n  @HostListener('document:keydown.escape')\n  onEscape(): void {\n    if (!this.isOpen) return;\n    this.close();\n    // Return focus to the trigger so keyboard users are not stranded.\n    this.triggerRef?.nativeElement.focus();\n  }\n\n  @HostListener('window:scroll', [])\n  @HostListener('window:resize', [])\n  onWindowScrollOrResize(): void {\n    // A sheet is viewport-anchored, so it has no stale position to escape; closing it on\n    // the `resize` a soft keyboard fires would also be wrong. The matchMedia listener\n    // handles a genuine layout switch instead.\n    if (this.isSheet) return;\n    this.close();\n  }\n\n  // ── Body scroll lock (sheet only) ──\n\n  private lockBodyScroll(): void {\n    if (this.previousBodyOverflow !== null) return;\n    this.previousBodyOverflow = document.body.style.overflow;\n    this.renderer.setStyle(document.body, 'overflow', 'hidden');\n  }\n\n  private unlockBodyScroll(): void {\n    if (this.previousBodyOverflow === null) return;\n    if (this.previousBodyOverflow) {\n      this.renderer.setStyle(document.body, 'overflow', this.previousBodyOverflow);\n    } else {\n      this.renderer.removeStyle(document.body, 'overflow');\n    }\n    this.previousBodyOverflow = null;\n  }\n\n  // ── Height floors (searchable only) ──\n\n  /**\n   * Records the anchored popover's opened height and width, locking them via\n   * {@link panelFloorPx} / {@link panelWidthPx}. Measured on the next frame so the read\n   * reflects the fully-rendered, unfiltered list (the search box is empty on open) and never\n   * forces a reflow mid change-detection. Both values equal the current dimensions, so\n   * applying them is jump-free — they only stop a later, shorter/narrower filtered list from\n   * shrinking the panel.\n   */\n  private capturePanelFloor(panelEl: HTMLElement): void {\n    if (typeof requestAnimationFrame !== 'function') {\n      this.panelFloorPx = panelEl.offsetHeight;\n      this.panelWidthPx = panelEl.offsetWidth;\n      return;\n    }\n    requestAnimationFrame(() => {\n      // The panel may have closed (or the query cleared) before the frame ran.\n      if (!this.isOpen || this.movedPanel !== panelEl) return;\n      this.panelFloorPx = panelEl.offsetHeight;\n      this.panelWidthPx = panelEl.offsetWidth;\n      this.cdr.markForCheck();\n    });\n  }\n\n  /**\n   * Records the sheet's opened height as its `min-height` floor, on the same next-frame\n   * basis as {@link capturePanelFloor}. `hostEl` is the portalled mn-bottom-sheet host\n   * (`display: contents`), so the height is read from its `.mn-sheet-container` child.\n   */\n  private captureSheetFloor(hostEl: HTMLElement): void {\n    const measure = (): number => {\n      const container = hostEl.querySelector<HTMLElement>('.mn-sheet-container');\n      return container?.offsetHeight ?? hostEl.offsetHeight;\n    };\n    if (typeof requestAnimationFrame !== 'function') {\n      this.sheetFloorPx = measure();\n      return;\n    }\n    requestAnimationFrame(() => {\n      if (!this.isOpen || this.sheetHost !== hostEl) return;\n      this.sheetFloorPx = measure();\n      this.cdr.markForCheck();\n    });\n  }\n\n  // ── Portal helper (see mn-multi-select for the full rationale) ──\n\n  private portal(el: HTMLElement | null, current: HTMLElement | null): HTMLElement | null {\n    if (el) {\n      if (current === el) return current;\n      this.renderer.appendChild(document.body, el);\n      return el;\n    }\n    if (current) {\n      const parent = current.parentNode;\n      if (parent) {\n        this.renderer.removeChild(parent, current);\n      }\n    }\n    return null;\n  }\n\n  // ── Resolved presentation ──\n\n  /** The label shown for an action, preferring a resolved translation key. */\n  actionLabel(action: MnDropdownAction): string {\n    const translated = action.labelKey ? this.lang.translateIfPresent(action.labelKey) : undefined;\n    return translated ?? action.label ?? '';\n  }\n\n  /**\n   * Whether an icon was supplied as a `TemplateRef` rather than lucide icon data, which\n   * decides how the template renders it. Kept as a method (not a pipe) so the narrowing\n   * is available inline in the item loop.\n   * @param value The icon to test.\n   * @returns True when the icon is a template the caller owns.\n   */\n  isTemplateRef(value: unknown): value is TemplateRef<unknown> {\n    return value instanceof TemplateRef;\n  }\n\n  /** Whether a list entry is a {@link MnDropdownSeparator} rather than a command. */\n  isSeparator(item: MnDropdownItem): item is MnDropdownSeparator {\n    return (item as MnDropdownSeparator).separator;\n  }\n\n  /**\n   * Narrows a list entry to a command, or null for a separator. Used as `@if (asAction(item);\n   * as action)` in the template so the item loop gets a reliably-typed {@link MnDropdownAction}\n   * without depending on template narrowing of the {@link isSeparator} guard.\n   * @param item The list entry to narrow.\n   * @returns The command, or null when the entry is a separator.\n   */\n  asAction(item: MnDropdownItem): MnDropdownAction | null {\n    return this.isSeparator(item) ? null : item;\n  }\n\n  /**\n   * Foreground class for an item: an explicit {@link MnDropdownAction.color}, else the\n   * destructive red for a {@link MnDropdownAction.danger} item, else the default text.\n   */\n  actionColorClass(action: MnDropdownAction): string {\n    if (action.color) return ACTION_COLOR_CLASS[action.color];\n    if (action.danger) return ACTION_COLOR_CLASS.danger;\n    return 'text-base-content';\n  }\n\n  /** Accessible name for the ⋯ trigger button. */\n  get triggerAriaLabel(): string {\n    const translated = this.datasource.ariaLabelKey\n      ? this.lang.translateIfPresent(this.datasource.ariaLabelKey)\n      : undefined;\n    return translated ?? this.datasource.ariaLabel ?? this.uiConfig.ariaLabel ?? 'Actions';\n  }\n\n  /** The visible text on the trigger, or null for an icon-only ⋯ trigger. */\n  get triggerLabelText(): string | null {\n    const translated = this.datasource.triggerLabelKey\n      ? this.lang.translateIfPresent(this.datasource.triggerLabelKey)\n      : undefined;\n    return translated ?? this.datasource.triggerLabel ?? null;\n  }\n\n  /**\n   * The trigger's glyph, normalised to a single representation so the template renders it\n   * one way — the same template-or-lucide-data path the menu items use — with no per-preset\n   * switch. Resolves, in order: an explicit `'none'` (no glyph); a caller's custom template\n   * or lucide data ({@link MnActionIcon}); otherwise a built-in preset mapped to its own\n   * lucide data (a labelled trigger defaults to the chevron, an icon-only one to the dots).\n   * @returns A template glyph, an icon-data glyph with its render size, or null for none.\n   */\n  private resolveTriggerGlyph():\n    | { template: TemplateRef<unknown> }\n    | { data: LucideIconData; size: number; dim: boolean }\n    | null {\n    const icon = this.datasource.triggerIcon;\n    if (icon === 'none') return null;\n    if (icon instanceof TemplateRef) return { template: icon };\n    if (icon != null && typeof icon !== 'string') return { data: icon, size: 18, dim: false };\n    const preset =\n      typeof icon === 'string' ? icon : this.triggerLabelText ? 'chevron' : 'dots-vertical';\n    // The chevron is a touch smaller and dimmed, matching a select's trailing affordance.\n    return preset === 'chevron'\n      ? { data: ICONS.ChevronDown, size: 16, dim: true }\n      : { data: ICONS.EllipsisVertical, size: 18, dim: false };\n  }\n\n  /** The trigger glyph when it is a caller's template, else null. Split from\n   *  {@link triggerIconData} so the template narrows without a discriminated union. */\n  get triggerIconTemplate(): TemplateRef<unknown> | null {\n    const glyph = this.resolveTriggerGlyph();\n    return glyph && 'template' in glyph ? glyph.template : null;\n  }\n\n  /** The trigger glyph when it is lucide data (a preset or caller data), with its render\n   *  size and dim flag, else null. */\n  get triggerIconData(): { data: LucideIconData; size: number; dim: boolean } | null {\n    const glyph = this.resolveTriggerGlyph();\n    return glyph && 'data' in glyph ? glyph : null;\n  }\n\n  /** Heading shown above the menu/sheet, or null when none is configured. */\n  get menuLabel(): string | null {\n    const translated = this.datasource.menuLabelKey\n      ? this.lang.translateIfPresent(this.datasource.menuLabelKey)\n      : undefined;\n    return translated ?? this.datasource.menuLabel ?? this.uiConfig.menuLabel ?? null;\n  }\n\n  /** Placeholder shown in the search input, preferring a resolved translation key. */\n  get searchPlaceholder(): string {\n    const translated = this.datasource.searchPlaceholderKey\n      ? this.lang.translateIfPresent(this.datasource.searchPlaceholderKey)\n      : undefined;\n    return (\n      translated ??\n      this.datasource.searchPlaceholder ??\n      this.uiConfig.searchPlaceholder ??\n      'Search...'\n    );\n  }\n\n  /** Text shown in place of the list when the filter matches no actions. */\n  get searchEmptyLabel(): string {\n    const translated = this.datasource.searchEmptyLabelKey\n      ? this.lang.translateIfPresent(this.datasource.searchEmptyLabelKey)\n      : undefined;\n    return (\n      translated ??\n      this.datasource.searchEmptyLabel ??\n      this.uiConfig.searchEmptyLabel ??\n      'No results'\n    );\n  }\n\n  /** The ghost look the trigger has always used; a bare or partial `triggerButton` merges\n   *  over this, so opting in without overriding anything keeps the current appearance. */\n  private static readonly DEFAULT_TRIGGER_BUTTON: Partial<MnButtonTypes> = {\n    size: 'sm',\n    variant: 'text',\n    color: 'gray',\n  };\n\n  /** mn-button config for the trigger: the ghost default, overlaid with any\n   *  {@link MnDropdownProps.triggerButton} the caller supplied. */\n  get triggerData(): Partial<MnButtonTypes> {\n    return { ...MnDropdown.DEFAULT_TRIGGER_BUTTON, ...this.datasource.triggerButton };\n  }\n\n  get triggerClasses(): string {\n    // Button mode: mn-button owns the entire look (fill/outline/size/radius/shape). The\n    // trigger's square-box variants would fight that — `h-7 w-7` overrides its padding,\n    // `text-base-content/80` its text colour — so keep only the label↔icon gap, which\n    // mn-button's base does not provide.\n    if (this.datasource.triggerButton) return 'gap-x-1.5';\n    // A caller's template can be any size (an avatar, a badge) and sizes the trigger itself,\n    // so skip the preset square-box — otherwise its `h-7 w-7` would clip the content, which\n    // is why custom triggers used to need a `triggerButton` just to undo it. (A lucide-data\n    // glyph is preset-sized, so it keeps the box for a consistent tap target.)\n    if (this.datasource.triggerIcon instanceof TemplateRef) return 'gap-x-1.5';\n    return mnDropdownTriggerVariants({\n      size: this.datasource.size,\n      borderRadius: this.datasource.borderRadius,\n      labeled: !!this.triggerLabelText,\n    });\n  }\n\n  get resolvedId(): string {\n    return this.datasource.id ?? this.autoId;\n  }\n}\n","<div class=\"relative inline-flex\">\n  <!-- Trigger -->\n  <button\n    #trigger\n    mnButton\n    type=\"button\"\n    [id]=\"resolvedId\"\n    [data]=\"triggerData\"\n    [ngClass]=\"triggerClasses\"\n    [attr.aria-label]=\"triggerLabelText ? null : triggerAriaLabel\"\n    [attr.aria-haspopup]=\"'menu'\"\n    [attr.aria-expanded]=\"isOpen\"\n    [attr.aria-controls]=\"isOpen ? resolvedId + '-menu' : null\"\n    (click)=\"toggle()\"\n  >\n    @if (triggerLabelText) {\n      <span class=\"truncate\">{{ triggerLabelText }}</span>\n    }\n    <!-- One glyph, rendered like a menu item's icon: a caller's template, else lucide data\n         (a preset resolves to its own data). No per-preset switch. -->\n    @if (triggerIconTemplate; as tpl) {\n      <span class=\"shrink-0 inline-flex items-center\">\n        <ng-container [ngTemplateOutlet]=\"tpl\"></ng-container>\n      </span>\n    } @else if (triggerIconData; as glyph) {\n      <span class=\"shrink-0 inline-flex items-center\">\n        <svg [lucideIcon]=\"glyph.data\" [size]=\"glyph.size\" [class.opacity-70]=\"glyph.dim\"></svg>\n      </span>\n    }\n  </button>\n\n  <!-- Menu -->\n  @if (isOpen) {\n    @if (isSheet) {\n      <!-- On mobile the menu is presented as the shared bottom sheet: chrome (backdrop,\n           grabber, swipe-to-dismiss, slide animation) lives in mn-bottom-sheet; this\n           component only projects the item list into it. The host is portalled to\n           document.body (see the `sheet` ViewChild). -->\n      <mn-bottom-sheet\n        #sheet\n        (dismiss)=\"close()\"\n        [ariaLabel]=\"menuLabel || triggerAriaLabel\"\n        [maxHeightVh]=\"80\"\n        [minHeightPx]=\"sheetFloorPx\"\n      >\n        <div [id]=\"resolvedId + '-menu'\" role=\"menu\" class=\"flex flex-col flex-1 min-h-0 overflow-hidden\">\n          <!-- The sheet covers its own trigger, so it carries a header to name itself; the\n               way out is the grabber (swipe-to-dismiss) and a backdrop tap. -->\n          <div class=\"px-4 pt-1 pb-2 shrink-0\">\n            <p class=\"text-base font-bold text-base-content truncate\">{{ menuLabel || triggerAriaLabel }}</p>\n          </div>\n          <ng-container [ngTemplateOutlet]=\"searchBox\" [ngTemplateOutletContext]=\"{ sheet: true }\"></ng-container>\n          <div class=\"flex-1 flex flex-col overflow-auto overscroll-contain\">\n            <ng-container [ngTemplateOutlet]=\"items\" [ngTemplateOutletContext]=\"{ sheet: true }\"></ng-container>\n          </div>\n        </div>\n      </mn-bottom-sheet>\n    } @else {\n      <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events,@angular-eslint/template/interactive-supports-focus -->\n      <div\n        #dropdown\n        (click)=\"$event.stopPropagation()\"\n        [id]=\"resolvedId + '-menu'\"\n        [ngClass]=\"panelClasses\"\n        [style.left]=\"dropdownStyle.left\"\n        [style.top]=\"dropdownStyle.top\"\n        [style.bottom]=\"dropdownStyle.bottom\"\n        [style.max-height]=\"dropdownStyle.maxHeight\"\n        [style.height.px]=\"panelFloorPx\"\n        [style.width.px]=\"panelWidthPx\"\n        role=\"menu\"\n      >\n        @if (menuLabel) {\n          <p class=\"px-3 pt-1 pb-1.5 text-xs font-medium text-base-content/50 truncate shrink-0\">{{ menuLabel }}</p>\n        }\n        <ng-container [ngTemplateOutlet]=\"searchBox\" [ngTemplateOutletContext]=\"{ sheet: false }\"></ng-container>\n        @if (isSearchable) {\n          <!-- Its own scroll region so the pinned search box above stays fixed and the\n               locked panel height (panelFloorPx) doesn't change as the list filters. The\n               flex column lets the empty state fill and centre in the reserved space. -->\n          <div class=\"flex-1 min-h-0 flex flex-col overflow-auto\">\n            <ng-container [ngTemplateOutlet]=\"items\" [ngTemplateOutletContext]=\"{ sheet: false }\"></ng-container>\n          </div>\n        } @else {\n          <ng-container [ngTemplateOutlet]=\"items\" [ngTemplateOutletContext]=\"{ sheet: false }\"></ng-container>\n        }\n      </div>\n    }\n  }\n\n  <!-- The item list, shared verbatim by the sheet and the anchored popover. `sheet`\n       only tunes the spacing so touch targets are roomier on mobile. -->\n  <ng-template #items let-sheet=\"sheet\">\n    @for (item of filteredActions; track $index) {\n      @if (asAction(item); as action) {\n        <button\n          type=\"button\"\n          role=\"menuitem\"\n          [disabled]=\"action.disabled\"\n          [attr.aria-current]=\"action.active ? 'true' : null\"\n          [class.opacity-50]=\"action.disabled\"\n          [class.pointer-events-none]=\"action.disabled\"\n          [ngClass]=\"[actionColorClass(action), sheet ? 'px-4 py-3 text-base' : 'px-3 py-2 text-sm', action.active ? 'bg-primary/10 font-medium' : '']\"\n          class=\"flex w-full shrink-0 items-center gap-x-2.5 text-left cursor-pointer hover:bg-base-200 focus-visible:bg-base-200 focus:outline-none transition-colors\"\n          (click)=\"select(action)\"\n        >\n          @if (action.icon) {\n            <span class=\"shrink-0 inline-flex items-center\">\n              @if (isTemplateRef(action.icon)) {\n                <ng-container [ngTemplateOutlet]=\"action.icon\"></ng-container>\n              } @else {\n                <!-- Data icon: rendered here so the item sizes it to match its own text\n                     (larger in the sheet, where the rows are touch-sized). -->\n                <svg [lucideIcon]=\"$any(action.icon)\" [size]=\"sheet ? 18 : 16\"></svg>\n              }\n            </span>\n          }\n          <span class=\"truncate min-w-0\">{{ actionLabel(action) }}</span>\n          <!-- The current choice's marker (e.g. the active language). Decorative: the\n               state is conveyed to assistive tech by `aria-current` on the row. -->\n          @if (action.active) {\n            <svg\n              [lucideIcon]=\"checkIcon\"\n              [size]=\"sheet ? 18 : 16\"\n              class=\"ml-auto shrink-0 text-primary\"\n              aria-hidden=\"true\"\n            ></svg>\n          }\n        </button>\n      } @else {\n        <hr role=\"separator\" [ngClass]=\"sheet ? 'mx-4 my-1.5' : 'mx-2 my-1'\" class=\"shrink-0 border-t border-base-300\" />\n      }\n    }\n    @if (isSearchable && filteredActions.length === 0) {\n      <div class=\"flex-1 flex flex-col items-center justify-center gap-2 px-4 py-6 text-center text-base-content/50\">\n        <svg [lucideIcon]=\"icons.SearchX\" [size]=\"sheet ? 28 : 24\" class=\"opacity-60\"></svg>\n        <span [ngClass]=\"sheet ? 'text-base' : 'text-sm'\">{{ searchEmptyLabel }}</span>\n      </div>\n    }\n  </ng-template>\n\n  <!-- The filter input, shared by the sheet and the anchored popover. Autofocused on\n       desktop (`!sheet`) so typing starts immediately; deliberately not on mobile, where\n       it would pop the soft keyboard and fight the viewport-anchored sheet. Enter runs\n       the first visible action via the wrapper's bubbled keydown. -->\n  <ng-template #searchBox let-sheet=\"sheet\">\n    @if (isSearchable) {\n      <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\n      <div\n        (click)=\"$event.stopPropagation()\"\n        (keydown.enter)=\"selectFirstVisible()\"\n        [ngClass]=\"sheet ? 'px-4 py-2' : 'p-2'\"\n        class=\"border-b border-base-300 shrink-0\"\n      >\n        <mn-lib-input-field\n          (ngModelChange)=\"onSearch($event)\"\n          [ngModelOptions]=\"{ standalone: true }\"\n          [ngModel]=\"searchTerm\"\n          [props]=\"{\n            id: resolvedId + '-search',\n            type: 'search',\n            placeholder: searchPlaceholder,\n            ariaLabel: searchPlaceholder,\n            fullWidth: true,\n            size: 'sm',\n            autoFocus: !sheet\n          }\"\n        ></mn-lib-input-field>\n      </div>\n    }\n  </ng-template>\n</div>\n","/**\n * Public API of the `mn-angular-lib/forms` entry point: form fields (input, checkbox, textarea, datetime, file input, select, multi-select, dropdown).\n *\n * Each entry point is its own module in the published package, so a consumer's bundler\n * splits it into the chunk that uses it instead of loading the whole library at startup.\n * The root `mn-angular-lib` entry re-exports every entry point.\n */\nexport * from './src/mn-input-field';\nexport * from './src/mn-checkbox';\nexport * from './src/mn-textarea';\nexport * from './src/mn-datetime';\nexport * from './src/mn-file-input';\nexport * from './src/mn-select';\nexport * from './src/mn-multi-select';\nexport * from './src/mn-dropdown';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2","ICONS","i1"],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;AAgBG;AA0GH;;;;;;;;;;;AAWG;AACH,MAAM,WAAW,GAAG,CAAC,GAAW,MAAqB,GAAG,KAAK,EAAE,GAAG,IAAI,GAAG,GAAG,CAAC;AAE7E;;;;;;;;;;AAUG;AACI,MAAM,kBAAkB,GAAkC;IAC/D,KAAK,EAAE,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,CAAC;IAChC,MAAM,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,IAAI,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;AACjD,IAAA,KAAK,EAAE,OAAO,EAAE,CAAC;AACjB,IAAA,QAAQ,EAAE,MAAM,IAAI;AACpB,IAAA,SAAS,EAAE,CAAC,KAAa,EAAE,IAAY,KAAY;AACjD,QAAA,IAAI,CAAC,IAAI,IAAI,CAAC,KAA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