import*as Common from"../../../core/common/common.js";import*as i18n from"../../../core/i18n/i18n.js";import*as ComponentHelpers from"../../../ui/components/helpers/helpers.js";import*as IconButton from"../../../ui/components/icon_button/icon_button.js";import*as UI from"../../../ui/legacy/legacy.js";import*as LitHtml from"../../../ui/lit-html/lit-html.js";import hideIssuesMenuStyles from"./hideIssuesMenu.css.js";const UIStrings={tooltipTitle:"Hide issues"},str_=i18n.i18n.registerUIStrings("panels/issues/components/HideIssuesMenu.ts",UIStrings),i18nString=i18n.i18n.getLocalizedString.bind(void 0,str_);export class HideIssuesMenu extends HTMLElement{static litTagName=LitHtml.literal`devtools-hide-issues-menu`;#e=this.attachShadow({mode:"open"});#t=Common.UIString.LocalizedEmptyString;#n=()=>{};set data(e){this.#t=e.menuItemLabel,this.#n=e.menuItemAction,this.#s()}connectedCallback(){this.#e.adoptedStyleSheets=[hideIssuesMenuStyles]}onMenuOpen(e){e.stopPropagation();const t=new UI.ContextMenu.ContextMenu(e,{useSoftMenu:!0,onSoftMenuClosed:()=>{this.classList.toggle("has-context-menu-opened",!1)}});t.headerSection().appendItem(this.#t,(()=>this.#n())),t.show(),this.classList.toggle("has-context-menu-opened",!0)}#s(){LitHtml.render(LitHtml.html`
      <button class="hide-issues-menu-btn" @click=${this.onMenuOpen.bind(this)} title=${i18nString(UIStrings.tooltipTitle)}>
        <${IconButton.Icon.Icon.litTagName}
          .data=${{color:"var(--icon-color)",iconName:"dots-vertical",height:"20px",width:"20px"}}
        ></${IconButton.Icon.Icon.litTagName}>
      </button>
    `,this.#e,{host:this})}}ComponentHelpers.CustomElements.defineComponent("devtools-hide-issues-menu",HideIssuesMenu);