import*as SDK from"../sdk/sdk.js";import*as UI from"../ui/ui.js";import{IssuesPane}from"./IssuesPane.js";let issueRevealerInstance;export class IssueRevealer{static instance(e={forceNew:null}){const{forceNew:s}=e;return issueRevealerInstance&&!s||(issueRevealerInstance=new IssueRevealer),issueRevealerInstance}async reveal(e){if(!(e instanceof SDK.Issue.Issue))throw new Error("Internal error: not a issue");await UI.ViewManager.ViewManager.instance().showView("issues-pane");const s=UI.ViewManager.ViewManager.instance().view("issues-pane");if(s){const a=await s.widget();if(!(a instanceof IssuesPane))throw new Error("Expected issues pane to be an instance of IssuesPane");a.revealByCode(e.code())}}}