import { forwardRef } from '@angular/core';
import { ControlContainer, FormGroupDirective, NG_VALUE_ACCESSOR } from '@angular/forms';
/**
 * Creates a value accessor provider for a form component.
 * @param component - The component that implements the NG_VALUE_ACCESSOR interface.
 * @returns An ExistingProvider object for the value accessor.
 */
export const provideValueAccessor = (component) => ({
    provide: NG_VALUE_ACCESSOR,
    useExisting: forwardRef(() => component),
    multi: true,
});
/**
 * Creates a control container provider using FormGroupDirective.
 * @returns An ExistingProvider object for the control container.
 */
export const provideControlContainer = () => ({
    provide: ControlContainer,
    useExisting: FormGroupDirective,
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS51dGlsLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2lyY2xldG9uZS9zcmMvbGliL2Zvcm1zL3V0aWxzL2Zvcm0udXRpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQW9CLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUM3RCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsa0JBQWtCLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUV6Rjs7OztHQUlHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sb0JBQW9CLEdBQUcsQ0FBQyxTQUFrQixFQUFvQixFQUFFLENBQUMsQ0FBQztJQUM3RSxPQUFPLEVBQUUsaUJBQWlCO0lBQzFCLFdBQVcsRUFBRSxVQUFVLENBQUMsR0FBRyxFQUFFLENBQUMsU0FBUyxDQUFDO0lBQ3hDLEtBQUssRUFBRSxJQUFJO0NBQ1osQ0FBQyxDQUFDO0FBRUg7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sdUJBQXVCLEdBQUcsR0FBcUIsRUFBRSxDQUFDLENBQUM7SUFDOUQsT0FBTyxFQUFFLG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