import*as i18n from"../i18n/i18n.js";import*as SDK from"../sdk/sdk.js";const UIStrings={noThrottling:"No throttling",noInternetConnectivity:"No internet connectivity",lowendMobile:"Low-end mobile",slowGXCpuSlowdown:"Slow 3G & 6x CPU slowdown",midtierMobile:"Mid-tier mobile",fastGXCpuSlowdown:"Fast 3G & 4x CPU slowdown",custom:"Custom",checkNetworkAndPerformancePanels:"Check Network and Performance panels"},str_=i18n.i18n.registerUIStrings("mobile_throttling/ThrottlingPresets.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);export var CPUThrottlingRates;!function(t){t[t.NoThrottling=1]="NoThrottling",t[t.MidTierMobile=4]="MidTierMobile",t[t.LowEndMobile=6]="LowEndMobile"}(CPUThrottlingRates||(CPUThrottlingRates={}));export class ThrottlingPresets{static getNoThrottlingConditions(){return{title:"function"===typeof SDK.NetworkManager.NoThrottlingConditions.title?SDK.NetworkManager.NoThrottlingConditions.title():SDK.NetworkManager.NoThrottlingConditions.title,description:i18nString(UIStrings.noThrottling),network:SDK.NetworkManager.NoThrottlingConditions,cpuThrottlingRate:CPUThrottlingRates.NoThrottling}}static getOfflineConditions(){return{title:"function"===typeof SDK.NetworkManager.OfflineConditions.title?SDK.NetworkManager.OfflineConditions.title():SDK.NetworkManager.OfflineConditions.title,description:i18nString(UIStrings.noInternetConnectivity),network:SDK.NetworkManager.OfflineConditions,cpuThrottlingRate:CPUThrottlingRates.NoThrottling}}static getLowEndMobileConditions(){return{title:i18nString(UIStrings.lowendMobile),description:i18nString(UIStrings.slowGXCpuSlowdown),network:SDK.NetworkManager.Slow3GConditions,cpuThrottlingRate:CPUThrottlingRates.LowEndMobile}}static getMidTierMobileConditions(){return{title:i18nString(UIStrings.midtierMobile),description:i18nString(UIStrings.fastGXCpuSlowdown),network:SDK.NetworkManager.Fast3GConditions,cpuThrottlingRate:CPUThrottlingRates.MidTierMobile}}static getCustomConditions(){return{title:i18nString(UIStrings.custom),description:i18nString(UIStrings.checkNetworkAndPerformancePanels)}}static getMobilePresets(){return[ThrottlingPresets.getMidTierMobileConditions(),ThrottlingPresets.getLowEndMobileConditions(),ThrottlingPresets.getCustomConditions()]}static getAdvancedMobilePresets(){return[ThrottlingPresets.getOfflineConditions()]}}ThrottlingPresets.networkPresets=[SDK.NetworkManager.Fast3GConditions,SDK.NetworkManager.Slow3GConditions,SDK.NetworkManager.OfflineConditions],ThrottlingPresets.cpuThrottlingPresets=[CPUThrottlingRates.NoThrottling,CPUThrottlingRates.MidTierMobile,CPUThrottlingRates.LowEndMobile];