import*as i18n from"../i18n/i18n.js";const UIStrings={elementsPanel:"Elements panel",stylesSidebar:"styles sidebar",changesDrawer:"Changes drawer",issuesView:"Issues view",networkPanel:"Network panel",applicationPanel:"Application panel",sourcesPanel:"Sources panel"},str_=i18n.i18n.registerUIStrings("common/Revealer.js",UIStrings),i18nLazyString=i18n.i18n.getLazilyComputedLocalizedString.bind(void 0,str_);export class Revealer{reveal(e,r){throw new Error("not implemented")}}export let reveal=async function(e,r){if(!e)return Promise.reject(new Error("Can't reveal "+e));return function(n){const t=[];for(let i=0;i<n.length;++i)t.push(n[i].reveal(e,r));return Promise.race(t)}(await Promise.all(getApplicableRegisteredRevealers(e).map((e=>e.loadRevealer()))))};export function setRevealForTest(e){reveal=e}export const revealDestination=function(e){const r=e?getApplicableRegisteredRevealers(e)[0]:registeredRevealers[0];return r&&r.destination?.()||null};const registeredRevealers=[];export function registerRevealer(e){registeredRevealers.push(e)}function getApplicableRegisteredRevealers(e){return registeredRevealers.filter((function(r){if(!r.contextTypes)return!0;for(const n of r.contextTypes())if(e instanceof n)return!0;return!1}))}export let RevealerRegistration;export const RevealerDestination={ELEMENTS_PANEL:i18nLazyString(UIStrings.elementsPanel),STYLES_SIDEBAR:i18nLazyString(UIStrings.stylesSidebar),CHANGES_DRAWER:i18nLazyString(UIStrings.changesDrawer),ISSUES_VIEW:i18nLazyString(UIStrings.issuesView),NETWORK_PANEL:i18nLazyString(UIStrings.networkPanel),APPLICATION_PANEL:i18nLazyString(UIStrings.applicationPanel),SOURCES_PANEL:i18nLazyString(UIStrings.sourcesPanel)};