import*as Common from"../common/common.js";import*as i18n from"../i18n/i18n.js";import*as Root from"../root/root.js";import*as SDK from"../sdk/sdk.js";import*as UI from"../ui/ui.js";import*as Workspace from"../workspace/workspace.js";const UIStrings={workspace:"Workspace",showWorkspace:"Show Workspace",enableLocalOverrides:"Enable Local Overrides",interception:"interception",override:"override",network:"network",rewrite:"rewrite",request:"request",enableOverrideNetworkRequests:"Enable override network requests",disableOverrideNetworkRequests:"Disable override network requests"},str_=i18n.i18n.registerUIStrings("persistence/persistence-meta.ts",UIStrings),i18nLazyString=i18n.i18n.getLazilyComputedLocalizedString.bind(void 0,str_);let loadedPersistenceModule;async function loadPersistenceModule(){return loadedPersistenceModule||(await Root.Runtime.Runtime.instance().loadModulePromise("persistence"),loadedPersistenceModule=await import("./persistence.js")),loadedPersistenceModule}UI.ViewManager.registerViewExtension({location:"settings-view",id:"workspace",title:i18nLazyString(UIStrings.workspace),commandPrompt:i18nLazyString(UIStrings.showWorkspace),order:1,loadView:async()=>(await loadPersistenceModule()).WorkspaceSettingsTab.WorkspaceSettingsTab.instance()}),Common.Settings.registerSettingExtension({category:"PERSISTENCE",title:i18nLazyString(UIStrings.enableLocalOverrides),settingName:"persistenceNetworkOverridesEnabled",settingType:"boolean",defaultValue:!1,tags:[i18nLazyString(UIStrings.interception),i18nLazyString(UIStrings.override),i18nLazyString(UIStrings.network),i18nLazyString(UIStrings.rewrite),i18nLazyString(UIStrings.request)],options:[{value:!0,title:i18nLazyString(UIStrings.enableOverrideNetworkRequests)},{value:!1,title:i18nLazyString(UIStrings.disableOverrideNetworkRequests)}]}),UI.ContextMenu.registerProvider({contextTypes:()=>[Workspace.UISourceCode.UISourceCode,SDK.Resource.Resource,SDK.NetworkRequest.NetworkRequest],loadProvider:async()=>(await loadPersistenceModule()).PersistenceActions.ContextMenuProvider.instance(),experiment:void 0});