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 SILO_OPTIONS = {
    showRedRange: true,
    showYellowRange: true,
    showRange: true,
    showTarget: true
};

const siloWidgetDefinition = {
    id: defaultWidgetIds.SILO,
    label: gettext('Silo'),
    description: gettext('A silo 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/silo-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: 5,
                _height: 6
            },
            ng1: {
                options: {
                    noDeviceTarget: true,
                    groupsSelectable: false
                }
            }
        }
    }
};
const siloWidgetProviders = [
    hookWidget(siloWidgetDefinition),
    hookWidgetConfig({
        widgetId: defaultWidgetIds.SILO,
        label: gettext('Data point selection'),
        loadComponent: () => import('@c8y/ngx-components/datapoint-selector').then(m => m.WidgetDatapointsSelectorComponent),
        initialState: {
            minActiveCount: 1,
            maxActiveCount: 1,
            defaultFormOptions: SILO_OPTIONS
        },
        expanded: true,
        priority: 80
    })
];

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

export { siloWidgetDefinition, siloWidgetProviders };
//# sourceMappingURL=c8y-ngx-components-widgets-definitions-silo.mjs.map
