import { gettext } from '@c8y/ngx-components/gettext';
import { DynamicComponentErrorStrategy, DynamicDatapointsResolver, hookWidget } from '@c8y/ngx-components';
import { defaultWidgetIds } from '@c8y/ngx-components/widgets/definitions';
import { importConfigWithTargets, exportConfigWithTargets } from '@c8y/ngx-components/widgets/import-export-config';
import { hookWidgetConfig } from '@c8y/ngx-components/context-dashboard';

const LINEAR_GAUGE_OPTIONS = {
    showRedRange: true,
    showYellowRange: true,
    showRange: true,
    showTarget: true
};

const linearGaugeWidgetDefinition = {
    id: defaultWidgetIds.LINEAR_GAUGE,
    label: gettext('Linear Gauge'),
    description: gettext('A linear gauge graph displaying current values for selected measurements'),
    loadComponent: () => import('@c8y/ngx-components/widgets/implementations/linear-gauge').then(m => m.LinearGaugeWidgetViewComponent),
    loadConfigComponent: () => import('@c8y/ngx-components/widgets/implementations/linear-gauge').then(m => m.LinearGaugeWidgetConfigComponent),
    previewImage: 'c8y-style-assets/linear-gauge-widget-pr.png',
    resolve: {
        datapoints: DynamicDatapointsResolver
    },
    errorStrategy: DynamicComponentErrorStrategy.OVERLAY_ERROR,
    data: {
        schema: () => import('c8y-schema-loader?interfaceName=LinearGaugeWidgetConfig&type=widget-config!@c8y/ngx-components/widgets/implementations/linear-gauge'),
        export: exportConfigWithTargets,
        import: importConfigWithTargets,
        settings: {
            noNewWidgets: false,
            widgetDefaults: {
                _width: 6,
                _height: 4
            },
            ng1: {
                options: {
                    noDeviceTarget: true,
                    groupsSelectable: false
                }
            }
        }
    }
};
const linearGaugeWidgetProviders = [
    hookWidget(linearGaugeWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.LINEAR_GAUGE,
        label: gettext('Data point selection'),
        loadComponent: () => import('@c8y/ngx-components/datapoint-selector').then(m => m.WidgetDatapointsSelectorComponent),
        initialState: {
            minActiveCount: 1,
            maxActiveCount: 1,
            defaultFormOptions: LINEAR_GAUGE_OPTIONS
        },
        expanded: true,
        priority: 80
    })
];

/**
 * Generated bundle index. Do not edit.
 */

export { linearGaugeWidgetDefinition, linearGaugeWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-linear-gauge.mjs.map
