import{r as u,h as a,n as f,c as h,a3 as m,H as _,j as v,C as g,w,q as p}from"./index-BeCeuELg.js";import{t as c}from"./i18n-43b7aa72-DSS4ELtF.js";import{r as b,a as k}from"./unique-nav-labels-62f5fdbc-C0vTOAA_.js";import{w as y}from"./validation-2296a919-Bw2uUP9h.js";import{v as x}from"./hide-label-a27a203c-Dfejlhn8.js";import{v as C}from"./label-3757689e-D7ErDa5R.js";const L=(e,n)=>{p(e,"_collapsible",n)},z=(e,n)=>{p(e,"_hasCompactButton",n)},B=(e,n)=>{p(e,"_hasIconsWhenExpanded",n)},E=`/*
 * This file contains all rules for accessibility.
 */
@layer kol-a11y {
  :host {
    /*
     * Minimum size of interactive elements.
     */
    --a11y-min-size: calc(44rem / var(--kolibri-root-font-size, 16));
    color: black;
    /*
     * No element should be used without a background and font color whose contrast ratio has
     * not been checked. By initially setting the background color to white and the font color
     * to black, the contrast ratio is ensured and explicit adjustment is forced.
     */
    background-color: white;
    /*
     * Verdana is an accessible font that can be used without requiring additional loading time.
     */
    font-family: Verdana;
    /*
     * Letter spacing is required for all texts.
     */
    letter-spacing: inherit;
    /*
     * Word spacing is required for all texts.
     */
    word-spacing: inherit;
  }
  * {
    /*
     * This rule enables the word dividing for all texts. That is important for high zoom levels.
     */
    hyphens: auto;
    /*
     * This rule enables the word dividing for all texts. That is important for high zoom levels.
     */
    word-break: break-word;
  }
  /*
   * All interactive elements should have a minimum size of rem(44).
   */
  /* input:not([type='checkbox'], [type='radio'], [type='range']), */
  /* option, */
  /* select, */
  /* textarea, */
  button,
  .kol-input .input {
    min-width: var(--a11y-min-size);
    min-height: var(--a11y-min-size);
  }
  /*
   * Some interactive elements should not inherit the font-family and font-size.
   */
  a,
  button,
  h1,
  h2,
  h3,
  h4,
  h5,
  h6,
  input,
  option,
  select,
  textarea {
    /*
     * All elements should inherit the font family from his parent element.
     */
    font-family: inherit;
    /*
     * All elements should inherit the font size from his parent element.
     */
    font-size: inherit;
    /*
     * Letter spacing is required for all texts.
     */
    letter-spacing: inherit;
    /*
     * Word spacing is required for all texts.
     */
    word-spacing: inherit;
  }
  /**
  * Sometimes we need the semantic element for accessibility reasons,
  * but we don't want to show it.
  *
  * - https://www.a11yproject.com/posts/how-to-hide-content/
  */
  .visually-hidden {
    position: fixed;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    white-space: nowrap;
    clip-path: inset(50%);
  }
}
@layer kol-global {
  /*
   * Dieses CSS stellt sicher, dass der Standard-Style
   * von A und Button resettet werden.
   */
  :is(a, button) {
    background-color: transparent;
    width: 100%; /* 100% needed for custom width from outside */
    margin: 0;
    padding: 0;
    border: none;
  }
  /*
   * Ensure elements with hidden attribute to be actually not visible
   * @see https://meowni.ca/hidden.is.a.lie.html
   */
  [hidden] {
    display: none !important;
  }
}
@layer kol-global {
  :host {
    /*
     * The max-width is needed to prevent the table from overflowing the
     * parent node, if the table is wider than the parent node.
     */
    max-width: 100%;
    font-size: calc(16rem / var(--kolibri-root-font-size, 16));
  }
  * {
    /*
     * We prefer to box-sizing: border-box for all elements.
     */
    box-sizing: border-box;
  }
  /* KolSpan is a layout component with icons in all directions and a label text in the middle. */
  .kol-span-wc {
    display: grid;
    place-items: center;
  }
  /* The sub span in KolSpan is the horizontal span with icon left and right and the label text in the middle. */
  .kol-span-wc > span {
    display: flex;
    place-items: center;
  }
  a,
  button {
    cursor: pointer;
  }
  /* This is the text label. */
  .hide-label > .kol-span-wc > span > span {
    display: none;
  }
  /* Reset browser agent style. */
  button:disabled {
    color: unset;
  }
  .disabled label,
  .disabled:focus-within label,
  [aria-disabled=true],
  [aria-disabled=true]:focus,
  [disabled],
  [disabled]:focus {
    opacity: 0.5;
    outline: none;
    cursor: not-allowed;
  }
  [aria-disabled=true]:focus .kol-span-wc,
  [disabled]:focus .kol-span-wc {
    outline: none !important;
  }
  .badge-text-hint {
    color: black;
    background-color: lightgray;
  }
}
@layer kol-component {
  .kol-tooltip-wc {
    display: contents;
  }
  .kol-tooltip-wc .tooltip-floating {
    opacity: 0;
    display: none;
    position: fixed;
    /* Avoid layout interference - see https://floating-ui.com/docs/computePosition */
    top: 0;
    left: 0;
    /* Can be used to specify the tooltip-width from the outside. Unset by default. */
    width: var(--kol-tooltip-width, unset);
    max-width: 90vw;
    max-height: 90vh;
    animation-direction: normal;
    /* Can be used to specify the animation duration from the outside. 250ms by default. */
    animation-duration: var(--kolibri-tooltip-animation-duration, 250ms);
    animation-fill-mode: forwards;
    animation-iteration-count: 1;
    animation-timing-function: ease-in;
  }
  .kol-tooltip-wc .tooltip-floating.hide {
    animation-name: hideTooltip;
  }
  .kol-tooltip-wc .tooltip-floating.show {
    animation-name: showTooltip;
  }
  /* Shared between content and arrow */
  .kol-tooltip-wc .tooltip-area {
    color: #000;
    background-color: #fff;
  }
  .kol-tooltip-wc .tooltip-arrow {
    transform: rotate(45deg);
    position: absolute;
    z-index: 999;
    width: calc(10rem / var(--kolibri-root-font-size, 16));
    height: calc(10rem / var(--kolibri-root-font-size, 16));
  }
  .kol-tooltip-wc .tooltip-content {
    position: relative;
    z-index: 1000;
  }
  @keyframes hideTooltip {
    0% {
      opacity: 1;
    }
    100% {
      opacity: 0;
      display: none;
    }
  }
  @keyframes showTooltip {
    0% {
      opacity: 0;
    }
    100% {
      opacity: 1;
    }
  }
}
@layer kol-component {
  :host > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    place-items: center;
  }
  .list {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .list.vertical {
    flex-direction: column;
  }
  .list.horizontal {
    flex-wrap: wrap;
  }
  .entry {
    display: flex;
  }
  .entry-item {
    flex-grow: 1;
  }
  .entry .kol-span-wc {
    place-items: start;
  }
  .entry .button {
    text-align: left;
  }
}`,T=E,W=e=>typeof e._href=="string",H=e=>{var n;return e._href===void 0&&typeof((n=e._on)===null||n===void 0?void 0:n.onClick)=="function"},O=class{constructor(e){u(this,e),this.handleToggleExpansionClick=n=>{n&&(this.state._expandedChildren.includes(n)?this.collapseChildren(n):this.expandChildren(n))},this.linkList=n=>a("ul",{class:`list ${n.deep===0&&n.orientation==="horizontal"?" horizontal":" vertical"}`,"data-deep":n.deep},n.links.map((t,i)=>this.li(n.collapsible,n.hideLabel,n.deep,i,t,n.orientation))),this._collapsible=!0,this._hasCompactButton=!1,this._hasIconsWhenExpanded=!1,this._hideLabel=!1,this._label=void 0,this._links=void 0,this._orientation="vertical",this.state={_collapsible:!0,_hasCompactButton:!1,_hasIconsWhenExpanded:!1,_hideLabel:!1,_label:"",_links:[],_orientation:"vertical",_expandedChildren:[]}}expandChildren(e){this.state=Object.assign(Object.assign({},this.state),{_expandedChildren:[...this.state._expandedChildren,e]})}collapseChildren(e){this.state=Object.assign(Object.assign({},this.state),{_expandedChildren:this.state._expandedChildren.filter(n=>n!==e)})}entry(e,n,t,i,o){const l=this.state._hasIconsWhenExpanded||this.state._hideLabel?i._icons||(this.state._hideLabel?"codicon codicon-symbol-method":void 0):void 0;return a("div",{class:{entry:!0,"hide-label":n}},W(i)?a(f,Object.assign({class:"entry-item"},i,{_hideLabel:n,_icons:l})):a(h,{class:"entry-item",_label:i._label,_hideLabel:n,_icons:l,_on:{onClick:(d,s)=>{H(i)&&typeof i._on.onClick=="function"?i._on.onClick(d,s):this.handleToggleExpansionClick(i._children)}}}),t?this.expandButton(e,i,o):"")}expandButton(e,n,t){return a(h,{class:"expand-button",_ariaExpanded:t,_disabled:!e,_icons:"codicon codicon-"+(t?"remove":"add"),_hideLabel:!0,_label:`${t?c("kol-nav-label-close",{placeholders:{label:n._label}}):c("kol-nav-label-open",{placeholders:{label:n._label}})}`,_on:{onClick:()=>this.handleToggleExpansionClick(n._children)}})}li(e,n,t,i,o,l){const d=!!o._active,s=Array.isArray(o._children)&&o._children.length>0,r=!!(o._children&&this.state._expandedChildren.includes(o._children));return a("li",{class:{active:d,expanded:r,"has-children":s},key:i},this.entry(e,n,s,o,r),r&&a(this.linkList,{collapsible:e,hideLabel:n,deep:t+1,links:o._children||[],orientation:l}))}initializeExpandedChildren(){this.state=Object.assign(Object.assign({},this.state),{_expandedChildren:[]});const e=n=>{if(n._active)return n._children&&this.expandChildren(n._children),!0;if(n._children){for(const t of n._children)if(e(t))return this.expandChildren(n._children),!0}return!1};this.state._links.forEach(e)}render(){let e=this.state._hasCompactButton;this.state._orientation==="horizontal"&&this.state._hasCompactButton===!0&&(e=!1,m("[KolNav] Wenn eine horizontale Navigation verwendet wird, kann die Option _hasCompactButton nicht aktiviert werden."));const n=this.state._collapsible===!0,t=this.state._hideLabel===!0,i=this.state._orientation;return a(_,{key:"46a30225fb3a5df0ca563486032edeaee0e4f025",class:"kol-nav"},a("div",{key:"70d2ee051329c9d1d204083045547d5cc00ff54c",class:{nav:!0,[i]:!0,"is-compact":this.state._hideLabel}},a("nav",{key:"33d0f7a2c6dc26cd5bd717ce254d94020536f36f","aria-label":this.state._label,id:"nav"},a(this.linkList,{key:"91013d2bf92dfc37f9791e07d7e3556829ee5ab8",collapsible:n,hideLabel:t,deep:0,links:this.state._links,orientation:i})),e&&a("div",{key:"a36bfc2c02e801a94f41935bd5075f2523de1535",class:"compact"},a(h,{key:"434b0b683cf7acbb8e36048616b6bd196dc3a364",class:"toggle-button",_ariaControls:"nav",_ariaExpanded:!t,_icons:t?"codicon codicon-chevron-right":"codicon codicon-chevron-left",_hideLabel:!0,_label:c(t?"kol-nav-maximize":"kol-nav-minimize"),_on:{onClick:()=>{this.state=Object.assign(Object.assign({},this.state),{_hideLabel:this.state._hideLabel===!1})}},_tooltipAlign:"right",_variant:"ghost"}))))}validateCollapsible(e){L(this,e)}validateHasCompactButton(e){z(this,e)}validateHasIconsWhenExpanded(e){B(this,e)}validateHideLabel(e){x(this,e)}validateLabel(e,n,t=!1){t||b(this.state._label),C(this,e,{required:!0}),v(e),k(this.state._label)}validateLinks(e){y("KolNav",this,e),g("[KolNav] The navigation structure is not yet validated recursively."),this.initializeExpandedChildren()}validateOrientation(e){w(this,"_orientation",n=>n==="horizontal"||n==="vertical",new Set(["Orientation {horizontal, vertical}"]),e,{defaultValue:"vertical"})}componentWillLoad(){this.validateCollapsible(this._collapsible),this.validateHideLabel(this._hideLabel),this.validateHasCompactButton(this._hasCompactButton),this.validateHasIconsWhenExpanded(this._hasIconsWhenExpanded),this.validateLabel(this._label,void 0,!0),this.validateLinks(this._links),this.validateOrientation(this._orientation),this.initializeExpandedChildren()}disconnectedCallback(){b(this.state._label)}static get watchers(){return{_collapsible:["validateCollapsible"],_hasCompactButton:["validateHasCompactButton"],_hasIconsWhenExpanded:["validateHasIconsWhenExpanded"],_hideLabel:["validateHideLabel"],_label:["validateLabel"],_links:["validateLinks"],_orientation:["validateOrientation"]}}};O.style={default:T};export{O as kol_nav};
//# sourceMappingURL=kol-nav.entry-BETStg47.js.map
