@openremote/or-tree-menu 1.26.0 → 1.26.2

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/umd/index.js CHANGED
@@ -1,5 +1,5 @@
1
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ORTranslate"),require("ORCore")):"function"==typeof define&&define.amd?define(["ORTranslate","ORCore"],t):"object"==typeof exports?exports.ORTreeMenu=t(require("ORTranslate"),require("ORCore")):e.ORTreeMenu=t(e.ORTranslate,e.ORCore)}(self,(e,t)=>(()=>{"use strict";var i={954(e){e.exports=t},673(t){t.exports=e}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return i[e](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,i;n.r(o),n.d(o,{OrTreeSelectEvent:()=>ek,TreeMenuSorting:()=>eC,OrTreeDragEvent:()=>eO,OrTreeGroup:()=>iq,OrTreeNode:()=>iZ,OrTreeMenu:()=>iJ,TreeMenuSelection:()=>ex});let s=globalThis,r=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),l=new WeakMap;class d{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(r&&void 0===e){let i=void 0!==t&&1===t.length;i&&(e=l.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&l.set(t,e))}return e}toString(){return this.cssText}}let h=(e,...t)=>new d(1===e.length?e[0]:t.reduce((t,i,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[s+1],e[0]),e,a),c=(e,t)=>{if(r)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let i of t){let t=document.createElement("style"),n=s.litNonce;void 0!==n&&t.setAttribute("nonce",n),t.textContent=i.cssText,e.appendChild(t)}},u=r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t,i="";for(let t of e.cssRules)i+=t.cssText;return new d("string"==typeof(t=i)?t:t+"",void 0,a)})(e):e,{is:p,defineProperty:_,getOwnPropertyDescriptor:v,getOwnPropertyNames:m,getOwnPropertySymbols:f,getPrototypeOf:g}=Object,b=globalThis,y=b.trustedTypes,w=y?y.emptyScript:"",x=b.reactiveElementPolyfillSupport,C={toAttribute(e,t){switch(t){case Boolean:e=e?w:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},E=(e,t)=>!p(e,t),A={attribute:!0,type:String,converter:C,reflect:!1,useDefault:!1,hasChanged:E};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;class k 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=A){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){let i=Symbol(),s=this.getPropertyDescriptor(e,i,t);void 0!==s&&_(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){let{get:s,set:n}=v(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){let o=s?.call(this);n?.call(this,t),this.requestUpdate(e,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??A}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=g(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...m(e),...f(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,i]of t)this.elementProperties.set(e,i)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let i of new Set(e.flat(1/0).reverse()))t.unshift(u(i));else void 0!==e&&t.push(u(e));return t}static _$Eu(e,t){let i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"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_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return c(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,i){this._$AK(e,i)}_$ET(e,t){let i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(void 0!==s&&!0===i.reflect){let n=(void 0!==i.converter?.toAttribute?i.converter:C).toAttribute(t,i.type);this._$Em=e,null==n?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){let i=this.constructor,s=i._$Eh.get(e);if(void 0!==s&&this._$Em!==s){let e=i.getPropertyOptions(s),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:C;this._$Em=s;let o=n.fromAttribute(t,e.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(e,t,i){if(void 0!==e){let s=this.constructor,n=this[e];if(!(((i??=s.getPropertyOptions(e)).hasChanged??E)(n,t)||i.useDefault&&i.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:n},o){i&&!(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||i||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let 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(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,i]of e){let{wrapped:e}=i,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,i,s)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(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){}}k.elementStyles=[],k.shadowRootOptions={mode:"open"},k.elementProperties=new Map,k.finalized=new Map,x?.({ReactiveElement:k}),(b.reactiveElementVersions??=[]).push("2.1.1");let O=globalThis,S=O.trustedTypes,T=S?S.createPolicy("lit-html",{createHTML:e=>e}):void 0,$="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,N="?"+M,L=`<${N}>`,P=document,I=()=>P.createComment(""),R=e=>null===e||"object"!=typeof e&&"function"!=typeof e,D=Array.isArray,B="[ \n\f\r]",j=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,U=/>/g,z=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
2
- \f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,K=/"/g,V=/^(?:script|style|textarea|title)$/i,W=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),q=W(1),G=(W(2),W(3),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),Z=new WeakMap,Y=P.createTreeWalker(P,129);function Q(e,t){if(!D(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==T?T.createHTML(t):t}class J{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let n=0,o=0;const r=e.length-1,a=this.parts,[l,d]=((e,t)=>{let i=e.length-1,s=[],n,o=2===t?"<svg>":3===t?"<math>":"",r=j;for(let t=0;t<i;t++){let i=e[t],a,l,d=-1,h=0;for(;h<i.length&&(r.lastIndex=h,null!==(l=r.exec(i)));)h=r.lastIndex,r===j?"!--"===l[1]?r=F:void 0!==l[1]?r=U:void 0!==l[2]?(V.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=z):void 0!==l[3]&&(r=z):r===z?">"===l[0]?(r=n??j,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?z:'"'===l[3]?K:H):r===K||r===H?r=z:r===F||r===U?r=j:(r=z,n=void 0);let c=r===z&&e[t+1].startsWith("/>")?" ":"";o+=r===j?i+L:d>=0?(s.push(a),i.slice(0,d)+$+i.slice(d)+M+c):i+M+(-2===d?t:c)}return[Q(e,o+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]})(e,t);if(this.el=J.createElement(l,i),Y.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=Y.nextNode())&&a.length<r;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith($)){const t=d[o++],i=s.getAttribute(e).split(M),r=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?en:"?"===r[1]?eo:"@"===r[1]?er:es}),s.removeAttribute(e)}else e.startsWith(M)&&(a.push({type:6,index:n}),s.removeAttribute(e));if(V.test(s.tagName)){const e=s.textContent.split(M),t=e.length-1;if(t>0){s.textContent=S?S.emptyScript:"";for(let i=0;i<t;i++)s.append(e[i],I()),Y.nextNode(),a.push({type:2,index:++n});s.append(e[t],I())}}}else if(8===s.nodeType)if(s.data===N)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=s.data.indexOf(M,e+1));)a.push({type:7,index:n}),e+=M.length-1}n++}}static createElement(e,t){let i=P.createElement("template");return i.innerHTML=e,i}}function ee(e,t,i=e,s){if(t===G)return t;let n=void 0!==s?i._$Co?.[s]:i._$Cl,o=R(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(e))._$AT(e,i,s),void 0!==s?(i._$Co??=[])[s]=n:i._$Cl=n),void 0!==n&&(t=ee(e,n._$AS(e,t.values),n,s)),t}class et{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){let{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??P).importNode(t,!0);Y.currentNode=s;let n=Y.nextNode(),o=0,r=0,a=i[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new ei(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new ea(n,this,e)),this._$AV.push(t),a=i[++r]}o!==a?.index&&(n=Y.nextNode(),o++)}return Y.currentNode=P,s}p(e){let t=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class ei{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,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){let i;R(e=ee(this,e,t))?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==G&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):D(i=e)||"function"==typeof i?.[Symbol.iterator]?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!==X&&R(this._$AH)?this._$AA.nextSibling.data=e:this.T(P.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,s="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=J.createElement(Q(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let e=new et(s,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=Z.get(e.strings);return void 0===t&&Z.set(e.strings,t=new J(e)),t}k(e){D(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,s=0;for(let n of e)s===t.length?t.push(i=new ei(this.O(I()),this.O(I()),this,this.options)):i=t[s],i._$AI(n),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class es{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,n){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=X}_$AI(e,t=this,i,s){let n=this.strings,o=!1;if(void 0===n)(o=!R(e=ee(this,e,t,0))||e!==this._$AH&&e!==G)&&(this._$AH=e);else{let s,r,a=e;for(e=n[0],s=0;s<n.length-1;s++)(r=ee(this,a[i+s],t,s))===G&&(r=this._$AH[s]),o||=!R(r)||r!==this._$AH[s],r===X?e=X:e!==X&&(e+=(r??"")+n[s+1]),this._$AH[s]=r}o&&!s&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class en extends es{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class eo extends es{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class er extends es{constructor(e,t,i,s,n){super(e,t,i,s,n),this.type=5}_$AI(e,t=this){if((e=ee(this,e,t,0)??X)===G)return;let i=this._$AH,s=e===X&&i!==X||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==X&&(i===X||s);s&&this.element.removeEventListener(this.name,this,i),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 ea{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}let el=O.litHtmlPolyfillSupport;el?.(J,ei),(O.litHtmlVersions??=[]).push("3.3.1");let ed=(e,t,i)=>{let s=i?.renderBefore??t,n=s._$litPart$;if(void 0===n){let e=i?.renderBefore??null;s._$litPart$=n=new ei(t.insertBefore(I(),e),e,void 0,i??{})}return n._$AI(e),n},eh=globalThis;class ec extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ed(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return G}}ec._$litElement$=!0,ec.finalized=!0,eh.litElementHydrateSupport?.({LitElement:ec});let eu=eh.litElementPolyfillSupport;eu?.({LitElement:ec}),(eh.litElementVersions??=[]).push("4.2.1");let ep=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},e_={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:E};function ev(e){return(t,i)=>{let s;return"object"==typeof i?((e=e_,t,i)=>{let{kind:s,metadata:n}=i,o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===s&&((e=Object.create(e)).wrapped=!0),o.set(i.name,e),"accessor"===s){let{name:s}=i;return{set(i){let n=t.get.call(this);t.set.call(this,i),this.requestUpdate(s,n,e)},init(t){return void 0!==t&&this.C(s,void 0,e,t),t}}}if("setter"===s){let{name:s}=i;return function(i){let n=this[s];t.call(this,i),this.requestUpdate(s,n,e)}}throw Error("Unsupported decorator location: "+s)})(e,t,i):(s=t.hasOwnProperty(i),t.constructor.createProperty(i,e),s?Object.getOwnPropertyDescriptor(t,i):void 0)}}let em=(e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i);function ef(t){return(i,s)=>em(i,s,{get(){return(this.renderRoot??(e??=document.createDocumentFragment())).querySelectorAll(t)}})}function eg(e){return(t,i)=>{let{slot:s,selector:n}=e??{},o="slot"+(s?`[name=${s}]`:":not([name])");return em(t,i,{get(){let t=this.renderRoot?.querySelector(o),i=t?.assignedElements(e)??[];return void 0===n?i:i.filter(e=>e.matches(n))}})}}function*eb(e,t){if(void 0!==e){let i=0;for(let s of e)yield t(s,i++)}}var ey,ew,ex,eC,eE=n(954);function eA(e,t,i=[]){console.debug(`Moving nodes '${e.map(e=>e.label).join(", ")}' into group '${null==t?void 0:t.label}'. Tree nodes are`,t);let s=function i(s){return s.map(s=>{if(e.some(e=>s.id===e.id))return console.debug("Removed the node from original position."),null;let n=Object.assign({},s);return n.children&&(n.children=i(n.children).filter(e=>null!==e)),t&&s.id===(null==t?void 0:t.id)&&e.forEach(e=>{n.children=n.children?[...n.children,e]:[e]}),n}).filter(e=>null!==e)}(i);return t||s.push(...e),s}(ey=ex||(ex={})).LEAF="leaf",ey.SINGLE="single",ey.MULTI="multi",(ew=eC||(eC={})).A_TO_Z="a_to_z",ew.Z_TO_A="z_to_a";class ek extends CustomEvent{constructor(e){super(ek.NAME,{bubbles:!0,composed:!0,detail:e})}}ek.NAME="or-tree-select";class eO extends CustomEvent{constructor(e,t,i=[]){super(eO.NAME,{bubbles:!0,composed:!0,cancelable:!0,detail:{nodes:e,groupNode:t,newNodes:i}})}}eO.NAME="or-tree-drag",window.Vaadin||={},window.Vaadin.featureFlags||={};let eS={};function eT(e,t="25.1.4"){if(Object.defineProperty(e,"version",{get:()=>t}),e.experimental){let t="string"==typeof e.experimental?e.experimental:`${e.is.split("-").slice(1).join("-").replace(/-[a-z]/gu,e=>e[1].toUpperCase())}Component`;if(window.Vaadin.featureFlags[t]||eS[t]){if(eS[t])return void eS[t].add(e)}else{eS[t]=new Set,eS[t].add(e),Object.defineProperty(window.Vaadin.featureFlags,t,{get:()=>0===eS[t].size,set(e){e&&eS[t].size>0&&(eS[t].forEach(e=>{customElements.define(e.is,e)}),eS[t].clear())}});return}}let i=customElements.get(e.is);if(i){let t=i.version;t&&e.version&&t===e.version?console.warn(`The component ${e.is} has been loaded twice`):console.error(`Tried to define ${e.is} version ${e.version} when version ${i.version} is already in use. Something will probably break.`)}else customElements.define(e.is,e)}let e$=[];function eM(e,t,i=e.getAttribute("dir")){t?e.setAttribute("dir",t):null!=i&&e.removeAttribute("dir")}function eN(){return document.documentElement.getAttribute("dir")}new MutationObserver(function(){let e=eN();e$.forEach(t=>{eM(t,e)})}).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});let eL=e=>class extends e{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:e=>e||"",toAttribute:e=>""===e?null:e}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),(!this.hasAttribute("dir")||this.__restoreSubscription)&&(this.__subscribe(),eM(this,eN(),null))}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),"dir"!==e)return;let s=eN(),n=i===s&&-1===e$.indexOf(this),o=!i&&t&&-1===e$.indexOf(this),r=i!==s&&t===s;n||o?(this.__subscribe(),eM(this,s,i)):r&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=e$.includes(this),this.__unsubscribe()}_valueToNodeAttribute(e,t,i){("dir"!==i||""!==t||e.hasAttribute("dir"))&&super._valueToNodeAttribute(e,t,i)}_attributeToProperty(e,t,i){"dir"!==e||t?super._attributeToProperty(e,t,i):this.dir=""}__subscribe(){e$.includes(this)||e$.push(this)}__unsubscribe(){e$.includes(this)&&e$.splice(e$.indexOf(this),1)}},eP=new WeakMap;function eI(e){return t=>{if(function(e,t){let i=t;for(;i;){if(eP.get(i)===e)return!0;i=Object.getPrototypeOf(i)}return!1}(e,t))return t;let i=e(t);return eP.set(i,e),i}}let eR={},eD=/([A-Z])/gu;function eB(e){return eR[e]||(eR[e]=e.replace(eD,"-$1").toLowerCase()),eR[e]}function ej(e){return e[0].toUpperCase()+e.substring(1)}function eF(e){let[t,i]=e.split("(");return{method:t,observerProps:i.replace(")","").split(",").map(e=>e.trim())}}function eU(e,t){return Object.prototype.hasOwnProperty.call(e,t)||(e[t]=new Map(e[t])),e[t]}let ez=eI(e=>class extends e{static enabledWarnings=[];static createProperty(e,t){[String,Boolean,Number,Array].includes(t)&&(t={type:t}),t&&t.reflectToAttribute&&(t.reflect=!0),super.createProperty(e,t)}static getOrCreateMap(e){return eU(this,e)}static finalize(){if(window.litIssuedWarnings&&(window.litIssuedWarnings.add("no-override-create-property"),window.litIssuedWarnings.add("no-override-get-property-descriptor")),super.finalize(),Array.isArray(this.observers)){let e=this.getOrCreateMap("__complexObservers");this.observers.forEach(t=>{let{method:i,observerProps:s}=eF(t);e.set(i,s)})}}static addCheckedInitializer(e){super.addInitializer(t=>{t instanceof this&&e(t)})}static getPropertyDescriptor(e,t,i){let s=super.getPropertyDescriptor(e,t,i),n=s;if(this.getOrCreateMap("__propKeys").set(e,t),i.sync&&(n={get:s.get,set(s){let n=this[e];E(s,n)&&(this[t]=s,this.requestUpdate(e,n,i),this.hasUpdated&&this.performUpdate())},configurable:!0,enumerable:!0}),i.readOnly){let t=n.set;this.addCheckedInitializer(i=>{i[`_set${ej(e)}`]=function(e){t.call(i,e)}}),n={get:n.get,set(){},configurable:!0,enumerable:!0}}if("value"in i&&this.addCheckedInitializer(t=>{let s="function"==typeof i.value?i.value.call(t):i.value;i.readOnly?t[`_set${ej(e)}`](s):t[e]=s}),i.observer){let t=i.observer;this.getOrCreateMap("__observers").set(e,t),this.addCheckedInitializer(e=>{e[t]||console.warn(`observer method ${t} not defined`)})}if(i.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){let e=this.__notifyProps;this.__notifyProps=new Set(e)}}else this.__notifyProps=new Set;this.__notifyProps.add(e)}if(i.computed){let t=`__assignComputed${e}`,s=eF(i.computed);this.prototype[t]=function(...t){this[e]=this[s.method](...t)},this.getOrCreateMap("__computedObservers").set(t,s.observerProps)}return i.attribute||(i.attribute=eB(e)),n}static get polylitConfig(){return{asyncFirstRender:!1}}connectedCallback(){super.connectedCallback();let{polylitConfig:e}=this.constructor;this.hasUpdated||e.asyncFirstRender||this.performUpdate()}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach(e=>{this.$[e.id]=e})}ready(){}willUpdate(e){this.constructor.__computedObservers&&this.__runComplexObservers(e,this.constructor.__computedObservers)}updated(e){let t=this.__isReadyInvoked;this.__isReadyInvoked=!0,this.constructor.__observers&&this.__runObservers(e,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(e,this.constructor.__complexObservers),this.__dynamicPropertyObservers&&this.__runDynamicObservers(e,this.__dynamicPropertyObservers),this.__dynamicMethodObservers&&this.__runComplexObservers(e,this.__dynamicMethodObservers),this.constructor.__notifyProps&&this.__runNotifyProps(e,this.constructor.__notifyProps),t||this.ready()}setProperties(e){Object.entries(e).forEach(([e,t])=>{let i=this.constructor.__propKeys.get(e),s=this[i];this[i]=t,this.requestUpdate(e,s)}),this.hasUpdated&&this.performUpdate()}_createMethodObserver(e){let t=eU(this,"__dynamicMethodObservers"),{method:i,observerProps:s}=eF(e);t.set(i,s)}_createPropertyObserver(e,t){eU(this,"__dynamicPropertyObservers").set(t,e)}__runComplexObservers(e,t){t.forEach((t,i)=>{t.some(t=>e.has(t))&&(this[i]?this[i](...t.map(e=>this[e])):console.warn(`observer method ${i} not defined`))})}__runDynamicObservers(e,t){t.forEach((t,i)=>{e.has(t)&&this[i]&&this[i](this[t],e.get(t))})}__runObservers(e,t){e.forEach((e,i)=>{let s=t.get(i);void 0!==s&&this[s]&&this[s](this[i],e)})}__runNotifyProps(e,t){e.forEach((e,i)=>{t.has(i)&&this.dispatchEvent(new CustomEvent(`${eB(i)}-changed`,{detail:{value:this[i]}}))})}_get(e,t){return e.split(".").reduce((e,t)=>e?e[t]:void 0,t)}_set(e,t,i){let s,n;n=(s=e.split(".")).pop(),s.reduce((e,t)=>e[t],i)[n]=t}}),eH=0,eK=0,eV=[],eW=!1,eq={after:e=>({run:t=>window.setTimeout(t,e),cancel(e){window.clearTimeout(e)}}),run:(e,t)=>window.setTimeout(e,t),cancel(e){window.clearTimeout(e)}},eG={run:e=>window.requestIdleCallback?window.requestIdleCallback(e):window.setTimeout(e,16),cancel(e){window.cancelIdleCallback?window.cancelIdleCallback(e):window.clearTimeout(e)}},eX={run(e){eW||(eW=!0,queueMicrotask(()=>(function(){eW=!1;let e=eV.length;for(let t=0;t<e;t++){let e=eV[t];if(e)try{e()}catch(e){setTimeout(()=>{throw e})}}eV.splice(0,e),eK+=e})())),eV.push(e);let t=eH;return eH+=1,t},cancel(e){let t=e-eK;if(t>=0){if(!eV[t])throw Error(`invalid async handle: ${e}`);eV[t]=null}}},eZ="string"==typeof document.head.style.touchAction,eY="__polymerGestures",eQ="__polymerGesturesHandled",eJ="__polymerGesturesTouchAction",e0=["mousedown","mousemove","mouseup","click"],e1=[0,1,4,2],e2=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}();function e5(e){return e0.indexOf(e)>-1}let e4=!1;try{let e=Object.defineProperty({},"passive",{get(){e4=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}let e7=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/u),e3={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function e8(e){let t=e.type;if(!e5(t))return!1;if("mousemove"===t){let t=void 0===e.buttons?1:e.buttons;return e instanceof window.MouseEvent&&!e2&&(t=e1[e.which]||0),!!(1&t)}return 0===(void 0===e.button?0:e.button)}let e6={x:0,y:0,id:-1,scrollDecided:!1};function e9(e,t,i){e.movefn=t,e.upfn=i,document.addEventListener("mousemove",t),document.addEventListener("mouseup",i)}function te(e){document.removeEventListener("mousemove",e.movefn),document.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}let tt=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:e=>e.composedPath&&e.composedPath()||[],ti={},ts=[];function tn(e,t){let i=document.elementFromPoint(e,t),s=i;for(;s&&s.shadowRoot&&!window.ShadyDOM&&s!==(s=s.shadowRoot.elementFromPoint(e,t));)s&&(i=s);return i}function to(e){let t=tt(e);return t.length>0?t[0]:e.target}function tr(e){let t=e.type,i=e.currentTarget[eY];if(!i)return;let s=i[t];if(!s)return;if(!e[eQ]&&(e[eQ]={},t.startsWith("touch"))){let i=e.changedTouches[0];if("touchstart"===t&&1===e.touches.length&&(e6.id=i.identifier),e6.id!==i.identifier)return;eZ||"touchstart"!==t&&"touchmove"!==t||function(e){let t=e.changedTouches[0],i=e.type;if("touchstart"===i)e6.x=t.clientX,e6.y=t.clientY,e6.scrollDecided=!1;else if("touchmove"===i){if(e6.scrollDecided)return;e6.scrollDecided=!0;let i=function(e){let t="auto",i=tt(e);for(let e=0,s;e<i.length;e++)if((s=i[e])[eJ]){t=s[eJ];break}return t}(e),s=!1,n=Math.abs(e6.x-t.clientX),o=Math.abs(e6.y-t.clientY);e.cancelable&&("none"===i?s=!0:"pan-x"===i?s=o>n:"pan-y"===i&&(s=n>o)),s?e.preventDefault():th("track")}}(e)}let n=e[eQ];if(!n.skip){for(let t=0,i;t<ts.length;t++)s[(i=ts[t]).name]&&!n[i.name]&&i.flow&&i.flow.start.indexOf(e.type)>-1&&i.reset&&i.reset();for(let i=0,o;i<ts.length;i++)s[(o=ts[i]).name]&&!n[o.name]&&(n[o.name]=!0,o[t](e))}}function ta(e,t,i){return!!ti[t]&&(function(e,t,i){var s,n;let o=ti[t],r=o.deps,a=o.name,l=e[eY];l||(e[eY]=l={});for(let t=0,i,s;t<r.length;t++)i=r[t],e7&&e5(i)&&"click"!==i||((s=l[i])||(l[i]=s={_count:0}),0===s._count&&e.addEventListener(i,tr,void e5(i)),s[a]=(s[a]||0)+1,s._count=(s._count||0)+1);e.addEventListener(t,i),o.touchAction&&(s=e,n=o.touchAction,eZ&&s instanceof HTMLElement&&eX.run(()=>{s.style.touchAction=n}),s[eJ]=n)}(e,t,i),!0)}function tl(e){ts.push(e),e.emits.forEach(t=>{ti[t]=e})}function td(e,t,i){let s=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(s.detail=i,e.dispatchEvent(s),s.defaultPrevented){let e=i.preventer||i.sourceEvent;e&&e.preventDefault&&e.preventDefault()}}function th(e){let t=function(e){for(let t=0,i;t<ts.length;t++){i=ts[t];for(let t=0;t<i.emits.length;t++)if(i.emits[t]===e)return i}return null}(e);t.info&&(t.info.prevent=!0)}function tc(e,t,i,s){t&&td(t,e,{x:i.clientX,y:i.clientY,sourceEvent:i,preventer:s,prevent:e=>th(e)})}function tu(e,t,i){if(e.prevent)return!1;if(e.started)return!0;let s=Math.abs(e.x-t),n=Math.abs(e.y-i);return s>=5||n>=5}function tp(e,t,i){if(!t)return;let s=e.moves[e.moves.length-2],n=e.moves[e.moves.length-1],o=n.x-e.x,r=n.y-e.y,a,l=0;s&&(a=n.x-s.x,l=n.y-s.y),td(t,"track",{state:e.state,x:i.clientX,y:i.clientY,dx:o,dy:r,ddx:a,ddy:l,sourceEvent:i,hover:()=>tn(i.clientX,i.clientY)})}function t_(e,t,i){let s=Math.abs(t.clientX-e.x),n=Math.abs(t.clientY-e.y),o=to(i||t);!(!o||e3[o.localName]&&o.hasAttribute("disabled"))&&(isNaN(s)||isNaN(n)||s<=25&&n<=25||function(e){if("click"===e.type){if(0===e.detail)return!0;let t=to(e);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE)return!0;let i=t.getBoundingClientRect(),s=e.pageX,n=e.pageY;return!(s>=i.left&&s<=i.right&&n>=i.top&&n<=i.bottom)}return!1}(t))&&!e.prevent&&td(o,"tap",{x:t.clientX,y:t.clientY,sourceEvent:t,preventer:i})}tl({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset(){te(this.info)},mousedown(e){if(!e8(e))return;let t=to(e),i=this;e9(this.info,e=>{e8(e)||(tc("up",t,e),te(i.info))},e=>{e8(e)&&tc("up",t,e),te(i.info)}),tc("down",t,e)},touchstart(e){tc("down",to(e),e.changedTouches[0],e)},touchend(e){tc("up",to(e),e.changedTouches[0],e)}}),tl({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove(e){this.moves.length>2&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,te(this.info)},mousedown(e){if(!e8(e))return;let t=to(e),i=this,s=e=>{let s=e.clientX,n=e.clientY;tu(i.info,s,n)&&(i.info.state=i.info.started?"mouseup"===e.type?"end":"track":"start","start"===i.info.state&&th("tap"),i.info.addMove({x:s,y:n}),e8(e)||(i.info.state="end",te(i.info)),t&&tp(i.info,t,e),i.info.started=!0)};e9(this.info,s,e=>{i.info.started&&s(e),te(i.info)}),this.info.x=e.clientX,this.info.y=e.clientY},touchstart(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove(e){let t=to(e),i=e.changedTouches[0],s=i.clientX,n=i.clientY;tu(this.info,s,n)&&("start"===this.info.state&&th("tap"),this.info.addMove({x:s,y:n}),tp(this.info,t,i),this.info.state="track",this.info.started=!0)},touchend(e){let t=to(e),i=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),tp(this.info,t,i))}}),tl({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown(e){e8(e)&&(this.info.x=e.clientX,this.info.y=e.clientY)},click(e){e8(e)&&t_(this.info,e)},touchstart(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchend(e){t_(this.info,e.changedTouches[0],e)}});let tv=eI(e=>class extends e{static get properties(){return{disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0,sync:!0}}}_disabledChanged(e){this._setAriaDisabled(e)}_setAriaDisabled(e){e?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}click(){this.disabled||super.click()}}),tm=eI(e=>class extends e{ready(){super.ready(),this.addEventListener("keydown",e=>{this._onKeyDown(e)}),this.addEventListener("keyup",e=>{this._onKeyUp(e)})}_onKeyDown(e){switch(e.key){case"Enter":this._onEnter(e);break;case"Escape":this._onEscape(e)}}_onKeyUp(e){}_onEnter(e){}_onEscape(e){}}),tf=e=>class extends tv(tm(e)){get _activeKeys(){return[" "]}ready(){super.ready(),ta(this,"down",e=>{this._shouldSetActive(e)&&this._setActive(!0)}),ta(this,"up",()=>{this._setActive(!1)})}disconnectedCallback(){super.disconnectedCallback(),this._setActive(!1)}_shouldSetActive(e){return!this.disabled}_onKeyDown(e){super._onKeyDown(e),this._shouldSetActive(e)&&this._activeKeys.includes(e.key)&&(this._setActive(!0),document.addEventListener("keyup",e=>{this._activeKeys.includes(e.key)&&this._setActive(!1)},{once:!0}))}_setActive(e){this.toggleAttribute("active",e)}},tg=!1;function tb(){let e=document.activeElement||document.body;for(;e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function ty(e){let t=e.style;if("hidden"===t.visibility||"none"===t.display)return!0;let i=window.getComputedStyle(e);return"hidden"===i.visibility||"none"===i.display}function tw(e){return e.checkVisibility?!e.checkVisibility({visibilityProperty:!0}):null===e.offsetParent&&0===e.clientWidth&&0===e.clientHeight||ty(e)}function tx(e){return!e.matches('[tabindex="-1"]')&&(e.matches("input, select, textarea, button, object")?e.matches(":not([disabled])"):e.matches("a[href], area[href], iframe, [tabindex], [contentEditable]"))}function tC(e){return e.getRootNode().activeElement===e}window.addEventListener("keydown",()=>{tg=!0},{capture:!0}),window.addEventListener("mousedown",()=>{tg=!1},{capture:!0});let tE=eI(e=>class extends e{get _keyboardActive(){return tg}ready(){this.addEventListener("focusin",e=>{this._shouldSetFocus(e)&&this._setFocused(!0)}),this.addEventListener("focusout",e=>{this._shouldRemoveFocus(e)&&this._setFocused(!1)}),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}focus(e){super.focus(e),e&&!1===e.focusVisible||this.setAttribute("focus-ring","")}_setFocused(e){this.toggleAttribute("focused",e),this.toggleAttribute("focus-ring",e&&this._keyboardActive)}_shouldSetFocus(e){return!0}_shouldRemoveFocus(e){return!0}}),tA=e=>class extends tf(tE(e)){static get properties(){return{_hasVaadinItemMixin:{value:!0},selected:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_selectedChanged",sync:!0},_value:String}}get _activeKeys(){return["Enter"," "]}get value(){return void 0!==this._value?this._value:this.textContent.trim()}set value(e){this._value=e}ready(){super.ready();let e=this.getAttribute("value");null!==e&&(this.value=e)}focus(e){this.disabled||super.focus(e)}_shouldSetActive(e){return!this.disabled&&!("keydown"===e.type&&e.defaultPrevented)}_selectedChanged(e){this.setAttribute("aria-selected",e)}_disabledChanged(e){super._disabledChanged(e),e&&(this.selected=!1,this.blur())}_onKeyDown(e){super._onKeyDown(e),this._activeKeys.includes(e.key)&&!e.defaultPrevented&&(e.preventDefault(),this.click())}};class tk extends EventTarget{#e;#t=new Set;#i;#s=!1;constructor(e){super(),this.#e=e,this.#i=new CSSStyleSheet}#n(e){let{propertyName:t}=e;this.#t.has(t)&&this.dispatchEvent(new CustomEvent("property-changed",{detail:{propertyName:t}}))}observe(e){this.connect(),this.#t.has(e)||(this.#t.add(e),this.#i.replaceSync(`
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ORTranslate"),require("ORCore")):"function"==typeof define&&define.amd?define(["ORTranslate","ORCore"],t):"object"==typeof exports?exports.ORTreeMenu=t(require("ORTranslate"),require("ORCore")):e.ORTreeMenu=t(e.ORTranslate,e.ORCore)}(self,(e,t)=>(()=>{"use strict";var i={954(e){e.exports=t},673(t){t.exports=e}},s={};function n(e){var t=s[e];if(void 0!==t)return t.exports;var o=s[e]={exports:{}};return i[e](o,o.exports,n),o.exports}n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{let e,t,i;n.r(o),n.d(o,{OrTreeSelectEvent:()=>ek,TreeMenuSorting:()=>eC,OrTreeDragEvent:()=>eS,OrTreeGroup:()=>iZ,OrTreeNode:()=>iJ,OrTreeMenu:()=>i2,TreeMenuSelection:()=>ex});let s=globalThis,r=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),l=new WeakMap;class d{constructor(e,t,i){if(this._$cssResult$=!0,i!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(r&&void 0===e){let i=void 0!==t&&1===t.length;i&&(e=l.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&l.set(t,e))}return e}toString(){return this.cssText}}let h=(e,...t)=>new d(1===e.length?e[0]:t.reduce((t,i,s)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[s+1],e[0]),e,a),c=(e,t)=>{if(r)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let i of t){let t=document.createElement("style"),n=s.litNonce;void 0!==n&&t.setAttribute("nonce",n),t.textContent=i.cssText,e.appendChild(t)}},u=r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t,i="";for(let t of e.cssRules)i+=t.cssText;return new d("string"==typeof(t=i)?t:t+"",void 0,a)})(e):e,{is:p,defineProperty:_,getOwnPropertyDescriptor:v,getOwnPropertyNames:m,getOwnPropertySymbols:f,getPrototypeOf:g}=Object,b=globalThis,y=b.trustedTypes,w=y?y.emptyScript:"",x=b.reactiveElementPolyfillSupport,C={toAttribute(e,t){switch(t){case Boolean:e=e?w:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=null!==e;break;case Number:i=null===e?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch(e){i=null}}return i}},E=(e,t)=>!p(e,t),A={attribute:!0,type:String,converter:C,reflect:!1,useDefault:!1,hasChanged:E};Symbol.metadata??=Symbol("metadata"),b.litPropertyMetadata??=new WeakMap;class k 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=A){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){let i=Symbol(),s=this.getPropertyDescriptor(e,i,t);void 0!==s&&_(this.prototype,e,s)}}static getPropertyDescriptor(e,t,i){let{get:s,set:n}=v(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:s,set(t){let o=s?.call(this);n?.call(this,t),this.requestUpdate(e,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??A}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=g(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...m(e),...f(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,i]of t)this.elementProperties.set(e,i)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let i=this._$Eu(e,t);void 0!==i&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let i of new Set(e.flat(1/0).reverse()))t.unshift(u(i));else void 0!==e&&t.push(u(e));return t}static _$Eu(e,t){let i=t.attribute;return!1===i?void 0:"string"==typeof i?i:"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_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return c(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,i){this._$AK(e,i)}_$ET(e,t){let i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(void 0!==s&&!0===i.reflect){let n=(void 0!==i.converter?.toAttribute?i.converter:C).toAttribute(t,i.type);this._$Em=e,null==n?this.removeAttribute(s):this.setAttribute(s,n),this._$Em=null}}_$AK(e,t){let i=this.constructor,s=i._$Eh.get(e);if(void 0!==s&&this._$Em!==s){let e=i.getPropertyOptions(s),n="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:C;this._$Em=s;let o=n.fromAttribute(t,e.type);this[s]=o??this._$Ej?.get(s)??o,this._$Em=null}}requestUpdate(e,t,i){if(void 0!==e){let s=this.constructor,n=this[e];if(!(((i??=s.getPropertyOptions(e)).hasChanged??E)(n,t)||i.useDefault&&i.reflect&&n===this._$Ej?.get(e)&&!this.hasAttribute(s._$Eu(e,i))))return;this.C(e,t,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:i,reflect:s,wrapped:n},o){i&&!(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||i||(t=void 0),this._$AL.set(e,t)),!0===s&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let 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(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,i]of e){let{wrapped:e}=i,s=this[t];!0!==e||this._$AL.has(t)||void 0===s||this.C(t,void 0,i,s)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(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){}}k.elementStyles=[],k.shadowRootOptions={mode:"open"},k.elementProperties=new Map,k.finalized=new Map,x?.({ReactiveElement:k}),(b.reactiveElementVersions??=[]).push("2.1.1");let S=globalThis,O=S.trustedTypes,$=O?O.createPolicy("lit-html",{createHTML:e=>e}):void 0,T="$lit$",M=`lit$${Math.random().toFixed(9).slice(2)}$`,N="?"+M,P=`<${N}>`,L=document,I=()=>L.createComment(""),D=e=>null===e||"object"!=typeof e&&"function"!=typeof e,R=Array.isArray,B="[ \n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,j=/-->/g,U=/>/g,z=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
2
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,V=/"/g,K=/^(?:script|style|textarea|title)$/i,W=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),q=W(1),G=(W(2),W(3),Symbol.for("lit-noChange")),X=Symbol.for("lit-nothing"),Z=new WeakMap,Y=L.createTreeWalker(L,129);function Q(e,t){if(!R(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==$?$.createHTML(t):t}class J{constructor({strings:e,_$litType$:t},i){let s;this.parts=[];let n=0,o=0;const r=e.length-1,a=this.parts,[l,d]=((e,t)=>{let i=e.length-1,s=[],n,o=2===t?"<svg>":3===t?"<math>":"",r=F;for(let t=0;t<i;t++){let i=e[t],a,l,d=-1,h=0;for(;h<i.length&&(r.lastIndex=h,null!==(l=r.exec(i)));)h=r.lastIndex,r===F?"!--"===l[1]?r=j:void 0!==l[1]?r=U:void 0!==l[2]?(K.test(l[2])&&(n=RegExp("</"+l[2],"g")),r=z):void 0!==l[3]&&(r=z):r===z?">"===l[0]?(r=n??F,d=-1):void 0===l[1]?d=-2:(d=r.lastIndex-l[2].length,a=l[1],r=void 0===l[3]?z:'"'===l[3]?V:H):r===V||r===H?r=z:r===j||r===U?r=F:(r=z,n=void 0);let c=r===z&&e[t+1].startsWith("/>")?" ":"";o+=r===F?i+P:d>=0?(s.push(a),i.slice(0,d)+T+i.slice(d)+M+c):i+M+(-2===d?t:c)}return[Q(e,o+(e[i]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),s]})(e,t);if(this.el=J.createElement(l,i),Y.currentNode=this.el.content,2===t||3===t){const e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(s=Y.nextNode())&&a.length<r;){if(1===s.nodeType){if(s.hasAttributes())for(const e of s.getAttributeNames())if(e.endsWith(T)){const t=d[o++],i=s.getAttribute(e).split(M),r=/([.?@])?(.*)/.exec(t);a.push({type:1,index:n,name:r[2],strings:i,ctor:"."===r[1]?en:"?"===r[1]?eo:"@"===r[1]?er:es}),s.removeAttribute(e)}else e.startsWith(M)&&(a.push({type:6,index:n}),s.removeAttribute(e));if(K.test(s.tagName)){const e=s.textContent.split(M),t=e.length-1;if(t>0){s.textContent=O?O.emptyScript:"";for(let i=0;i<t;i++)s.append(e[i],I()),Y.nextNode(),a.push({type:2,index:++n});s.append(e[t],I())}}}else if(8===s.nodeType)if(s.data===N)a.push({type:2,index:n});else{let e=-1;for(;-1!==(e=s.data.indexOf(M,e+1));)a.push({type:7,index:n}),e+=M.length-1}n++}}static createElement(e,t){let i=L.createElement("template");return i.innerHTML=e,i}}function ee(e,t,i=e,s){if(t===G)return t;let n=void 0!==s?i._$Co?.[s]:i._$Cl,o=D(t)?void 0:t._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(e))._$AT(e,i,s),void 0!==s?(i._$Co??=[])[s]=n:i._$Cl=n),void 0!==n&&(t=ee(e,n._$AS(e,t.values),n,s)),t}class et{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){let{el:{content:t},parts:i}=this._$AD,s=(e?.creationScope??L).importNode(t,!0);Y.currentNode=s;let n=Y.nextNode(),o=0,r=0,a=i[0];for(;void 0!==a;){if(o===a.index){let t;2===a.type?t=new ei(n,n.nextSibling,this,e):1===a.type?t=new a.ctor(n,a.name,a.strings,this,e):6===a.type&&(t=new ea(n,this,e)),this._$AV.push(t),a=i[++r]}o!==a?.index&&(n=Y.nextNode(),o++)}return Y.currentNode=L,s}p(e){let t=0;for(let i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(e,i,t),t+=i.strings.length-2):i._$AI(e[t])),t++}}class ei{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,i,s){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,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){let i;D(e=ee(this,e,t))?e===X||null==e||""===e?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==G&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):R(i=e)||"function"==typeof i?.[Symbol.iterator]?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!==X&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(L.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:i}=e,s="number"==typeof i?this._$AC(e):(void 0===i.el&&(i.el=J.createElement(Q(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(t);else{let e=new et(s,this),i=e.u(this.options);e.p(t),this.T(i),this._$AH=e}}_$AC(e){let t=Z.get(e.strings);return void 0===t&&Z.set(e.strings,t=new J(e)),t}k(e){R(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,i,s=0;for(let n of e)s===t.length?t.push(i=new ei(this.O(I()),this.O(I()),this,this.options)):i=t[s],i._$AI(n),s++;s<t.length&&(this._$AR(i&&i._$AB.nextSibling,s),t.length=s)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class es{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,i,s,n){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=s,this.options=n,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=X}_$AI(e,t=this,i,s){let n=this.strings,o=!1;if(void 0===n)(o=!D(e=ee(this,e,t,0))||e!==this._$AH&&e!==G)&&(this._$AH=e);else{let s,r,a=e;for(e=n[0],s=0;s<n.length-1;s++)(r=ee(this,a[i+s],t,s))===G&&(r=this._$AH[s]),o||=!D(r)||r!==this._$AH[s],r===X?e=X:e!==X&&(e+=(r??"")+n[s+1]),this._$AH[s]=r}o&&!s&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class en extends es{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}}class eo extends es{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}}class er extends es{constructor(e,t,i,s,n){super(e,t,i,s,n),this.type=5}_$AI(e,t=this){if((e=ee(this,e,t,0)??X)===G)return;let i=this._$AH,s=e===X&&i!==X||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==X&&(i===X||s);s&&this.element.removeEventListener(this.name,this,i),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 ea{constructor(e,t,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){ee(this,e)}}let el=S.litHtmlPolyfillSupport;el?.(J,ei),(S.litHtmlVersions??=[]).push("3.3.1");let ed=(e,t,i)=>{let s=i?.renderBefore??t,n=s._$litPart$;if(void 0===n){let e=i?.renderBefore??null;s._$litPart$=n=new ei(t.insertBefore(I(),e),e,void 0,i??{})}return n._$AI(e),n},eh=globalThis;class ec extends k{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=ed(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return G}}ec._$litElement$=!0,ec.finalized=!0,eh.litElementHydrateSupport?.({LitElement:ec});let eu=eh.litElementPolyfillSupport;eu?.({LitElement:ec}),(eh.litElementVersions??=[]).push("4.2.1");let ep=e=>(t,i)=>{void 0!==i?i.addInitializer(()=>{customElements.define(e,t)}):customElements.define(e,t)},e_={attribute:!0,type:String,converter:C,reflect:!1,hasChanged:E};function ev(e){return(t,i)=>{let s;return"object"==typeof i?((e=e_,t,i)=>{let{kind:s,metadata:n}=i,o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===s&&((e=Object.create(e)).wrapped=!0),o.set(i.name,e),"accessor"===s){let{name:s}=i;return{set(i){let n=t.get.call(this);t.set.call(this,i),this.requestUpdate(s,n,e)},init(t){return void 0!==t&&this.C(s,void 0,e,t),t}}}if("setter"===s){let{name:s}=i;return function(i){let n=this[s];t.call(this,i),this.requestUpdate(s,n,e)}}throw Error("Unsupported decorator location: "+s)})(e,t,i):(s=t.hasOwnProperty(i),t.constructor.createProperty(i,e),s?Object.getOwnPropertyDescriptor(t,i):void 0)}}let em=(e,t,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof t&&Object.defineProperty(e,t,i),i);function ef(t){return(i,s)=>em(i,s,{get(){return(this.renderRoot??(e??=document.createDocumentFragment())).querySelectorAll(t)}})}function eg(e){return(t,i)=>{let{slot:s,selector:n}=e??{},o="slot"+(s?`[name=${s}]`:":not([name])");return em(t,i,{get(){let t=this.renderRoot?.querySelector(o),i=t?.assignedElements(e)??[];return void 0===n?i:i.filter(e=>e.matches(n))}})}}function*eb(e,t){if(void 0!==e){let i=0;for(let s of e)yield t(s,i++)}}var ey,ew,ex,eC,eE=n(954);function eA(e,t,i=[]){console.debug(`Moving nodes '${e.map(e=>e.label).join(", ")}' into group '${null==t?void 0:t.label}'. Tree nodes are`,t);let s=function i(s){return s.map(s=>{if(e.some(e=>s.id===e.id))return console.debug("Removed the node from original position."),null;let n=Object.assign({},s);return n.children&&(n.children=i(n.children).filter(e=>null!==e)),t&&s.id===(null==t?void 0:t.id)&&e.forEach(e=>{n.children=n.children?[...n.children,e]:[e]}),n}).filter(e=>null!==e)}(i);return t||s.push(...e),s}(ey=ex||(ex={})).LEAF="leaf",ey.SINGLE="single",ey.MULTI="multi",(ew=eC||(eC={})).A_TO_Z="a_to_z",ew.Z_TO_A="z_to_a";class ek extends CustomEvent{constructor(e){super(ek.NAME,{bubbles:!0,composed:!0,detail:e})}}ek.NAME="or-tree-select";class eS extends CustomEvent{constructor(e,t,i=[]){super(eS.NAME,{bubbles:!0,composed:!0,cancelable:!0,detail:{nodes:e,groupNode:t,newNodes:i}})}}eS.NAME="or-tree-drag",window.Vaadin||={},window.Vaadin.featureFlags||={};let eO={};function e$(e,t="25.2.1"){if(Object.defineProperty(e,"version",{get:()=>t}),e.experimental){let t="string"==typeof e.experimental?e.experimental:`${e.is.split("-").slice(1).join("-").replace(/-[a-z]/gu,e=>e[1].toUpperCase())}Component`;if(window.Vaadin.featureFlags[t]||eO[t]){if(eO[t])return void eO[t].add(e)}else{eO[t]=new Set,eO[t].add(e),Object.defineProperty(window.Vaadin.featureFlags,t,{get:()=>0===eO[t].size,set(e){e&&eO[t].size>0&&(eO[t].forEach(e=>{customElements.define(e.is,e)}),eO[t].clear())}});return}}let i=customElements.get(e.is);if(i){let t=i.version;t&&e.version&&t===e.version?console.warn(`The component ${e.is} has been loaded twice`):console.error(`Tried to define ${e.is} version ${e.version} when version ${i.version} is already in use. Something will probably break.`)}else customElements.define(e.is,e)}let eT=[];function eM(e,t,i=e.getAttribute("dir")){t?e.setAttribute("dir",t):null!=i&&e.removeAttribute("dir")}function eN(){return document.documentElement.getAttribute("dir")}new MutationObserver(function(){let e=eN();eT.forEach(t=>{eM(t,e)})}).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});let eP=e=>class extends e{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:e=>e||"",toAttribute:e=>""===e?null:e}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),(!this.hasAttribute("dir")||this.__restoreSubscription)&&(this.__subscribe(),eM(this,eN(),null))}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),"dir"!==e)return;let s=eN(),n=i===s&&-1===eT.indexOf(this),o=!i&&t&&-1===eT.indexOf(this),r=i!==s&&t===s;n||o?(this.__subscribe(),eM(this,s,i)):r&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=eT.includes(this),this.__unsubscribe()}_valueToNodeAttribute(e,t,i){("dir"!==i||""!==t||e.hasAttribute("dir"))&&super._valueToNodeAttribute(e,t,i)}_attributeToProperty(e,t,i){"dir"!==e||t?super._attributeToProperty(e,t,i):this.dir=""}__subscribe(){eT.includes(this)||eT.push(this)}__unsubscribe(){eT.includes(this)&&eT.splice(eT.indexOf(this),1)}},eL=new WeakMap;function eI(e){return t=>{if(function(e,t){let i=t;for(;i;){if(eL.get(i)===e)return!0;i=Object.getPrototypeOf(i)}return!1}(e,t))return t;let i=e(t);return eL.set(i,e),i}}let eD={},eR=/([A-Z])/gu;function eB(e){return eD[e]||(eD[e]=e.replace(eR,"-$1").toLowerCase()),eD[e]}function eF(e){return e[0].toUpperCase()+e.substring(1)}function ej(e){let[t,i]=e.split("(");return{method:t,observerProps:i.replace(")","").split(",").map(e=>e.trim())}}function eU(e,t){return Object.prototype.hasOwnProperty.call(e,t)||(e[t]=new Map(e[t])),e[t]}let ez=eI(e=>class extends e{static enabledWarnings=[];static createProperty(e,t){[String,Boolean,Number,Array].includes(t)&&(t={type:t}),t?.reflectToAttribute&&(t.reflect=!0),super.createProperty(e,t)}static getOrCreateMap(e){return eU(this,e)}static finalize(){if(window.litIssuedWarnings&&(window.litIssuedWarnings.add("no-override-create-property"),window.litIssuedWarnings.add("no-override-get-property-descriptor")),super.finalize(),Array.isArray(this.observers)){let e=this.getOrCreateMap("__complexObservers");this.observers.forEach(t=>{let{method:i,observerProps:s}=ej(t);e.set(i,s)})}}static addCheckedInitializer(e){super.addInitializer(t=>{t instanceof this&&e(t)})}static getPropertyDescriptor(e,t,i){let s=super.getPropertyDescriptor(e,t,i),n=s;if(this.getOrCreateMap("__propKeys").set(e,t),i.sync&&(n={get:s.get,set(s){let n=this[e];E(s,n)&&(this[t]=s,this.requestUpdate(e,n,i),this.hasUpdated&&this.performUpdate())},configurable:!0,enumerable:!0}),i.readOnly){let t=n.set;this.addCheckedInitializer(i=>{i[`_set${eF(e)}`]=function(e){t.call(i,e)}}),n={get:n.get,set(){},configurable:!0,enumerable:!0}}if("value"in i&&this.addCheckedInitializer(t=>{let s="function"==typeof i.value?i.value.call(t):i.value;i.readOnly?t[`_set${eF(e)}`](s):t[e]=s}),i.observer){let t=i.observer;this.getOrCreateMap("__observers").set(e,t),this.addCheckedInitializer(e=>{e[t]||console.warn(`observer method ${t} not defined`)})}if(i.notify){if(this.__notifyProps){if(!this.hasOwnProperty("__notifyProps")){let e=this.__notifyProps;this.__notifyProps=new Set(e)}}else this.__notifyProps=new Set;this.__notifyProps.add(e)}if(i.computed){let t=`__assignComputed${e}`,s=ej(i.computed);this.prototype[t]=function(...t){this[e]=this[s.method](...t)},this.getOrCreateMap("__computedObservers").set(t,s.observerProps)}return i.attribute||(i.attribute=eB(e)),n}static get polylitConfig(){return{asyncFirstRender:!1}}connectedCallback(){super.connectedCallback();let{polylitConfig:e}=this.constructor;this.hasUpdated||e.asyncFirstRender||this.performUpdate()}firstUpdated(){super.firstUpdated(),this.$||(this.$={}),this.renderRoot.querySelectorAll("[id]").forEach(e=>{this.$[e.id]=e})}ready(){}willUpdate(e){this.constructor.__computedObservers&&this.__runComplexObservers(e,this.constructor.__computedObservers)}updated(e){let t=this.__isReadyInvoked;this.__isReadyInvoked=!0,this.constructor.__observers&&this.__runObservers(e,this.constructor.__observers),this.constructor.__complexObservers&&this.__runComplexObservers(e,this.constructor.__complexObservers),this.__dynamicPropertyObservers&&this.__runDynamicObservers(e,this.__dynamicPropertyObservers),this.__dynamicMethodObservers&&this.__runComplexObservers(e,this.__dynamicMethodObservers),this.constructor.__notifyProps&&this.__runNotifyProps(e,this.constructor.__notifyProps),t||this.ready()}setProperties(e){Object.entries(e).forEach(([e,t])=>{let i=this.constructor.__propKeys.get(e),s=this[i];this[i]=t,this.requestUpdate(e,s)}),this.hasUpdated&&this.performUpdate()}_createMethodObserver(e){let t=eU(this,"__dynamicMethodObservers"),{method:i,observerProps:s}=ej(e);t.set(i,s)}_createPropertyObserver(e,t){eU(this,"__dynamicPropertyObservers").set(t,e)}__runComplexObservers(e,t){t.forEach((t,i)=>{t.some(t=>e.has(t))&&(this[i]?this[i](...t.map(e=>this[e])):console.warn(`observer method ${i} not defined`))})}__runDynamicObservers(e,t){t.forEach((t,i)=>{e.has(t)&&this[i]&&this[i](this[t],e.get(t))})}__runObservers(e,t){e.forEach((e,i)=>{let s=t.get(i);void 0!==s&&this[s]&&this[s](this[i],e)})}__runNotifyProps(e,t){e.forEach((e,i)=>{t.has(i)&&this.dispatchEvent(new CustomEvent(`${eB(i)}-changed`,{detail:{value:this[i]}}))})}_get(e,t){return e.split(".").reduce((e,t)=>e?e[t]:void 0,t)}_set(e,t,i){let s,n;n=(s=e.split(".")).pop(),s.reduce((e,t)=>e[t],i)[n]=t}}),eH=0,eV=0,eK=[],eW=!1,eq={after:e=>({run:t=>window.setTimeout(t,e),cancel(e){window.clearTimeout(e)}}),run:(e,t)=>window.setTimeout(e,t),cancel(e){window.clearTimeout(e)}},eG={run:e=>window.requestIdleCallback?window.requestIdleCallback(e):window.setTimeout(e,16),cancel(e){window.cancelIdleCallback?window.cancelIdleCallback(e):window.clearTimeout(e)}},eX={run(e){eW||(eW=!0,queueMicrotask(()=>(function(){eW=!1;let e=eK.length;for(let t=0;t<e;t++){let e=eK[t];if(e)try{e()}catch(e){setTimeout(()=>{throw e})}}eK.splice(0,e),eV+=e})())),eK.push(e);let t=eH;return eH+=1,t},cancel(e){let t=e-eV;if(t>=0){if(!eK[t])throw Error(`invalid async handle: ${e}`);eK[t]=null}}},eZ="string"==typeof document.head.style.touchAction,eY="__polymerGestures",eQ="__polymerGesturesHandled",eJ="__polymerGesturesTouchAction",e0=["mousedown","mousemove","mouseup","click"],e1=[0,1,4,2],e2=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(e){return!1}}();function e5(e){return e0.indexOf(e)>-1}let e4=!1;try{let e=Object.defineProperty({},"passive",{get(){e4=!0}});window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(e){}let e8=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/u),e3={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function e7(e){let t=e.type;if(!e5(t))return!1;if("mousemove"===t){let t=e.buttons??1;return e instanceof window.MouseEvent&&!e2&&(t=e1[e.which]||0),!!(1&t)}return 0===(e.button??0)}let e6={x:0,y:0,id:-1,scrollDecided:!1};function e9(e,t,i){e.movefn=t,e.upfn=i,document.addEventListener("mousemove",t),document.addEventListener("mouseup",i)}function te(e){document.removeEventListener("mousemove",e.movefn),document.removeEventListener("mouseup",e.upfn),e.movefn=null,e.upfn=null}let tt=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:e=>e.composedPath&&e.composedPath()||[],ti={},ts=[];function tn(e,t){let i=document.elementFromPoint(e,t),s=i;for(;s?.shadowRoot&&!window.ShadyDOM&&s!==(s=s.shadowRoot.elementFromPoint(e,t));)s&&(i=s);return i}function to(e){let t=tt(e);return t.length>0?t[0]:e.target}function tr(e){let t=e.type,i=e.currentTarget[eY];if(!i)return;let s=i[t];if(!s)return;if(!e[eQ]&&(e[eQ]={},t.startsWith("touch"))){let i=e.changedTouches[0];if("touchstart"===t&&1===e.touches.length&&(e6.id=i.identifier),e6.id!==i.identifier)return;eZ||"touchstart"!==t&&"touchmove"!==t||function(e){let t=e.changedTouches[0],i=e.type;if("touchstart"===i)e6.x=t.clientX,e6.y=t.clientY,e6.scrollDecided=!1;else if("touchmove"===i){if(e6.scrollDecided)return;e6.scrollDecided=!0;let i=function(e){let t="auto",i=tt(e);for(let e=0,s;e<i.length;e++)if((s=i[e])[eJ]){t=s[eJ];break}return t}(e),s=!1,n=Math.abs(e6.x-t.clientX),o=Math.abs(e6.y-t.clientY);e.cancelable&&("none"===i?s=!0:"pan-x"===i?s=o>n:"pan-y"===i&&(s=n>o)),s?e.preventDefault():th("track")}}(e)}let n=e[eQ];if(!n.skip){for(let t=0,i;t<ts.length;t++)s[(i=ts[t]).name]&&!n[i.name]&&i.flow&&i.flow.start.indexOf(e.type)>-1&&i.reset&&i.reset();for(let i=0,o;i<ts.length;i++)s[(o=ts[i]).name]&&!n[o.name]&&(n[o.name]=!0,o[t](e))}}function ta(e,t,i){return!!ti[t]&&(function(e,t,i){var s,n;let o=ti[t],r=o.deps,a=o.name,l=e[eY];l||(e[eY]=l={});for(let t=0,i,s;t<r.length;t++)i=r[t],e8&&e5(i)&&"click"!==i||((s=l[i])||(l[i]=s={_count:0}),0===s._count&&e.addEventListener(i,tr,void e5(i)),s[a]=(s[a]||0)+1,s._count=(s._count||0)+1);e.addEventListener(t,i),o.touchAction&&(s=e,n=o.touchAction,eZ&&s instanceof HTMLElement&&eX.run(()=>{s.style.touchAction=n}),s[eJ]=n)}(e,t,i),!0)}function tl(e){ts.push(e),e.emits.forEach(t=>{ti[t]=e})}function td(e,t,i){let s=new Event(t,{bubbles:!0,cancelable:!0,composed:!0});if(s.detail=i,e.dispatchEvent(s),s.defaultPrevented){let e=i.preventer||i.sourceEvent;e?.preventDefault&&e.preventDefault()}}function th(e){let t=function(e){for(let t=0,i;t<ts.length;t++){i=ts[t];for(let t=0;t<i.emits.length;t++)if(i.emits[t]===e)return i}return null}(e);t.info&&(t.info.prevent=!0)}function tc(e,t,i,s){t&&td(t,e,{x:i.clientX,y:i.clientY,sourceEvent:i,preventer:s,prevent:e=>th(e)})}function tu(e,t,i){if(e.prevent)return!1;if(e.started)return!0;let s=Math.abs(e.x-t),n=Math.abs(e.y-i);return s>=5||n>=5}function tp(e,t,i){if(!t)return;let s=e.moves[e.moves.length-2],n=e.moves[e.moves.length-1],o=n.x-e.x,r=n.y-e.y,a,l=0;s&&(a=n.x-s.x,l=n.y-s.y),td(t,"track",{state:e.state,x:i.clientX,y:i.clientY,dx:o,dy:r,ddx:a,ddy:l,sourceEvent:i,hover:()=>tn(i.clientX,i.clientY)})}function t_(e,t,i){let s=Math.abs(t.clientX-e.x),n=Math.abs(t.clientY-e.y),o=to(i||t);!(!o||e3[o.localName]&&o.hasAttribute("disabled"))&&(isNaN(s)||isNaN(n)||s<=25&&n<=25||function(e){if("click"===e.type){if(0===e.detail)return!0;let t=to(e);if(!t.nodeType||t.nodeType!==Node.ELEMENT_NODE)return!0;let i=t.getBoundingClientRect(),s=e.pageX,n=e.pageY;return!(s>=i.left&&s<=i.right&&n>=i.top&&n<=i.bottom)}return!1}(t))&&!e.prevent&&td(o,"tap",{x:t.clientX,y:t.clientY,sourceEvent:t,preventer:i})}tl({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset(){te(this.info)},mousedown(e){if(!e7(e))return;let t=to(e),i=this;e9(this.info,e=>{e7(e)||(tc("up",t,e),te(i.info))},e=>{e7(e)&&tc("up",t,e),te(i.info)}),tc("down",t,e)},touchstart(e){tc("down",to(e),e.changedTouches[0],e)},touchend(e){tc("up",to(e),e.changedTouches[0],e)}}),tl({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove(e){this.moves.length>2&&this.moves.shift(),this.moves.push(e)},movefn:null,upfn:null,prevent:!1},reset(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,te(this.info)},mousedown(e){if(!e7(e))return;let t=to(e),i=this,s=e=>{let s=e.clientX,n=e.clientY;tu(i.info,s,n)&&(i.info.state=i.info.started?"mouseup"===e.type?"end":"track":"start","start"===i.info.state&&th("tap"),i.info.addMove({x:s,y:n}),e7(e)||(i.info.state="end",te(i.info)),t&&tp(i.info,t,e),i.info.started=!0)};e9(this.info,s,e=>{i.info.started&&s(e),te(i.info)}),this.info.x=e.clientX,this.info.y=e.clientY},touchstart(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchmove(e){let t=to(e),i=e.changedTouches[0],s=i.clientX,n=i.clientY;tu(this.info,s,n)&&("start"===this.info.state&&th("tap"),this.info.addMove({x:s,y:n}),tp(this.info,t,i),this.info.state="track",this.info.started=!0)},touchend(e){let t=to(e),i=e.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),tp(this.info,t,i))}}),tl({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown(e){e7(e)&&(this.info.x=e.clientX,this.info.y=e.clientY)},click(e){e7(e)&&t_(this.info,e)},touchstart(e){let t=e.changedTouches[0];this.info.x=t.clientX,this.info.y=t.clientY},touchend(e){t_(this.info,e.changedTouches[0],e)}});let tv=eI(e=>class extends e{static get properties(){return{disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0,sync:!0}}}_disabledChanged(e){this._setAriaDisabled(e)}_setAriaDisabled(e){e?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}click(){this.disabled||super.click()}}),tm=eI(e=>class extends e{ready(){super.ready(),this.addEventListener("keydown",e=>{this._onKeyDown(e)}),this.addEventListener("keyup",e=>{this._onKeyUp(e)})}_onKeyDown(e){switch(e.key){case"Enter":this._onEnter(e);break;case"Escape":this._onEscape(e)}}_onKeyUp(e){}_onEnter(e){}_onEscape(e){}}),tf=e=>class extends tv(tm(e)){get _activeKeys(){return[" "]}ready(){super.ready(),ta(this,"down",e=>{this._shouldSetActive(e)&&this._setActive(!0)}),ta(this,"up",()=>{this._setActive(!1)})}disconnectedCallback(){super.disconnectedCallback(),this._setActive(!1)}_shouldSetActive(e){return!this.disabled}_onKeyDown(e){super._onKeyDown(e),this._shouldSetActive(e)&&this._activeKeys.includes(e.key)&&(this._setActive(!0),document.addEventListener("keyup",e=>{this._activeKeys.includes(e.key)&&this._setActive(!1)},{once:!0}))}_setActive(e){this.toggleAttribute("active",e)}},tg=!1;function tb(){let e=document.activeElement||document.body;for(;e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function ty(e){let t=e.style;if("hidden"===t.visibility||"none"===t.display)return!0;let i=window.getComputedStyle(e);return"hidden"===i.visibility||"none"===i.display}function tw(e){return e.checkVisibility?!e.checkVisibility({visibilityProperty:!0}):null===e.offsetParent&&0===e.clientWidth&&0===e.clientHeight||ty(e)}function tx(e){return!e.matches('[tabindex="-1"]')&&(e.matches("input, select, textarea, button, object")?e.matches(":not([disabled])"):e.matches("a[href], area[href], iframe, [tabindex], [contentEditable]"))}function tC(e){return e.getRootNode().activeElement===e}window.addEventListener("keydown",()=>{tg=!0},{capture:!0}),window.addEventListener("mousedown",()=>{tg=!1},{capture:!0});let tE=eI(e=>class extends e{get _keyboardActive(){return tg}ready(){this.addEventListener("focusin",e=>{this._shouldSetFocus(e)&&this._setFocused(!0)}),this.addEventListener("focusout",e=>{this._shouldRemoveFocus(e)&&this._setFocused(!1)}),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}focus(e){super.focus(e),e?.focusVisible!==!1&&this.setAttribute("focus-ring","")}_setFocused(e){this.toggleAttribute("focused",e),this.toggleAttribute("focus-ring",e&&this._keyboardActive)}_shouldSetFocus(e){return!0}_shouldRemoveFocus(e){return!0}}),tA=e=>class extends tf(tE(e)){static get properties(){return{_hasVaadinItemMixin:{value:!0},selected:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_selectedChanged",sync:!0},_value:String}}get _activeKeys(){return["Enter"," "]}get value(){return this._value??this.textContent.trim()}set value(e){this._value=e}ready(){super.ready();let e=this.getAttribute("value");null!==e&&(this.value=e),this.__shouldAllowFocusWhenDisabled()&&this.style.setProperty("--_vaadin-item-disabled-pointer-events","auto")}focus(e){(!this.disabled||this.__shouldAllowFocusWhenDisabled())&&super.focus(e)}_shouldSetActive(e){return!this.disabled&&!("keydown"===e.type&&e.defaultPrevented)}_selectedChanged(e){this.setAttribute("aria-selected",e)}_disabledChanged(e){super._disabledChanged(e),e&&(this.selected=!1,this.__shouldAllowFocusWhenDisabled()||this.blur())}_onKeyDown(e){super._onKeyDown(e),this._activeKeys.includes(e.key)&&!e.defaultPrevented&&(e.preventDefault(),this.click())}__shouldAllowFocusWhenDisabled(){return!1}};function tk(e){try{CSS.registerProperty(e)}catch(t){if(t instanceof DOMException&&"InvalidModificationError"===t.name)console.warn(`The CSS property ${e.name} has already been registered.`);else throw t}}class tS extends EventTarget{#e;#t=new Set;#i;#s=!1;constructor(e){super(),this.#e=e,this.#i=new CSSStyleSheet}#n(e){let{propertyName:t}=e;this.#t.has(t)&&this.dispatchEvent(new CustomEvent("property-changed",{detail:{propertyName:t}}))}observe(e){this.connect(),this.#t.has(e)||(this.#t.add(e),this.#i.replaceSync(`
3
3
  :root::before, :host::before {
4
4
  content: '' !important;
5
5
  position: absolute !important;
@@ -9,7 +9,7 @@
9
9
  transition: 1ms allow-discrete step-end !important;
10
10
  transition-property: ${[...this.#t].join(", ")} !important;
11
11
  }
12
- `))}connect(){this.#s||(this.#e.adoptedStyleSheets.unshift(this.#i),this.#o.addEventListener("transitionstart",e=>this.#n(e)),this.#o.addEventListener("transitionend",e=>this.#n(e)),this.#s=!0)}disconnect(){this.#t.clear(),this.#e.adoptedStyleSheets=this.#e.adoptedStyleSheets.filter(e=>e!==this.#i),this.#o.removeEventListener("transitionstart",this.#n),this.#o.removeEventListener("transitionend",this.#n),this.#s=!1}get #o(){return this.#e.documentElement??this.#e.host}static for(e){return e.__cssPropertyObserver||=new tk(e),e.__cssPropertyObserver}}function tO(e){c(e.shadowRoot,function(e){let{baseStyles:t,themeStyles:i,elementStyles:s,lumoInjector:n}=e.constructor,o=e.__lumoStyleSheet;return o&&(t||i)?[...n.includeBaseStyles?t:[],o,...i]:[o,...s].filter(Boolean)}(e))}function tS(e,t){e.__lumoStyleSheet=t,tO(e)}function tT(e){e.__lumoStyleSheet=void 0,tO(e)}let t$=new Set;function tM(e){t$.has(e)||(t$.add(e),console.warn(e))}let tN=new WeakMap;function tL(e){try{return e.media.mediaText}catch{return tM('[LumoInjector] Browser denied to access property "mediaText" for some CSS rules, so they were skipped.'),""}}function tP(e){return`--_lumo-${e.is}-inject`}class tI{#e;#r;#a=new Map;#l=new Map;constructor(e=document){this.#e=e,this.handlePropertyChange=this.handlePropertyChange.bind(this),this.#r=tk.for(e),this.#r.addEventListener("property-changed",this.handlePropertyChange)}disconnect(){this.#r.removeEventListener("property-changed",this.handlePropertyChange),this.#a.clear(),this.#l.values().forEach(e=>e.forEach(tT))}forceUpdate(){for(let e of this.#a.keys())this.#d(e)}componentConnected(e){let{lumoInjector:t}=e.constructor,{is:i}=t;this.#l.set(i,this.#l.get(i)??new Set),this.#l.get(i).add(e);let s=this.#a.get(i);if(s){s.cssRules.length>0&&tS(e,s);return}this.#h(i);let n=tP(t);this.#r.observe(n)}componentDisconnected(e){let{is:t}=e.constructor.lumoInjector;this.#l.get(t)?.delete(e),tT(e)}handlePropertyChange(e){let{propertyName:t}=e.detail,i=t.match(/^--_lumo-(.*)-inject$/u)?.[1];i&&this.#d(i)}#h(e){this.#a.set(e,new CSSStyleSheet),this.#d(e)}#d(e){let{tags:t,modules:i}=function(e){let t=new Map,i=new Map;for(let s of e){let e=tN.get(s);e||(e=function e(t,i={tags:new Map,modules:new Map}){for(let s of function(e){try{return e.cssRules}catch{return tM('[LumoInjector] Browser denied to access property "cssRules" for some CSS stylesheets, so they were skipped.'),[]}}(t)){if(s instanceof CSSImportRule){let t=tL(s);t.startsWith("lumo_")?i.modules.set(t,[...s.styleSheet.cssRules]):e(s.styleSheet,i);continue}if(s instanceof CSSMediaRule){let e=tL(s);e.startsWith("lumo_")&&i.modules.set(e,[...s.cssRules]);continue}if(s instanceof CSSStyleRule&&s.cssText.includes("-inject")){for(let e of s.style){let t=e.match(/^--_lumo-(.*)-inject-modules$/u)?.[1];if(!t)continue;let n=s.style.getPropertyValue(e);i.tags.set(t,n.split(",").map(e=>e.trim().replace(/'|"/gu,"")))}continue}}return i}(s),tN.set(s,e)),t=new Map([...t,...e.tags]),i=new Map([...i,...e.modules])}return{tags:t,modules:i}}(this.#c),s=(t.get(e)??[]).flatMap(e=>i.get(e)??[]).map(e=>e.cssText).join("\n"),n=this.#a.get(e);n.replaceSync(s),this.#l.get(e)?.forEach(e=>{s?tS(e,n):tT(e)})}get #c(){let e=new Set;for(let t of[this.#e,document])e=(e=e.union(new Set(t.styleSheets))).union(new Set(t.adoptedStyleSheets));return[...e]}}let tR=new Set,tD=e=>class extends e{static finalize(){super.finalize();let e=tP(this.lumoInjector);this.is&&!tR.has(e)&&(tR.add(e),CSS.registerProperty({name:e,syntax:"<number>",inherits:!0,initialValue:"0"}))}static get lumoInjector(){return{is:this.is,includeBaseStyles:!1}}connectedCallback(){super.connectedCallback();let e=function e(t){let i=t.getRootNode();return i.host&&i.host.constructor.version?e(i.host):i}(this);!e.__lumoInjectorDisabled&&this.isConnected&&(e.__lumoInjector||=new tI(e),this.__lumoInjector=e.__lumoInjector,this.__lumoInjector.componentConnected(this))}disconnectedCallback(){super.disconnectedCallback(),this.__lumoInjector&&(this.__lumoInjector.componentDisconnected(this),this.__lumoInjector=void 0)}},tB=e=>class extends e{static get properties(){return{_theme:{type:String,readOnly:!0}}}static get observedAttributes(){return[...super.observedAttributes,"theme"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),"theme"===e&&this._set_theme(i)}},tj=[],tF=new Set,tU=new Set,tz=e=>class extends tB(e){constructor(){super(),tF.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&tU.add(this.is),this.elementStyles)return;let e=this.prototype._template;if(!(!e||this&&Object.prototype.hasOwnProperty.call(this,"__themes"))){var t=this.getStylesForThis();let i=document.createElement("style");i.id="vaadin-themable-mixin-style",i.textContent=t.map(e=>e.cssText).join("\n"),e.content.appendChild(i)}}static finalizeStyles(e){return this.baseStyles=e?[e].flat(1/0):[],this.themeStyles=this.getStylesForThis(),[...this.baseStyles,...this.themeStyles]}static getStylesForThis(){var t;let i,s,n=e.__themes||[],o=Object.getPrototypeOf(this.prototype),r=(o?o.constructor.__themes:[])||[];this.__themes=[...n,...r,...(t=this.is,i=`${t}-default-theme`,(s=tj.filter(e=>{var s;return e.moduleId!==i&&(s=e.themeFor,(s||"").split(" ").some(e=>RegExp(`^${e.split("*").join(".*")}$`,"u").test(t)))}).map(e=>({...e,styles:[...function e(t){let i=[];return t.include&&[].concat(t.include).forEach(t=>{let s=tj.find(e=>e.moduleId===t);s?i.push(...e(s),...s.styles):console.warn(`Included moduleId ${t} not found in style registry`)},t.styles),i}(e),...e.styles],includePriority:function(e=""){let t=0;return e.startsWith("lumo-")||e.startsWith("material-")?t=1:e.startsWith("vaadin-")&&(t=2),t}(e.moduleId)})).sort((e,t)=>t.includePriority-e.includePriority)).length>0?s:tj.filter(e=>e.moduleId===i))];let a=this.__themes.flatMap(e=>e.styles);return a.filter((e,t)=>t===a.lastIndexOf(e))}};["--vaadin-text-color","--vaadin-text-color-disabled","--vaadin-text-color-secondary","--vaadin-border-color","--vaadin-border-color-secondary","--vaadin-background-color"].forEach(e=>{CSS.registerProperty({name:e,syntax:"<color>",inherits:!0,initialValue:"transparent"})}),((e,...t)=>{let i=document.createElement("style");i.id=e,i.textContent=t.map(e=>e.toString()).join("\n"),document.head.insertAdjacentElement("afterbegin",i)})("vaadin-base",h`
12
+ `))}connect(){this.#s||(this.#e.adoptedStyleSheets.unshift(this.#i),this.#o.addEventListener("transitionstart",e=>this.#n(e)),this.#o.addEventListener("transitionend",e=>this.#n(e)),this.#s=!0)}disconnect(){this.#t.clear(),this.#e.adoptedStyleSheets=this.#e.adoptedStyleSheets.filter(e=>e!==this.#i),this.#o.removeEventListener("transitionstart",this.#n),this.#o.removeEventListener("transitionend",this.#n),this.#s=!1}get #o(){return this.#e.documentElement??this.#e.host}static for(e){return e.__cssPropertyObserver||=new tS(e),e.__cssPropertyObserver}}function tO(e){c(e.shadowRoot,function(e){let{baseStyles:t,themeStyles:i,elementStyles:s,lumoInjector:n}=e.constructor,o=e.__lumoStyleSheet;return o?[...n.includeBaseStyles?t??s:[],o,...i??[]]:s}(e))}function t$(e,t){e.__lumoStyleSheet=t,tO(e)}function tT(e){e.__lumoStyleSheet=void 0,tO(e)}let tM=new Set;function tN(e){tM.has(e)||(tM.add(e),console.warn(e))}let tP=new WeakMap;function tL(e){try{return e.media.mediaText}catch{return tN('[LumoInjector] Browser denied to access property "mediaText" for some CSS rules, so they were skipped.'),""}}function tI(e){return`--_lumo-${e.is}-inject`}class tD{#e;#r;#a=new Map;#l=new Map;constructor(e=document){this.#e=e,this.handlePropertyChange=this.handlePropertyChange.bind(this),this.#r=tS.for(e),this.#r.addEventListener("property-changed",this.handlePropertyChange)}disconnect(){this.#r.removeEventListener("property-changed",this.handlePropertyChange),this.#a.clear(),this.#l.values().forEach(e=>e.forEach(tT))}forceUpdate(){for(let e of this.#a.keys())this.#d(e)}componentConnected(e){let{lumoInjector:t}=e.constructor,{is:i}=t;this.#l.set(i,this.#l.get(i)??new Set),this.#l.get(i).add(e);let s=this.#a.get(i);if(s){s.cssRules.length>0&&t$(e,s);return}this.#h(i);let n=tI(t);this.#r.observe(n)}componentDisconnected(e){let{is:t}=e.constructor.lumoInjector;this.#l.get(t)?.delete(e),tT(e)}handlePropertyChange(e){let{propertyName:t}=e.detail,i=t.match(/^--_lumo-(.*)-inject$/u)?.[1];i&&this.#d(i)}#h(e){this.#a.set(e,new CSSStyleSheet),this.#d(e)}#d(e){let{tags:t,modules:i}=function(e){let t=new Map,i=new Map;for(let s of e){let e=tP.get(s);e||(e=function e(t,i={tags:new Map,modules:new Map}){for(let s of function(e){try{return e.cssRules}catch{return tN('[LumoInjector] Browser denied to access property "cssRules" for some CSS stylesheets, so they were skipped.'),[]}}(t)){if(s instanceof CSSImportRule){let t=tL(s);t.startsWith("lumo_")?i.modules.set(t,[...s.styleSheet.cssRules]):e(s.styleSheet,i);continue}if(s instanceof CSSMediaRule){let e=tL(s);e.startsWith("lumo_")&&i.modules.set(e,[...s.cssRules]);continue}if(s instanceof CSSStyleRule&&s.cssText.includes("-inject")){for(let e of s.style){let t=e.match(/^--_lumo-(.*)-inject-modules$/u)?.[1];if(!t)continue;let n=s.style.getPropertyValue(e);i.tags.set(t,n.split(",").map(e=>e.trim().replace(/'|"/gu,"")))}continue}}return i}(s),tP.set(s,e)),t=new Map([...t,...e.tags]),i=new Map([...i,...e.modules])}return{tags:t,modules:i}}(this.#c),s=(t.get(e)??[]).flatMap(e=>i.get(e)??[]).map(e=>e.cssText).join("\n"),n=this.#a.get(e);n.replaceSync(s),this.#l.get(e)?.forEach(e=>{s?t$(e,n):tT(e)})}get #c(){let e=new Set;for(let t of[this.#e,document])e=(e=e.union(new Set(t.styleSheets))).union(new Set(t.adoptedStyleSheets));return[...e]}}let tR=new Set,tB=e=>class extends e{static finalize(){super.finalize();let e=tI(this.lumoInjector);this.is&&!tR.has(e)&&(tR.add(e),tk({name:e,syntax:"<number>",inherits:!0,initialValue:"0"}))}static get lumoInjector(){return{is:this.is,includeBaseStyles:!1}}connectedCallback(){super.connectedCallback();let e=function e(t){let i=t.getRootNode();return i.host&&i.host.constructor.version?e(i.host):i}(this);!e.__lumoInjectorDisabled&&this.isConnected&&(e.__lumoInjector||=new tD(e),this.__lumoInjector=e.__lumoInjector,this.__lumoInjector.componentConnected(this))}disconnectedCallback(){super.disconnectedCallback(),this.__lumoInjector&&(this.__lumoInjector.componentDisconnected(this),this.__lumoInjector=void 0)}},tF=e=>class extends e{static get properties(){return{_theme:{type:String,readOnly:!0}}}static get observedAttributes(){return[...super.observedAttributes,"theme"]}attributeChangedCallback(e,t,i){super.attributeChangedCallback(e,t,i),"theme"===e&&this._set_theme(i)}},tj=[],tU=new Set,tz=new Set,tH=e=>class extends tF(e){constructor(){super(),tU.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&tz.add(this.is),this.elementStyles)return;let e=this.prototype._template;if(!(!e||this&&Object.prototype.hasOwnProperty.call(this,"__themes"))){var t=this.getStylesForThis();let i=document.createElement("style");i.id="vaadin-themable-mixin-style",i.textContent=t.map(e=>e.cssText).join("\n"),e.content.appendChild(i)}}static finalizeStyles(e){return this.baseStyles=e?[e].flat(1/0):[],this.themeStyles=this.getStylesForThis(),[...this.baseStyles,...this.themeStyles]}static getStylesForThis(){var t;let i,s,n=e.__themes||[],o=Object.getPrototypeOf(this.prototype),r=(o?o.constructor.__themes:[])||[];this.__themes=[...n,...r,...(t=this.is,i=`${t}-default-theme`,(s=tj.filter(e=>{var s;return e.moduleId!==i&&(s=e.themeFor,(s||"").split(" ").some(e=>RegExp(`^${e.split("*").join(".*")}$`,"u").test(t)))}).map(e=>({...e,styles:[...function e(t){let i=[];return t.include&&[].concat(t.include).forEach(t=>{let s=tj.find(e=>e.moduleId===t);s?i.push(...e(s),...s.styles):console.warn(`Included moduleId ${t} not found in style registry`)},t.styles),i}(e),...e.styles],includePriority:function(e=""){let t=0;return e.startsWith("lumo-")||e.startsWith("material-")?t=1:e.startsWith("vaadin-")&&(t=2),t}(e.moduleId)})).sort((e,t)=>t.includePriority-e.includePriority)).length>0?s:tj.filter(e=>e.moduleId===i))];let a=this.__themes.flatMap(e=>e.styles);return a.filter((e,t)=>t===a.lastIndexOf(e))}};["--vaadin-text-color","--vaadin-text-color-disabled","--vaadin-text-color-secondary","--vaadin-border-color","--vaadin-border-color-secondary","--vaadin-background-color"].forEach(e=>{tk({name:e,syntax:"<color>",inherits:!0,initialValue:"transparent"})}),((e,...t)=>{let i=document.createElement("style");i.id=e,i.textContent=t.map(e=>e.toString()).join("\n"),document.head.insertAdjacentElement("afterbegin",i)})("vaadin-base",h`
13
13
  @layer vaadin.base {
14
14
  html {
15
15
  /* Background color */
@@ -65,9 +65,11 @@
65
65
  --_vaadin-icon-calendar: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 2v4"/><path d="M16 2v4"/><rect width="18" height="18" x="3" y="4" rx="2"/><path d="M3 10h18"/></svg>');
66
66
  --_vaadin-icon-checkmark: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg>');
67
67
  --_vaadin-icon-chevron-down: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m6 9 6 6 6-6"/></svg>');
68
+ --_vaadin-icon-chevron-right: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>');
68
69
  --_vaadin-icon-clock: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 6v6l4 2"/><circle cx="12" cy="12" r="10"/></svg>');
69
70
  --_vaadin-icon-cross: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M6 18 18 6M6 6l12 12" /></svg>');
70
71
  --_vaadin-icon-drag: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M11 7c0 .82843-.6716 1.5-1.5 1.5C8.67157 8.5 8 7.82843 8 7s.67157-1.5 1.5-1.5c.8284 0 1.5.67157 1.5 1.5Zm0 5c0 .8284-.6716 1.5-1.5 1.5-.82843 0-1.5-.6716-1.5-1.5s.67157-1.5 1.5-1.5c.8284 0 1.5.6716 1.5 1.5Zm0 5c0 .8284-.6716 1.5-1.5 1.5-.82843 0-1.5-.6716-1.5-1.5s.67157-1.5 1.5-1.5c.8284 0 1.5.6716 1.5 1.5Zm5-10c0 .82843-.6716 1.5-1.5 1.5S13 7.82843 13 7s.6716-1.5 1.5-1.5S16 6.17157 16 7Zm0 5c0 .8284-.6716 1.5-1.5 1.5S13 12.8284 13 12s.6716-1.5 1.5-1.5 1.5.6716 1.5 1.5Zm0 5c0 .8284-.6716 1.5-1.5 1.5S13 17.8284 13 17s.6716-1.5 1.5-1.5 1.5.6716 1.5 1.5Z" fill="currentColor"/></svg>');
72
+ --_vaadin-icon-ellipsis: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>');
71
73
  --_vaadin-icon-eye: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z" /><path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /></svg>');
72
74
  --_vaadin-icon-eye-slash: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88" /></svg>');
73
75
  --_vaadin-icon-file: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/></svg>');
@@ -83,6 +85,7 @@
83
85
  --_vaadin-icon-redo: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 7v6h-6"/><path d="M3 17a9 9 0 0 1 9-9 9 9 0 0 1 6 2.3l3 2.7"/></svg>');
84
86
  --_vaadin-icon-refresh: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><path d="M22 10C22 10 19.995 7.26822 18.3662 5.63824C16.7373 4.00827 14.4864 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21C16.1031 21 19.5649 18.2543 20.6482 14.5M22 10V4M22 10H16" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>');
85
87
  --_vaadin-icon-resize: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.5303 7.46967c.2929.29289.2929.76777 0 1.06066L8.53033 18.5304c-.29289.2929-.76777.2929-1.06066 0s-.29289-.7678 0-1.0607L17.4697 7.46967c.2929-.29289.7677-.29289 1.0606 0Zm0 4.50003c.2929.2929.2929.7678 0 1.0607l-5.5 5.5c-.2929.2928-.7677.2928-1.0606 0-.2929-.2929-.2929-.7678 0-1.0607l5.4999-5.5c.2929-.2929.7678-.2929 1.0607 0Zm0 4.5c.2929.2928.2929.7677 0 1.0606l-1 1.0001c-.2929.2928-.7677.2929-1.0606 0-.2929-.2929-.2929-.7678 0-1.0607l1-1c.2929-.2929.7677-.2929 1.0606 0Z" fill="currentColor"/></svg>');
88
+ --_vaadin-icon-slash: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"><rect x="13.7812" y="4.22583" width="1.5" height="16" rx="0.75" transform="rotate(20 13.7812 4.22583)" fill="currentColor"/></svg>');
86
89
  --_vaadin-icon-sort: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="8" height="12" viewBox="0 0 8 12" fill="none"><path d="M7.49854 6.99951C7.92795 6.99951 8.15791 7.50528 7.87549 7.82861L4.37646 11.8296C4.17728 12.0571 3.82272 12.0571 3.62354 11.8296L0.125488 7.82861C-0.157248 7.50531 0.0719873 6.99956 0.501465 6.99951H7.49854ZM3.62354 0.17041C3.82275 -0.0573875 4.17725 -0.0573848 4.37646 0.17041L7.87549 4.17041C8.15825 4.49373 7.92806 5.00049 7.49854 5.00049L0.501465 4.99951C0.0719873 4.99946 -0.157248 4.49371 0.125488 4.17041L3.62354 0.17041Z" fill="black"/></svg>');
87
90
  --_vaadin-icon-undo: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 7v6h6"/><path d="M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13"/></svg>');
88
91
  --_vaadin-icon-upload: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 3v12"/><path d="m17 8-5-5-5 5"/><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/></svg>');
@@ -98,6 +101,13 @@
98
101
  --safe-area-inset-right: env(safe-area-inset-right, 0px);
99
102
  --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
100
103
  --safe-area-inset-left: env(safe-area-inset-left, 0px);
104
+ --safe-area-inset-inline-start: var(--safe-area-inset-left);
105
+ --safe-area-inset-inline-end: var(--safe-area-inset-right);
106
+
107
+ &:dir(rtl) {
108
+ --safe-area-inset-inline-start: var(--safe-area-inset-right);
109
+ --safe-area-inset-inline-end: var(--safe-area-inset-left);
110
+ }
101
111
  }
102
112
 
103
113
  @supports not (color: hsl(0 0 0)) {
@@ -119,7 +129,7 @@
119
129
  }
120
130
  }
121
131
  }
122
- `);let tH=[h`
132
+ `);let tV=[h`
123
133
  :host {
124
134
  align-items: center;
125
135
  border-radius: var(--vaadin-item-border-radius, var(--vaadin-radius-m));
@@ -140,7 +150,7 @@
140
150
  :host([disabled]) {
141
151
  cursor: var(--vaadin-disabled-cursor);
142
152
  opacity: 0.5;
143
- pointer-events: none;
153
+ pointer-events: var(--_vaadin-item-disabled-pointer-events, none);
144
154
  }
145
155
 
146
156
  :host([hidden]) {
@@ -199,12 +209,12 @@
199
209
  :host([menu-item-checked]) [part='checkmark'] {
200
210
  visibility: visible;
201
211
  }
202
- `];class tK extends tA(tz(eL(ez(tD(ec))))){static get is(){return"vaadin-menu-bar-item"}static get styles(){return tH}render(){return q`
212
+ `];class tK extends tA(tH(eP(ez(tB(ec))))){static get is(){return"vaadin-menu-bar-item"}static get styles(){return tV}render(){return q`
203
213
  <span part="checkmark" aria-hidden="true"></span>
204
214
  <div part="content">
205
215
  <slot></slot>
206
216
  </div>
207
- `}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menuitem")}}eT(tK);let tV=new Set;class tW{static debounce(e,t,i){return e instanceof tW?e._cancelAsync():e=new tW,e.setConfig(t,i),e}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(e,t){this._asyncModule=e,this._callback=t,this._timer=this._asyncModule.run(()=>{this._timer=null,tV.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),tV.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}}class tq{constructor(e,t,i){this.slot=e,this.callback=t,this.forceInitial=i,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){let e=this.slot.assignedNodes({flatten:!0}),t=[],i=[],s=[];e.length&&(t=e.filter(e=>!this._storedNodes.includes(e))),this._storedNodes.length&&this._storedNodes.forEach((t,n)=>{let o=e.indexOf(t);-1===o?i.push(t):o!==n&&s.push(t)}),(t.length||i.length||s.length||this.forceInitial)&&this.callback({addedNodes:t,currentNodes:e,movedNodes:s,removedNodes:i}),this.forceInitial&&(this.forceInitial=!1),this._storedNodes=e}}let tG=e=>class extends tm(e){get focused(){return(this._getItems()||[]).find(tC)}get _vertical(){return!0}get _tabNavigation(){return!1}focus(e){let t=this._getFocusableIndex();t>=0&&this._focus(t,e)}_getFocusableIndex(){let e=this._getItems();return Array.isArray(e)?this._getAvailableIndex(e,0,null,e=>!tw(e)):-1}_getItems(){return Array.from(this.children)}_onKeyDown(e){let t,i;if(super._onKeyDown(e),e.metaKey||e.ctrlKey)return;let{key:s,shiftKey:n}=e,o=this._getItems()||[],r=o.indexOf(this.focused),a=this._vertical||"rtl"!==this.getAttribute("dir")?1:-1;this.__isPrevKeyPressed(s,n)?(i=-a,t=r-a):this.__isNextKeyPressed(s,n)?(i=a,t=r+a):"Home"===s?(i=1,t=0):"End"===s&&(i=-1,t=o.length-1),t=this._getAvailableIndex(o,t,i,e=>!tw(e)),this._tabNavigation&&"Tab"===s&&(t>r&&e.shiftKey||t<r&&!e.shiftKey||t===r)||t>=0&&(e.preventDefault(),this._focus(t,{focusVisible:!0},!0))}__isPrevKeyPressed(e,t){return this._vertical?"ArrowUp"===e:"ArrowLeft"===e||this._tabNavigation&&"Tab"===e&&t}__isNextKeyPressed(e,t){return this._vertical?"ArrowDown"===e:"ArrowRight"===e||this._tabNavigation&&"Tab"===e&&!t}_focus(e,t,i=!1){let s=this._getItems();this._focusItem(s[e],t,i)}_focusItem(e,t){e&&e.focus(t)}_getAvailableIndex(e,t,i,s){let n=e.length,o=t;for(let t=0;"number"==typeof o&&t<n;t+=1,o+=i||1){o<0?o=n-1:o>=n&&(o=0);let t=e[o];if(this._isItemFocusable(t)&&this.__isMatchingItem(t,s))return o}return -1}__isMatchingItem(e,t){return"function"!=typeof t||t(e)}_isItemFocusable(e){return!e.hasAttribute("disabled")}},tX=e=>class extends tG(e){static get properties(){return{disabled:{type:Boolean,value:!1,reflectToAttribute:!0},selected:{type:Number,reflectToAttribute:!0,notify:!0,sync:!0},orientation:{type:String,reflectToAttribute:!0,value:""},items:{type:Array,readOnly:!0,notify:!0},_searchBuf:{type:String,value:""}}}static get observers(){return["_enhanceItems(items, orientation, selected, disabled)"]}get _isRTL(){return!this._vertical&&"rtl"===this.getAttribute("dir")}get _scrollerElement(){return console.warn(`Please implement the '_scrollerElement' property in <${this.localName}>`),this}get _vertical(){return"horizontal"!==this.orientation}focus(e){this._observer&&this._observer.flush();let t=Array.isArray(this.items)?this.items:[],i=this._getAvailableIndex(t,0,null,e=>0===e.tabIndex&&!tw(e));i>=0?this._focus(i,e):super.focus(e)}ready(){super.ready(),this.addEventListener("click",e=>this._onClick(e));let e=this.shadowRoot.querySelector("slot:not([name])");this._observer=new tq(e,()=>{this._setItems(this._filterItems([...this.children]))})}_getItems(){return this.items}_enhanceItems(e,t,i,s){if(!s&&e){this.setAttribute("aria-orientation",t||"vertical"),e.forEach(e=>{t?e.setAttribute("orientation",t):e.removeAttribute("orientation")}),this._setFocusable(i<0||!i?0:i);let s=e[i];e.forEach(e=>{e.selected=e===s}),s&&!s.disabled&&this._scrollToItem(i)}}_filterItems(e){return e.filter(e=>e._hasVaadinItemMixin)}_onClick(e){let t;if(e.metaKey||e.shiftKey||e.ctrlKey||e.defaultPrevented)return;let i=this._filterItems(e.composedPath())[0];i&&!i.disabled&&(t=this.items.indexOf(i))>=0&&(this.selected=t)}_searchKey(e,t){this._searchReset=tW.debounce(this._searchReset,eq.after(500),()=>{this._searchBuf=""}),this._searchBuf+=t.toLowerCase(),this.items.some(e=>this.__isMatchingKey(e))||(this._searchBuf=t.toLowerCase());let i=1===this._searchBuf.length?e+1:e;return this._getAvailableIndex(this.items,i,1,e=>this.__isMatchingKey(e)&&"none"!==getComputedStyle(e).display)}__isMatchingKey(e){return e.textContent.replace(/[^\p{L}\p{Nd}]/gu,"").toLowerCase().startsWith(this._searchBuf)}_onKeyDown(e){if(e.metaKey||e.ctrlKey)return;let t=e.key,i=this.items.indexOf(this.focused);if(/[\p{L}\p{Nd}]/u.test(t)&&1===t.length){let e=this._searchKey(i,t);e>=0&&this._focus(e);return}super._onKeyDown(e)}_setFocusable(e){e=this._getAvailableIndex(this.items,e,1);let t=this.items[e];this.items.forEach(e=>{e.tabIndex=e===t?0:-1})}_focus(e,t){this.items.forEach((t,i)=>{t.focused=i===e}),this._setFocusable(e),this._scrollToItem(e),super._focus(e,t)}_scrollToItem(e){let t=this.items[e];if(!t)return;let i=this._vertical?["top","bottom"]:this._isRTL?["right","left"]:["left","right"],s=this._scrollerElement.getBoundingClientRect(),n=(this.items[e+1]||t).getBoundingClientRect(),o=(this.items[e-1]||t).getBoundingClientRect(),r=0;!this._isRTL&&n[i[1]]>=s[i[1]]||this._isRTL&&n[i[1]]<=s[i[1]]?r=n[i[1]]-s[i[1]]:(!this._isRTL&&o[i[0]]<=s[i[0]]||this._isRTL&&o[i[0]]>=s[i[0]])&&(r=o[i[0]]-s[i[0]]),this._scroll(r)}_scroll(e){if(this._vertical)this._scrollerElement.scrollTop+=e;else{var t;let i=this.getAttribute("dir")||"ltr",s=function(e,t){let{scrollLeft:i}=e;return"rtl"!==t?i:e.scrollWidth-e.clientWidth+i}(this._scrollerElement,i)+e;t=this._scrollerElement,"rtl"!==i?t.scrollLeft=s:t.scrollLeft=t.clientWidth-t.scrollWidth+s}}},tZ=h`
217
+ `}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menuitem")}__shouldAllowFocusWhenDisabled(){return window.Vaadin.featureFlags.accessibleDisabledMenuItems}}e$(tK);let tW=new Set;class tq{static debounce(e,t,i){return e instanceof tq?e._cancelAsync():e=new tq,e.setConfig(t,i),e}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(e,t){this._asyncModule=e,this._callback=t,this._timer=this._asyncModule.run(()=>{this._timer=null,tW.delete(this),this._callback()})}cancel(){this.isActive()&&(this._cancelAsync(),tW.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}}class tG{constructor(e,t,i){this.target=e,this.callback=t,this.forceInitial=i,this._storedNodes=[],this._isSlot=e instanceof HTMLSlotElement,this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.target.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.target.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask(()=>{this.flush()}))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_collectNodes(){return[...new Set((this._isSlot?[this.target]:[...this.target.querySelectorAll("slot")]).flatMap(e=>e.assignedNodes({flatten:!0})))]}_groupNodesBySlot(e){let t=new Map;return e.forEach(e=>{let i=e.assignedSlot;t.set(i,t.get(i)??[]),t.get(i).push(e)}),t}_collectMovedNodes(e){let t=this._groupNodesBySlot(e),i=this._groupNodesBySlot(this._storedNodes),s=[];return t.forEach((e,t)=>{let n=i.get(t)||[];new Set(n).difference(new Set(e)).size>0||n.forEach((t,i)=>{e.indexOf(t)!==i&&s.push(t)})}),s}_processNodes(){let e=this._collectNodes(),t=e.filter(e=>!this._storedNodes.includes(e)),i=this._storedNodes.filter(t=>!e.includes(t)),s=this._collectMovedNodes(e);(t.length||i.length||s.length||this.forceInitial)&&this.callback({addedNodes:t,currentNodes:e,movedNodes:s,removedNodes:i}),this.forceInitial&&(this.forceInitial=!1),this._storedNodes=e}}let tX=e=>class extends tm(e){get focused(){return(this._getItems()||[]).find(tC)}get _vertical(){return!0}get _tabNavigation(){return!1}focus(e){let t=this._getFocusableIndex();t>=0&&this._focus(t,e)}_getFocusableIndex(){let e=this._getItems();return Array.isArray(e)?this._getAvailableIndex(e,0,null,e=>!tw(e)):-1}_getItems(){return Array.from(this.children)}_onKeyDown(e){let t,i;if(super._onKeyDown(e),e.metaKey||e.ctrlKey)return;let{key:s,shiftKey:n}=e,o=this._getItems()||[],r=o.indexOf(this.focused),a=this._vertical||"rtl"!==this.getAttribute("dir")?1:-1;this.__isPrevKeyPressed(s,n)?(i=-a,t=r-a):this.__isNextKeyPressed(s,n)?(i=a,t=r+a):"Home"===s?(i=1,t=0):"End"===s&&(i=-1,t=o.length-1),t=this._getAvailableIndex(o,t,i,e=>!tw(e)),this._tabNavigation&&"Tab"===s&&(t>r&&e.shiftKey||t<r&&!e.shiftKey||t===r)||t>=0&&(e.preventDefault(),this._focus(t,{focusVisible:!0,preventScroll:!0},!0))}__isPrevKeyPressed(e,t){return this._vertical?"ArrowUp"===e:"ArrowLeft"===e||this._tabNavigation&&"Tab"===e&&t}__isNextKeyPressed(e,t){return this._vertical?"ArrowDown"===e:"ArrowRight"===e||this._tabNavigation&&"Tab"===e&&!t}_focus(e,t,i=!1){let s=this._getItems();this._focusItem(s[e],t,i)}_focusItem(e,t){e&&e.focus(t)}_getAvailableIndex(e,t,i,s){let n=e.length,o=t;for(let t=0;"number"==typeof o&&t<n;t+=1,o+=i||1){o<0?o=n-1:o>=n&&(o=0);let t=e[o];if(this._isItemFocusable(t)&&this.__isMatchingItem(t,s))return o}return -1}__isMatchingItem(e,t){return"function"!=typeof t||t(e)}_isItemFocusable(e){return!e.hasAttribute("disabled")}},tZ=e=>class extends tX(e){static get properties(){return{disabled:{type:Boolean,value:!1,reflectToAttribute:!0},selected:{type:Number,reflectToAttribute:!0,notify:!0,sync:!0},orientation:{type:String,reflectToAttribute:!0,value:""},items:{type:Array,readOnly:!0,notify:!0},_searchBuf:{type:String,value:""}}}static get observers(){return["_enhanceItems(items, orientation, selected, disabled)"]}get _isRTL(){return!this._vertical&&"rtl"===this.getAttribute("dir")}get _scrollerElement(){return console.warn(`Please implement the '_scrollerElement' property in <${this.localName}>`),this}get _vertical(){return"horizontal"!==this.orientation}focus(e){this._observer&&this._observer.flush();let t=Array.isArray(this.items)?this.items:[],i=this._getAvailableIndex(t,0,null,e=>0===e.tabIndex&&!tw(e));i>=0?this._focus(i,e):super.focus(e)}ready(){super.ready(),this.addEventListener("click",e=>this._onClick(e));let e=this.shadowRoot.querySelector("slot:not([name])");this._observer=new tG(e,()=>{this._setItems(this._filterItems([...this.children]))})}_getItems(){return this.items}_enhanceItems(e,t,i,s){if(!s&&e){this.setAttribute("aria-orientation",t||"vertical"),e.forEach(e=>{t?e.setAttribute("orientation",t):e.removeAttribute("orientation")}),this._setFocusable(i<0||!i?0:i);let s=e[i];e.forEach(e=>{e.selected=e===s}),s&&!s.disabled&&this._scrollToItem(i)}}_filterItems(e){return e.filter(e=>e._hasVaadinItemMixin)}_onClick(e){let t;if(e.metaKey||e.shiftKey||e.ctrlKey||e.defaultPrevented)return;let i=this._filterItems(e.composedPath())[0];i&&!i.disabled&&(t=this.items.indexOf(i))>=0&&(this.selected=t)}_searchKey(e,t){this._searchReset=tq.debounce(this._searchReset,eq.after(500),()=>{this._searchBuf=""}),this._searchBuf+=t.toLowerCase(),this.items.some(e=>this.__isMatchingKey(e))||(this._searchBuf=t.toLowerCase());let i=1===this._searchBuf.length?e+1:e;return this._getAvailableIndex(this.items,i,1,e=>this.__isMatchingKey(e)&&"none"!==getComputedStyle(e).display)}__isMatchingKey(e){return e.textContent.replace(/[^\p{L}\p{Nd}]/gu,"").toLowerCase().startsWith(this._searchBuf)}_onKeyDown(e){if(e.metaKey||e.ctrlKey)return;let t=e.key,i=this.items.indexOf(this.focused);if(/[\p{L}\p{Nd}]/u.test(t)&&1===t.length){let e=this._searchKey(i,t);e>=0&&this._focus(e);return}super._onKeyDown(e)}_setFocusable(e){e=this._getAvailableIndex(this.items,e,1);let t=this.items[e];this.items.forEach(e=>{e.tabIndex=e===t?0:-1})}_focus(e,t){this.items.forEach((t,i)=>{t.focused=i===e}),this._setFocusable(e),this._scrollToItem(e),super._focus(e,t??{preventScroll:!0})}_scrollToItem(e){let t=this._getItems()[e];t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}_scroll(e){if(this._vertical)this._scrollerElement.scrollTop+=e;else{var t;let i=this.getAttribute("dir")||"ltr",s=function(e,t){let{scrollLeft:i}=e;return"rtl"!==t?i:e.scrollWidth-e.clientWidth+i}(this._scrollerElement,i)+e;t=this._scrollerElement,"rtl"!==i?t.scrollLeft=s:t.scrollLeft=t.clientWidth-t.scrollWidth+s}}_isItemFocusable(e){return e.disabled&&e.__shouldAllowFocusWhenDisabled?e.__shouldAllowFocusWhenDisabled():super._isItemFocusable(e)}},tY=h`
208
218
  :host {
209
219
  --vaadin-item-checkmark-display: block;
210
220
  display: flex;
@@ -226,11 +236,11 @@
226
236
  margin: 4px 8px;
227
237
  margin-inline-start: calc(var(--vaadin-icon-size, 1lh) + var(--vaadin-item-gap, var(--vaadin-gap-s)) + 8px);
228
238
  }
229
- `;class tY extends tX(tz(eL(ez(tD(ec))))){static get is(){return"vaadin-menu-bar-list-box"}static get styles(){return tZ}static get properties(){return{orientation:{type:String,readOnly:!0}}}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}render(){return q`
239
+ `;class tQ extends tZ(tH(eP(ez(tB(ec))))){static get is(){return"vaadin-menu-bar-list-box"}static get styles(){return tY}static get properties(){return{orientation:{type:String,readOnly:!0}}}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}render(){return q`
230
240
  <div part="items">
231
241
  <slot></slot>
232
242
  </div>
233
- `}ready(){super.ready(),this.setAttribute("role","menu")}}eT(tY);class tQ{saveFocus(e){this.focusNode=e||tb()}restoreFocus(e){let t=this.focusNode;if(!t)return;let i={preventScroll:!!e&&e.preventScroll,focusVisible:!!e&&e.focusVisible};tb()===document.body?setTimeout(()=>t.focus(i)):t.focus(i),this.focusNode=null}}let tJ=[];class t0{constructor(e){this.host=e,this.__trapNode=null,this.__onKeyDown=this.__onKeyDown.bind(this)}get __focusableElements(){var e;let t;return e=this.__trapNode,!function e(t,i){if(t.nodeType!==Node.ELEMENT_NODE||ty(t))return!1;let s=tx(t)?Number(t.getAttribute("tabindex")||0):-1,n=s>0;s>=0&&i.push(t);return[..."slot"===t.localName?t.assignedNodes({flatten:!0}):(t.shadowRoot||t).children].forEach(t=>{n=e(t,i)||n}),n}(e,t=[])?t:function e(t){let i=t.length;if(i<2)return t;let s=Math.ceil(i/2),n=e(t.slice(0,s)),o=e(t.slice(s)),r=[];for(;n.length>0&&o.length>0;)!function(e,t){let i=Math.max(e.tabIndex,0),s=Math.max(t.tabIndex,0);return 0===i||0===s?s>i:i>s}(n[0],o[0])?r.push(n.shift()):r.push(o.shift());return r.concat(n,o)}(t)}get __focusedElementIndex(){let e=this.__focusableElements;return e.indexOf(e.filter(tC).pop())}hostConnected(){document.addEventListener("keydown",this.__onKeyDown)}hostDisconnected(){document.removeEventListener("keydown",this.__onKeyDown)}trapFocus(e){if(this.__trapNode=e,0===this.__focusableElements.length)throw this.__trapNode=null,Error("The trap node should have at least one focusable descendant or be focusable itself.");tJ.push(this),-1===this.__focusedElementIndex&&this.__focusableElements[0].focus({focusVisible:tg})}releaseFocus(){this.__trapNode=null,tJ.pop()}__onKeyDown(e){if(this.__trapNode&&this===Array.from(tJ).pop()&&"Tab"===e.key){if(e.defaultPrevented)return;e.preventDefault();let t=e.shiftKey;this.__focusNextElement(t)}}__focusNextElement(e=!1){let t=this.__focusableElements,i=this.__focusedElementIndex,s=(t.length+i+(e?-1:1))%t.length,n=t[s];n.focus({focusVisible:!0}),"input"===n.localName&&n.select()}}let t1=e=>class extends e{static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__focusTrapController=new t0(this),this.__focusRestorationController=new tQ}get _contentRoot(){return this}ready(){super.ready(),this.addController(this.__focusTrapController),this.addController(this.__focusRestorationController)}get _focusTrapRoot(){return this.$.overlay}_resetFocus(){if(this.focusTrap&&this.__focusTrapController.releaseFocus(),this.restoreFocusOnClose&&this._shouldRestoreFocus()){let e=tg;this.__focusRestorationController.restoreFocus({preventScroll:!e,focusVisible:e})}}_saveFocus(){this.restoreFocusOnClose&&this.__focusRestorationController.saveFocus(this.restoreFocusNode)}_trapFocus(){this.focusTrap&&!tw(this._focusTrapRoot)&&this.__focusTrapController.trapFocus(this._focusTrapRoot)}_shouldRestoreFocus(){let e=tb();return e===document.body||this._deepContains(e)}_deepContains(e){if(this._contentRoot.contains(e))return!0;let t=e,i=e.ownerDocument;for(;t&&t!==i&&t!==this._contentRoot;)t=t.parentNode||t.host;return t===this._contentRoot}};function t2(e,t,i){let s=[e];e.owner&&s.push(e.owner),"string"==typeof i?s.forEach(e=>{e.setAttribute(t,i)}):i?s.forEach(e=>{e.setAttribute(t,"")}):s.forEach(e=>{e.removeAttribute(t)})}let t5={start:"top",end:"bottom"},t4={start:"left",end:"right"},t7=new ResizeObserver(e=>{setTimeout(()=>{e.forEach(e=>{e.target.__overlay&&e.target.__overlay._updatePosition()})})}),t3=e=>class extends e{static get properties(){return{positionTarget:{type:Object,value:null,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!0}}}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}updated(e){if(super.updated(e),e.has("positionTarget")){let t=e.get("positionTarget");this.__oldContentWidth=void 0,this.__oldContentHeight=void 0,(!this.positionTarget&&t||this.positionTarget&&!t&&this.__margins)&&this.__resetPosition()}(e.has("opened")||e.has("positionTarget"))&&this.__updatePositionSettings(this.opened,this.positionTarget),["horizontalAlign","verticalAlign","noHorizontalOverlap","noVerticalOverlap","requiredVerticalSpace"].some(t=>e.has(t))&&this._updatePosition()}__addUpdatePositionEventListeners(){window.visualViewport.addEventListener("resize",this._updatePosition),window.visualViewport.addEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes=function(e){let t=[];for(;e;){if(e.nodeType===Node.DOCUMENT_NODE){t.push(e);break}if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){t.push(e),e=e.host;continue}if(e.assignedSlot){e=e.assignedSlot;continue}e=e.parentNode}return t}(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach(e=>{e.addEventListener("scroll",this.__onScroll,!0)}),this.positionTarget&&(this.__observePositionTargetMove=function(e,t){let i,s=null,n=document.documentElement;function o(){i&&clearTimeout(i),s&&s.disconnect(),s=null}return!function r(a=!1,l=1){o();let{left:d,top:h,width:c,height:u}=e.getBoundingClientRect();if(a||t(),!c||!u)return;let p=Math.floor(h),_=Math.floor(n.clientWidth-(d+c)),v=Math.floor(n.clientHeight-(h+u)),m=Math.floor(d),f=!0;(s=new IntersectionObserver(function(e){let t=e[0].intersectionRatio;if(t!==l){if(!f)return r();t?r(!1,t):i=setTimeout(()=>{r(!1,1e-7)},1e3)}f=!1},{rootMargin:`${-p}px ${-_}px ${-v}px ${-m}px`,threshold:Math.max(0,Math.min(1,l))||1})).observe(e)}(!0),o}(this.positionTarget,()=>{this._updatePosition()}))}__removeUpdatePositionEventListeners(){window.visualViewport.removeEventListener("resize",this._updatePosition),window.visualViewport.removeEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach(e=>{e.removeEventListener("scroll",this.__onScroll,!0)}),this.__positionTargetAncestorRootNodes=null),this.__observePositionTargetMove&&(this.__observePositionTargetMove(),this.__observePositionTargetMove=null)}__updatePositionSettings(e,t){if(this.__removeUpdatePositionEventListeners(),t&&(t.__overlay=null,t7.unobserve(t),e&&(this.__addUpdatePositionEventListeners(),t.__overlay=this,t7.observe(t))),e){let e=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach(t=>{this.__margins[t]=parseInt(e[t],10)})),this._updatePosition(),requestAnimationFrame(()=>this._updatePosition())}}__onScroll(e){e.target instanceof Node&&this._deepContains(e.target)||this._updatePosition()}__resetPosition(){this.__margins=null,Object.assign(this.style,{justifyContent:"",alignItems:"",top:"",bottom:"",left:"",right:""}),t2(this,"bottom-aligned",!1),t2(this,"top-aligned",!1),t2(this,"end-aligned",!1),t2(this,"start-aligned",!1)}_updatePosition(){if(!this.positionTarget||!this.opened||!this.__margins)return;let e=this.positionTarget.getBoundingClientRect();if(0===e.width&&0===e.height&&this.opened){this.opened=!1;return}let t=this.__shouldAlignStartVertically(e);this.style.justifyContent=t?"flex-start":"flex-end";let i=this.__isRTL,s=this.__shouldAlignStartHorizontally(e,i),n=!i&&s||i&&!s;this.style.alignItems=n?"flex-start":"flex-end";let o=this.getBoundingClientRect(),r=this.__calculatePositionInOneDimension(e,o,this.noVerticalOverlap,t5,this,t),a=this.__calculatePositionInOneDimension(e,o,this.noHorizontalOverlap,t4,this,s);Object.assign(this.style,r,a),t2(this,"bottom-aligned",!t),t2(this,"top-aligned",t),t2(this,"end-aligned",!n),t2(this,"start-aligned",n)}__shouldAlignStartHorizontally(e,t){let i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;let s=Math.min(window.innerWidth,document.documentElement.clientWidth),n=!t&&"start"===this.horizontalAlign||t&&"end"===this.horizontalAlign;return this.__shouldAlignStart(e,i,s,this.__margins,n,this.noHorizontalOverlap,t4)}__shouldAlignStartVertically(e){let t=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;let i=Math.min(window.innerHeight,document.documentElement.clientHeight),s="top"===this.verticalAlign;return this.__shouldAlignStart(e,t,i,this.__margins,s,this.noVerticalOverlap,t5)}__shouldAlignStart(e,t,i,s,n,o,r){let a=i-e[o?r.end:r.start]-s[r.end],l=e[o?r.start:r.end]-s[r.start],d=n?a:l;return n===(d>(n?l:a)||d>t)}__adjustBottomProperty(e,t,i){let s;if(e===t.end){if(t.end===t5.end){let e=Math.min(window.innerHeight,document.documentElement.clientHeight);i>e&&this.__oldViewportHeight&&(s=i-(this.__oldViewportHeight-e)),this.__oldViewportHeight=e}if(t.end===t4.end){let e=Math.min(window.innerWidth,document.documentElement.clientWidth);i>e&&this.__oldViewportWidth&&(s=i-(this.__oldViewportWidth-e)),this.__oldViewportWidth=e}}return s}__calculatePositionInOneDimension(e,t,i,s,n,o){let r=o?s.start:s.end,a=o?s.end:s.start,l=parseFloat(n.style[r]||getComputedStyle(n)[r]),d=this.__adjustBottomProperty(r,s,l),h=t[o?s.start:s.end]-e[i===o?s.end:s.start];return{[r]:d?`${d}px`:`${l+h*(o?-1:1)}px`,[a]:""}}},t8=e=>class extends t1(t3(e)){static get properties(){return{parentOverlay:{type:Object,readOnly:!0},_theme:{type:String,readOnly:!0,sync:!0}}}static get observers(){return["_themeChanged(_theme)"]}get _contentRoot(){return this._rendererRoot}get _rendererRoot(){if(!this.__savedRoot){let e=document.createElement("div");e.setAttribute("slot","overlay"),e.style.display="contents",this.owner.appendChild(e),this.__savedRoot=e}return this.__savedRoot}ready(){super.ready(),this.restoreFocusOnClose=!0,this.addEventListener("keydown",e=>{if(!e.defaultPrevented&&e.composedPath()[0]===this.$.overlay&&[38,40].indexOf(e.keyCode)>-1){let t=this._contentRoot.firstElementChild;t&&Array.isArray(t.items)&&t.items.length&&(e.preventDefault(),38===e.keyCode?t.items[t.items.length-1].focus():t.focus())}})}_themeChanged(){this.close()}getBoundaries(){let e=this.getBoundingClientRect(),t=this.$.overlay.getBoundingClientRect(),i=e.bottom-t.height,s=this.parentOverlay;if(s&&s.hasAttribute("bottom-aligned")){let e=getComputedStyle(s);i=i-parseFloat(e.bottom)-parseFloat(e.height)}return{xMax:e.right-t.width,xMin:e.left+t.width,yMax:i}}_updatePosition(){if(super._updatePosition(),this.positionTarget&&this.parentOverlay&&this.opened){let e=getComputedStyle(this.$.content);this.style.left?this.style.left=`${parseFloat(this.style.left)+parseFloat(e.paddingLeft)}px`:this.style.right=`${parseFloat(this.style.right)+parseFloat(e.paddingRight)}px`,this.style.bottom?this.style.bottom=`${parseFloat(this.style.bottom)-parseFloat(e.paddingBottom)}px`:this.style.top=`${parseFloat(this.style.top)-parseFloat(e.paddingTop)}px`}}_shouldRestoreFocus(){return!this.parentOverlay&&super._shouldRestoreFocus()}_deepContains(e){return this.owner.contains(e)}},t6=/Android/u.test(navigator.userAgent);/Chrome/u.test(navigator.userAgent)&&/Google Inc/u.test(navigator.vendor),/Firefox/u.test(navigator.userAgent);let t9=/^iPad/u.test(navigator.platform)||/^Mac/u.test(navigator.platform)&&navigator.maxTouchPoints>1,ie=/^iPhone/u.test(navigator.platform)||t9;/^((?!chrome|android).)*safari/iu.test(navigator.userAgent);let it=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})(),ii=new Set,is=()=>[...ii].filter(e=>!e.hasAttribute("closing")),io=e=>{let t=is(),i=t[t.indexOf(e)+1];return!i||!!e._deepContains(i)&&io(i)},ir=(e,t=e=>!0)=>e===is().filter(t).pop(),ia=e=>class extends e{get _last(){return ir(this)}get _isAttached(){return ii.has(this)}bringToFront(){ir(this)||io(this)||(this.matches(":popover-open")&&(this.hidePopover(),this.showPopover()),this._removeAttachedInstance(),this._appendAttachedInstance())}_enterModalState(){"none"!==document.body.style.pointerEvents&&(this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),is().forEach(e=>{e!==this&&(e.$.overlay.style.pointerEvents="none")})}_exitModalState(){let e;void 0!==this._previousDocumentPointerEvents&&(document.body.style.pointerEvents=this._previousDocumentPointerEvents,delete this._previousDocumentPointerEvents);let t=is();for(;(e=t.pop())&&(e===this||(e.$.overlay.style.removeProperty("pointer-events"),e.modeless)););}_appendAttachedInstance(){ii.add(this)}_removeAttachedInstance(){this._isAttached&&ii.delete(this)}},il=e=>class extends t1(ia(e)){static get properties(){return{opened:{type:Boolean,notify:!0,observer:"_openedChanged",reflectToAttribute:!0,sync:!0},owner:{type:Object,sync:!0},model:{type:Object,sync:!0},renderer:{type:Object,sync:!0},modeless:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_modelessChanged",sync:!0},hidden:{type:Boolean,reflectToAttribute:!0,observer:"_hiddenChanged",sync:!0},withBackdrop:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_withBackdropChanged",sync:!0}}}static get observers(){return["_rendererOrDataChanged(renderer, owner, model, opened)"]}get _rendererRoot(){return this}constructor(){super(),this._boundMouseDownListener=this._mouseDownListener.bind(this),this._boundMouseUpListener=this._mouseUpListener.bind(this),this._boundOutsideClickListener=this._outsideClickListener.bind(this),this._boundKeydownListener=this._keydownListener.bind(this),ie&&(this._boundIosResizeListener=()=>this._detectIosNavbar())}firstUpdated(){super.firstUpdated(),this.popover="manual",this.addEventListener("click",()=>{}),this.$.backdrop&&this.$.backdrop.addEventListener("click",()=>{}),this.addEventListener("mouseup",()=>{document.activeElement===document.body&&"0"===this.$.overlay.getAttribute("tabindex")&&this.$.overlay.focus()}),this.addEventListener("animationcancel",()=>{this._flushAnimation("opening"),this._flushAnimation("closing")})}connectedCallback(){super.connectedCallback(),this._boundIosResizeListener&&(this._detectIosNavbar(),window.addEventListener("resize",this._boundIosResizeListener)),this.opened&&this._attachOverlay()}disconnectedCallback(){super.disconnectedCallback(),this.__scheduledOpen&&(cancelAnimationFrame(this.__scheduledOpen),this.__scheduledOpen=null),this._boundIosResizeListener&&window.removeEventListener("resize",this._boundIosResizeListener)}requestContentUpdate(){this.renderer&&this.renderer.call(this.owner,this._rendererRoot,this.owner,this.model)}close(e){let t=new CustomEvent("vaadin-overlay-close",{bubbles:!0,cancelable:!0,detail:{overlay:this,sourceEvent:e}});this.dispatchEvent(t),document.body.dispatchEvent(t),t.defaultPrevented||(this.opened=!1)}setBounds(e,t=!0){let i=this.$.overlay,s={...e};t&&"absolute"!==i.style.position&&(i.style.position="absolute"),Object.keys(s).forEach(e=>{null===s[e]||isNaN(s[e])||(s[e]=`${s[e]}px`)}),Object.assign(i.style,s)}_detectIosNavbar(){if(!this.opened)return;let e=window.innerHeight,t=window.innerWidth,i=document.documentElement.clientHeight;t>e&&i>e?this.style.setProperty("--vaadin-overlay-viewport-bottom",`${i-e}px`):this.style.setProperty("--vaadin-overlay-viewport-bottom","0px")}_shouldAddGlobalListeners(){return!this.modeless}_addGlobalListeners(){this.__hasGlobalListeners||(this.__hasGlobalListeners=!0,document.addEventListener("mousedown",this._boundMouseDownListener),document.addEventListener("mouseup",this._boundMouseUpListener),document.documentElement.addEventListener("click",this._boundOutsideClickListener,!0))}_removeGlobalListeners(){this.__hasGlobalListeners&&(this.__hasGlobalListeners=!1,document.removeEventListener("mousedown",this._boundMouseDownListener),document.removeEventListener("mouseup",this._boundMouseUpListener),document.documentElement.removeEventListener("click",this._boundOutsideClickListener,!0))}_rendererOrDataChanged(e,t,i,s){let n=this._oldOwner!==t||this._oldModel!==i;this._oldModel=i,this._oldOwner=t;let o=this._oldRenderer!==e,r=void 0!==this._oldRenderer;this._oldRenderer=e;let a=this._oldOpened!==s;this._oldOpened=s,o&&r&&(this._rendererRoot.innerHTML="",delete this._rendererRoot._$litPart$),s&&e&&(o||a||n)&&this.requestContentUpdate()}_modelessChanged(e){this.opened&&(this._shouldAddGlobalListeners()?this._addGlobalListeners():this._removeGlobalListeners()),e?this._exitModalState():this.opened&&this._enterModalState(),t2(this,"modeless",e)}_withBackdropChanged(e){t2(this,"with-backdrop",e)}_openedChanged(e,t){if(e){if(!this.isConnected){this.opened=!1;return}this._saveFocus(),this._animatedOpening(),this.__scheduledOpen=requestAnimationFrame(()=>{setTimeout(()=>{this._trapFocus();let e=new CustomEvent("vaadin-overlay-open",{detail:{overlay:this},bubbles:!0});this.dispatchEvent(e),document.body.dispatchEvent(e)})}),document.addEventListener("keydown",this._boundKeydownListener),this._shouldAddGlobalListeners()&&this._addGlobalListeners()}else t&&(this.__scheduledOpen&&(cancelAnimationFrame(this.__scheduledOpen),this.__scheduledOpen=null),this._resetFocus(),this._animatedClosing(),document.removeEventListener("keydown",this._boundKeydownListener),this._shouldAddGlobalListeners()&&this._removeGlobalListeners())}_hiddenChanged(e){e&&this.hasAttribute("closing")&&this._flushAnimation("closing")}_shouldAnimate(){let e=getComputedStyle(this),t=e.getPropertyValue("animation-name");return"none"!==e.getPropertyValue("display")&&t&&"none"!==t}_enqueueAnimation(e,t){let i=`__${e}Handler`,s=e=>{e&&e.target!==this||(t(),this.removeEventListener("animationend",s),delete this[i])};this[i]=s,this.addEventListener("animationend",s)}_flushAnimation(e){let t=`__${e}Handler`;"function"==typeof this[t]&&this[t]()}_animatedOpening(){this._isAttached&&this.hasAttribute("closing")&&this._flushAnimation("closing"),this._attachOverlay(),this._appendAttachedInstance(),this.bringToFront(),this.modeless||this._enterModalState(),t2(this,"opening",!0),this._shouldAnimate()?this._enqueueAnimation("opening",()=>{this._finishOpening()}):this._finishOpening()}_attachOverlay(){this.matches(":popover-open")||this.showPopover()}_finishOpening(){t2(this,"opening",!1)}_finishClosing(){this._detachOverlay(),this._removeAttachedInstance(),this.$.overlay.style.removeProperty("pointer-events"),t2(this,"closing",!1),this.dispatchEvent(new CustomEvent("vaadin-overlay-closed"))}_animatedClosing(){this.hasAttribute("opening")&&this._flushAnimation("opening"),this._isAttached&&(this._exitModalState(),t2(this,"closing",!0),this.dispatchEvent(new CustomEvent("vaadin-overlay-closing")),this._shouldAnimate()?this._enqueueAnimation("closing",()=>{this._finishClosing()}):this._finishClosing())}_detachOverlay(){this.hidePopover()}_mouseDownListener(e){this._mouseDownInside=e.composedPath().indexOf(this.$.overlay)>=0}_mouseUpListener(e){this._mouseUpInside=e.composedPath().indexOf(this.$.overlay)>=0}_shouldCloseOnOutsideClick(e){return this._last}_outsideClickListener(e){if(e.composedPath().includes(this.$.overlay)||this._mouseDownInside||this._mouseUpInside){this._mouseDownInside=!1,this._mouseUpInside=!1;return}if(!this._shouldCloseOnOutsideClick(e))return;let t=new CustomEvent("vaadin-overlay-outside-click",{cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}_keydownListener(e){if(this._last&&!e.defaultPrevented&&(this._shouldAddGlobalListeners()||e.composedPath().includes(this._focusTrapRoot))&&"Escape"===e.key){let t=new CustomEvent("vaadin-overlay-escape-press",{cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}}},id=h`
243
+ `}ready(){super.ready(),this.setAttribute("role","menu")}}e$(tQ);class tJ{saveFocus(e){this.focusNode=e||tb()}restoreFocus(e){let t=this.focusNode;if(!t)return;let i={preventScroll:!!e&&e.preventScroll,focusVisible:!!e&&e.focusVisible};tb()===document.body?setTimeout(()=>t.focus(i)):t.focus(i),this.focusNode=null}}let t0=[];class t1{constructor(e){this.host=e,this.__trapNode=null,this.__onKeyDown=this.__onKeyDown.bind(this)}get __focusableElements(){var e;let t;return e=this.__trapNode,!function e(t,i){if(t.nodeType!==Node.ELEMENT_NODE||ty(t))return!1;let s=tx(t)?Number(t.getAttribute("tabindex")||0):-1,n=s>0;s>=0&&i.push(t);return[..."slot"===t.localName?t.assignedNodes({flatten:!0}):(t.shadowRoot||t).children].forEach(t=>{n=e(t,i)||n}),n}(e,t=[])?t:function e(t){let i=t.length;if(i<2)return t;let s=Math.ceil(i/2),n=e(t.slice(0,s)),o=e(t.slice(s)),r=[];for(;n.length>0&&o.length>0;)!function(e,t){let i=Math.max(e.tabIndex,0),s=Math.max(t.tabIndex,0);return 0===i||0===s?s>i:i>s}(n[0],o[0])?r.push(n.shift()):r.push(o.shift());return r.concat(n,o)}(t)}get __focusedElementIndex(){let e=this.__focusableElements;return e.indexOf(e.filter(tC).pop())}hostConnected(){document.addEventListener("keydown",this.__onKeyDown)}hostDisconnected(){document.removeEventListener("keydown",this.__onKeyDown)}trapFocus(e){if(this.__trapNode=e,0===this.__focusableElements.length)throw this.__trapNode=null,Error("The trap node should have at least one focusable descendant or be focusable itself.");t0.push(this),-1===this.__focusedElementIndex&&this.__focusableElements[0].focus({focusVisible:tg})}releaseFocus(){this.__trapNode=null,t0.pop()}__onKeyDown(e){if(this.__trapNode&&this===Array.from(t0).pop()&&"Tab"===e.key){if(e.defaultPrevented)return;e.preventDefault();let t=e.shiftKey;this.__focusNextElement(t)}}__focusNextElement(e=!1){let t=this.__focusableElements,i=this.__focusedElementIndex,s=(t.length+i+(e?-1:1))%t.length,n=t[s];n.focus({focusVisible:!0}),"input"===n.localName&&n.select()}}let t2=e=>class extends e{static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__focusTrapController=new t1(this),this.__focusRestorationController=new tJ}get _contentRoot(){return this}ready(){super.ready(),this.addController(this.__focusTrapController),this.addController(this.__focusRestorationController)}get _focusTrapRoot(){return this.$.overlay}_resetFocus(){if(this.focusTrap&&this.__focusTrapController.releaseFocus(),this.restoreFocusOnClose&&this._shouldRestoreFocus()){let e=tg;this.__focusRestorationController.restoreFocus({preventScroll:!e,focusVisible:e})}}_saveFocus(){this.restoreFocusOnClose&&this.__focusRestorationController.saveFocus(this.restoreFocusNode)}_trapFocus(){this.focusTrap&&!tw(this._focusTrapRoot)&&this.__focusTrapController.trapFocus(this._focusTrapRoot)}_shouldRestoreFocus(){let e=tb();return e===document.body||this._deepContains(e)}_deepContains(e){if(this._contentRoot.contains(e))return!0;let t=e,i=e.ownerDocument;for(;t&&t!==i&&t!==this._contentRoot;)t=t.parentNode||t.host;return t===this._contentRoot}};function t5(e,t,i){let s=[e];e.owner&&s.push(e.owner),"string"==typeof i?s.forEach(e=>{e.setAttribute(t,i)}):i?s.forEach(e=>{e.setAttribute(t,"")}):s.forEach(e=>{e.removeAttribute(t)})}let t4={start:"top",end:"bottom"},t8={start:"left",end:"right"},t3=new ResizeObserver(e=>{setTimeout(()=>{e.forEach(e=>{e.target.__overlay&&e.target.__overlay._updatePosition()})})}),t7=e=>class extends e{static get properties(){return{positionTarget:{type:Object,value:null,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!0}}}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}updated(e){if(super.updated(e),e.has("positionTarget")){let t=e.get("positionTarget");this.__oldContentWidth=void 0,this.__oldContentHeight=void 0,(!this.positionTarget&&t||this.positionTarget&&!t&&this.__margins)&&this.__resetPosition()}(e.has("opened")||e.has("positionTarget"))&&this.__updatePositionSettings(this.opened,this.positionTarget),["horizontalAlign","verticalAlign","noHorizontalOverlap","noVerticalOverlap","requiredVerticalSpace"].some(t=>e.has(t))&&this._updatePosition()}__addUpdatePositionEventListeners(){window.visualViewport.addEventListener("resize",this._updatePosition),window.visualViewport.addEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes=function(e){let t=[];for(;e;){if(e.nodeType===Node.DOCUMENT_NODE){t.push(e);break}if(e.nodeType===Node.DOCUMENT_FRAGMENT_NODE){t.push(e),e=e.host;continue}if(e.assignedSlot){e=e.assignedSlot;continue}e=e.parentNode}return t}(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach(e=>{e.addEventListener("scroll",this.__onScroll,!0)}),this.positionTarget&&(this.__observePositionTargetMove=function(e,t){let i,s=null,n=document.documentElement;function o(){i&&clearTimeout(i),s?.disconnect(),s=null}return!function r(a=!1,l=1){o();let{left:d,top:h,width:c,height:u}=e.getBoundingClientRect();if(a||t(),!c||!u)return;let p=Math.floor(h),_=Math.floor(n.clientWidth-(d+c)),v=Math.floor(n.clientHeight-(h+u)),m=Math.floor(d),f=!0;(s=new IntersectionObserver(function(e){let t=e[0].intersectionRatio;if(t!==l){if(!f)return r();t?r(!1,t):i=setTimeout(()=>{r(!1,1e-7)},1e3)}f=!1},{rootMargin:`${-p}px ${-_}px ${-v}px ${-m}px`,threshold:Math.max(0,Math.min(1,l))||1})).observe(e)}(!0),o}(this.positionTarget,()=>{this._updatePosition()}))}__removeUpdatePositionEventListeners(){window.visualViewport.removeEventListener("resize",this._updatePosition),window.visualViewport.removeEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach(e=>{e.removeEventListener("scroll",this.__onScroll,!0)}),this.__positionTargetAncestorRootNodes=null),this.__observePositionTargetMove&&(this.__observePositionTargetMove(),this.__observePositionTargetMove=null)}__updatePositionSettings(e,t){if(this.__removeUpdatePositionEventListeners(),t&&(t.__overlay=null,t3.unobserve(t),e&&(this.__addUpdatePositionEventListeners(),t.__overlay=this,t3.observe(t))),e){let e=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach(t=>{this.__margins[t]=parseInt(e[t],10)})),this._updatePosition(),requestAnimationFrame(()=>this._updatePosition())}}__onScroll(e){e.target instanceof Node&&this._deepContains(e.target)||this._updatePosition()}__resetPosition(){this.__margins=null,Object.assign(this.style,{justifyContent:"",alignItems:"",top:"",bottom:"",left:"",right:""}),t5(this,"bottom-aligned",!1),t5(this,"top-aligned",!1),t5(this,"end-aligned",!1),t5(this,"start-aligned",!1)}_updatePosition(){if(!this.positionTarget||!this.opened||!this.__margins)return;let e=this.positionTarget.getBoundingClientRect();if(0===e.width&&0===e.height&&this.opened){this.opened=!1;return}let t=this.__shouldAlignStartVertically(e);this.style.justifyContent=t?"flex-start":"flex-end";let i=this.__isRTL,s=this.__shouldAlignStartHorizontally(e,i),n=!i&&s||i&&!s;this.style.alignItems=n?"flex-start":"flex-end";let o=this.getBoundingClientRect(),r=this.__calculatePositionInOneDimension(e,o,this.noVerticalOverlap,t4,this,t),a=this.__calculatePositionInOneDimension(e,o,this.noHorizontalOverlap,t8,this,s);Object.assign(this.style,r,a),t5(this,"bottom-aligned",!t),t5(this,"top-aligned",t),t5(this,"end-aligned",!n),t5(this,"start-aligned",n)}__shouldAlignStartHorizontally(e,t){let i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;let s=Math.min(window.innerWidth,document.documentElement.clientWidth),n=!t&&"start"===this.horizontalAlign||t&&"end"===this.horizontalAlign;return this.__shouldAlignStart(e,i,s,this.__margins,n,this.noHorizontalOverlap,t8)}__shouldAlignStartVertically(e){let t=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;let i=Math.min(window.innerHeight,document.documentElement.clientHeight),s="top"===this.verticalAlign;return this.__shouldAlignStart(e,t,i,this.__margins,s,this.noVerticalOverlap,t4)}__shouldAlignStart(e,t,i,s,n,o,r){let a=i-e[o?r.end:r.start]-s[r.end],l=e[o?r.start:r.end]-s[r.start],d=n?a:l;return n===(d>(n?l:a)||d>t)}__adjustBottomProperty(e,t,i){let s;if(e===t.end){if(t.end===t4.end){let e=Math.min(window.innerHeight,document.documentElement.clientHeight);i>e&&this.__oldViewportHeight&&(s=i-(this.__oldViewportHeight-e)),this.__oldViewportHeight=e}if(t.end===t8.end){let e=Math.min(window.innerWidth,document.documentElement.clientWidth);i>e&&this.__oldViewportWidth&&(s=i-(this.__oldViewportWidth-e)),this.__oldViewportWidth=e}}return s}__calculatePositionInOneDimension(e,t,i,s,n,o){let r=o?s.start:s.end,a=o?s.end:s.start,l=parseFloat(n.style[r]||getComputedStyle(n)[r]),d=this.__adjustBottomProperty(r,s,l),h=t[o?s.start:s.end]-e[i===o?s.end:s.start];return{[r]:d?`${d}px`:`${l+h*(o?-1:1)}px`,[a]:""}}},t6=e=>class extends t2(t7(e)){static get properties(){return{parentOverlay:{type:Object,readOnly:!0},_theme:{type:String,readOnly:!0,sync:!0}}}static get observers(){return["_themeChanged(_theme)"]}get _contentRoot(){return this._rendererRoot}get _rendererRoot(){if(!this.__savedRoot){let e=document.createElement("div");e.setAttribute("slot","overlay"),e.style.display="contents",this.owner.appendChild(e),this.__savedRoot=e}return this.__savedRoot}ready(){super.ready(),this.restoreFocusOnClose=!0,this.addEventListener("keydown",e=>{if(!e.defaultPrevented&&e.composedPath()[0]===this.$.overlay&&[38,40].indexOf(e.keyCode)>-1){let t=this._contentRoot.firstElementChild;t&&Array.isArray(t.items)&&t.items.length&&(e.preventDefault(),38===e.keyCode?t.items[t.items.length-1].focus():t.focus())}})}_themeChanged(){this.close()}getBoundaries(){let e=this.getBoundingClientRect(),t=this.$.overlay.getBoundingClientRect(),i=e.bottom-t.height,s=this.parentOverlay;if(s?.hasAttribute("bottom-aligned")){let e=getComputedStyle(s);i=i-parseFloat(e.bottom)-parseFloat(e.height)}return{xMax:e.right-t.width,xMin:e.left+t.width,yMax:i}}_updatePosition(){if(super._updatePosition(),this.positionTarget&&this.parentOverlay&&this.opened){let e=getComputedStyle(this.$.content);this.style.left?this.style.left=`${parseFloat(this.style.left)+parseFloat(e.paddingLeft)}px`:this.style.right=`${parseFloat(this.style.right)+parseFloat(e.paddingRight)}px`,this.style.bottom?this.style.bottom=`${parseFloat(this.style.bottom)-parseFloat(e.paddingBottom)}px`:this.style.top=`${parseFloat(this.style.top)-parseFloat(e.paddingTop)}px`}}_shouldRestoreFocus(){return!this.parentOverlay&&super._shouldRestoreFocus()}_deepContains(e){return this.owner.contains(e)}},t9=/Android/u.test(navigator.userAgent);/Chrome/u.test(navigator.userAgent)&&/Google Inc/u.test(navigator.vendor),/Firefox/u.test(navigator.userAgent);let ie=/^iPad/u.test(navigator.platform)||/^Mac/u.test(navigator.platform)&&navigator.maxTouchPoints>1,it=/^iPhone/u.test(navigator.platform)||ie;/^((?!chrome|android).)*safari/iu.test(navigator.userAgent);let ii=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})(),is=new Set,io=()=>[...is].filter(e=>!e.hasAttribute("closing")),ir=e=>{let t=io(),i=t[t.indexOf(e)+1];return!i||!!e._deepContains(i)&&ir(i)},ia=(e,t=e=>!0)=>e===io().filter(t).pop(),il=e=>class extends e{get _last(){return ia(this)}get _isAttached(){return is.has(this)}bringToFront(){ia(this)||ir(this)||(this.matches(":popover-open")&&(this.hidePopover(),this.showPopover()),this._removeAttachedInstance(),this._appendAttachedInstance())}_enterModalState(){"none"!==document.body.style.pointerEvents&&(this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),io().forEach(e=>{e!==this&&(e.$.overlay.style.pointerEvents="none")})}_exitModalState(){let e;void 0!==this._previousDocumentPointerEvents&&(document.body.style.pointerEvents=this._previousDocumentPointerEvents,delete this._previousDocumentPointerEvents);let t=io();for(;(e=t.pop())&&(e===this||(e.$.overlay.style.removeProperty("pointer-events"),e.modeless)););}_appendAttachedInstance(){is.add(this)}_removeAttachedInstance(){this._isAttached&&is.delete(this)}},id=e=>class extends t2(il(e)){static get properties(){return{opened:{type:Boolean,notify:!0,observer:"_openedChanged",reflectToAttribute:!0,sync:!0},owner:{type:Object,sync:!0},model:{type:Object,sync:!0},renderer:{type:Object,sync:!0},modeless:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_modelessChanged",sync:!0},hidden:{type:Boolean,reflectToAttribute:!0,observer:"_hiddenChanged",sync:!0},withBackdrop:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_withBackdropChanged",sync:!0}}}static get observers(){return["_rendererOrDataChanged(renderer, owner, model, opened)"]}get _rendererRoot(){return this}constructor(){super(),this._boundMouseDownListener=this._mouseDownListener.bind(this),this._boundMouseUpListener=this._mouseUpListener.bind(this),this._boundOutsideClickListener=this._outsideClickListener.bind(this),this._boundKeydownListener=this._keydownListener.bind(this),it&&(this._boundIosResizeListener=()=>this._detectIosNavbar())}firstUpdated(){super.firstUpdated(),this.popover="manual",this.addEventListener("click",()=>{}),this.$.backdrop&&this.$.backdrop.addEventListener("click",()=>{}),this.addEventListener("mouseup",()=>{document.activeElement===document.body&&"0"===this.$.overlay.getAttribute("tabindex")&&this.$.overlay.focus()}),this.addEventListener("animationcancel",()=>{this._flushAnimation("opening"),this._flushAnimation("closing")})}connectedCallback(){super.connectedCallback(),this._boundIosResizeListener&&(this._detectIosNavbar(),window.addEventListener("resize",this._boundIosResizeListener)),this.opened&&this._attachOverlay()}disconnectedCallback(){super.disconnectedCallback(),this.__scheduledOpen&&(cancelAnimationFrame(this.__scheduledOpen),this.__scheduledOpen=null),this._boundIosResizeListener&&window.removeEventListener("resize",this._boundIosResizeListener)}requestContentUpdate(){this.renderer&&this.renderer.call(this.owner,this._rendererRoot,this.owner,this.model)}close(e){let t=new CustomEvent("vaadin-overlay-close",{bubbles:!0,cancelable:!0,detail:{overlay:this,sourceEvent:e}});this.dispatchEvent(t),document.body.dispatchEvent(t),t.defaultPrevented||(this.opened=!1)}setBounds(e,t=!0){let i=this.$.overlay,s={...e};t&&"absolute"!==i.style.position&&(i.style.position="absolute"),Object.keys(s).forEach(e=>{null===s[e]||isNaN(s[e])||(s[e]=`${s[e]}px`)}),Object.assign(i.style,s)}_detectIosNavbar(){if(!this.opened)return;let e=window.innerHeight,t=window.innerWidth,i=document.documentElement.clientHeight;t>e&&i>e?this.style.setProperty("--vaadin-overlay-viewport-bottom",`${i-e}px`):this.style.setProperty("--vaadin-overlay-viewport-bottom","0px")}_shouldAddGlobalListeners(){return!this.modeless}_addGlobalListeners(){this.__hasGlobalListeners||(this.__hasGlobalListeners=!0,document.addEventListener("mousedown",this._boundMouseDownListener),document.addEventListener("mouseup",this._boundMouseUpListener),document.documentElement.addEventListener("click",this._boundOutsideClickListener,!0))}_removeGlobalListeners(){this.__hasGlobalListeners&&(this.__hasGlobalListeners=!1,document.removeEventListener("mousedown",this._boundMouseDownListener),document.removeEventListener("mouseup",this._boundMouseUpListener),document.documentElement.removeEventListener("click",this._boundOutsideClickListener,!0))}_rendererOrDataChanged(e,t,i,s){let n=this._oldOwner!==t||this._oldModel!==i;this._oldModel=i,this._oldOwner=t;let o=this._oldRenderer!==e,r=void 0!==this._oldRenderer;this._oldRenderer=e;let a=this._oldOpened!==s;this._oldOpened=s,o&&r&&(this._rendererRoot.innerHTML="",delete this._rendererRoot._$litPart$),s&&e&&(o||a||n)&&this.requestContentUpdate()}_modelessChanged(e){this.opened&&(this._shouldAddGlobalListeners()?this._addGlobalListeners():this._removeGlobalListeners()),e?this._exitModalState():this.opened&&this._enterModalState(),t5(this,"modeless",e)}_withBackdropChanged(e){t5(this,"with-backdrop",e)}_openedChanged(e,t){if(e){if(!this.isConnected){this.opened=!1;return}this._saveFocus(),this._animatedOpening(),this.__scheduledOpen=requestAnimationFrame(()=>{setTimeout(()=>{this._trapFocus();let e=new CustomEvent("vaadin-overlay-open",{detail:{overlay:this},bubbles:!0});this.dispatchEvent(e),document.body.dispatchEvent(e)})}),document.addEventListener("keydown",this._boundKeydownListener),this._shouldAddGlobalListeners()&&this._addGlobalListeners()}else t&&(this.__scheduledOpen&&(cancelAnimationFrame(this.__scheduledOpen),this.__scheduledOpen=null),this._resetFocus(),this._animatedClosing(),document.removeEventListener("keydown",this._boundKeydownListener),this._shouldAddGlobalListeners()&&this._removeGlobalListeners())}_hiddenChanged(e){e&&this.hasAttribute("closing")&&this._flushAnimation("closing")}_shouldAnimate(){let e=getComputedStyle(this),t=e.getPropertyValue("animation-name");return"none"!==e.getPropertyValue("display")&&t&&"none"!==t}_enqueueAnimation(e,t){let i=`__${e}Handler`,s=e=>{e&&e.target!==this||(t(),this.removeEventListener("animationend",s),delete this[i])};this[i]=s,this.addEventListener("animationend",s)}_flushAnimation(e){let t=`__${e}Handler`;"function"==typeof this[t]&&this[t]()}_animatedOpening(){this._isAttached&&this.hasAttribute("closing")&&this._flushAnimation("closing"),this._attachOverlay(),this._appendAttachedInstance(),this.bringToFront(),this.modeless||this._enterModalState(),t5(this,"opening",!0),this._shouldAnimate()?this._enqueueAnimation("opening",()=>{this._finishOpening()}):this._finishOpening()}_attachOverlay(){this.matches(":popover-open")||this.showPopover()}_finishOpening(){t5(this,"opening",!1)}_finishClosing(){this._detachOverlay(),this._removeAttachedInstance(),this.$.overlay.style.removeProperty("pointer-events"),t5(this,"closing",!1),this.dispatchEvent(new CustomEvent("vaadin-overlay-closed"))}_animatedClosing(){this.hasAttribute("opening")&&this._flushAnimation("opening"),this._isAttached&&(this._exitModalState(),t5(this,"closing",!0),this.dispatchEvent(new CustomEvent("vaadin-overlay-closing")),this._shouldAnimate()?this._enqueueAnimation("closing",()=>{this._finishClosing()}):this._finishClosing())}_detachOverlay(){this.hidePopover()}_mouseDownListener(e){this._mouseDownInside=e.composedPath().indexOf(this.$.overlay)>=0}_mouseUpListener(e){this._mouseUpInside=e.composedPath().indexOf(this.$.overlay)>=0}_shouldCloseOnOutsideClick(e){return this._last}_outsideClickListener(e){if(e.composedPath().includes(this.$.overlay)||this._mouseDownInside||this._mouseUpInside){this._mouseDownInside=!1,this._mouseUpInside=!1;return}if(!this._shouldCloseOnOutsideClick(e))return;let t=new CustomEvent("vaadin-overlay-outside-click",{cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}_keydownListener(e){if(this._last&&!e.defaultPrevented&&(this._shouldAddGlobalListeners()||e.composedPath().includes(this._focusTrapRoot))&&"Escape"===e.key){let t=new CustomEvent("vaadin-overlay-escape-press",{cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}}},ih=h`
234
244
  :host {
235
245
  align-items: flex-start;
236
246
  justify-content: flex-start;
@@ -257,7 +267,7 @@
257
267
  [part='overlay']:focus-visible {
258
268
  outline: none;
259
269
  }
260
- `,ih=[h`
270
+ `,ic=[h`
261
271
  :host {
262
272
  z-index: 200;
263
273
  position: fixed;
@@ -353,7 +363,7 @@
353
363
  border: 3px solid !important;
354
364
  }
355
365
  }
356
- `,id];class ic extends t8(il(eL(tz(ez(tD(ec)))))){static get is(){return"vaadin-menu-bar-overlay"}static get styles(){return ih}render(){return q`
366
+ `,ih];class iu extends t6(id(eP(tH(ez(tB(ec)))))){static get is(){return"vaadin-menu-bar-overlay"}static get styles(){return ic}static get lumoInjector(){return{...super.lumoInjector,includeBaseStyles:!0}}render(){return q`
357
367
  <div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
358
368
  <div part="overlay" id="overlay" tabindex="0">
359
369
  <div part="content" id="content">
@@ -361,7 +371,7 @@
361
371
  <slot name="submenu"></slot>
362
372
  </div>
363
373
  </div>
364
- `}}eT(ic);class iu{constructor(e,t){this.query=e,this.callback=t,this._boundQueryHandler=this._queryHandler.bind(this)}hostConnected(){this._removeListener(),this._mediaQuery=window.matchMedia(this.query),this._addListener(),this._queryHandler(this._mediaQuery)}hostDisconnected(){this._removeListener()}_addListener(){this._mediaQuery&&this._mediaQuery.addListener(this._boundQueryHandler)}_removeListener(){this._mediaQuery&&this._mediaQuery.removeListener(this._boundQueryHandler),this._mediaQuery=null}_queryHandler(e){"function"==typeof this.callback&&this.callback(e.matches)}}let ip=e=>class extends e{static get properties(){return{items:{type:Array,sync:!0},_positionTarget:{type:Object,sync:!0}}}constructor(){super(),this.__itemsOutsideClickListener=e=>{this._shouldCloseOnOutsideClick(e)&&this.dispatchEvent(new CustomEvent("items-outside-click"))},this.addEventListener("items-outside-click",()=>{this.items&&this.close()})}get _tagNamePrefix(){return"vaadin-context-menu"}connectedCallback(){super.connectedCallback(),document.documentElement.addEventListener("click",this.__itemsOutsideClickListener)}disconnectedCallback(){super.disconnectedCallback(),document.documentElement.removeEventListener("click",this.__itemsOutsideClickListener)}_shouldCloseOnOutsideClick(e){return!e.composedPath().some(e=>e.localName===`${this._tagNamePrefix}-overlay`)}__forwardFocus(){let e=this._overlayElement,t=e._contentRoot.firstElementChild;if(e.parentOverlay){let i=e.parentOverlay._contentRoot.querySelector("[expanded]");i&&i.hasAttribute("focused")&&t?t.focus():e.$.overlay.focus()}else t&&t.focus()}__openSubMenu(e,t){this.__updateSubMenuForItem(e,t);let i=this._overlayElement,s=e._overlayElement;s._setParentOverlay(i),i.hasAttribute("theme")?e.setAttribute("theme",i.getAttribute("theme")):e.removeAttribute("theme"),s.$.content.style.minWidth="",t.dispatchEvent(new CustomEvent("opensubmenu",{detail:{children:t._item.children}}))}__updateSubMenuForItem(e,t){e.items=t._item.children,e.listenOn=t,e._positionTarget=t,e._overlayElement.requestContentUpdate()}__createComponent(e){let t;return(t=e.component instanceof HTMLElement?e.component:document.createElement(e.component||`${this._tagNamePrefix}-item`))._hasVaadinItemMixin&&(t.setAttribute("role","menuitem"),t.tabIndex=-1),"hr"===t.localName?t.setAttribute("role","separator"):t.setAttribute("aria-haspopup","false"),this._setMenuItemTheme(t,e,this._theme),t._item=e,e.text&&(t.textContent=e.text),e.className&&t.setAttribute("class",e.className),this.__toggleMenuComponentAttribute(t,"menu-item-checked",e.checked),this.__toggleMenuComponentAttribute(t,"disabled",e.disabled),e.children&&e.children.length&&(this.__updateExpanded(t,!1),t.setAttribute("aria-haspopup","true")),t}__initListBox(){let e=document.createElement(`${this._tagNamePrefix}-list-box`);return this._theme&&e.setAttribute("theme",this._theme),e.addEventListener("selected-changed",t=>{let{value:i}=t.detail;if("number"==typeof i){let t=e.items[i]._item;e.selected=null,t.children||this.dispatchEvent(new CustomEvent("item-selected",{detail:{value:t}}))}}),e}__initOverlay(){let e=this._overlayElement;e.$.backdrop.addEventListener("click",()=>{this.close()}),e.addEventListener(it?"click":"mouseover",e=>{e.composedPath().includes(this._subMenu)||this.__showSubMenu(e)}),e.addEventListener("keydown",e=>{if(e.composedPath().includes(this._subMenu))return;let{key:t}=e,i=this.__isRTL,s="ArrowRight"===t,n="ArrowLeft"===t;!i&&s||i&&n||"Enter"===t||" "===t?this.__showSubMenu(e):!i&&n||i&&s||"Escape"===t?("Escape"===t&&e.stopPropagation(),this.close(),this.listenOn.focus()):"Tab"!==t||e.defaultPrevented||this.dispatchEvent(new CustomEvent("close-all-menus"))})}__initSubMenu(){let e=document.createElement(this.constructor.is);return e._modeless=!0,e.openOn="opensubmenu",this.addEventListener("opened-changed",e=>{e.detail.value||this._subMenu.close()}),e.addEventListener("close-all-menus",()=>{this.dispatchEvent(new CustomEvent("close-all-menus"))}),e.addEventListener("item-selected",e=>{let{detail:t}=e;this.dispatchEvent(new CustomEvent("item-selected",{detail:t}))}),this.addEventListener("close-all-menus",()=>{this._overlayElement.close()}),this.addEventListener("item-selected",e=>{let t=e.target,i=e.detail.value,s=t.items.indexOf(i);i.keepOpen&&s>-1&&t.opened?(t.__selectedIndex=s,t.requestContentUpdate()):i.keepOpen||this.close()}),e.addEventListener("opened-changed",e=>{if(!e.detail.value){let e=this._listBox.querySelector("[expanded]");e&&this.__updateExpanded(e,!1)}}),e}__showSubMenu(e,t=e.composedPath().find(e=>e.localName===`${this._tagNamePrefix}-item`)){if(!this.__openListenerActive)return;if(this._overlayElement.hasAttribute("opening"))return void requestAnimationFrame(()=>{this.__showSubMenu(e,t)});let i=this._subMenu,s=this._listBox.querySelector("[expanded]");if(t&&t!==s){let{children:e}=t._item,n=i._overlayElement._contentRoot.firstElementChild,o=n&&n.focused;if(s&&this.__updateExpanded(s,!1),e&&e.length||i.close(),!this.opened)return;e&&e.length?(this.__updateExpanded(t,!0),this.__openSubMenu(i,t)):o?i.listenOn.focus():this._listBox.focused||this._overlayElement.$.overlay.focus()}}__getListBox(){return this._overlayElement._contentRoot.querySelector(`${this._tagNamePrefix}-list-box`)}__itemsRenderer(e,t){this.__initMenu(e,t),this._subMenu.closeOn=t.closeOn,this._listBox.innerHTML="",t.items.forEach(e=>{let t=this.__createComponent(e);this._listBox.appendChild(t)})}_setMenuItemTheme(e,t,i){let s=e.getAttribute("theme")||i;null!=t.theme&&(s=Array.isArray(t.theme)?t.theme.join(" "):t.theme),this.__updateTheme(e,s)}__toggleMenuComponentAttribute(e,t,i){i?(e.setAttribute(t,""),e[`__has-${t}`]=!0):e[`__has-${t}`]&&(e.removeAttribute(t),e[`__has-${t}`]=!1)}__initMenu(e,t){if(e.firstElementChild)this.__updateTheme(this._listBox,this._theme);else{this.__initOverlay();let t=this.__initListBox();this._listBox=t,e.appendChild(t);let i=this.__initSubMenu();i.slot="submenu",this._subMenu=i,this.appendChild(i),requestAnimationFrame(()=>{this.__openListenerActive=!0})}}__updateExpanded(e,t){e.setAttribute("aria-expanded",t.toString()),e.toggleAttribute("expanded",t)}__updateTheme(e,t){t?e.setAttribute("theme",t):e.removeAttribute("theme")}},i_=e=>class extends ip(e){static get properties(){return{selector:{type:String},opened:{type:Boolean,reflectToAttribute:!0,observer:"_openedChanged",value:!1,notify:!0,readOnly:!0},openOn:{type:String,value:"vaadin-contextmenu",sync:!0},listenOn:{type:Object,sync:!0,value(){return this}},closeOn:{type:String,value:"click",observer:"_closeOnChanged",sync:!0},renderer:{type:Function,sync:!0},_modeless:{type:Boolean,sync:!0},_context:{type:Object,sync:!0},_phone:{type:Boolean},_fullscreen:{type:Boolean},_fullscreenMediaQuery:{type:String,value:"(max-width: 450px), (max-height: 450px)"}}}static get observers(){return["_targetOrOpenOnChanged(listenOn, openOn)","_rendererChanged(renderer, items)","_fullscreenChanged(_fullscreen)"]}constructor(){super(),this._boundOpen=this.open.bind(this),this._boundClose=this.close.bind(this),this._boundPreventDefault=this._preventDefault.bind(this),this._boundOnGlobalContextMenu=this._onGlobalContextMenu.bind(this)}connectedCallback(){super.connectedCallback(),this.__boundOnScroll=this.__onScroll.bind(this),window.addEventListener("scroll",this.__boundOnScroll,!0),this.__restoreOpened&&this._setOpened(!0)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.__boundOnScroll,!0),this.__restoreOpened=this.opened,this.close()}firstUpdated(){super.firstUpdated(),this._overlayElement=this.$.overlay,this.addController(new iu(this._fullscreenMediaQuery,e=>{this._fullscreen=e}))}_onOverlayOpened(e){if(e.target!==this._overlayElement)return;let t=e.detail.value;this._setOpened(t),t&&this.__alignOverlayPosition()}_onVaadinOverlayOpen(e){e.target===this._overlayElement&&(this.__alignOverlayPosition(),this._overlayElement.style.visibility="",this.__forwardFocus())}_onVaadinOverlayClosed(){this.dispatchEvent(new CustomEvent("closed"))}_targetOrOpenOnChanged(e,t){this._oldListenOn&&this._oldOpenOn&&(this._unlisten(this._oldListenOn,this._oldOpenOn,this._boundOpen),this._oldListenOn.style.webkitTouchCallout="",this._oldListenOn.style.webkitUserSelect="",this._oldListenOn.style.userSelect="",this._oldListenOn=null,this._oldOpenOn=null),e&&t&&(this._listen(e,t,this._boundOpen),this._oldListenOn=e,this._oldOpenOn=t)}_fullscreenChanged(e){this._phone=e}__setListenOnUserSelect(e){let t=e?"none":"";this.listenOn.style.webkitTouchCallout=t,this.listenOn.style.webkitUserSelect=t,this.listenOn.style.userSelect=t,e&&document.getSelection().removeAllRanges()}_closeOnChanged(e,t){let i="vaadin-overlay-outside-click",s=this._overlayElement;t&&this._unlisten(s,t,this._boundClose),e?(this._listen(s,e,this._boundClose),s.removeEventListener(i,this._boundPreventDefault)):s.addEventListener(i,this._boundPreventDefault)}_preventDefault(e){e.preventDefault()}_openedChanged(e,t){e?document.documentElement.addEventListener("contextmenu",this._boundOnGlobalContextMenu,!0):t&&document.documentElement.removeEventListener("contextmenu",this._boundOnGlobalContextMenu,!0),this.__setListenOnUserSelect(e)}requestContentUpdate(){this._overlayElement&&(this.__preserveMenuState(),this._overlayElement.requestContentUpdate(),this.__restoreMenuState())}_rendererChanged(e,t){if(t){if(e)throw Error("The items API cannot be used together with a renderer");"click"===this.closeOn&&(this.closeOn="")}}close(){this._setOpened(!1)}_contextTarget(e){if(this.selector){let t=this.listenOn.querySelectorAll(this.selector);return Array.prototype.filter.call(t,t=>e.composedPath().indexOf(t)>-1)[0]}return this.listenOn&&this.listenOn!==this&&this.position?this.listenOn:e.target}open(e){!(this._overlayElement&&e.composedPath().includes(this._overlayElement))&&e&&!this.opened&&(this._context={detail:e.detail,target:this._contextTarget(e)},this._context.target&&(e.preventDefault(),e.stopPropagation(),this.__x=this._getEventCoordinate(e,"x"),this.__pageXOffset=window.pageXOffset,this.__y=this._getEventCoordinate(e,"y"),this.__pageYOffset=window.pageYOffset,this._overlayElement.style.visibility="hidden",this._setOpened(!0)))}__preserveMenuState(){let e=this.__getListBox();e&&(this.__focusedIndex=e.items.indexOf(e.focused),this._subMenu&&this._subMenu.opened&&(this.__subMenuIndex=e.items.indexOf(this._subMenu.listenOn)))}__restoreMenuState(){let e=this.__focusedIndex,t=this.__subMenuIndex,i=this.__selectedIndex,s=this.__getListBox();if(s){if(s._observer.flush(),t>-1){let e=s.items[t];e?Array.isArray(e._item.children)&&e._item.children.length?(this.__updateSubMenuForItem(this._subMenu,e),this._subMenu.requestContentUpdate()):(this._subMenu.close(),this.__focusItem(e)):s.focus()}this.__focusItem(i>-1?s.children[i]:s.items[e])}this.__focusedIndex=void 0,this.__subMenuIndex=void 0,this.__selectedIndex=void 0}__focusItem(e){e&&e.focus({focusVisible:tg})}__onScroll(){if(!this.opened||this.position)return;let e=window.pageYOffset-this.__pageYOffset,t=window.pageXOffset-this.__pageXOffset;this.__adjustPosition("left",-t),this.__adjustPosition("right",t),this.__adjustPosition("top",-e),this.__adjustPosition("bottom",e),this.__pageYOffset+=e,this.__pageXOffset+=t}__adjustPosition(e,t){let i=this._overlayElement.style;i[e]=`${(parseInt(i[e])||0)+t}px`}__alignOverlayPosition(){let e=this._overlayElement;if(e.positionTarget)return;let t=e.style;["top","right","bottom","left"].forEach(e=>t.removeProperty(e)),["right-aligned","end-aligned","bottom-aligned"].forEach(t=>e.removeAttribute(t));let{xMax:i,xMin:s,yMax:n}=e.getBoundaries(),o=this.__x,r=this.__y,a=document.documentElement.clientWidth,l=document.documentElement.clientHeight;this.__isRTL?o>a/2||o>s?t.right=`${Math.max(0,a-o)}px`:(t.left=`${o}px`,this._setEndAligned(e)):o<a/2||o<i?t.left=`${o}px`:(t.right=`${Math.max(0,a-o)}px`,this._setEndAligned(e)),r<l/2||r<n?t.top=`${r}px`:(t.bottom=`${Math.max(0,l-r)}px`,e.setAttribute("bottom-aligned",""))}_setEndAligned(e){e.setAttribute("end-aligned",""),this.__isRTL||e.setAttribute("right-aligned","")}_getEventCoordinate(e,t){if(e.detail instanceof Object){if(e.detail[t])return e.detail[t];else if(e.detail.sourceEvent)return this._getEventCoordinate(e.detail.sourceEvent,t)}else{let i=`client${t.toUpperCase()}`,s=e.changedTouches?e.changedTouches[0][i]:e[i];if(0===s){let i=e.target.getBoundingClientRect();return"x"===t?i.left:i.top+i.height}return s}}_listen(e,t,i){ti[t]?ta(e,t,i):e.addEventListener(t,i)}_unlisten(e,t,i){if(ti[t])ti[t]&&function(e,t,i){let s=ti[t],n=s.deps,o=s.name,r=e[eY];if(r)for(let t=0,i,s;t<n.length;t++){var a;(s=r[i=n[t]])&&s[o]&&(s[o]=(s[o]||1)-1,s._count=(s._count||1)-1,0===s._count&&e.removeEventListener(i,tr,void e5(a=i)))}e.removeEventListener(t,i)}(e,t,i);else e.removeEventListener(t,i)}__createMouseEvent(e,t,i){return new MouseEvent(e,{bubbles:!0,composed:!0,cancelable:!0,clientX:t,clientY:i})}__focusClosestFocusable(e){let t=e;for(;t;){if(t instanceof HTMLElement&&tx(t))return void t.focus();t=t.parentNode||t.host}}__contextMenuAt(e,t){let i=tn(e,t);i&&queueMicrotask(()=>{i.dispatchEvent(this.__createMouseEvent("mousedown",e,t)),i.dispatchEvent(this.__createMouseEvent("mouseup",e,t)),this.__focusClosestFocusable(i),i.dispatchEvent(this.__createMouseEvent("contextmenu",e,t))})}_onGlobalContextMenu(e){e.shiftKey||(t6||ie||(e.stopPropagation(),this._overlayElement.__focusRestorationController.focusNode=null,this._overlayElement.addEventListener("vaadin-overlay-closed",t=>{t.target===this._overlayElement&&this.__contextMenuAt(e.clientX,e.clientY)},{once:!0})),e.preventDefault(),this.close())}};class iv extends i_(tB(ez(ec))){static get is(){return"vaadin-menu-bar-submenu"}static get styles(){return h`
374
+ `}}e$(iu);class ip{constructor(e,t){this.query=e,this.callback=t,this._boundQueryHandler=this._queryHandler.bind(this)}hostConnected(){this._removeListener(),this._mediaQuery=window.matchMedia(this.query),this._addListener(),this._queryHandler(this._mediaQuery)}hostDisconnected(){this._removeListener()}_addListener(){this._mediaQuery&&this._mediaQuery.addListener(this._boundQueryHandler)}_removeListener(){this._mediaQuery&&this._mediaQuery.removeListener(this._boundQueryHandler),this._mediaQuery=null}_queryHandler(e){"function"==typeof this.callback&&this.callback(e.matches)}}let i_=0;class iv extends EventTarget{static generateId(e,t="default"){return`${t}-${e.localName}-${i_++}`}constructor(e,t,i,s={}){super();const{initializer:n,multiple:o,observe:r,useUniqueId:a,uniqueIdPrefix:l}=s;this.host=e,this.slotName=t,this.tagName=i,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof o&&o,this.slotInitializer=n,o&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(e,l||t))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let e=this.getSlotChild();e?(this.node=e,this.initAddedNode(e)):(e=this.attachDefaultNode(),this.initNode(e))}initMultiple(){let e=this.getSlotChildren();if(0===e.length){let e=this.attachDefaultNode();e&&(this.nodes=[e],this.initNode(e))}else this.nodes=e,e.forEach(e=>{this.initAddedNode(e)})}attachDefaultNode(){let{host:e,slotName:t,tagName:i}=this,s=this.defaultNode;return!s&&i&&(s=document.createElement(i))instanceof Element&&(""!==t&&s.setAttribute("slot",t),this.defaultNode=s),s&&(this.node=s,e.appendChild(s)),s}getSlotChildren(){let{slotName:e}=this;return Array.from(this.host.childNodes).filter(t=>!(t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("data-slot-ignore"))&&(t.nodeType===Node.ELEMENT_NODE&&t.slot===e||t.nodeType===Node.TEXT_NODE&&t.textContent.trim()&&""===e))}getSlotChild(){return this.getSlotChildren()[0]}initNode(e){let{slotInitializer:t}=this;t&&t(e,this.host)}initCustomNode(e){}teardownNode(e){}initAddedNode(e){e!==this.defaultNode&&(this.initCustomNode(e),this.initNode(e))}observeSlot(){let{slotName:e}=this,t=""===e?"slot:not([name])":`slot[name=${e}]`,i=this.host.shadowRoot.querySelector(t);this.__slotObserver=new tG(i,({addedNodes:e,removedNodes:t})=>{let i=this.multiple?this.nodes:[this.node],s=e.filter(e=>(e.nodeType!==Node.TEXT_NODE||""!==e.textContent.trim())&&!i.includes(e)&&!(e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-slot-ignore")));t.length&&(this.nodes=i.filter(e=>!t.includes(e)),t.forEach(e=>{this.teardownNode(e)})),s?.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...i,...s].filter(e=>e!==this.defaultNode),s.forEach(e=>{this.initAddedNode(e)})):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))})}}class im extends iv{constructor(e){super(e,"tooltip")}initCustomNode(e){e.manual=!0,e.generator||=({item:e})=>e?.tooltip}_getItem(e){return e._item}_getDefaultPosition(e){let t=this._getItem(e);return t.children?.length>0&&!t.disabled?"start":"end"}setTarget(e){let t=this.node;if(!t)return;let i=e?this._getItem(e):null;i?.tooltip?(t.target=e,t.context={item:i},t._position=i.tooltipPosition||this._getDefaultPosition(e)):(t.target=null,t.context={item:null},this.close(!0))}open({trigger:e}){let t=this.node;t?.isConnected&&t.target&&t._stateController.open({hover:"hover"===e,focus:"focus"===e})}bringToFront(){let e=this.node;e?._overlayElement?.bringToFront()}close(e){let t=this.node;t?._stateController.close(e)}}let ig=e=>class extends e{static get properties(){return{items:{type:Array,sync:!0},_positionTarget:{type:Object,sync:!0}}}constructor(){super(),this.__itemsOutsideClickListener=e=>{this._shouldCloseOnOutsideClick(e)&&this.dispatchEvent(new CustomEvent("items-outside-click"))},this.addEventListener("items-outside-click",()=>{this.items&&this.close()})}get _tagNamePrefix(){return"vaadin-context-menu"}connectedCallback(){super.connectedCallback(),document.documentElement.addEventListener("click",this.__itemsOutsideClickListener)}disconnectedCallback(){super.disconnectedCallback(),document.documentElement.removeEventListener("click",this.__itemsOutsideClickListener),this._tooltipController.setTarget(null)}_shouldCloseOnOutsideClick(e){return!e.composedPath().some(e=>e.localName===`${this._tagNamePrefix}-overlay`)}__forwardFocus(){let e=this._overlayElement,t=e._contentRoot.firstElementChild;if(e.parentOverlay){let i=e.parentOverlay._contentRoot.querySelector("[expanded]");i?.hasAttribute("focused")&&t?t.focus():e.$.overlay.focus()}else t&&t.focus()}__openSubMenu(e,t){this.__updateSubMenuForItem(e,t);let i=this._overlayElement,s=e._overlayElement;s._setParentOverlay(i),i.hasAttribute("theme")?e.setAttribute("theme",i.getAttribute("theme")):e.removeAttribute("theme"),s.$.content.style.minWidth="",t.dispatchEvent(new CustomEvent("opensubmenu",{detail:{children:t._item.children}}))}__updateSubMenuForItem(e,t){e.items=t._item.children,e.listenOn=t,e._positionTarget=t,e._overlayElement.requestContentUpdate()}__createComponent(e){let t;return(t=e.component instanceof HTMLElement?e.component:document.createElement(e.component||`${this._tagNamePrefix}-item`))._hasVaadinItemMixin&&(t.setAttribute("role","menuitem"),t.tabIndex=-1),"hr"===t.localName?t.setAttribute("role","separator"):t.setAttribute("aria-haspopup","false"),this._setMenuItemTheme(t,e,this._theme),t._item=e,e.text&&(t.textContent=e.text),e.className&&t.setAttribute("class",e.className),this.__toggleMenuComponentAttribute(t,"menu-item-checked",e.checked),this.__toggleMenuComponentAttribute(t,"disabled",e.disabled),e.children&&e.children.length&&(this.__updateExpanded(t,!1),t.setAttribute("aria-haspopup","true")),t}__initListBox(){let e=document.createElement(`${this._tagNamePrefix}-list-box`);return this._theme&&e.setAttribute("theme",this._theme),e.addEventListener("mouseover",e=>{let t=e.target.closest(`${this._tagNamePrefix}-item`);this._tooltipController.setTarget(t),this._tooltipController.open({trigger:"hover"})}),e.addEventListener("mouseleave",()=>{this._tooltipController.close(!0)}),e.addEventListener("focusin",e=>{if(!tg)return;let t=e.target.closest(`${this._tagNamePrefix}-item`);this._tooltipController.setTarget(t),this._tooltipController.open({trigger:"focus"})}),e.addEventListener("selected-changed",t=>{let{value:i}=t.detail;if("number"==typeof i){let t=e.items[i]._item;e.selected=null,t.children||this.dispatchEvent(new CustomEvent("item-selected",{detail:{value:t}}))}}),e}__initOverlay(){let e=this._overlayElement;e.$.backdrop.addEventListener("click",()=>{this.close()}),e.addEventListener(ii?"click":"mouseover",e=>{e.composedPath().includes(this._subMenu)||this.__showSubMenu(e)}),e.addEventListener("keydown",e=>{if(e.composedPath().includes(this._subMenu))return;let{key:t}=e,i=this.__isRTL,s="ArrowRight"===t,n="ArrowLeft"===t;!i&&s||i&&n||"Enter"===t||" "===t?this.__showSubMenu(e):!i&&n||i&&s||"Escape"===t?("Escape"===t&&e.stopPropagation(),this.close(),this.listenOn.focus()):"Tab"!==t||e.defaultPrevented||this.dispatchEvent(new CustomEvent("close-all-menus"))})}__initSubMenu(){let e=document.createElement(this.constructor.is);return e._tooltipController=this._tooltipController,e.__parentMenu=this,e._modeless=!0,e.openOn="opensubmenu",this.addEventListener("opened-changed",e=>{e.detail.value||this._subMenu.close()}),e.addEventListener("close-all-menus",()=>{this.dispatchEvent(new CustomEvent("close-all-menus"))}),e.addEventListener("item-selected",e=>{let{detail:t}=e;this.dispatchEvent(new CustomEvent("item-selected",{detail:t}))}),this.addEventListener("close-all-menus",()=>{this.close()}),this.addEventListener("item-selected",e=>{let t=e.target,i=e.detail.value,s=t.items.indexOf(i);i.keepOpen&&s>-1&&t.opened?(t.__selectedIndex=s,t.requestContentUpdate()):i.keepOpen||this.close()}),e.addEventListener("opened-changed",e=>{if(e.detail.value)this._tooltipController.bringToFront();else{let e=this._listBox.querySelector("[expanded]");e&&this.__updateExpanded(e,!1)}}),e}__showSubMenu(e,t=e.composedPath().find(e=>e.localName===`${this._tagNamePrefix}-item`)){if(!this.__openListenerActive)return;if(this._overlayElement.hasAttribute("opening"))return void requestAnimationFrame(()=>{this.__showSubMenu(e,t)});let i=this._subMenu,s=this._listBox.querySelector("[expanded]");if(t&&t!==s&&!t.disabled){let{children:e}=t._item,n=i._overlayElement._contentRoot.firstElementChild,o=n?.focused;if(s&&this.__updateExpanded(s,!1),e&&e.length||i.close(),!this.opened)return;e?.length?(this.__updateExpanded(t,!0),this.__openSubMenu(i,t)):o?i.listenOn.focus():this._listBox.focused||this._overlayElement.$.overlay.focus()}t?.disabled&&i.close()}__getListBox(){return this._overlayElement._contentRoot.querySelector(`${this._tagNamePrefix}-list-box`)}__itemsRenderer(e,t){this.__initMenu(e,t),this._subMenu.closeOn=t.closeOn,this._listBox.innerHTML="",t.items.forEach(e=>{let t=this.__createComponent(e);this._listBox.appendChild(t)})}_setMenuItemTheme(e,t,i){let s=e.getAttribute("theme")||i;null!=t.theme&&(s=Array.isArray(t.theme)?t.theme.join(" "):t.theme),this.__updateTheme(e,s)}__toggleMenuComponentAttribute(e,t,i){i?(e.setAttribute(t,""),e[`__has-${t}`]=!0):e[`__has-${t}`]&&(e.removeAttribute(t),e[`__has-${t}`]=!1)}__initMenu(e,t){if(e.firstElementChild)this.__updateTheme(this._listBox,this._theme);else{this.__initOverlay();let t=this.__initListBox();this._listBox=t,e.appendChild(t);let i=this.__initSubMenu();i.slot="submenu",this._subMenu=i,this.appendChild(i),requestAnimationFrame(()=>{this.__openListenerActive=!0})}}__updateExpanded(e,t){e.setAttribute("aria-expanded",t.toString()),e.toggleAttribute("expanded",t)}__updateTheme(e,t){t?e.setAttribute("theme",t):e.removeAttribute("theme")}close(){this.__parentMenu||this._tooltipController.close(!0)}},ib=e=>class extends ig(e){static get properties(){return{selector:{type:String},opened:{type:Boolean,reflectToAttribute:!0,observer:"_openedChanged",value:!1,notify:!0,readOnly:!0,sync:!0},openOn:{type:String,value:"vaadin-contextmenu",sync:!0},listenOn:{type:Object,sync:!0,value(){return this}},closeOn:{type:String,value:"click",observer:"_closeOnChanged",sync:!0},renderer:{type:Function,sync:!0},_modeless:{type:Boolean,sync:!0},_context:{type:Object,sync:!0},_phone:{type:Boolean},_fullscreen:{type:Boolean},_fullscreenMediaQuery:{type:String,value:"(max-width: 450px), (max-height: 450px)"}}}static get observers(){return["_targetOrOpenOnChanged(listenOn, openOn)","_rendererChanged(renderer, items)","_fullscreenChanged(_fullscreen)"]}constructor(){super(),this._boundOpen=this.open.bind(this),this._boundClose=this.close.bind(this),this._boundPreventDefault=this._preventDefault.bind(this),this.__onGlobalContextMenu=this.__onGlobalContextMenu.bind(this)}connectedCallback(){super.connectedCallback(),this.__boundOnScroll=this.__onScroll.bind(this),window.addEventListener("scroll",this.__boundOnScroll,!0),document.documentElement.addEventListener("contextmenu",this.__onGlobalContextMenu,!0),this.__restoreOpened&&this._setOpened(!0)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.__boundOnScroll,!0),document.documentElement.removeEventListener("contextmenu",this.__onGlobalContextMenu,!0),this.__restoreOpened=this.opened,setTimeout(()=>{this.isConnected||this.close()})}firstUpdated(){super.firstUpdated(),this._overlayElement=this.$.overlay,this.addController(new ip(this._fullscreenMediaQuery,e=>{this._fullscreen=e})),this._tooltipController||(this._tooltipController=new im(this),this.addController(this._tooltipController))}_onOverlayOpened(e){if(e.target!==this._overlayElement)return;let t=e.detail.value;this._setOpened(t),t&&this.__alignOverlayPosition()}_onVaadinOverlayOpen(e){e.target===this._overlayElement&&(this.__alignOverlayPosition(),this._overlayElement.style.visibility="",this.__forwardFocus())}_onVaadinOverlayClosed(){this.dispatchEvent(new CustomEvent("closed"))}_targetOrOpenOnChanged(e,t){this._oldListenOn&&this._oldOpenOn&&(this._unlisten(this._oldListenOn,this._oldOpenOn,this._boundOpen),this._oldListenOn.style.webkitTouchCallout="",this._oldListenOn.style.webkitUserSelect="",this._oldListenOn.style.userSelect="",this._oldListenOn=null,this._oldOpenOn=null),e&&t&&(this._listen(e,t,this._boundOpen),this._oldListenOn=e,this._oldOpenOn=t)}_fullscreenChanged(e){this._phone=e}__setListenOnUserSelect(e){let t=e?"none":"";this.listenOn.style.webkitTouchCallout=t,this.listenOn.style.webkitUserSelect=t,this.listenOn.style.userSelect=t,e&&document.getSelection().removeAllRanges()}_closeOnChanged(e,t){let i="vaadin-overlay-outside-click",s=this._overlayElement;t&&this._unlisten(s,t,this._boundClose),e?(this._listen(s,e,this._boundClose),s.removeEventListener(i,this._boundPreventDefault)):s.addEventListener(i,this._boundPreventDefault)}_preventDefault(e){e.preventDefault()}_openedChanged(e){this.__setListenOnUserSelect(e)}requestContentUpdate(){this._overlayElement&&(this.__preserveMenuState(),this._overlayElement.requestContentUpdate(),this.__restoreMenuState())}_rendererChanged(e,t){if(t){if(e)throw Error("The items API cannot be used together with a renderer");"click"===this.closeOn&&(this.closeOn="")}}close(){super.close(),this._setOpened(!1)}__getComposedPath(e){return e.__composedPath??e.detail?.sourceEvent?.__composedPath??e.composedPath()}_contextTarget(e){if(this.selector){let t=this.listenOn.querySelectorAll(this.selector);return Array.prototype.filter.call(t,t=>this.__getComposedPath(e).indexOf(t)>-1)[0]}return this.listenOn&&this.listenOn!==this&&this.position?this.listenOn:e.target}open(e){!(this._overlayElement&&this.__getComposedPath(e).includes(this._overlayElement))&&e&&!this.opened&&(this._context={detail:e.detail,target:this._contextTarget(e)},this._context.target&&(e.preventDefault(),e.stopPropagation(),this.__x=this._getEventCoordinate(e,"x"),this.__pageXOffset=window.pageXOffset,this.__y=this._getEventCoordinate(e,"y"),this.__pageYOffset=window.pageYOffset,this._overlayElement.style.visibility="hidden",this._setOpened(!0)))}__preserveMenuState(){let e=this.__getListBox();e&&(this.__focusedIndex=e.items.indexOf(e.focused),this._subMenu&&this._subMenu.opened&&(this.__subMenuIndex=e.items.indexOf(this._subMenu.listenOn)))}__restoreMenuState(){let e=this.__focusedIndex,t=this.__subMenuIndex,i=this.__selectedIndex,s=this.__getListBox();if(s){if(s._observer.flush(),t>-1){let e=s.items[t];e?Array.isArray(e._item.children)&&e._item.children.length?(this.__updateSubMenuForItem(this._subMenu,e),this._subMenu.requestContentUpdate()):(this._subMenu.close(),this.__focusItem(e)):s.focus()}this.__focusItem(i>-1?s.children[i]:s.items[e])}this.__focusedIndex=void 0,this.__subMenuIndex=void 0,this.__selectedIndex=void 0}__focusItem(e){e&&e.focus({focusVisible:tg})}__onScroll(){if(!this.opened||this.position)return;let e=window.pageYOffset-this.__pageYOffset,t=window.pageXOffset-this.__pageXOffset;this.__adjustPosition("left",-t),this.__adjustPosition("right",t),this.__adjustPosition("top",-e),this.__adjustPosition("bottom",e),this.__pageYOffset+=e,this.__pageXOffset+=t}__adjustPosition(e,t){let i=this._overlayElement.style;i[e]=`${(parseInt(i[e])||0)+t}px`}__alignOverlayPosition(){let e=this._overlayElement;if(e.positionTarget)return;let t=e.style;["top","right","bottom","left"].forEach(e=>t.removeProperty(e)),["right-aligned","end-aligned","bottom-aligned"].forEach(t=>e.removeAttribute(t));let{xMax:i,xMin:s,yMax:n}=e.getBoundaries(),o=this.__x,r=this.__y,a=document.documentElement.clientWidth,l=document.documentElement.clientHeight;this.__isRTL?o>a/2||o>s?t.right=`${Math.max(0,a-o)}px`:(t.left=`${o}px`,this._setEndAligned(e)):o<a/2||o<i?t.left=`${o}px`:(t.right=`${Math.max(0,a-o)}px`,this._setEndAligned(e)),r<l/2||r<n?t.top=`${r}px`:(t.bottom=`${Math.max(0,l-r)}px`,e.setAttribute("bottom-aligned",""))}_setEndAligned(e){e.setAttribute("end-aligned",""),this.__isRTL||e.setAttribute("right-aligned","")}_getEventCoordinate(e,t){if(e.detail instanceof Object){if(e.detail[t])return e.detail[t];else if(e.detail.sourceEvent)return this._getEventCoordinate(e.detail.sourceEvent,t)}else{let i=`client${t.toUpperCase()}`,s=e.changedTouches?e.changedTouches[0][i]:e[i];if(0===s){let i=(this.__getComposedPath(e)[0]||e.target).getBoundingClientRect();return"x"===t?i.left:i.top+i.height}return s}}_listen(e,t,i){ti[t]?ta(e,t,i):e.addEventListener(t,i)}_unlisten(e,t,i){if(ti[t])ti[t]&&function(e,t,i){let s=ti[t],n=s.deps,o=s.name,r=e[eY];if(r)for(let t=0,i,s;t<n.length;t++){var a;s=r[i=n[t]],s?.[o]&&(s[o]=(s[o]||1)-1,s._count=(s._count||1)-1,0===s._count&&e.removeEventListener(i,tr,void e5(a=i)))}e.removeEventListener(t,i)}(e,t,i);else e.removeEventListener(t,i)}__createMouseEvent(e,t,i){return new MouseEvent(e,{bubbles:!0,composed:!0,cancelable:!0,clientX:t,clientY:i})}__focusClosestFocusable(e){let t=e;for(;t;){if(t instanceof HTMLElement&&tx(t))return void t.focus();t=t.parentNode||t.host}}__contextMenuAt(e,t){let i=tn(e,t);i&&queueMicrotask(()=>{i.dispatchEvent(this.__createMouseEvent("mousedown",e,t)),i.dispatchEvent(this.__createMouseEvent("mouseup",e,t)),this.__focusClosestFocusable(i),i.dispatchEvent(this.__createMouseEvent("contextmenu",e,t))})}__onGlobalContextMenu(e){this.opened&&(e.shiftKey||(t9||it||(e.stopPropagation(),this._overlayElement.__focusRestorationController.focusNode=null,this._overlayElement.addEventListener("vaadin-overlay-closed",t=>{t.target===this._overlayElement&&this.__contextMenuAt(e.clientX,e.clientY)},{once:!0})),e.preventDefault(),this.close()))}};class iy extends ib(tF(ez(ec))){static get is(){return"vaadin-menu-bar-submenu"}static get styles(){return h`
365
375
  :host {
366
376
  display: block;
367
377
  }
@@ -369,7 +379,7 @@
369
379
  :host([hidden]) {
370
380
  display: none !important;
371
381
  }
372
- `}static get properties(){return{isRoot:{type:Boolean,reflectToAttribute:!0,sync:!0}}}constructor(){super(),this.openOn="opensubmenu"}get _tagNamePrefix(){return"vaadin-menu-bar"}render(){return q`
382
+ `}static get properties(){return{isRoot:{type:Boolean,reflectToAttribute:!0,sync:!0}}}constructor(){super(),this.openOn="opensubmenu"}firstUpdated(e){this._tooltipController=this.parentElement._tooltipController,super.firstUpdated(e)}get _tagNamePrefix(){return"vaadin-menu-bar"}render(){return q`
373
383
  <vaadin-menu-bar-overlay
374
384
  id="overlay"
375
385
  .owner="${this}"
@@ -389,14 +399,14 @@
389
399
  <slot name="overlay"></slot>
390
400
  <slot name="submenu" slot="submenu"></slot>
391
401
  </vaadin-menu-bar-overlay>
392
- `}_openedChanged(){}close(){super.close(),this.hasAttribute("is-root")&&this.parentElement._close()}_shouldCloseOnOutsideClick(e){return!(this.hasAttribute("is-root")&&e.composedPath().includes(this.listenOn))&&super._shouldCloseOnOutsideClick(e)}}eT(iv);let im=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,ig=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;function ib(e,t){if("function"!=typeof e)return;let i=im.exec(e.toString());if(i)try{e=Function(i[1])}catch(e){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",e)}return e(t)}window.Vaadin=window.Vaadin||{};let iy=function(e,t){if(window.Vaadin.developmentMode)return ib(e,t)};function iw(){}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=function(){try{if(localStorage.getItem("vaadin.developmentmode.force"))return!0;if(!(["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0))return!1;if(ig)return!(ig&&Object.keys(ig).map(e=>ig[e]).filter(e=>e.productionMode).length>0);return!ib(function(){return!0})}catch(e){return!1}}());let ix=function(){if("function"==typeof iy)return iy(iw)};window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){ix()};let iC=new Set,iE=e=>class extends eL(e){static _ensureRegistrations(){let{is:e}=this;if(e&&!iC.has(e)){window.Vaadin.registrations.push(this),iC.add(e);let s=window.Vaadin.developmentModeCallback;if(s){var i;i=t=tW.debounce(t,eG,()=>{s["vaadin-usage-statistics"]()}),tV.add(i)}}}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.'),this.constructor._ensureRegistrations()}},iA=0;class ik extends EventTarget{static generateId(e,t="default"){return`${t}-${e.localName}-${iA++}`}constructor(e,t,i,s={}){super();const{initializer:n,multiple:o,observe:r,useUniqueId:a,uniqueIdPrefix:l}=s;this.host=e,this.slotName=t,this.tagName=i,this.observe="boolean"!=typeof r||r,this.multiple="boolean"==typeof o&&o,this.slotInitializer=n,o&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(e,l||t))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let e=this.getSlotChild();e?(this.node=e,this.initAddedNode(e)):(e=this.attachDefaultNode(),this.initNode(e))}initMultiple(){let e=this.getSlotChildren();if(0===e.length){let e=this.attachDefaultNode();e&&(this.nodes=[e],this.initNode(e))}else this.nodes=e,e.forEach(e=>{this.initAddedNode(e)})}attachDefaultNode(){let{host:e,slotName:t,tagName:i}=this,s=this.defaultNode;return!s&&i&&(s=document.createElement(i))instanceof Element&&(""!==t&&s.setAttribute("slot",t),this.defaultNode=s),s&&(this.node=s,e.appendChild(s)),s}getSlotChildren(){let{slotName:e}=this;return Array.from(this.host.childNodes).filter(t=>!(t.nodeType===Node.ELEMENT_NODE&&t.hasAttribute("data-slot-ignore"))&&(t.nodeType===Node.ELEMENT_NODE&&t.slot===e||t.nodeType===Node.TEXT_NODE&&t.textContent.trim()&&""===e))}getSlotChild(){return this.getSlotChildren()[0]}initNode(e){let{slotInitializer:t}=this;t&&t(e,this.host)}initCustomNode(e){}teardownNode(e){}initAddedNode(e){e!==this.defaultNode&&(this.initCustomNode(e),this.initNode(e))}observeSlot(){let{slotName:e}=this,t=""===e?"slot:not([name])":`slot[name=${e}]`,i=this.host.shadowRoot.querySelector(t);this.__slotObserver=new tq(i,({addedNodes:e,removedNodes:t})=>{let i=this.multiple?this.nodes:[this.node],s=e.filter(e=>(e.nodeType!==Node.TEXT_NODE||""!==e.textContent.trim())&&!i.includes(e)&&!(e.nodeType===Node.ELEMENT_NODE&&e.hasAttribute("data-slot-ignore")));t.length&&(this.nodes=i.filter(e=>!t.includes(e)),t.forEach(e=>{this.teardownNode(e)})),s&&s.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...i,...s].filter(e=>e!==this.defaultNode),s.forEach(e=>{this.initAddedNode(e)})):(this.node&&this.node.remove(),this.node=s[0],this.initAddedNode(this.node)))})}}class iO extends ik{constructor(e){super(e,"tooltip"),this.setTarget(e),this.__onContentChange=this.__onContentChange.bind(this)}initCustomNode(e){e.target=this.target,void 0!==this.ariaTarget&&(e.ariaTarget=this.ariaTarget),void 0!==this.context&&(e.context=this.context),void 0!==this.manual&&(e.manual=this.manual),void 0!==this.opened&&(e.opened=this.opened),void 0!==this.position&&(e._position=this.position),void 0!==this.shouldShow&&(e.shouldShow=this.shouldShow),this.manual||this.host.setAttribute("has-tooltip",""),this.__notifyChange(e),e.addEventListener("content-changed",this.__onContentChange)}teardownNode(e){this.manual||this.host.removeAttribute("has-tooltip"),e.removeEventListener("content-changed",this.__onContentChange),this.__notifyChange(null)}setAriaTarget(e){this.ariaTarget=e;let t=this.node;t&&(t.ariaTarget=e)}setContext(e){this.context=e;let t=this.node;t&&(t.context=e)}setManual(e){this.manual=e;let t=this.node;t&&(t.manual=e)}setOpened(e){this.opened=e;let t=this.node;t&&(t.opened=e)}setPosition(e){this.position=e;let t=this.node;t&&(t._position=e)}setShouldShow(e){this.shouldShow=e;let t=this.node;t&&(t.shouldShow=e)}setTarget(e){this.target=e;let t=this.node;t&&(t.target=e)}__onContentChange(e){this.__notifyChange(e.target)}__notifyChange(e){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:e}}))}}let iS=h`
402
+ `}_openedChanged(){}__onGlobalContextMenu(){}close(){super.close(),this.hasAttribute("is-root")&&this.parentElement._close()}_shouldCloseOnOutsideClick(e){return!(this.hasAttribute("is-root")&&e.composedPath().includes(this.listenOn))&&super._shouldCloseOnOutsideClick(e)}}e$(iy);let iw=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,ix=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;function iC(e,t){if("function"!=typeof e)return;let i=iw.exec(e.toString());if(i)try{e=Function(i[1])}catch(e){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",e)}return e(t)}window.Vaadin=window.Vaadin||{};let iE=function(e,t){if(window.Vaadin.developmentMode)return iC(e,t)};function iA(){}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=function(){try{if(localStorage.getItem("vaadin.developmentmode.force"))return!0;if(!(["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0))return!1;if(ix)return!(ix&&Object.keys(ix).map(e=>ix[e]).filter(e=>e.productionMode).length>0);return!iC(function(){return!0})}catch(e){return!1}}());let ik=function(){if("function"==typeof iE)return iE(iA)};window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){ik()};let iS=new Set,iO=e=>class extends eP(e){static _ensureRegistrations(){let{is:e}=this;if(e&&!iS.has(e)){window.Vaadin.registrations.push(this),iS.add(e);let s=window.Vaadin.developmentModeCallback;if(s){var i;i=t=tq.debounce(t,eG,()=>{s["vaadin-usage-statistics"]()}),tW.add(i)}}}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.'),this.constructor._ensureRegistrations()}};class i$ extends iv{constructor(e){super(e,"tooltip"),this.setTarget(e),this.__onContentChange=this.__onContentChange.bind(this)}initCustomNode(e){e.target=this.target,void 0!==this.ariaTarget&&(e.ariaTarget=this.ariaTarget),void 0!==this.context&&(e.context=this.context),void 0!==this.manual&&(e.manual=this.manual),void 0!==this.position&&(e._position=this.position),void 0!==this.shouldShow&&(e.shouldShow=this.shouldShow),this.manual||this.host.setAttribute("has-tooltip",""),this.__notifyChange(e),e.addEventListener("content-changed",this.__onContentChange)}teardownNode(e){this.manual||this.host.removeAttribute("has-tooltip"),e.removeEventListener("content-changed",this.__onContentChange),this.__notifyChange(null)}setAriaTarget(e){this.ariaTarget=e;let t=this.node;t&&(t.ariaTarget=e)}setContext(e){this.context=e;let t=this.node;t&&(t.context=e)}setManual(e){this.manual=e;let t=this.node;t&&(t.manual=e)}setPosition(e){this.position=e;let t=this.node;t&&(t._position=e)}setShouldShow(e){this.shouldShow=e;let t=this.node;t&&(t.shouldShow=e)}setTarget(e){this.target=e;let t=this.node;t&&(t.target=e)}open(e){let t=this.node;t?.isConnected&&t._stateController.open(e)}close(e){let t=this.node;t&&t._stateController.close(e)}__onContentChange(e){this.__notifyChange(e.target)}__notifyChange(e){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:e}}))}}let iT=h`
393
403
  :host {
394
404
  display: inline-flex;
395
405
  align-items: center;
396
406
  justify-content: center;
397
407
  text-align: center;
398
408
  gap: var(--vaadin-button-gap, 0 var(--vaadin-gap-s));
399
- white-space: nowrap;
409
+ white-space: var(--vaadin-button-label-wrap, normal);
400
410
  -webkit-tap-highlight-color: transparent;
401
411
  -webkit-user-select: none;
402
412
  user-select: none;
@@ -430,7 +440,8 @@
430
440
  }
431
441
 
432
442
  [part='label'] {
433
- display: inline-flex;
443
+ overflow: hidden;
444
+ text-overflow: ellipsis;
434
445
  }
435
446
 
436
447
  :host(:is([focus-ring], :focus-visible)) {
@@ -485,7 +496,7 @@
485
496
  opacity: 1;
486
497
  }
487
498
  }
488
- `,iT=e=>class extends tv(e){static get properties(){return{tabindex:{type:Number,reflectToAttribute:!0,observer:"_tabindexChanged",sync:!0},_lastTabIndex:{type:Number}}}_disabledChanged(e,t){super._disabledChanged(e,t),!this.__shouldAllowFocusWhenDisabled()&&(e?(void 0!==this.tabindex&&(this._lastTabIndex=this.tabindex),this.setAttribute("tabindex","-1")):t&&(void 0!==this._lastTabIndex?this.setAttribute("tabindex",this._lastTabIndex):this.tabindex=void 0))}_tabindexChanged(e){!this.__shouldAllowFocusWhenDisabled()&&this.disabled&&-1!==e&&(this._lastTabIndex=e,this.setAttribute("tabindex","-1"))}focus(e){(!this.disabled||this.__shouldAllowFocusWhenDisabled())&&super.focus(e)}__shouldAllowFocusWhenDisabled(){return!1}},i$=["mousedown","mouseup","click","dblclick","keypress","keydown","keyup"],iM=e=>class extends tf(iT(tE(e))){constructor(){super(),this.__onInteractionEvent=this.__onInteractionEvent.bind(this),i$.forEach(e=>{this.addEventListener(e,this.__onInteractionEvent,!0)}),this.tabindex=0}get _activeKeys(){return["Enter"," "]}ready(){super.ready(),this.hasAttribute("role")||this.setAttribute("role","button"),this.__shouldAllowFocusWhenDisabled()&&this.style.setProperty("--_vaadin-button-disabled-pointer-events","auto")}_onKeyDown(e){super._onKeyDown(e),e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||this._activeKeys.includes(e.key)&&(e.preventDefault(),this.click())}__onInteractionEvent(e){this.__shouldSuppressInteractionEvent(e)&&e.stopImmediatePropagation()}__shouldSuppressInteractionEvent(e){return this.disabled}};class iN extends iM(iE(tz(ez(tD(ec))))){static get is(){return"vaadin-button"}static get styles(){return iS}static get properties(){return{disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0,sync:!0}}}render(){return q`
499
+ `,iM=e=>class extends tv(e){static get properties(){return{tabindex:{type:Number,reflectToAttribute:!0,observer:"_tabindexChanged",sync:!0},_lastTabIndex:{type:Number}}}_disabledChanged(e,t){super._disabledChanged(e,t),!this.__shouldAllowFocusWhenDisabled()&&(e?(void 0!==this.tabindex&&(this._lastTabIndex=this.tabindex),this.setAttribute("tabindex","-1")):t&&(void 0!==this._lastTabIndex?this.setAttribute("tabindex",this._lastTabIndex):this.tabindex=void 0))}_tabindexChanged(e){!this.__shouldAllowFocusWhenDisabled()&&this.disabled&&-1!==e&&(this._lastTabIndex=e,this.setAttribute("tabindex","-1"))}focus(e){(!this.disabled||this.__shouldAllowFocusWhenDisabled())&&super.focus(e)}__shouldAllowFocusWhenDisabled(){return!1}},iN=["mousedown","mouseup","click","dblclick","keypress","keydown","keyup"],iP=e=>class extends tf(iM(tE(e))){constructor(){super(),this.__onInteractionEvent=this.__onInteractionEvent.bind(this),iN.forEach(e=>{this.addEventListener(e,this.__onInteractionEvent,!0)}),this.tabindex=0}get _activeKeys(){return["Enter"," "]}ready(){super.ready(),this.hasAttribute("role")||this.setAttribute("role","button"),this.__shouldAllowFocusWhenDisabled()&&this.style.setProperty("--_vaadin-button-disabled-pointer-events","auto")}_onKeyDown(e){super._onKeyDown(e),e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||this._activeKeys.includes(e.key)&&(e.preventDefault(),this.click())}__onInteractionEvent(e){this.__shouldSuppressInteractionEvent(e)&&e.stopImmediatePropagation()}__shouldSuppressInteractionEvent(e){return this.disabled}};class iL extends iP(iO(tH(ez(tB(ec))))){static get is(){return"vaadin-button"}static get styles(){return iT}static get properties(){return{disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0,sync:!0}}}render(){return q`
489
500
  <div class="vaadin-button-container">
490
501
  <span part="prefix" aria-hidden="true">
491
502
  <slot name="prefix"></slot>
@@ -499,7 +510,7 @@
499
510
 
500
511
  <slot name="tooltip"></slot>
501
512
  </div>
502
- `}ready(){super.ready(),this._tooltipController=new iO(this),this.addController(this._tooltipController)}__shouldAllowFocusWhenDisabled(){return window.Vaadin.featureFlags.accessibleDisabledButtons}}eT(iN);let iL=h`
513
+ `}ready(){super.ready(),this._tooltipController=new i$(this),this.addController(this._tooltipController)}__shouldAllowFocusWhenDisabled(){return window.Vaadin.featureFlags.accessibleDisabledButtons}}e$(iL);let iI=h`
503
514
  :host {
504
515
  flex-shrink: 0;
505
516
  }
@@ -538,7 +549,7 @@
538
549
  ::slotted(vaadin-menu-bar-item)::after {
539
550
  display: none;
540
551
  }
541
- `;eT(class extends iN{static get is(){return"vaadin-menu-bar-button"}static get styles(){return[super.styles,iL]}_onKeyDown(e){this.__triggeredWithActiveKeys=this._activeKeys.includes(e.key),super._onKeyDown(e),this.__triggeredWithActiveKeys=null}_setActive(e){!e&&this.hasAttribute("expanded")||super._setActive(e)}__shouldSuppressInteractionEvent(e){return!("keydown"===e.type&&["ArrowLeft","ArrowRight"].includes(e.key))&&super.__shouldSuppressInteractionEvent(e)}});let iP=h`
552
+ `;e$(class extends iL{static get is(){return"vaadin-menu-bar-button"}static get styles(){return[super.styles,iI]}_onKeyDown(e){this.__triggeredWithActiveKeys=this._activeKeys.includes(e.key),super._onKeyDown(e),this.__triggeredWithActiveKeys=null}_setActive(e){!e&&this.hasAttribute("expanded")||super._setActive(e)}__shouldSuppressInteractionEvent(e){return!("keydown"===e.type&&["ArrowLeft","ArrowRight"].includes(e.key))&&super.__shouldSuppressInteractionEvent(e)}});let iD=h`
542
553
  :host {
543
554
  display: block;
544
555
  min-width: 0;
@@ -584,8 +595,8 @@
584
595
  :host([theme~='end-aligned'][has-single-button]) ::slotted(vaadin-menu-bar-button) {
585
596
  margin-inline-start: auto;
586
597
  }
587
- `;class iI{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}function iR(e,...t){let i=e=>e&&"object"==typeof e&&!Array.isArray(e),s=(e,t)=>{i(t)&&i(e)&&Object.keys(t).forEach(n=>{let o=t[n];i(o)?(e[n]||(e[n]={}),s(e[n],o)):Array.isArray(o)?e[n]=[...o]:null!=o&&(e[n]=o)})};return t.forEach(t=>{s(e,t)}),e}let iD=(e,t)=>class extends t{static get properties(){return{i18n:{type:Object},__effectiveI18n:{type:Object,sync:!0}}}constructor(){super(),this.i18n=iR({},e)}get i18n(){return this.__customI18n}set i18n(t){t!==this.__customI18n&&(this.__customI18n=t,this.__effectiveI18n=iR({},e,this.__customI18n))}},iB=new ResizeObserver(e=>{setTimeout(()=>{e.forEach(e=>{e.target.isConnected&&(e.target.resizables?e.target.resizables.forEach(t=>{t._onResize(e.contentRect)}):e.target._onResize(e.contentRect))})})}),ij=eI(e=>class extends e{get _observeParent(){return!1}connectedCallback(){if(super.connectedCallback(),iB.observe(this),this._observeParent){let e=this.parentNode instanceof ShadowRoot?this.parentNode.host:this.parentNode;e.resizables||(e.resizables=new Set,iB.observe(e)),e.resizables.add(this),this.__parent=e}}disconnectedCallback(){super.disconnectedCallback(),iB.unobserve(this);let e=this.__parent;if(this._observeParent&&e){let t=e.resizables;t&&(t.delete(this),0===t.size&&iB.unobserve(e)),this.__parent=null}}_onResize(e){}}),iF=(i=class extends iI{update(e,[{component:t,text:i}]){let{parentNode:s,startNode:n}=e,o=t||(i?document.createTextNode(i):null),r=this.getOldNode(e);return r===o||(r&&o?s.replaceChild(o,r):r?s.removeChild(r):o&&n.after(o)),G}getOldNode(e){let{startNode:t,endNode:i}=e;return t.nextSibling===i?null:t.nextSibling}},(...e)=>({_$litDirective$:i,values:e})),iU={moreOptions:"More options"},iz=e=>class extends iD(iU,tG(ij(tE(tv(e))))){static get properties(){return{items:{type:Array,sync:!0,value:()=>[]},openOnHover:{type:Boolean},reverseCollapse:{type:Boolean,sync:!0},tabNavigation:{type:Boolean,sync:!0}}}get i18n(){return super.i18n}set i18n(e){super.i18n=e}constructor(){super(),this.__boundOnContextMenuKeydown=this.__onContextMenuKeydown.bind(this),this.__boundOnTooltipMouseLeave=this.__onTooltipOverlayMouseLeave.bind(this)}get focused(){return(this._getItems()||[]).find(tC)||this._expandedButton}get _vertical(){return!1}get _tabNavigation(){return this.tabNavigation}get _observeParent(){return!0}get _buttons(){return Array.from(this.querySelectorAll("vaadin-menu-bar-button"))}get _hasOverflow(){return this._overflow&&!this._overflow.hasAttribute("hidden")}set _hasOverflow(e){this._overflow&&this._overflow.toggleAttribute("hidden",!e)}ready(){super.ready(),this.setAttribute("role","menubar"),this._subMenuController=new ik(this,"submenu","vaadin-menu-bar-submenu",{initializer:e=>{e.setAttribute("is-root",""),e.addEventListener("item-selected",this.__onItemSelected.bind(this)),e.addEventListener("close-all-menus",this.__onEscapeClose.bind(this)),e._overlayElement._contentRoot.addEventListener("keydown",this.__boundOnContextMenuKeydown),this._subMenu=e}}),this._overflowController=new ik(this,"overflow","vaadin-menu-bar-button",{initializer:e=>{e.setAttribute("hidden","");let t=document.createElement("div");t.setAttribute("aria-hidden","true"),t.innerHTML="&centerdot;".repeat(3),e.appendChild(t),e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"),e.setAttribute("role",this.tabNavigation?"button":"menuitem"),this._overflow=e}}),this.addController(this._subMenuController),this.addController(this._overflowController),this.addEventListener("mousedown",()=>this._hideTooltip(!0)),this.addEventListener("mouseleave",()=>this._hideTooltip()),this._container=this.shadowRoot.querySelector('[part="container"]')}updated(e){super.updated(e),(e.has("items")||e.has("_theme")||e.has("disabled"))&&this.__renderButtons(this.items),(e.has("items")||e.has("_theme")||e.has("reverseCollapse"))&&this.__scheduleOverflow(),e.has("items")&&this.__updateSubMenu(),e.has("_theme")&&this._themeChanged(this._theme),e.has("disabled")&&this._overflow.toggleAttribute("disabled",this.disabled),e.has("tabNavigation")&&this._tabNavigationChanged(this.tabNavigation),e.has("__effectiveI18n")&&this.__i18nChanged(this.__effectiveI18n)}_getItems(){return this._buttons}disconnectedCallback(){super.disconnectedCallback(),this._hideTooltip(!0)}_onResize(){this.__scheduleOverflow()}_themeChanged(e){e?(this._overflow.setAttribute("theme",e),this._subMenu.setAttribute("theme",e)):(this._overflow.removeAttribute("theme"),this._subMenu.removeAttribute("theme"))}_tabNavigationChanged(e){let t=this.querySelector('[tabindex="0"]');this._buttons.forEach(i=>{t?this._setTabindex(i,i===t):this._setTabindex(i,!1),i.setAttribute("role",e?"button":"menuitem")}),this.setAttribute("role",e?"group":"menubar")}__updateSubMenu(){let e=this._subMenu;if(e&&e.opened){let t=e._positionTarget;t.isConnected&&Array.isArray(t.item.children)&&0!==t.item.children.length||e.close()}}__i18nChanged(e){e&&void 0!==e.moreOptions&&(e.moreOptions?this._overflow.setAttribute("aria-label",e.moreOptions):this._overflow.removeAttribute("aria-label"))}__getOverflowCount(e){return e.item&&e.item.children&&e.item.children.length||0}__restoreButtons(e){e.forEach(e=>{e.style.visibility="",e.style.position="",e.style.width="";let t=e.item&&e.item.component;t instanceof HTMLElement&&"menuitem"===t.getAttribute("role")&&this.__restoreItem(e,t)}),this.__updateOverflow([])}__restoreItem(e,t){e.appendChild(t),t.removeAttribute("role"),t.removeAttribute("aria-expanded"),t.removeAttribute("aria-haspopup"),t.removeAttribute("tabindex")}__updateOverflow(e){this._overflow.item={children:e},this._hasOverflow=e.length>0}__setOverflowItems(e,t){let i=this._container;if(i.style.minWidth=`${i.offsetWidth}px`,i.offsetWidth<i.scrollWidth){this._hasOverflow=!0;let s=this.__isRTL,n=i.offsetLeft,o=[...e];for(;o.length;){let e=o[o.length-1],r=e.offsetLeft-n;if(!s&&r+e.offsetWidth<i.offsetWidth-t.offsetWidth||s&&r>=t.offsetWidth)break;let a=this.reverseCollapse?o.shift():o.pop();a.style.width=getComputedStyle(a).width,a.style.visibility="hidden",a.style.position="absolute"}let r=e.filter(e=>!o.includes(e)).map(e=>e.item);this.__updateOverflow(r)}i.style.minWidth=""}__scheduleOverflow(){this._overflowDebouncer=tW.debounce(this._overflowDebouncer,eX,()=>{this.__detectOverflow()})}__detectOverflow(){let e=this._overflow,t=this._buttons.filter(t=>t!==e),i=this.__getOverflowCount(e);this.__restoreButtons(t),this.__setOverflowItems(t,e);let s=this.__getOverflowCount(e);i!==s&&this._subMenu.opened&&this._subMenu.close();let n=s===t.length||0===s&&1===t.length;this.toggleAttribute("has-single-button",n);let o=t.filter(e=>"hidden"!==e.style.visibility);o.length?o.some(e=>"0"===e.getAttribute("tabindex"))||this._setTabindex(o[o.length-1],!0):this._overflow.setAttribute("tabindex","0"),o.forEach((e,t,i)=>{e.toggleAttribute("first-visible",0===t),e.toggleAttribute("last-visible",!this._hasOverflow&&t===i.length-1)})}__getButtonTheme(e,t){let i=t,s=e&&e.theme;return null!=s&&(i=Array.isArray(s)?s.join(" "):s),i}__getComponent(e){let t,i=e.component,s=i instanceof HTMLElement;return s&&"vaadin-menu-bar-item"===i.localName?t=i:(t=document.createElement("vaadin-menu-bar-item")).appendChild(s?i:document.createElement(i)),e.text&&((t.firstChild||t).textContent=e.text),t}__renderButtons(e=[]){ed(q`
588
- ${e.map(e=>{let t={...e},i=!!(e&&e.children);if(t.component){let e=this.__getComponent(t);t.component=e,e.item=t}return q`
598
+ `;class iR{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}function iB(e,...t){let i=e=>e&&"object"==typeof e&&!Array.isArray(e),s=(e,t)=>{i(t)&&i(e)&&Object.keys(t).forEach(n=>{let o=t[n];i(o)?(e[n]||(e[n]={}),s(e[n],o)):Array.isArray(o)?e[n]=[...o]:null!=o&&(e[n]=o)})};return t.forEach(t=>{s(e,t)}),e}let iF=e=>class extends e{static get properties(){return{i18n:{type:Object},__effectiveI18n:{type:Object,sync:!0}}}static get defaultI18n(){return{}}constructor(){super(),this.i18n=iB({},this.constructor.defaultI18n)}get i18n(){return this.__customI18n}set i18n(e){e!==this.__customI18n&&(this.__customI18n=e,this.__effectiveI18n=iB({},this.constructor.defaultI18n,this.__customI18n))}},ij=new ResizeObserver(e=>{setTimeout(()=>{e.forEach(e=>{e.target.isConnected&&(e.target.resizables?e.target.resizables.forEach(t=>{t._onResize(e.contentRect)}):e.target._onResize(e.contentRect))})})}),iU=eI(e=>class extends e{get _observeParent(){return!1}connectedCallback(){if(super.connectedCallback(),ij.observe(this),this._observeParent){let e=this.parentNode instanceof ShadowRoot?this.parentNode.host:this.parentNode;e.resizables||(e.resizables=new Set,ij.observe(e)),e.resizables.add(this),this.__parent=e}}disconnectedCallback(){super.disconnectedCallback(),ij.unobserve(this);let e=this.__parent;if(this._observeParent&&e){let t=e.resizables;t&&(t.delete(this),0===t.size&&ij.unobserve(e)),this.__parent=null}}_onResize(e){}});class iz extends im{_getItem(e){return"vaadin-menu-bar-button"===e.localName?e.item:super._getItem(e)}_getDefaultPosition(e){return"vaadin-menu-bar-button"===e.localName?"bottom":super._getDefaultPosition(e)}}let iH=(i=class extends iR{update(e,[{component:t,text:i}]){let{parentNode:s,startNode:n}=e,o=t||(i?document.createTextNode(i):null),r=this.getOldNode(e);return r===o||(r&&o?s.replaceChild(o,r):r?s.removeChild(r):o&&n.after(o)),G}getOldNode(e){let{startNode:t,endNode:i}=e;return t.nextSibling===i?null:t.nextSibling}},(...e)=>({_$litDirective$:i,values:e})),iV={moreOptions:"More options"},iK=e=>class extends iF(tX(iU(tE(tv(e))))){static get properties(){return{items:{type:Array,sync:!0,value:()=>[]},openOnHover:{type:Boolean},reverseCollapse:{type:Boolean,sync:!0},tabNavigation:{type:Boolean,sync:!0}}}static get defaultI18n(){return iV}get i18n(){return super.i18n}set i18n(e){super.i18n=e}constructor(){super(),this.__boundOnContextMenuKeydown=this.__onContextMenuKeydown.bind(this)}get focused(){return(this._getItems()||[]).find(tC)||this._expandedButton}get _vertical(){return!1}get _tabNavigation(){return this.tabNavigation}get _observeParent(){return!0}get _buttons(){return Array.from(this.querySelectorAll("vaadin-menu-bar-button"))}get _hasOverflow(){return this._overflow&&!this._overflow.hasAttribute("hidden")}set _hasOverflow(e){this._overflow&&this._overflow.toggleAttribute("hidden",!e)}ready(){super.ready(),this.setAttribute("role","menubar"),this._subMenuController=new iv(this,"submenu","vaadin-menu-bar-submenu",{initializer:e=>{e.setAttribute("is-root",""),e.addEventListener("item-selected",this.__onItemSelected.bind(this)),e.addEventListener("close-all-menus",this.__onEscapeClose.bind(this)),e._overlayElement._contentRoot.addEventListener("keydown",this.__boundOnContextMenuKeydown),this._subMenu=e}}),this._overflowController=new iv(this,"overflow","vaadin-menu-bar-button",{initializer:e=>{e.setAttribute("hidden","");let t=document.createElement("div");t.setAttribute("aria-hidden","true"),t.innerHTML="&centerdot;".repeat(3),e.appendChild(t),e.setAttribute("aria-haspopup","true"),e.setAttribute("aria-expanded","false"),e.setAttribute("role",this.tabNavigation?"button":"menuitem"),this._overflow=e}}),this._tooltipController=new iz(this),this.addEventListener("mousedown",()=>this._tooltipController.close(!0)),this.addEventListener("mouseleave",()=>this._tooltipController.close()),this.addController(this._tooltipController),this.addController(this._subMenuController),this.addController(this._overflowController),this._container=this.shadowRoot.querySelector('[part="container"]')}updated(e){super.updated(e),(e.has("items")||e.has("_theme")||e.has("disabled"))&&this.__renderButtons(this.items),(e.has("items")||e.has("_theme")||e.has("reverseCollapse"))&&this.__scheduleOverflow(),e.has("items")&&this.__updateSubMenu(),e.has("_theme")&&this._themeChanged(this._theme),e.has("disabled")&&this._overflow.toggleAttribute("disabled",this.disabled),e.has("tabNavigation")&&this._tabNavigationChanged(this.tabNavigation),e.has("__effectiveI18n")&&this.__i18nChanged(this.__effectiveI18n)}_getItems(){return this._buttons}disconnectedCallback(){super.disconnectedCallback(),this._tooltipController.setTarget(null)}_onResize(){this.__scheduleOverflow()}_themeChanged(e){e?(this._overflow.setAttribute("theme",e),this._subMenu.setAttribute("theme",e)):(this._overflow.removeAttribute("theme"),this._subMenu.removeAttribute("theme"))}_tabNavigationChanged(e){let t=this.querySelector('[tabindex="0"]');this._buttons.forEach(i=>{t?this._setTabindex(i,i===t):this._setTabindex(i,!1),i.setAttribute("role",e?"button":"menuitem")}),this.setAttribute("role",e?"group":"menubar")}__updateSubMenu(){let e=this._subMenu;if(e?.opened){let t=e._positionTarget;t.isConnected&&Array.isArray(t.item.children)&&0!==t.item.children.length||e.close()}}__i18nChanged(e){e?.moreOptions!==void 0&&(e.moreOptions?this._overflow.setAttribute("aria-label",e.moreOptions):this._overflow.removeAttribute("aria-label"))}__getOverflowCount(e){return e.item&&e.item.children&&e.item.children.length||0}__restoreButtons(e){e.forEach(e=>{e.style.visibility="",e.style.position="",e.style.width="";let t=e.item&&e.item.component;t instanceof HTMLElement&&"menuitem"===t.getAttribute("role")&&this.__restoreItem(e,t)}),this.__updateOverflow([])}__restoreItem(e,t){e.appendChild(t),t.removeAttribute("role"),t.removeAttribute("aria-expanded"),t.removeAttribute("aria-haspopup"),t.removeAttribute("tabindex")}__updateOverflow(e){this._overflow.item={children:e},this._hasOverflow=e.length>0}__setOverflowItems(e,t){let i=this._container;if(i.style.minWidth=`${i.offsetWidth}px`,i.offsetWidth<i.scrollWidth){this._hasOverflow=!0;let s=this.__isRTL,n=i.offsetLeft,o=[...e];for(;o.length;){let e=o[o.length-1],r=e.offsetLeft-n;if(!s&&r+e.offsetWidth<i.offsetWidth-t.offsetWidth||s&&r>=t.offsetWidth)break;let a=this.reverseCollapse?o.shift():o.pop();a.style.width=getComputedStyle(a).width,a.style.visibility="hidden",a.style.position="absolute"}let r=e.filter(e=>!o.includes(e)).map(e=>e.item);this.__updateOverflow(r)}i.style.minWidth=""}__scheduleOverflow(){this._overflowDebouncer=tq.debounce(this._overflowDebouncer,eX,()=>{this.__detectOverflow()})}__detectOverflow(){let e=this._overflow,t=this._buttons.filter(t=>t!==e),i=this.__getOverflowCount(e);this.__restoreButtons(t),this.__setOverflowItems(t,e);let s=this.__getOverflowCount(e);i!==s&&this._subMenu.opened&&this._subMenu.close();let n=s===t.length||0===s&&1===t.length;this.toggleAttribute("has-single-button",n);let o=t.filter(e=>"hidden"!==e.style.visibility);o.length?o.some(e=>"0"===e.getAttribute("tabindex"))||this._setTabindex(o[o.length-1],!0):this._overflow.setAttribute("tabindex","0"),o.forEach((e,t,i)=>{e.toggleAttribute("first-visible",0===t),e.toggleAttribute("last-visible",!this._hasOverflow&&t===i.length-1)})}__getButtonTheme(e,t){let i=t,s=e?.theme;return null!=s&&(i=Array.isArray(s)?s.join(" "):s),i}__getComponent(e){let t,i=e.component,s=i instanceof HTMLElement;return s&&"vaadin-menu-bar-item"===i.localName?t=i:(t=document.createElement("vaadin-menu-bar-item")).appendChild(s?i:document.createElement(i)),e.text&&((t.firstChild||t).textContent=e.text),t}__renderButtons(e=[]){ed(q`
599
+ ${e.map(e=>{let t={...e},i=!!e?.children;if(t.component){let e=this.__getComponent(t);t.component=e,e.item=t}return q`
589
600
  <vaadin-menu-bar-button
590
601
  .item="${t}"
591
602
  .disabled="${this.disabled||e.disabled}"
@@ -595,10 +606,10 @@
595
606
  class="${(e.className||X)??X}"
596
607
  theme="${(this.__getButtonTheme(e,this._theme)||X)??X}"
597
608
  @click="${this.__onRootButtonClick}"
598
- >${iF(t)}</vaadin-menu-bar-button
609
+ >${iH(t)}</vaadin-menu-bar-button
599
610
  >
600
611
  `})}
601
- `,this,{renderBefore:this._overflow})}__onRootButtonClick(e){let t=e.target;t.item&&t.item.component&&!e.composedPath().includes(t.item.component)&&(e.stopPropagation(),t.item.component.click())}_showTooltip(e,t){let i=this._tooltipController.node;i&&i.isConnected&&(void 0===i.generator&&(i.generator=({item:e})=>e&&e.tooltip),i._mouseLeaveListenerAdded||(i._overlayElement.addEventListener("mouseleave",this.__boundOnTooltipMouseLeave),i._mouseLeaveListenerAdded=!0),this._subMenu.opened||(this._tooltipController.setTarget(e),this._tooltipController.setContext({item:e.item}),i._stateController.open({hover:t,focus:!t})))}_hideTooltip(e){let t=this._tooltipController&&this._tooltipController.node;t&&(this._tooltipController.setContext({item:null}),t._stateController.close(e))}__onTooltipOverlayMouseLeave(e){e.relatedTarget!==this._tooltipController.target&&this._hideTooltip()}_setExpanded(e,t){e.toggleAttribute("expanded",t),e.toggleAttribute("active",t),e.setAttribute("aria-expanded",t?"true":"false")}_setTabindex(e,t){this.tabNavigation&&this._isItemFocusable(e)?e.setAttribute("tabindex","0"):e.setAttribute("tabindex",t?"0":"-1")}_focusItem(e,t,i){let s=i&&this.focused===this._expandedButton;s&&this._close(),super._focusItem(e,t,i),this._buttons.forEach(t=>{this._setTabindex(t,t===e)}),s&&e.item&&e.item.children?this.__openSubMenu(e,!0,{keepFocus:!0}):e===this._overflow?this._hideTooltip():this._showTooltip(e)}_getButtonFromEvent(e){return Array.from(e.composedPath()).find(e=>"vaadin-menu-bar-button"===e.localName)}_shouldSetFocus(e){return!e.composedPath().includes(this._subMenu)&&super._shouldSetFocus(e)}_shouldRemoveFocus(e){return!e.composedPath().includes(this._subMenu)&&super._shouldRemoveFocus(e)}_setFocused(e){if(e){let e=this.__getFocusTarget();e&&this._buttons.forEach(t=>{this._setTabindex(t,t===e),t===e&&t!==this._overflow&&tg&&this._showTooltip(t)})}else this._hideTooltip()}__getFocusTarget(){let e=this._buttons.find(e=>tC(e));if(!e){let t=this.tabNavigation?"[focused]":'[tabindex="0"]';tw(e=this.querySelector(`vaadin-menu-bar-button${t}`))&&(e=this._buttons[this._getFocusableIndex()])}return e}_onArrowDown(e){e.preventDefault();let t=this._getButtonFromEvent(e);t===this._expandedButton?this._focusFirstItem():this.__openSubMenu(t,!0)}_onArrowUp(e){e.preventDefault();let t=this._getButtonFromEvent(e);t===this._expandedButton?this._focusLastItem():this.__openSubMenu(t,!0,{focusLast:!0})}_onEscape(e){e.composedPath().includes(this._expandedButton)&&this._close(!0),this._hideTooltip(!0)}_onKeyDown(e){e.composedPath().includes(this._subMenu)||this._handleKeyDown(e)}_handleKeyDown(e){switch(e.key){case"ArrowDown":this._onArrowDown(e);break;case"ArrowUp":this._onArrowUp(e);break;default:super._onKeyDown(e)}}_onMouseOver(e){if(e.composedPath().includes(this._subMenu))return;let t=this._getButtonFromEvent(e);t?t!==this._expandedButton&&(t.item.children&&(this.openOnHover||this._subMenu.opened)&&this.__openSubMenu(t,!1),t===this._overflow||this.openOnHover&&t.item.children?this._hideTooltip():this._showTooltip(t,!0)):this._hideTooltip()}__onContextMenuKeydown(e){let t=Array.from(e.composedPath()).find(e=>e._item);if(t){let i=t.parentNode;38===e.keyCode&&t===i.items[0]&&this._close(!0),37!==e.keyCode&&(39!==e.keyCode||t._item.children)||(e.stopImmediatePropagation(),this._handleKeyDown(e)),"Tab"===e.key&&this.tabNavigation&&this._handleKeyDown(e)}}__fireItemSelected(e){this.dispatchEvent(new CustomEvent("item-selected",{detail:{value:e}}))}__onButtonClick(e){let t=this._getButtonFromEvent(e);t&&this.__openSubMenu(t,t.__triggeredWithActiveKeys)}__openSubMenu(e,t,i={}){if(e.disabled)return;let s=this._subMenu,n=e.item;if(s.opened&&(this._close(),s.listenOn===e))return;let o=n&&n.children;if(!o||0===o.length)return void this.__fireItemSelected(n);s.items=o,s.listenOn=e,s._positionTarget=e;let r=s._overlayElement;r.noVerticalOverlap=!0,this._hideTooltip(!0),this._expandedButton=e,this._setExpanded(e,!0),this.style.pointerEvents="auto",e.dispatchEvent(new CustomEvent("opensubmenu",{detail:{children:o}})),r.addEventListener("vaadin-overlay-open",()=>{if(i.focusLast&&this._focusLastItem(),i.keepFocus){let e={focusVisible:tg};this._focusItem(this._expandedButton,e,!1)}t||r.$.overlay.focus()},{once:!0})}_focusFirstItem(){this._subMenu._overlayElement._contentRoot.firstElementChild.focus()}_focusLastItem(){let e=this._subMenu._overlayElement._contentRoot.firstElementChild,t=e.items[e.items.length-1];t&&t.focus()}__onItemSelected(e){e.stopPropagation(),this.__fireItemSelected(e.detail.value)}__onEscapeClose(){this.__deactivateButton(!0)}__deactivateButton(e){let t=this._expandedButton;if(t&&t.hasAttribute("expanded")){if(this._setExpanded(t,!1),e){let e={focusVisible:tg};this._focusItem(t,e,!1)}this._expandedButton=null}}_close(e=!1){this.style.pointerEvents="",this.__deactivateButton(e),this._subMenu.opened&&this._subMenu.close()}close(){this._close()}_isItemFocusable(e){return e.disabled&&e.__shouldAllowFocusWhenDisabled?e.__shouldAllowFocusWhenDisabled():super._isItemFocusable(e)}};class iH extends iz(iE(tz(ez(tD(ec))))){static get is(){return"vaadin-menu-bar"}static get styles(){return iP}render(){return q`
612
+ `,this,{renderBefore:this._overflow})}__onRootButtonClick(e){let t=e.target;t.item&&t.item.component&&!e.composedPath().includes(t.item.component)&&(e.stopPropagation(),t.item.component.click())}_setExpanded(e,t){e.toggleAttribute("expanded",t),e.toggleAttribute("active",t),e.setAttribute("aria-expanded",t?"true":"false")}_setTabindex(e,t){this.tabNavigation&&this._isItemFocusable(e)?e.setAttribute("tabindex","0"):e.setAttribute("tabindex",t?"0":"-1")}_focusItem(e,t,i){let s=i&&this.focused===this._expandedButton;s&&this._close(),super._focusItem(e,t,i),this._buttons.forEach(t=>{this._setTabindex(t,t===e)}),this._tooltipController.setTarget(e),s&&e.item&&e.item.children?this.__openSubMenu(e,!0,{keepFocus:!0}):this._subMenu.opened||this._tooltipController.open({trigger:"focus"})}_getButtonFromEvent(e){return Array.from(e.composedPath()).find(e=>"vaadin-menu-bar-button"===e.localName)}_shouldSetFocus(e){return!e.composedPath().includes(this._subMenu)&&super._shouldSetFocus(e)}_shouldRemoveFocus(e){return!e.composedPath().includes(this._subMenu)&&super._shouldRemoveFocus(e)}_setFocused(e){let t=e?this.__getFocusTarget():null;t?(this._tooltipController.setTarget(t),this._buttons.forEach(e=>{this._setTabindex(e,e===t)}),!this._subMenu.opened&&tg&&this._tooltipController.open({trigger:"focus"})):this._tooltipController.close(!0)}__getFocusTarget(){let e=this._buttons.find(e=>tC(e));if(!e){let t=this.tabNavigation?"[focused]":'[tabindex="0"]';tw(e=this.querySelector(`vaadin-menu-bar-button${t}`))&&(e=this._buttons[this._getFocusableIndex()])}return e}_onArrowDown(e){e.preventDefault();let t=this._getButtonFromEvent(e);t===this._expandedButton?this._focusFirstItem():this.__openSubMenu(t,!0)}_onArrowUp(e){e.preventDefault();let t=this._getButtonFromEvent(e);t===this._expandedButton?this._focusLastItem():this.__openSubMenu(t,!0,{focusLast:!0})}_onEscape(e){e.composedPath().includes(this._expandedButton)&&this._close(!0),this._tooltipController.close(!0)}_onKeyDown(e){e.composedPath().includes(this._subMenu)||this._handleKeyDown(e)}_handleKeyDown(e){switch(e.key){case"ArrowDown":this._onArrowDown(e);break;case"ArrowUp":this._onArrowUp(e);break;default:super._onKeyDown(e)}}_onMouseOver(e){if(e.composedPath().includes(this._subMenu))return;let t=this._getButtonFromEvent(e);this._tooltipController.setTarget(t),t&&t!==this._expandedButton&&t.item.children&&(this.openOnHover||this._subMenu.opened)&&this.__openSubMenu(t,!1),this._subMenu.opened||this._tooltipController.open({trigger:"hover"})}__onContextMenuKeydown(e){let t=Array.from(e.composedPath()).find(e=>e._item);if(t){let i=t.parentNode;38===e.keyCode&&t===i.items[0]&&this._close(!0),37!==e.keyCode&&(39!==e.keyCode||t._item.children)||(e.stopImmediatePropagation(),this._handleKeyDown(e)),"Tab"===e.key&&this.tabNavigation&&this._handleKeyDown(e)}}__fireItemSelected(e){this.dispatchEvent(new CustomEvent("item-selected",{detail:{value:e}}))}__onButtonClick(e){let t=this._getButtonFromEvent(e);t&&this.__openSubMenu(t,t.__triggeredWithActiveKeys)}__openSubMenu(e,t,i={}){if(e.disabled)return;let s=this._subMenu,n=e.item;if(s.opened&&(this._close(),s.listenOn===e))return;let o=n?.children;if(!o||0===o.length)return void this.__fireItemSelected(n);s.items=o,s.listenOn=e,s._positionTarget=e;let r=s._overlayElement;r.noVerticalOverlap=!0,this._tooltipController.close(!0),this._expandedButton=e,this._setExpanded(e,!0),this.style.pointerEvents="auto",e.dispatchEvent(new CustomEvent("opensubmenu",{detail:{children:o}})),r.addEventListener("vaadin-overlay-open",()=>{if(i.focusLast&&this._focusLastItem(),i.keepFocus){let e={focusVisible:tg};this._focusItem(this._expandedButton,e,!1)}t||r.$.overlay.focus()},{once:!0})}_focusFirstItem(){this._subMenu._overlayElement._contentRoot.firstElementChild.focus()}_focusLastItem(){let e=this._subMenu._overlayElement._contentRoot.firstElementChild,t=e.items[e.items.length-1];t&&t.focus()}__onItemSelected(e){e.stopPropagation(),this.__fireItemSelected(e.detail.value)}__onEscapeClose(){this.__deactivateButton(!0)}__deactivateButton(e){let t=this._expandedButton;if(t?.hasAttribute("expanded")){if(this._setExpanded(t,!1),e){let e={focusVisible:tg};this._focusItem(t,e,!1)}else this._tooltipController.close(!0);this._expandedButton=null}}_close(e=!1){this.style.pointerEvents="",this.__deactivateButton(e),this._subMenu.opened&&this._subMenu.close()}close(){this._close()}_isItemFocusable(e){return e.disabled&&e.__shouldAllowFocusWhenDisabled?e.__shouldAllowFocusWhenDisabled():super._isItemFocusable(e)}};class iW extends iK(iO(tH(ez(tB(ec))))){static get is(){return"vaadin-menu-bar"}static get styles(){return iD}render(){return q`
602
613
  <div part="container" @click="${this.__onButtonClick}" @mouseover="${this._onMouseOver}">
603
614
  <slot></slot>
604
615
  <slot name="overflow"></slot>
@@ -607,7 +618,7 @@
607
618
  <slot name="submenu"></slot>
608
619
 
609
620
  <slot name="tooltip"></slot>
610
- `}ready(){super.ready(),this._tooltipController=new iO(this),this._tooltipController.setManual(!0),this.addController(this._tooltipController)}}function iK(e){let t=document.createElement("vaadin-menu-bar-item");return ed(e,t),t}eT(iH);let iV=class extends iH{};iV=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r}([ep("or-vaadin-menu-bar")],iV),n(673);var iW=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};let iq=class extends ec{constructor(){super(...arguments),this.expanded=!1,this.leaf=!1,this.readonly=!1,this._slotClickListener=e=>this.leaf?this._onExpandToggle(e):null,this._chevronClickListener=e=>this._onExpandToggle(e)}static get styles(){return[h`
621
+ `}}function iq(e){let t=document.createElement("vaadin-menu-bar-item");return ed(e,t),t}e$(iW);let iG=class extends iW{};iG=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r}([ep("or-vaadin-menu-bar")],iG),n(673);var iX=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};let iZ=class extends ec{constructor(){super(...arguments),this.expanded=!1,this.leaf=!1,this.readonly=!1,this._slotClickListener=e=>this.leaf?this._onExpandToggle(e):null,this._chevronClickListener=e=>this._onExpandToggle(e)}static get styles(){return[h`
611
622
  * {
612
623
  box-sizing: border-box;
613
624
  }
@@ -655,7 +666,7 @@
655
666
  <or-icon id="chevron" part="chevron" icon="${e?"chevron-down":"chevron-right"}"
656
667
  @click="${this._chevronClickListener}"
657
668
  ></or-icon>
658
- `}_onExpandToggle(e){this.expanded=!this.expanded}_onSlotChange(e){this._applyIndentToChildren()}_applyIndentToChildren(e=this.getChildNodes()){e.forEach(e=>{let t=(e=>{let t=0;for(;e;)"or-tree-group"===e.tagName.toLowerCase()&&t++,e=e.parentElement;return t})(e);"parent"===e.slot&&t--,e.style.setProperty("--or-tree-node-indent",`${24+12*t}px`)})}};iW([ev({type:Boolean,reflect:!0})],iq.prototype,"expanded",void 0),iW([ev({type:Boolean})],iq.prototype,"leaf",void 0),iW([ev({type:Boolean})],iq.prototype,"readonly",void 0),iW([eg({slot:void 0})],iq.prototype,"_childNodes",void 0),iW([eg({slot:"parent"})],iq.prototype,"_parentNodes",void 0),iq=iW([ep("or-tree-group")],iq);var iG=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};let iX=h`
669
+ `}_onExpandToggle(e){this.expanded=!this.expanded}_onSlotChange(e){this._applyIndentToChildren()}_applyIndentToChildren(e=this.getChildNodes()){e.forEach(e=>{let t=(e=>{let t=0;for(;e;)"or-tree-group"===e.tagName.toLowerCase()&&t++,e=e.parentElement;return t})(e);"parent"===e.slot&&t--,e.style.setProperty("--or-tree-node-indent",`${24+12*t}px`)})}};iX([ev({type:Boolean,reflect:!0})],iZ.prototype,"expanded",void 0),iX([ev({type:Boolean})],iZ.prototype,"leaf",void 0),iX([ev({type:Boolean})],iZ.prototype,"readonly",void 0),iX([eg({slot:void 0})],iZ.prototype,"_childNodes",void 0),iX([eg({slot:"parent"})],iZ.prototype,"_parentNodes",void 0),iZ=iX([ep("or-tree-group")],iZ);var iY=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};let iQ=h`
659
670
  * {
660
671
  box-sizing: border-box;
661
672
  }
@@ -693,11 +704,11 @@
693
704
  ::slotted(*:not([slot])) {
694
705
  flex: 1;
695
706
  }
696
- `,iZ=class extends ec{constructor(){super(...arguments),this.readonly=!1,this.selected=!1}static get styles(){return[iX]}render(){return q`
707
+ `,iJ=class extends ec{constructor(){super(...arguments),this.readonly=!1,this.selected=!1}static get styles(){return[iQ]}render(){return q`
697
708
  <slot name="prefix"></slot>
698
709
  <slot></slot>
699
710
  <slot name="suffix"></slot>
700
- `}};iG([ev({type:Boolean,reflect:!0})],iZ.prototype,"readonly",void 0),iG([ev({type:Boolean,reflect:!0})],iZ.prototype,"selected",void 0),iZ=iG([ep("or-tree-node")],iZ);var iY=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};let iQ=h`
711
+ `}};iY([ev({type:Boolean,reflect:!0})],iJ.prototype,"readonly",void 0),iY([ev({type:Boolean,reflect:!0})],iJ.prototype,"selected",void 0),iJ=iY([ep("or-tree-node")],iJ);var i0=function(e,t,i,s){var n,o=arguments.length,r=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(r=(o<3?n(r):o>3?n(t,i,r):n(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};let i1=h`
701
712
  * {
702
713
  box-sizing: border-box;
703
714
  }
@@ -749,7 +760,7 @@
749
760
  display: flex;
750
761
  align-items: center;
751
762
  }
752
- `,iJ=class extends ec{constructor(){super(...arguments),this.nodes=[],this.selection=ex.LEAF,this.draggable=!1,this.noHeader=!1,this.menuTitle="Tree Menu",this.sortBy=eC.A_TO_Z,this.groupFirst=!1,this._treeNodeCache=new Map}static get styles(){return[iQ]}willUpdate(e){return(e.has("nodes")||e.has("sortBy")||e.has("groupFirst"))&&this.nodes&&(this.nodes=this._sortNodes(this.nodes,this.sortBy,this.groupFirst)),e.has("selection")&&e.get("selection")&&this.selection&&this.deselectAllNodes(),super.willUpdate(e)}render(){var e,t;return q`
763
+ `,i2=class extends ec{constructor(){super(...arguments),this.nodes=[],this.selection=ex.LEAF,this.draggable=!1,this.noHeader=!1,this.menuTitle="Tree Menu",this.sortBy=eC.A_TO_Z,this.groupFirst=!1,this._treeNodeCache=new Map}static get styles(){return[i1]}willUpdate(e){return(e.has("nodes")||e.has("sortBy")||e.has("groupFirst"))&&this.nodes&&(this.nodes=this._sortNodes(this.nodes,this.sortBy,this.groupFirst)),e.has("selection")&&e.get("selection")&&this.selection&&this.deselectAllNodes(),super.willUpdate(e)}render(){var e,t;return q`
753
764
  <div id="tree-container">
754
765
  ${e=!this.noHeader,t=()=>this._getHeaderTemplate(),e?t(e):void 0}
755
766
  ${this._getTreeTemplate(this.nodes)}
@@ -799,9 +810,9 @@
799
810
  ${this._getSortActionTemplate(this.sortBy,this.sortOptions)}
800
811
  </div>
801
812
  </div>
802
- `}_getSortActionTemplate(e,t){let i=[{component:iK(q`<or-icon icon="sort-variant"></or-icon>`),children:(null!=t?t:[]).map(t=>({checked:e&&t===e,component:iK(q`<or-translate value=${t}></or-translate>`),value:t}))}];return q`
813
+ `}_getSortActionTemplate(e,t){let i=[{component:iq(q`<or-icon icon="sort-variant"></or-icon>`),children:(null!=t?t:[]).map(t=>({checked:e&&t===e,component:iq(q`<or-translate value=${t}></or-translate>`),value:t}))}];return q`
803
814
  <or-vaadin-menu-bar theme="icon" .items=${i}
804
815
  @item-selected=${e=>this._onSortClick(e.detail.value.value)}
805
816
  ></or-vaadin-menu-bar>
806
- `}_getErrorTemplate(){return q``}_onSortClick(e){this.sortBy=e}_onTreeGroupClick(e){let t=e.currentTarget,i=t.parentElement,s=(e,t)=>{e.select(),this._lastSelectedNode=t,this._notifyNodesSelect()};switch(this.selection){case ex.LEAF:return;case ex.MULTI:if(e.shiftKey&&this._lastSelectedNode){let e=Array.from(this._uiNodes||[]),t=i.getGroupNode();if(t){let i=e.indexOf(t),s=e.indexOf(this._lastSelectedNode);this._selectNodesBetween(e,i,s);return}}else if(e.ctrlKey)return void s(i,t);this.deselectAllNodes(),s(i,t);return;case ex.SINGLE:this.deselectAllNodes(),s(i,t);return}}_onTreeNodeClick(e){let t=e.currentTarget;if(t)if(this.selection===ex.MULTI){if(e.shiftKey&&this._lastSelectedNode){let e=Array.from(this._uiNodes||[]),i=e.indexOf(this._lastSelectedNode),s=e.indexOf(t);if(i>-1&&s>-1)return void this._selectNodesBetween(e,i,s)}else if(e.ctrlKey)return void this._selectNode(t);this.deselectAllNodes(),this._selectNode(t);return}else{this.deselectAllNodes(),this._selectNode(t);return}}_onDragStart(e,t){var i;e.target?null==(i=e.dataTransfer)||i.setData("treeNode",JSON.stringify(t)):e.preventDefault()}_onDragOverList(e){this.draggable&&e.preventDefault()}_onDragOverSingleNode(e,t,i){if(this.draggable&&(e.preventDefault(),i)){let e=this._getUiNodeFromTree(i);null==e||e.setAttribute("drophover","true")}}_onDragOverGroup(e,t){this.draggable&&(e.preventDefault(),e.currentTarget.setAttribute("drophover","true"))}_onDragLeaveSingleNode(e,t,i){if(i&&this.draggable){e.preventDefault();let t=this._getUiNodeFromTree(i);null==t||t.removeAttribute("drophover")}}_onDragLeaveGroup(e,t){this.draggable&&e.currentTarget.removeAttribute("drophover")}_onDragDropList(e){this._onDragDropGroup(e)}_onDragDropSingleNode(e,t,i){this._onDragDropGroup(e,i)}_onDragDropGroup(e,t){var i,s;if(this.draggable){e.preventDefault(),e.stopPropagation(),t&&(null==(i=this._getUiNodeFromTree(t))||i.removeAttribute("drophover"));let n=[],o=null==(s=e.dataTransfer)?void 0:s.getData("treeNode");if(o){let e=JSON.parse(o);e&&n.push(e)}if(this.selection===ex.MULTI){let e=this._findSelectedTreeNodes();(e=e.filter(e=>!e.children)).length>0&&(this.deselectAllNodes(),n.push(...e.filter(e=>!n.find(t=>JSON.stringify(t)===JSON.stringify(e)))))}(null==t?void 0:t.children)&&(n=n.filter(e=>{var i;return!(null==(i=t.children)?void 0:i.find(t=>t.id===e.id))})),n.length>0&&this._dispatchCancellableDragEvent(n,t,this.nodes).then(()=>{this.nodes=eA(n,t,this.nodes)}).catch(e=>{})}}_dispatchCancellableDragEvent(e,t,i=[]){return new Promise((s,n)=>{this.dispatchEvent(new eO(e,t,i))?s():n()})}_selectNode(e,t=!0){if(e){if(t){let t=[...this._findSelectedTreeNodes()],i=this._getTreeNodeFromTree(e);if(i&&t.push(i),!this._dispatchSelectEvent(t))return}e.selected=!0,this._lastSelectedNode=e}}_selectNodesBetween(e,t,i,s=!0){let n=[];if(t<i)for(let s=t;s<=i;s++)n.push(e[s]);else if(t>i)for(let s=i;s<=t;s++)n.push(e[s]);if(s){let e=n.map(e=>this._getTreeNodeFromTree(e)).filter(e=>e);if(!this._notifyNodesSelect(e))return}n.forEach(e=>this._selectNode(e))}_notifyNodesSelect(e){var t,i,s,n;return t=this,i=void 0,s=void 0,n=function*(){return yield this.getUpdateComplete(),e||(e=this._findSelectedTreeNodes()),this._dispatchSelectEvent(e)},new(s||(s=Promise))(function(e,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(t){var i;t.done?e(t.value):((i=t.value)instanceof s?i:new s(function(e){e(i)})).then(r,a)}l((n=n.apply(t,i||[])).next())})}_findSelectedTreeNodes(e=Array.from(this._uiNodes||[]),t=this._treeNodeCache){let i=e.filter(e=>e.selected),s=Array.from(t.entries());return i.map(e=>s.find(t=>t[1]===e.id)).map(e=>null==e?void 0:e[0]).filter(e=>void 0!==e)}_getTreeNodeFromTree(e,t=this._treeNodeCache){var i;return null==(i=Array.from(t.entries()).find(t=>t[1]===e.id))?void 0:i[0]}_getUiNodeFromTree(e,t=this._treeNodeCache){var i;let s=Array.from(t.entries()),n=JSON.stringify(e),o=null==(i=s.find(e=>JSON.stringify(e[0])===n))?void 0:i[1];return o?this.shadowRoot.getElementById(o):void 0}_dispatchSelectEvent(e){return this.dispatchEvent(new ek(e||[]))}deselectAllNodes(){(this._uiGroups||[]).forEach(e=>e.deselect()),(this._uiNodes||[]).forEach(e=>e.selected=!1)}_sortNodes(e,t,i=!1){console.debug(`Sorting nodes in the tree menu using '${t}'`);let s=e.filter(e=>void 0!==e.children);if(s.forEach(e=>{var i;return null==(i=e.children)?void 0:i.sort(this._getSortFunction(t))}),i){let i=e.filter(e=>void 0===e.children);return s.sort(this._getSortFunction(t)),i.sort(this._getSortFunction(t)),[...s,...i]}return e.sort(this._getSortFunction(t))}_setTreeNodeId(e,t=eE.Util.generateUniqueUUID()){return this._treeNodeCache.get(e)?this._treeNodeCache.get(e):(this._treeNodeCache.set(e,t),t)}_getSortFunction(e){return e===eC.Z_TO_A?(e,t)=>t.label.localeCompare(e.label):eE.Util.sortByString(e=>e.label)}expandGroup(e){this.updateComplete.then(()=>{let t=this.nodes.find(t=>t.id===e&&t.children);t&&(t.expanded=!0,this.requestUpdate())})}};iY([ev({type:Array})],iJ.prototype,"nodes",void 0),iY([ev({type:String})],iJ.prototype,"selection",void 0),iY([ev({type:Boolean})],iJ.prototype,"draggable",void 0),iY([ev({type:Boolean,attribute:"no-header"})],iJ.prototype,"noHeader",void 0),iY([ev({type:String,attribute:"menu-title"})],iJ.prototype,"menuTitle",void 0),iY([ev({type:Array,attribute:"sort-options"})],iJ.prototype,"sortOptions",void 0),iY([ev({type:String,attribute:"sort-by",reflect:!0})],iJ.prototype,"sortBy",void 0),iY([ev({type:Boolean,attribute:"group-first"})],iJ.prototype,"groupFirst",void 0),iY([ef("or-tree-node")],iJ.prototype,"_uiNodes",void 0),iY([ef("or-tree-group")],iJ.prototype,"_uiGroups",void 0),iJ=iY([ep("or-tree-menu")],iJ)})(),o})());
817
+ `}_getErrorTemplate(){return q``}_onSortClick(e){this.sortBy=e}_onTreeGroupClick(e){let t=e.currentTarget,i=t.parentElement,s=(e,t)=>{e.select(),this._lastSelectedNode=t,this._notifyNodesSelect()};switch(this.selection){case ex.LEAF:return;case ex.MULTI:if(e.shiftKey&&this._lastSelectedNode){let e=Array.from(this._uiNodes||[]),t=i.getGroupNode();if(t){let i=e.indexOf(t),s=e.indexOf(this._lastSelectedNode);this._selectNodesBetween(e,i,s);return}}else if(e.ctrlKey)return void s(i,t);this.deselectAllNodes(),s(i,t);return;case ex.SINGLE:this.deselectAllNodes(),s(i,t);return}}_onTreeNodeClick(e){let t=e.currentTarget;if(t)if(this.selection===ex.MULTI){if(e.shiftKey&&this._lastSelectedNode){let e=Array.from(this._uiNodes||[]),i=e.indexOf(this._lastSelectedNode),s=e.indexOf(t);if(i>-1&&s>-1)return void this._selectNodesBetween(e,i,s)}else if(e.ctrlKey)return void this._selectNode(t);this.deselectAllNodes(),this._selectNode(t);return}else{this.deselectAllNodes(),this._selectNode(t);return}}_onDragStart(e,t){var i;e.target?null==(i=e.dataTransfer)||i.setData("treeNode",JSON.stringify(t)):e.preventDefault()}_onDragOverList(e){this.draggable&&e.preventDefault()}_onDragOverSingleNode(e,t,i){if(this.draggable&&(e.preventDefault(),i)){let e=this._getUiNodeFromTree(i);null==e||e.setAttribute("drophover","true")}}_onDragOverGroup(e,t){this.draggable&&(e.preventDefault(),e.currentTarget.setAttribute("drophover","true"))}_onDragLeaveSingleNode(e,t,i){if(i&&this.draggable){e.preventDefault();let t=this._getUiNodeFromTree(i);null==t||t.removeAttribute("drophover")}}_onDragLeaveGroup(e,t){this.draggable&&e.currentTarget.removeAttribute("drophover")}_onDragDropList(e){this._onDragDropGroup(e)}_onDragDropSingleNode(e,t,i){this._onDragDropGroup(e,i)}_onDragDropGroup(e,t){var i,s;if(this.draggable){e.preventDefault(),e.stopPropagation(),t&&(null==(i=this._getUiNodeFromTree(t))||i.removeAttribute("drophover"));let n=[],o=null==(s=e.dataTransfer)?void 0:s.getData("treeNode");if(o){let e=JSON.parse(o);e&&n.push(e)}if(this.selection===ex.MULTI){let e=this._findSelectedTreeNodes();(e=e.filter(e=>!e.children)).length>0&&(this.deselectAllNodes(),n.push(...e.filter(e=>!n.find(t=>JSON.stringify(t)===JSON.stringify(e)))))}(null==t?void 0:t.children)&&(n=n.filter(e=>{var i;return!(null==(i=t.children)?void 0:i.find(t=>t.id===e.id))})),n.length>0&&this._dispatchCancellableDragEvent(n,t,this.nodes).then(()=>{this.nodes=eA(n,t,this.nodes)}).catch(e=>{})}}_dispatchCancellableDragEvent(e,t,i=[]){return new Promise((s,n)=>{this.dispatchEvent(new eS(e,t,i))?s():n()})}_selectNode(e,t=!0){if(e){if(t){let t=[...this._findSelectedTreeNodes()],i=this._getTreeNodeFromTree(e);if(i&&t.push(i),!this._dispatchSelectEvent(t))return}e.selected=!0,this._lastSelectedNode=e}}_selectNodesBetween(e,t,i,s=!0){let n=[];if(t<i)for(let s=t;s<=i;s++)n.push(e[s]);else if(t>i)for(let s=i;s<=t;s++)n.push(e[s]);if(s){let e=n.map(e=>this._getTreeNodeFromTree(e)).filter(e=>e);if(!this._notifyNodesSelect(e))return}n.forEach(e=>this._selectNode(e))}_notifyNodesSelect(e){var t,i,s,n;return t=this,i=void 0,s=void 0,n=function*(){return yield this.getUpdateComplete(),e||(e=this._findSelectedTreeNodes()),this._dispatchSelectEvent(e)},new(s||(s=Promise))(function(e,o){function r(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(t){var i;t.done?e(t.value):((i=t.value)instanceof s?i:new s(function(e){e(i)})).then(r,a)}l((n=n.apply(t,i||[])).next())})}_findSelectedTreeNodes(e=Array.from(this._uiNodes||[]),t=this._treeNodeCache){let i=e.filter(e=>e.selected),s=Array.from(t.entries());return i.map(e=>s.find(t=>t[1]===e.id)).map(e=>null==e?void 0:e[0]).filter(e=>void 0!==e)}_getTreeNodeFromTree(e,t=this._treeNodeCache){var i;return null==(i=Array.from(t.entries()).find(t=>t[1]===e.id))?void 0:i[0]}_getUiNodeFromTree(e,t=this._treeNodeCache){var i;let s=Array.from(t.entries()),n=JSON.stringify(e),o=null==(i=s.find(e=>JSON.stringify(e[0])===n))?void 0:i[1];return o?this.shadowRoot.getElementById(o):void 0}_dispatchSelectEvent(e){return this.dispatchEvent(new ek(e||[]))}deselectAllNodes(){(this._uiGroups||[]).forEach(e=>e.deselect()),(this._uiNodes||[]).forEach(e=>e.selected=!1)}_sortNodes(e,t,i=!1){console.debug(`Sorting nodes in the tree menu using '${t}'`);let s=e.filter(e=>void 0!==e.children);if(s.forEach(e=>{var i;return null==(i=e.children)?void 0:i.sort(this._getSortFunction(t))}),i){let i=e.filter(e=>void 0===e.children);return s.sort(this._getSortFunction(t)),i.sort(this._getSortFunction(t)),[...s,...i]}return e.sort(this._getSortFunction(t))}_setTreeNodeId(e,t=eE.Util.generateUniqueUUID()){return this._treeNodeCache.get(e)?this._treeNodeCache.get(e):(this._treeNodeCache.set(e,t),t)}_getSortFunction(e){return e===eC.Z_TO_A?(e,t)=>t.label.localeCompare(e.label):eE.Util.sortByString(e=>e.label)}expandGroup(e){this.updateComplete.then(()=>{let t=this.nodes.find(t=>t.id===e&&t.children);t&&(t.expanded=!0,this.requestUpdate())})}};i0([ev({type:Array})],i2.prototype,"nodes",void 0),i0([ev({type:String})],i2.prototype,"selection",void 0),i0([ev({type:Boolean})],i2.prototype,"draggable",void 0),i0([ev({type:Boolean,attribute:"no-header"})],i2.prototype,"noHeader",void 0),i0([ev({type:String,attribute:"menu-title"})],i2.prototype,"menuTitle",void 0),i0([ev({type:Array,attribute:"sort-options"})],i2.prototype,"sortOptions",void 0),i0([ev({type:String,attribute:"sort-by",reflect:!0})],i2.prototype,"sortBy",void 0),i0([ev({type:Boolean,attribute:"group-first"})],i2.prototype,"groupFirst",void 0),i0([ef("or-tree-node")],i2.prototype,"_uiNodes",void 0),i0([ef("or-tree-group")],i2.prototype,"_uiGroups",void 0),i2=i0([ep("or-tree-menu")],i2)})(),o})());
807
818
  //# sourceMappingURL=index.js.map