import{proxyCustomElement,HTMLElement,h}from"@stencil/core/internal/client";import{i as isRtl}from"./page-align.js";const scMenuItemCss=":host{display:block}.menu-item{position:relative;display:flex;align-items:stretch;font-family:var(--sc-font-sans);font-size:var(--sc-font-size-medium);font-weight:var(--sc-font-weight-normal);line-height:var(--sc-menu-item-line-height, var(--sc-line-height-normal));letter-spacing:var(--sc-letter-spacing-normal);text-align:left;color:var(--sc-menu-item-color, var(--sc-color-gray-700));padding:var(--sc-spacing-xx-small) var(--sc-spacing-x-large);transition:var(--sc-input-transition, var(--sc-transition-medium)) fill, var(--sc-input-transition, var(--sc-transition-medium)) background-color;user-select:none;white-space:var(--sc-menu-item-white-space, nowrap);text-wrap:auto;cursor:pointer;text-decoration:none}.menu-item.menu-item--focused:not(.menu-item--disabled){outline:none;background-color:var(--sc-menu-item-background-focused, var(--sc-color-primary-500));color:var(--sc-color-white)}.menu-item.menu-item--disabled{outline:none;color:var(--sc-color-gray-400);cursor:not-allowed}.menu-item .menu-item__label{flex:1 1 auto}.menu-item .menu-item__prefix{flex:0 0 auto;display:flex;align-items:center}.menu-item .menu-item__prefix ::slotted(*){display:inline-flex;margin-right:var(--sc-spacing-small)}.menu-item .menu-item__suffix{flex:0 0 auto;display:flex;align-items:center}.menu-item .menu-item__suffix ::slotted(*){margin-left:var(--sc-spacing-x-small);text-align:right}.menu-item .menu-item__check{display:flex;position:absolute;left:0.5em;top:0.6em;visibility:hidden;align-items:center;font-size:inherit}.menu-item--checked .menu-item__check{visibility:visible}.menu-item--is-rtl.menu-item{text-align:right}.menu-item--is-rtl.menu-item .menu-item__check{left:auto;right:0.5em}",ScMenuItemStyle0=scMenuItemCss,ScMenuItem=proxyCustomElement(class extends HTMLElement{constructor(){super(),this.__registerHost(),this.__attachShadow(),this.hasFocus=!1,this.href=void 0,this.target=void 0,this.checked=!1,this.value="",this.disabled=!1}async setFocus(e){this.menuItem.focus(e)}async setBlur(){this.menuItem.blur()}handleBlur(){this.hasFocus=!1}handleFocus(){this.hasFocus=!0}render(){const e=this.href?"a":"div";return h(e,{key:"ccc1f509a1517a8aeb33853ab5f40d55a96b38c9",ref:e=>this.menuItem=e,part:"base",class:{"menu-item":!0,"menu-item--checked":this.checked,"menu-item--disabled":this.disabled,"menu-item--focused":this.hasFocus,"menu-item--is-rtl":isRtl()},href:this.href,role:"menuitem","aria-disabled":this.disabled?"true":"false","aria-checked":this.checked?"true":"false",tabindex:this.disabled?void 0:"0",onFocus:()=>this.handleFocus(),onBlur:()=>this.handleBlur(),onMouseEnter:()=>this.handleFocus(),onMouseLeave:()=>this.handleBlur(),onKeyDown:e=>{" "!==e.key&&"Spacebar"!==e.key&&"Enter"!==e.key||this.menuItem.click()},"aria-label":this.el.innerText,target:this.target},h("span",{key:"57f740c959fdea50187077a39486817dc4af0e54",part:"checked-icon",class:"menu-item__check"},h("svg",{key:"e3abd39de7892e21772f8b3c113584614bf1ae27",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-check",viewBox:"0 0 16 16"},h("path",{key:"d46736e1c28587990891d90fb8e9710921c6f7cd",d:"M10.97 4.97a.75.75 0 0 1 1.07 1.05l-3.99 4.99a.75.75 0 0 1-1.08.02L4.324 8.384a.75.75 0 1 1 1.06-1.06l2.094 2.093 3.473-4.425a.267.267 0 0 1 .02-.022z"}))),h("span",{key:"8ebe6b6c0100479353c99876c35b5232dc74a85c",part:"prefix",class:"menu-item__prefix"},h("slot",{key:"5b549ef452bf787a37dc0249b5f6cde66f022d6a",name:"prefix"})),h("span",{key:"29fb4ca1f70951c7652b11956ff6c1e10ca40972",part:"label",class:"menu-item__label"},h("slot",{key:"9926525242a2e7f2b8dc018e8e9767b48ae73a7e"})),h("span",{key:"6dc62aeb07cad0b5a3afc2cbf9610b8e3c278a8a",part:"suffix",class:"menu-item__suffix"},h("slot",{key:"dbcc390209a9d6c9f8af605f2b5a554105272b1d",name:"suffix"})))}get el(){return this}static get style(){return ScMenuItemStyle0}},[1,"sc-menu-item",{href:[1],target:[1],checked:[516],value:[513],disabled:[516],hasFocus:[32],setFocus:[64],setBlur:[64]}]);function defineCustomElement(){"undefined"!=typeof customElements&&["sc-menu-item"].forEach((e=>{"sc-menu-item"===e&&(customElements.get(e)||customElements.define(e,ScMenuItem))}))}export{ScMenuItem as S,defineCustomElement as d};