import{r as e,c as i,h as a,H as t,g as r}from"./p-23a36bb6.js";import{ElementIDUtils as s}from"@sankhyalabs/core";import{E as n}from"./p-98bb8b16.js";import{i as o}from"./p-a61fdd20.js";const d=class{constructor(a){e(this,a),this.ezSelectionChange=i(this,"ezSelectionChange",7),this.open=!0,this.selectedId=void 0,this.items=[],this.tooltipResolver=void 0,this.filterText=""}async disableItem(e){[].concat(e).forEach((e=>this._tree.disableItem(e)))}async openGuideNavidator(){this.open=!0}async enableItem(e){[].concat(e).forEach((e=>this._tree.enableItem(e)))}async updateItem(e){[].concat(e).forEach((e=>this._tree.updateItem(e)))}async getItem(e){return this._tree.getItem(e)}async getCurrentPath(){var e;return null===(e=this._tree)||void 0===e?void 0:e.getCurrentPath()}async selectGuide(e){null!=this._tree&&null!=e&&(this._tree.selectItem(e),this.getCurrentPath().then((e=>{null==e||e.forEach((e=>{this._tree.openItem(e.id)}))})))}async getParent(e){return this._tree.getParent(e)}async componentWillLoad(){this.i18n=await o()}async handleToggleSidebar(){this.open=!this.open}handleFilterTree(e){"Enter"===e.key&&this._tree.applyFilter(this.filterText)}onFilterChanged(e){this.filterText=e.detail,e.stopPropagation()}render(){return s.addIDInfoIfNotExists(this._element),a(t,null,a("ez-sidebar-button",{class:this.open?"hidden":"",onEzClick:this.handleToggleSidebar.bind(this),"aria-controls":"navigator","aria-expanded":this.open,"data-element-id":s.getInternalIDInfo("openButton")}),a("aside",{tabIndex:-1,id:"navigator",class:"ez-col ez-col--sd-12 ez-col--tb-3 ez-guide-navigator "+(this.open?"":"hidden"),"data-element-id":s.getInternalIDInfo("sidebar")},a("div",{role:"search",class:"ez-guide-navigator__actions"},a("ez-filter-input",{mode:"slim",value:this.filterText,onEzChange:e=>this.onFilterChanged(e),label:this.i18n("ez-guide-navigator.searchGuide"),"aria-placeholder":this.i18n("ez-guide-navigator.searchGuide"),onKeyUp:this.handleFilterTree.bind(this),"data-element-id":s.getInternalIDInfo("textinput")}),a("ez-button",{onClick:this.handleToggleSidebar.bind(this),class:"inverted",mode:"icon",size:"small",iconName:"show_menu",title:this.i18n("ez-guide-navigator.hideMenu"),"aria-label":this.i18n("ez-guide-navigator.hideMenu"),"aria-controls":"navigator","data-element-id":s.getInternalIDInfo("closeButton")})),a("ez-scroller",{direction:n.VERTICAL,activeShadow:!0},a("ez-tree",{ref:e=>this._tree=e,items:this.items,"data-element-id":s.getInternalIDInfo("tree"),tooltipResolver:this.tooltipResolver,onEzChange:e=>this.ezSelectionChange.emit(e.detail),selectedId:this.selectedId}))))}get _element(){return r(this)}};d.style=":host{--ez-guide-navigator--padding-left:var(--space--large);--ez-guide-navigator--padding-right:var(--space--small);--ez-guide-navigator--box-shadow:var(--shadow, 0px 0px 24px 0px #000);--ez-guide-navigator--background-color:var(--color--inverted);--ez-guide-navigator--border-radius:0px var(--border--radius-medium) var(--border--radius-medium) 0px;--ez-guide-navigator--actions-gap:var(--space--medium);--ez-guide-navigator--actions-margin:var(--space--large) 0 var(--space--medium);--ez-guide-navigator--actions-padding-right:calc(var(--space--medium, 12px) + var(--space--small, 6px))}.inverted{transform:rotate(180deg)}.ez-guide-navigator{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%;padding-left:var(--ez-guide-navigator--padding-left);padding-right:var(--ez-guide-navigator--padding-right);background-color:var(--ez-guide-navigator--background-color);-webkit-box-shadow:var(--ez-guide-navigator--box-shadow);box-shadow:var(--ez-guide-navigator--box-shadow);border-radius:var(--ez-guide-navigator--border-radius)}.ez-guide-navigator__actions{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;gap:var(--ez-guide-navigator--actions-gap);margin:var(--ez-guide-navigator--actions-margin);padding-right:var(--ez-guide-navigator--actions-padding-right)}.hidden{display:none}";export{d as ez_guide_navigator}