/**
 * Normalize a value entry that may carry the deprecated single `value` field
 * or the canonical `values` array into a plain `string[]`.
 */
export const getUserAttributeValues = (entry) => {
    if (entry.values && entry.values.length > 0) {
        return entry.values;
    }
    if (entry.value !== undefined && entry.value !== '') {
        return [entry.value];
    }
    return [];
};
/**
 * Resolve the canonical `attributeDefaults` array (preferred) or the deprecated
 * `attributeDefault` (array or single string) into `string[] | null`
 * (null = no default).
 */
export const getAttributeDefaultValues = (entry) => {
    if (entry.attributeDefaults !== undefined) {
        const defaults = entry.attributeDefaults;
        return defaults && defaults.length > 0 ? defaults : null;
    }
    const legacy = entry.attributeDefault;
    if (legacy == null) {
        return null;
    }
    if (Array.isArray(legacy)) {
        return legacy.length > 0 ? legacy : null;
    }
    return legacy === '' ? null : [legacy];
};
//# sourceMappingURL=userAttributes.js.map