@cas-smartdesign/virtual-list 6.2.2 → 6.2.4

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/docs/doc.mjs CHANGED
@@ -391,13 +391,13 @@ list.addEventListener("selection", (event: CustomEvent) => {
391
391
  <div class="${n}" title="${Ze(t)}">
392
392
  ${this.contentMode==="html"?_r(e):e}
393
393
  </div>
394
- `:O}updated(n){super.updated(n),(n.has("icon")||n.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Er.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),n.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){const n=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let e=0;const t=this.shadowRoot.querySelector(".caption");t&&(e+=t.scrollWidth-t.clientWidth);const i=this.shadowRoot.querySelector(".description");return i&&(e=Math.max(e,i.scrollWidth-i.clientWidth)),e>0&&e++,n&&this.setAttribute("enable-line-clamp",""),e}handleIconClick(n){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",n))&&n.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},ae.ID="sd-list-item",ae.ensureDefined=()=>{customElements.get(ae.ID)||customElements.define(ae.ID,ae)},ae);L([R({type:String})],P.prototype,"caption",2);L([R({type:String})],P.prototype,"description",2);L([R({type:Boolean})],P.prototype,"selected",2);L([R({type:String})],P.prototype,"icon",2);L([R({type:String})],P.prototype,"iconBackgroundColor",2);L([R({type:String})],P.prototype,"iconPlaceholder",2);L([R({type:Number})],P.prototype,"level",2);L([R()],P.prototype,"contentMode",2);L([R({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],P.prototype,"enableLineClamp",2);L([R({type:Boolean,reflect:!0,attribute:"aria-disabled"})],P.prototype,"disabled",2);L([R({type:String,attribute:"icon-attr-aria-label"})],P.prototype,"iconAttrAriaLabel",2);L([R({type:String,reflect:!0})],P.prototype,"role",2);L([R({type:String,attribute:"caption-attr-title"})],P.prototype,"captionAttrTitle",2);L([R({type:String,attribute:"description-attr-title"})],P.prototype,"descriptionAttrTitle",2);L([R({type:String,attribute:"icon-attr-title"})],P.prototype,"iconAttrTitle",2);let ye=P;const Cr=(n,e)=>{const t=document.createElement(ye.ID);if(n){if(t.caption=n.caption,t.description=n.description,t.icon=n.icon,t.iconBackgroundColor=n.iconBackgroundColor,t.iconPlaceholder=n.iconPlaceholder,t.level=n.level,t.disabled=n.disabled,n.contentMode&&(t.contentMode=n.contentMode),n.leftContentGenerator){const i=n.leftContentGenerator(n,t);i&&(i.slot="left-content",t.appendChild(i))}if(n.rightContentGenerator){const i=n.rightContentGenerator(n,t);i&&(i.slot="right-content",t.appendChild(i))}}return t};ye.ensureDefined();const Ir=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}";var kr=Object.defineProperty,Or=Object.getOwnPropertyDescriptor,ie=(n,e,t,i)=>{for(var s=i>1?void 0:i?Or(e,t):e,o=n.length-1,r;o>=0;o--)(r=n[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&kr(e,t,s),s};let Rr=0;var V;const Q=(V=class extends ve{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=V.ID+"_"+Rr++,this.role="listbox",this.itemGenerator=Cr,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;const e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":this.focusIndex=this.normalizeIndex(this.focusIndex+1);break;case"Up":case"ArrowUp":this.focusIndex=this.normalizeIndex(this.focusIndex-1);break;case"Enter":this.handleSelection(this.focusIndex,e.metaKey||e.ctrlKey);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(e.preventDefault(),e.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(e){this.toggleAttribute("focus-target",e)}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this.itemCount){const t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToItem(e),t!=e&&(e==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(e){e?this._selectedIndices=e.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(e,t="auto"){this.scrollTop=yr.getOffsetForIndexAndAlignment(this.normalizeIndex(e),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(e){return!this.shadowRoot||e<this._firstVisibleIndex||this._lastVisibleIndex<e?null:this.querySelector(`[item-index="${e}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){const e=this.getListItem(this.focusIndex);e&&(this.focusTarget||document.activeElement==this?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):(e.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[wn`
394
+ `:O}updated(n){super.updated(n),(n.has("icon")||n.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Er.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),n.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){const n=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let e=0;const t=this.shadowRoot.querySelector(".caption");t&&(e+=t.scrollWidth-t.clientWidth);const i=this.shadowRoot.querySelector(".description");return i&&(e=Math.max(e,i.scrollWidth-i.clientWidth)),e>0&&e++,n&&this.setAttribute("enable-line-clamp",""),e}handleIconClick(n){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",n))&&n.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},ae.ID="sd-list-item",ae.ensureDefined=()=>{customElements.get(ae.ID)||customElements.define(ae.ID,ae)},ae);L([R({type:String})],P.prototype,"caption",2);L([R({type:String})],P.prototype,"description",2);L([R({type:Boolean})],P.prototype,"selected",2);L([R({type:String})],P.prototype,"icon",2);L([R({type:String})],P.prototype,"iconBackgroundColor",2);L([R({type:String})],P.prototype,"iconPlaceholder",2);L([R({type:Number})],P.prototype,"level",2);L([R()],P.prototype,"contentMode",2);L([R({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],P.prototype,"enableLineClamp",2);L([R({converter:{fromAttribute:n=>n=="true",toAttribute:n=>n},reflect:!0,attribute:"aria-disabled"})],P.prototype,"disabled",2);L([R({type:String,attribute:"icon-attr-aria-label"})],P.prototype,"iconAttrAriaLabel",2);L([R({type:String,reflect:!0})],P.prototype,"role",2);L([R({type:String,attribute:"caption-attr-title"})],P.prototype,"captionAttrTitle",2);L([R({type:String,attribute:"description-attr-title"})],P.prototype,"descriptionAttrTitle",2);L([R({type:String,attribute:"icon-attr-title"})],P.prototype,"iconAttrTitle",2);let ye=P;const Cr=(n,e)=>{const t=document.createElement(ye.ID);if(n){if(t.caption=n.caption,t.description=n.description,t.icon=n.icon,t.iconBackgroundColor=n.iconBackgroundColor,t.iconPlaceholder=n.iconPlaceholder,t.level=n.level,t.disabled=n.disabled,n.contentMode&&(t.contentMode=n.contentMode),n.leftContentGenerator){const i=n.leftContentGenerator(n,t);i&&(i.slot="left-content",t.appendChild(i))}if(n.rightContentGenerator){const i=n.rightContentGenerator(n,t);i&&(i.slot="right-content",t.appendChild(i))}}return t};ye.ensureDefined();const Ir=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}";var kr=Object.defineProperty,Or=Object.getOwnPropertyDescriptor,ie=(n,e,t,i)=>{for(var s=i>1?void 0:i?Or(e,t):e,o=n.length-1,r;o>=0;o--)(r=n[o])&&(s=(i?r(e,t,s):r(s))||s);return i&&s&&kr(e,t,s),s};let Rr=0;var V;const Q=(V=class extends ve{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=V.ID+"_"+Rr++,this.role="listbox",this.itemGenerator=Cr,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;const e=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(e)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=e=>{let t=!0;switch(e.key){case"Down":case"ArrowDown":this.focusIndex=this.normalizeIndex(this.focusIndex+1);break;case"Up":case"ArrowUp":this.focusIndex=this.normalizeIndex(this.focusIndex-1);break;case"Enter":this.handleSelection(this.focusIndex,e.metaKey||e.ctrlKey);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(e.preventDefault(),e.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(e){this.toggleAttribute("focus-target",e)}get focusIndex(){return this._focusIndex}set focusIndex(e){if(e>=-1&&e<this.itemCount){const t=this._focusIndex;this._focusIndex=e,(e<=this._firstVisibleIndex||this._lastVisibleIndex<=e)&&this.scrollToItem(e),t!=e&&(e==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(e){e?this._selectedIndices=e.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(e,t="auto"){this.scrollTop=yr.getOffsetForIndexAndAlignment(this.normalizeIndex(e),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(e){return!this.shadowRoot||e<this._firstVisibleIndex||this._lastVisibleIndex<e?null:this.querySelector(`[item-index="${e}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(e){super.firstUpdated(e),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){const e=this.getListItem(this.focusIndex);e&&(this.focusTarget||document.activeElement==this?(e.setAttribute("focused",""),this.setAttribute("aria-activedescendant",e.id)):(e.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[wn`
395
395
  ${pi(Ir)}
396
396
  `]}render(){return this.updateItemsRenderData(),Re`
397
397
  <div class="container" style="height: ${this.itemCount*this.itemHeight}px">
398
398
  <slot name="items"></slot>
399
399
  </div>
400
- `}updated(e){if(super.updated(e),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{const t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{const e=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(e==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;const t=[...this.querySelectorAll("[item-index]")].map(s=>{if(s instanceof ye){s.enableLineClamp=!1;const o=s.missingWidthForTexts;return o>e&&(s.enableLineClamp=!0),o}}),i=Math.max(...t);i>0&&(this.style.width=`${this.offsetWidth+i}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(e=>{e instanceof ye&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){const e=[...this.querySelectorAll("[item-index]")],t=new Map,i=document.createDocumentFragment();for(const s of this._itemsRenderData){const o=this.renderItem(s);o.parentElement||i.appendChild(o),t.set(s.dataHash,o);const r=e.indexOf(o);r!==-1&&e.splice(r,1)}this.appendChild(i);for(const s of e)s instanceof ye&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,o)=>{this._elementCache.set(o,s)})}renderItem({index:e,top:t,dataHash:i,data:s}){let o;return s?this._elementCache.has(i)?(o=this._elementCache.get(i),this._elementCache.delete(i)):(o=this.itemGenerator(s,e),o.setAttribute("slot","items")):(o=document.createElement("div"),o.setAttribute("placeholder-item",""),o.setAttribute("slot","items")),Object.assign(o.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),o.setAttribute("item-index",e.toString()),o.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),o.setAttribute("aria-posinset",String(e+1)),(!o.id||o.id.startsWith(this.id+"_item_"))&&(o.id=this.id+"_item_"+e),this.itemCount-1==e?o.setAttribute("last",""):o.removeAttribute("last"),this.updateSelectedAttribute(e,o),this.updateFocusedAttribute(e,o),o}updateFocusedAttribute(e,t){this.focusIndex==e&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(e,t){const i=this.selectedIndices.indexOf(e)!==-1;i?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(i))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);const e=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(e,t);for(let i=e;i<=t;i++){const s=i-e,o=this.items[s];let r;o?r=JSON.stringify(o):r=`placeholder-${s}`,this._itemsRenderData.push({index:i,top:this.itemHeight*i,physicalIndex:s,dataHash:r,data:o})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(e){return Math.max(0,Math.min(e,this.itemCount-1))}get height(){return this.offsetHeight}requestData(e,t){!Number.isNaN(e)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:e,stopIndex:t}}))}handleSelection(e,t){if(e<0||this.itemCount<=e)return;const i=e%this._visibleItemsNum,s=this.items[i];if(!s||s.disabled)return;let o=!0;if(this.selectionType!=="trigger-only"){const r=this.selectedIndices.indexOf(e);o=r==-1,o?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(r,1),this.requestUpdate("selectedIndices")}this.focusIndex=e,this.dispatchSelectionEvent(e,o,t)}dispatchSelectionEvent(e,t,i){this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:t,hasModifier:i}}))}handleClick(e){const t=e.composedPath().find(i=>i.hasAttribute&&i.hasAttribute("item-index"));if(t){const i=parseInt(t.getAttribute("item-index"));if(Number.isInteger(i)){if(e.button==0||e.button==1){const s=e.type=="auxclick"&&e.button==1||e.metaKey||e.ctrlKey;this.handleSelection(i,s)}this.focusIndex=i}}}},V.ID="sd-virtual-list",V.ensureDefined=()=>{ye.ensureDefined(),customElements.get(V.ID)||customElements.define(V.ID,V)},V);ie([R({type:Number,attribute:"item-height",reflect:!0})],Q.prototype,"itemHeight",2);ie([R({type:Number})],Q.prototype,"itemCount",2);ie([R({type:Array,attribute:!1})],Q.prototype,"items",2);ie([R({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],Q.prototype,"selectionType",2);ie([R({type:String,attribute:!0,reflect:!0})],Q.prototype,"id",2);ie([R({type:String,reflect:!0})],Q.prototype,"role",2);ie([R({type:Number,attribute:"focus-index",reflect:!0})],Q.prototype,"focusIndex",1);ie([R({type:Array,attribute:!1})],Q.prototype,"selectedIndices",1);let Nr=Q;Nr.ensureDefined();function $n(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Tr(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return n[i]}})}),t}var mi={exports:{}},$=String,Cn=function(){return{isColorSupported:!1,reset:$,bold:$,dim:$,italic:$,underline:$,inverse:$,hidden:$,strikethrough:$,black:$,red:$,green:$,yellow:$,blue:$,magenta:$,cyan:$,white:$,gray:$,bgBlack:$,bgRed:$,bgGreen:$,bgYellow:$,bgBlue:$,bgMagenta:$,bgCyan:$,bgWhite:$}};mi.exports=Cn();mi.exports.createColors=Cn;var Mr=mi.exports;const Pr={},Lr=Object.freeze(Object.defineProperty({__proto__:null,default:Pr},Symbol.toStringTag,{value:"Module"})),B=Tr(Lr);let Gi=Mr,Ki=B,Kt=class In extends Error{constructor(e,t,i,s,o,r){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),r&&(this.plugin=r),typeof t<"u"&&typeof i<"u"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,In)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Gi.isColorSupported),Ki&&e&&(t=Ki(t));let i=t.split(/\r?\n/),s=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),r=String(o).length,l,a;if(e){let{bold:c,gray:u,red:f}=Gi.createColors(!0);l=p=>c(f(p)),a=p=>u(p)}else l=a=c=>c;return i.slice(s,o).map((c,u)=>{let f=s+1+u,p=" "+(" "+f).slice(-r)+" | ";if(f===this.line){let x=a(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+c+`
400
+ `}updated(e){if(super.updated(e),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{const t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{const e=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(e==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;const t=[...this.querySelectorAll("[item-index]")].map(s=>{if(s instanceof ye){s.enableLineClamp=!1;const o=s.missingWidthForTexts;return o>e&&(s.enableLineClamp=!0),o}}),i=Math.max(...t);i>0&&(this.style.width=`${this.offsetWidth+i}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(e=>{e instanceof ye&&(e.enableLineClamp=e.enableLineClamp||e.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){const e=[...this.querySelectorAll("[item-index]")],t=new Map,i=document.createDocumentFragment();for(const s of this._itemsRenderData){const o=this.renderItem(s);o.parentElement||i.appendChild(o),t.set(s.dataHash,o);const r=e.indexOf(o);r!==-1&&e.splice(r,1)}this.appendChild(i);for(const s of e)s instanceof ye&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,o)=>{this._elementCache.set(o,s)})}renderItem({index:e,top:t,dataHash:i,data:s}){let o;return s?this._elementCache.has(i)?(o=this._elementCache.get(i),this._elementCache.delete(i)):(o=this.itemGenerator(s,e),o.setAttribute("slot","items")):(o=document.createElement("div"),o.setAttribute("placeholder-item",""),o.setAttribute("slot","items")),Object.assign(o.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),o.setAttribute("item-index",e.toString()),o.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),o.setAttribute("aria-posinset",String(e+1)),(!o.id||o.id.startsWith(this.id+"_item_"))&&(o.id=this.id+"_item_"+e),this.itemCount-1==e?o.setAttribute("last",""):o.removeAttribute("last"),this.updateSelectedAttribute(e,o),this.updateFocusedAttribute(e,o),o}updateFocusedAttribute(e,t){this.focusIndex==e&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(e,t){const i=this.selectedIndices.indexOf(e)!==-1;i?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(i))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);const e=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(e,t);for(let i=e;i<=t;i++){const s=i-e,o=this.items[s];let r;o?r=JSON.stringify(o):r=`placeholder-${s}`,this._itemsRenderData.push({index:i,top:this.itemHeight*i,physicalIndex:s,dataHash:r,data:o})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(e){return Math.max(0,Math.min(e,this.itemCount-1))}get height(){return this.offsetHeight}requestData(e,t){!Number.isNaN(e)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:e,stopIndex:t}}))}handleSelection(e,t){if(e<0||this.itemCount<=e)return;const i=this.getListItem(e);if(i.getAttribute("aria-disabled")=="true"||i.hasAttribute("disabled"))return;let s=!0;if(this.selectionType!=="trigger-only"){const o=this.selectedIndices.indexOf(e);s=o==-1,s?this.selectionType==="single"?this.selectedIndices=[e]:this.selectedIndices.push(e):this.selectedIndices.splice(o,1),this.requestUpdate("selectedIndices")}this.focusIndex=e,this.dispatchSelectionEvent(e,s,t)}dispatchSelectionEvent(e,t,i){this.dispatchEvent(new CustomEvent("selection",{detail:{index:e,selected:t,hasModifier:i}}))}handleClick(e){const t=e.composedPath().find(i=>i.hasAttribute&&i.hasAttribute("item-index"));if(t){const i=parseInt(t.getAttribute("item-index"));if(Number.isInteger(i)){if(e.button==0||e.button==1){const s=e.type=="auxclick"&&e.button==1||e.metaKey||e.ctrlKey;this.handleSelection(i,s)}this.focusIndex=i}}}},V.ID="sd-virtual-list",V.ensureDefined=()=>{ye.ensureDefined(),customElements.get(V.ID)||customElements.define(V.ID,V)},V);ie([R({type:Number,attribute:"item-height",reflect:!0})],Q.prototype,"itemHeight",2);ie([R({type:Number})],Q.prototype,"itemCount",2);ie([R({type:Array,attribute:!1})],Q.prototype,"items",2);ie([R({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],Q.prototype,"selectionType",2);ie([R({type:String,attribute:!0,reflect:!0})],Q.prototype,"id",2);ie([R({type:String,reflect:!0})],Q.prototype,"role",2);ie([R({type:Number,attribute:"focus-index",reflect:!0})],Q.prototype,"focusIndex",1);ie([R({type:Array,attribute:!1})],Q.prototype,"selectedIndices",1);let Nr=Q;Nr.ensureDefined();function $n(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Tr(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(i){var s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return n[i]}})}),t}var mi={exports:{}},$=String,Cn=function(){return{isColorSupported:!1,reset:$,bold:$,dim:$,italic:$,underline:$,inverse:$,hidden:$,strikethrough:$,black:$,red:$,green:$,yellow:$,blue:$,magenta:$,cyan:$,white:$,gray:$,bgBlack:$,bgRed:$,bgGreen:$,bgYellow:$,bgBlue:$,bgMagenta:$,bgCyan:$,bgWhite:$}};mi.exports=Cn();mi.exports.createColors=Cn;var Mr=mi.exports;const Pr={},Lr=Object.freeze(Object.defineProperty({__proto__:null,default:Pr},Symbol.toStringTag,{value:"Module"})),B=Tr(Lr);let Gi=Mr,Ki=B,Kt=class In extends Error{constructor(e,t,i,s,o,r){super(e),this.name="CssSyntaxError",this.reason=e,o&&(this.file=o),s&&(this.source=s),r&&(this.plugin=r),typeof t<"u"&&typeof i<"u"&&(typeof t=="number"?(this.line=t,this.column=i):(this.line=t.line,this.column=t.column,this.endLine=i.line,this.endColumn=i.column)),this.setMessage(),Error.captureStackTrace&&Error.captureStackTrace(this,In)}setMessage(){this.message=this.plugin?this.plugin+": ":"",this.message+=this.file?this.file:"<css input>",typeof this.line<"u"&&(this.message+=":"+this.line+":"+this.column),this.message+=": "+this.reason}showSourceCode(e){if(!this.source)return"";let t=this.source;e==null&&(e=Gi.isColorSupported),Ki&&e&&(t=Ki(t));let i=t.split(/\r?\n/),s=Math.max(this.line-3,0),o=Math.min(this.line+2,i.length),r=String(o).length,l,a;if(e){let{bold:c,gray:u,red:f}=Gi.createColors(!0);l=p=>c(f(p)),a=p=>u(p)}else l=a=c=>c;return i.slice(s,o).map((c,u)=>{let f=s+1+u,p=" "+(" "+f).slice(-r)+" | ";if(f===this.line){let x=a(p.replace(/\d/g," "))+c.slice(0,this.column-1).replace(/[^\t]/g," ");return l(">")+a(p)+c+`
401
401
  `+x+l("^")}return" "+a(p)+c}).join(`
402
402
  `)}toString(){let e=this.showSourceCode();return e&&(e=`
403
403
 
@@ -543,8 +543,7 @@ Although normally the page would change by such a selection, so it may not be ne
543
543
  </ul>
544
544
  </li>
545
545
  </ul>
546
- <h2 id="examples">Examples</h2>
547
- `;document.querySelector("#markdown-container").innerHTML=ja;Ma(Object.assign({"./examples/1_selection_types/index.ts":Fs,"./examples/2_lazy_load_with_search/index.ts":Zs,"./examples/3_duplicate_items/index.ts":tr}));
546
+ `,Da=document.querySelector("#markdown-container");Da.innerHTML=ja;Ma(Object.assign({"./examples/1_selection_types/index.ts":Fs,"./examples/2_lazy_load_with_search/index.ts":Zs,"./examples/3_duplicate_items/index.ts":tr}),document.querySelector(".markdown-body"));
548
547
  function __vite__mapDeps(indexes) {
549
548
  if (!__vite__mapDeps.viteFileDeps) {
550
549
  __vite__mapDeps.viteFileDeps = ["./1_selection_types.js","./item-provider.mjs","./2_lazy_load_with_search.js","./3_duplicate_items.js"]
@@ -1,6 +1,6 @@
1
- var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var Q=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var Vt=Object.prototype.hasOwnProperty;var jt=(i,t)=>{for(var e in t)Q(i,e,{get:t[e],enumerable:!0})},Bt=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Wt(t))!Vt.call(i,n)&&n!==e&&Q(i,n,{get:()=>t[n],enumerable:!(s=Kt(t,n))||s.enumerable});return i};var Ft=i=>Bt(Q({},"__esModule",{value:!0}),i);var he={};jt(he,{ListDataProvider:()=>vt,SelectionType:()=>Ut,default:()=>zt});var j=window,B=j.ShadowRoot&&(j.ShadyCSS===void 0||j.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),_t=new WeakMap,P=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==X)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(B&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_t.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_t.set(e,t))}return t}toString(){return this.cssText}},k=i=>new P(typeof i=="string"?i:i+"",void 0,X),M=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((s,n,o)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new P(e,i,X)},tt=(i,t)=>{B?i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let s=document.createElement("style"),n=j.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)})},F=B?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return k(e)})(i):i;var et,G=window,gt=G.trustedTypes,Gt=gt?gt.emptyScript:"",bt=G.reactiveElementPolyfillSupport,st={toAttribute(i,t){switch(t){case Boolean:i=i?Gt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},yt=(i,t)=>t!==i&&(t==t||i==i),it={attribute:!0,type:String,converter:st,reflect:!1,hasChanged:yt},nt="finalized",b=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,s)=>{let n=this._$Ep(s,e);n!==void 0&&(this._$Ev.set(n,s),t.push(n))}),t}static createProperty(t,e=it){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){let o=this[t];this[e]=n,this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||it}static finalize(){if(this.hasOwnProperty(nt))return!1;this[nt]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let n of s)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(F(n))}else t!==void 0&&e.push(F(t));return e}static _$Ep(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return tt(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostConnected)===null||s===void 0?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=it){var n;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===!0){let r=(((n=s.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?s.converter:st).toAttribute(e,s.type);this._$El=t,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$El=null}}_$AK(t,e){var s;let n=this.constructor,o=n._$Ev.get(t);if(o!==void 0&&this._$El!==o){let r=n.getPropertyOptions(o),h=typeof r.converter=="function"?{fromAttribute:r.converter}:((s=r.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?r.converter:st;this._$El=o,this[o]=h.fromAttribute(e,r.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||yt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,o)=>this[o]=n),this._$Ei=void 0);let e=!1,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(n=>{var o;return(o=n.hostUpdate)===null||o===void 0?void 0:o.call(n)}),this.update(s)):this._$Ek()}catch(n){throw e=!1,this._$Ek(),n}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var n;return(n=s.hostUpdated)===null||n===void 0?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};b[nt]=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},bt?.({ReactiveElement:b}),((et=G.reactiveElementVersions)!==null&&et!==void 0?et:G.reactiveElementVersions=[]).push("1.6.3");var ot,J=window,N=J.trustedTypes,$t=N?N.createPolicy("lit-html",{createHTML:i=>i}):void 0,lt="$lit$",x=`lit$${(Math.random()+"").slice(9)}$`,Et="?"+x,Jt=`<${Et}>`,C=document,O=()=>C.createComment(""),U=i=>i===null||typeof i!="object"&&typeof i!="function",Tt=Array.isArray,Yt=i=>Tt(i)||typeof i?.[Symbol.iterator]=="function",rt=`[
2
- \f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xt=/-->/g,At=/>/g,S=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),It=/'/g,St=/"/g,Lt=/^(?:script|style|textarea|title)$/i,kt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),E=kt(1),fe=kt(2),y=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),wt=new WeakMap,w=C.createTreeWalker(C,129,null,!1);function Nt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return $t!==void 0?$t.createHTML(t):t}var Zt=(i,t)=>{let e=i.length-1,s=[],n,o=t===2?"<svg>":"",r=H;for(let h=0;h<e;h++){let l=i[h],a,c,p=-1,m=0;for(;m<l.length&&(r.lastIndex=m,c=r.exec(l),c!==null);)m=r.lastIndex,r===H?c[1]==="!--"?r=xt:c[1]!==void 0?r=At:c[2]!==void 0?(Lt.test(c[2])&&(n=RegExp("</"+c[2],"g")),r=S):c[3]!==void 0&&(r=S):r===S?c[0]===">"?(r=n??H,p=-1):c[1]===void 0?p=-2:(p=r.lastIndex-c[2].length,a=c[1],r=c[3]===void 0?S:c[3]==='"'?St:It):r===St||r===It?r=S:r===xt||r===At?r=H:(r=S,n=void 0);let _=r===S&&i[h+1].startsWith("/>")?" ":"";o+=r===H?l+Jt:p>=0?(s.push(a),l.slice(0,p)+lt+l.slice(p)+x+_):l+x+(p===-2?(s.push(void 0),h):_)}return[Nt(i,o+(i[e]||"<?>")+(t===2?"</svg>":"")),s]},z=class i{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let o=0,r=0,h=t.length-1,l=this.parts,[a,c]=Zt(t,e);if(this.el=i.createElement(a,s),w.currentNode=this.el.content,e===2){let p=this.el.content,m=p.firstChild;m.remove(),p.append(...m.childNodes)}for(;(n=w.nextNode())!==null&&l.length<h;){if(n.nodeType===1){if(n.hasAttributes()){let p=[];for(let m of n.getAttributeNames())if(m.endsWith(lt)||m.startsWith(x)){let _=c[r++];if(p.push(m),_!==void 0){let qt=n.getAttribute(_.toLowerCase()+lt).split(x),V=/([.?@])?(.*)/.exec(_);l.push({type:1,index:o,name:V[2],strings:qt,ctor:V[1]==="."?ht:V[1]==="?"?dt:V[1]==="@"?ct:D})}else l.push({type:6,index:o})}for(let m of p)n.removeAttribute(m)}if(Lt.test(n.tagName)){let p=n.textContent.split(x),m=p.length-1;if(m>0){n.textContent=N?N.emptyScript:"";for(let _=0;_<m;_++)n.append(p[_],O()),w.nextNode(),l.push({type:2,index:++o});n.append(p[m],O())}}}else if(n.nodeType===8)if(n.data===Et)l.push({type:2,index:o});else{let p=-1;for(;(p=n.data.indexOf(x,p+1))!==-1;)l.push({type:7,index:o}),p+=x.length-1}o++}}static createElement(t,e){let s=C.createElement("template");return s.innerHTML=t,s}};function R(i,t,e=i,s){var n,o,r,h;if(t===y)return t;let l=s!==void 0?(n=e._$Co)===null||n===void 0?void 0:n[s]:e._$Cl,a=U(t)?void 0:t._$litDirective$;return l?.constructor!==a&&((o=l?._$AO)===null||o===void 0||o.call(l,!1),a===void 0?l=void 0:(l=new a(i),l._$AT(i,e,s)),s!==void 0?((r=(h=e)._$Co)!==null&&r!==void 0?r:h._$Co=[])[s]=l:e._$Cl=l),l!==void 0&&(t=R(i,l._$AS(i,t.values),l,s)),t}var at=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;let{el:{content:s},parts:n}=this._$AD,o=((e=t?.creationScope)!==null&&e!==void 0?e:C).importNode(s,!0);w.currentNode=o;let r=w.nextNode(),h=0,l=0,a=n[0];for(;a!==void 0;){if(h===a.index){let c;a.type===2?c=new q(r,r.nextSibling,this,t):a.type===1?c=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(c=new ut(r,this,t)),this._$AV.push(c),a=n[++l]}h!==a?.index&&(r=w.nextNode(),h++)}return w.currentNode=C,o}v(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},q=class i{constructor(t,e,s,n){var o;this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cp=(o=n?.isConnected)===null||o===void 0||o}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),U(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==y&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Yt(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==d&&U(this._$AH)?this._$AA.nextSibling.data=t:this.$(C.createTextNode(t)),this._$AH=t}g(t){var e;let{values:s,_$litType$:n}=t,o=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=z.createElement(Nt(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.v(s);else{let r=new at(o,this),h=r.u(this.options);r.v(s),this.$(h),this._$AH=r}}_$AC(t){let e=wt.get(t.strings);return e===void 0&&wt.set(t.strings,e=new z(t)),e}T(t){Tt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let o of t)n===e.length?e.push(s=new i(this.k(O()),this.k(O()),this,this.options)):s=e[n],s._$AI(o),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}},D=class{constructor(t,e,s,n,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){let o=this.strings,r=!1;if(o===void 0)t=R(this,t,e,0),r=!U(t)||t!==this._$AH&&t!==y,r&&(this._$AH=t);else{let h=t,l,a;for(t=o[0],l=0;l<o.length-1;l++)a=R(this,h[s+l],e,l),a===y&&(a=this._$AH[l]),r||(r=!U(a)||a!==this._$AH[l]),a===d?t=d:t!==d&&(t+=(a??"")+o[l+1]),this._$AH[l]=a}r&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ht=class extends D{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},Qt=N?N.emptyScript:"",dt=class extends D{constructor(){super(...arguments),this.type=4}j(t){t&&t!==d?this.element.setAttribute(this.name,Qt):this.element.removeAttribute(this.name)}},ct=class extends D{constructor(t,e,s,n,o){super(t,e,s,n,o),this.type=5}_$AI(t,e=this){var s;if((t=(s=R(this,t,e,0))!==null&&s!==void 0?s:d)===y)return;let n=this._$AH,o=t===d&&n!==d||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==d&&(n===d||o);o&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}},ut=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}};var Ct=J.litHtmlPolyfillSupport;Ct?.(z,q),((ot=J.litHtmlVersions)!==null&&ot!==void 0?ot:J.litHtmlVersions=[]).push("2.8.0");var Rt=(i,t,e)=>{var s,n;let o=(s=e?.renderBefore)!==null&&s!==void 0?s:t,r=o._$litPart$;if(r===void 0){let h=(n=e?.renderBefore)!==null&&n!==void 0?n:null;o._$litPart$=r=new q(t.insertBefore(O(),h),h,void 0,e??{})}return r._$AI(i),r};var pt,mt;var g=class extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;let s=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=s.firstChild),s}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return y}};g.finalized=!0,g._$litElement$=!0,(pt=globalThis.litElementHydrateSupport)===null||pt===void 0||pt.call(globalThis,{LitElement:g});var Dt=globalThis.litElementPolyfillSupport;Dt?.({LitElement:g});((mt=globalThis.litElementVersions)!==null&&mt!==void 0?mt:globalThis.litElementVersions=[]).push("3.3.3");var Xt=(i,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,i)}},te=(i,t,e)=>{t.constructor.createProperty(e,i)};function u(i){return(t,e)=>e!==void 0?te(i,t,e):Xt(i,t)}var Pt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mt=i=>(...t)=>({_$litDirective$:i,values:t}),Y=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=class extends Y{constructor(t){if(super(t),this.et=d,t.type!==Pt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this.ft=void 0,this.et=t;if(t===y)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;let e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}};K.directiveName="unsafeHTML",K.resultType=1;var Ht=Mt(K);var W=i=>i??d;var Z=class{static showImage(t,e,s,n){let o;if(n||!(t instanceof HTMLImageElement)?o=r=>t.style.backgroundImage=this.prepareSrc(r):o=r=>t.src=r,o(s),e){let r=()=>{o(e)},h=new Image;h.addEventListener("load",r),h.src=e,h.complete&&(h.removeEventListener("load",r),r())}}static prepareSrc(t){return t?t.startsWith("url")?t:`url("${t}")`:null}};var ee=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',ie=Object.defineProperty,se=Object.getOwnPropertyDescriptor,v=(i,t,e,s)=>{for(var n=s>1?void 0:s?se(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&ie(t,e,n),n},T,f=(T=class extends g{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[M`
1
+ var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var Q=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Wt=Object.getOwnPropertyNames;var Vt=Object.prototype.hasOwnProperty;var jt=(i,t)=>{for(var e in t)Q(i,e,{get:t[e],enumerable:!0})},Bt=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Wt(t))!Vt.call(i,n)&&n!==e&&Q(i,n,{get:()=>t[n],enumerable:!(s=Kt(t,n))||s.enumerable});return i};var Ft=i=>Bt(Q({},"__esModule",{value:!0}),i);var he={};jt(he,{ListDataProvider:()=>vt,SelectionType:()=>Ut,default:()=>zt});var j=window,B=j.ShadowRoot&&(j.ShadyCSS===void 0||j.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,X=Symbol(),_t=new WeakMap,P=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==X)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o,e=this.t;if(B&&t===void 0){let s=e!==void 0&&e.length===1;s&&(t=_t.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&_t.set(e,t))}return t}toString(){return this.cssText}},k=i=>new P(typeof i=="string"?i:i+"",void 0,X),M=(i,...t)=>{let e=i.length===1?i[0]:t.reduce((s,n,o)=>s+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+i[o+1],i[0]);return new P(e,i,X)},tt=(i,t)=>{B?i.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let s=document.createElement("style"),n=j.litNonce;n!==void 0&&s.setAttribute("nonce",n),s.textContent=e.cssText,i.appendChild(s)})},F=B?i=>i:i=>i instanceof CSSStyleSheet?(t=>{let e="";for(let s of t.cssRules)e+=s.cssText;return k(e)})(i):i;var et,G=window,gt=G.trustedTypes,Gt=gt?gt.emptyScript:"",bt=G.reactiveElementPolyfillSupport,st={toAttribute(i,t){switch(t){case Boolean:i=i?Gt:null;break;case Object:case Array:i=i==null?i:JSON.stringify(i)}return i},fromAttribute(i,t){let e=i;switch(t){case Boolean:e=i!==null;break;case Number:e=i===null?null:Number(i);break;case Object:case Array:try{e=JSON.parse(i)}catch{e=null}}return e}},yt=(i,t)=>t!==i&&(t==t||i==i),it={attribute:!0,type:String,converter:st,reflect:!1,hasChanged:yt},nt="finalized",b=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(t){var e;this.finalize(),((e=this.h)!==null&&e!==void 0?e:this.h=[]).push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,s)=>{let n=this._$Ep(s,e);n!==void 0&&(this._$Ev.set(n,s),t.push(n))}),t}static createProperty(t,e=it){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let s=typeof t=="symbol"?Symbol():"__"+t,n=this.getPropertyDescriptor(t,s,e);n!==void 0&&Object.defineProperty(this.prototype,t,n)}}static getPropertyDescriptor(t,e,s){return{get(){return this[e]},set(n){let o=this[t];this[e]=n,this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||it}static finalize(){if(this.hasOwnProperty(nt))return!1;this[nt]=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),t.h!==void 0&&(this.h=[...t.h]),this.elementProperties=new Map(t.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties,s=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let n of s)this.createProperty(n,e[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let s=new Set(t.flat(1/0).reverse());for(let n of s)e.unshift(F(n))}else t!==void 0&&e.push(F(t));return e}static _$Ep(t,e){let s=e.attribute;return s===!1?void 0:typeof s=="string"?s:typeof t=="string"?t.toLowerCase():void 0}_$Eu(){var t;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(t=this.constructor.h)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,s;((e=this._$ES)!==null&&e!==void 0?e:this._$ES=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((s=t.hostConnected)===null||s===void 0||s.call(t))}removeController(t){var e;(e=this._$ES)===null||e===void 0||e.splice(this._$ES.indexOf(t)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Ei.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return tt(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostConnected)===null||s===void 0?void 0:s.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$ES)===null||t===void 0||t.forEach(e=>{var s;return(s=e.hostDisconnected)===null||s===void 0?void 0:s.call(e)})}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EO(t,e,s=it){var n;let o=this.constructor._$Ep(t,s);if(o!==void 0&&s.reflect===!0){let r=(((n=s.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?s.converter:st).toAttribute(e,s.type);this._$El=t,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$El=null}}_$AK(t,e){var s;let n=this.constructor,o=n._$Ev.get(t);if(o!==void 0&&this._$El!==o){let r=n.getPropertyOptions(o),h=typeof r.converter=="function"?{fromAttribute:r.converter}:((s=r.converter)===null||s===void 0?void 0:s.fromAttribute)!==void 0?r.converter:st;this._$El=o,this[o]=h.fromAttribute(e,r.type),this._$El=null}}requestUpdate(t,e,s){let n=!0;t!==void 0&&(((s=s||this.constructor.getPropertyOptions(t)).hasChanged||yt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),s.reflect===!0&&this._$El!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,s))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,o)=>this[o]=n),this._$Ei=void 0);let e=!1,s=this._$AL;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),(t=this._$ES)===null||t===void 0||t.forEach(n=>{var o;return(o=n.hostUpdate)===null||o===void 0?void 0:o.call(n)}),this.update(s)):this._$Ek()}catch(n){throw e=!1,this._$Ek(),n}e&&this._$AE(s)}willUpdate(t){}_$AE(t){var e;(e=this._$ES)===null||e===void 0||e.forEach(s=>{var n;return(n=s.hostUpdated)===null||n===void 0?void 0:n.call(s)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,s)=>this._$EO(s,this[s],e)),this._$EC=void 0),this._$Ek()}updated(t){}firstUpdated(t){}};b[nt]=!0,b.elementProperties=new Map,b.elementStyles=[],b.shadowRootOptions={mode:"open"},bt?.({ReactiveElement:b}),((et=G.reactiveElementVersions)!==null&&et!==void 0?et:G.reactiveElementVersions=[]).push("1.6.3");var ot,J=window,N=J.trustedTypes,$t=N?N.createPolicy("lit-html",{createHTML:i=>i}):void 0,lt="$lit$",A=`lit$${(Math.random()+"").slice(9)}$`,Et="?"+A,Jt=`<${Et}>`,C=document,O=()=>C.createComment(""),U=i=>i===null||typeof i!="object"&&typeof i!="function",Tt=Array.isArray,Yt=i=>Tt(i)||typeof i?.[Symbol.iterator]=="function",rt=`[
2
+ \f\r]`,H=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,At=/-->/g,xt=/>/g,S=RegExp(`>|${rt}(?:([^\\s"'>=/]+)(${rt}*=${rt}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),It=/'/g,St=/"/g,Lt=/^(?:script|style|textarea|title)$/i,kt=i=>(t,...e)=>({_$litType$:i,strings:t,values:e}),E=kt(1),fe=kt(2),y=Symbol.for("lit-noChange"),d=Symbol.for("lit-nothing"),wt=new WeakMap,w=C.createTreeWalker(C,129,null,!1);function Nt(i,t){if(!Array.isArray(i)||!i.hasOwnProperty("raw"))throw Error("invalid template strings array");return $t!==void 0?$t.createHTML(t):t}var Zt=(i,t)=>{let e=i.length-1,s=[],n,o=t===2?"<svg>":"",r=H;for(let h=0;h<e;h++){let l=i[h],a,c,p=-1,m=0;for(;m<l.length&&(r.lastIndex=m,c=r.exec(l),c!==null);)m=r.lastIndex,r===H?c[1]==="!--"?r=At:c[1]!==void 0?r=xt:c[2]!==void 0?(Lt.test(c[2])&&(n=RegExp("</"+c[2],"g")),r=S):c[3]!==void 0&&(r=S):r===S?c[0]===">"?(r=n??H,p=-1):c[1]===void 0?p=-2:(p=r.lastIndex-c[2].length,a=c[1],r=c[3]===void 0?S:c[3]==='"'?St:It):r===St||r===It?r=S:r===At||r===xt?r=H:(r=S,n=void 0);let _=r===S&&i[h+1].startsWith("/>")?" ":"";o+=r===H?l+Jt:p>=0?(s.push(a),l.slice(0,p)+lt+l.slice(p)+A+_):l+A+(p===-2?(s.push(void 0),h):_)}return[Nt(i,o+(i[e]||"<?>")+(t===2?"</svg>":"")),s]},z=class i{constructor({strings:t,_$litType$:e},s){let n;this.parts=[];let o=0,r=0,h=t.length-1,l=this.parts,[a,c]=Zt(t,e);if(this.el=i.createElement(a,s),w.currentNode=this.el.content,e===2){let p=this.el.content,m=p.firstChild;m.remove(),p.append(...m.childNodes)}for(;(n=w.nextNode())!==null&&l.length<h;){if(n.nodeType===1){if(n.hasAttributes()){let p=[];for(let m of n.getAttributeNames())if(m.endsWith(lt)||m.startsWith(A)){let _=c[r++];if(p.push(m),_!==void 0){let qt=n.getAttribute(_.toLowerCase()+lt).split(A),V=/([.?@])?(.*)/.exec(_);l.push({type:1,index:o,name:V[2],strings:qt,ctor:V[1]==="."?ht:V[1]==="?"?dt:V[1]==="@"?ct:D})}else l.push({type:6,index:o})}for(let m of p)n.removeAttribute(m)}if(Lt.test(n.tagName)){let p=n.textContent.split(A),m=p.length-1;if(m>0){n.textContent=N?N.emptyScript:"";for(let _=0;_<m;_++)n.append(p[_],O()),w.nextNode(),l.push({type:2,index:++o});n.append(p[m],O())}}}else if(n.nodeType===8)if(n.data===Et)l.push({type:2,index:o});else{let p=-1;for(;(p=n.data.indexOf(A,p+1))!==-1;)l.push({type:7,index:o}),p+=A.length-1}o++}}static createElement(t,e){let s=C.createElement("template");return s.innerHTML=t,s}};function R(i,t,e=i,s){var n,o,r,h;if(t===y)return t;let l=s!==void 0?(n=e._$Co)===null||n===void 0?void 0:n[s]:e._$Cl,a=U(t)?void 0:t._$litDirective$;return l?.constructor!==a&&((o=l?._$AO)===null||o===void 0||o.call(l,!1),a===void 0?l=void 0:(l=new a(i),l._$AT(i,e,s)),s!==void 0?((r=(h=e)._$Co)!==null&&r!==void 0?r:h._$Co=[])[s]=l:e._$Cl=l),l!==void 0&&(t=R(i,l._$AS(i,t.values),l,s)),t}var at=class{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;let{el:{content:s},parts:n}=this._$AD,o=((e=t?.creationScope)!==null&&e!==void 0?e:C).importNode(s,!0);w.currentNode=o;let r=w.nextNode(),h=0,l=0,a=n[0];for(;a!==void 0;){if(h===a.index){let c;a.type===2?c=new q(r,r.nextSibling,this,t):a.type===1?c=new a.ctor(r,a.name,a.strings,this,t):a.type===6&&(c=new ut(r,this,t)),this._$AV.push(c),a=n[++l]}h!==a?.index&&(r=w.nextNode(),h++)}return w.currentNode=C,o}v(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}},q=class i{constructor(t,e,s,n){var o;this.type=2,this._$AH=d,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=n,this._$Cp=(o=n?.isConnected)===null||o===void 0||o}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cp}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=R(this,t,e),U(t)?t===d||t==null||t===""?(this._$AH!==d&&this._$AR(),this._$AH=d):t!==this._$AH&&t!==y&&this._(t):t._$litType$!==void 0?this.g(t):t.nodeType!==void 0?this.$(t):Yt(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==d&&U(this._$AH)?this._$AA.nextSibling.data=t:this.$(C.createTextNode(t)),this._$AH=t}g(t){var e;let{values:s,_$litType$:n}=t,o=typeof n=="number"?this._$AC(t):(n.el===void 0&&(n.el=z.createElement(Nt(n.h,n.h[0]),this.options)),n);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===o)this._$AH.v(s);else{let r=new at(o,this),h=r.u(this.options);r.v(s),this.$(h),this._$AH=r}}_$AC(t){let e=wt.get(t.strings);return e===void 0&&wt.set(t.strings,e=new z(t)),e}T(t){Tt(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,n=0;for(let o of t)n===e.length?e.push(s=new i(this.k(O()),this.k(O()),this,this.options)):s=e[n],s._$AI(o),n++;n<e.length&&(this._$AR(s&&s._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){var s;for((s=this._$AP)===null||s===void 0||s.call(this,!1,!0,e);t&&t!==this._$AB;){let n=t.nextSibling;t.remove(),t=n}}setConnected(t){var e;this._$AM===void 0&&(this._$Cp=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}},D=class{constructor(t,e,s,n,o){this.type=1,this._$AH=d,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=o,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=d}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,s,n){let o=this.strings,r=!1;if(o===void 0)t=R(this,t,e,0),r=!U(t)||t!==this._$AH&&t!==y,r&&(this._$AH=t);else{let h=t,l,a;for(t=o[0],l=0;l<o.length-1;l++)a=R(this,h[s+l],e,l),a===y&&(a=this._$AH[l]),r||(r=!U(a)||a!==this._$AH[l]),a===d?t=d:t!==d&&(t+=(a??"")+o[l+1]),this._$AH[l]=a}r&&!n&&this.j(t)}j(t){t===d?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ht=class extends D{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===d?void 0:t}},Qt=N?N.emptyScript:"",dt=class extends D{constructor(){super(...arguments),this.type=4}j(t){t&&t!==d?this.element.setAttribute(this.name,Qt):this.element.removeAttribute(this.name)}},ct=class extends D{constructor(t,e,s,n,o){super(t,e,s,n,o),this.type=5}_$AI(t,e=this){var s;if((t=(s=R(this,t,e,0))!==null&&s!==void 0?s:d)===y)return;let n=this._$AH,o=t===d&&n!==d||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,r=t!==d&&(n===d||o);o&&this.element.removeEventListener(this.name,this,n),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,s;typeof this._$AH=="function"?this._$AH.call((s=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&s!==void 0?s:this.element,t):this._$AH.handleEvent(t)}},ut=class{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){R(this,t)}};var Ct=J.litHtmlPolyfillSupport;Ct?.(z,q),((ot=J.litHtmlVersions)!==null&&ot!==void 0?ot:J.litHtmlVersions=[]).push("2.8.0");var Rt=(i,t,e)=>{var s,n;let o=(s=e?.renderBefore)!==null&&s!==void 0?s:t,r=o._$litPart$;if(r===void 0){let h=(n=e?.renderBefore)!==null&&n!==void 0?n:null;o._$litPart$=r=new q(t.insertBefore(O(),h),h,void 0,e??{})}return r._$AI(i),r};var pt,mt;var g=class extends b{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,e;let s=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=s.firstChild),s}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Rt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)===null||t===void 0||t.setConnected(!1)}render(){return y}};g.finalized=!0,g._$litElement$=!0,(pt=globalThis.litElementHydrateSupport)===null||pt===void 0||pt.call(globalThis,{LitElement:g});var Dt=globalThis.litElementPolyfillSupport;Dt?.({LitElement:g});((mt=globalThis.litElementVersions)!==null&&mt!==void 0?mt:globalThis.litElementVersions=[]).push("3.3.3");var Xt=(i,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,i)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,i)}},te=(i,t,e)=>{t.constructor.createProperty(e,i)};function u(i){return(t,e)=>e!==void 0?te(i,t,e):Xt(i,t)}var Pt={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Mt=i=>(...t)=>({_$litDirective$:i,values:t}),Y=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,s){this._$Ct=t,this._$AM=e,this._$Ci=s}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var K=class extends Y{constructor(t){if(super(t),this.et=d,t.type!==Pt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===d||t==null)return this.ft=void 0,this.et=t;if(t===y)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.et)return this.ft;this.et=t;let e=[t];return e.raw=e,this.ft={_$litType$:this.constructor.resultType,strings:e,values:[]}}};K.directiveName="unsafeHTML",K.resultType=1;var Ht=Mt(K);var W=i=>i??d;var Z=class{static showImage(t,e,s,n){let o;if(n||!(t instanceof HTMLImageElement)?o=r=>t.style.backgroundImage=this.prepareSrc(r):o=r=>t.src=r,o(s),e){let r=()=>{o(e)},h=new Image;h.addEventListener("load",r),h.src=e,h.complete&&(h.removeEventListener("load",r),r())}}static prepareSrc(t){return t?t.startsWith("url")?t:`url("${t}")`:null}};var ee=':host{display:block;contain:strict;height:50px}:host([selected]){background-color:#d3e6fa}:host(:not([selected]):hover),:host(:not([selected])[focused]){background-color:#e7f1fa}@media (forced-colors: active){:host([selected]){outline:4px solid}:host(:not([selected]):hover){outline:4px dotted}:host(:not([selected])[focused]){outline:4px dashed}}:host([enable-line-clamp]) .labels>:only-child{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;white-space:normal;word-wrap:break-word}.container{display:flex;height:100%;box-sizing:border-box}.container .level-indicator{width:7px;height:100%}.container .level-indicator.level-0{background-color:#a0c3ef}.container .level-indicator.level-1{background-color:#e7c374}.container .level-indicator.level-2{background-color:#bfd596}.container .level-indicator.level-3{background-color:#fd998d}.container .level-indicator.level-4{background-color:#c6e8f5}.container .level-indicator.level-5{background-color:#fde3a4}.container .level-indicator.level-6{background-color:#dcbfe0}.side-content{display:flex;align-items:center;flex-grow:0}.labels{display:flex;flex-direction:column;justify-content:center;flex:1 1 0px;height:100%;line-height:normal;overflow:hidden;padding:var(--sd-list-item-label-content-padding, 0 8px)}.caption,.description{width:100%;font-family:var(--sd-list-item-font-family, "Segoe UI", "Lucida Sans", Arial, sans-serif);font-style:normal;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;-webkit-user-select:none;user-select:none;text-decoration:var(--sd-list-item-text-decoration, inherit)}.caption em,.description em{font-weight:bolder}.caption{font-size:var(--sd-list-item-caption-font-size, 16px);color:var(--sd-list-item-caption-text-color, #111);font-weight:var(--sd-list-item-caption-font-weight, normal)}.description{font-size:var(--sd-list-item-description-font-size, 13px);color:var(--sd-list-item-description-text-color, #767676);font-weight:var(--sd-list-item-description-font-weight, normal)}.icon-wrapper{width:var(--sd-list-item-icon-wrapper-width, 45px);height:100%;display:flex;align-items:center;justify-content:center}.icon-wrapper .icon{min-height:var(--sd-list-item-icon-size, 24px);min-width:var(--sd-list-item-icon-size, 24px);background-repeat:no-repeat;background-position:center;background-size:cover}',ie=Object.defineProperty,se=Object.getOwnPropertyDescriptor,v=(i,t,e,s)=>{for(var n=s>1?void 0:s?se(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&ie(t,e,n),n},T,f=(T=class extends g{constructor(){super(...arguments),this.contentMode="text",this.role="option"}static get styles(){return[M`
4
4
  ${k(ee)}
5
5
  `]}render(){return E`
6
6
  <div class="container">
@@ -32,13 +32,13 @@ var window;(window||={})["@cas-smartdesign/virtual-list"]=(()=>{var Q=Object.def
32
32
  <div class="${i}" title="${W(e)}">
33
33
  ${this.contentMode==="html"?Ht(t):t}
34
34
  </div>
35
- `:d}updated(i){super.updated(i),(i.has("icon")||i.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Z.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),i.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let i=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,e=this.shadowRoot.querySelector(".caption");e&&(t+=e.scrollWidth-e.clientWidth);let s=this.shadowRoot.querySelector(".description");return s&&(t=Math.max(t,s.scrollWidth-s.clientWidth)),t>0&&t++,i&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(i){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",i))&&i.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},T.ID="sd-list-item",T.ensureDefined=()=>{customElements.get(T.ID)||customElements.define(T.ID,T)},T);v([u({type:String})],f.prototype,"caption",2);v([u({type:String})],f.prototype,"description",2);v([u({type:Boolean})],f.prototype,"selected",2);v([u({type:String})],f.prototype,"icon",2);v([u({type:String})],f.prototype,"iconBackgroundColor",2);v([u({type:String})],f.prototype,"iconPlaceholder",2);v([u({type:Number})],f.prototype,"level",2);v([u()],f.prototype,"contentMode",2);v([u({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],f.prototype,"enableLineClamp",2);v([u({type:Boolean,reflect:!0,attribute:"aria-disabled"})],f.prototype,"disabled",2);v([u({type:String,attribute:"icon-attr-aria-label"})],f.prototype,"iconAttrAriaLabel",2);v([u({type:String,reflect:!0})],f.prototype,"role",2);v([u({type:String,attribute:"caption-attr-title"})],f.prototype,"captionAttrTitle",2);v([u({type:String,attribute:"description-attr-title"})],f.prototype,"descriptionAttrTitle",2);v([u({type:String,attribute:"icon-attr-title"})],f.prototype,"iconAttrTitle",2);var L=f,Ot=(i,t)=>{let e=document.createElement(L.ID);if(i){if(e.caption=i.caption,e.description=i.description,e.icon=i.icon,e.iconBackgroundColor=i.iconBackgroundColor,e.iconPlaceholder=i.iconPlaceholder,e.level=i.level,e.disabled=i.disabled,i.contentMode&&(e.contentMode=i.contentMode),i.leftContentGenerator){let s=i.leftContentGenerator(i,e);s&&(s.slot="left-content",e.appendChild(s))}if(i.rightContentGenerator){let s=i.rightContentGenerator(i,e);s&&(s.slot="right-content",e.appendChild(s))}}return e};L.ensureDefined();var ft=class{getOffsetForIndexAndAlignment(t,e,s,n,o,r){let h=Math.max(0,r*n),l=Math.min(h,t*n),a=Math.max(0,t*n-o+n);switch(e){case"start":return l;case"end":return a;case"center":{let c=Math.round(a+(l-a)/2);return c<Math.ceil(o/2)?0:c>h+Math.floor(o/2)?h:c}case"auto":default:return s>=a&&s<=l?s:s<a?a:l}}debounce(t){let e;return(...s)=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{t(...s),e=null})}}},ne=new ft,vt=class{constructor(t=100,e=5){this.pageSize=t,this.preloadedItemsCount=e,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this.handleListDataRequest=s=>{let{startIndex:n,stopIndex:o}=s.detail;this._lastRequestedFirstIndex=n,this._lastRequestedLastIndex=o,this._list.items=this._itemCache.slice(n,o+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<o+this.preloadedItemsCount&&this.requestData()},this.itemCount=t}get currentPage(){return this.items.length==0&&this.finalSizeIsKnown?0:Math.floor((this.items.length-1)/this.pageSize)}get finalSizeIsKnown(){return this._finalSizeIsKnown}set finalSizeIsKnown(t){this._finalSizeIsKnown=t,t&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=t)}get itemCount(){return this._itemCount}set itemCount(t){this._itemCount=t,this._list&&(this._list.itemCount=t)}get items(){return this._itemCache}set items(t){this._itemCache=t,this.onItemsChange()}addItems(t){this._itemCache=this._itemCache.concat(t),this.onItemsChange()}connectList(t){this._list&&this._list.removeEventListener("data-request",this.handleListDataRequest),this._list=t,t.itemCount=this.itemCount,t.addEventListener("data-request",this.handleListDataRequest),t.finalSizeIsKnown=this._finalSizeIsKnown}onItemsChange(){this._pendingDataRequest=!1,this._lastLoadedIndex=this._itemCache.length-1,this.finalSizeIsKnown?this.itemCount=this._itemCache.length:this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex),this._list&&(this._list.items=this._itemCache.slice(this._lastRequestedFirstIndex,this._lastRequestedLastIndex+1))}requestData(){if(!this._pendingDataRequest)if(this.onDataRequest)this._pendingDataRequest=!0,this.onDataRequest(this.currentPage+1),this._lastLoadedIndex+=this.pageSize-1,this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex);else throw Error("The final size is not yet known and the list would require item data from index "+this._lastRequestedFirstIndex+". to "+this._lastRequestedLastIndex+". which is not possible to load without a configured onDataRequest")}},oe=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}",re=Object.defineProperty,le=Object.getOwnPropertyDescriptor,I=(i,t,e,s)=>{for(var n=s>1?void 0:s?le(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&re(t,e,n),n},Ut=(i=>(i.TriggerOnly="trigger-only",i.Single="single",i.Multi="multi",i))(Ut||{}),ae=0,A,$=(A=class extends g{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=A.ID+"_"+ae++,this.role="listbox",this.itemGenerator=Ot,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let i=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(i)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=i=>{let t=!0;switch(i.key){case"Down":case"ArrowDown":this.focusIndex=this.normalizeIndex(this.focusIndex+1);break;case"Up":case"ArrowUp":this.focusIndex=this.normalizeIndex(this.focusIndex-1);break;case"Enter":this.handleSelection(this.focusIndex,i.metaKey||i.ctrlKey);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(i.preventDefault(),i.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(i){this.toggleAttribute("focus-target",i)}get focusIndex(){return this._focusIndex}set focusIndex(i){if(i>=-1&&i<this.itemCount){let t=this._focusIndex;this._focusIndex=i,(i<=this._firstVisibleIndex||this._lastVisibleIndex<=i)&&this.scrollToItem(i),t!=i&&(i==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(i){i?this._selectedIndices=i.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(i,t="auto"){this.scrollTop=ne.getOffsetForIndexAndAlignment(this.normalizeIndex(i),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(i){return!this.shadowRoot||i<this._firstVisibleIndex||this._lastVisibleIndex<i?null:this.querySelector(`[item-index="${i}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(i){super.firstUpdated(i),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){let i=this.getListItem(this.focusIndex);i&&(this.focusTarget||document.activeElement==this?(i.setAttribute("focused",""),this.setAttribute("aria-activedescendant",i.id)):(i.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[M`
35
+ `:d}updated(i){super.updated(i),(i.has("icon")||i.has("iconPlaceholder"))&&(this.icon||this.iconPlaceholder)&&Z.showImage(this.shadowRoot.querySelector(".icon"),this.icon,this.iconPlaceholder),i.has("selected")&&this.setAttribute("aria-selected",String(this.selected))}get missingWidthForTexts(){let i=this.enableLineClamp;this.removeAttribute("enable-line-clamp");let t=0,e=this.shadowRoot.querySelector(".caption");e&&(t+=e.scrollWidth-e.clientWidth);let s=this.shadowRoot.querySelector(".description");return s&&(t=Math.max(t,s.scrollWidth-s.clientWidth)),t>0&&t++,i&&this.setAttribute("enable-line-clamp",""),t}handleIconClick(i){!this.disabled&&!this.dispatchEvent(new PointerEvent("list-item-icon-click",i))&&i.preventDefault()}getLevelIndicators(){return this.level?Array(Number(this.level)).fill(null):[]}},T.ID="sd-list-item",T.ensureDefined=()=>{customElements.get(T.ID)||customElements.define(T.ID,T)},T);v([u({type:String})],f.prototype,"caption",2);v([u({type:String})],f.prototype,"description",2);v([u({type:Boolean})],f.prototype,"selected",2);v([u({type:String})],f.prototype,"icon",2);v([u({type:String})],f.prototype,"iconBackgroundColor",2);v([u({type:String})],f.prototype,"iconPlaceholder",2);v([u({type:Number})],f.prototype,"level",2);v([u()],f.prototype,"contentMode",2);v([u({type:Boolean,reflect:!0,attribute:"enable-line-clamp"})],f.prototype,"enableLineClamp",2);v([u({converter:{fromAttribute:i=>i=="true",toAttribute:i=>i},reflect:!0,attribute:"aria-disabled"})],f.prototype,"disabled",2);v([u({type:String,attribute:"icon-attr-aria-label"})],f.prototype,"iconAttrAriaLabel",2);v([u({type:String,reflect:!0})],f.prototype,"role",2);v([u({type:String,attribute:"caption-attr-title"})],f.prototype,"captionAttrTitle",2);v([u({type:String,attribute:"description-attr-title"})],f.prototype,"descriptionAttrTitle",2);v([u({type:String,attribute:"icon-attr-title"})],f.prototype,"iconAttrTitle",2);var L=f,Ot=(i,t)=>{let e=document.createElement(L.ID);if(i){if(e.caption=i.caption,e.description=i.description,e.icon=i.icon,e.iconBackgroundColor=i.iconBackgroundColor,e.iconPlaceholder=i.iconPlaceholder,e.level=i.level,e.disabled=i.disabled,i.contentMode&&(e.contentMode=i.contentMode),i.leftContentGenerator){let s=i.leftContentGenerator(i,e);s&&(s.slot="left-content",e.appendChild(s))}if(i.rightContentGenerator){let s=i.rightContentGenerator(i,e);s&&(s.slot="right-content",e.appendChild(s))}}return e};L.ensureDefined();var ft=class{getOffsetForIndexAndAlignment(t,e,s,n,o,r){let h=Math.max(0,r*n),l=Math.min(h,t*n),a=Math.max(0,t*n-o+n);switch(e){case"start":return l;case"end":return a;case"center":{let c=Math.round(a+(l-a)/2);return c<Math.ceil(o/2)?0:c>h+Math.floor(o/2)?h:c}case"auto":default:return s>=a&&s<=l?s:s<a?a:l}}debounce(t){let e;return(...s)=>{e&&window.cancelAnimationFrame(e),e=window.requestAnimationFrame(()=>{t(...s),e=null})}}},ne=new ft,vt=class{constructor(t=100,e=5){this.pageSize=t,this.preloadedItemsCount=e,this._finalSizeIsKnown=!1,this._itemCache=[],this._lastRequestedFirstIndex=0,this._lastRequestedLastIndex=0,this._lastLoadedIndex=0,this.handleListDataRequest=s=>{let{startIndex:n,stopIndex:o}=s.detail;this._lastRequestedFirstIndex=n,this._lastRequestedLastIndex=o,this._list.items=this._itemCache.slice(n,o+1),!this.finalSizeIsKnown&&this._lastLoadedIndex<o+this.preloadedItemsCount&&this.requestData()},this.itemCount=t}get currentPage(){return this.items.length==0&&this.finalSizeIsKnown?0:Math.floor((this.items.length-1)/this.pageSize)}get finalSizeIsKnown(){return this._finalSizeIsKnown}set finalSizeIsKnown(t){this._finalSizeIsKnown=t,t&&(this.itemCount=this._itemCache.length),this._list&&(this._list.finalSizeIsKnown=t)}get itemCount(){return this._itemCount}set itemCount(t){this._itemCount=t,this._list&&(this._list.itemCount=t)}get items(){return this._itemCache}set items(t){this._itemCache=t,this.onItemsChange()}addItems(t){this._itemCache=this._itemCache.concat(t),this.onItemsChange()}connectList(t){this._list&&this._list.removeEventListener("data-request",this.handleListDataRequest),this._list=t,t.itemCount=this.itemCount,t.addEventListener("data-request",this.handleListDataRequest),t.finalSizeIsKnown=this._finalSizeIsKnown}onItemsChange(){this._pendingDataRequest=!1,this._lastLoadedIndex=this._itemCache.length-1,this.finalSizeIsKnown?this.itemCount=this._itemCache.length:this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex),this._list&&(this._list.items=this._itemCache.slice(this._lastRequestedFirstIndex,this._lastRequestedLastIndex+1))}requestData(){if(!this._pendingDataRequest)if(this.onDataRequest)this._pendingDataRequest=!0,this.onDataRequest(this.currentPage+1),this._lastLoadedIndex+=this.pageSize-1,this._lastLoadedIndex>this.itemCount&&(this.itemCount=this._lastLoadedIndex);else throw Error("The final size is not yet known and the list would require item data from index "+this._lastRequestedFirstIndex+". to "+this._lastRequestedLastIndex+". which is not possible to load without a configured onDataRequest")}},oe=":host{display:block;position:relative;contain:layout}:host(:focus){outline:none}:host(:focus-visible) ::slotted([focused]){box-shadow:0 0 0 1px #1467ba inset}.container{width:100%}.container>::slotted(*){width:100%;position:absolute;box-sizing:border-box}.container>::slotted(:not([last])){border-bottom:1px solid #d9d9d9}",re=Object.defineProperty,le=Object.getOwnPropertyDescriptor,I=(i,t,e,s)=>{for(var n=s>1?void 0:s?le(t,e):t,o=i.length-1,r;o>=0;o--)(r=i[o])&&(n=(s?r(t,e,n):r(n))||n);return s&&n&&re(t,e,n),n},Ut=(i=>(i.TriggerOnly="trigger-only",i.Single="single",i.Multi="multi",i))(Ut||{}),ae=0,x,$=(x=class extends g{constructor(){super(),this.items=[],this.selectionType="trigger-only",this.id=x.ID+"_"+ae++,this.role="listbox",this.itemGenerator=Ot,this._lastKnownScrollTop=0,this._lastRenderedScrollTop=0,this._itemsRenderData=[],this._elementCache=new Map,this._visibleItemsNum=0,this._selectedIndices=[],this._focusIndex=-1,this._lastKnownHeight=0,this.onScroll=()=>{this._lastKnownScrollTop=this.scrollTop;let i=this._lastRenderedScrollTop-this._lastKnownScrollTop;Math.abs(i)>=this.itemHeight&&(this._lastRenderedScrollTop=this._lastKnownScrollTop,this.requestUpdate())},this.handleKeyDown=i=>{let t=!0;switch(i.key){case"Down":case"ArrowDown":this.focusIndex=this.normalizeIndex(this.focusIndex+1);break;case"Up":case"ArrowUp":this.focusIndex=this.normalizeIndex(this.focusIndex-1);break;case"Enter":this.handleSelection(this.focusIndex,i.metaKey||i.ctrlKey);break;case"End":this.focusIndex=this.itemCount-1;break;case"PageDown":this.focusIndex=this.normalizeIndex(this.focusIndex+this._visibleItemsNum-1);break;case"Home":this.focusIndex=0;break;case"PageUp":this.focusIndex=this.normalizeIndex(this.focusIndex-this._visibleItemsNum+1);break;default:t=!1;break}t&&(i.preventDefault(),i.stopPropagation())},this._resizeObserver=new ResizeObserver(()=>{this._lastKnownHeight!==this.offsetHeight&&(this._lastKnownHeight=this.offsetHeight,this.requestUpdate())})}get focusTarget(){return this.hasAttribute("focus-target")}set focusTarget(i){this.toggleAttribute("focus-target",i)}get focusIndex(){return this._focusIndex}set focusIndex(i){if(i>=-1&&i<this.itemCount){let t=this._focusIndex;this._focusIndex=i,(i<=this._firstVisibleIndex||this._lastVisibleIndex<=i)&&this.scrollToItem(i),t!=i&&(i==-1&&this.removeAttribute("aria-activedescendant"),this.requestUpdate("focusIndex",t))}}get selectedIndices(){return this._selectedIndices}set selectedIndices(i){i?this._selectedIndices=i.map(t=>Number(t)):this._selectedIndices=[],this.requestUpdate("selectedIndices")}scrollToItem(i,t="auto"){this.scrollTop=ne.getOffsetForIndexAndAlignment(this.normalizeIndex(i),t,this.scrollTop,this.itemHeight,this.height,this.itemCount),this._lastKnownScrollTop=this.scrollTop}getListItem(i){return!this.shadowRoot||i<this._firstVisibleIndex||this._lastVisibleIndex<i?null:this.querySelector(`[item-index="${i}"]`)}connectedCallback(){super.connectedCallback(),this._resizeObserver.observe(this),this.scrollTop!==this._lastKnownScrollTop&&(this.scrollTop=this._lastKnownScrollTop,this.requestUpdate())}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver.disconnect()}firstUpdated(i){super.firstUpdated(i),this.addEventListener("scroll",this.onScroll),this.addEventListener("keydown",this.handleKeyDown),this.addEventListener("click",this.handleClick),this.addEventListener("mousedown",t=>{t.button==1&&t.preventDefault()}),this.addEventListener("auxclick",this.handleClick),this.addEventListener("focus",()=>{this.matches(":focus-visible")&&(this.focusIndex==-1?(this.selectedIndices&&(this.focusIndex=this.selectedIndices[0]),this.focusIndex==-1&&this.itemCount>0&&(this.focusIndex=0)):this.updateFocusedItemAttributes())}),this.addEventListener("blur",()=>{this.focusIndex!=-1&&this.updateFocusedItemAttributes()}),this.selectedIndices.length>0&&this.scrollToItem(this.selectedIndices[0],"center")}updateFocusedItemAttributes(){let i=this.getListItem(this.focusIndex);i&&(this.focusTarget||document.activeElement==this?(i.setAttribute("focused",""),this.setAttribute("aria-activedescendant",i.id)):(i.removeAttribute("focused"),this.removeAttribute("aria-activedescendant")))}static get styles(){return[M`
36
36
  ${k(oe)}
37
37
  `]}render(){return this.updateItemsRenderData(),E`
38
38
  <div class="container" style="height: ${this.itemCount*this.itemHeight}px">
39
39
  <slot name="items"></slot>
40
40
  </div>
41
- `}updated(i){if(super.updated(i),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{let t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{let i=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(i==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;let t=[...this.querySelectorAll("[item-index]")].map(s=>{if(s instanceof L){s.enableLineClamp=!1;let n=s.missingWidthForTexts;return n>i&&(s.enableLineClamp=!0),n}}),e=Math.max(...t);e>0&&(this.style.width=`${this.offsetWidth+e}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(i=>{i instanceof L&&(i.enableLineClamp=i.enableLineClamp||i.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){let i=[...this.querySelectorAll("[item-index]")],t=new Map,e=document.createDocumentFragment();for(let s of this._itemsRenderData){let n=this.renderItem(s);n.parentElement||e.appendChild(n),t.set(s.dataHash,n);let o=i.indexOf(n);o!==-1&&i.splice(o,1)}this.appendChild(e);for(let s of i)s instanceof L&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,n)=>{this._elementCache.set(n,s)})}renderItem({index:i,top:t,dataHash:e,data:s}){let n;return s?this._elementCache.has(e)?(n=this._elementCache.get(e),this._elementCache.delete(e)):(n=this.itemGenerator(s,i),n.setAttribute("slot","items")):(n=document.createElement("div"),n.setAttribute("placeholder-item",""),n.setAttribute("slot","items")),Object.assign(n.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),n.setAttribute("item-index",i.toString()),n.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),n.setAttribute("aria-posinset",String(i+1)),(!n.id||n.id.startsWith(this.id+"_item_"))&&(n.id=this.id+"_item_"+i),this.itemCount-1==i?n.setAttribute("last",""):n.removeAttribute("last"),this.updateSelectedAttribute(i,n),this.updateFocusedAttribute(i,n),n}updateFocusedAttribute(i,t){this.focusIndex==i&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(i,t){let e=this.selectedIndices.indexOf(i)!==-1;e?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(e))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);let i=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(i,t);for(let e=i;e<=t;e++){let s=e-i,n=this.items[s],o;n?o=JSON.stringify(n):o=`placeholder-${s}`,this._itemsRenderData.push({index:e,top:this.itemHeight*e,physicalIndex:s,dataHash:o,data:n})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(i){return Math.max(0,Math.min(i,this.itemCount-1))}get height(){return this.offsetHeight}requestData(i,t){!Number.isNaN(i)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:i,stopIndex:t}}))}handleSelection(i,t){if(i<0||this.itemCount<=i)return;let e=i%this._visibleItemsNum,s=this.items[e];if(!s||s.disabled)return;let n=!0;if(this.selectionType!=="trigger-only"){let o=this.selectedIndices.indexOf(i);n=o==-1,n?this.selectionType==="single"?this.selectedIndices=[i]:this.selectedIndices.push(i):this.selectedIndices.splice(o,1),this.requestUpdate("selectedIndices")}this.focusIndex=i,this.dispatchSelectionEvent(i,n,t)}dispatchSelectionEvent(i,t,e){this.dispatchEvent(new CustomEvent("selection",{detail:{index:i,selected:t,hasModifier:e}}))}handleClick(i){let t=i.composedPath().find(e=>e.hasAttribute&&e.hasAttribute("item-index"));if(t){let e=parseInt(t.getAttribute("item-index"));if(Number.isInteger(e)){if(i.button==0||i.button==1){let s=i.type=="auxclick"&&i.button==1||i.metaKey||i.ctrlKey;this.handleSelection(e,s)}this.focusIndex=e}}}},A.ID="sd-virtual-list",A.ensureDefined=()=>{L.ensureDefined(),customElements.get(A.ID)||customElements.define(A.ID,A)},A);I([u({type:Number,attribute:"item-height",reflect:!0})],$.prototype,"itemHeight",2);I([u({type:Number})],$.prototype,"itemCount",2);I([u({type:Array,attribute:!1})],$.prototype,"items",2);I([u({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],$.prototype,"selectionType",2);I([u({type:String,attribute:!0,reflect:!0})],$.prototype,"id",2);I([u({type:String,reflect:!0})],$.prototype,"role",2);I([u({type:Number,attribute:"focus-index",reflect:!0})],$.prototype,"focusIndex",1);I([u({type:Array,attribute:!1})],$.prototype,"selectedIndices",1);var zt=$;zt.ensureDefined();return Ft(he);})();
41
+ `}updated(i){if(super.updated(i),this._lastRenderedScrollTop=this._lastKnownScrollTop,this.updateItems(),(this._increaseWidthOnNextRenderIfNeeded||this._reachedMaxWidth)&&this._firstVisibleIndex<this._lastVisibleIndex)if(this.querySelector("[item-index]"))this.adjustWidthIfNeeded();else{let t=new MutationObserver(()=>{this.adjustWidthIfNeeded(),t.disconnect()});t.observe(this)}}adjustWidthIfNeeded(){this._increaseWidthOnNextRenderIfNeeded?(this._increaseWidthOnNextRenderIfNeeded=!1,window.requestAnimationFrame(()=>{let i=Number.parseInt(getComputedStyle(this).maxWidth)-this.offsetWidth;if(i==0)this._reachedMaxWidth=!0,this.enableLineClampOnItemsIfNeeded();else{this._reachedMaxWidth=!1;let t=[...this.querySelectorAll("[item-index]")].map(s=>{if(s instanceof L){s.enableLineClamp=!1;let n=s.missingWidthForTexts;return n>i&&(s.enableLineClamp=!0),n}}),e=Math.max(...t);e>0&&(this.style.width=`${this.offsetWidth+e}px`)}})):this._reachedMaxWidth&&this.enableLineClampOnItemsIfNeeded()}enableLineClampOnItemsIfNeeded(){this.querySelectorAll("[item-index]").forEach(i=>{i instanceof L&&(i.enableLineClamp=i.enableLineClamp||i.missingWidthForTexts>0)})}increaseWidthOnNextRenderIfNeeded(){this._increaseWidthOnNextRenderIfNeeded=!0}updateItems(){let i=[...this.querySelectorAll("[item-index]")],t=new Map,e=document.createDocumentFragment();for(let s of this._itemsRenderData){let n=this.renderItem(s);n.parentElement||e.appendChild(n),t.set(s.dataHash,n);let o=i.indexOf(n);o!==-1&&i.splice(o,1)}this.appendChild(e);for(let s of i)s instanceof L&&(s.enableLineClamp=!1),this.removeChild(s);t.forEach((s,n)=>{this._elementCache.set(n,s)})}renderItem({index:i,top:t,dataHash:e,data:s}){let n;return s?this._elementCache.has(e)?(n=this._elementCache.get(e),this._elementCache.delete(e)):(n=this.itemGenerator(s,i),n.setAttribute("slot","items")):(n=document.createElement("div"),n.setAttribute("placeholder-item",""),n.setAttribute("slot","items")),Object.assign(n.style,{transform:`translateY(${t}px)`,height:`${this.itemHeight}px`}),n.setAttribute("item-index",i.toString()),n.setAttribute("aria-setsize",String(this.finalSizeIsKnown?this.itemCount:-1)),n.setAttribute("aria-posinset",String(i+1)),(!n.id||n.id.startsWith(this.id+"_item_"))&&(n.id=this.id+"_item_"+i),this.itemCount-1==i?n.setAttribute("last",""):n.removeAttribute("last"),this.updateSelectedAttribute(i,n),this.updateFocusedAttribute(i,n),n}updateFocusedAttribute(i,t){this.focusIndex==i&&(this.focusTarget||document.activeElement==this)?(t.setAttribute("focused",""),this.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focused")}updateSelectedAttribute(i,t){let e=this.selectedIndices.indexOf(i)!==-1;e?t.setAttribute("selected",""):t.removeAttribute("selected"),t.setAttribute("aria-selected",String(e))}updateItemsRenderData(){if(this._itemsRenderData=[],this._visibleItemsNum=Math.min(Math.ceil(this.height/this.itemHeight),this.itemCount),this._visibleItemsNum>0){this._firstVisibleIndex=this.normalizeIndex(Math.floor(this._lastKnownScrollTop/this.itemHeight)),this._lastVisibleIndex=this.normalizeIndex(this._firstVisibleIndex+this._visibleItemsNum);let i=this.normalizeIndex(this._firstVisibleIndex-2),t=this.normalizeIndex(this._lastVisibleIndex+2);this.requestData(i,t);for(let e=i;e<=t;e++){let s=e-i,n=this.items[s],o;n?o=JSON.stringify(n):o=`placeholder-${s}`,this._itemsRenderData.push({index:e,top:this.itemHeight*e,physicalIndex:s,dataHash:o,data:n})}}else this._firstVisibleIndex=0,this._lastVisibleIndex=0}normalizeIndex(i){return Math.max(0,Math.min(i,this.itemCount-1))}get height(){return this.offsetHeight}requestData(i,t){!Number.isNaN(i)&&!Number.isNaN(t)&&this.dispatchEvent(new CustomEvent("data-request",{detail:{startIndex:i,stopIndex:t}}))}handleSelection(i,t){if(i<0||this.itemCount<=i)return;let e=this.getListItem(i);if(e.getAttribute("aria-disabled")=="true"||e.hasAttribute("disabled"))return;let s=!0;if(this.selectionType!=="trigger-only"){let n=this.selectedIndices.indexOf(i);s=n==-1,s?this.selectionType==="single"?this.selectedIndices=[i]:this.selectedIndices.push(i):this.selectedIndices.splice(n,1),this.requestUpdate("selectedIndices")}this.focusIndex=i,this.dispatchSelectionEvent(i,s,t)}dispatchSelectionEvent(i,t,e){this.dispatchEvent(new CustomEvent("selection",{detail:{index:i,selected:t,hasModifier:e}}))}handleClick(i){let t=i.composedPath().find(e=>e.hasAttribute&&e.hasAttribute("item-index"));if(t){let e=parseInt(t.getAttribute("item-index"));if(Number.isInteger(e)){if(i.button==0||i.button==1){let s=i.type=="auxclick"&&i.button==1||i.metaKey||i.ctrlKey;this.handleSelection(e,s)}this.focusIndex=e}}}},x.ID="sd-virtual-list",x.ensureDefined=()=>{L.ensureDefined(),customElements.get(x.ID)||customElements.define(x.ID,x)},x);I([u({type:Number,attribute:"item-height",reflect:!0})],$.prototype,"itemHeight",2);I([u({type:Number})],$.prototype,"itemCount",2);I([u({type:Array,attribute:!1})],$.prototype,"items",2);I([u({type:String,attribute:"selection-type",reflect:!0,noAccessor:!0})],$.prototype,"selectionType",2);I([u({type:String,attribute:!0,reflect:!0})],$.prototype,"id",2);I([u({type:String,reflect:!0})],$.prototype,"role",2);I([u({type:Number,attribute:"focus-index",reflect:!0})],$.prototype,"focusIndex",1);I([u({type:Array,attribute:!1})],$.prototype,"selectedIndices",1);var zt=$;zt.ensureDefined();return Ft(he);})();
42
42
  /*! Bundled license information:
43
43
 
44
44
  @lit/reactive-element/css-tag.js: