import*as i18n from"../i18n/i18n.js";import*as Root from"../root/root.js";const UIStrings={elements:"Elements",appearance:"Appearance",sources:"Sources",network:"Network",performance:"Performance",console:"Console",persistence:"Persistence",debugger:"Debugger",global:"Global",rendering:"Rendering",grid:"Grid",mobile:"Mobile",emulation:"Emulation",memory:"Memory",extension:"Extension",adorner:"Adorner"},str_=i18n.i18n.registerUIStrings("common/SettingRegistration.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);let registeredSettings=[];const settingNameSet=new Set;export function registerSettingExtension(e){const t=e.settingName;if(settingNameSet.has(t))throw new Error(`Duplicate setting name '${t}'`);settingNameSet.add(t),registeredSettings.push(e)}export function getRegisteredSettings(){return registeredSettings.filter((e=>Root.Runtime.Runtime.isDescriptorEnabled({experiment:e.experiment,condition:e.condition})))}export function registerSettingExtengionsForTest(e,t=!1){if(0===registeredSettings.length||t){registeredSettings=e,settingNameSet.clear();for(const t of e){const e=t.settingName;if(settingNameSet.has(e))throw new Error(`Duplicate setting name '${e}'`);settingNameSet.add(e)}}}export function getLocalizedSettingsCategory(e){switch(e){case"ELEMENTS":return i18nString(UIStrings.elements);case"APPEARANCE":return i18nString(UIStrings.appearance);case"SOURCES":return i18nString(UIStrings.sources);case"NETWORK":return i18nString(UIStrings.network);case"PERFORMANCE":return i18nString(UIStrings.performance);case"CONSOLE":return i18nString(UIStrings.console);case"PERSISTENCE":return i18nString(UIStrings.persistence);case"DEBUGGER":return i18nString(UIStrings.debugger);case"GLOBAL":return i18nString(UIStrings.global);case"RENDERING":return i18nString(UIStrings.rendering);case"GRID":return i18nString(UIStrings.grid);case"MOBILE":return i18nString(UIStrings.mobile);case"EMULATION":return i18nString(UIStrings.console);case"MEMORY":return i18nString(UIStrings.memory);case"EXTENSIONS":return i18nString(UIStrings.extension);case"ADORNER":return i18nString(UIStrings.adorner);case"":return""}}