import*as Common from"../common/common.js";import*as i18n from"../i18n/i18n.js";import*as Root from"../root/root.js";import*as UI from"../ui/ui.js";const UIStrings={throttling:"Throttling",showThrottling:"Show Throttling",goOffline:"Go offline",device:"device",throttlingTag:"throttling",enableSlowGThrottling:"Enable slow `3G` throttling",enableFastGThrottling:"Enable fast `3G` throttling",goOnline:"Go online"},str_=i18n.i18n.registerUIStrings("mobile_throttling/mobile_throttling-meta.ts",UIStrings),i18nLazyString=i18n.i18n.getLazilyComputedLocalizedString.bind(void 0,str_);let loadedMobileThrottlingModule;async function loadMobileThrottlingModule(){return loadedMobileThrottlingModule||(await Root.Runtime.Runtime.instance().loadModulePromise("mobile_throttling"),loadedMobileThrottlingModule=await import("./mobile_throttling.js")),loadedMobileThrottlingModule}UI.ViewManager.registerViewExtension({location:"settings-view",id:"throttling-conditions",title:i18nLazyString(UIStrings.throttling),commandPrompt:i18nLazyString(UIStrings.showThrottling),order:35,loadView:async()=>(await loadMobileThrottlingModule()).ThrottlingSettingsTab.ThrottlingSettingsTab.instance(),settings:["customNetworkConditions"]}),UI.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-offline",category:UI.ActionRegistration.ActionCategory.NETWORK,title:i18nLazyString(UIStrings.goOffline),loadActionDelegate:async()=>(await loadMobileThrottlingModule()).ThrottlingManager.ActionDelegate.instance(),tags:[i18nLazyString(UIStrings.device),i18nLazyString(UIStrings.throttlingTag)]}),UI.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-low-end-mobile",category:UI.ActionRegistration.ActionCategory.NETWORK,title:i18nLazyString(UIStrings.enableSlowGThrottling),loadActionDelegate:async()=>(await loadMobileThrottlingModule()).ThrottlingManager.ActionDelegate.instance(),tags:[i18nLazyString(UIStrings.device),i18nLazyString(UIStrings.throttlingTag)]}),UI.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-mid-tier-mobile",category:UI.ActionRegistration.ActionCategory.NETWORK,title:i18nLazyString(UIStrings.enableFastGThrottling),loadActionDelegate:async()=>(await loadMobileThrottlingModule()).ThrottlingManager.ActionDelegate.instance(),tags:[i18nLazyString(UIStrings.device),i18nLazyString(UIStrings.throttlingTag)]}),UI.ActionRegistration.registerActionExtension({actionId:"network-conditions.network-online",category:UI.ActionRegistration.ActionCategory.NETWORK,title:i18nLazyString(UIStrings.goOnline),loadActionDelegate:async()=>(await loadMobileThrottlingModule()).ThrottlingManager.ActionDelegate.instance(),tags:[i18nLazyString(UIStrings.device),i18nLazyString(UIStrings.throttlingTag)]}),Common.Settings.registerSettingExtension({settingName:"customNetworkConditions",settingType:"array",defaultValue:[]});