import { AXTranslationService } from '@acorex/core/translation';
import { AXPPlatformScope } from '@acorex/platform/core';
import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
import * as i0 from '@angular/core';
import { Injectable } from '@angular/core';
import { AXPCommonSettings } from './acorex-platform-common.mjs';

class AXPCommonSettingProvider {
    constructor(injector) {
        this.injector = injector;
        this.translateService = this.injector.get(AXTranslationService);
    }
    async provide(context) {
        const trans = async (key) => await this.translateService.translateAsync(`@general:settings.${key}`);
        // Define the 'General Settings' group
        context
            .group('general')
            ?.addSection('notifications', await trans('general.notifications.title'), await trans('general.notifications.description'))
            // Add the 'Enable Operation Toasts' setting
            .addSetting({
            key: AXPCommonSettings.EnableOperationToasts,
            title: await trans('general.notifications.enable-operation-toasts.title'),
            scope: AXPPlatformScope.User,
            isInherited: true,
            defaultValue: true,
            widget: {
                type: AXPWidgetsCatalog.toggle,
                options: {
                    label: null,
                },
            },
            description: await trans('general.notifications.enable-operation-toasts.description'),
        })
            // End the 'Notifications' section
            .endSection()
            .addSection('entity', await trans('general.entity.title'), await trans('general.entity.description'))
            // Add the 'Enable Operation Toasts' setting
            .addSetting({
            key: AXPCommonSettings.EntityFilterApplyMode,
            title: await trans('general.entity.filter-apply-mode.title'),
            scope: AXPPlatformScope.User,
            isInherited: true,
            defaultValue: 'auto',
            widget: {
                type: AXPWidgetsCatalog.select,
                options: {
                    label: null,
                    valueField: 'value',
                    textField: 'text',
                    dataSource: [
                        { value: 'auto', text: await trans('general.entity.filter-apply-mode.options.auto') },
                        { value: 'manual', text: await trans('general.entity.filter-apply-mode.options.manual') },
                    ],
                },
            },
            description: await trans('general.entity.filter-apply-mode.description'),
        })
            // End the 'Entity Settings' section
            .endSection()
            // End the 'General Settings' group
            .endGroup();
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPCommonSettingProvider, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
    static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPCommonSettingProvider }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPCommonSettingProvider, decorators: [{
            type: Injectable
        }], ctorParameters: () => [{ type: i0.Injector }] });

export { AXPCommonSettingProvider };
//# sourceMappingURL=acorex-platform-common-common-settings.provider-BwBLG0Hl.mjs.map
