import { union, undefined as _undefined, array, string, literal, number } from "io-ts";
import { LogLevelFromApi } from "../internal/types.js";
const settingsConfigForTask = (taskId) => settingsConfigForLogs(taskId);
const settingsConfigForTrial = (id) => settingsConfigForLogs(id);
const settingsConfigForLogs = (id) => ({
  settings: {
    agentId: {
      defaultValue: void 0,
      storageKey: "agentId",
      type: union([_undefined, array(string)])
    },
    allocationId: {
      defaultValue: void 0,
      storageKey: "allocationId",
      type: union([_undefined, array(string)])
    },
    containerId: {
      defaultValue: void 0,
      storageKey: "containerId",
      type: union([_undefined, array(string)])
    },
    level: {
      defaultValue: void 0,
      storageKey: "level",
      type: union([
        _undefined,
        array(
          union([
            literal(LogLevelFromApi.Critical),
            literal(LogLevelFromApi.Debug),
            literal(LogLevelFromApi.Error),
            literal(LogLevelFromApi.Info),
            literal(LogLevelFromApi.Trace),
            literal(LogLevelFromApi.Unspecified),
            literal(LogLevelFromApi.Warning)
          ])
        )
      ])
    },
    rankId: {
      defaultValue: void 0,
      storageKey: "rankId",
      type: union([_undefined, array(number)])
    },
    searchText: {
      defaultValue: void 0,
      storageKey: "searchText",
      type: union([_undefined, string])
    }
  },
  storagePath: `log-viewer-filters-${id}`
});
export {
  settingsConfigForTask,
  settingsConfigForTrial
};
