import{Settings as e}from"../common/common.js";import{i18n as o}from"../i18n/i18n.js";import{Runtime as t}from"../root/root.js";import{ViewManager as i,ActionRegistration as r}from"../ui/ui.js";let a;const n={memory:"Memory",liveHeapProfile:"Live Heap Profile",startRecordingHeapAllocations:"Start recording heap allocations",stopRecordingHeapAllocations:"Stop recording heap allocations",startRecordingHeapAllocationsAndReload:"Start recording heap allocations and reload the page",startStopRecording:"Start/stop recording",showNativeFunctions:"Show native functions in JS Profile"},l=o.registerUIStrings("profiler/profiler-meta.ts",n),c=o.getLazilyComputedLocalizedString.bind(void 0,l);async function s(){return a||(await t.Runtime.instance().loadModulePromise("profiler"),a=await import("./profiler.js")),a}function g(e){return void 0===a?[]:e(a)}i.registerViewExtension({location:"panel",id:"heap_profiler",commandPrompt:"Show Memory",title:c(n.memory),order:60,loadView:async()=>(await s()).HeapProfilerPanel.HeapProfilerPanel.instance()}),i.registerViewExtension({location:"drawer-view",id:"live_heap_profile",commandPrompt:"Show Live Heap Profile",title:c(n.liveHeapProfile),persistence:"closeable",order:100,loadView:async()=>(await s()).LiveHeapProfileView.LiveHeapProfileView.instance(),experiment:t.ExperimentName.LIVE_HEAP_PROFILE}),r.registerActionExtension({actionId:"live-heap-profile.toggle-recording",iconClass:"largeicon-start-recording",toggleable:!0,toggledIconClass:"largeicon-stop-recording",toggleWithRedColor:!0,loadActionDelegate:async()=>(await s()).LiveHeapProfileView.ActionDelegate.instance(),category:r.ActionCategory.MEMORY,experiment:t.ExperimentName.LIVE_HEAP_PROFILE,options:[{value:!0,title:c(n.startRecordingHeapAllocations)},{value:!1,title:c(n.stopRecordingHeapAllocations)}]}),r.registerActionExtension({actionId:"live-heap-profile.start-with-reload",iconClass:"largeicon-refresh",loadActionDelegate:async()=>(await s()).LiveHeapProfileView.ActionDelegate.instance(),category:r.ActionCategory.MEMORY,experiment:t.ExperimentName.LIVE_HEAP_PROFILE,title:c(n.startRecordingHeapAllocationsAndReload)}),r.registerActionExtension({actionId:"profiler.heap-toggle-recording",category:r.ActionCategory.MEMORY,iconClass:"largeicon-start-recording",title:c(n.startStopRecording),toggleable:!0,toggledIconClass:"largeicon-stop-recording",toggleWithRedColor:!0,contextTypes:()=>g((e=>[e.HeapProfilerPanel.HeapProfilerPanel])),loadActionDelegate:async()=>(await s()).HeapProfilerPanel.HeapProfilerPanel.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),r.registerActionExtension({actionId:"profiler.js-toggle-recording",category:r.ActionCategory.JAVASCRIPT_PROFILER,title:c(n.startStopRecording),iconClass:"largeicon-start-recording",toggleable:!0,toggledIconClass:"largeicon-stop-recording",toggleWithRedColor:!0,contextTypes:()=>g((e=>[e.ProfilesPanel.JSProfilerPanel])),loadActionDelegate:async()=>(await s()).ProfilesPanel.JSProfilerPanel.instance(),bindings:[{platform:"windows,linux",shortcut:"Ctrl+E"},{platform:"mac",shortcut:"Meta+E"}]}),e.registerSettingExtension({category:e.SettingCategoryObject.PERFORMANCE,title:c(n.showNativeFunctions),settingName:"showNativeFunctionsInJSProfile",settingType:e.SettingTypeObject.BOOLEAN,defaultValue:!0});export{n as UIStrings};
