// Log level mapping from JS-style to C#-style
const LOG_LEVEL_MAP = {
    'trace': 'Verbose',
    'debug': 'Debug',
    'info': 'Information',
    'warn': 'Warning',
    'error': 'Error',
    'fatal': 'Fatal'
};
// Internal Configuration class (not exported)
export class Configuration {
    params;
    constructor(config) {
        if (!config) {
            throw new Error("Configuration must be provided.");
        }
        if (!config.appName || config.appName.trim() === "") {
            throw new Error("appName must be set to a valid application name.");
        }
        this.params = {
            'AppName': config.appName
        };
        if (config.appDataDir)
            this.params['AppDataDir'] = config.appDataDir;
        if (config.modelCacheDir)
            this.params['ModelCacheDir'] = config.modelCacheDir;
        if (config.logsDir)
            this.params['LogsDir'] = config.logsDir;
        if (config.logLevel)
            this.params['LogLevel'] = LOG_LEVEL_MAP[config.logLevel] || config.logLevel;
        if (config.webServiceUrls)
            this.params['WebServiceUrls'] = config.webServiceUrls;
        if (config.serviceEndpoint)
            this.params['WebServiceExternalUrl'] = config.serviceEndpoint;
        if (config.libraryPath)
            this.params['FoundryLocalCorePath'] = config.libraryPath;
        // Flatten additional settings into params
        if (config.additionalSettings) {
            for (const key in config.additionalSettings) {
                this.params[key] = config.additionalSettings[key];
            }
        }
    }
}
