{"version":3,"file":"ng-primitives-utils.mjs","sources":["../../../../packages/ng-primitives/utils/src/forms/providers.ts","../../../../packages/ng-primitives/utils/src/observables/take-until-destroyed.ts","../../../../packages/ng-primitives/utils/src/forms/status.ts","../../../../packages/ng-primitives/utils/src/helpers/attributes.ts","../../../../packages/ng-primitives/utils/src/helpers/coercion.ts","../../../../packages/ng-primitives/utils/src/helpers/disposables.ts","../../../../packages/ng-primitives/utils/src/helpers/unique-id.ts","../../../../packages/ng-primitives/utils/src/helpers/validators.ts","../../../../packages/ng-primitives/utils/src/signals/index.ts","../../../../packages/ng-primitives/utils/src/ng-primitives-utils.ts"],"sourcesContent":["import { ExistingProvider, Type } from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * A simple helper function to provide a value accessor for a given type.\n * @param type The type to provide the value accessor for\n */\nexport function provideValueAccessor<T>(type: Type<T>): ExistingProvider {\n  return { provide: NG_VALUE_ACCESSOR, useExisting: type, multi: true };\n}\n","/* eslint-disable @nx/workspace-take-until-destroyed */\nimport { DestroyRef } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { EMPTY, MonoTypeOperatorFunction, NEVER, pipe } from 'rxjs';\nimport { catchError, defaultIfEmpty, takeUntil } from 'rxjs/operators';\n\n/**\n * The built-in `takeUntilDestroyed` operator does not handle the case when the component is destroyed before the source observable emits.\n * This operator ensures that the source observable completes gracefully without throwing an error.\n * https://github.com/angular/angular/issues/54527#issuecomment-2098254508\n *\n * @internal\n */\nexport function safeTakeUntilDestroyed<T>(destroyRef?: DestroyRef): MonoTypeOperatorFunction<T> {\n  return pipe(\n    takeUntil(\n      NEVER.pipe(\n        takeUntilDestroyed(destroyRef),\n        catchError(() => EMPTY),\n        defaultIfEmpty(null),\n      ),\n    ),\n  );\n}\n","import {\n  DestroyRef,\n  Injector,\n  Signal,\n  WritableSignal,\n  effect,\n  inject,\n  signal,\n  untracked,\n} from '@angular/core';\nimport { NgControl } from '@angular/forms';\nimport { onMount } from 'ng-primitives/state';\nimport { safeTakeUntilDestroyed } from '../observables/take-until-destroyed';\n\nexport interface NgpControlStatus {\n  valid: boolean | null;\n  invalid: boolean | null;\n  pristine: boolean | null;\n  dirty: boolean | null;\n  touched: boolean | null;\n  pending: boolean | null;\n  disabled: boolean | null;\n}\n\n/**\n * Detects an Angular signal-forms interop control without importing any of the new\n * signal-form types. Interop controls expose a `field()` method which returns the\n * underlying FieldState.\n */\nfunction isInteropControl(control: NgControl | null | undefined): boolean {\n  return !!control && typeof (control as any).field === 'function';\n}\n\n/**\n * Reads status from a control and updates the status signal.\n * Wrapped in try-catch to handle signal-forms interop controls where\n * the `field` input may not be available yet (throws NG0950).\n */\nfunction updateStatus(control: NgControl, status: WritableSignal<NgpControlStatus>): void {\n  try {\n    // For interop controls, read directly from the control (which has signal getters).\n    // For classic controls, read from the underlying AbstractControl.\n    const source = isInteropControl(control) ? control : ((control as any).control ?? control);\n\n    const newStatus: NgpControlStatus = {\n      valid: source.valid ?? null,\n      invalid: source.invalid ?? null,\n      pristine: source.pristine ?? null,\n      dirty: source.dirty ?? null,\n      touched: source.touched ?? null,\n      pending: source.pending ?? null,\n      disabled: source.disabled ?? null,\n    };\n\n    untracked(() => status.set(newStatus));\n  } catch {\n    // NG0950: Required input not available yet. The effect will re-run\n    // when the signal input becomes available.\n  }\n}\n\n/**\n * A utility function to get the status of an Angular form control as a reactive signal.\n * This function injects the NgControl and returns a signal that reflects the control's status.\n * It supports both classic reactive forms controls and signal-forms interop controls.\n * @internal\n */\n/**\n * Sets up event subscription for a given NgControl.\n * Only sets up the subscription - does not call updateStatus.\n */\nfunction setupEventSubscription(\n  ngControl: NgControl,\n  status: WritableSignal<NgpControlStatus>,\n  destroyRef: DestroyRef,\n): void {\n  // For classic controls, also subscribe to the events observable.\n  const underlyingControl = (ngControl as any).control;\n  if (underlyingControl?.events) {\n    underlyingControl.events\n      .pipe(safeTakeUntilDestroyed(destroyRef))\n      .subscribe(() => updateStatus(ngControl, status));\n  }\n}\n\nexport function controlStatus(): Signal<NgpControlStatus> {\n  const injector = inject(Injector);\n  const destroyRef = inject(DestroyRef);\n\n  const status = signal<NgpControlStatus>({\n    valid: null,\n    invalid: null,\n    pristine: null,\n    dirty: null,\n    touched: null,\n    pending: null,\n    disabled: null,\n  });\n\n  const control = signal<NgControl | null>(null);\n\n  onMount(() => {\n    // Try to inject NgControl immediately for initial state\n    control.set(inject(NgControl, { optional: true }));\n\n    // If we have a control immediately, update initial status\n    if (control()) {\n      updateStatus(control()!, status);\n    }\n\n    // Get the control (either from initial injection or from mount)\n    const mountControl = control() || inject(NgControl, { optional: true });\n\n    if (!mountControl) {\n      return;\n    }\n\n    // Update control signal if it wasn't set before\n    if (!control()) {\n      control.set(mountControl);\n    }\n\n    // Update status to ensure latest values\n    updateStatus(mountControl, status);\n\n    // Set up event subscription for reactive updates\n    setupEventSubscription(mountControl, status, destroyRef);\n  });\n\n  // Use an effect to reactively track status changes.\n  // For signal-forms interop controls, the status properties are signals.\n  // For classic controls, this will read the current values and establish\n  // no signal dependencies, but we also subscribe to events below.\n  effect(\n    () => {\n      const c = control();\n      if (c) {\n        updateStatus(c, status);\n      }\n    },\n    { injector },\n  );\n\n  return status;\n}\n","import { afterRenderEffect, Signal } from '@angular/core';\n\nexport function booleanAttributeBinding(\n  element: HTMLElement,\n  attribute: string,\n  value: Signal<boolean> | undefined,\n): void {\n  // eslint-disable-next-line @angular-eslint/no-uncalled-signals -- checking whether the optional signal was provided, not its value\n  if (value === undefined) {\n    return;\n  }\n\n  afterRenderEffect({\n    write: () =>\n      value() ? element.setAttribute(attribute, '') : element.removeAttribute(attribute),\n  });\n}\n","import { BooleanInput, NumberInput } from '@angular/cdk/coercion';\nimport { booleanAttribute, numberAttribute } from '@angular/core';\n\n/**\n * A number input `transform` for a two-way value that may be uncontrolled.\n *\n * `numberAttribute` coerces `undefined` to `NaN`, which `controlledState` reads\n * as a defined (controlled) value and latches the primitive into controlled\n * mode with a bogus number. This preserves `undefined` so an absent binding\n * stays uncontrolled, while coercing every other value as usual.\n */\nexport function coerceNumberOrUndefined(value: NumberInput): number | undefined {\n  return value === undefined ? undefined : numberAttribute(value);\n}\n\n/**\n * A boolean input `transform` for a two-way value that may be uncontrolled.\n *\n * `booleanAttribute` coerces `undefined` to `false`, which `controlledState`\n * reads as a defined (controlled) value and latches the primitive into\n * controlled mode. This preserves `undefined` so an absent binding stays\n * uncontrolled, while coercing every other value as usual.\n */\nexport function coerceBooleanOrUndefined(value: BooleanInput): boolean | undefined {\n  return value === undefined ? undefined : booleanAttribute(value);\n}\n","import { DestroyRef, inject } from '@angular/core';\n\n/**\n * Disposable functions are a way to manage timers, intervals, and event listeners\n * that should be cleared when a component is destroyed.\n *\n * Each disposable releases its DestroyRef registration as soon as the resource\n * is gone (the timer fires or the returned cleanup runs), so repeated calls -\n * e.g. rescheduling a timeout on every pointermove - don't accumulate destroy\n * callbacks for the lifetime of the host.\n *\n * This is heavily inspired by Headless UI disposables:\n * https://github.com/tailwindlabs/headlessui/blob/main/packages/%40headlessui-react/src/utils/disposables.ts\n */\nexport function injectDisposables() {\n  const destroyRef = inject(DestroyRef);\n  let isDestroyed = false;\n\n  destroyRef.onDestroy(() => (isDestroyed = true));\n\n  return {\n    /**\n     * Set a timeout that will be cleared when the component is destroyed.\n     * @param callback The callback to execute\n     * @param delay The delay before the callback is executed\n     * @returns A function to clear the timeout\n     */\n    setTimeout: (callback: () => void, delay: number) => {\n      if (isDestroyed) {\n        // eslint-disable-next-line @typescript-eslint/no-empty-function\n        return () => {};\n      }\n\n      const id = setTimeout(() => {\n        unregister();\n        callback();\n      }, delay);\n      const unregister = destroyRef.onDestroy(() => clearTimeout(id));\n      return () => {\n        clearTimeout(id);\n        unregister();\n      };\n    },\n    /**\n     * Add an event listener that will be removed when the component is destroyed.\n     * @param target The event target\n     * @param type The event type\n     * @param listener The event listener\n     * @param options The event listener options\n     * @returns A function to remove the event listener\n     */\n    addEventListener: <K extends keyof HTMLElementEventMap>(\n      target: EventTarget,\n      type: K,\n      // eslint-disable-next-line @typescript-eslint/no-explicit-any\n      listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any,\n      options?: boolean | AddEventListenerOptions,\n    ) => {\n      if (isDestroyed) {\n        // eslint-disable-next-line @typescript-eslint/no-empty-function\n        return () => {};\n      }\n\n      target.addEventListener(type, listener as EventListenerOrEventListenerObject, options);\n      const unregister = destroyRef.onDestroy(() =>\n        target.removeEventListener(type, listener as EventListenerOrEventListenerObject, options),\n      );\n      return () => {\n        target.removeEventListener(type, listener as EventListenerOrEventListenerObject, options);\n        unregister();\n      };\n    },\n    /**\n     * Set an interval that will be cleared when the component is destroyed.\n     * @param callback The callback to execute\n     * @param delay The delay between executions\n     * @returns A function to clear the interval\n     */\n    setInterval: (callback: () => void, delay: number) => {\n      if (isDestroyed) {\n        // eslint-disable-next-line @typescript-eslint/no-empty-function\n        return () => {};\n      }\n\n      const id = setInterval(callback, delay);\n      const unregister = destroyRef.onDestroy(() => clearInterval(id));\n      return () => {\n        clearInterval(id);\n        unregister();\n      };\n    },\n    /**\n     * Set a requestAnimationFrame that will be cleared when the component is destroyed.\n     * @param callback The callback to execute\n     * @returns A function to clear the requestAnimationFrame\n     */\n    requestAnimationFrame: (callback: FrameRequestCallback) => {\n      if (isDestroyed) {\n        // eslint-disable-next-line @typescript-eslint/no-empty-function\n        return () => {};\n      }\n\n      const id = requestAnimationFrame(time => {\n        unregister();\n        callback(time);\n      });\n      const unregister = destroyRef.onDestroy(() => cancelAnimationFrame(id));\n      return () => {\n        cancelAnimationFrame(id);\n        unregister();\n      };\n    },\n  };\n}\n","/**\n * Store a map of unique ids for elements so that there are no collisions.\n */\nconst uniqueIdMap = new Map<string, number>();\n\n/**\n * Generate a unique id for an element\n * @param prefix - The prefix to use for the id\n * @returns The generated id\n */\nexport function uniqueId(prefix: string): string {\n  const id = uniqueIdMap.get(prefix) ?? 0;\n  uniqueIdMap.set(prefix, id + 1);\n  return `${prefix}-${id}`;\n}\n","/**\n * Type validation utilities\n */\n\n/**\n * Checks if a value is a string\n * @param value - The value to check\n * @returns true if the value is a string, false otherwise\n */\nexport function isString(value: unknown): value is string {\n  return typeof value === 'string';\n}\n\n/**\n * Checks if a value is a number\n * @param value - The value to check\n * @returns true if the value is a number, false otherwise\n */\nexport function isNumber(value: unknown): value is number {\n  return typeof value === 'number';\n}\n\n/**\n * Checks if a value is a boolean\n * @param value - The value to check\n * @returns true if the value is a boolean, false otherwise\n */\nexport function isBoolean(value: unknown): value is boolean {\n  return typeof value === 'boolean';\n}\n\n/**\n * Checks if a value is a function\n * @param value - The value to check\n * @returns true if the value is a function, false otherwise\n */\nexport function isFunction(value: unknown): value is CallableFunction {\n  return typeof value === 'function';\n}\n\n/**\n * Checks if a value is a plain object (but not null or array)\n * @param value - The value to check\n * @returns true if the value is a plain object, false otherwise\n */\nexport function isObject(value: unknown): value is Record<string, unknown> {\n  return !!value && typeof value === 'object' && !Array.isArray(value);\n}\n\n/**\n * Checks if a value is undefined\n * @param value - The value to check\n * @returns true if the value is undefined, false otherwise\n */\nexport function isUndefined(value: unknown): value is undefined {\n  return typeof value === 'undefined';\n}\n\n/**\n * Checks if a value is null or undefined\n * @param value - The value to check\n * @returns true if the value is null or undefined, false otherwise\n */\nexport function isNil(value: unknown): value is null | undefined {\n  return isUndefined(value) || value === null;\n}\n\n/**\n * Checks if a value is not null and not undefined\n * @param value - The value to check\n * @returns true if the value is not null and not undefined, false otherwise\n */\nexport function notNil<T>(value: T | null | undefined): value is T {\n  return !isNil(value);\n}\n","import { effect, Injector, Signal, signal, untracked } from '@angular/core';\n\n/**\n * Listen for changes to a signal and call a function when the signal changes.\n * @param source\n * @param fn\n * @param options\n * @param options.injector\n * @internal\n */\nexport function onChange<T>(\n  source: Signal<T>,\n  fn: (value: T, previousValue: T | null | undefined) => void,\n  options?: { injector: Injector },\n): void {\n  const previousValue = signal(source());\n\n  effect(\n    () => {\n      const value = source();\n      if (value !== previousValue()) {\n        untracked(() => fn(value, previousValue()));\n        previousValue.set(value);\n      }\n    },\n    { injector: options?.injector },\n  );\n\n  // call the fn with the initial value\n  fn(source(), null);\n}\n\n/**\n * Listen for changes to a boolean signal and call one of two functions when the signal changes.\n * @param source\n * @param onTrue\n * @param onFalse\n * @param options\n */\nexport function onBooleanChange(\n  source: Signal<boolean>,\n  onTrue?: () => void,\n  onFalse?: () => void,\n  options?: { injector: Injector },\n): void {\n  onChange(source, value => (value ? onTrue?.() : onFalse?.()), options);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAGA;;;AAGG;AACG,SAAU,oBAAoB,CAAI,IAAa,EAAA;AACnD,IAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;AACvE;;ACHA;;;;;;AAMG;AACG,SAAU,sBAAsB,CAAI,UAAuB,EAAA;AAC/D,IAAA,OAAO,IAAI,CACT,SAAS,CACP,KAAK,CAAC,IAAI,CACR,kBAAkB,CAAC,UAAU,CAAC,EAC9B,UAAU,CAAC,MAAM,KAAK,CAAC,EACvB,cAAc,CAAC,IAAI,CAAC,CACrB,CACF,CACF;AACH;;ACCA;;;;AAIG;AACH,SAAS,gBAAgB,CAAC,OAAqC,EAAA;IAC7D,OAAO,CAAC,CAAC,OAAO,IAAI,OAAQ,OAAe,CAAC,KAAK,KAAK,UAAU;AAClE;AAEA;;;;AAIG;AACH,SAAS,YAAY,CAAC,OAAkB,EAAE,MAAwC,EAAA;AAChF,IAAA,IAAI;;;QAGF,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,OAAO,IAAK,OAAe,CAAC,OAAO,IAAI,OAAO,CAAC;AAE1F,QAAA,MAAM,SAAS,GAAqB;AAClC,YAAA,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,IAAI;AAC3B,YAAA,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI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