UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

441 lines (374 loc) 104 kB
/*! For license information please see 27506.fcdc1824f021bb7d.js.LICENSE.txt */ export const __webpack_ids__=["27506"];export const __webpack_modules__={2394:function(e,t,i){i.d(t,{t:()=>l});var s=i(45779),o=(i(9359),i(52924),i(57243)),r=i(67753);const n=Symbol("valueNotInitialized");class a extends r.sR{constructor(e){if(super(e),e.type!==s.pX.ELEMENT)throw new Error(`\`${this.constructor.name}\` must be bound to an element.`);this.previousValue=n}render(e,t){return o.Ld}update(e,[t,i]){if(!this.hasChanged(i))return o.Ld;this.host=e.options&&e.options.host,this.element=e.element,this.renderer=t;return this.previousValue===n?this.addRenderer():this.runRenderer(),this.previousValue=Array.isArray(i)?[...i]:i,o.Ld}reconnected(){this.addRenderer()}disconnected(){this.removeRenderer()}addRenderer(){throw new Error("The `addRenderer` method must be implemented.")}runRenderer(){throw new Error("The `runRenderer` method must be implemented.")}removeRenderer(){throw new Error("The `removeRenderer` method must be implemented.")}renderRenderer(e,...t){const i=this.renderer.call(this.host,...t);(0,o.sY)(i,e,{host:this.host})}hasChanged(e){return Array.isArray(e)?!Array.isArray(this.previousValue)||(this.previousValue.length!==e.length||e.some(((e,t)=>e!==this.previousValue[t]))):this.previousValue!==e}}const l=(0,s.XM)(class extends a{addRenderer(){this.element.renderer=(e,t,i)=>{this.renderRenderer(e,i.item,i,t)}}runRenderer(){this.element.requestContentUpdate()}removeRenderer(){this.element.renderer=null}})},30080:function(e,t,i){i(9359),i(31526),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814);window.Vaadin||={},window.Vaadin.featureFlags||={};const s={};function o(e,t="24.7.1"){if(Object.defineProperty(e,"version",{get:()=>t}),e.experimental){const t="string"==typeof e.experimental?e.experimental:`${i=e.is.split("-").slice(1).join("-"),i.replace(/-[a-z]/gu,(e=>e[1].toUpperCase()))}Component`;if(!window.Vaadin.featureFlags[t]&&!s[t])return s[t]=new Set,s[t].add(e),void Object.defineProperty(window.Vaadin.featureFlags,t,{get:()=>0===s[t].size,set(e){e&&s[t].size>0&&(s[t].forEach((e=>{customElements.define(e.is,e)})),s[t].clear())}});if(s[t])return void s[t].add(e)}var i;const o=customElements.get(e.is);if(o){const t=o.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 ${o.version} is already in use. Something will probably break.`)}else customElements.define(e.is,e)}class r extends HTMLElement{static get is(){return"vaadin-material-styles"}}o(r),console.warn("The Material theme is deprecated and will be removed in Vaadin 25.");var n=i(94786),a=i(43631);const l=(e,...t)=>{(0,a.vR)(`material-${e}`,t)},h=n.iv` :host { /* Text colors */ --material-body-text-color: var(--light-theme-text-color, rgba(0, 0, 0, 0.87)); --material-secondary-text-color: var(--light-theme-secondary-color, rgba(0, 0, 0, 0.54)); --material-disabled-text-color: var(--light-theme-disabled-color, rgba(0, 0, 0, 0.38)); /* Primary colors */ --material-primary-color: var(--primary-color, #6200ee); --material-primary-contrast-color: var(--dark-theme-base-color, #fff); --material-primary-text-color: var(--material-primary-color); /* Error colors */ --material-error-color: var(--error-color, #b00020); --material-error-text-color: var(--material-error-color); /* Background colors */ --material-background-color: var(--light-theme-background-color, #fff); --material-secondary-background-color: var(--light-theme-secondary-background-color, #f5f5f5); --material-disabled-color: rgba(0, 0, 0, 0.26); /* Divider colors */ --material-divider-color: rgba(0, 0, 0, 0.12); /* Undocumented internal properties (prefixed with three dashes) */ /* Text field tweaks */ --_material-text-field-input-line-background-color: initial; --_material-text-field-input-line-opacity: initial; --_material-text-field-input-line-hover-opacity: initial; --_material-text-field-focused-label-opacity: initial; /* Button tweaks */ --_material-button-raised-background-color: initial; --_material-button-outline-color: initial; /* Grid tweaks */ --_material-grid-row-hover-background-color: initial; /* Split layout tweaks */ --_material-split-layout-splitter-background-color: initial; background-color: var(--material-background-color); color: var(--material-body-text-color); } [theme~='dark'] { /* Text colors */ --material-body-text-color: var(--dark-theme-text-color, rgba(255, 255, 255, 1)); --material-secondary-text-color: var(--dark-theme-secondary-color, rgba(255, 255, 255, 0.7)); --material-disabled-text-color: var(--dark-theme-disabled-color, rgba(255, 255, 255, 0.5)); /* Primary colors */ --material-primary-color: var(--light-primary-color, #7e3ff2); --material-primary-text-color: #b794f6; /* Error colors */ --material-error-color: var(--error-color, #de2839); --material-error-text-color: var(--material-error-color); /* Background colors */ --material-background-color: var(--dark-theme-background-color, #303030); --material-secondary-background-color: var(--dark-theme-secondary-background-color, #3b3b3b); --material-disabled-color: rgba(255, 255, 255, 0.3); /* Divider colors */ --material-divider-color: rgba(255, 255, 255, 0.12); /* Undocumented internal properties (prefixed with three dashes) */ /* Text field tweaks */ --_material-text-field-input-line-background-color: #fff; --_material-text-field-input-line-opacity: 0.7; --_material-text-field-input-line-hover-opacity: 1; --_material-text-field-focused-label-opacity: 1; /* Button tweaks */ --_material-button-raised-background-color: rgba(255, 255, 255, 0.08); --_material-button-outline-color: rgba(255, 255, 255, 0.2); /* Grid tweaks */ --_material-grid-row-hover-background-color: rgba(255, 255, 255, 0.08); --_material-grid-row-selected-overlay-opacity: 0.16; /* Split layout tweaks */ --_material-split-layout-splitter-background-color: rgba(255, 255, 255, 0.8); background-color: var(--material-background-color); color: var(--material-body-text-color); } a { color: inherit; } `;(0,n.hC)("",h,{moduleId:"material-color-light"});const d=n.iv` :host { /* Text colors */ --material-body-text-color: var(--dark-theme-text-color, rgba(255, 255, 255, 1)); --material-secondary-text-color: var(--dark-theme-secondary-color, rgba(255, 255, 255, 0.7)); --material-disabled-text-color: var(--dark-theme-disabled-color, rgba(255, 255, 255, 0.5)); /* Primary colors */ --material-primary-color: var(--light-primary-color, #7e3ff2); --material-primary-text-color: #b794f6; /* Error colors */ --material-error-color: var(--error-color, #de2839); --material-error-text-color: var(--material-error-color); /* Background colors */ --material-background-color: var(--dark-theme-background-color, #303030); --material-secondary-background-color: var(--dark-theme-secondary-background-color, #3b3b3b); --material-disabled-color: rgba(255, 255, 255, 0.3); /* Divider colors */ --material-divider-color: rgba(255, 255, 255, 0.12); /* Undocumented internal properties (prefixed with three dashes) */ /* Text field tweaks */ --_material-text-field-input-line-background-color: #fff; --_material-text-field-input-line-opacity: 0.7; --_material-text-field-input-line-hover-opacity: 1; --_material-text-field-focused-label-opacity: 1; /* Button tweaks */ --_material-button-raised-background-color: rgba(255, 255, 255, 0.08); --_material-button-outline-color: rgba(255, 255, 255, 0.2); /* Grid tweaks */ --_material-grid-row-hover-background-color: rgba(255, 255, 255, 0.08); --_material-grid-row-selected-overlay-opacity: 0.16; /* Split layout tweaks */ --_material-split-layout-splitter-background-color: rgba(255, 255, 255, 0.8); background-color: var(--material-background-color); color: var(--material-body-text-color); } `;(0,n.hC)("",d,{moduleId:"material-color-dark"});l("color-base",n.iv` :host { /* Text colors */ --material-body-text-color: var(--light-theme-text-color, rgba(0, 0, 0, 0.87)); --material-secondary-text-color: var(--light-theme-secondary-color, rgba(0, 0, 0, 0.54)); --material-disabled-text-color: var(--light-theme-disabled-color, rgba(0, 0, 0, 0.38)); /* Primary colors */ --material-primary-color: var(--primary-color, #6200ee); --material-primary-contrast-color: var(--dark-theme-base-color, #fff); --material-primary-text-color: var(--material-primary-color); /* Error colors */ --material-error-color: var(--error-color, #b00020); --material-error-text-color: var(--material-error-color); /* Background colors */ --material-background-color: var(--light-theme-background-color, #fff); --material-secondary-background-color: var(--light-theme-secondary-background-color, #f5f5f5); --material-disabled-color: rgba(0, 0, 0, 0.26); /* Divider colors */ --material-divider-color: rgba(0, 0, 0, 0.12); } `);const c=n.iv` :host { display: flex; align-items: center; box-sizing: border-box; min-height: 36px; padding: 8px 32px 8px 10px; overflow: hidden; font-family: var(--material-font-family); font-size: var(--material-small-font-size); line-height: 24px; } /* It's the list-box's responsibility to add the focus style */ :host([focused]) { outline: none; } /* Checkmark */ [part='checkmark']::before { display: var(--_material-item-selected-icon-display, none); content: ''; font-family: material-icons; font-size: 24px; line-height: 1; font-weight: 400; width: 24px; text-align: center; margin-right: 10px; color: var(--material-secondary-text-color); flex: none; } :host([selected]) [part='checkmark']::before { content: var(--material-icons-check); } @media (any-hover: hover) { :host(:hover:not([disabled])) { background-color: var(--material-secondary-background-color); } } :host([focused]:not([disabled])) { background-color: var(--material-divider-color); } /* Disabled */ :host([disabled]) { color: var(--material-disabled-text-color); cursor: default; pointer-events: none; } /* RTL specific styles */ :host([dir='rtl']) { padding: 8px 10px 8px 32px; } :host([dir='rtl']) [part='checkmark']::before { margin-right: 0; margin-left: 10px; } `;(0,n.hC)("vaadin-item",c,{moduleId:"material-item"});const u=n.iv` :host { cursor: pointer; -webkit-tap-highlight-color: transparent; padding: 4px 10px; --_material-item-selected-icon-display: block; } `;(0,n.hC)("vaadin-combo-box-item",[c,u],{moduleId:"material-combo-box-item"});const _=n.iv` [part~='loader'] { height: 2px; background: var(--material-background-color) linear-gradient( 90deg, transparent 0%, transparent 20%, var(--material-primary-color) 20%, var(--material-primary-color) 40%, transparent 40%, transparent 60%, var(--material-primary-color) 60%, var(--material-primary-color) 80%, transparent 80%, transparent 100% ) 0 0 / 400% 100% repeat-x; opacity: 0; } :host(:not([loading])) [part~='loader'] { display: none; } :host([loading]) [part='loader'] { animation: 3s linear infinite material-loader-progress, 0.3s 0.1s both material-loader-fade-in; } [part='loader']::before { content: ''; display: block; height: 100%; opacity: 0.16; background: var(--material-primary-color); } @keyframes material-loader-fade-in { 0% { opacity: 0; } 100% { opacity: 1; } } @keyframes material-loader-progress { 0% { background-position: 0 0; background-size: 300% 100%; } 33% { background-position: -100% 0; background-size: 400% 100%; } 67% { background-position: -200% 0; background-size: 250% 100%; } 100% { background-position: -300% 0; background-size: 300% 100%; } } /* RTL specific styles */ @keyframes material-loader-progress-rtl { 0% { background-position: 100% 0; background-size: 300% 100%; } 33% { background-position: 200% 0; background-size: 400% 100%; } 67% { background-position: 300% 0; background-size: 250% 100%; } 100% { background-position: 400% 0; background-size: 300% 100%; } } :host([loading][dir='rtl']) [part='loader'] { animation: 3s linear infinite material-loader-progress-rtl, 0.3s 0.1s both material-loader-fade-in; } `;l("shadow",n.iv` /* prettier-ignore */ :host { /* from http://codepen.io/shyndman/pen/c5394ddf2e8b2a5c9185904b57421cdb */ --material-shadow-elevation-2dp: 0 2px 2px 0 rgba(0, 0, 0, 0.14), 0 1px 5px 0 rgba(0, 0, 0, 0.12), 0 3px 1px -2px rgba(0, 0, 0, 0.2); --material-shadow-elevation-3dp: 0 3px 4px 0 rgba(0, 0, 0, 0.14), 0 1px 8px 0 rgba(0, 0, 0, 0.12), 0 3px 3px -2px rgba(0, 0, 0, 0.4); --material-shadow-elevation-4dp: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.4); --material-shadow-elevation-6dp: 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12), 0 3px 5px -1px rgba(0, 0, 0, 0.4); --material-shadow-elevation-8dp: 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.4); --material-shadow-elevation-12dp: 0 12px 16px 1px rgba(0, 0, 0, 0.14), 0 4px 22px 3px rgba(0, 0, 0, 0.12), 0 6px 7px -4px rgba(0, 0, 0, 0.4); --material-shadow-elevation-16dp: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.4); --material-shadow-elevation-24dp: 0 24px 38px 3px rgba(0, 0, 0, 0.14), 0 9px 46px 8px rgba(0, 0, 0, 0.12), 0 11px 15px -7px rgba(0, 0, 0, 0.4); } `);const p=n.iv` :host { top: 16px; right: 16px; /* TODO (@jouni): remove unnecessary multiplication after https://github.com/vaadin/vaadin-overlay/issues/90 is fixed */ bottom: calc(1px * var(--vaadin-overlay-viewport-bottom) + 16px); left: 16px; } [part='overlay'] { background-color: var(--material-background-color); border-radius: 4px; box-shadow: var(--material-shadow-elevation-4dp); color: var(--material-body-text-color); font-family: var(--material-font-family); font-size: var(--material-body-font-size); font-weight: 400; } [part='content'] { padding: 8px 0; } [part='backdrop'] { opacity: 0.2; animation: 0.2s vaadin-overlay-backdrop-enter; will-change: opacity; } @keyframes vaadin-overlay-backdrop-enter { 0% { opacity: 0; } } `;(0,n.hC)("",p,{moduleId:"material-overlay"});const m=p;(0,n.hC)("",m,{moduleId:"material-menu-overlay"});const g=n.iv` [part='overlay'] { position: relative; border-top-left-radius: 0; border-top-right-radius: 0; } /* Overflow needs to be auto by default to make overlay sizing logic work */ /* When loading, overflow needs to be visible to make loading indicator visible */ :host([loading]) [part='overlay'] { overflow: visible; } [part='content'] { padding: 0; } `,v=n.iv` [part~='loader'] { position: absolute; z-index: 1; top: -2px; left: 0; right: 0; } `;(0,n.hC)("vaadin-combo-box-overlay",[m,g,_,v,n.iv` :host { --_vaadin-combo-box-items-container-border-width: 8px 0; --_vaadin-combo-box-items-container-border-style: solid; } `],{moduleId:"material-combo-box-overlay"});var b=i(93588);i(92745);const f=[];function y(e,t,i=e.getAttribute("dir")){t?e.setAttribute("dir",t):null!=i&&e.removeAttribute("dir")}function x(){return document.documentElement.getAttribute("dir")}new MutationObserver((function(){const e=x();f.forEach((t=>{y(t,e)}))})).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const C=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(),y(this,x(),null))}attributeChangedCallback(e,t,i){if(super.attributeChangedCallback(e,t,i),"dir"!==e)return;const s=x(),o=i===s&&-1===f.indexOf(this),r=!i&&t&&-1===f.indexOf(this),n=i!==s&&t===s;o||r?(this.__subscribe(),y(this,s,i)):n&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=f.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(){f.includes(this)||f.push(this)}__unsubscribe(){f.includes(this)&&f.splice(f.indexOf(this),1)}},I=e=>class extends e{static get properties(){return{index:{type:Number},item:{type:Object},label:{type:String},selected:{type:Boolean,value:!1,reflectToAttribute:!0},focused:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Function}}}static get observers(){return["__rendererOrItemChanged(renderer, index, item, selected, focused)","__updateLabel(label, renderer)"]}static get observedAttributes(){return[...super.observedAttributes,"hidden"]}attributeChangedCallback(e,t,i){"hidden"===e&&null!==i?this.index=void 0:super.attributeChangedCallback(e,t,i)}connectedCallback(){super.connectedCallback(),this._owner=this.parentNode.owner;const e=this._owner.getAttribute("dir");e&&this.setAttribute("dir",e)}requestContentUpdate(){if(!this.renderer||this.hidden)return;const e={index:this.index,item:this.item,focused:this.focused,selected:this.selected};this.renderer(this,this._owner,e)}__rendererOrItemChanged(e,t,i){void 0!==i&&void 0!==t&&(this._oldRenderer!==e&&(this.innerHTML="",delete this._$litPart$),e&&(this._oldRenderer=e,this.requestContentUpdate()))}__updateLabel(e,t){t||(this.textContent=e)}};class w extends(I((0,n.Tb)(C(b.H3)))){static get template(){return b.dy` <style> :host { display: block; } :host([hidden]) { display: none; } </style> <span part="checkmark" aria-hidden="true"></span> <div part="content"> <slot></slot> </div> `}static get is(){return"vaadin-combo-box-item"}}o(w);var E=i(85695);const S=e=>e.test(navigator.userAgent),P=e=>e.test(navigator.platform);S(/Android/u),S(/Chrome/u)&&/Google Inc/u.test(navigator.vendor);S(/Firefox/u);const T=P(/^iPad/u)||P(/^Mac/u)&&navigator.maxTouchPoints>1,V=P(/^iPhone/u)||T,k=S(/^((?!chrome|android).)*safari/iu),z=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}})();window.ShadowRoot&&"adoptedStyleSheets"in Document.prototype&&CSSStyleSheet.prototype;i(56475),i(70104);let O=new WeakMap,A=new WeakMap,L={},F=0;const M=e=>e&&e.nodeType===Node.ELEMENT_NODE,R=(...e)=>{console.error(`Error: ${e.join(" ")}. Skip setting aria-hidden.`)},N=(e,t,i,s)=>{const o=((e,t)=>M(e)?t.map((t=>{if(!M(t))return R(t,"is not a valid element"),null;let i=t;for(;i&&i!==e;){if(e.contains(i))return t;i=i.getRootNode().host}return R(t,"is not contained inside",e),null})).filter((e=>Boolean(e))):(R(e,"is not a valid element"),[]))(t,Array.isArray(e)?e:[e]);L[i]||(L[i]=new WeakMap);const r=L[i],n=[],a=new Set,l=new Set(o),h=e=>{if(!e||a.has(e))return;a.add(e);const t=e.assignedSlot;t&&h(t),h(e.parentNode||e.host)};o.forEach(h);const d=e=>{if(!e||l.has(e))return;const t=e.shadowRoot;(t?[...e.children,...t.children]:[...e.children]).forEach((e=>{if(!["template","script","style"].includes(e.localName))if(a.has(e))d(e);else{const t=e.getAttribute(s),o=null!==t&&"false"!==t,a=(O.get(e)||0)+1,l=(r.get(e)||0)+1;O.set(e,a),r.set(e,l),n.push(e),1===a&&o&&A.set(e,!0),1===l&&e.setAttribute(i,"true"),o||e.setAttribute(s,"true")}}))};return d(t),a.clear(),F+=1,()=>{n.forEach((e=>{const t=O.get(e)-1,o=r.get(e)-1;O.set(e,t),r.set(e,o),t||(A.has(e)?A.delete(e):e.removeAttribute(s)),o||e.removeAttribute(i)})),F-=1,F||(O=new WeakMap,O=new WeakMap,A=new WeakMap,L={})}},D=(e,t=document.body,i="data-aria-hidden")=>{const s=Array.from(Array.isArray(e)?e:[e]);return t&&s.push(...Array.from(t.querySelectorAll("[aria-live]"))),N(s,t,i,"aria-hidden")};HTMLElement.prototype;class B{constructor(e,t){this.host=e,this.callback="function"==typeof t?t:()=>e}showModal(){const e=this.callback();this.__showOthers=D(e)}close(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null)}}let H=!1;function $(){let e=document.activeElement||document.body;for(;e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function q(){return H}function W(e){const t=e.style;if("hidden"===t.visibility||"none"===t.display)return!0;const i=window.getComputedStyle(e);return"hidden"===i.visibility||"none"===i.display}function U(e,t){const i=Math.max(e.tabIndex,0),s=Math.max(t.tabIndex,0);return 0===i||0===s?s>i:i>s}function j(e){const t=e.length;if(t<2)return e;const i=Math.ceil(t/2);return function(e,t){const i=[];for(;e.length>0&&t.length>0;)U(e[0],t[0])?i.push(t.shift()):i.push(e.shift());return i.concat(e,t)}(j(e.slice(0,i)),j(e.slice(i)))}function G(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 K(e){return e.getRootNode().activeElement===e}function Y(e,t){if(e.nodeType!==Node.ELEMENT_NODE||W(e))return!1;const i=e,s=function(e){if(!G(e))return-1;const t=e.getAttribute("tabindex")||0;return Number(t)}(i);let o=s>0;s>=0&&t.push(i);let r=[];return r="slot"===i.localName?i.assignedNodes({flatten:!0}):(i.shadowRoot||i).children,[...r].forEach((e=>{o=Y(e,t)||o})),o}window.addEventListener("keydown",(()=>{H=!0}),{capture:!0}),window.addEventListener("mousedown",(()=>{H=!1}),{capture:!0});class X{saveFocus(e){this.focusNode=e||$()}restoreFocus(e){const t=this.focusNode;if(!t)return;const i=!!e&&e.preventScroll;$()===document.body?setTimeout((()=>t.focus({preventScroll:i}))):t.focus({preventScroll:i}),this.focusNode=null}}const Q=[];class Z{constructor(e){this.host=e,this.__trapNode=null,this.__onKeyDown=this.__onKeyDown.bind(this)}get __focusableElements(){return function(e){const t=[];return Y(e,t)?j(t):t}(this.__trapNode)}get __focusedElementIndex(){const e=this.__focusableElements;return e.indexOf(e.filter(K).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,new Error("The trap node should have at least one focusable descendant or be focusable itself.");Q.push(this),-1===this.__focusedElementIndex&&this.__focusableElements[0].focus()}releaseFocus(){this.__trapNode=null,Q.pop()}__onKeyDown(e){if(this.__trapNode&&this===Array.from(Q).pop()&&"Tab"===e.key){e.preventDefault();const t=e.shiftKey;this.__focusNextElement(t)}}__focusNextElement(e=!1){const t=this.__focusableElements,i=e?-1:1,s=this.__focusedElementIndex,o=t[(t.length+s+i)%t.length];o.focus(),"input"===o.localName&&o.select()}}var J=i(19883);const ee=(0,J.o)((e=>"function"==typeof e.prototype.addController?e:class extends e{constructor(){super(),this.__controllers=new Set}connectedCallback(){super.connectedCallback(),this.__controllers.forEach((e=>{e.hostConnected&&e.hostConnected()}))}disconnectedCallback(){super.disconnectedCallback(),this.__controllers.forEach((e=>{e.hostDisconnected&&e.hostDisconnected()}))}addController(e){this.__controllers.add(e),void 0!==this.$&&this.isConnected&&e.hostConnected&&e.hostConnected()}removeController(e){this.__controllers.delete(e)}})),te=e=>class extends(ee(e)){static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__ariaModalController=new B(this),this.__focusTrapController=new Z(this),this.__focusRestorationController=new X}ready(){super.ready(),this.addController(this.__ariaModalController),this.addController(this.__focusTrapController),this.addController(this.__focusRestorationController)}_resetFocus(){if(this.focusTrap&&(this.__ariaModalController.close(),this.__focusTrapController.releaseFocus()),this.restoreFocusOnClose&&this._shouldRestoreFocus()){const e=!q();this.__focusRestorationController.restoreFocus({preventScroll:e})}}_saveFocus(){this.restoreFocusOnClose&&this.__focusRestorationController.saveFocus(this.restoreFocusNode)}_trapFocus(){this.focusTrap&&(this.__ariaModalController.showModal(),this.__focusTrapController.trapFocus(this.$.overlay))}_shouldRestoreFocus(){const e=$();return e===document.body||this._deepContains(e)}_deepContains(e){if(this.contains(e))return!0;let t=e;const i=e.ownerDocument;for(;t&&t!==i&&t!==this;)t=t.parentNode||t.host;return t===this}},ie=()=>Array.from(document.body.children).filter((e=>e instanceof HTMLElement&&e._hasOverlayStackMixin&&!e.hasAttribute("closing"))).sort(((e,t)=>e.__zIndex-t.__zIndex||0)),se=()=>ie().filter((e=>e.$.overlay)),oe=new WeakMap,re=e=>class extends e{constructor(){super(),this._hasOverlayStackMixin=!0}get _last(){return this===se().pop()}bringToFront(){let e="";const t=ie().filter((e=>e!==this)).pop();if(t){e=t.__zIndex+1}this.style.zIndex=e,this.__zIndex=e||parseFloat(getComputedStyle(this).zIndex),oe.has(this)&&oe.get(this).bringToFront()}_enterModalState(){"none"!==document.body.style.pointerEvents&&(this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),se().forEach((e=>{e!==this&&(e.$.overlay.style.pointerEvents="none")}))}_exitModalState(){void 0!==this._previousDocumentPointerEvents&&(document.body.style.pointerEvents=this._previousDocumentPointerEvents,delete this._previousDocumentPointerEvents);const e=se();let t;for(;(t=e.pop())&&(t===this||(t.$.overlay.style.removeProperty("pointer-events"),t.modeless)););}},ne=e=>class extends(te(re(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,sync:!0}}}static get observers(){return["_rendererOrDataChanged(renderer, owner, model, opened)"]}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),V&&(this._boundIosResizeListener=()=>this._detectIosNavbar())}ready(){super.ready(),this.addEventListener("click",(()=>{})),this.$.backdrop.addEventListener("click",(()=>{})),this.addEventListener("mouseup",(()=>{document.activeElement===document.body&&"0"===this.$.overlay.getAttribute("tabindex")&&this.$.overlay.focus()}))}connectedCallback(){super.connectedCallback(),this._boundIosResizeListener&&(this._detectIosNavbar(),window.addEventListener("resize",this._boundIosResizeListener))}disconnectedCallback(){super.disconnectedCallback(),this._boundIosResizeListener&&window.removeEventListener("resize",this._boundIosResizeListener)}requestContentUpdate(){this.renderer&&this.renderer.call(this.owner,this,this.owner,this.model)}close(e){const t=new CustomEvent("vaadin-overlay-close",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),t.defaultPrevented||(this.opened=!1)}_detectIosNavbar(){if(!this.opened)return;const e=window.innerHeight,t=window.innerWidth>e,i=document.documentElement.clientHeight;t&&i>e?this.style.setProperty("--vaadin-overlay-viewport-bottom",i-e+"px"):this.style.setProperty("--vaadin-overlay-viewport-bottom","0")}_addGlobalListeners(){document.addEventListener("mousedown",this._boundMouseDownListener),document.addEventListener("mouseup",this._boundMouseUpListener),document.documentElement.addEventListener("click",this._boundOutsideClickListener,!0)}_removeGlobalListeners(){document.removeEventListener("mousedown",this._boundMouseDownListener),document.removeEventListener("mouseup",this._boundMouseUpListener),document.documentElement.removeEventListener("click",this._boundOutsideClickListener,!0)}_rendererOrDataChanged(e,t,i,s){const o=this._oldOwner!==t||this._oldModel!==i;this._oldModel=i,this._oldOwner=t;const r=this._oldRenderer!==e,n=void 0!==this._oldRenderer;this._oldRenderer=e;const a=this._oldOpened!==s;this._oldOpened=s,r&&n&&(this.innerHTML="",delete this._$litPart$),s&&e&&(r||a||o)&&this.requestContentUpdate()}_modelessChanged(e){e?(this._removeGlobalListeners(),this._exitModalState()):this.opened&&(this._addGlobalListeners(),this._enterModalState())}_openedChanged(e,t){e?(this._saveFocus(),this._animatedOpening(),(0,E.T8)(this,(()=>{this._trapFocus();const e=new CustomEvent("vaadin-overlay-open",{bubbles:!0});this.dispatchEvent(e)})),document.addEventListener("keydown",this._boundKeydownListener),this.modeless||this._addGlobalListeners()):t&&(this._resetFocus(),this._animatedClosing(),document.removeEventListener("keydown",this._boundKeydownListener),this.modeless||this._removeGlobalListeners())}_hiddenChanged(e){e&&this.hasAttribute("closing")&&this._flushAnimation("closing")}_shouldAnimate(){const e=getComputedStyle(this),t=e.getPropertyValue("animation-name");return!("none"===e.getPropertyValue("display"))&&t&&"none"!==t}_enqueueAnimation(e,t){const 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){const t=`__${e}Handler`;"function"==typeof this[t]&&this[t]()}_animatedOpening(){this.parentNode===document.body&&this.hasAttribute("closing")&&this._flushAnimation("closing"),this._attachOverlay(),this.modeless||this._enterModalState(),this.setAttribute("opening",""),this._shouldAnimate()?this._enqueueAnimation("opening",(()=>{this._finishOpening()})):this._finishOpening()}_attachOverlay(){this._placeholder=document.createComment("vaadin-overlay-placeholder"),this.parentNode.insertBefore(this._placeholder,this),document.body.appendChild(this),this.bringToFront()}_finishOpening(){this.removeAttribute("opening")}_finishClosing(){this._detachOverlay(),this.$.overlay.style.removeProperty("pointer-events"),this.removeAttribute("closing"),this.dispatchEvent(new CustomEvent("vaadin-overlay-closed"))}_animatedClosing(){this.hasAttribute("opening")&&this._flushAnimation("opening"),this._placeholder&&(this._exitModalState(),this.setAttribute("closing",""),this.dispatchEvent(new CustomEvent("vaadin-overlay-closing")),this._shouldAnimate()?this._enqueueAnimation("closing",(()=>{this._finishClosing()})):this._finishClosing())}_detachOverlay(){this._placeholder.parentNode.insertBefore(this,this._placeholder),this._placeholder.parentNode.removeChild(this._placeholder)}_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)return this._mouseDownInside=!1,void(this._mouseUpInside=!1);if(!this._shouldCloseOnOutsideClick(e))return;const t=new CustomEvent("vaadin-overlay-outside-click",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}_keydownListener(e){if(this._last&&(!this.modeless||e.composedPath().includes(this.$.overlay))&&"Escape"===e.key){const t=new CustomEvent("vaadin-overlay-escape-press",{bubbles:!0,cancelable:!0,detail:{sourceEvent:e}});this.dispatchEvent(t),this.opened&&!t.defaultPrevented&&this.close(e)}}};const ae=i(57243).iv`:host{z-index:200;position:fixed;inset:0;bottom:var(--vaadin-overlay-viewport-bottom);display:flex;flex-direction:column;align-items:center;justify-content:center;margin:auto;pointer-events:none;-webkit-tap-highlight-color:transparent;--vaadin-overlay-viewport-bottom:0}:host(:not([opened]):not([closing])),:host(:not([opened]):not([closing])) [part=overlay],:host([hidden]){display:none!important}[part=overlay]{-webkit-overflow-scrolling:touch;overflow:auto;pointer-events:auto;max-width:100%;box-sizing:border-box;-webkit-tap-highlight-color:initial}[part=backdrop]{z-index:-1;content:'';background:rgba(0,0,0,.5);position:fixed;inset:0;pointer-events:auto}`;const le={start:"top",end:"bottom"},he={start:"left",end:"right"},de=new ResizeObserver((e=>{setTimeout((()=>{e.forEach((e=>{e.target.__overlay&&e.target.__overlay._updatePosition()}))}))})),ce=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}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}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()}__addUpdatePositionEventListeners(){window.visualViewport.addEventListener("resize",this._updatePosition),window.visualViewport.addEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes=function(e){const t=[];for(;e;){if(e.nodeType===Node.DOCUMENT_NODE){t.push(e);break}e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?e=e.assignedSlot?e.assignedSlot:e.parentNode:(t.push(e),e=e.host)}return t}(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach((e=>{e.addEventListener("scroll",this.__onScroll,!0)})),this.positionTarget&&(this.__observePositionTargetMove=function(e,t){let i=null;const s=document.documentElement;function o(){i&&i.disconnect(),i=null}return function r(n=!1,a=1){o();const{left:l,top:h,width:d,height:c}=e.getBoundingClientRect();if(n||t(),!d||!c)return;const u={rootMargin:`${-Math.floor(h)}px ${-Math.floor(s.clientWidth-(l+d))}px ${-Math.floor(s.clientHeight-(h+c))}px ${-Math.floor(l)}px`,threshold:Math.max(0,Math.min(1,a))||1};let _=!0;i=new IntersectionObserver((function(e){let t=e[0].intersectionRatio;if(t!==a){if(!_)return r();0===t&&(t=1e-7),r(!1,t)}_=!1}),u),i.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)}__overlayOpenedChanged(e,t){if(this.__removeUpdatePositionEventListeners(),t&&(t.__overlay=null,de.unobserve(t),e&&(this.__addUpdatePositionEventListeners(),t.__overlay=this,de.observe(t))),e){const 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()))}}__positionSettingsChanged(){this._updatePosition()}__onScroll(e){e.target instanceof Node&&this.contains(e.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened||!this.__margins)return;const e=this.positionTarget.getBoundingClientRect();if(0===e.width&&0===e.height&&this.opened)return void(this.opened=!1);const t=this.__shouldAlignStartVertically(e);this.style.justifyContent=t?"flex-start":"flex-end";const i=this.__isRTL,s=this.__shouldAlignStartHorizontally(e,i),o=!i&&s||i&&!s;this.style.alignItems=o?"flex-start":"flex-end";const r=this.getBoundingClientRect(),n=this.__calculatePositionInOneDimension(e,r,this.noVerticalOverlap,le,this,t),a=this.__calculatePositionInOneDimension(e,r,this.noHorizontalOverlap,he,this,s);Object.assign(this.style,n,a),this.toggleAttribute("bottom-aligned",!t),this.toggleAttribute("top-aligned",t),this.toggleAttribute("end-aligned",!o),this.toggleAttribute("start-aligned",o)}__shouldAlignStartHorizontally(e,t){const i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const s=Math.min(window.innerWidth,document.documentElement.clientWidth),o=!t&&"start"===this.horizontalAlign||t&&"end"===this.horizontalAlign;return this.__shouldAlignStart(e,i,s,this.__margins,o,this.noHorizontalOverlap,he)}__shouldAlignStartVertically(e){const t=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const i=Math.min(window.innerHeight,document.documentElement.clientHeight),s="top"===this.verticalAlign;return this.__shouldAlignStart(e,t,i,this.__margins,s,this.noVerticalOverlap,le)}__shouldAlignStart(e,t,i,s,o,r,n){const a=i-e[r?n.end:n.start]-s[n.end],l=e[r?n.start:n.end]-s[n.start],h=o?a:l;return o===(h>(o?l:a)||h>t)}__adjustBottomProperty(e,t,i){let s;if(e===t.end){if(t.end===le.end){const e=Math.min(window.innerHeight,document.documentElement.clientHeight);if(i>e&&this.__oldViewportHeight){s=i-(this.__oldViewportHeight-e)}this.__oldViewportHeight=e}if(t.end===he.end){const e=Math.min(window.innerWidth,document.documentElement.clientWidth);if(i>e&&this.__oldViewportWidth){s=i-(this.__oldViewportWidth-e)}this.__oldViewportWidth=e}}return s}__calculatePositionInOneDimension(e,t,i,s,o,r){const n=r?s.start:s.end,a=r?s.end:s.start,l=parseFloat(o.style[n]||getComputedStyle(o)[n]),h=this.__adjustBottomProperty(n,s,l),d=t[r?s.start:s.end]-e[i===r?s.end:s.start],c=h?`${h}px`:`${l+d*(r?-1:1)}px`;return{[n]:c,[a]:""}}},ue=e=>class extends(ce(e)){static get observers(){return["_setOverlayWidth(positionTarget, opened)"]}constructor(){super(),this.requiredVerticalSpace=200}connectedCallback(){super.connectedCallback();const e=this._comboBox,t=e&&e.getAttribute("dir");t&&this.setAttribute("dir",t)}_shouldCloseOnOutsideClick(e){const t=e.composedPath();return!t.includes(this.positionTarget)&&!t.includes(this)}_mouseDownListener(e){super._mouseDownListener(e),this._shouldCloseOnOutsideClick(e)&&!G(e.composedPath()[0])&&e.preventDefault()}_updateOverlayWidth(){const e=this.localName;this.style.setProperty(`--_${e}-default-width`,`${this.positionTarget.clientWidth}px`);const t=getComputedStyle(this._comboBox).getPropertyValue(`--${e}-width`);""===t?this.style.removeProperty(`--${e}-width`):this.style.setProperty(`--${e}-width`,t)}_setOverlayWidth(e,t){e&&t&&(this._updateOverlayWidth(),this._updatePosition())}},_e=n.iv` #overlay { width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto)); } [part='content'] { display: flex; flex-direction: column; height: 100%; } `;(0,n.hC)("vaadin-combo-box-overlay",[ae,_e],{moduleId:"vaadin-combo-box-overlay-styles"});class pe extends(ue(ne(C((0,n.Tb)(b.H3))))){static get is(){return"vaadin-combo-box-overlay"}static get template(){return b.dy` <div id="backdrop" part="backdrop" hidden></div> <div part="overlay" id="overlay"> <div part="loader"></div> <div part="content" id="content"><slot></slot></div> </div> `}}o(pe);i(48136);function me(e,t){return e.split(".").reduce(((e,t)=>e?e[t]:void 0),t)}let ge=0;i(1331),i(52924);let ve=0,be=0;const fe=[];let ye=!1;const xe={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)}},Ce={run:e=>window.requestAnimationFrame(e),cancel(e){window.cancelAnimationFrame(e)}},Ie={run:e=>window.requestIdleCallback?window.requestIdleCallback(e):window.setTimeout(e,16),cancel(e){window.cancelIdleCallback?window.cancelIdleCallback(e):window.clearTimeout(e)}},we={run(e){ye||(ye=!0,queueMicrotask((()=>function(){ye=!1;const e=fe.length;for(let t=0;t<e;t++){const e=fe[t];if(e)try{e()}catch(e){setTimeout((()=>{throw e}))}}fe.splice(0,e),be+=e}()))),fe.push(e);const t=ve;return ve+=1,t},cancel(e){const t=e-be;if(t>=0){if(!fe[t])throw new Error(`invalid async handle: ${e}`);fe[t]=null}}},Ee=new Set;class Se{static debounce(e,t,i){return e instanceof Se?e._cancelAsync():e=new Se,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,Ee.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),Ee.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}}function Pe(){const e=Boolean(Ee.size);return Ee.forEach((e=>{try{e.flush()}catch(e){setTimeout((()=>{throw e}))}})),e}const Te=()=>{let e;do{e=Pe()}while(e)},Ve=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/u),ke=Ve&&Ve[1]>=8,ze={_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_lastVisibleIndexVal:null,_maxPages:2,_templateCost:0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return this._physicalSize-this._viewportHeight},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset},get _maxVirtualStart(){const e=this._virtualCount;return Math.max(0,e-this._physicalCount)},get _virtualStart(){return this._virtualStartVal||0},set _virtualStart(e){e=this._clamp(e,0,this._maxVirtualStart),this._virtualStartVal=e},get _physicalStart(){return this._physicalStartVal||0},set _physicalStart(e){(e%=this._physicalCount)<0&&(e=this._physicalCount+e),this._physicalStartVal=e},get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalCount(){return this._physicalCountVal||0},set _physicalCount(e){this._physicalCountVal=e},get _optPhysicalSize(){return 0===this._viewportHeight?1/0:this._viewportHeight*this._maxPages},get _isVisible(){return Boolean(this.offsetWidth||this.offsetHeight)},get firstVisibleIndex(){let e=this._firstVisibleIndexVal;if(null==e){let t=this._physicalTop+this._scrollOffset;e=this._iterateItems(((e,i)=>{if(t+=this._getPhysicalSizeIncrement(e),t>this._scrollPosition)return i}))||0,this._firstVisibleIndexVal=e}return e},get lastVisibleIndex(){let e=this._lastVisibleIndexVal;if(null==e){let t=this._physicalTop+this._scrollOffset;this._iterateItems(((i,s)=>{t<this._scrollBottom&&(e=s),t+=this._getPhysicalSizeIncrement(i)})),this._lastVisibleIndexVal=e}return e},get _scrollOffset(){return this._scrollerPaddingTop+this.scrollOffset},_scrollHandler(){const e=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop));let t=e-this._scrollPosition;const i=t>=0;if(this._scrollPosition=e,this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,Math.abs(t)>this._physicalSize&&this._physicalSize>0){t-=this._scrollOffset;const e=Math.round(t/this._physicalAverage);this._virtualStart+=e,this._physicalStart+=e,this._physicalTop=Math.min(Math.floor(this._virtualStart)*this._physicalAverage,this._scrollPosition),this._update()}else if(this._physicalCount>0){const e=this._getReusables(i);i?(this._physicalTop=e.physicalTop,this._virtualStart+=e.indexes.length,this._physicalStart+=e.indexes.length):(this._virtualStart-=e.indexes.length,this._physicalStart-=e.indexes.length),this._update(e.indexes,i?null:e.indexes),this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,0),we)}},_getReusables(e){let t,i,s;const o=[],r=this._hiddenContentSize*this._ratio,n=this._virtualStart,a=this._virtualEnd,l=this._physicalCount;let h=this._physicalTop+this._scrollOffset;const d=this._physicalBottom+this._scrollOffset,c=this._scrollPosition,u=this._scrollBottom;for(e?(t=this._physicalStart,i=c-h):(t=this._physicalEnd,i=d-u);s=this._getPhysicalSizeIncrement(t),i-=s,!(o.length>=l||i<=r);)if(e){if(a+o.length+1>=this._virtualCount)break;if(h+s>=c-this._scrollOffset)break;o.push(t),h+=s,t=(t+1)%l}else{if(n-o.length<=0)break;if(h+this._physicalSize-s<=u)break;o.push(t),h-=s,t=0===t?l-1:t-1}return{indexes:o,physicalTop:h-this._scrollOffset}},_update(e,t){if(!(e&&0===e.length||0===this._physicalCount)){if(this._assignModels(e),this._updateMetrics(e),t)for(;t.length;){const e=t.pop();this._physicalTop-=this._getPhysicalSizeIncrement(e)}this._positionItems(),this._updateScrollerSize()}},_isClientFull(){return 0!==this._scrollBottom&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded(e){const t=this._clamp(this._physicalCount+e,3,this._virtualCount-this._virtualStart)-this._physicalCount;let i=Math.round(.5*this._physicalCount);if(!(t<0)){if(t>0){const e=window.performance.now();[].push.apply(this._physicalItems,this._createPool(t));for(let e=0;e<t;e++)this._physicalSizes.push(0);this._physicalCount+=t,this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)<this._physicalEnd&&(this._physicalStart+=t),this._update(),this._templateCost=(window.performance.now()-e)/t,i=Math.round(.5*this._physicalCount)}this._virtualEnd>=this._virtualCount-1||0===i||(this._isClientFull()?this._physicalSize<this._optPhysicalSize&&this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,this._clamp(Math.round(50/this._templateCost),1,i)),Ie):this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,i),we))}},_render(){if(this.isAttached&&this._isVisible)if(0!==this._physicalCount){const e=this._getReusables(!0);this._physicalTop=e.physicalTop,this._virtualStart+=e.indexes.length,this._physicalStart+=e.indexes.length,this._update(e.indexes),this._update(),this._increasePoolIfNeeded(0)}else this._virtualCount>0&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(3))},_itemsChanged(e){"items"===e.path&&(this._virtualStart=0,this._physicalTop=0,this._virtualCount=this.items?this.items.length:0,this._physicalIndexForKey={},this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._physicalItems||(this._physicalItems=[]),this._physicalSizes||(this._physicalSizes=[]),this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._debounce("_render",this._render,Ce))},_iterateItems(e,t){let i,s,o,r;if(2===arguments.length&&t){for(r=0;r<t.length;r++)if(i=t[r],s=this._computeVidx(i),null!=(o=e.call(this,i,s)))return o}else{for(i=this._physicalStart,s=this._virtualStart;i<this._physicalCount;i++,s++)if(null!=(o=e.call(this,i,s)))return o;for(i=0;i<this._physicalStart;i++,s++)if(null!=(o=e.call(this,i,s)))return o}},_computeVidx(e){return e>=this._physicalStart?this._virtualStart+(e-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+e},_positionItems(){this._adjustScrollPosition();let e=this._physicalTop;this._iterateItems((t=>{this.translate3d(0,`${e}px`,0,this._physicalItems[t]),e+=this._physicalSizes[t]}))},_getPhysicalSizeIncrement(e){return this._physicalSizes[e]},_adjustScrollPosition(){const e=0===this._virtualStart?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(0!==e){this._physicalTop-=e;const t=this._scrollPosition;!ke&&t>0&&this._resetScrollPosition(t-e)}},_resetScrollPosition(e){this.scrollTarget&&e>=0&&(this._scrollTop=e,this._scrollPosition=this._scrollTop)},_updateScrollerSize(e){const t=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage;this._estScrollHeight=t,(e||0===this._scrollHeight||this._scrollPosition>=t-this._physicalSize||Math.abs(t-this._scrollHeight)>=this._viewportHeight)&&(this.$.items.style.height=`${t}px`,this._scrollHeight=t)},scrollToIndex(e){if("number"!=typeof e||e<0||e>this.items.length-1)return;if(Te(),0===this._physicalCount)return;e=this._clamp(e,0,this._virtualCount-1),(!this._isIndexRendered(e)||e>=this._maxVirtualStart)&&(this._virtualStart=e-1),this._assignModels(),this._updateMetrics(),this._physicalTop=this._virtualStart*this._physicalAverage;let t=this._physicalStart,i=this._virtualStart,s=0;const o=this._hiddenContentSize;for(;i<e&&s<=o;)s+=this._getPhysicalSizeIncrement(t),t=(t+1)%this._physicalCount,i+=1;this._updateSc