@m3e/nav-menu 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.min.js CHANGED
@@ -3,29 +3,29 @@
3
3
  * Copyright (c) 2025 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{LitElement as e,html as t,unsafeCSS as s,css as i}from"lit";import{Selected as n,Disabled as o,EventAttribute as r,AttachInternals as a,Role as l,DesignToken as h,hasAssignedNodes as c,scrollIntoViewIfNeeded as d,PressedController as m,FocusController as p}from"@m3e/core";import{selectionManager as u,SelectionManager as f}from"@m3e/core/a11y";function v(e,t,s,i){var n,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,s,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,s,r):n(t,s))||r);return o>3&&r&&Object.defineProperty(t,s,r),r}function g(e,t,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(e):i?i.value:t.get(e)}function $(e,t,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,s):n?n.value=s:t.set(e,s),s}"function"==typeof SuppressedError&&SuppressedError;
6
+ import{LitElement as t,html as e,unsafeCSS as s,css as i}from"lit";import{Selected as n,Disabled as o,EventAttribute as r,AttachInternals as a,Role as l,DesignToken as h,hasAssignedNodes as c,scrollIntoViewIfNeeded as d,PressedController as m,FocusController as p}from"@m3e/core";import{selectionManager as u,SelectionManager as f}from"@m3e/core/a11y";function v(t,e,s,i){var n,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(r=(o<3?n(r):o>3?n(e,s,r):n(e,s))||r);return o>3&&r&&Object.defineProperty(e,s,r),r}function g(t,e,s,i){if("a"===s&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?i:"a"===s?i.call(t):i?i.value:e.get(t)}function $(t,e,s,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(t,s):n?n.value=s:e.set(t,s),s}"function"==typeof SuppressedError&&SuppressedError;
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2017 Google LLC
10
10
  * SPDX-License-Identifier: BSD-3-Clause
11
11
  */
12
- const b=e=>(t,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},y=globalThis,_=y.ShadowRoot&&(void 0===y.ShadyCSS||y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,A=Symbol(),w=new WeakMap;
12
+ const b=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},y=globalThis,_=y.ShadowRoot&&(void 0===y.ShadyCSS||y.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,A=Symbol(),w=new WeakMap;
13
13
  /**
14
14
  * @license
15
15
  * Copyright 2019 Google LLC
16
16
  * SPDX-License-Identifier: BSD-3-Clause
17
- */let E=class{constructor(e,t,s){if(this._$cssResult$=!0,s!==A)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(_&&void 0===e){const s=void 0!==t&&1===t.length;s&&(e=w.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),s&&w.set(t,e))}return e}toString(){return this.cssText}};const S=_?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(const s of e.cssRules)t+=s.cssText;return(e=>new E("string"==typeof e?e:e+"",void 0,A))(t)})(e):e,{is:C,defineProperty:k,getOwnPropertyDescriptor:x,getOwnPropertyNames:I,getOwnPropertySymbols:P,getPrototypeOf:M}=Object,T=globalThis,U=T.trustedTypes,O=U?U.emptyScript:"",H=T.reactiveElementPolyfillSupport,R=(e,t)=>e,L={toAttribute(e,t){switch(t){case Boolean:e=e?O:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let s=e;switch(t){case Boolean:s=null!==e;break;case Number:s=null===e?null:Number(e);break;case Object:case Array:try{s=JSON.parse(e)}catch(e){s=null}}return s}},N=(e,t)=>!C(e,t),j={attribute:!0,type:String,converter:L,reflect:!1,useDefault:!1,hasChanged:N};
17
+ */let E=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==A)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(_&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=w.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&w.set(e,t))}return t}toString(){return this.cssText}};const S=_?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new E("string"==typeof t?t:t+"",void 0,A))(e)})(t):t,{is:C,defineProperty:k,getOwnPropertyDescriptor:x,getOwnPropertyNames:I,getOwnPropertySymbols:P,getPrototypeOf:M}=Object,T=globalThis,U=T.trustedTypes,O=U?U.emptyScript:"",H=T.reactiveElementPolyfillSupport,R=(t,e)=>t,L={toAttribute(t,e){switch(e){case Boolean:t=t?O:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},N=(t,e)=>!C(t,e),j={attribute:!0,type:String,converter:L,reflect:!1,useDefault:!1,hasChanged:N};
18
18
  /**
19
19
  * @license
20
20
  * Copyright 2017 Google LLC
21
21
  * SPDX-License-Identifier: BSD-3-Clause
22
- */Symbol.metadata??=Symbol("metadata"),T.litPropertyMetadata??=new WeakMap;class W extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=j){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(e,s,t);void 0!==i&&k(this.prototype,e,i)}}static getPropertyDescriptor(e,t,s){const{get:i,set:n}=x(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:i,set(t){const o=i?.call(this);n?.call(this,t),this.requestUpdate(e,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??j}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;const e=M(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){const e=this.properties,t=[...I(e),...P(e)];for(const s of t)this.createProperty(s,e[s])}const e=this[Symbol.metadata];if(null!==e){const t=litPropertyMetadata.get(e);if(void 0!==t)for(const[e,s]of t)this.elementProperties.set(e,s)}this._$Eh=new Map;for(const[e,t]of this.elementProperties){const s=this._$Eu(e,t);void 0!==s&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const s=new Set(e.flat(1/0).reverse());for(const e of s)t.unshift(S(e))}else void 0!==e&&t.push(S(e));return t}static _$Eu(e,t){const s=t.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof e?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const s of t.keys())this.hasOwnProperty(s)&&(e.set(s,this[s]),delete this[s]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(_)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const s of t){const t=document.createElement("style"),i=y.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=s.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,s){this._$AK(e,s)}_$ET(e,t){const s=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,s);if(void 0!==i&&!0===s.reflect){const n=(void 0!==s.converter?.toAttribute?s.converter:L).toAttribute(t,s.type);this._$Em=e,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){const s=this.constructor,i=s._$Eh.get(e);if(void 0!==i&&this._$Em!==i){const e=s.getPropertyOptions(i),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:L;this._$Em=i;const o=n.fromAttribute(t,e.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(e,t,s){if(void 0!==e){const i=this.constructor,n=this[e];if(s??=i.getPropertyOptions(e),!((s.hasChanged??N)(n,t)||s.useDefault&&s.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(i._$Eu(e,s))))return;this.C(e,t,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,o??t??this[e]),!0!==n||void 0!==o)||(this._$AL.has(e)||(this.hasUpdated||s||(t=void 0),this._$AL.set(e,t)),!0===i&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}const e=this.constructor.elementProperties;if(e.size>0)for(const[t,s]of e){const{wrapped:e}=s,i=this[t];!0!==e||this._$AL.has(t)||void 0===i||this.C(t,void 0,s,i)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}W.elementStyles=[],W.shadowRootOptions={mode:"open"},W[R("elementProperties")]=new Map,W[R("finalized")]=new Map,H?.({ReactiveElement:W}),(T.reactiveElementVersions??=[]).push("2.1.1");
22
+ */Symbol.metadata??=Symbol("metadata"),T.litPropertyMetadata??=new WeakMap;class W extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=j){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&k(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=x(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const o=i?.call(this);n?.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??j}static _$Ei(){if(this.hasOwnProperty(R("elementProperties")))return;const t=M(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(R("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(R("properties"))){const t=this.properties,e=[...I(t),...P(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(S(t))}else void 0!==t&&e.push(S(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(_)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),i=y.litNonce;void 0!==i&&e.setAttribute("nonce",i),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const n=(void 0!==s.converter?.toAttribute?s.converter:L).toAttribute(e,s.type);this._$Em=t,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:L;this._$Em=i;const o=n.fromAttribute(e,t.type);this[i]=o??this._$Ej?.get(i)??o,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const i=this.constructor,n=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??N)(n,e)||s.useDefault&&s.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:n},o){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==n||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,s,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}W.elementStyles=[],W.shadowRootOptions={mode:"open"},W[R("elementProperties")]=new Map,W[R("finalized")]=new Map,H?.({ReactiveElement:W}),(T.reactiveElementVersions??=[]).push("2.1.1");
23
23
  /**
24
24
  * @license
25
25
  * Copyright 2017 Google LLC
26
26
  * SPDX-License-Identifier: BSD-3-Clause
27
27
  */
28
- const D={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:N},z=(e=D,t,s)=>{const{kind:i,metadata:n}=s;let o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===i&&((e=Object.create(e)).wrapped=!0),o.set(s.name,e),"accessor"===i){const{name:i}=s;return{set(s){const n=t.get.call(this);t.set.call(this,s),this.requestUpdate(i,n,e)},init(t){return void 0!==t&&this.C(i,void 0,e,t),t}}}if("setter"===i){const{name:i}=s;return function(s){const n=this[i];t.call(this,s),this.requestUpdate(i,n,e)}}throw Error("Unsupported decorator location: "+i)};function B(e){return(t,s)=>"object"==typeof s?z(e,t,s):((e,t,s)=>{const i=t.hasOwnProperty(s);return t.constructor.createProperty(s,e),i?Object.getOwnPropertyDescriptor(t,s):void 0})(e,t,s)}
28
+ const D={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:N},z=(t=D,e,s)=>{const{kind:i,metadata:n}=s;let o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),o.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const n=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,n,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=s;return function(s){const n=this[i];e.call(this,s),this.requestUpdate(i,n,t)}}throw Error("Unsupported decorator location: "+i)};function B(t){return(e,s)=>"object"==typeof s?z(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}
29
29
  /**
30
30
  * @license
31
31
  * Copyright 2017 Google LLC
@@ -36,18 +36,18 @@ const D={attribute:!0,type:String,converter:L,reflect:!1,hasChanged:N},z=(e=D,t,
36
36
  * Copyright 2017 Google LLC
37
37
  * SPDX-License-Identifier: BSD-3-Clause
38
38
  */
39
- function q(e,t){return(t,s,i)=>((e,t,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,s),s))(t,s,{get(){return(t=>t.renderRoot?.querySelector(e)??null)(this)}})}
39
+ function q(t,e){return(e,s,i)=>((t,e,s)=>(s.configurable=!0,s.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,s),s))(e,s,{get(){return(e=>e.renderRoot?.querySelector(t)??null)(this)}})}
40
40
  /**
41
41
  * @license
42
42
  * Copyright 2017 Google LLC
43
43
  * SPDX-License-Identifier: BSD-3-Clause
44
- */const V=globalThis,K=V.trustedTypes,Z=K?K.createPolicy("lit-html",{createHTML:e=>e}):void 0,F="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,G="?"+J,Q=`<${G}>`,X=document,Y=()=>X.createComment(""),ee=e=>null===e||"object"!=typeof e&&"function"!=typeof e,te=Array.isArray,se="[ \t\n\f\r]",ie=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ne=/-->/g,oe=/>/g,re=RegExp(`>|${se}(?:([^\\s"'>=/]+)(${se}*=${se}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),ae=/'/g,le=/"/g,he=/^(?:script|style|textarea|title)$/i,ce=Symbol.for("lit-noChange"),de=Symbol.for("lit-nothing"),me=new WeakMap,pe=X.createTreeWalker(X,129);function ue(e,t){if(!te(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Z?Z.createHTML(t):t}const fe=(e,t)=>{const s=e.length-1,i=[];let n,o=2===t?"<svg>":3===t?"<math>":"",r=ie;for(let t=0;t<s;t++){const s=e[t];let a,l,h=-1,c=0;for(;c<s.length&&(r.lastIndex=c,l=r.exec(s),null!==l);)c=r.lastIndex,r===ie?"!--"===l[1]?r=ne:void 0!==l[1]?r=oe:void 0!==l[2]?(he.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=re):void 0!==l[3]&&(r=re):r===re?">"===l[0]?(r=n??ie,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?re:'"'===l[3]?le:ae):r===le||r===ae?r=re:r===ne||r===oe?r=ie:(r=re,n=void 0);const d=r===re&&e[t+1].startsWith("/>")?" ":"";o+=r===ie?s+Q:h>=0?(i.push(a),s.slice(0,h)+F+s.slice(h)+J+d):s+J+(-2===h?t:d)}return[ue(e,o+(e[s]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),i]};class ve{constructor({strings:e,_$litType$:t},s){let i;this.parts=[];let n=0,o=0;const r=e.length-1,a=this.parts,[l,h]=fe(e,t);if(this.el=ve.createElement(l,s),pe.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(i=pe.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const e of i.getAttributeNames())if(e.endsWith(F)){const t=h[o++],s=i.getAttribute(e).split(J),r=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:r[2],strings:s,ctor:"."===r[1]?_e:"?"===r[1]?Ae:"@"===r[1]?we:ye}),i.removeAttribute(e)}else e.startsWith(J)&&(a.push({type:6,index:n}),i.removeAttribute(e));if(he.test(i.tagName)){const e=i.textContent.split(J),t=e.length-1;if(t>0){i.textContent=K?K.emptyScript:"";for(let s=0;s<t;s++)i.append(e[s],Y()),pe.nextNode(),a.push({type:2,index:++n});i.append(e[t],Y())}}}else if(8===i.nodeType)if(i.data===G)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=i.data.indexOf(J,e+1));)a.push({type:7,index:n}),e+=J.length-1}n++}}static createElement(e,t){const s=X.createElement("template");return s.innerHTML=e,s}}function ge(e,t,s=e,i){if(t===ce)return t;let n=void 0!==i?s._$Co?.[i]:s._$Cl;const o=ee(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(e),n._$AT(e,s,i)),void 0!==i?(s._$Co??=[])[i]=n:s._$Cl=n),void 0!==n&&(t=ge(e,n._$AS(e,t.values),n,i)),t}class $e{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:s}=this._$AD,i=(e?.creationScope??X).importNode(t,!0);pe.currentNode=i;let n=pe.nextNode(),o=0,r=0,a=s[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new be(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new Ee(n,this,e)),this._$AV.push(t),a=s[++r]}o!==a?.index&&(n=pe.nextNode(),o++)}return pe.currentNode=X,i}p(e){let t=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(e,s,t),t+=s.strings.length-2):s._$AI(e[t])),t++}}class be{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,s,i){this.type=2,this._$AH=de,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=ge(this,e,t),ee(e)?e===de||null==e||""===e?(this._$AH!==de&&this._$AR(),this._$AH=de):e!==this._$AH&&e!==ce&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):(e=>te(e)||"function"==typeof e?.[Symbol.iterator])(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==de&&ee(this._$AH)?this._$AA.nextSibling.data=e:this.T(X.createTextNode(e)),this._$AH=e}$(e){const{values:t,_$litType$:s}=e,i="number"==typeof s?this._$AC(e):(void 0===s.el&&(s.el=ve.createElement(ue(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(t);else{const e=new $e(i,this),s=e.u(this.options);e.p(t),this.T(s),this._$AH=e}}_$AC(e){let t=me.get(e.strings);return void 0===t&&me.set(e.strings,t=new ve(e)),t}k(e){te(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let s,i=0;for(const n of e)i===t.length?t.push(s=new be(this.O(Y()),this.O(Y()),this,this.options)):s=t[i],s._$AI(n),i++;i<t.length&&(this._$AR(s&&s._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){const t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ye{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,s,i,n){this.type=1,this._$AH=de,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=de}_$AI(e,t=this,s,i){const n=this.strings;let o=!1;if(void 0===n)e=ge(this,e,t,0),o=!ee(e)||e!==this._$AH&&e!==ce,o&&(this._$AH=e);else{const i=e;let r,a;for(e=n[0],r=0;r<n.length-1;r++)a=ge(this,i[s+r],t,r),a===ce&&(a=this._$AH[r]),o||=!ee(a)||a!==this._$AH[r],a===de?e=de:e!==de&&(e+=(a??"")+n[r+1]),this._$AH[r]=a}o&&!i&&this.j(e)}j(e){e===de?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class _e extends ye{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===de?void 0:e}}class Ae extends ye{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==de)}}class we extends ye{constructor(e,t,s,i,n){super(e,t,s,i,n),this.type=5}_$AI(e,t=this){if((e=ge(this,e,t,0)??de)===ce)return;const s=this._$AH,i=e===de&&s!==de||e.capture!==s.capture||e.once!==s.once||e.passive!==s.passive,n=e!==de&&(s===de||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Ee{constructor(e,t,s){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(e){ge(this,e)}}const Se=V.litHtmlPolyfillSupport;Se?.(ve,be),(V.litHtmlVersions??=[]).push("3.3.1");var Ce,ke,xe,Ie,Pe,Me,Te,Ue,Oe,He,Re,Le;let Ne=Le=class extends(n(o(r(a(l(e,"treeitem"),!0),"opening","opened","closing","closed")))){constructor(){super(...arguments),Ce.add(this),this._hasChildItems=!1,ke.set(this,[]),xe.set(this,null),Ie.set(this,new Array),Pe.set(this,null),this.open=!1}get link(){return g(this,Pe,"f")}get label(){return this._base??null}get visible(){return!g(this,Ie,"f").some(e=>!e.open)}get path(){return[...g(this,Ie,"f"),this]}get hasChildItems(){return this._hasChildItems}get parentItem(){return g(this,Ie,"f")[g(this,Ie,"f").length-1]??null}get childItems(){return g(this,ke,"f")}get level(){return g(this,Ie,"f").length+1}expand(e=!1){this.hasChildItems&&(this.open=!0,e&&this.childItems.forEach(e=>e.expand(!0)))}collapse(e=!1){this.hasChildItems&&(this.open=!1,e&&this.childItems.forEach(e=>e.collapse(!0)))}toggle(){this.hasChildItems&&(this.open=!this.open)}connectedCallback(){super.connectedCallback(),g(this,Ie,"f").length=0;for(let e=this.parentElement?.closest("m3e-nav-menu-item");e;e=e.parentElement?.closest("m3e-nav-menu-item"))g(this,Ie,"f").push(e);g(this,Ie,"f").reverse(),this.style.setProperty("--_nav-menu-item-level",`${this.level}`),$(this,xe,this.closest("m3e-nav-menu"),"f")}disconnectedCallback(){super.disconnectedCallback(),g(this,Ie,"f").length=0}update(e){if(super.update(e),e.has("selected")){this.ariaSelected=null,this.ariaCurrent=this.hasChildItems?null:`${this.selected}`;for(const e of this.querySelectorAll(":scope > m3e-icon[slot]"))e.toggleAttribute("filled",this.selected);g(this,Ie,"f").forEach(e=>e.selected=this.selected),this.selected&&!this.hasChildItems&&this.closest("m3e-nav-menu")?.[u].notifySelectionChange(this)}(e.has("open")||e.has("_hasChildItems"))&&(this.ariaExpanded=this._hasChildItems?`${this.open}`:null),(e.has("_hasChildItems")&&this.disabled||e.has("disabled"))&&g(this,ke,"f").forEach(e=>e.disabled=this.disabled)}firstUpdated(e){super.firstUpdated(e);const t=this._base;t&&[this.focusRing,this.stateLayer,this.ripple].forEach(e=>e?.attach(t))}render(){return t`<div class="base" @click="${g(this,Ce,"m",He)}">
44
+ */const V=globalThis,K=V.trustedTypes,Z=K?K.createPolicy("lit-html",{createHTML:t=>t}):void 0,F="$lit$",J=`lit$${Math.random().toFixed(9).slice(2)}$`,G="?"+J,Q=`<${G}>`,X=document,Y=()=>X.createComment(""),tt=t=>null===t||"object"!=typeof t&&"function"!=typeof t,et=Array.isArray,st="[ \t\n\f\r]",it=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,nt=/-->/g,ot=/>/g,rt=RegExp(`>|${st}(?:([^\\s"'>=/]+)(${st}*=${st}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),at=/'/g,lt=/"/g,ht=/^(?:script|style|textarea|title)$/i,ct=Symbol.for("lit-noChange"),dt=Symbol.for("lit-nothing"),mt=new WeakMap,pt=X.createTreeWalker(X,129);function ut(t,e){if(!et(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==Z?Z.createHTML(e):e}const ft=(t,e)=>{const s=t.length-1,i=[];let n,o=2===e?"<svg>":3===e?"<math>":"",r=it;for(let e=0;e<s;e++){const s=t[e];let a,l,h=-1,c=0;for(;c<s.length&&(r.lastIndex=c,l=r.exec(s),null!==l);)c=r.lastIndex,r===it?"!--"===l[1]?r=nt:void 0!==l[1]?r=ot:void 0!==l[2]?(ht.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=rt):void 0!==l[3]&&(r=rt):r===rt?">"===l[0]?(r=n??it,h=-1):void 0===l[1]?h=-2:(h=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?rt:'"'===l[3]?lt:at):r===lt||r===at?r=rt:r===nt||r===ot?r=it:(r=rt,n=void 0);const d=r===rt&&t[e+1].startsWith("/>")?" ":"";o+=r===it?s+Q:h>=0?(i.push(a),s.slice(0,h)+F+s.slice(h)+J+d):s+J+(-2===h?e:d)}return[ut(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class vt{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const r=t.length-1,a=this.parts,[l,h]=ft(t,e);if(this.el=vt.createElement(l,s),pt.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=pt.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(F)){const e=h[o++],s=i.getAttribute(t).split(J),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:r[2],strings:s,ctor:"."===r[1]?_t:"?"===r[1]?At:"@"===r[1]?wt:yt}),i.removeAttribute(t)}else t.startsWith(J)&&(a.push({type:6,index:n}),i.removeAttribute(t));if(ht.test(i.tagName)){const t=i.textContent.split(J),e=t.length-1;if(e>0){i.textContent=K?K.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],Y()),pt.nextNode(),a.push({type:2,index:++n});i.append(t[e],Y())}}}else if(8===i.nodeType)if(i.data===G)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=i.data.indexOf(J,t+1));)a.push({type:7,index:n}),t+=J.length-1}n++}}static createElement(t,e){const s=X.createElement("template");return s.innerHTML=t,s}}function gt(t,e,s=t,i){if(e===ct)return e;let n=void 0!==i?s._$Co?.[i]:s._$Cl;const o=tt(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=n:s._$Cl=n),void 0!==n&&(e=gt(t,n._$AS(t,e.values),n,i)),e}class $t{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??X).importNode(e,!0);pt.currentNode=i;let n=pt.nextNode(),o=0,r=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new bt(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new Et(n,this,t)),this._$AV.push(e),a=s[++r]}o!==a?.index&&(n=pt.nextNode(),o++)}return pt.currentNode=X,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class bt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=dt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=gt(this,t,e),tt(t)?t===dt||null==t||""===t?(this._$AH!==dt&&this._$AR(),this._$AH=dt):t!==this._$AH&&t!==ct&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>et(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==dt&&tt(this._$AH)?this._$AA.nextSibling.data=t:this.T(X.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=vt.createElement(ut(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new $t(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=mt.get(t.strings);return void 0===e&&mt.set(t.strings,e=new vt(t)),e}k(t){et(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new bt(this.O(Y()),this.O(Y()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class yt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=dt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=dt}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(void 0===n)t=gt(this,t,e,0),o=!tt(t)||t!==this._$AH&&t!==ct,o&&(this._$AH=t);else{const i=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=gt(this,i[s+r],e,r),a===ct&&(a=this._$AH[r]),o||=!tt(a)||a!==this._$AH[r],a===dt?t=dt:t!==dt&&(t+=(a??"")+n[r+1]),this._$AH[r]=a}o&&!i&&this.j(t)}j(t){t===dt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class _t extends yt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===dt?void 0:t}}class At extends yt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==dt)}}class wt extends yt{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=gt(this,t,e,0)??dt)===ct)return;const s=this._$AH,i=t===dt&&s!==dt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==dt&&(s===dt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class Et{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){gt(this,t)}}const St=V.litHtmlPolyfillSupport;St?.(vt,bt),(V.litHtmlVersions??=[]).push("3.3.1");var Ct,kt,xt,It,Pt,Mt,Tt,Ut,Ot,Ht,Rt,Lt;let Nt=Lt=class extends(n(o(r(a(l(t,"treeitem"),!0),"opening","opened","closing","closed")))){constructor(){super(...arguments),Ct.add(this),this._hasChildItems=!1,kt.set(this,[]),xt.set(this,null),It.set(this,new Array),Pt.set(this,null),this.open=!1}get link(){return g(this,Pt,"f")}get label(){return this._base??null}get visible(){return!g(this,It,"f").some(t=>!t.open)}get path(){return[...g(this,It,"f"),this]}get hasChildItems(){return this._hasChildItems}get parentItem(){return g(this,It,"f")[g(this,It,"f").length-1]??null}get childItems(){return g(this,kt,"f")}get level(){return g(this,It,"f").length+1}expand(t=!1){this.hasChildItems&&(this.open=!0,t&&this.childItems.forEach(t=>t.expand(!0)))}collapse(t=!1){this.hasChildItems&&(this.open=!1,t&&this.childItems.forEach(t=>t.collapse(!0)))}toggle(){this.hasChildItems&&(this.open=!this.open)}connectedCallback(){super.connectedCallback(),g(this,It,"f").length=0;for(let t=this.parentElement?.closest("m3e-nav-menu-item");t;t=t.parentElement?.closest("m3e-nav-menu-item"))g(this,It,"f").push(t);g(this,It,"f").reverse(),this.style.setProperty("--_nav-menu-item-level",`${this.level}`),$(this,xt,this.closest("m3e-nav-menu"),"f")}disconnectedCallback(){super.disconnectedCallback(),g(this,It,"f").length=0}update(t){if(super.update(t),t.has("selected")){this.ariaSelected=null,this.ariaCurrent=this.hasChildItems?null:`${this.selected}`;for(const t of this.querySelectorAll(":scope > m3e-icon[slot]"))t.toggleAttribute("filled",this.selected);g(this,It,"f").forEach(t=>t.selected=this.selected),this.selected&&!this.hasChildItems&&this.closest("m3e-nav-menu")?.[u].notifySelectionChange(this)}(t.has("open")||t.has("_hasChildItems"))&&(this.ariaExpanded=this._hasChildItems?`${this.open}`:null),(t.has("_hasChildItems")&&this.disabled||t.has("disabled"))&&g(this,kt,"f").forEach(t=>t.disabled=this.disabled)}firstUpdated(t){super.firstUpdated(t);const e=this._base;e&&[this.focusRing,this.stateLayer,this.ripple].forEach(t=>t?.attach(e))}render(){return e`<div class="base" @click="${g(this,Ct,"m",Ht)}">
45
45
  <m3e-state-layer class="state-layer" ?disabled="${this.disabled}"></m3e-state-layer>
46
46
  <m3e-focus-ring class="focus-ring" inward ?disabled="${this.disabled}"></m3e-focus-ring>
47
- <m3e-ripple class="ripple" centered ?disabled="${this.disabled}"></m3e-ripple>
48
- <div class="icon" aria-hidden="true">${g(this,Ce,"m",Me).call(this)}</div>
47
+ <m3e-ripple class="ripple" ?disabled="${this.disabled}"></m3e-ripple>
48
+ <div class="icon" aria-hidden="true">${g(this,Ct,"m",Mt).call(this)}</div>
49
49
  <div class="label">
50
- <slot name="label" @slotchange="${g(this,Ce,"m",Ue)}"></slot>
50
+ <slot name="label" @slotchange="${g(this,Ct,"m",Ut)}"></slot>
51
51
  </div>
52
52
  <slot name="badge"></slot>
53
53
  <div aria-hidden="true" class="toggle">
@@ -61,15 +61,15 @@ function q(e,t){return(t,s,i)=>((e,t,s)=>(s.configurable=!0,s.enumerable=!0,Refl
61
61
  <m3e-collapsible
62
62
  class="group"
63
63
  role="group"
64
- aria-hidden="${(e=>e??de)(this._hasChildItems?void 0:"true")}"
64
+ aria-hidden="${(t=>t??dt)(this._hasChildItems?void 0:"true")}"
65
65
  ?open="${this._hasChildItems&&this.open}"
66
- @opening="${g(this,Ce,"m",Re)}"
67
- @opened="${g(this,Ce,"m",Re)}"
68
- @closing="${g(this,Ce,"m",Re)}"
69
- @closed="${g(this,Ce,"m",Re)}"
66
+ @opening="${g(this,Ct,"m",Rt)}"
67
+ @opened="${g(this,Ct,"m",Rt)}"
68
+ @closing="${g(this,Ct,"m",Rt)}"
69
+ @closed="${g(this,Ct,"m",Rt)}"
70
70
  >
71
- <slot @slotchange="${g(this,Ce,"m",Oe)}"></slot>
72
- </m3e-collapsible>`}};var je,We,De,ze,Be,qe,Ve,Ke,Ze,Fe,Je,Ge,Qe,Xe,Ye;ke=new WeakMap,xe=new WeakMap,Ie=new WeakMap,Pe=new WeakMap,Ce=new WeakSet,Me=function(){const e=t`<slot name="icon" @slotchange="${g(this,Ce,"m",Te)}"></slot>`;return this.selected&&!this.hasChildItems?t`<slot name="selected-icon" @slotchange="${g(this,Ce,"m",Te)}">${e}</slot>`:e},Te=function(e){this.classList.toggle("-with-icon",c(e.target))},Ue=function(e){$(this,Pe,e.target.assignedElements({flatten:!0}).find(e=>e instanceof HTMLAnchorElement)??null,"f"),g(this,Pe,"f")?.setAttribute("tabindex","-1")},Oe=function(e){$(this,ke,e.target.assignedElements({flatten:!0}).filter(e=>e instanceof Le),"f");const t=this._hasChildItems;this._hasChildItems=g(this,ke,"f").length>0,this.classList.toggle("-has-items",this._hasChildItems),(t||this._hasChildItems)&&(this.selected=g(this,ke,"f").some(e=>e.selected))},He=function(){if(!this.disabled)if(g(this,xe,"f")?.[u].setActiveItem(this),this._hasChildItems)this.toggle();else{g(this,xe,"f")?.[u].select(this),g(this,Ie,"f").forEach(e=>e.selected=this.selected),g(this,Pe,"f")?.click();const e=this.closest("m3e-drawer-container");if(e){const t=this.closest("[slot='start']")??this.closest("[slot='end')");t&&(e.classList.contains(`-${t.slot}-push`)||e.classList.contains(`-${t.slot}-over`))&&setTimeout(()=>e.removeAttribute(t.slot),300)}}},Re=function(e){e.stopPropagation(),this.dispatchEvent(new Event(e.type,{bubbles:!0}))},Ne.styles=i`
71
+ <slot @slotchange="${g(this,Ct,"m",Ot)}"></slot>
72
+ </m3e-collapsible>`}};var jt,Wt,Dt,zt,Bt,qt,Vt,Kt,Zt,Ft,Jt,Gt,Qt,Xt,Yt;kt=new WeakMap,xt=new WeakMap,It=new WeakMap,Pt=new WeakMap,Ct=new WeakSet,Mt=function(){const t=e`<slot name="icon" @slotchange="${g(this,Ct,"m",Tt)}"></slot>`;return this.selected&&!this.hasChildItems?e`<slot name="selected-icon" @slotchange="${g(this,Ct,"m",Tt)}">${t}</slot>`:t},Tt=function(t){this.classList.toggle("-with-icon",c(t.target))},Ut=function(t){$(this,Pt,t.target.assignedElements({flatten:!0}).find(t=>t instanceof HTMLAnchorElement)??null,"f"),g(this,Pt,"f")?.setAttribute("tabindex","-1")},Ot=function(t){$(this,kt,t.target.assignedElements({flatten:!0}).filter(t=>t instanceof Lt),"f");const e=this._hasChildItems;this._hasChildItems=g(this,kt,"f").length>0,this.classList.toggle("-has-items",this._hasChildItems),(e||this._hasChildItems)&&(this.selected=g(this,kt,"f").some(t=>t.selected))},Ht=function(){if(!this.disabled)if(g(this,xt,"f")?.[u].setActiveItem(this),this._hasChildItems)this.toggle();else{g(this,xt,"f")?.[u].select(this),g(this,It,"f").forEach(t=>t.selected=this.selected),g(this,Pt,"f")?.click();const t=this.closest("m3e-drawer-container");if(t){const e=this.closest("[slot='start']")??this.closest("[slot='end')");e&&(t.classList.contains(`-${e.slot}-push`)||t.classList.contains(`-${e.slot}-over`))&&setTimeout(()=>t.removeAttribute(e.slot),300)}}},Rt=function(t){t.stopPropagation(),this.dispatchEvent(new Event(t.type,{bubbles:!0}))},Nt.styles=i`
73
73
  :host {
74
74
  display: block;
75
75
  flex: none;
@@ -245,12 +245,12 @@ function q(e,t){return(t,s,i)=>((e,t,s)=>(s.configurable=!0,s.enumerable=!0,Refl
245
245
  color: ButtonText;
246
246
  }
247
247
  }
248
- `,v([q(".state-layer")],Ne.prototype,"stateLayer",void 0),v([q(".focus-ring")],Ne.prototype,"focusRing",void 0),v([q(".ripple")],Ne.prototype,"ripple",void 0),v([q(".base")],Ne.prototype,"_base",void 0),v([function(e){return B({...e,state:!0,attribute:!1})}
248
+ `,v([q(".state-layer")],Nt.prototype,"stateLayer",void 0),v([q(".focus-ring")],Nt.prototype,"focusRing",void 0),v([q(".ripple")],Nt.prototype,"ripple",void 0),v([q(".base")],Nt.prototype,"_base",void 0),v([function(t){return B({...t,state:!0,attribute:!1})}
249
249
  /**
250
250
  * @license
251
251
  * Copyright 2017 Google LLC
252
252
  * SPDX-License-Identifier: BSD-3-Clause
253
- */()],Ne.prototype,"_hasChildItems",void 0),v([B({type:Boolean,reflect:!0})],Ne.prototype,"open",void 0),Ne=Le=v([b("m3e-nav-menu-item")],Ne);let et=Ye=class extends(l(e,"tree")){constructor(){super(),je.add(this),We.set(this,!1),De.set(this,!1),this[Xe]=(new f).withVerticalOrientation().withHomeAndEnd().withTypeahead().withSkipPredicate(e=>e.disabled||!e.visible).disableRovingTabIndex().onActiveItemChange(()=>{this[u].activeItem&&g(this,je,"m",Je).call(this,this[u].activeItem)}).onSelectedItemsChange(()=>{const e=this.selected;for(const t of this.items)t!==e&&g(this,je,"m",Qe).call(this,t,!1,!1);e?.label&&d(e.label,this,{block:"start",behavior:"smooth"})}),ze.set(this,e=>g(this,je,"m",Ke).call(this,e)),Be.set(this,e=>g(this,je,"m",Ze).call(this,e)),qe.set(this,e=>g(this,je,"m",Fe).call(this,e)),new m(this,{callback:e=>$(this,De,e,"f")}),new p(this,{callback:()=>{g(this,De,"f")||g(this,je,"m",Ge).call(this)}})}get selected(){return this[u].selectedItems[0]??null}get items(){return this[u].items}expand(e){(e??this[u].items).forEach(e=>e.expand())}collapse(e){(e??this[u].items).forEach(e=>e.collapse());const t=this[u].activeItem;if(t&&!t.visible)for(let e=t.parentItem;e;e=e.parentItem)if(e.visible){this[u].setActiveItem(e);break}}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),this.addEventListener("keydown",g(this,ze,"f")),this.addEventListener("keyup",g(this,Be,"f")),this.addEventListener("pointerdown",g(this,qe,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",g(this,ze,"f")),this.removeEventListener("keyup",g(this,Be,"f")),this.removeEventListener("pointerdown",g(this,qe,"f"))}render(){return t`<slot @slotchange="${g(this,je,"m",Ve)}"></slot>`}};var tt,st,it,nt,ot;We=new WeakMap,De=new WeakMap,ze=new WeakMap,Be=new WeakMap,qe=new WeakMap,je=new WeakSet,Xe=u,Ve=function(){for(const e of this.querySelectorAll("m3e-divider"))e.ariaHidden="true";const{added:e}=this[u].setItems([...this.querySelectorAll("m3e-nav-menu-item")]);for(const t of e)t.id=t.id||"m3e-nav-menu-item-"+Ye.__nextId++;this[u].activeItem?(this.setAttribute("aria-activedescendant",this[u].activeItem.id),g(this,je,"m",Ge).call(this)):this.removeAttribute("aria-activedescendant")},Ke=function(e){$(this,We,!1,"f"),g(this,je,"m",Ge).call(this);const t=this[u].activeItem;if(!e.defaultPrevented&&t&&!t.disabled)switch(e.key){case"Enter":case" ":e.preventDefault()," "===e.key&&t.ripple&&!t.ripple.visible&&t.ripple.show(0,0,!0),t.hasChildItems?t.toggle():t.selected||(this[u].select(t),t.link?.click());break;case"*":e.preventDefault(),t.expand(!0);break;case"Left":case"ArrowLeft":if(e.preventDefault(),t.hasChildItems&&t.open)t.collapse();else{const e=t.parentItem;e&&(e.collapse(),this[u].setActiveItem(e))}break;case"Right":case"ArrowRight":if(t.hasChildItems)if(t.open)try{this[u].vertical=!1,this[u].onKeyDown(e)}finally{this[u].vertical=!0}else e.preventDefault(),t.expand();else e.preventDefault();break;default:this[u].onKeyDown(e)}},Ze=function(e){const t=this[u].activeItem;e.defaultPrevented||!t||t.disabled||" "!==e.key||t.ripple?.hide()},Fe=function(e){if(!e.defaultPrevented&&!g(this,We,"f")){$(this,We,!0,"f");const t=e.composedPath().reverse().find(e=>e instanceof Ne);t&&!t.disabled&&g(this,je,"m",Qe).call(this,t,!0,!1)}},Je=function(e){this.setAttribute("aria-activedescendant",e.id),e.label&&d(e.label,this,{block:"nearest",behavior:"smooth"}),g(this,je,"m",Ge).call(this)},Ge=function(){const e=this.matches(":focus")||this.matches(":focus-within"),t=!g(this,We,"f")&&this.matches(":focus-visible");this[u].items.forEach(s=>{const i=s===this[u].activeItem;g(this,je,"m",Qe).call(this,s,i&&e,i&&t)})},Qe=function(e,t,s){t&&s?e.stateLayer?.show("focused"):e.stateLayer?.hide("focused"),s?e.focusRing?.show():e.focusRing?.hide()},et.styles=i`
253
+ */()],Nt.prototype,"_hasChildItems",void 0),v([B({type:Boolean,reflect:!0})],Nt.prototype,"open",void 0),Nt=Lt=v([b("m3e-nav-menu-item")],Nt);let te=Yt=class extends(l(t,"tree")){constructor(){super(),jt.add(this),Wt.set(this,!1),Dt.set(this,!1),this[Xt]=(new f).withVerticalOrientation().withHomeAndEnd().withTypeahead().withSkipPredicate(t=>t.disabled||!t.visible).disableRovingTabIndex().onActiveItemChange(()=>{this[u].activeItem&&g(this,jt,"m",Jt).call(this,this[u].activeItem)}).onSelectedItemsChange(()=>{const t=this.selected;for(const e of this.items)e!==t&&g(this,jt,"m",Qt).call(this,e,!1,!1);t?.label&&d(t.label,this,{block:"start",behavior:"smooth"})}),zt.set(this,t=>g(this,jt,"m",Kt).call(this,t)),Bt.set(this,t=>g(this,jt,"m",Zt).call(this,t)),qt.set(this,t=>g(this,jt,"m",Ft).call(this,t)),new m(this,{callback:t=>$(this,Dt,t,"f")}),new p(this,{callback:()=>{g(this,Dt,"f")||g(this,jt,"m",Gt).call(this)}})}get selected(){return this[u].selectedItems[0]??null}get items(){return this[u].items}expand(t){(t??this[u].items).forEach(t=>t.expand())}collapse(t){(t??this[u].items).forEach(t=>t.collapse());const e=this[u].activeItem;if(e&&!e.visible)for(let t=e.parentItem;t;t=t.parentItem)if(t.visible){this[u].setActiveItem(t);break}}connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0"),this.addEventListener("keydown",g(this,zt,"f")),this.addEventListener("keyup",g(this,Bt,"f")),this.addEventListener("pointerdown",g(this,qt,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",g(this,zt,"f")),this.removeEventListener("keyup",g(this,Bt,"f")),this.removeEventListener("pointerdown",g(this,qt,"f"))}render(){return e`<slot @slotchange="${g(this,jt,"m",Vt)}"></slot>`}};var ee,se,ie,ne,oe;Wt=new WeakMap,Dt=new WeakMap,zt=new WeakMap,Bt=new WeakMap,qt=new WeakMap,jt=new WeakSet,Xt=u,Vt=function(){for(const t of this.querySelectorAll("m3e-divider"))t.ariaHidden="true";const{added:t}=this[u].setItems([...this.querySelectorAll("m3e-nav-menu-item")]);for(const e of t)e.id=e.id||"m3e-nav-menu-item-"+Yt.__nextId++;this[u].activeItem?(this.setAttribute("aria-activedescendant",this[u].activeItem.id),g(this,jt,"m",Gt).call(this)):this.removeAttribute("aria-activedescendant")},Kt=function(t){$(this,Wt,!1,"f"),g(this,jt,"m",Gt).call(this);const e=this[u].activeItem;if(!t.defaultPrevented&&e&&!e.disabled)switch(t.key){case"Enter":case" ":t.preventDefault()," "===t.key&&e.ripple&&!e.ripple.visible&&e.ripple.show(0,0,!0),e.hasChildItems?e.toggle():e.selected||(this[u].select(e),e.link?.click());break;case"*":t.preventDefault(),e.expand(!0);break;case"Left":case"ArrowLeft":if(t.preventDefault(),e.hasChildItems&&e.open)e.collapse();else{const t=e.parentItem;t&&(t.collapse(),this[u].setActiveItem(t))}break;case"Right":case"ArrowRight":if(e.hasChildItems)if(e.open)try{this[u].vertical=!1,this[u].onKeyDown(t)}finally{this[u].vertical=!0}else t.preventDefault(),e.expand();else t.preventDefault();break;default:this[u].onKeyDown(t)}},Zt=function(t){const e=this[u].activeItem;t.defaultPrevented||!e||e.disabled||" "!==t.key||e.ripple?.hide()},Ft=function(t){if(!t.defaultPrevented&&!g(this,Wt,"f")){$(this,Wt,!0,"f");const e=t.composedPath().reverse().find(t=>t instanceof Nt);e&&!e.disabled&&g(this,jt,"m",Qt).call(this,e,!0,!1)}},Jt=function(t){this.setAttribute("aria-activedescendant",t.id),t.label&&d(t.label,this,{block:"nearest",behavior:"smooth"}),g(this,jt,"m",Gt).call(this)},Gt=function(){const t=this.matches(":focus")||this.matches(":focus-within"),e=!g(this,Wt,"f")&&this.matches(":focus-visible");this[u].items.forEach(s=>{const i=s===this[u].activeItem;g(this,jt,"m",Qt).call(this,s,i&&t,i&&e)})},Qt=function(t,e,s){e&&s?t.stateLayer?.show("focused"):t.stateLayer?.hide("focused"),s?t.focusRing?.show():t.focusRing?.hide()},te.styles=i`
254
254
  :host {
255
255
  display: flex;
256
256
  flex-direction: column;
@@ -270,7 +270,7 @@ function q(e,t){return(t,s,i)=>((e,t,s)=>(s.configurable=!0,s.enumerable=!0,Refl
270
270
  margin-block: var(--m3e-nav-menu-divider-margin, 0.25rem);
271
271
  flex: none;
272
272
  }
273
- `,et.__nextId=0,et=Ye=v([b("m3e-nav-menu")],et);let rt=ot=class extends(l(e,"group")){constructor(){super(...arguments),tt.add(this),st.set(this,"m3e-nav-menu-item-group-label-"+ot.__nextId++),it.set(this,void 0)}connectedCallback(){super.connectedCallback(),this.classList.toggle("-divided","M3E-DIVIDER"===this.previousElementSibling?.tagName)}disconnectedCallback(){super.disconnectedCallback(),this.classList.remove("-divided")}render(){return t`<slot name="label" @slotchange="${g(this,tt,"m",nt)}"></slot><slot></slot>`}};st=new WeakMap,it=new WeakMap,tt=new WeakSet,nt=function(e){const t=e.target.assignedElements({flatten:!0})[0];t!==g(this,it,"f")&&(g(this,it,"f")?.id===g(this,st,"f")&&(g(this,it,"f").id=""),$(this,it,t,"f"),g(this,it,"f")?(g(this,it,"f").role="none",g(this,it,"f").id=g(this,it,"f").id||g(this,st,"f"),this.setAttribute("aria-labelledby",g(this,it,"f").id)):this.removeAttribute("aria-labelledby"))},rt.styles=i`
273
+ `,te.__nextId=0,te=Yt=v([b("m3e-nav-menu")],te);let re=oe=class extends(l(t,"group")){constructor(){super(...arguments),ee.add(this),se.set(this,"m3e-nav-menu-item-group-label-"+oe.__nextId++),ie.set(this,void 0)}connectedCallback(){super.connectedCallback(),this.classList.toggle("-divided","M3E-DIVIDER"===this.previousElementSibling?.tagName)}disconnectedCallback(){super.disconnectedCallback(),this.classList.remove("-divided")}render(){return e`<slot name="label" @slotchange="${g(this,ee,"m",ne)}"></slot><slot></slot>`}};se=new WeakMap,ie=new WeakMap,ee=new WeakSet,ne=function(t){const e=t.target.assignedElements({flatten:!0})[0];e!==g(this,ie,"f")&&(g(this,ie,"f")?.id===g(this,se,"f")&&(g(this,ie,"f").id=""),$(this,ie,e,"f"),g(this,ie,"f")?(g(this,ie,"f").role="none",g(this,ie,"f").id=g(this,ie,"f").id||g(this,se,"f"),this.setAttribute("aria-labelledby",g(this,ie,"f").id)):this.removeAttribute("aria-labelledby"))},re.styles=i`
274
274
  :host {
275
275
  display: contents;
276
276
  }
@@ -287,5 +287,5 @@ function q(e,t){return(t,s,i)=>((e,t,s)=>(s.configurable=!0,s.enumerable=!0,Refl
287
287
  :host(:not(.-divided)) ::slotted([slot="label"]) {
288
288
  margin-block-start: var(--m3e-nav-menu-item-group-label-space, 1rem);
289
289
  }
290
- `,rt.__nextId=0,rt=ot=v([b("m3e-nav-menu-item-group")],rt);export{et as M3eNavMenuElement,Ne as M3eNavMenuItemElement,rt as M3eNavMenuItemGroupElement};
290
+ `,re.__nextId=0,re=oe=v([b("m3e-nav-menu-item-group")],re);export{te as M3eNavMenuElement,Nt as M3eNavMenuItemElement,re as M3eNavMenuItemGroupElement};
291
291
  //# sourceMappingURL=index.min.js.map