/*!
 * EdGEL: The University of Edinburgh Design System v5.3.1 (https://design-system.ed.ac.uk/)
 * Copyright 2014-2025 The University of Edinburgh
 *
 * Bootstrap  v5.3.3 (https://getbootstrap.com/)
 * Copyright 2011-2024 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */
import{x as e,c as n}from"./base-D29SVYIK.js";import{o as s}from"./if-defined-L9qFdEae.js";import{E as r}from"./menu-DemWMZ65.js";import"./collapse-Dg2MrZWy.js";import"./collapse-D9mLnlZE.js";import"./selector-engine-0wv5ALVt.js";import"./edgel-icon.js";let t,i,l,o=e=>e;n("edgel-menu-full",class extends r{_validateMenu(){if(!this.menu.tree)throw new Error("No tree supplied in the menu object.");if(!this.menu.tree.text||!this.menu.tree.url)throw new Error("Invalid tree supplied in the menu object.");return super._validateMenu()}_processMenu(){this._current=this.menu.breadcrumb.at(-1)}_renderMenu(){return this._nestedList([this.menu.tree])}_nestedList(n,r=0){if(r>2)throw new Error("Trees more than three levels deep (including root) are not currently supported in the design");const d=r>1,u=1===r;let a="";for(const s of n)s._active=s.url===this._current.url,s._joint=!1,s._renderedChildren=e(t||(t=o``)),s.children&&s.children.length?(s._collapsed=!this.menu.breadcrumb.some((e=>e.url===s.url)),s._expanded=!s._collapsed,s._expanded&&(s._renderedChildren=this._nestedList(s.children,r+1)),(s._active||s.children.some((e=>e._active&&(!e.children||!e.children.length))))&&(s._joint=!0)):(s._collapsed=!1,s._expanded=!1);for(const s of n)s._classes=[],0===r?s._classes.push("uoe-nav-link-root"):s._joint?s._classes.push("uoe-nav-link-joint"):d?s._classes.push("uoe-nav-link-leaf"):u&&s._classes.push("uoe-nav-link-child"),s._collapsed?s._classes.push("uoe-nav-link-collapsed"):s._expanded&&s._classes.push("uoe-nav-link-expanded"),a=e(i||(i=o`
        ${0}
        <li>
          ${0}
          ${0}
        </li>
      `),a,this._itemLink(s),s._renderedChildren);return e(l||(l=o`<ul id=${0}>${0}</ul>`),s(r?void 0:this.controls),a)}});
