import{r as t,h as e,a as r,g as o}from"./p-c18ee3cd.js";import{c as i}from"./p-c608c6dc.js";const a=t=>{try{return!!JSON.parse(t)}catch(e){return"string"==typeof t||!!t}},n=class{constructor(e){t(this,e),this.condensed=!1,this.bold=!1,this.active=!1,this.current=null}nestingLevelChanged(t){1===t&&(this.bold=!0)}currentChanged(t){this.handleAriaCurrentInSlottedA(t),this.syncActiveToCurrent(t)}componentDidLoad(){this.handleAriaCurrentInSlottedA(this.current),this.current&&this.syncActiveToCurrent(this.current)}syncActiveToCurrent(t){this.active=a(t)}handleAriaCurrentInSlottedA(t){const e=this.el.querySelector("a");null!=this.srOnlyElement&&(e.removeChild(this.srOnlyElement),this.srOnlyElement=null),null!=e&&e.removeAttribute("aria-current"),a(t)&&null!=e&&(this.srOnlyElement=this.createScreenReaderOnlySpan(),e.appendChild(this.srOnlyElement),e.setAttribute("aria-current","page"))}createScreenReaderOnlySpan(){const t=(t=>{let e;try{e=JSON.parse(t)}catch(r){e=t}return"string"==typeof e&&e.length>0?` ${e}`:" Zurzeit aktiv"})(this.current),e=document.createElement("span");return Object.assign(e.style,{position:"absolute",left:"-10000px",overflow:"hidden"}),e.textContent=t,e}render(){return e(r,null,this.styles&&e("style",null,this.styles),e("li",{part:this.getBasePartMap(),class:this.getCssClassMap(),role:"listitem"},e("slot",null)))}getBasePartMap(){return this.getCssOrBasePartMap("basePart")}getCssClassMap(){return this.getCssOrBasePartMap("css")}getCssOrBasePartMap(t){const e="sidebar-nav-item",r="basePart"===t?"":`${e}--`;return i(e,this.bold&&`${r}bold`,this.condensed&&`${r}condensed`,this.active&&`${r}active`)}get el(){return o(this)}static get watchers(){return{nestingLevel:["nestingLevelChanged"],current:["currentChanged"]}}};n.style=":host{--border-bottom-color:var(--telekom-color-ui-faint);--border-left-color-third-nesting:var(--telekom-color-ui-strong);--color-active:var(--telekom-color-text-and-icon-primary-pressed);--color-hover:var(--telekom-color-text-and-icon-primary-hovered);--color-primary:var(--telekom-color-text-and-icon-primary-standard);--background-color-before-active:var(--color-primary);--font-weight-bold:var(--telekom-typography-font-weight-bold);--box-shadow-focus:inset 0 0 0 var(--telekom-line-weight-highlight)\n    var(--telekom-color-functional-focus)}.sidebar-nav-item{border-bottom-style:solid;border-bottom-width:1px;border-bottom-color:var(--border-bottom-color)}.sidebar-nav-item--active{position:relative;color:var(--color-primary)}.sidebar-nav-item--active::before{content:'';display:block;position:absolute;top:0;left:var(--left-current-border, 0);width:0;height:100%;background-color:var(--background-color-before-active);border-left:2px solid transparent}.sidebar-nav-item--condensed.sidebar-nav-item--active::before{left:-1px}:host([nesting-level='1']) .sidebar-nav-item,.sidebar-nav-item--bold{font-weight:var(--font-weight-bold)}:host([nesting-level='3']) .sidebar-nav-item{border-left-color:var(--border-left-color-third-nesting);border-left-style:solid;border-left-width:0.0625rem}::slotted(a){color:currentColor;display:block;padding-top:1rem;padding-right:1rem;padding-bottom:1rem;padding-left:var(--spacing-indent);border-radius:var(--telekom-radius-small);text-decoration:none;outline:none}:host([nesting-level='2']) ::slotted(a){padding-left:calc(var(--spacing-indent) + 0.75rem)}::slotted(a:hover){color:var(--color-hover)}::slotted(a:focus){box-shadow:var(--box-shadow-focus)}::slotted(a:active){color:var(--color-active)}.sidebar-nav-item--condensed{border-bottom-width:0}.sidebar-nav-item--condensed ::slotted(a){padding-top:0.5rem;padding-left:0.75rem;padding-right:0.5rem;padding-bottom:0.5rem}";export{n as scale_sidebar_nav_item}