import { AXTranslationService } from '@acorex/core/translation';
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';

class AXMSettingProvider {
    constructor(injector) {
        this.injector = injector;
        this.translateService = this.injector.get(AXTranslationService);
    }
    async provide(context) {
        const trans = async (key) => await this.translateService.translateAsync(`@auth:settings.${key}`);
        context
            .addGroup('security-settings', await trans('title'), await trans('description'), 'fa-light fa-lock')
            // Authentication Section - Tenant Level
            .addSection('authentication', await trans('authentication.title'), await trans('authentication.description'))
            .addSetting({
            key: 'two-factor-auth',
            title: await trans('authentication.two-factor.title'),
            scope: 'T',
            isInherited: true,
            defaultValue: false,
            widget: {
                type: AXPWidgetsCatalog.toggle,
            },
            description: await trans('authentication.two-factor.description'),
        })
            .addSetting({
            key: 'password-complexity',
            title: await trans('authentication.password.title'),
            scope: 'T',
            isInherited: true,
            defaultValue: 'Medium',
            widget: {
                type: AXPWidgetsCatalog.select,
                options: {
                    valueField: 'value',
                    textField: 'text',
                    dataSource: [
                        {
                            text: await trans('authentication.password.options.low'),
                            value: 'Low'
                        },
                        {
                            text: await trans('authentication.password.options.medium'),
                            value: 'Medium'
                        },
                        {
                            text: await trans('authentication.password.options.high'),
                            value: 'High'
                        },
                    ],
                },
            },
            description: await trans('authentication.password.description'),
        })
            .addSetting({
            key: 'password-expiry-days',
            title: await trans('authentication.password-expiry.title'),
            scope: 'T',
            isInherited: true,
            defaultValue: 90,
            widget: {
                type: AXPWidgetsCatalog.number,
                options: {
                    minValue: 30,
                    maxValue: 365,
                    step: 1
                },
            },
            description: await trans('authentication.password-expiry.description'),
        })
            .addSetting({
            key: 'max-login-attempts',
            title: await trans('authentication.max-attempts.title'),
            scope: 'T',
            isInherited: true,
            defaultValue: 5,
            widget: {
                type: AXPWidgetsCatalog.number,
                options: {
                    minValue: 3,
                    maxValue: 10,
                    step: 1
                },
            },
            description: await trans('authentication.max-attempts.description'),
        })
            .addSetting({
            key: 'lockout-duration',
            title: await trans('authentication.lockout.title'),
            scope: 'T',
            isInherited: true,
            defaultValue: 15,
            widget: {
                type: AXPWidgetsCatalog.number,
                options: {
                    minValue: 5,
                    maxValue: 60,
                    step: 5
                },
            },
            description: await trans('authentication.lockout.description'),
        })
            .endSection()
            // Session Management - Tenant Level
            .addSection('session-management', await trans('session.title'), await trans('session.description'))
            .addSetting({
            key: 'session-timeout',
            title: 'Session Timeout Duration',
            scope: 'T',
            isInherited: true,
            defaultValue: 5,
            widget: {
                type: 'number-editor',
                options: {
                    min: 5,
                    max: 60,
                    step: 1,
                },
            },
            description: 'Set the session timeout duration (in minutes) for the user.',
        })
            .endSection()
            .endGroup();
    }
}

export { AXMSettingProvider };
//# sourceMappingURL=acorex-modules-auth-settings.provider-P6ATx8ON.mjs.map
