@timlassiter11/yatl 1.2.4 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +647 -510
- package/dist/index.d.ts +647 -510
- package/dist/index.js +660 -364
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +647 -357
- package/dist/index.mjs.map +1 -1
- package/dist/yatl.min.global.js +126 -45
- package/dist/yatl.min.global.js.map +1 -1
- package/package.json +1 -1
package/dist/yatl.min.global.js
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
"use strict";var yatl=(()=>{var Se=Object.defineProperty;var ht=Object.getOwnPropertyDescriptor;var ni=Object.getOwnPropertyNames;var li=Object.prototype.hasOwnProperty;var Fe=(s,t)=>()=>(s&&(t=s(s=0)),t);var dt=(s,t)=>{for(var e in t)Se(s,e,{get:t[e],enumerable:!0})},ai=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ni(t))!li.call(s,r)&&r!==e&&Se(s,r,{get:()=>t[r],enumerable:!(i=ht(t,r))||i.enumerable});return s};var ci=s=>ai(Se({},"__esModule",{value:!0}),s),_=(s,t,e,i)=>{for(var r=i>1?void 0:i?ht(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&Se(t,e,r),r};var ve,Bt=Fe(()=>{"use strict";ve=class{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,t?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(t,e){let i=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-i}get averageSize(){if(this._map.size>0){let t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}});function st(s){return s==="horizontal"?"width":"height"}var Ve,Kt=Fe(()=>{"use strict";Ve=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){t=t==="horizontal"?t:"vertical",t!==this._direction&&(this._direction=t,this._sizeDim=t==="horizontal"?"width":"height",this._secondarySizeDim=t==="horizontal"?"height":"width",this._positionDim=t==="horizontal"?"left":"top",this._secondaryPositionDim=t==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){let{_viewDim1:e,_viewDim2:i}=this;Object.assign(this._viewportSize,t),i!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[st(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let t=this._scrollPosition,{index:e,block:i}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:i||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){let{block:e}=t,i=Math.min(this.items.length,Math.max(0,t.index)),r=this._getItemPosition(i)[this._positionDim],o=r;if(e!=="start"){let n=this._getItemSize(i)[this._sizeDim];if(e==="center")o=r-.5*this._viewDim1+.5*n;else{let l=r-this._viewDim1+n;if(e==="end")o=l;else{let a=this._scrollPosition;o=Math.abs(a-r)<Math.abs(a-l)?r:l}}}return o+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(o)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let t=new Map;if(this._first!==-1&&this._last!==-1)for(let i=this._first;i<=this._last;i++)t.set(i,this._getItemPosition(i));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let i=this._last;for(;i>this._first&&Math.round(this._getItemPosition(i)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)i--;(e!==this._firstVisible||i!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=i,t&&t.emit&&this._sendVisibilityChangedMessage())}}});var Qt={};dt(Qt,{FlowLayout:()=>Le,flow:()=>Ii});function Wt(s){return s==="horizontal"?"marginLeft":"marginTop"}function Oi(s){return s==="horizontal"?"marginRight":"marginBottom"}function ki(s){return s==="horizontal"?"xOffset":"yOffset"}function Ni(s,t){let e=[s,t].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var Ii,ot,Le,Yt=Fe(()=>{"use strict";Bt();Kt();Ii=s=>Object.assign({type:Le},s);ot=class{constructor(){this._childSizeCache=new ve,this._marginSizeCache=new ve,this._metricsCache=new Map}update(t,e){let i=new Set;Object.keys(t).forEach(r=>{let o=Number(r);this._metricsCache.set(o,t[o]),this._childSizeCache.set(o,t[o][st(e)]),i.add(o),i.add(o+1)});for(let r of i){let o=this._metricsCache.get(r)?.[Wt(e)]||0,n=this._metricsCache.get(r-1)?.[Oi(e)]||0;this._marginSizeCache.set(r,Ni(o,n))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[Wt(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},Le=class extends Ve{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new ot,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){let i=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(i*e.averageChildSize+(i-1)*e.averageMarginSize)}else{let i=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+i*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){let e=this._getPhysicalItem(t),{averageMarginSize:i}=this._metricsCache;return t===0?this._metricsCache.getMarginSize(0)??i:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(this._physicalItems.size===0)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);let i=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),o=i.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(o>e)return this._calculateAnchor(t,e);let a=this._firstVisible-1,c=-1/0;for(;c<t;)c=this._getPhysicalItem(++a).pos+this._metricsCache.getChildSize(a);return a}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){let t=this._newPhysicalItems;this._stable=!0;let e,i;if(this.pin!==null){let{index:c}=this.pin;this._anchorIdx=c,this._anchorPos=this._getPosition(c)}if(e=this._scrollPosition-this._overhang,i=this._scrollPosition+this._viewDim1+this._overhang,i<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,i),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let o=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,n=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=o),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-n-r);let l=0;for(this._anchorPos+r+n<e&&(l=e-(this._anchorPos+r+n)),this._anchorPos-o>i&&(l=i-(this._anchorPos-o)),l&&(this._scrollPosition-=l,e-=l,i-=l,this._scrollError+=l),t.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-o,this._physicalMax=this._anchorPos+r+n;this._physicalMin>e&&this._first>0;){let c=this._getSize(--this._first);c===void 0&&(this._stable=!1,c=this._getAverageSize());let d=this._metricsCache.getMarginSize(this._first);d===void 0&&(this._stable=!1,d=this._metricsCache.averageMarginSize),this._physicalMin-=c;let h=this._physicalMin;if(t.set(this._first,{pos:h,size:c}),this._physicalMin-=d,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<i&&this._last<this.items.length-1;){let c=this._getSize(++this._last);c===void 0&&(this._stable=!1,c=this._getAverageSize());let d=this._metricsCache.getMarginSize(this._last);d===void 0&&(this._stable=!1,d=this._metricsCache.averageMarginSize);let h=this._physicalMax;if(t.set(this._last,{pos:h,size:c}),this._physicalMax+=c+d,!this._stable&&!this._estimate)break}let a=this._calculateError();a&&(this._physicalMin-=a,this._physicalMax-=a,this._anchorPos-=a,this._scrollPosition-=a,t.forEach(c=>c.pos-=a),this._scrollError+=a),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:t,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){let{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[ki(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var Hi={};dt(Hi,{TypedEventTarget:()=>ce,YatlColumnReorderEvent:()=>re,YatlColumnReorderRequest:()=>ie,YatlColumnResizeEvent:()=>te,YatlColumnSortEvent:()=>Z,YatlColumnSortRequest:()=>J,YatlColumnToggleEvent:()=>ee,YatlEvent:()=>v,YatlRowClickEvent:()=>Y,YatlRowSelectEvent:()=>X,YatlRowSelectRequest:()=>G,YatlTable:()=>f,YatlTableController:()=>we,YatlTableSearchEvent:()=>se,YatlTableStateChangeEvent:()=>ne,YatlTableViewChangeEvent:()=>oe,createRegexTokenizer:()=>pt,createState:()=>O,findColumn:()=>hi,getColumnStateChanges:()=>le,getNestedValue:()=>S,isDisplayColumn:()=>M,isInternalColumn:()=>di,isRowIdType:()=>ae,isRowSelectionMethod:()=>qe,setNestedValue:()=>ui,whitespaceTokenizer:()=>Be});var v=class extends Event{constructor(t,e={}){super(t,{bubbles:!0,composed:!0,cancelable:!1,...e})}},Y=class s extends v{constructor(e,i,r,o,n){super(s.EVENT_NAME);this.row=e;this.rowId=i;this.index=r;this.field=o;this.originalEvent=n}static{this.EVENT_NAME="yatl-row-click"}clone(){return new s(this.row,this.rowId,this.index,this.field,this.originalEvent)}},G=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.rowId=e;this.selected=i;this.currentlySelectedRows=r}static{this.EVENT_NAME="yatl-row-select-request"}clone(){return new s(this.rowId,this.selected,this.currentlySelectedRows)}},X=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.selectedIds=e;this.previouslySelectedRows=i}static{this.EVENT_NAME="yatl-row-select"}clone(){return new s(this.selectedIds,this.previouslySelectedRows)}},J=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.field=e;this.order=i;this.multisort=r}static{this.EVENT_NAME="yatl-column-sort-request"}clone(){return new s(this.field,this.order,this.multisort)}},Z=class s extends v{constructor(e,i,r){super(s.EVENT_NAME);this.field=e;this.order=i;this.multisort=r}static{this.EVENT_NAME="yatl-column-sort"}clone(){return new s(this.field,this.order,this.multisort)}},ee=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.field=e;this.visible=i}static{this.EVENT_NAME="yatl-column-toggle"}clone(){return new s(this.field,this.visible)}},te=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.field=e;this.width=i}static{this.EVENT_NAME="yatl-column-resize"}clone(){return new s(this.field,this.width)}},ie=class s extends v{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.movedColumn=e;this.originalIndex=i;this.newIndex=r}static{this.EVENT_NAME="yatl-column-reorder-request"}clone(){return new s(this.movedColumn,this.originalIndex,this.newIndex)}},re=class s extends v{constructor(e){super(s.EVENT_NAME);this.order=e}static{this.EVENT_NAME="yatl-column-reorder"}clone(){return new s(this.order)}},se=class s extends v{constructor(e){super(s.EVENT_NAME);this.query=e}static{this.EVENT_NAME="yatl-table-search"}clone(){return new s(this.query)}},oe=class s extends v{constructor(e){super(s.EVENT_NAME);this.data=e}static{this.EVENT_NAME="yatl-table-view-change"}clone(){return new s(this.data)}},ne=class s extends v{constructor(e,i){super(s.EVENT_NAME);this.state=e;this.triggers=i}static{this.EVENT_NAME="yatl-table-state-change"}clone(){return new s(this.state,this.triggers)}};function hi(s,t){return s.find(e=>e.field===t)}function di(s){return s?.role==="internal"}function M(s){return s?.role!=="internal"}function O(s,t){return{field:s,visible:t?.visible??!0,width:t?.width??null,sort:t?.sort?{...t.sort}:null}}function le(s,t){if(s&&s.field!==t.field)throw Error(`attempting to compare states for different fields: ${s.field}, ${t.field}`);let e=[];return s?.visible!==t.visible&&e.push("visible"),s?.width!==t.width&&e.push("width"),(s?.sort!==t.sort||s.sort?.order!==t.sort?.order||s.sort?.priority!==t.sort?.priority)&&e.push("sort"),e}function ae(s){return typeof s=="string"||typeof s=="number"}function qe(s){return s===null||s==="multi"||s==="single"}function ut(s,t){return s in t}function S(s,t){let e=t.split("."),i=s;for(let r of e)if(i&&ut(r,i))i=i[r];else return;return i}function ui(s,t,e){let i=t.split("."),r=i.at(-1);if(!r)throw new Error("Cannot set nested value with empty path");let o=s;for(let n of i.slice(0,-1))if(ut(n,o))o=o[n];else{let l={};Object.assign(o,{[n]:l}),o=l}Object.assign(o,{[r]:e})}var pt=(s="\\S+")=>{let t=new RegExp(`"[^"]*"|${s}`,"g");return e=>(e.match(t)||[]).map(r=>(r=r.toLocaleLowerCase().trim(),r.startsWith('"')&&r.endsWith('"')?{value:r.slice(1,-1),quoted:!0}:{value:r,quoted:!1}))},Be=pt();var ce=class extends EventTarget{addEventListener(t,e,i){super.addEventListener(t,e,i)}removeEventListener(t,e,i){super.removeEventListener(t,e,i)}dispatchEvent(t){return super.dispatchEvent(t)}};var Ce=globalThis,Ee=Ce.ShadowRoot&&(Ce.ShadyCSS===void 0||Ce.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Ke=Symbol(),ft=new WeakMap,he=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Ke)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(Ee&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=ft.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&ft.set(e,t))}return t}toString(){return this.cssText}},mt=s=>new he(typeof s=="string"?s:s+"",void 0,Ke),We=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,r,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new he(e,s,Ke)},_t=(s,t)=>{if(Ee)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=Ce.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},Qe=Ee?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return mt(e)})(s):s;var{is:pi,defineProperty:fi,getOwnPropertyDescriptor:mi,getOwnPropertyNames:_i,getOwnPropertySymbols:gi,getPrototypeOf:bi}=Object,Te=globalThis,gt=Te.trustedTypes,yi=gt?gt.emptyScript:"",vi=Te.reactiveElementPolyfillSupport,de=(s,t)=>s,ue={toAttribute(s,t){switch(t){case Boolean:s=s?yi:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},xe=(s,t)=>!pi(s,t),bt={attribute:!0,type:String,converter:ue,reflect:!1,useDefault:!1,hasChanged:xe};Symbol.metadata??=Symbol("metadata"),Te.litPropertyMetadata??=new WeakMap;var $=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=bt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&fi(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=mi(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let l=r?.call(this);o?.call(this,n),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??bt}static _$Ei(){if(this.hasOwnProperty(de("elementProperties")))return;let t=bi(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(de("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(de("properties"))){let e=this.properties,i=[..._i(e),...gi(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(Qe(r))}else t!==void 0&&e.push(Qe(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _t(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:ue).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){let i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:ue;this._$Em=r;let l=n.fromAttribute(e,o.type);this[r]=l??this._$Ej?.get(r)??l,this._$Em=null}}requestUpdate(t,e,i,r=!1,o){if(t!==void 0){let n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??xe)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{wrapped:n}=o,l=this[r];n!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,o,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};$.elementStyles=[],$.shadowRootOptions={mode:"open"},$[de("elementProperties")]=new Map,$[de("finalized")]=new Map,vi?.({ReactiveElement:$}),(Te.reactiveElementVersions??=[]).push("2.1.2");var Ge=globalThis,yt=s=>s,Re=Ge.trustedTypes,vt=Re?Re.createPolicy("lit-html",{createHTML:s=>s}):void 0,Xe="$lit$",z=`lit$${Math.random().toFixed(9).slice(2)}$`,Je="?"+z,wi=`<${Je}>`,D=document,fe=()=>D.createComment(""),me=s=>s===null||typeof s!="object"&&typeof s!="function",Ze=Array.isArray,xt=s=>Ze(s)||typeof s?.[Symbol.iterator]=="function",Ye=`[
|
|
2
|
-
\f\r]`,
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ct=/'/g,Et=/"/g,Rt=/^(?:script|style|textarea|title)$/i,et=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),g=et(1),Zi=et(2),er=et(3),w=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Tt=new WeakMap,P=D.createTreeWalker(D,129);function Mt(s,t){if(!Ze(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return vt!==void 0?vt.createHTML(t):t}var $t=(s,t)=>{let e=s.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=pe;for(let l=0;l<e;l++){let a=s[l],c,d,h=-1,u=0;for(;u<a.length&&(n.lastIndex=u,d=n.exec(a),d!==null);)u=n.lastIndex,n===pe?d[1]==="!--"?n=wt:d[1]!==void 0?n=St:d[2]!==void 0?(Rt.test(d[2])&&(r=RegExp("</"+d[2],"g")),n=N):d[3]!==void 0&&(n=N):n===N?d[0]===">"?(n=r??pe,h=-1):d[1]===void 0?h=-2:(h=n.lastIndex-d[2].length,c=d[1],n=d[3]===void 0?N:d[3]==='"'?Et:Ct):n===Et||n===Ct?n=N:n===wt||n===St?n=pe:(n=N,r=void 0);let m=n===N&&s[l+1].startsWith("/>")?" ":"";o+=n===pe?a+wi:h>=0?(i.push(c),a.slice(0,h)+Xe+a.slice(h)+z+m):a+z+(h===-2?l:m)}return[Mt(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},_e=class s{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0,l=t.length-1,a=this.parts,[c,d]=$t(t,e);if(this.el=s.createElement(c,i),P.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(r=P.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(let h of r.getAttributeNames())if(h.endsWith(Xe)){let u=d[n++],m=r.getAttribute(h).split(z),y=/([.?@])?(.*)/.exec(u);a.push({type:1,index:o,name:y[2],strings:m,ctor:y[1]==="."?$e:y[1]==="?"?ze:y[1]==="@"?Ae:L}),r.removeAttribute(h)}else h.startsWith(z)&&(a.push({type:6,index:o}),r.removeAttribute(h));if(Rt.test(r.tagName)){let h=r.textContent.split(z),u=h.length-1;if(u>0){r.textContent=Re?Re.emptyScript:"";for(let m=0;m<u;m++)r.append(h[m],fe()),P.nextNode(),a.push({type:2,index:++o});r.append(h[u],fe())}}}else if(r.nodeType===8)if(r.data===Je)a.push({type:2,index:o});else{let h=-1;for(;(h=r.data.indexOf(z,h+1))!==-1;)a.push({type:7,index:o}),h+=z.length-1}o++}}static createElement(t,e){let i=D.createElement("template");return i.innerHTML=t,i}};function V(s,t,e=s,i){if(t===w)return t;let r=i!==void 0?e._$Co?.[i]:e._$Cl,o=me(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??=[])[i]=r:e._$Cl=r),r!==void 0&&(t=V(s,r._$AS(s,t.values),r,i)),t}var Me=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){let{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??D).importNode(e,!0);P.currentNode=r;let o=P.nextNode(),n=0,l=0,a=i[0];for(;a!==void 0;){if(n===a.index){let c;a.type===2?c=new H(o,o.nextSibling,this,t):a.type===1?c=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(c=new Ie(o,this,t)),this._$AV.push(c),a=i[++l]}n!==a?.index&&(o=P.nextNode(),n++)}return P.currentNode=D,r}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},H=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}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=V(this,t,e),me(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==w&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):xt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==b&&me(this._$AH)?this._$AA.nextSibling.data=t:this.T(D.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=_e.createElement(Mt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{let o=new Me(r,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=Tt.get(t.strings);return e===void 0&&Tt.set(t.strings,e=new _e(t)),e}k(t){Ze(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let o of t)r===e.length?e.push(i=new s(this.O(fe()),this.O(fe()),this,this.options)):i=e[r],i._$AI(o),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let i=yt(t).nextSibling;yt(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},L=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,o){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(t,e=this,i,r){let o=this.strings,n=!1;if(o===void 0)t=V(this,t,e,0),n=!me(t)||t!==this._$AH&&t!==w,n&&(this._$AH=t);else{let l=t,a,c;for(t=o[0],a=0;a<o.length-1;a++)c=V(this,l[i+a],e,a),c===w&&(c=this._$AH[a]),n||=!me(c)||c!==this._$AH[a],c===b?t=b:t!==b&&(t+=(c??"")+o[a+1]),this._$AH[a]=c}n&&!r&&this.j(t)}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},$e=class extends L{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===b?void 0:t}},ze=class extends L{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==b)}},Ae=class extends L{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}_$AI(t,e=this){if((t=V(this,t,e,0)??b)===w)return;let i=this._$AH,r=t===b&&i!==b||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==b&&(i===b||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},Ie=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){V(this,t)}},zt={M:Xe,P:z,A:Je,C:1,L:$t,R:Me,D:xt,V,I:H,H:L,N:ze,U:Ae,B:$e,F:Ie},Si=Ge.litHtmlPolyfillSupport;Si?.(_e,H),(Ge.litHtmlVersions??=[]).push("3.3.2");var At=(s,t,e)=>{let i=e?.renderBefore??t,r=i._$litPart$;if(r===void 0){let o=e?.renderBefore??null;i._$litPart$=r=new H(t.insertBefore(fe(),o),o,void 0,e??{})}return r._$AI(s),r};var tt=globalThis,E=class extends ${constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=At(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return w}};E._$litElement$=!0,E.finalized=!0,tt.litElementHydrateSupport?.({LitElement:E});var Ci=tt.litElementPolyfillSupport;Ci?.({LitElement:E});(tt.litElementVersions??=[]).push("4.2.2");function It(s,t){if(!s||!t||t.length===0)return s;let e=[...t].sort((l,a)=>l[0]-a[0]),i=[],r=e[0];for(let l=1;l<e.length;l++){let a=e[l];a[0]<r[1]?r[1]=Math.max(r[1],a[1]):(i.push(r),r=a)}i.push(r);let o=[],n=0;for(let[l,a]of i){let c=Math.max(0,Math.min(l,s.length)),d=Math.max(0,Math.min(a,s.length));c>n&&o.push(s.slice(n,c)),o.push(g`<mark class="highlight">${s.slice(c,d)}</mark>`),n=d}return n<s.length&&o.push(s.slice(n)),g`${o}`}var Ot=s=>s.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase());var kt=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};var Ei={attribute:!0,type:String,converter:ue,reflect:!1,hasChanged:xe},Ti=(s=Ei,t,e)=>{let{kind:i,metadata:r}=e,o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(e.name,s),i==="accessor"){let{name:n}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(n,a,s,!0,l)},init(l){return l!==void 0&&this.C(n,void 0,s,l),l}}}if(i==="setter"){let{name:n}=e;return function(l){let a=this[n];t.call(this,l),this.requestUpdate(n,a,s,!0,l)}}throw Error("Unsupported decorator location: "+i)};function p(s){return(t,e)=>typeof e=="object"?Ti(s,t,e):((i,r,o)=>{let n=r.hasOwnProperty(o);return r.constructor.createProperty(o,i),n?Object.getOwnPropertyDescriptor(r,o):void 0})(s,t,e)}function Nt(s){return p({...s,state:!0,attribute:!1})}var U=(s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e);function it(s,t){return(e,i,r)=>{let o=n=>n.renderRoot?.querySelector(s)??null;if(t){let{get:n,set:l}=typeof i=="object"?e:r??(()=>{let a=Symbol();return{get(){return this[a]},set(c){this[a]=c}}})();return U(e,i,{get(){let a=n.call(this);return a===void 0&&(a=o(this),(a!==null||this.hasUpdated)&&l.call(this,a)),a}})}return U(e,i,{get(){return o(this)}})}}var x={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},A=s=>(...t)=>({_$litDirective$:s,values:t}),T=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var F=A(class extends T{constructor(s){if(super(s),s.type!==x.ATTRIBUTE||s.name!=="class"||s.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(let i in t)t[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(t)}let e=s.element.classList;for(let i of this.st)i in t||(e.remove(i),this.st.delete(i));for(let i in t){let r=!!t[i];r===this.st.has(i)||this.nt?.has(i)||(r?(e.add(i),this.st.add(i)):(e.remove(i),this.st.delete(i)))}return w}});var ge=s=>s??b;var{I:xi}=zt,Pt=s=>s;var Vt=s=>s.strings===void 0,Dt=()=>document.createComment(""),q=(s,t,e)=>{let i=s._$AA.parentNode,r=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=i.insertBefore(Dt(),r),n=i.insertBefore(Dt(),r);e=new xi(o,n,s,s.options)}else{let o=e._$AB.nextSibling,n=e._$AM,l=n!==s;if(l){let a;e._$AQ?.(s),e._$AM=s,e._$AP!==void 0&&(a=s._$AU)!==n._$AU&&e._$AP(a)}if(o!==r||l){let a=e._$AA;for(;a!==o;){let c=Pt(a).nextSibling;Pt(i).insertBefore(a,r),a=c}}}return e},k=(s,t,e=s)=>(s._$AI(t,e),s),Ri={},Lt=(s,t=Ri)=>s._$AH=t,Ut=s=>s._$AH,Oe=s=>{s._$AR(),s._$AA.remove()};var jt=(s,t,e)=>{let i=new Map;for(let r=t;r<=e;r++)i.set(s[r],r);return i},ke=A(class extends T{constructor(s){if(super(s),s.type!==x.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let r=[],o=[],n=0;for(let l of s)r[n]=i?i(l,n):n,o[n]=e(l,n),n++;return{values:o,keys:r}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){let r=Ut(s),{values:o,keys:n}=this.dt(t,e,i);if(!Array.isArray(r))return this.ut=n,o;let l=this.ut??=[],a=[],c,d,h=0,u=r.length-1,m=0,y=o.length-1;for(;h<=u&&m<=y;)if(r[h]===null)h++;else if(r[u]===null)u--;else if(l[h]===n[m])a[m]=k(r[h],o[m]),h++,m++;else if(l[u]===n[y])a[y]=k(r[u],o[y]),u--,y--;else if(l[h]===n[y])a[y]=k(r[h],o[y]),q(s,a[y+1],r[h]),h++,y--;else if(l[u]===n[m])a[m]=k(r[u],o[m]),q(s,r[h],r[u]),u--,m++;else if(c===void 0&&(c=jt(n,m,y),d=jt(l,h,u)),c.has(l[h]))if(c.has(l[u])){let C=d.get(n[m]),Q=C!==void 0?r[C]:null;if(Q===null){let R=q(s,r[h]);k(R,o[m]),a[m]=R}else a[m]=k(Q,o[m]),q(s,r[h],Q),r[C]=null;m++}else Oe(r[u]),u--;else Oe(r[h]),h++;for(;m<=y;){let C=q(s,a[y+1]);k(C,o[m]),a[m++]=C}for(;h<=u;){let C=r[h++];C!==null&&Oe(C)}return this.ut=n,Lt(s,a),w}});var Ht="important",Mi=" !"+Ht,Ft=A(class extends T{constructor(s){if(super(s),s.type!==x.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((t,e)=>{let i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[t]){let{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(let i in t){let r=t[i];if(r!=null){this.ft.add(i);let o=typeof r=="string"&&r.endsWith(Mi);i.includes("-")||o?e.setProperty(i,o?r.slice(0,-11):r,o?Ht:""):e[i]=r}}return w}});function B(s,t,e,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,i);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(r<3?n(o):r>3?n(t,e,o):n(t,e))||o);return r>3&&o&&Object.defineProperty(t,e,o),o}var be=(s,t)=>{let e=s._$AN;if(e===void 0)return!1;for(let i of e)i._$AO?.(t,!1),be(i,t);return!0},Ne=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while(e?.size===0)},qt=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),Ai(t)}};function $i(s){this._$AN!==void 0?(Ne(this),this._$AM=s,qt(this)):this._$AM=s}function zi(s,t=!1,e=0){let i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let o=e;o<i.length;o++)be(i[o],!1),Ne(i[o]);else i!=null&&(be(i,!1),Ne(i));else be(this,s)}var Ai=s=>{s.type==x.CHILD&&(s._$AP??=zi,s._$AQ??=$i)},Pe=class extends T{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),qt(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(be(this,t),Ne(this))}setValue(t){if(Vt(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var K=class s extends Event{constructor(t){super(s.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};K.eventName="rangeChanged";var W=class s extends Event{constructor(t){super(s.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};W.eventName="visibilityChanged";var ye=class s extends Event{constructor(){super(s.eventName,{bubbles:!1})}};ye.eventName="unpinned";var rt=class{constructor(t){this._element=null;let e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}},De=class extends rt{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);let i=this._node;this._originalScrollTo=i.scrollTo,this._originalScrollBy=i.scrollBy,this._originalScroll=i.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(t,e){let i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;this._scrollTo(i)}scrollBy(t,e){let i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;i.top!==void 0&&(i.top+=this.scrollTop),i.left!==void 0&&(i.left+=this.scrollLeft),this._scrollTo(i)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,i=null){this._end!==null&&this._end(),t.behavior==="smooth"?(this._setDestination(t),this._retarget=e,this._end=i):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:i}=t;return e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),i=i===void 0?void 0:Math.max(0,Math.min(i,this.maxScrollLeft)),this._destination!==null&&i===this._destination.left&&e===this._destination.top?!1:(this.__destination={top:e,left:i,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,i){return this._scrollTo(t,e,i),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){let{scrollTop:t,scrollLeft:e}=this,{top:i,left:r}=this._destination;i=Math.min(i||0,this.maxScrollTop),r=Math.min(r||0,this.maxScrollLeft);let o=Math.abs(i-t),n=Math.abs(r-e);o<1&&n<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}};var Gt=typeof window<"u"?window.ResizeObserver:void 0;var j=Symbol("virtualizerRef"),Ue="virtualizer-sizer",Xt,He=class{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(t.hostElement)this._init(t);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);let e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new Gt(()=>this._hostElementSizeChanged()),this._childrenRO=new Gt(this._childrenSizeChanged.bind(this))}_initHostElement(t){let e=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),e[j]=this}connected(){this._initObservers();let t=this._isScroller;this._clippingAncestors=Vi(this._hostElement,t),this._scrollerController=new De(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){let e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){let t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${Ue}]`);e||(e=document.createElement("div"),e.setAttribute(Ue,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent=" ",e.setAttribute(Ue,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;let e=t.type||Xt;if(typeof e=="function"&&this._layout instanceof e){let i={...t};return delete i.type,this._layout.config=i,!0}return!1}async _initLayout(t){let e,i;if(typeof t.type=="function"){i=t.type;let r={...t};delete r.type,e=r}else e=t;i===void 0&&(Xt=i=(await Promise.resolve().then(()=>(Yt(),Qt))).FlowLayout),this._layout=new i(r=>this._handleLayoutMessage(r),e),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){let t=window.performance.now(),e=t-this._benchmarkStart,r=performance.getEntriesByName("uv-virtualizing","measure").filter(o=>o.startTime>=this._benchmarkStart&&o.startTime<t).reduce((o,n)=>o+n.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:r}}return null}_measureChildren(){let t={},e=this._children,i=this._measureChildOverride||this._measureChild;for(let r=0;r<e.length;r++){let o=e[r],n=this._first+r;(this._itemsChanged||this._toBeMeasured.has(o))&&(t[n]=i.call(this,o,this._items[n]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){let{width:e,height:i}=t.getBoundingClientRect();return Object.assign({width:e,height:i},Pi(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;let{_rangeChanged:e,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){t.type==="scroll"?(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent():console.warn("event not handled",t)}_handleLayoutMessage(t){t.type==="stateChanged"?this._updateDOM(t):t.type==="visibilityChanged"?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):t.type==="unpinned"&&this._hostElement.dispatchEvent(new ye)}get _children(){let t=[],e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(Ue)||t.push(e),e=e.nextElementSibling;return t}_updateView(){let t=this._hostElement,e=this._scrollerController?.element,i=this._layout;if(t&&e&&i){let r,o,n,l,a=t.getBoundingClientRect();r=0,o=0,n=window.innerHeight,l=window.innerWidth;let c=this._clippingAncestors.map(R=>R.getBoundingClientRect());c.unshift(a);for(let R of c)r=Math.max(r,R.top),o=Math.max(o,R.left),n=Math.min(n,R.bottom),l=Math.min(l,R.right);let d=e.getBoundingClientRect(),h={left:a.left-d.left,top:a.top-d.top},u={width:e.scrollWidth,height:e.scrollHeight},m=r-a.top+t.scrollTop,y=o-a.left+t.scrollLeft,C=Math.max(0,n-r),Q=Math.max(0,l-o);i.viewportSize={width:Q,height:C},i.viewportScroll={top:m,left:y},i.totalScrollSize=u,i.offsetWithinScroller=h}}_sizeHostElement(t){let i=t&&t.width!==null?Math.min(82e5,t.width):0,r=t&&t.height!==null?Math.min(82e5,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${r}px)`;else{let o=this._hostElement.style;o.minWidth=i?`${i}px`:"100%",o.minHeight=r?`${r}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:e,left:i,width:r,height:o,xOffset:n,yOffset:l},a)=>{let c=this._children[a-this._first];c&&(c.style.position="absolute",c.style.boxSizing="border-box",c.style.transform=`translate(${i}px, ${e}px)`,r!==void 0&&(c.style.width=r+"px"),o!==void 0&&(c.style.height=o+"px"),c.style.left=n===void 0?null:n+"px",c.style.top=l===void 0?null:l+"px")})}async _adjustRange(t){let{_first:e,_last:i,_firstVisible:r,_lastVisible:o}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==r||this._lastVisible!==o}_correctScrollError(){if(this._scrollError){let{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:i,left:r}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-i,left:e-r})}}element(t){return t===1/0&&(t=this._items.length-1),this._items?.[t]===void 0?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),t.behavior==="smooth"){let e=this._layout.getScrollIntoViewCoordinates(t),{behavior:i}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:i}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){let{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new K({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new W({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(let e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function Pi(s){let t=window.getComputedStyle(s);return{marginTop:je(t.marginTop),marginRight:je(t.marginRight),marginBottom:je(t.marginBottom),marginLeft:je(t.marginLeft)}}function je(s){let t=s?parseFloat(s):NaN;return Number.isNaN(t)?0:t}function Jt(s){if(s.assignedSlot!==null)return s.assignedSlot;if(s.parentElement!==null)return s.parentElement;let t=s.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}function Di(s,t=!1){let e=[],i=t?s:Jt(s);for(;i!==null;)e.push(i),i=Jt(i);return e}function Vi(s,t=!1){let e=!1;return Di(s,t).filter(i=>{if(e)return!1;let r=getComputedStyle(i);return e=r.position==="fixed",r.overflow!=="visible"})}var lt=s=>s,at=(s,t)=>g`${t}: ${JSON.stringify(s,null,2)}`,nt=class extends Pe{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,i)=>at(e,i+this._first),this._keyFunction=(e,i)=>lt(e,i+this._first),this._items=[],t.type!==x.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);let e=[];if(this._first>=0&&this._last>=this._first)for(let i=this._first;i<=this._last;i++)e.push(this._items[i]);return ke(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);let i=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),i?w:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){let r=t.parentNode;this._makeVirtualizer(r,e)}this._virtualizer.items=this._items}_setFunctions(t){let{renderItem:e,keyFunction:i}=t;e&&(this._renderItem=(r,o)=>e(r,o+this._first)),i&&(this._keyFunction=(r,o)=>i(r,o+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();let{layout:i,scroller:r,items:o}=e;this._virtualizer=new He({hostElement:t,layout:i,scroller:r}),this._virtualizer.items=o,this._virtualizer.connected()}_initialize(t,e){let i=t.parentNode;i&&i.nodeType===1&&(i.addEventListener("rangeChanged",r=>{this._first=r.first,this._last=r.last,this.setValue(this.render())}),this._makeVirtualizer(i,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}},Zt=A(nt);var I=class extends E{constructor(){super(...arguments),this.items=[],this.renderItem=at,this.keyFunction=lt,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){let{items:t,renderItem:e,keyFunction:i,layout:r,scroller:o}=this;return g`${Zt({items:t,renderItem:e,keyFunction:i,layout:r,scroller:o})}`}element(t){return this[j]?.element(t)}get layoutComplete(){return this[j]?.layoutComplete}scrollToIndex(t,e="start"){this.element(t)?.scrollIntoView({block:e})}};B([p({attribute:!1})],I.prototype,"items",void 0);B([p()],I.prototype,"renderItem",void 0);B([p()],I.prototype,"keyFunction",void 0);B([p({attribute:!1})],I.prototype,"layout",void 0);B([p({reflect:!0,type:Boolean})],I.prototype,"scroller",void 0);customElements.define("lit-virtualizer",I);function ei(s){return typeof s=="string"||typeof s=="number"||typeof s=="bigint"?s:typeof s=="boolean"?Number(s):s instanceof Date?s.getTime():String(s)}function ti(s,t){let e=Array.from(new Set(s)),i=new Intl.Collator(t,{numeric:!0,sensitivity:"base"});e.sort(([o,n],[l,a])=>{if(n==null&&a==null)return 0;if(n==null)return-1;if(n==null)return 1;let c=ei(n),d=ei(a);return typeof c=="string"&&typeof d=="string"?i.compare(String(c),String(d)):c<d?-1:d<c?1:0});let r=new Map;return e.forEach(([o,n],l)=>r.set(o,l)),r}var Li=1e3,ii={storage:"local",saveColumnSortOrders:!0,saveColumnVisibility:!0,saveColumnWidths:!0,saveColumnOrder:!0,saveSelectedRows:!0},ct={EXACT:100,PREFIX:50,SUBSTRING:10},we=class extends ce{constructor(e,i){super();this.hosts=new Set;this._enableSearchTokenization=!1;this._enableSearchScoring=!1;this._columns=[];this._columnDefinitionMap=new Map;this._columnStateMap=new Map;this._rowSelectionMethod=null;this._selectedRowIds=new Set;this._storageOptions=null;this._rowIdCallback=(e,i)=>"id"in e&&ae(e.id)?e.id:"key"in e&&ae(e.key)?e.key:"_id"in e&&ae(e._id)?e._id:(Ui(),i);this._data=[];this._filteredData=[];this._dataUpdateTimestamp=null;this._searchQuery="";this._searchTokenizer=Be;this._filters=null;this.hasRestoredState=!1;this.saveTimer=0;this.filterDirty=!1;this.sortDirty=!1;this.rowMetadata=new WeakMap;this.idToRowMap=new Map;this.queryTokens=null;e&&this.attach(e),i&&(i.enableSearchScoring!==void 0&&(this.enableSearchScoring=i.enableSearchScoring),i.enableSearchTokenization!==void 0&&(this.enableSearchTokenization=i.enableSearchTokenization),i.searchTokenizer!==void 0&&(this.searchTokenizer=i.searchTokenizer),i.rowIdCallback!==void 0&&(this.rowIdCallback=i.rowIdCallback),i.rowSelectionMethod!==void 0&&(this.rowSelectionMethod=i.rowSelectionMethod),i.storageOptions!==void 0&&(this.storageOptions=i.storageOptions),i.columns!==void 0&&(this.columns=i.columns),i.data!==void 0&&(this.data=i.data))}get enableSearchTokenization(){return this._enableSearchTokenization}set enableSearchTokenization(e){this._enableSearchTokenization!==e&&(this._enableSearchTokenization=e,this.updateInternalQuery(),this.filterDirty=!0,this.requestUpdate("enableSearchTokenization"))}get enableSearchScoring(){return this._enableSearchScoring}set enableSearchScoring(e){this._enableSearchScoring!==e&&(this._enableSearchScoring=e,this.filterDirty=!0,this.requestUpdate("enableSearchScoring"))}get columns(){return[...this._columns]}set columns(e){this._columns=[...e],this.filterDirty=!0,this._columnDefinitionMap=new Map;for(let i of e)this._columnDefinitionMap.set(i.field,i);this.createMetadata(),this.requestUpdate("columns")}get displayColumns(){return this.columns.filter(M)}get columnStates(){return this.columns.map(e=>{let i=this.getColumnState(e.field);return O(e.field,i)})}set columnStates(e){let i=!1;for(let r of e){let o=this.getColumnState(r.field),n=le(o,r);if(n.length){i=!0,n.includes("sort")&&(this.sortDirty=!0);let l=O(r.field,r);this._columnStateMap.set(r.field,l)}}i&&this.requestUpdate("columnStates")}get searchQuery(){return this._searchQuery}set searchQuery(e){this._searchQuery!==e&&(this._searchQuery=e,this.updateInternalQuery(),this.filterDirty=!0,this.requestUpdate("searchQuery"))}get searchTokenizer(){return this._searchTokenizer}set searchTokenizer(e){this._searchTokenizer!==e&&(this._searchTokenizer=e,this.filterDirty=!0,this.requestUpdate("searchTokenizer"))}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=e,this.filterDirty=!0,this.requestUpdate("filters"))}get rowSelectionMethod(){return this._rowSelectionMethod}set rowSelectionMethod(e){this._rowSelectionMethod===e||!qe(e)||(this._rowSelectionMethod=e,this.requestUpdate("rowSelectionMethod"))}get selectedRowIds(){let e=[...this._selectedRowIds];return this.rowSelectionMethod==="single"?e=e.slice(0,1):this.rowSelectionMethod||(e=[]),e}set selectedRowIds(e){e.length===this._selectedRowIds.size&&e.every(i=>this._selectedRowIds.has(i))||(this._selectedRowIds=new Set(e),this.requestUpdate("selectedRowIds"))}get storageOptions(){return this._storageOptions?{...this._storageOptions}:null}set storageOptions(e){this._storageOptions!==e&&(this._storageOptions=e?{...e}:null,this.hasRestoredState||(this.loadStateFromStorage(),this.requestUpdate("storageOptions")))}get rowIdCallback(){return this._rowIdCallback}set rowIdCallback(e){if(this._rowIdCallback!==e){this._rowIdCallback=e;for(let i=0;i<this.data.length;++i){let r=this.data[i];this.rowMetadata.get(r).id=this._rowIdCallback(r,i)}this.requestUpdate("rowIdCallback")}}get data(){return[...this._data]}set data(e){this._data=[...e],this.createMetadata(),this._dataUpdateTimestamp=new Date,this.filterDirty=!0,this.requestUpdate("data")}get filteredData(){return this.filterDirty?this.filterRows():this.sortDirty&&this.sortRows(),this.filterDirty=!1,this.sortDirty=!1,[...this._filteredData]}get dataUpdateTimestamp(){return this._dataUpdateTimestamp}attach(e){this.hosts.add(e),e.addController(this),e.requestUpdate()}detach(e){e.removeController(this),this.hosts.delete(e)}getColumn(e){return this._columnDefinitionMap.get(e)}getDisplayColumn(e){let i=this._columnDefinitionMap.get(e);if(M(i))return i}getTableState(){return{searchQuery:this.searchQuery,selectedRows:this.selectedRowIds,columns:this.columnStates.map(e=>{let i=this.getColumnState(e.field);return O(e.field,i)})}}updateTableState(e){if("searchQuery"in e&&e.searchQuery!==void 0&&(this.searchQuery=e.searchQuery),"selectedRows"in e&&e.selectedRows&&(this.selectedRowIds=e.selectedRows),"columns"in e&&e.columns!==void 0)for(let i of e.columns)this.updateColumnState(i.field,i);this.requestUpdate()}getColumnState(e){let i=this._columnStateMap.get(e);if(!i){let r=O(e);return this._columnStateMap.set(e,r),r}return O(e,i)}updateColumnState(e,i){let r=this._columnStateMap.get(e),o=O(e,{...r,...i});this.columnStates=[o]}search(e){this.searchQuery=e,this.dispatchEvent(new se(e))}getColumnFilterValues(e,i=!1){let r=this.getDisplayColumn(e),o=new Map;for(let n of this.filteredData){let l=S(n,e);if(r?.valueFormatter&&(l=r.valueFormatter(l,n)),l!=null||i){let a=o.get(l)??0;o.set(l,a+1)}}return o}sort(e,i,r=!0){let o=this.getColumnState(e);if(o===void 0)throw new Error(`Cannot get options for non-existent column "${e}"`);if(i===o?.sort?.order)return;if(i&&!o.sort){let a=[...this._columnStateMap.values()].map(h=>h.sort?.priority).filter(h=>h!==void 0),c=this.columns.length+1,d=Math.min(c,...a)-1;o.sort={order:i,priority:d}}else i&&o.sort?o.sort.order=i:o.sort=null;let n=[o];if(r){for(let a of this.columns)if(a.field!==e){let c=this.getColumnState(a.field);c.sort=null,n.push(c)}}this.columnStates=n;let l=new Z(e,i,!r);this.dispatchEvent(l)}toggleColumnVisibility(e,i){let r=this.getColumnState(e),o=i!==void 0?i:!r.visible;if(o===r.visible)return;r.visible=o,this.columnStates=[r];let n=new ee(e,o);this.dispatchEvent(n)}showColumn(e){this.toggleColumnVisibility(e,!0)}hideColumn(e){this.toggleColumnVisibility(e,!1)}moveColumn(e,i){let r=this.displayColumns,o=r.findIndex(l=>l.field===e),n=typeof i=="number"?i:r.findIndex(l=>l.field===i);if(o>-1&&n>-1){let[l]=r.splice(o,1);r.splice(n,0,l),this.columns=r;let a=new re(r.map(c=>c.field));this.dispatchEvent(a)}}resizeColumn(e,i){let r=this.getColumnState(e);r.width=i,this.updateColumnState(e,r),this.dispatchEvent(new te(e,i))}isRowSelected(e){let i=this.getRowId(e);return this.selectedRowIds.includes(i)}toggleRowSelection(e,i){let r=this.getRowId(e),o=this.isRowSelected(e),n=i!==void 0?i:o;if(n===o)return;let l;n?l=this.rowSelectionMethod==="single"?[r]:[...this.selectedRowIds,r]:l=this.selectedRowIds.filter(d=>d!==r);let a=this.selectedRowIds;this.selectedRowIds=l;let c=new X(l,a);this.dispatchEvent(c)}selectRow(e){this.toggleRowSelection(e,!0)}deselectRow(e){this.toggleRowSelection(e,!1)}selectAll(){if(this.rowSelectionMethod==="single")return;let e=this.filteredData.map(i=>this.getRowId(i));this.selectedRowIds=e}deselectAll(){this.selectedRowIds=[]}export(e={includeAllRows:!1,includeHiddenColumns:!1,includeInternalColumns:!1}){let i=e.includeAllRows?this.data:this.filteredData,r=e.includeInternalColumns?this.columns:this.displayColumns,o=r.filter(a=>e.includeHiddenColumns?!0:this.getColumnState(a.field).visible).map(a=>M(a)?a.title:a.field).join(","),n=i.map(a=>{let c=[];for(let d of r){let h=this.getColumnState(d.field),u=S(a,d.field);(e.includeHiddenColumns||h.visible)&&(M(d)&&typeof d.valueFormatter=="function"&&(u=d.valueFormatter(u,a)),u=String(u).replace('"','""'),c.push(`"${u}"`))}return c.join(",")}).join(`
|
|
1
|
+
"use strict";var yatl=(()=>{var Re=Object.defineProperty;var St=Object.getOwnPropertyDescriptor;var mi=Object.getOwnPropertyNames;var _i=Object.prototype.hasOwnProperty;var Xe=(s,t)=>()=>(s&&(t=s(s=0)),t);var Et=(s,t)=>{for(var e in t)Re(s,e,{get:t[e],enumerable:!0})},gi=(s,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of mi(t))!_i.call(s,r)&&r!==e&&Re(s,r,{get:()=>t[r],enumerable:!(i=St(t,r))||i.enumerable});return s};var bi=s=>gi(Re({},"__esModule",{value:!0}),s),g=(s,t,e,i)=>{for(var r=i>1?void 0:i?St(t,e):t,o=s.length-1,n;o>=0;o--)(n=s[o])&&(r=(i?n(t,e,r):n(r))||r);return i&&r&&Re(t,e,r),r};var Te,ei=Xe(()=>{"use strict";Te=class{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,t?.roundAverageSize===!0&&(this._roundAverageSize=!0)}set(t,e){let i=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-i}get averageSize(){if(this._map.size>0){let t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}});function _t(s){return s==="horizontal"?"width":"height"}var qe,ti=Xe(()=>{"use strict";qe=class{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){t=t==="horizontal"?t:"vertical",t!==this._direction&&(this._direction=t,this._sizeDim=t==="horizontal"?"width":"height",this._secondarySizeDim=t==="horizontal"?"height":"width",this._positionDim=t==="horizontal"?"left":"top",this._secondaryPositionDim=t==="horizontal"?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){let{_viewDim1:e,_viewDim2:i}=this;Object.assign(this._viewportSize,t),i!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);let e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim],Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(this._pin!==null){let{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[_t(this.direction)]-this._viewDim1))}unpin(){this._pin!==null&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(this.pin!==null){let t=this._scrollPosition,{index:e,block:i}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:i||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){let{block:e}=t,i=Math.min(this.items.length,Math.max(0,t.index)),r=this._getItemPosition(i)[this._positionDim],o=r;if(e!=="start"){let n=this._getItemSize(i)[this._sizeDim];if(e==="center")o=r-.5*this._viewDim1+.5*n;else{let l=r-this._viewDim1+n;if(e==="end")o=l;else{let a=this._scrollPosition;o=Math.abs(a-r)<Math.abs(a-l)?r:l}}}return o+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(o)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){let t=new Map;if(this._first!==-1&&this._last!==-1)for(let i=this._first;i<=this._last;i++)t.set(i,this._getItemPosition(i));let e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return this._first===-1||this._last===-1?0:this._last-this._first+1}_checkThresholds(){if(this._viewDim1===0&&this._num>0||this._pin!==null)this._scheduleReflow();else{let t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(this._first===-1||this._last===-1)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let i=this._last;for(;i>this._first&&Math.round(this._getItemPosition(i)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)i--;(e!==this._firstVisible||i!==this._lastVisible)&&(this._firstVisible=e,this._lastVisible=i,t&&t.emit&&this._sendVisibilityChangedMessage())}}});var ri={};Et(ri,{FlowLayout:()=>We,flow:()=>Ui});function ii(s){return s==="horizontal"?"marginLeft":"marginTop"}function ji(s){return s==="horizontal"?"marginRight":"marginBottom"}function Hi(s){return s==="horizontal"?"xOffset":"yOffset"}function Bi(s,t){let e=[s,t].sort();return e[1]<=0?Math.min(...e):e[0]>=0?Math.max(...e):e[0]+e[1]}var Ui,gt,We,si=Xe(()=>{"use strict";ei();ti();Ui=s=>Object.assign({type:We},s);gt=class{constructor(){this._childSizeCache=new Te,this._marginSizeCache=new Te,this._metricsCache=new Map}update(t,e){let i=new Set;Object.keys(t).forEach(r=>{let o=Number(r);this._metricsCache.set(o,t[o]),this._childSizeCache.set(o,t[o][_t(e)]),i.add(o),i.add(o+1)});for(let r of i){let o=this._metricsCache.get(r)?.[ii(e)]||0,n=this._metricsCache.get(r-1)?.[ji(e)]||0;this._marginSizeCache.set(r,Bi(o,n))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[ii(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}},We=class extends qe{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new gt,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){let e=this._metricsCache;if(this._first===-1||this._last===-1)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){let i=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(i*e.averageChildSize+(i-1)*e.averageMarginSize)}else{let i=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+i*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){let e=this._getPhysicalItem(t),{averageMarginSize:i}=this._metricsCache;return t===0?this._metricsCache.getMarginSize(0)??i:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(this._physicalItems.size===0)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);let i=this._getPhysicalItem(this._first),r=this._getPhysicalItem(this._last),o=i.pos;if(r.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(o>e)return this._calculateAnchor(t,e);let a=this._firstVisible-1,c=-1/0;for(;c<t;)c=this._getPhysicalItem(++a).pos+this._metricsCache.getChildSize(a);return a}_getActiveItems(){this._viewDim1===0||this.items.length===0?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;let t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){let t=this._newPhysicalItems;this._stable=!0;let e,i;if(this.pin!==null){let{index:c}=this.pin;this._anchorIdx=c,this._anchorPos=this._getPosition(c)}if(e=this._scrollPosition-this._overhang,i=this._scrollPosition+this._viewDim1+this._overhang,i<0||e>this._scrollSize){this._clearItems();return}(this._anchorIdx===null||this._anchorPos===null)&&(this._anchorIdx=this._getAnchor(e,i),this._anchorPos=this._getPosition(this._anchorIdx));let r=this._getSize(this._anchorIdx);r===void 0&&(this._stable=!1,r=this._getAverageSize());let o=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,n=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;this._anchorIdx===0&&(this._anchorPos=o),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-n-r);let l=0;for(this._anchorPos+r+n<e&&(l=e-(this._anchorPos+r+n)),this._anchorPos-o>i&&(l=i-(this._anchorPos-o)),l&&(this._scrollPosition-=l,e-=l,i-=l,this._scrollError+=l),t.set(this._anchorIdx,{pos:this._anchorPos,size:r}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-o,this._physicalMax=this._anchorPos+r+n;this._physicalMin>e&&this._first>0;){let c=this._getSize(--this._first);c===void 0&&(this._stable=!1,c=this._getAverageSize());let h=this._metricsCache.getMarginSize(this._first);h===void 0&&(this._stable=!1,h=this._metricsCache.averageMarginSize),this._physicalMin-=c;let d=this._physicalMin;if(t.set(this._first,{pos:d,size:c}),this._physicalMin-=h,this._stable===!1&&this._estimate===!1)break}for(;this._physicalMax<i&&this._last<this.items.length-1;){let c=this._getSize(++this._last);c===void 0&&(this._stable=!1,c=this._getAverageSize());let h=this._metricsCache.getMarginSize(this._last);h===void 0&&(this._stable=!1,h=this._metricsCache.averageMarginSize);let d=this._physicalMax;if(t.set(this._last,{pos:d,size:c}),this._physicalMax+=c+h,!this._stable&&!this._estimate)break}let a=this._calculateError();a&&(this._physicalMin-=a,this._physicalMax-=a,this._anchorPos-=a,this._scrollPosition-=a,t.forEach(c=>c.pos-=a),this._scrollError+=a),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return this._first===0?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){let{_first:t,_last:e}=this;super._reflow(),(this._first===-1&&this._last==-1||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){let{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){let{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[Hi(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}});var Gi={};Et(Gi,{InputEditor:()=>H,NumberEditor:()=>at,SelectEditor:()=>ct,TextEditor:()=>ht,TypedEventTarget:()=>Se,YatlCellEditEvent:()=>ce,YatlColumnReorderEvent:()=>ae,YatlColumnReorderRequest:()=>le,YatlColumnResizeEvent:()=>ne,YatlColumnSortEvent:()=>se,YatlColumnSortRequest:()=>re,YatlColumnToggleEvent:()=>oe,YatlEvent:()=>A,YatlRowClickEvent:()=>ee,YatlRowSelectEvent:()=>ie,YatlRowSelectRequest:()=>te,YatlTable:()=>u,YatlTableController:()=>xe,YatlTableControllerEvent:()=>E,YatlTableSearchEvent:()=>he,YatlTableStateChangeEvent:()=>ue,YatlTableViewChangeEvent:()=>de,createRegexTokenizer:()=>Wt,createState:()=>P,findColumn:()=>Oi,getColumnStateChanges:()=>ve,getNestedValue:()=>C,isDisplayColumn:()=>I,isInternalColumn:()=>Ii,isRowIdType:()=>we,isRowSelectionMethod:()=>dt,setNestedValue:()=>ut,whitespaceTokenizer:()=>pt});var A=class extends Event{constructor(t,e={}){super(t,{bubbles:!0,composed:!0,cancelable:!1,...e})}},E=class extends A{},ee=class s extends A{constructor(e,i,r,o,n){super(s.EVENT_NAME);this.row=e;this.rowId=i;this.index=r;this.field=o;this.originalEvent=n}static{this.EVENT_NAME="yatl-row-click"}},te=class s extends A{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.rowId=e;this.selected=i;this.currentlySelectedRows=r}static{this.EVENT_NAME="yatl-row-select-request"}},ie=class s extends E{constructor(e,i){super(s.EVENT_NAME);this.selectedIds=e;this.previouslySelectedRows=i}static{this.EVENT_NAME="yatl-row-select"}clone(){return new s(this.selectedIds,this.previouslySelectedRows)}},re=class s extends A{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.field=e;this.order=i;this.multisort=r}static{this.EVENT_NAME="yatl-column-sort-request"}},se=class s extends E{constructor(e,i,r){super(s.EVENT_NAME);this.field=e;this.order=i;this.multisort=r}static{this.EVENT_NAME="yatl-column-sort"}clone(){return new s(this.field,this.order,this.multisort)}},oe=class s extends E{constructor(e,i){super(s.EVENT_NAME);this.field=e;this.visible=i}static{this.EVENT_NAME="yatl-column-toggle"}clone(){return new s(this.field,this.visible)}},ne=class s extends E{constructor(e,i){super(s.EVENT_NAME);this.field=e;this.width=i}static{this.EVENT_NAME="yatl-column-resize"}clone(){return new s(this.field,this.width)}},le=class s extends A{constructor(e,i,r){super(s.EVENT_NAME,{cancelable:!0});this.movedColumn=e;this.originalIndex=i;this.newIndex=r}static{this.EVENT_NAME="yatl-column-reorder-request"}},ae=class s extends E{constructor(e){super(s.EVENT_NAME);this.order=e}static{this.EVENT_NAME="yatl-column-reorder"}clone(){return new s(this.order)}},ce=class s extends A{constructor(e,i,r,o,n){super(s.EVENT_NAME);this.row=e;this.rowId=i;this.field=r;this.originalValue=o;this.currentValue=n}static{this.EVENT_NAME="yatl-cell-edit"}},he=class s extends E{constructor(e){super(s.EVENT_NAME);this.query=e}static{this.EVENT_NAME="yatl-table-search"}clone(){return new s(this.query)}},de=class s extends E{constructor(e){super(s.EVENT_NAME);this.data=e}static{this.EVENT_NAME="yatl-table-view-change"}clone(){return new s(this.data)}},ue=class s extends E{constructor(e,i){super(s.EVENT_NAME);this.state=e;this.triggers=i}static{this.EVENT_NAME="yatl-table-state-change"}clone(){return new s(this.state,this.triggers)}};var Me=globalThis,$e=Me.ShadowRoot&&(Me.ShadyCSS===void 0||Me.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Je=Symbol(),Ct=new WeakMap,pe=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Je)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($e&&t===void 0){let i=e!==void 0&&e.length===1;i&&(t=Ct.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Ct.set(e,t))}return t}toString(){return this.cssText}},Tt=s=>new pe(typeof s=="string"?s:s+"",void 0,Je),Ze=(s,...t)=>{let e=s.length===1?s[0]:t.reduce((i,r,o)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+s[o+1],s[0]);return new pe(e,s,Je)},xt=(s,t)=>{if($e)s.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of t){let i=document.createElement("style"),r=Me.litNonce;r!==void 0&&i.setAttribute("nonce",r),i.textContent=e.cssText,s.appendChild(i)}},et=$e?s=>s:s=>s instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return Tt(e)})(s):s;var{is:yi,defineProperty:vi,getOwnPropertyDescriptor:wi,getOwnPropertyNames:Si,getOwnPropertySymbols:Ei,getPrototypeOf:Ci}=Object,Ae=globalThis,Rt=Ae.trustedTypes,Ti=Rt?Rt.emptyScript:"",xi=Ae.reactiveElementPolyfillSupport,fe=(s,t)=>s,me={toAttribute(s,t){switch(t){case Boolean:s=s?Ti:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,t){let e=s;switch(t){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},ze=(s,t)=>!yi(s,t),Mt={attribute:!0,type:String,converter:me,reflect:!1,useDefault:!1,hasChanged:ze};Symbol.metadata??=Symbol("metadata"),Ae.litPropertyMetadata??=new WeakMap;var z=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=Mt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){let i=Symbol(),r=this.getPropertyDescriptor(t,i,e);r!==void 0&&vi(this.prototype,t,r)}}static getPropertyDescriptor(t,e,i){let{get:r,set:o}=wi(this.prototype,t)??{get(){return this[e]},set(n){this[e]=n}};return{get:r,set(n){let l=r?.call(this);o?.call(this,n),this.requestUpdate(t,l,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Mt}static _$Ei(){if(this.hasOwnProperty(fe("elementProperties")))return;let t=Ci(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(fe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(fe("properties"))){let e=this.properties,i=[...Si(e),...Ei(e)];for(let r of i)this.createProperty(r,e[r])}let t=this[Symbol.metadata];if(t!==null){let e=litPropertyMetadata.get(t);if(e!==void 0)for(let[i,r]of e)this.elementProperties.set(i,r)}this._$Eh=new Map;for(let[e,i]of this.elementProperties){let r=this._$Eu(e,i);r!==void 0&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let r of i)e.unshift(et(r))}else t!==void 0&&e.push(et(t));return e}static _$Eu(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),this.renderRoot!==void 0&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){let t=new Map,e=this.constructor.elementProperties;for(let i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){let t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xt(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){let i=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,i);if(r!==void 0&&i.reflect===!0){let o=(i.converter?.toAttribute!==void 0?i.converter:me).toAttribute(e,i.type);this._$Em=t,o==null?this.removeAttribute(r):this.setAttribute(r,o),this._$Em=null}}_$AK(t,e){let i=this.constructor,r=i._$Eh.get(t);if(r!==void 0&&this._$Em!==r){let o=i.getPropertyOptions(r),n=typeof o.converter=="function"?{fromAttribute:o.converter}:o.converter?.fromAttribute!==void 0?o.converter:me;this._$Em=r;let l=n.fromAttribute(e,o.type);this[r]=l??this._$Ej?.get(r)??l,this._$Em=null}}requestUpdate(t,e,i,r=!1,o){if(t!==void 0){let n=this.constructor;if(r===!1&&(o=this[t]),i??=n.getPropertyOptions(t),!((i.hasChanged??ze)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(n._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:r,wrapped:o},n){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),o!==!0||n!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),r===!0&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[r,o]of this._$Ep)this[r]=o;this._$Ep=void 0}let i=this.constructor.elementProperties;if(i.size>0)for(let[r,o]of i){let{wrapped:n}=o,l=this[r];n!==!0||this._$AL.has(r)||l===void 0||this.C(r,void 0,o,l)}}let t=!1,e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(i=>i.hostUpdate?.()),this.update(e)):this._$EM()}catch(i){throw t=!1,this._$EM(),i}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(t){}firstUpdated(t){}};z.elementStyles=[],z.shadowRootOptions={mode:"open"},z[fe("elementProperties")]=new Map,z[fe("finalized")]=new Map,xi?.({ReactiveElement:z}),(Ae.reactiveElementVersions??=[]).push("2.1.2");var it=globalThis,$t=s=>s,Oe=it.trustedTypes,At=Oe?Oe.createPolicy("lit-html",{createHTML:s=>s}):void 0,rt="$lit$",O=`lit$${Math.random().toFixed(9).slice(2)}$`,st="?"+O,Ri=`<${st}>`,L=document,ge=()=>L.createComment(""),be=s=>s===null||typeof s!="object"&&typeof s!="function",ot=Array.isArray,Pt=s=>ot(s)||typeof s?.[Symbol.iterator]=="function",tt=`[
|
|
2
|
+
\f\r]`,_e=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zt=/-->/g,Ot=/>/g,D=RegExp(`>|${tt}(?:([^\\s"'>=/]+)(${tt}*=${tt}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),It=/'/g,kt=/"/g,Dt=/^(?:script|style|textarea|title)$/i,nt=s=>(t,...e)=>({_$litType$:s,strings:t,values:e}),f=nt(1),rr=nt(2),sr=nt(3),v=Symbol.for("lit-noChange"),b=Symbol.for("lit-nothing"),Nt=new WeakMap,V=L.createTreeWalker(L,129);function Vt(s,t){if(!ot(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return At!==void 0?At.createHTML(t):t}var Lt=(s,t)=>{let e=s.length-1,i=[],r,o=t===2?"<svg>":t===3?"<math>":"",n=_e;for(let l=0;l<e;l++){let a=s[l],c,h,d=-1,p=0;for(;p<a.length&&(n.lastIndex=p,h=n.exec(a),h!==null);)p=n.lastIndex,n===_e?h[1]==="!--"?n=zt:h[1]!==void 0?n=Ot:h[2]!==void 0?(Dt.test(h[2])&&(r=RegExp("</"+h[2],"g")),n=D):h[3]!==void 0&&(n=D):n===D?h[0]===">"?(n=r??_e,d=-1):h[1]===void 0?d=-2:(d=n.lastIndex-h[2].length,c=h[1],n=h[3]===void 0?D:h[3]==='"'?kt:It):n===kt||n===It?n=D:n===zt||n===Ot?n=_e:(n=D,r=void 0);let _=n===D&&s[l+1].startsWith("/>")?" ":"";o+=n===_e?a+Ri:d>=0?(i.push(c),a.slice(0,d)+rt+a.slice(d)+O+_):a+O+(d===-2?l:_)}return[Vt(s,o+(s[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]},ye=class s{constructor({strings:t,_$litType$:e},i){let r;this.parts=[];let o=0,n=0,l=t.length-1,a=this.parts,[c,h]=Lt(t,e);if(this.el=s.createElement(c,i),V.currentNode=this.el.content,e===2||e===3){let d=this.el.content.firstChild;d.replaceWith(...d.childNodes)}for(;(r=V.nextNode())!==null&&a.length<l;){if(r.nodeType===1){if(r.hasAttributes())for(let d of r.getAttributeNames())if(d.endsWith(rt)){let p=h[n++],_=r.getAttribute(d).split(O),y=/([.?@])?(.*)/.exec(p);a.push({type:1,index:o,name:y[2],strings:_,ctor:y[1]==="."?ke:y[1]==="?"?Ne:y[1]==="@"?Pe:j}),r.removeAttribute(d)}else d.startsWith(O)&&(a.push({type:6,index:o}),r.removeAttribute(d));if(Dt.test(r.tagName)){let d=r.textContent.split(O),p=d.length-1;if(p>0){r.textContent=Oe?Oe.emptyScript:"";for(let _=0;_<p;_++)r.append(d[_],ge()),V.nextNode(),a.push({type:2,index:++o});r.append(d[p],ge())}}}else if(r.nodeType===8)if(r.data===st)a.push({type:2,index:o});else{let d=-1;for(;(d=r.data.indexOf(O,d+1))!==-1;)a.push({type:7,index:o}),d+=O.length-1}o++}}static createElement(t,e){let i=L.createElement("template");return i.innerHTML=t,i}};function U(s,t,e=s,i){if(t===v)return t;let r=i!==void 0?e._$Co?.[i]:e._$Cl,o=be(t)?void 0:t._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),o===void 0?r=void 0:(r=new o(s),r._$AT(s,e,i)),i!==void 0?(e._$Co??=[])[i]=r:e._$Cl=r),r!==void 0&&(t=U(s,r._$AS(s,t.values),r,i)),t}var Ie=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){let{el:{content:e},parts:i}=this._$AD,r=(t?.creationScope??L).importNode(e,!0);V.currentNode=r;let o=V.nextNode(),n=0,l=0,a=i[0];for(;a!==void 0;){if(n===a.index){let c;a.type===2?c=new q(o,o.nextSibling,this,t):a.type===1?c=new a.ctor(o,a.name,a.strings,this,t):a.type===6&&(c=new De(o,this,t)),this._$AV.push(c),a=i[++l]}n!==a?.index&&(o=V.nextNode(),n++)}return V.currentNode=L,r}p(t){let e=0;for(let i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},q=class s{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,r){this.type=2,this._$AH=b,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}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=U(this,t,e),be(t)?t===b||t==null||t===""?(this._$AH!==b&&this._$AR(),this._$AH=b):t!==this._$AH&&t!==v&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):Pt(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==b&&be(this._$AH)?this._$AA.nextSibling.data=t:this.T(L.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:i}=t,r=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=ye.createElement(Vt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(e);else{let o=new Ie(r,this),n=o.u(this.options);o.p(e),this.T(n),this._$AH=o}}_$AC(t){let e=Nt.get(t.strings);return e===void 0&&Nt.set(t.strings,e=new ye(t)),e}k(t){ot(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,r=0;for(let o of t)r===e.length?e.push(i=new s(this.O(ge()),this.O(ge()),this,this.options)):i=e[r],i._$AI(o),r++;r<e.length&&(this._$AR(i&&i._$AB.nextSibling,r),e.length=r)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let i=$t(t).nextSibling;$t(t).remove(),t=i}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}},j=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,r,o){this.type=1,this._$AH=b,this._$AN=void 0,this.element=t,this.name=e,this._$AM=r,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=b}_$AI(t,e=this,i,r){let o=this.strings,n=!1;if(o===void 0)t=U(this,t,e,0),n=!be(t)||t!==this._$AH&&t!==v,n&&(this._$AH=t);else{let l=t,a,c;for(t=o[0],a=0;a<o.length-1;a++)c=U(this,l[i+a],e,a),c===v&&(c=this._$AH[a]),n||=!be(c)||c!==this._$AH[a],c===b?t=b:t!==b&&(t+=(c??"")+o[a+1]),this._$AH[a]=c}n&&!r&&this.j(t)}j(t){t===b?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},ke=class extends j{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===b?void 0:t}},Ne=class extends j{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==b)}},Pe=class extends j{constructor(t,e,i,r,o){super(t,e,i,r,o),this.type=5}_$AI(t,e=this){if((t=U(this,t,e,0)??b)===v)return;let i=this._$AH,r=t===b&&i!==b||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==b&&(i===b||r);r&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}},De=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){U(this,t)}},Ut={M:rt,P:O,A:st,C:1,L:Lt,R:Ie,D:Pt,V:U,I:q,H:j,N:Ne,U:Pe,B:ke,F:De},Mi=it.litHtmlPolyfillSupport;Mi?.(ye,q),(it.litHtmlVersions??=[]).push("3.3.2");var jt=(s,t,e)=>{let i=e?.renderBefore??t,r=i._$litPart$;if(r===void 0){let o=e?.renderBefore??null;i._$litPart$=r=new q(t.insertBefore(ge(),o),o,void 0,e??{})}return r._$AI(s),r};var lt=globalThis,M=class extends z{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=jt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return v}};M._$litElement$=!0,M.finalized=!0,lt.litElementHydrateSupport?.({LitElement:M});var $i=lt.litElementPolyfillSupport;$i?.({LitElement:M});(lt.litElementVersions??=[]).push("4.2.2");var S=s=>s??b;var w={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},R=s=>(...t)=>({_$litDirective$:s,values:t}),T=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};var{I:Ai}=Ut,Ht=s=>s;var Ve=s=>s.strings===void 0,Bt=()=>document.createComment(""),W=(s,t,e)=>{let i=s._$AA.parentNode,r=t===void 0?s._$AB:t._$AA;if(e===void 0){let o=i.insertBefore(Bt(),r),n=i.insertBefore(Bt(),r);e=new Ai(o,n,s,s.options)}else{let o=e._$AB.nextSibling,n=e._$AM,l=n!==s;if(l){let a;e._$AQ?.(s),e._$AM=s,e._$AP!==void 0&&(a=s._$AU)!==n._$AU&&e._$AP(a)}if(o!==r||l){let a=e._$AA;for(;a!==o;){let c=Ht(a).nextSibling;Ht(i).insertBefore(a,r),a=c}}}return e},N=(s,t,e=s)=>(s._$AI(t,e),s),zi={},Le=(s,t=zi)=>s._$AH=t,Kt=s=>s._$AH,Ue=s=>{s._$AR(),s._$AA.remove()};var je=R(class extends T{constructor(s){if(super(s),s.type!==w.PROPERTY&&s.type!==w.ATTRIBUTE&&s.type!==w.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ve(s))throw Error("`live` bindings can only contain a single expression")}render(s){return s}update(s,[t]){if(t===v||t===b)return t;let e=s.element,i=s.name;if(s.type===w.PROPERTY){if(t===e[i])return v}else if(s.type===w.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(i))return v}else if(s.type===w.ATTRIBUTE&&e.getAttribute(i)===t+"")return v;return Le(s),t}});var Q=class{constructor(t){this.options=t}reset(){this.currentValue=void 0}canEdit(t,e){return this.options?.canEdit?.(t,e)??!0}save(t,e,i,r){if(!(this.currentValue===void 0||this.currentValue===t))return this.options?.onSave?this.options.onSave(t,this.currentValue,e,i):this.currentValue}};var H=class extends Q{constructor(e){super(e);this.options=e;this.handleChange=e=>{let i=e.target,{type:r,max:o,min:n}=this.options??{};if(r==="checkbox")this.currentValue=i.checked;else if(r==="date"||r==="datetime-local")this.currentValue=i.valueAsDate;else if(r==="number"){let l=i.valueAsNumber;isNaN(l)?l=null:(typeof o=="number"&&l>o?(i.valueAsNumber=o,l=o):typeof n=="number"&&l<n&&(i.valueAsNumber=n,l=n),this.currentValue=l)}else this.currentValue=i.value}}render(e,i,r,o){return f`
|
|
4
|
+
<input
|
|
5
|
+
.value=${je(String(e??""))}
|
|
6
|
+
type=${S(this.options?.type)}
|
|
7
|
+
minlength=${S(this.options?.minlength)}
|
|
8
|
+
maxlength=${S(this.options?.maxlength)}
|
|
9
|
+
min=${S(this.options?.min)}
|
|
10
|
+
max=${S(this.options?.max)}
|
|
11
|
+
step=${S(this.options?.step)}
|
|
12
|
+
pattern=${S(this.options?.pattern)}
|
|
13
|
+
placeholder=${S(this.options?.placeholder)}
|
|
14
|
+
autofocus
|
|
15
|
+
@input=${this.handleChange}
|
|
16
|
+
/>
|
|
17
|
+
`}};var at=class extends H{constructor(t){super({type:"number",...t})}};var Ft=(s,t,e)=>{let i=new Map;for(let r=t;r<=e;r++)i.set(s[r],r);return i},Y=R(class extends T{constructor(s){if(super(s),s.type!==w.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,t,e){let i;e===void 0?e=t:t!==void 0&&(i=t);let r=[],o=[],n=0;for(let l of s)r[n]=i?i(l,n):n,o[n]=e(l,n),n++;return{values:o,keys:r}}render(s,t,e){return this.dt(s,t,e).values}update(s,[t,e,i]){let r=Kt(s),{values:o,keys:n}=this.dt(t,e,i);if(!Array.isArray(r))return this.ut=n,o;let l=this.ut??=[],a=[],c,h,d=0,p=r.length-1,_=0,y=o.length-1;for(;d<=p&&_<=y;)if(r[d]===null)d++;else if(r[p]===null)p--;else if(l[d]===n[_])a[_]=N(r[d],o[_]),d++,_++;else if(l[p]===n[y])a[y]=N(r[p],o[y]),p--,y--;else if(l[d]===n[y])a[y]=N(r[d],o[y]),W(s,a[y+1],r[d]),d++,y--;else if(l[p]===n[_])a[_]=N(r[p],o[_]),W(s,r[d],r[p]),p--,_++;else if(c===void 0&&(c=Ft(n,_,y),h=Ft(l,d,p)),c.has(l[d]))if(c.has(l[p])){let x=h.get(n[_]),Z=x!==void 0?r[x]:null;if(Z===null){let $=W(s,r[d]);N($,o[_]),a[_]=$}else a[_]=N(Z,o[_]),W(s,r[d],Z),r[x]=null;_++}else Ue(r[p]),p--;else Ue(r[d]),d++;for(;_<=y;){let x=W(s,a[y+1]);N(x,o[_]),a[_++]=x}for(;d<=p;){let x=r[d++];x!==null&&Ue(x)}return this.ut=n,Le(s,a),v}});var ct=class extends Q{constructor(e){super(e);this.options=e;this.handleChange=e=>{let i=e.target;this.currentValue=i.value}}render(e,i,r,o){let n=o.getColumnFilterValues(i,!1);return f`
|
|
18
|
+
<select .value=${je(String(e))} @change=${this.handleChange}>
|
|
19
|
+
${Y(n.keys(),l=>l,l=>this.renderOption(l,l===e))}
|
|
20
|
+
</select>
|
|
21
|
+
`}renderOption(e,i){let[r,o]=this.options?.labelRenderer?.(e)??[String(e),String(e)];return f`
|
|
22
|
+
<option value=${r} ?selected=${i}>${o}</option>
|
|
23
|
+
`}};var ht=class extends H{constructor(t){super({type:"text",...t})}};function Oi(s,t){return s.find(e=>e.field===t)}function Ii(s){return s?.role==="internal"}function I(s){return s?.role!=="internal"}function P(s,t){return{field:s,visible:t?.visible??!0,width:t?.width??null,sort:t?.sort?{...t.sort}:null}}function ve(s,t){if(s&&s.field!==t.field)throw Error(`attempting to compare states for different fields: ${s.field}, ${t.field}`);let e=[];return s?.visible!==t.visible&&e.push("visible"),s?.width!==t.width&&e.push("width"),(s?.sort!==t.sort||s.sort?.order!==t.sort?.order||s.sort?.priority!==t.sort?.priority)&&e.push("sort"),e}function we(s){return typeof s=="string"||typeof s=="number"}function dt(s){return s===null||s==="multi"||s==="single"}function qt(s,t){return s in t}function C(s,t){let e=t.split("."),i=s;for(let r of e)if(i&&qt(r,i))i=i[r];else return;return i}function ut(s,t,e){let i=t.split("."),r=i.at(-1);if(!r)throw new Error("Cannot set nested value with empty path");let o=s;for(let n of i.slice(0,-1))if(qt(n,o))o=o[n];else{let l={};Object.assign(o,{[n]:l}),o=l}Object.assign(o,{[r]:e})}var Wt=(s="\\S+")=>{let t=new RegExp(`"[^"]*"|${s}`,"g");return e=>(e.match(t)||[]).map(r=>(r=r.toLocaleLowerCase().trim(),r.startsWith('"')&&r.endsWith('"')?{value:r.slice(1,-1),quoted:!0}:{value:r,quoted:!1}))},pt=Wt();var Se=class extends EventTarget{addEventListener(t,e,i){super.addEventListener(t,e,i)}removeEventListener(t,e,i){super.removeEventListener(t,e,i)}dispatchEvent(t){return super.dispatchEvent(t)}};function Qt(s,t){if(!s||!t||t.length===0)return s;let e=[...t].sort((l,a)=>l[0]-a[0]),i=[],r=e[0];for(let l=1;l<e.length;l++){let a=e[l];a[0]<r[1]?r[1]=Math.max(r[1],a[1]):(i.push(r),r=a)}i.push(r);let o=[],n=0;for(let[l,a]of i){let c=Math.max(0,Math.min(l,s.length)),h=Math.max(0,Math.min(a,s.length));c>n&&o.push(s.slice(n,c)),o.push(f`<mark class="highlight">${s.slice(c,h)}</mark>`),n=h}return n<s.length&&o.push(s.slice(n)),f`${o}`}var Yt=s=>s.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/\b\w/g,t=>t.toUpperCase());var Gt=s=>(t,e)=>{e!==void 0?e.addInitializer(()=>{customElements.define(s,t)}):customElements.define(s,t)};var ki={attribute:!0,type:String,converter:me,reflect:!1,hasChanged:ze},Ni=(s=ki,t,e)=>{let{kind:i,metadata:r}=e,o=globalThis.litPropertyMetadata.get(r);if(o===void 0&&globalThis.litPropertyMetadata.set(r,o=new Map),i==="setter"&&((s=Object.create(s)).wrapped=!0),o.set(e.name,s),i==="accessor"){let{name:n}=e;return{set(l){let a=t.get.call(this);t.set.call(this,l),this.requestUpdate(n,a,s,!0,l)},init(l){return l!==void 0&&this.C(n,void 0,s,l),l}}}if(i==="setter"){let{name:n}=e;return function(l){let a=this[n];t.call(this,l),this.requestUpdate(n,a,s,!0,l)}}throw Error("Unsupported decorator location: "+i)};function m(s){return(t,e)=>typeof e=="object"?Ni(s,t,e):((i,r,o)=>{let n=r.hasOwnProperty(o);return r.constructor.createProperty(o,i),n?Object.getOwnPropertyDescriptor(r,o):void 0})(s,t,e)}function ft(s){return m({...s,state:!0,attribute:!1})}var B=(s,t,e)=>(e.configurable=!0,e.enumerable=!0,Reflect.decorate&&typeof t!="object"&&Object.defineProperty(s,t,e),e);function He(s,t){return(e,i,r)=>{let o=n=>n.renderRoot?.querySelector(s)??null;if(t){let{get:n,set:l}=typeof i=="object"?e:r??(()=>{let a=Symbol();return{get(){return this[a]},set(c){this[a]=c}}})();return B(e,i,{get(){let a=n.call(this);return a===void 0&&(a=o(this),(a!==null||this.hasUpdated)&&l.call(this,a)),a}})}return B(e,i,{get(){return o(this)}})}}var K=R(class extends T{constructor(s){if(super(s),s.type!==w.ATTRIBUTE||s.name!=="class"||s.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){if(this.st===void 0){this.st=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(i=>i!=="")));for(let i in t)t[i]&&!this.nt?.has(i)&&this.st.add(i);return this.render(t)}let e=s.element.classList;for(let i of this.st)i in t||(e.remove(i),this.st.delete(i));for(let i in t){let r=!!t[i];r===this.st.has(i)||this.nt?.has(i)||(r?(e.add(i),this.st.add(i)):(e.remove(i),this.st.delete(i)))}return v}});var Xt="important",Pi=" !"+Xt,Jt=R(class extends T{constructor(s){if(super(s),s.type!==w.ATTRIBUTE||s.name!=="style"||s.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(s){return Object.keys(s).reduce((t,e)=>{let i=s[e];return i==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(s,[t]){let{style:e}=s.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let i of this.ft)t[i]==null&&(this.ft.delete(i),i.includes("-")?e.removeProperty(i):e[i]=null);for(let i in t){let r=t[i];if(r!=null){this.ft.add(i);let o=typeof r=="string"&&r.endsWith(Pi);i.includes("-")||o?e.setProperty(i,o?r.slice(0,-11):r,o?Xt:""):e[i]=r}}return v}});function G(s,t,e,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,e):i,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,i);else for(var l=s.length-1;l>=0;l--)(n=s[l])&&(o=(r<3?n(o):r>3?n(t,e,o):n(t,e))||o);return r>3&&o&&Object.defineProperty(t,e,o),o}var Ee=(s,t)=>{let e=s._$AN;if(e===void 0)return!1;for(let i of e)i._$AO?.(t,!1),Ee(i,t);return!0},Be=s=>{let t,e;do{if((t=s._$AM)===void 0)break;e=t._$AN,e.delete(s),s=t}while(e?.size===0)},Zt=s=>{for(let t;t=s._$AM;s=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(s))break;e.add(s),Li(t)}};function Di(s){this._$AN!==void 0?(Be(this),this._$AM=s,Zt(this)):this._$AM=s}function Vi(s,t=!1,e=0){let i=this._$AH,r=this._$AN;if(r!==void 0&&r.size!==0)if(t)if(Array.isArray(i))for(let o=e;o<i.length;o++)Ee(i[o],!1),Be(i[o]);else i!=null&&(Ee(i,!1),Be(i));else Ee(this,s)}var Li=s=>{s.type==w.CHILD&&(s._$AP??=Vi,s._$AQ??=Di)},Ke=class extends T{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,i){super._$AT(t,e,i),Zt(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(Ee(this,t),Be(this))}setValue(t){if(Ve(this._$Ct))this._$Ct._$AI(t,this);else{let e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}};var X=class s extends Event{constructor(t){super(s.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};X.eventName="rangeChanged";var J=class s extends Event{constructor(t){super(s.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}};J.eventName="visibilityChanged";var Ce=class s extends Event{constructor(){super(s.eventName,{bubbles:!1})}};Ce.eventName="unpinned";var mt=class{constructor(t){this._element=null;let e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}},Fe=class extends mt{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);let i=this._node;this._originalScrollTo=i.scrollTo,this._originalScrollBy=i.scrollBy,this._originalScroll=i.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return this._destination!==null}scrollTo(t,e){let i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;this._scrollTo(i)}scrollBy(t,e){let i=typeof t=="number"&&typeof e=="number"?{left:t,top:e}:t;i.top!==void 0&&(i.top+=this.scrollTop),i.left!==void 0&&(i.left+=this.scrollLeft),this._scrollTo(i)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,i=null){this._end!==null&&this._end(),t.behavior==="smooth"?(this._setDestination(t),this._retarget=e,this._end=i):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:i}=t;return e=e===void 0?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),i=i===void 0?void 0:Math.max(0,Math.min(i,this.maxScrollLeft)),this._destination!==null&&i===this._destination.left&&e===this._destination.top?!1:(this.__destination={top:e,left:i,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,i){return this._scrollTo(t,e,i),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(this._destination!==null){let{scrollTop:t,scrollLeft:e}=this,{top:i,left:r}=this._destination;i=Math.min(i||0,this.maxScrollTop),r=Math.min(r||0,this.maxScrollLeft);let o=Math.abs(i-t),n=Math.abs(r-e);o<1&&n<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),this._clients.size===0&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),this._clients.size===1&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}};var oi=typeof window<"u"?window.ResizeObserver:void 0;var F=Symbol("virtualizerRef"),Qe="virtualizer-sizer",ni,Ge=class{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(t.hostElement)this._init(t);else throw new Error('Virtualizer configuration requires the "hostElement" property')}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);let e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new oi(()=>this._hostElementSizeChanged()),this._childrenRO=new oi(this._childrenSizeChanged.bind(this))}_initHostElement(t){let e=this._hostElement=t.hostElement;this._applyVirtualizerStyles(),e[F]=this}connected(){this._initObservers();let t=this._isScroller;this._clippingAncestors=qi(this._hostElement,t),this._scrollerController=new Fe(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){let e=this._hostElement.style;e.display=e.display||"block",e.position=e.position||"relative",e.contain=e.contain||"size layout",this._isScroller&&(e.overflow=e.overflow||"auto",e.minHeight=e.minHeight||"150px")}_getSizer(){let t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${Qe}]`);e||(e=document.createElement("div"),e.setAttribute(Qe,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent=" ",e.setAttribute(Qe,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;let e=t.type||ni;if(typeof e=="function"&&this._layout instanceof e){let i={...t};return delete i.type,this._layout.config=i,!0}return!1}async _initLayout(t){let e,i;if(typeof t.type=="function"){i=t.type;let r={...t};delete r.type,e=r}else e=t;i===void 0&&(ni=i=(await Promise.resolve().then(()=>(si(),ri))).FlowLayout),this._layout=new i(r=>this._handleLayoutMessage(r),e),this._layout.measureChildren&&typeof this._layout.updateItemSizes=="function"&&(typeof this._layout.measureChildren=="function"&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){this._benchmarkStart===null&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(this._benchmarkStart!==null){let t=window.performance.now(),e=t-this._benchmarkStart,r=performance.getEntriesByName("uv-virtualizing","measure").filter(o=>o.startTime>=this._benchmarkStart&&o.startTime<t).reduce((o,n)=>o+n.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:r}}return null}_measureChildren(){let t={},e=this._children,i=this._measureChildOverride||this._measureChild;for(let r=0;r<e.length;r++){let o=e[r],n=this._first+r;(this._itemsChanged||this._toBeMeasured.has(o))&&(t[n]=i.call(this,o,this._items[n]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){let{width:e,height:i}=t.getBoundingClientRect();return Object.assign({width:e,height:i},Ki(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;let{_rangeChanged:e,_itemsChanged:i}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||i)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),this._childMeasurements!==null&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}this._scrollerController.correctingScrollError===!1&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){t.type==="scroll"?(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent():console.warn("event not handled",t)}_handleLayoutMessage(t){t.type==="stateChanged"?this._updateDOM(t):t.type==="visibilityChanged"?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):t.type==="unpinned"&&this._hostElement.dispatchEvent(new Ce)}get _children(){let t=[],e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(Qe)||t.push(e),e=e.nextElementSibling;return t}_updateView(){let t=this._hostElement,e=this._scrollerController?.element,i=this._layout;if(t&&e&&i){let r,o,n,l,a=t.getBoundingClientRect();r=0,o=0,n=window.innerHeight,l=window.innerWidth;let c=this._clippingAncestors.map($=>$.getBoundingClientRect());c.unshift(a);for(let $ of c)r=Math.max(r,$.top),o=Math.max(o,$.left),n=Math.min(n,$.bottom),l=Math.min(l,$.right);let h=e.getBoundingClientRect(),d={left:a.left-h.left,top:a.top-h.top},p={width:e.scrollWidth,height:e.scrollHeight},_=r-a.top+t.scrollTop,y=o-a.left+t.scrollLeft,x=Math.max(0,n-r),Z=Math.max(0,l-o);i.viewportSize={width:Z,height:x},i.viewportScroll={top:_,left:y},i.totalScrollSize=p,i.offsetWithinScroller=d}}_sizeHostElement(t){let i=t&&t.width!==null?Math.min(82e5,t.width):0,r=t&&t.height!==null?Math.min(82e5,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${i}px, ${r}px)`;else{let o=this._hostElement.style;o.minWidth=i?`${i}px`:"100%",o.minHeight=r?`${r}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:e,left:i,width:r,height:o,xOffset:n,yOffset:l},a)=>{let c=this._children[a-this._first];c&&(c.style.position="absolute",c.style.boxSizing="border-box",c.style.transform=`translate(${i}px, ${e}px)`,r!==void 0&&(c.style.width=r+"px"),o!==void 0&&(c.style.height=o+"px"),c.style.left=n===void 0?null:n+"px",c.style.top=l===void 0?null:l+"px")})}async _adjustRange(t){let{_first:e,_last:i,_firstVisible:r,_lastVisible:o}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==i,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==r||this._lastVisible!==o}_correctScrollError(){if(this._scrollError){let{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:i,left:r}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-i,left:e-r})}}element(t){return t===1/0&&(t=this._items.length-1),this._items?.[t]===void 0?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),t.behavior==="smooth"){let e=this._layout.getScrollIntoViewCoordinates(t),{behavior:i}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:i}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){let{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new X({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new J({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){this._layoutCompleteRejecter!==null&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&this._pendingLayoutComplete===null&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){this._layoutCompleteResolver!==null&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(let e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}};function Ki(s){let t=window.getComputedStyle(s);return{marginTop:Ye(t.marginTop),marginRight:Ye(t.marginRight),marginBottom:Ye(t.marginBottom),marginLeft:Ye(t.marginLeft)}}function Ye(s){let t=s?parseFloat(s):NaN;return Number.isNaN(t)?0:t}function li(s){if(s.assignedSlot!==null)return s.assignedSlot;if(s.parentElement!==null)return s.parentElement;let t=s.parentNode;return t&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&t.host||null}function Fi(s,t=!1){let e=[],i=t?s:li(s);for(;i!==null;)e.push(i),i=li(i);return e}function qi(s,t=!1){let e=!1;return Fi(s,t).filter(i=>{if(e)return!1;let r=getComputedStyle(i);return e=r.position==="fixed",r.overflow!=="visible"})}var yt=s=>s,vt=(s,t)=>f`${t}: ${JSON.stringify(s,null,2)}`,bt=class extends Ke{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,i)=>vt(e,i+this._first),this._keyFunction=(e,i)=>yt(e,i+this._first),this._items=[],t.type!==w.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);let e=[];if(this._first>=0&&this._last>=this._first)for(let i=this._first;i<=this._last;i++)e.push(this._items[i]);return Y(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);let i=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),i?v:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){let r=t.parentNode;this._makeVirtualizer(r,e)}this._virtualizer.items=this._items}_setFunctions(t){let{renderItem:e,keyFunction:i}=t;e&&(this._renderItem=(r,o)=>e(r,o+this._first)),i&&(this._keyFunction=(r,o)=>i(r,o+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();let{layout:i,scroller:r,items:o}=e;this._virtualizer=new Ge({hostElement:t,layout:i,scroller:r}),this._virtualizer.items=o,this._virtualizer.connected()}_initialize(t,e){let i=t.parentNode;i&&i.nodeType===1&&(i.addEventListener("rangeChanged",r=>{this._first=r.first,this._last=r.last,this.setValue(this.render())}),this._makeVirtualizer(i,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}},ai=R(bt);var k=class extends M{constructor(){super(...arguments),this.items=[],this.renderItem=vt,this.keyFunction=yt,this.layout={},this.scroller=!1}createRenderRoot(){return this}render(){let{items:t,renderItem:e,keyFunction:i,layout:r,scroller:o}=this;return f`${ai({items:t,renderItem:e,keyFunction:i,layout:r,scroller:o})}`}element(t){return this[F]?.element(t)}get layoutComplete(){return this[F]?.layoutComplete}scrollToIndex(t,e="start"){this.element(t)?.scrollIntoView({block:e})}};G([m({attribute:!1})],k.prototype,"items",void 0);G([m()],k.prototype,"renderItem",void 0);G([m()],k.prototype,"keyFunction",void 0);G([m({attribute:!1})],k.prototype,"layout",void 0);G([m({reflect:!0,type:Boolean})],k.prototype,"scroller",void 0);customElements.define("lit-virtualizer",k);function ci(s){return typeof s=="string"||typeof s=="number"||typeof s=="bigint"?s:typeof s=="boolean"?Number(s):s instanceof Date?s.getTime():String(s)}function hi(s,t){let e=Array.from(new Set(s)),i=new Intl.Collator(t,{numeric:!0,sensitivity:"base"});e.sort(([o,n],[l,a])=>{if(n==null&&a==null)return 0;if(n==null)return-1;if(n==null)return 1;let c=ci(n),h=ci(a);return typeof c=="string"&&typeof h=="string"?i.compare(String(c),String(h)):c<h?-1:h<c?1:0});let r=new Map;return e.forEach(([o,n],l)=>r.set(o,l)),r}var Wi=1e3,di={storage:window.localStorage,saveColumnSortOrders:!0,saveColumnVisibility:!0,saveColumnWidths:!0,saveColumnOrder:!0,saveSelectedRows:!0},wt={EXACT:100,PREFIX:50,SUBSTRING:10},xe=class extends Se{constructor(e,i){super();this.hosts=new Set;this._tokenizedSearch=!1;this._scoredSearch=!1;this._columns=[];this._columnDefinitionMap=new Map;this._columnStateMap=new Map;this._rowSelectionMethod=null;this._selectedRowIds=new Set;this._storageOptions=null;this._rowIdCallback=(e,i)=>"id"in e&&we(e.id)?e.id:"key"in e&&we(e.key)?e.key:"_id"in e&&we(e._id)?e._id:(Qi(),i);this._data=[];this._filteredData=[];this._dataUpdateTimestamp=null;this._searchQuery="";this._searchTokenizer=pt;this._filters=null;this.hasRestoredState=!1;this.saveTimer=0;this.filterDirty=!1;this.sortDirty=!1;this.rowMetadata=new WeakMap;this.idToRowMap=new Map;this.queryTokens=null;e&&this.attach(e),i&&(i.scoredSearch!==void 0&&(this.scoredSearch=i.scoredSearch),i.tokenizedSearch!==void 0&&(this.tokenizedSearch=i.tokenizedSearch),i.searchTokenizer!==void 0&&(this.searchTokenizer=i.searchTokenizer),i.rowIdCallback!==void 0&&(this.rowIdCallback=i.rowIdCallback),i.rowSelectionMethod!==void 0&&(this.rowSelectionMethod=i.rowSelectionMethod),i.storageOptions!==void 0&&(this.storageOptions=i.storageOptions),i.columns!==void 0&&(this.columns=i.columns),i.data!==void 0&&(this.data=i.data))}get columns(){return[...this._columns]}set columns(e){this._columns=[...e],this.filterDirty=!0,this._columnDefinitionMap=new Map;for(let i of e)this._columnDefinitionMap.set(i.field,i);this.createMetadata(),this.requestUpdate("columns")}get displayColumns(){return this.columns.filter(I)}get columnStates(){return this.columns.map(e=>{let i=this.getColumnState(e.field);return P(e.field,i)})}set columnStates(e){let i=!1;for(let r of e){let o=this.getColumnState(r.field),n=ve(o,r);if(n.length){i=!0,n.includes("sort")&&(this.sortDirty=!0);let l=P(r.field,r);this._columnStateMap.set(r.field,l)}}i&&this.requestUpdate("columnStates")}get data(){return[...this._data]}set data(e){this._data!==e&&(this._data=[...e],this.createMetadata(),this._dataUpdateTimestamp=new Date,this.filterDirty=!0,this.requestUpdate("data"))}get filteredData(){return this.filterDirty?this.filterRows():this.sortDirty&&this.sortRows(),this.filterDirty=!1,this.sortDirty=!1,[...this._filteredData]}get dataUpdateTimestamp(){return this._dataUpdateTimestamp}get filters(){return this._filters}set filters(e){this._filters!==e&&(this._filters=e,this.filterDirty=!0,this.requestUpdate("filters"))}get searchQuery(){return this._searchQuery}set searchQuery(e){this._searchQuery!==e&&(this._searchQuery=e,this.updateInternalQuery(),this.filterDirty=!0,this.requestUpdate("searchQuery"))}get tokenizedSearch(){return this._tokenizedSearch}set tokenizedSearch(e){this._tokenizedSearch!==e&&(this._tokenizedSearch=e,this.updateInternalQuery(),this.filterDirty=!0,this.requestUpdate("tokenizedSearch"))}get scoredSearch(){return this._scoredSearch}set scoredSearch(e){this._scoredSearch!==e&&(this._scoredSearch=e,this.filterDirty=!0,this.requestUpdate("scoredSearch"))}get searchTokenizer(){return this._searchTokenizer}set searchTokenizer(e){this._searchTokenizer!==e&&(this._searchTokenizer=e,this.filterDirty=!0,this.requestUpdate("searchTokenizer"))}get rowSelectionMethod(){return this._rowSelectionMethod}set rowSelectionMethod(e){this._rowSelectionMethod===e||!dt(e)||(this._rowSelectionMethod=e,this.requestUpdate("rowSelectionMethod"))}get selectedRowIds(){let e=[...this._selectedRowIds];return this.rowSelectionMethod==="single"?e=e.slice(0,1):this.rowSelectionMethod||(e=[]),e}set selectedRowIds(e){e.length===this._selectedRowIds.size&&e.every(i=>this._selectedRowIds.has(i))||(this._selectedRowIds=new Set(e),this.requestUpdate("selectedRowIds"))}get rowIdCallback(){return this._rowIdCallback}set rowIdCallback(e){if(this._rowIdCallback!==e){this._rowIdCallback=e;for(let i=0;i<this.data.length;++i){let r=this.data[i];this.rowMetadata.get(r).id=this._rowIdCallback(r,i)}this.requestUpdate("rowIdCallback")}}get storageOptions(){return this._storageOptions?{...this._storageOptions}:null}set storageOptions(e){this._storageOptions!==e&&(this._storageOptions=e?{...e}:null,this.hasRestoredState||(this.loadStateFromStorage(),this.requestUpdate("storageOptions")))}attach(e){this.hosts.add(e),e.addController(this),e.requestUpdate()}detach(e){e.removeController(this),this.hosts.delete(e)}getColumn(e){return this._columnDefinitionMap.get(e)}getDisplayColumn(e){let i=this._columnDefinitionMap.get(e);if(I(i))return i}getTableState(){return{searchQuery:this.searchQuery,selectedRows:this.selectedRowIds,columns:this.columnStates.map(e=>{let i=this.getColumnState(e.field);return P(e.field,i)})}}updateTableState(e){if("searchQuery"in e&&e.searchQuery!==void 0&&(this.searchQuery=e.searchQuery),"selectedRows"in e&&e.selectedRows&&(this.selectedRowIds=e.selectedRows),"columns"in e&&e.columns!==void 0)for(let i of e.columns)this.updateColumnState(i.field,i);this.requestUpdate()}getColumnState(e){let i=this._columnStateMap.get(e);if(!i){let r=P(e);return this._columnStateMap.set(e,r),r}return P(e,i)}updateColumnState(e,i){let r=this._columnStateMap.get(e),o=P(e,{...r,...i});this.columnStates=[o]}search(e){this.searchQuery=e,this.dispatchEvent(new he(e))}getColumnFilterValues(e,i=!1){let r=this.getDisplayColumn(e),o=new Map;for(let n of this.filteredData){let l=C(n,e);r?.valueFormatter&&(l=r.valueFormatter(l,n)),Array.isArray(l)||(l=[l]);for(let a of l)if(a!=null||i){let c=o.get(a)??0;o.set(a,c+1)}}return o}sort(e,i,r=!0){let o=this.getColumnState(e);if(o===void 0)throw new Error(`Cannot get options for non-existent column "${e}"`);if(i===o?.sort?.order)return;if(i&&!o.sort){let a=[...this._columnStateMap.values()].map(d=>d.sort?.priority).filter(d=>d!==void 0),c=this.columns.length+1,h=Math.min(c,...a)-1;o.sort={order:i,priority:h}}else i&&o.sort?o.sort.order=i:o.sort=null;let n=[o];if(r){for(let a of this.columns)if(a.field!==e){let c=this.getColumnState(a.field);c.sort=null,n.push(c)}}this.columnStates=n;let l=new se(e,i,!r);this.dispatchEvent(l)}toggleColumnVisibility(e,i){let r=this.getColumnState(e),o=i!==void 0?i:!r.visible;if(o===r.visible)return;r.visible=o,this.columnStates=[r];let n=new oe(e,o);this.dispatchEvent(n)}showColumn(e){this.toggleColumnVisibility(e,!0)}hideColumn(e){this.toggleColumnVisibility(e,!1)}moveColumn(e,i){let r=this.displayColumns,o=r.findIndex(l=>l.field===e),n=typeof i=="number"?i:r.findIndex(l=>l.field===i);if(o>-1&&n>-1){let[l]=r.splice(o,1);r.splice(n,0,l),this.columns=r;let a=new ae(r.map(c=>c.field));this.dispatchEvent(a)}}resizeColumn(e,i){let r=this.getColumnState(e);r.width=i,this.updateColumnState(e,r),this.dispatchEvent(new ne(e,i))}isRowSelected(e){let i=this.getRowId(e);return this.selectedRowIds.includes(i)}toggleRowSelection(e,i){let r=this.getRowId(e),o=this.isRowSelected(e),n=i!==void 0?i:o;if(n===o)return;let l;n?l=this.rowSelectionMethod==="single"?[r]:[...this.selectedRowIds,r]:l=this.selectedRowIds.filter(h=>h!==r);let a=this.selectedRowIds;this.selectedRowIds=l;let c=new ie(l,a);this.dispatchEvent(c)}selectRow(e){this.toggleRowSelection(e,!0)}deselectRow(e){this.toggleRowSelection(e,!1)}selectAll(){if(this.rowSelectionMethod==="single")return;let e=this.filteredData.map(i=>this.getRowId(i));this.selectedRowIds=e}deselectAll(){this.selectedRowIds=[]}export(e={includeAllRows:!1,includeHiddenColumns:!1,includeInternalColumns:!1}){let i=e.includeAllRows?this.data:this.filteredData,r=e.includeInternalColumns?this.columns:this.displayColumns,o=r.filter(a=>e.includeHiddenColumns?!0:this.getColumnState(a.field).visible).map(a=>I(a)?a.title:a.field).join(","),n=i.map(a=>{let c=[];for(let h of r){let d=this.getColumnState(h.field),p=C(a,h.field);(e.includeHiddenColumns||d.visible)&&(I(h)&&typeof h.valueFormatter=="function"&&(p=h.valueFormatter(p,a)),p=String(p??"").replace('"','""'),c.push(`"${p}"`))}return c.join(",")}).join(`
|
|
4
24
|
`),l=o+`
|
|
5
|
-
`+n;return new Blob([l],{type:"text/csv;charset=utf-8,"})}getRow(e){return this.idToRowMap.get(e)}findRow(e,i){return this.data.find(r=>
|
|
25
|
+
`+n;return new Blob([l],{type:"text/csv;charset=utf-8,"})}getRow(e){return this.idToRowMap.get(e)}findRow(e,i){return this.data.find(r=>C(r,e)===i)}findRowIndex(e,i){let r=this.findRow(e,i);return r?this.rowMetadata.get(r).index:-1}updateRow(e,i){let r=this.idToRowMap.get(e);r&&this.updateRowData(r,i)}updateRowAtIndex(e,i){let r=this.data[e];r&&this.updateRowData(r,i)}deleteRow(...e){for(let i of e){let r=this.idToRowMap.get(i);if(r){let o=this.rowMetadata.get(r);this.deleteRowAtIndex(o.index)}}}deleteRowAtIndex(...e){let i=new Set(this.selectedRowIds);for(let r of e){let o=this.data[r];if(o){let n=this.rowMetadata.get(o);this.idToRowMap.delete(n.id),this.rowMetadata.delete(o),i.delete(n.id),this.data=this.data.toSpliced(r,1)}}this.selectedRowIds=[...i]}getRowId(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.id}getRowIndex(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.index}getRowHighlightIndicies(e){let i=this.rowMetadata.get(e);if(!i)throw new Error("The provided row does not exist in the current dataset");return i.highlightIndices}hostConnected(){}hostDisconnected(){}hostUpdate(){}hostUpdated(){}requestUpdate(...e){let i=["columns","columnStates","searchQuery","selectedRowIds"],r=e.filter(o=>i.includes(o));r.length&&(this.scheduleSave(),this.dispatchEvent(new ue(this.getTableState(),r))),e.includes("data")&&(this.filterDirty=!0);for(let o of this.hosts)o.requestUpdate()}calculateSearchScore(e,i){let r={score:0,ranges:[]};if(!e||!i)return r;let o=0,n=0;if(i===e)n=wt.EXACT,o=e.length,r.ranges.push([0,i.length]);else if(i.startsWith(e))n=wt.PREFIX,o=e.length,r.ranges.push([0,e.length]);else{let c=i.indexOf(e);if(c!==-1){n=wt.SUBSTRING,o=e.length;let h=c;for(;h!==-1;)r.ranges.push([h,h+e.length]),h=i.indexOf(e,h+1)}else return r}let a=1/(1+(i.length-e.length));return r.score=o*n*a,r}searchField(e,i,r){let o={score:0,ranges:[]},n=l=>{let a=i.indexOf(l);for(;a!==-1;)o.ranges.push([a,a+l.length]),a=i.indexOf(l,a+1)};if(e.quoted||!r){if(!this.scoredSearch)i.includes(e.value)&&(o.score=1,n(e.value));else{let l=this.calculateSearchScore(e.value,i);o.score=l.score,o.ranges=l.ranges}return o}if(!this.scoredSearch)return r.some(a=>a.includes(e.value))&&(o.score=1,n(e.value)),o;for(let l of r){let a=this.calculateSearchScore(e.value,l);a.score>0&&(o.score+=a.score,n(e.value))}return o}filterField(e,i,r=null){return Array.isArray(i)?i.length===0?!0:i.some(o=>this.filterField(e,o,r)):Array.isArray(e)?e.length===0?!1:e.some(o=>this.filterField(o,i,r)):typeof r=="function"?r(e,i):i instanceof RegExp?i.test(String(e)):i===e}filterRow(e,i){if(!this.filters)return!0;if(typeof this.filters=="function")return this.filters(e,i);for(let r in this.filters){let o=C(this.filters,r),n=C(e,r);if(typeof o=="function"){if(!o(n))return!1}else if(o!==void 0){let l=this.getColumn(r),a=l?l.filter:void 0;if(!this.filterField(n,o,a))return!1}}return!0}filterRows(){let i=[...this.columns].filter(r=>r.searchable).map(r=>r.field);this._filteredData=this.data.filter((r,o)=>{let n=this.rowMetadata.get(r);if(n.searchScore=0,n.highlightIndices={},!this.filterRow(r,o))return!1;if(!this.queryTokens)return!0;for(let l of i){let a=C(r,l),c=n.searchValues[l],h=n.searchTokens[l];if(typeof a!="string"||typeof c!="string")continue;let d={score:0,ranges:[]};for(let p of this.queryTokens){let _=this.searchField(p,c,h);d.score+=_.score,d.ranges.push(..._.ranges)}d.score>0&&(n.searchScore+=d.score,n.highlightIndices[l]=d.ranges)}return n.searchScore>0}),this.filterDirty=!1,this.sortRows(),this.dispatchEvent(new de(this.data))}compareRows(e,i,r){let o,n,l=this.getColumnState(r);if(!l.sort)return 0;let a=this.rowMetadata.get(e),c=this.rowMetadata.get(i);return l.sort?.order==="asc"?(o=a.sortValues[r],n=c.sortValues[r]):(o=c.sortValues[r],n=a.sortValues[r]),o??=Number.MIN_SAFE_INTEGER,n??=Number.MIN_SAFE_INTEGER,o<n?-1:o>n?1:0}sortRows(){if(this.filterDirty){this.filterRows();return}let e=[...this._columnStateMap.values()].filter(i=>i.visible&&i.sort).sort((i,r)=>r.sort.priority-i.sort.priority);this._filteredData=this._filteredData.toSorted((i,r)=>{let o=this.rowMetadata.get(i),n=this.rowMetadata.get(r);if(this.scoredSearch&&this.queryTokens){let l=o.searchScore||0,a=n.searchScore||0;if(l>a)return-1;if(l<a)return 1}for(let l of e){let a=this.compareRows(i,r,l.field);if(a!==0)return a}return o.index-n.index}),this.sortDirty=!1}createMetadata(){this.idToRowMap=new Map,this.rowMetadata=new WeakMap;let e=new Map;for(let r of this.columns){let o=this.data.map(n=>{let l=C(n,r.field),a=r.sorter?.(l)??l;return[l,a]});e.set(r.field,hi(o))}let i=0;for(let r of this.data){let o=this._rowIdCallback(r,i);(o==null||this.idToRowMap.has(o))&&(Yi(i,o,r),o=`__yatl_fallback_id_${i}`),this.idToRowMap.set(o,r);let n={id:o,index:i++,searchTokens:{},searchValues:{},sortValues:{},selected:!1};this.rowMetadata.set(r,n);for(let l of this.columns){let a=C(r,l.field),c=e.get(l.field);if(n.sortValues[l.field]=c.get(a)??null,typeof a=="string"&&(n.searchValues[l.field]=a.toLocaleLowerCase()),l.searchable&&l.tokenize&&a){let h=l.searchTokenizer??this.searchTokenizer;n.searchTokens[l.field]=h(String(a)).map(d=>d.value)}}}}updateRowData(e,i){Object.assign(e,i),this.createMetadata(),this.requestUpdate("data")}updateInternalQuery(){if(this.searchQuery.length===0){this.queryTokens=null;return}this.queryTokens=[{value:this.searchQuery.toLocaleLowerCase(),quoted:!0}],this.tokenizedSearch&&this.queryTokens.push(...this.searchTokenizer(this.searchQuery))}scheduleSave(){window.clearTimeout(this.saveTimer),this.saveTimer=window.setTimeout(()=>{this.saveStateToStorage()},Wi)}saveStateToStorage(){if(!this.storageOptions)return;let e={...di,...this.storageOptions},i={columns:[]},r=this.getTableState();e.saveSearchQuery&&(i.searchQuery=r.searchQuery),e.saveSelectedRows&&(i.selectedRows=r.selectedRows);for(let n of r.columns){let l={field:n.field};e.saveColumnSortOrders&&(l.sort=n.sort),e.saveColumnVisibility&&(l.visible=n.visible),e.saveColumnWidths&&(l.width=n.width),i.columns?.push(l)}let o=e.storage??window.localStorage;try{o.setItem(e.key,JSON.stringify(i))}catch(n){console.warn("Failed to save table state",n)}}loadStateFromStorage(){if(!this.storageOptions)return;let e={...di,...this.storageOptions},r=(e.storage??window.localStorage).getItem(e.key);if(r)try{let o=JSON.parse(r),n={};if(e.saveSearchQuery&&(n.searchQuery=o.searchQuery),e.saveSelectedRows&&(n.selectedRows=o.selectedRows),o.columns){n.columns=[];for(let l of o.columns){let a={field:l.field};e.saveColumnVisibility&&(a.visible=l.visible),e.saveColumnWidths&&(a.width=l.width),e.saveColumnSortOrders&&(a.sort=l.sort),n.columns.push(a)}}this.updateTableState(n),this.hasRestoredState=!0}catch(o){console.error("Failed to restore DataTable state:",o)}}},ui=!1;function Qi(){ui||(ui=!0,console.warn(`[yatl-table] Data rows are missing a unique 'id' or 'key' property.
|
|
6
26
|
Falling back to array index.
|
|
7
27
|
Selection and sorting may behave unexpectedly.
|
|
8
28
|
Please provide a unique ID via the 'rowIdCallback' property.
|
|
9
|
-
`))}var
|
|
29
|
+
`))}var pi=!1;function Yi(s,t,e){pi||(pi=!0,console.warn(`[yatl-table] rowIdCallback returned non-unique id (${t}) for data at index ${s}.
|
|
10
30
|
Falling back to array index.
|
|
11
31
|
Selection and sorting may behave unexpectedly.
|
|
12
|
-
`),console.debug(e))}var
|
|
32
|
+
`),console.debug(e))}var fi=Ze`
|
|
13
33
|
@layer base, striped, hover, selected;
|
|
14
34
|
|
|
15
35
|
:host {
|
|
@@ -32,7 +52,7 @@
|
|
|
32
52
|
);
|
|
33
53
|
|
|
34
54
|
--table-header-text: var(--yatl-table-header-text, var(--yatl-text-1));
|
|
35
|
-
--table-header-bg: var(--yatl-table-header-bg, var(--yatl-surface-
|
|
55
|
+
--table-header-bg: var(--yatl-table-header-bg, var(--yatl-surface-2));
|
|
36
56
|
--table-header-hover-bg: var(
|
|
37
57
|
--yatl-table-header-hover-bg,
|
|
38
58
|
color-mix(in srgb, var(--yatl-color-mix) 4%, var(--table-header-bg))
|
|
@@ -134,6 +154,20 @@
|
|
|
134
154
|
justify-content: flex-end;
|
|
135
155
|
}
|
|
136
156
|
|
|
157
|
+
.cell.is-editing {
|
|
158
|
+
padding: 0;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
.cell.is-editing > * {
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: 100%;
|
|
164
|
+
box-sizing: border-box;
|
|
165
|
+
outline: none;
|
|
166
|
+
padding: var(--yatl-spacing-m);
|
|
167
|
+
border: 1px solid var(--yatl-color-brand);
|
|
168
|
+
border-radius: var(--yatl-radius-xs);
|
|
169
|
+
}
|
|
170
|
+
|
|
137
171
|
.table.resizing * {
|
|
138
172
|
cursor: col-resize !important;
|
|
139
173
|
}
|
|
@@ -161,8 +195,17 @@
|
|
|
161
195
|
transition: background-color 0.2s;
|
|
162
196
|
}
|
|
163
197
|
|
|
198
|
+
.cell-wrapper:has(.cell-index) {
|
|
199
|
+
overflow: visible;
|
|
200
|
+
background-color: var(--table-header-bg);
|
|
201
|
+
height: calc(100% + var(--table-border-width));
|
|
202
|
+
}
|
|
203
|
+
|
|
164
204
|
.row-number-cell {
|
|
165
205
|
background-color: var(--table-header-bg);
|
|
206
|
+
border-right-width: var(--table-border-width);
|
|
207
|
+
border-right-color: var(--table-border-color);
|
|
208
|
+
border-right-style: solid;
|
|
166
209
|
}
|
|
167
210
|
|
|
168
211
|
.message {
|
|
@@ -209,11 +252,10 @@
|
|
|
209
252
|
}
|
|
210
253
|
|
|
211
254
|
/* Layout stuff
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
255
|
+
* Most of this is functional and needed
|
|
256
|
+
* for the table to work properly.
|
|
257
|
+
* Modify with caution!
|
|
258
|
+
*/
|
|
217
259
|
:host {
|
|
218
260
|
display: block;
|
|
219
261
|
width: 100%;
|
|
@@ -394,25 +436,53 @@
|
|
|
394
436
|
white-space: nowrap;
|
|
395
437
|
overflow: hidden;
|
|
396
438
|
}
|
|
397
|
-
|
|
439
|
+
|
|
440
|
+
@media print {
|
|
441
|
+
.table {
|
|
442
|
+
color: black;
|
|
443
|
+
width: 100%;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.row {
|
|
447
|
+
break-inside: avoid;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.cell {
|
|
451
|
+
border: 1px solid black;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
`;var u=class extends M{constructor(){super(...arguments);this.resizeState=null;this.dragColumn=null;this.useYatlUi=!1;this.editingState=null;this._controller=new xe(this);this.striped=!1;this.sortable=!1;this.resizable=!1;this.reorderable=!1;this.rowNumbers=!1;this.virtualScroll=!1;this.hideFooter=!1;this.disableEditing=!1;this.nullValuePlaceholder="-";this.emptyMessage="No records to display";this.noResultsMessage="No matching records found";this.rowParts=null;this.eventNames=["yatl-column-reorder","yatl-column-resize","yatl-column-sort","yatl-column-toggle","yatl-row-select","yatl-table-search","yatl-table-state-change","yatl-table-view-change"];this.redispatchControllerEvent=e=>{e instanceof E&&this.dispatchEvent(e.clone())};this.handleHeaderClicked=(e,i)=>{if(!e.currentTarget.classList.contains("sortable")||this.resizeState)return;let o=e.shiftKey,n=this.getColumnState(i.field),l=null;n?.sort?n.sort.order==="asc"&&(l="desc"):l="asc";let a=new re(i.field,l,o);this.dispatchEvent(a)&&this.sort(i.field,l,!o)};this.handleCellClick=(e,i,r)=>{if(this.editingState||window.getSelection()?.toString())return;let o=e.target;if(o.tagName==="A"||o.tagName==="BUTTON"||o.tagName==="YATL-BUTTON")return;let n=this.controller.getRowId(i),l=this.controller.getRowIndex(i);this.dispatchEvent(new ee(i,n,l,r,e))};this.handleResizeMouseMove=e=>{this.resizeState?.active&&requestAnimationFrame(()=>{if(!this.resizeState?.active)return;let i=e.pageX-this.resizeState.startX,r=Math.max(50,this.resizeState.startWidth+i);this.resizeState.currentWidths[this.resizeState.columnIndex]=`${r}px`,this.tableElement.style.setProperty("--grid-template",this.resizeState.currentWidths.join(" "))})};this.handleResizeMouseUp=e=>{if(window.removeEventListener("mousemove",this.handleResizeMouseMove),window.removeEventListener("mouseup",this.handleResizeMouseUp),this.tableElement.classList.remove("resizing"),this.resizeState?.active){e.preventDefault(),e.stopPropagation();let i=parseFloat(this.resizeState.currentWidths[this.resizeState.columnIndex]);this.resizeColumn(this.resizeState.columnField,i)}setTimeout(()=>{this.resizeState=null})};this.handleDragColumnStart=(e,i)=>{if(e.target?.classList.contains("resizer")){e.preventDefault();return}e.dataTransfer&&(e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",i),this.dragColumn=i)};this.handleDragColumnEnter=e=>{e.currentTarget.querySelector(".drop-indicator")?.classList.add("active")};this.handleDragColumnLeave=e=>{let i=e.currentTarget,r=e.relatedTarget;i.contains(r)||i.querySelector(".drop-indicator")?.classList.remove("active")};this.handleDragColumnOver=e=>{e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="move")};this.handleDragColumnDrop=(e,i)=>{if(!this.dragColumn||this.dragColumn===i)return;e.preventDefault(),e.stopPropagation();let r=this.displayColumns,o=r.findIndex(a=>a.field===this.dragColumn),n=r.findIndex(a=>a.field===i),l=new le(this.dragColumn,o,n);this.dispatchEvent(l)&&this.moveColumn(this.dragColumn,i)};this.handleDragColumnEnd=()=>{this.dragColumn=null,this.tableElement.querySelectorAll(".drop-indicator.active").forEach(e=>e.classList.remove("active"))};this.handleRowSelectionClicked=(e,i)=>{e.stopPropagation();let r=e.currentTarget,o=r.checked,n=this.controller.getRowId(i),l=this.selectedRowIds,a=new te(n,o,l);if(!this.dispatchEvent(a)){r.checked=!o;return}this.toggleRowSelection(i,o)}}get virtualizerRef(){if(this.virtualizer)return this.virtualizer[F]}get controller(){return this._controller}set controller(e){if(this._controller===e)return;let i=this._controller;this.isConnected&&(this.removeControllerListeners(i),this.addControllerListeners(e)),i.detach(this),e.attach(this),this._controller=e}get columns(){return this.controller.columns}set columns(e){if(this.columns!==e){for(let i of e)I(i)&&i.title===void 0&&(i.title=Yt(i.field));this.controller.columns=e}}get displayColumns(){return this.controller.displayColumns}get columnStates(){return this.controller.columnStates}set columnStates(e){let i=!1;for(let r of e){let o=this.getColumnState(r.field);if(ve(o,r).length){i=!0;break}}i&&(this.controller.columnStates=e)}get data(){return this.controller.data}set data(e){this.controller.data=e}get filteredData(){return this.controller.filteredData}get dataUpdateTimestamp(){return this.controller.dataUpdateTimestamp}get filters(){return this.controller.filters}set filters(e){this.filters!==e&&(this.controller.filters=e)}get searchQuery(){return this.controller.searchQuery}set searchQuery(e){this.searchQuery!==e&&(this.controller.searchQuery=e)}get tokenizedSearch(){return this.controller.tokenizedSearch}set tokenizedSearch(e){this.tokenizedSearch!==e&&(this.controller.tokenizedSearch=e)}get scoredSearch(){return this.controller.scoredSearch}set scoredSearch(e){this.scoredSearch!==e&&(this.controller.scoredSearch=e)}get searchTokenizer(){return this.controller.searchTokenizer}set searchTokenizer(e){this.searchTokenizer!==e&&(this.controller.searchTokenizer=e)}get rowSelectionMethod(){return this.controller.rowSelectionMethod}set rowSelectionMethod(e){this.rowSelectionMethod!==e&&(this.controller.rowSelectionMethod=e)}get selectedRowIds(){return this.controller.selectedRowIds}set selectedRowIds(e){let i=new Set(this.selectedRowIds);i.size===e.length&&e.every(r=>i.has(r))||(this.controller.selectedRowIds=e)}get storageOptions(){return this.controller.storageOptions}set storageOptions(e){this.controller.storageOptions=e}get rowIdCallback(){return this.controller.rowIdCallback}set rowIdCallback(e){this.rowIdCallback!==e&&(this.controller.rowIdCallback=e)}getColumn(e){return this.controller.getColumn(e)}getDisplayColumn(e){let i=this.getColumn(e);if(i&&I(i))return i}getTableState(){return this.controller.getTableState()}updateTableState(e){return this.controller.updateTableState(e)}getColumnState(e){return this.controller.getColumnState(e)}updateColumnState(e,i){return this.controller.updateColumnState(e,i)}sort(e,i,r=!0){return this.controller.sort(e,i,r)}toggleColumnVisibility(e,i){return this.controller.toggleColumnVisibility(e,i)}showColumn(e){return this.controller.showColumn(e)}hideColumn(e){return this.controller.hideColumn(e)}moveColumn(e,i){return this.controller.moveColumn(e,i)}resizeColumn(e,i){return this.controller.resizeColumn(e,i)}isRowSelected(e){return this.controller.isRowSelected(e)}toggleRowSelection(e,i){return this.controller.toggleRowSelection(e,i)}selectRow(e){return this.controller.selectRow(e)}deselectRow(e){return this.controller.deselectRow(e)}selectAll(){return this.controller.selectAll()}deselectAll(){return this.controller.deselectAll()}export(e,i={includeAllRows:!1,includeHiddenColumns:!1,includeInternalColumns:!1}){let r=this.controller.export(i),o=document.createElement("a");o.style.display="none",o.href=URL.createObjectURL(r),o.download=`${e}.csv`,document.body.append(o),o.click(),o.remove()}async print(e){e&&(document.title=e);let i=new CSSStyleSheet;i.replaceSync(`
|
|
455
|
+
@media print {
|
|
456
|
+
body > *:not(.yatl-printable) {
|
|
457
|
+
display: none !important;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
body {
|
|
461
|
+
height: auto !important;
|
|
462
|
+
overflow: visible !important;
|
|
463
|
+
background: white !important;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
`);let r=document.adoptedStyleSheets;document.adoptedStyleSheets=[...r,i];let o=document.createElement("yatl-table");o.classList.add("yatl-printable"),o.controller=this.controller,o.virtualScroll=!1,document.body.append(o),await o.updateComplete,requestAnimationFrame(()=>{window.print(),o.remove(),document.adoptedStyleSheets=r})}scrollToRow(e){let i=this.data.findIndex(r=>r===e);if(typeof i=="number")return this.scrollToOriginalIndex(i);throw new Error("Row not in table")}scrollToOriginalIndex(e){let i=this.data[e];if(i){let r=this.filteredData.indexOf(i);if(r>=0)return this.scrollToFilteredIndex(r);throw new Error("Cannot scroll to filtered out row")}else throw new RangeError(`Row index ${e} out of range`)}async scrollToFilteredIndex(e){if(!this.filteredData[e])throw new RangeError(`Row index ${e} out of range`);await this.updateComplete,this.virtualizer?this.virtualizer.element(e)?.scrollIntoView({block:"start",behavior:"instant"}):this.tableElement.querySelector(`.row[data-filtered-index="${e}"]`)?.scrollIntoView({block:"start",behavior:"smooth"})}async scrollToPx(e){await this.updateComplete,this.virtualizer?this.virtualizer.scrollTop=e:this.tableElement.scrollTop=e}getRow(e){return this.controller.getRow(e)}findRow(e,i){return this.controller.findRow(e,i)}findRowIndex(e,i){return this.controller.findRowIndex(e,i)}updateRow(e,i){return this.controller.updateRow(e,i)}reflowVirtualizer(){let e=this.virtualizerRef;e&&(e._itemsChanged=!0,e._rangeChanged=!0,e._measureChildren(),e._itemsChanged=!1,e._rangeChanged=!1)}updateRowAtIndex(e,i){return this.controller.updateRowAtIndex(e,i)}deleteRow(...e){return this.controller.deleteRow(...e)}deleteRowAtIndex(e){return this.controller.deleteRowAtIndex(e)}renderColumnSortIcon(e,i){return e.sortable??this.sortable?f`<div
|
|
398
467
|
part="header-sort-icon"
|
|
399
|
-
class=${
|
|
400
|
-
></div>`:b}renderColumnResizer(e,i){return e.resizable??this.resizable?
|
|
468
|
+
class=${K({"sort-icon":!0,ascending:i.sort?.order==="asc",descending:i.sort?.order==="desc"})}
|
|
469
|
+
></div>`:b}renderColumnResizer(e,i){return e.resizable??this.resizable?f`
|
|
401
470
|
<div
|
|
402
471
|
part="header-resizer"
|
|
403
472
|
class="resizer"
|
|
404
473
|
@click=${r=>r.stopPropagation()}
|
|
405
474
|
@mousedown=${r=>this.handleResizeMouseDown(r,e.field)}
|
|
406
475
|
></div>
|
|
407
|
-
`:b}renderHeaderCell(e){if(!e)return b;let i=this.getColumnState(e.field),r=e.title??e.field,o="none";i.sort?.order==="asc"&&(o="ascending"),i.sort?.order==="desc"&&(o="descending");let n=i.visible?"columnheader":void 0,l=i.visible?!1:void 0,a={cell:!0,sortable:e.sortable??this.sortable};return this.renderCellWrapper(
|
|
476
|
+
`:b}renderHeaderCell(e){if(!e)return b;let i=this.getColumnState(e.field),r=e.title??e.field,o="none";i.sort?.order==="asc"&&(o="ascending"),i.sort?.order==="desc"&&(o="descending");let n=i.visible?"columnheader":void 0,l=i.visible?!1:void 0,a={cell:!0,sortable:e.sortable??this.sortable};return this.renderCellWrapper(f`
|
|
408
477
|
<div
|
|
409
|
-
role=${
|
|
410
|
-
aria-hidden=${
|
|
478
|
+
role=${S(n)}
|
|
479
|
+
aria-hidden=${S(l)}
|
|
411
480
|
aria-sort=${o}
|
|
412
481
|
aria-label=${r}
|
|
413
482
|
part="cell header-cell"
|
|
414
|
-
class=${
|
|
415
|
-
|
|
483
|
+
class=${K(a)}
|
|
484
|
+
title=${r}
|
|
485
|
+
draggable=${S(this.reorderable?!0:void 0)}
|
|
416
486
|
data-field=${e.field}
|
|
417
487
|
@dragstart=${c=>this.handleDragColumnStart(c,e.field)}
|
|
418
488
|
@dragenter=${this.handleDragColumnEnter}
|
|
@@ -431,88 +501,98 @@
|
|
|
431
501
|
${this.renderColumnResizer(e,i)}
|
|
432
502
|
<div part="drop-indicator" class="drop-indicator"></div>
|
|
433
503
|
</div>
|
|
434
|
-
`)}renderRowNumberHeader(){return this.renderCellWrapper(
|
|
435
|
-
<div role="rowgroup" part="header" class=${
|
|
504
|
+
`)}renderRowNumberHeader(){return this.renderCellWrapper(f`<div part="cell-index" class="cell-index"></div>`)}renderSelectionHeader(){return this.renderCellWrapper(f`<div part="cell-selector" class="cell-selector"></div>`)}renderHeader(){let e={header:!0,reorderable:this.reorderable};return f`
|
|
505
|
+
<div role="rowgroup" part="header" class=${K(e)}>
|
|
436
506
|
<div role="row" class="row header-row" part="row header-row">
|
|
437
507
|
${this.renderRowNumberHeader()} ${this.renderSelectionHeader()}
|
|
438
508
|
${this.displayColumns.map(i=>this.renderHeaderCell(i))}
|
|
439
509
|
</div>
|
|
440
510
|
</div>
|
|
441
|
-
`}renderCellContents(e,i,r){if(i.cellRenderer)return i.cellRenderer(e,i.field,r);if(e==null)return this.nullValuePlaceholder;let o=this.controller.getRowHighlightIndicies(r);return
|
|
511
|
+
`}renderCellContents(e,i,r){if(i.cellRenderer)return i.cellRenderer(e,i.field,r);if(e==null)return this.nullValuePlaceholder;let o=this.controller.getRowHighlightIndicies(r);return o?Qt(String(e),o[i.field]):e}renderCell(e,i){let r=C(i,e.field),o=e.cellParts?.call(this,r,e.field,i);Array.isArray(o)&&(o=o.join(" "));let l={cell:!0,"is-number":this.getInputTypeFromValue(r)==="number"},a=this.controller.getRowId(i),c=e.field;return e.editor&&!this.disableEditing&&this.editingState&&this.editingState.id===a&&this.editingState.field===c?this.renderCellWrapper(f`
|
|
512
|
+
<div
|
|
513
|
+
role="cell"
|
|
514
|
+
part="cell body-cell cell-${e.field}"
|
|
515
|
+
class=${K({...l,"is-editing":!0})}
|
|
516
|
+
data-field=${e.field}
|
|
517
|
+
>
|
|
518
|
+
${e.editor.render(r,c,i,this.controller)}
|
|
519
|
+
</div>
|
|
520
|
+
`):(typeof e.valueFormatter=="function"&&(r=e.valueFormatter(r,i)),this.renderCellWrapper(f`
|
|
442
521
|
<div
|
|
443
522
|
role="cell"
|
|
444
523
|
part="cell body-cell cell-${e.field} ${o}"
|
|
445
524
|
data-field=${e.field}
|
|
446
|
-
class=${
|
|
447
|
-
title=${
|
|
448
|
-
@click=${
|
|
525
|
+
class=${K(l)}
|
|
526
|
+
title=${S(r?String(r):void 0)}
|
|
527
|
+
@click=${h=>this.handleCellClick(h,i,c)}
|
|
528
|
+
@dblclick=${()=>this.handleCellDoubleClick(i,c)}
|
|
449
529
|
>
|
|
450
530
|
<span class="truncate">
|
|
451
531
|
${this.renderCellContents(r,e,i)}
|
|
452
532
|
</span>
|
|
453
533
|
</div>
|
|
454
|
-
`)}renderCheckbox(e,i){return this.useYatlUi?
|
|
534
|
+
`))}renderCheckbox(e,i){return this.useYatlUi?f`<yatl-checkbox
|
|
455
535
|
part="row-checkbox"
|
|
456
536
|
class="row-checkbox"
|
|
457
537
|
.checked=${i}
|
|
458
538
|
@change=${r=>this.handleRowSelectionClicked(r,e)}
|
|
459
|
-
></yatl-checkbox>`:
|
|
539
|
+
></yatl-checkbox>`:f`<input
|
|
460
540
|
part="row-checkbox"
|
|
461
541
|
class="row-checkbox"
|
|
462
542
|
type="checkbox"
|
|
463
543
|
.checked=${i}
|
|
464
544
|
@change=${r=>this.handleRowSelectionClicked(r,e)}
|
|
465
|
-
/>`}renderRowSelectorCell(e,i){return this.renderCellWrapper(
|
|
545
|
+
/>`}renderRowSelectorCell(e,i){return this.renderCellWrapper(f`
|
|
466
546
|
<div part="cell body-cell" class="cell body-cell">
|
|
467
547
|
<div part="row-selector-cell" class="row-selector-cell">
|
|
468
548
|
<label> ${this.renderCheckbox(e,i)} </label>
|
|
469
549
|
</div>
|
|
470
550
|
</div>
|
|
471
|
-
`)}renderRowNumberCell(e){return this.renderCellWrapper(
|
|
551
|
+
`)}renderRowNumberCell(e){return this.renderCellWrapper(f`
|
|
472
552
|
<div part="cell body-cell" class="cell body-cell">
|
|
473
553
|
<div part="row-number-cell" class="row-number-cell">${e}</div>
|
|
474
554
|
</div>
|
|
475
|
-
`)}renderRow(e,i){let r=this.isRowSelected(e),o=this.rowParts?.(e)??"";Array.isArray(o)&&(o=o.join(" "));let n={row:!0,selected:r,"row-even":i%2===0,"row-odd":i%2!==0},l=i+1;return
|
|
555
|
+
`)}renderRow(e,i){let r=this.isRowSelected(e),o=this.rowParts?.(e)??"";Array.isArray(o)&&(o=o.join(" "));let n={row:!0,selected:r,"row-even":i%2===0,"row-odd":i%2!==0},l=i+1;return f`
|
|
476
556
|
<div
|
|
477
557
|
role="row"
|
|
478
558
|
aria-rowindex=${l}
|
|
479
559
|
aria-selected=${r?"true":"false"}
|
|
480
560
|
part=${"row "+o}
|
|
481
|
-
class=${
|
|
561
|
+
class=${K(n)}
|
|
482
562
|
>
|
|
483
563
|
${this.renderRowNumberCell(l)}
|
|
484
564
|
${this.renderRowSelectorCell(e,r)}
|
|
485
565
|
${this.displayColumns.map(a=>this.renderCell(a,e))}
|
|
486
566
|
</div>
|
|
487
|
-
`}renderBodyContents(){return this.hasVisibleColumn()?this.data.length===0?
|
|
567
|
+
`}renderBodyContents(){return this.hasVisibleColumn()?this.data.length===0?f`
|
|
488
568
|
<div part="message" class="message">${this.emptyMessage}</div>
|
|
489
|
-
`:this.filteredData.length===0?
|
|
569
|
+
`:this.filteredData.length===0?f`
|
|
490
570
|
<div part="message" class="message">${this.noResultsMessage}</div>
|
|
491
|
-
`:this.
|
|
571
|
+
`:this.virtualScroll?f`
|
|
492
572
|
<lit-virtualizer
|
|
493
573
|
.items=${this.filteredData}
|
|
494
574
|
.renderItem=${(e,i)=>this.renderRow(e,i)}
|
|
495
575
|
>
|
|
496
576
|
</lit-virtualizer>
|
|
497
|
-
`:
|
|
498
|
-
${
|
|
499
|
-
`:
|
|
577
|
+
`:f`
|
|
578
|
+
${Y(this.filteredData,e=>this.controller.getRowId(e),(e,i)=>this.renderRow(e,i))}
|
|
579
|
+
`:f`
|
|
500
580
|
<div part="message" class="message">No visible columns.</div>
|
|
501
|
-
`}renderFooter(){if(
|
|
581
|
+
`}renderFooter(){if(this.hideFooter)return b;let e=this.data.length,i=this.filteredData.length,r=new Intl.NumberFormat(void 0),o=r.format(e),n=r.format(i),l=e!==i?`Showing ${n} of ${o} records`:`Total records: ${o}`,a=Intl.DateTimeFormat(void 0,{dateStyle:"short",timeStyle:"short"}),c=this.dataUpdateTimestamp?a.format(this.dataUpdateTimestamp):"Never";return f`
|
|
502
582
|
<div part="footer" class="footer">
|
|
503
583
|
<slot name="footer">
|
|
504
584
|
<span part="row-count">${l}</span>
|
|
505
585
|
<span part="timestamp">${c}</span>
|
|
506
586
|
</slot>
|
|
507
587
|
</div>
|
|
508
|
-
`}render(){let i={"--grid-template":this.getGridWidths().join(" ")};return
|
|
588
|
+
`}render(){let i={"--grid-template":this.getGridWidths().join(" ")};return f`
|
|
509
589
|
<div
|
|
510
590
|
role="table"
|
|
511
591
|
aria-label="Data Table"
|
|
512
592
|
aria-rowcount=${this.filteredData.length}
|
|
513
593
|
part="table"
|
|
514
594
|
class="table"
|
|
515
|
-
style=${
|
|
595
|
+
style=${Jt(i)}
|
|
516
596
|
>
|
|
517
597
|
<div class="scroller">
|
|
518
598
|
${this.renderHeader()}
|
|
@@ -522,7 +602,7 @@
|
|
|
522
602
|
</div>
|
|
523
603
|
${this.renderFooter()}
|
|
524
604
|
</div>
|
|
525
|
-
`}renderCellWrapper(e){return
|
|
605
|
+
`}renderCellWrapper(e){return f` <div class="cell-wrapper">${e}</div> `}connectedCallback(){super.connectedCallback(),this.addControllerListeners(this.controller),this.addEventListener("mousedown",this.handleMouseDown),this.addEventListener("keydown",this.handleCellInputKeypress),this.useYatlUi||customElements.whenDefined("yatl-checkbox").then(()=>{this.useYatlUi=!0})}disconnectedCallback(){super.disconnectedCallback(),this.removeControllerListeners(this.controller),this.removeEventListener("mousedown",this.handleMouseDown),this.removeEventListener("keydown",this.handleCellInputKeypress),window.removeEventListener("mousemove",this.handleResizeMouseMove),window.removeEventListener("mouseup",this.handleResizeMouseUp)}updated(e){super.updated(e),this.editor&&document.activeElement!==this.editor&&setTimeout(()=>{this.editor?.focus(),this.editor instanceof HTMLInputElement&&this.editor.select()})}addControllerListeners(e){for(let i of this.eventNames)e.addEventListener(i,this.redispatchControllerEvent)}removeControllerListeners(e){for(let i of this.eventNames)e.removeEventListener(i,this.redispatchControllerEvent)}hasVisibleColumn(){return this.displayColumns.map(e=>this.getColumnState(e.field)).filter(e=>e.visible).length>0}getGridWidths(){let e=[];this.rowNumbers?e.push("var(--yatl-row-number-column-width, 48px)"):e.push("0"),this.rowSelectionMethod?e.push("var(--yatl-row-selector-column-width, 48px)"):e.push("0");for(let i of this.displayColumns){let r=this.getColumnState(i.field),o=r.width!=null;r.visible?o?e.push(`${r.width}px`):e.push("minmax(50px, 1fr)"):o?e.push("0px"):e.push("minmax(0, 0fr)")}return e}getInputTypeFromValue(e){let i=typeof e;return i==="bigint"||i==="number"?"number":i==="boolean"?"boolean":e instanceof Date?"date":"text"}getNextEditableField(e,i){let r=0;i&&(r=this.displayColumns.findIndex(o=>o.field===i),r<0?r=0:r++);for(let o of this.displayColumns.slice(r))if(o.editor&&o.editor.canEdit(o.field,e))return o.field}async saveEdits(){if(!this.editingState)return;let{id:e,field:i,originalValue:r}=this.editingState,o=this.getDisplayColumn(i),n=this.getRow(e);if(!o?.editor||!n)return;let l,a=o.editor.save(r,i,n,this.controller);if(a instanceof Promise?l=await a:l=a,l!==void 0){let c={};ut(c,i,l),this.updateRow(e,c),this.dispatchEvent(new ce(n,e,i,r,l))}}handleCellDoubleClick(e,i){let r=this.getDisplayColumn(i);if(!r||!r.editor||!r.editor.canEdit(i,e))return;r.editor.reset();let o=C(e,i);this.editingState={id:this.controller.getRowId(e),field:i,originalValue:o}}handleCellInputKeypress(e){if(this.editingState){if(e.key==="Escape")this.editingState=null;else if(e.key==="Enter")this.saveEdits(),this.editingState=null;else if(e.key==="Tab"){this.saveEdits();let{id:i}=this.editingState,r=this.getRow(i),o=this.getNextEditableField(r,this.editingState.field);if(o)return this.handleCellDoubleClick(r,o);let n=this.filteredData.indexOf(r);if(n<0)return;n++,n>=this.filteredData.length&&(n=0);let l=this.filteredData[n];if(o=this.getNextEditableField(l),!o)return;this.handleCellDoubleClick(l,o),e.preventDefault()}}}handleMouseDown(e){let i=e.composedPath().filter(r=>r instanceof HTMLElement).some(r=>r.classList.contains("is-editing"));this.editingState&&!i&&(console.log("saving"),this.saveEdits(),this.editingState=null)}handleResizeMouseDown(e,i){e.preventDefault(),e.stopPropagation();let o=e.target.closest(".cell");if(!o)return;let n=this.displayColumns.findIndex(a=>a.field===i);if(n<0)return;this.tableElement.classList.add("resizing"),this.tableElement.querySelectorAll(".header .cell").forEach(a=>{let c=a.dataset.field;if(c){let h=this.getColumnState(c);h.width=a.getBoundingClientRect().width,this.updateColumnState(c,h)}});let l=this.getGridWidths();this.resizeState={active:!0,startX:e.pageX,startWidth:o.getBoundingClientRect().width,columnIndex:n+2,columnField:i,currentWidths:l},this.tableElement.style.setProperty("--grid-template",l.join(" ")),window.addEventListener("mousemove",this.handleResizeMouseMove),window.addEventListener("mouseup",this.handleResizeMouseUp)}};u.styles=[fi],g([He(".table")],u.prototype,"tableElement",2),g([He("lit-virtualizer")],u.prototype,"virtualizer",2),g([He(".cell.is-editing > *")],u.prototype,"editor",2),g([ft()],u.prototype,"useYatlUi",2),g([ft()],u.prototype,"editingState",2),g([m({attribute:!1})],u.prototype,"controller",1),g([m({attribute:!1})],u.prototype,"columns",1),g([m({attribute:!1})],u.prototype,"columnStates",1),g([m({attribute:!1})],u.prototype,"data",1),g([m({attribute:!1})],u.prototype,"filters",1),g([m({type:String,attribute:"search-query"})],u.prototype,"searchQuery",1),g([m({type:Boolean,attribute:"tokenized-search"})],u.prototype,"tokenizedSearch",1),g([m({type:Boolean,attribute:"scored-search"})],u.prototype,"scoredSearch",1),g([m({attribute:!1})],u.prototype,"searchTokenizer",1),g([m({type:String,attribute:"row-selection-method"})],u.prototype,"rowSelectionMethod",1),g([m({attribute:!1})],u.prototype,"selectedRowIds",1),g([m({attribute:!1})],u.prototype,"storageOptions",1),g([m({attribute:!1})],u.prototype,"rowIdCallback",1),g([m({type:Boolean,reflect:!0})],u.prototype,"striped",2),g([m({type:Boolean})],u.prototype,"sortable",2),g([m({type:Boolean})],u.prototype,"resizable",2),g([m({type:Boolean})],u.prototype,"reorderable",2),g([m({type:Boolean,attribute:"row-numbers"})],u.prototype,"rowNumbers",2),g([m({type:Boolean,attribute:"virtual-scroll"})],u.prototype,"virtualScroll",2),g([m({type:Boolean,attribute:"hide-footer"})],u.prototype,"hideFooter",2),g([m({type:Boolean,attribute:"disable-editing"})],u.prototype,"disableEditing",2),g([m({type:String,attribute:"null-value-placeholder"})],u.prototype,"nullValuePlaceholder",2),g([m({type:String,attribute:"empty-message"})],u.prototype,"emptyMessage",2),g([m({type:String,attribute:"no-results-message"})],u.prototype,"noResultsMessage",2),g([m({attribute:!1})],u.prototype,"rowParts",2),u=g([Gt("yatl-table")],u);return bi(Gi);})();
|
|
526
606
|
/*! Bundled license information:
|
|
527
607
|
|
|
528
608
|
@lit-labs/virtualizer/layouts/shared/SizeCache.js:
|
|
@@ -551,6 +631,8 @@
|
|
|
551
631
|
@lit/reactive-element/reactive-element.js:
|
|
552
632
|
lit-html/lit-html.js:
|
|
553
633
|
lit-element/lit-element.js:
|
|
634
|
+
lit-html/directive.js:
|
|
635
|
+
lit-html/directives/repeat.js:
|
|
554
636
|
@lit/reactive-element/decorators/custom-element.js:
|
|
555
637
|
@lit/reactive-element/decorators/property.js:
|
|
556
638
|
@lit/reactive-element/decorators/state.js:
|
|
@@ -560,8 +642,6 @@ lit-element/lit-element.js:
|
|
|
560
642
|
@lit/reactive-element/decorators/query-all.js:
|
|
561
643
|
@lit/reactive-element/decorators/query-async.js:
|
|
562
644
|
@lit/reactive-element/decorators/query-assigned-nodes.js:
|
|
563
|
-
lit-html/directive.js:
|
|
564
|
-
lit-html/directives/repeat.js:
|
|
565
645
|
lit-html/async-directive.js:
|
|
566
646
|
(**
|
|
567
647
|
* @license
|
|
@@ -576,8 +656,8 @@ lit-html/is-server.js:
|
|
|
576
656
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
577
657
|
*)
|
|
578
658
|
|
|
579
|
-
lit-html/directives/class-map.js:
|
|
580
659
|
lit-html/directives/if-defined.js:
|
|
660
|
+
lit-html/directives/class-map.js:
|
|
581
661
|
lit-html/directives/style-map.js:
|
|
582
662
|
(**
|
|
583
663
|
* @license
|
|
@@ -586,6 +666,7 @@ lit-html/directives/style-map.js:
|
|
|
586
666
|
*)
|
|
587
667
|
|
|
588
668
|
lit-html/directive-helpers.js:
|
|
669
|
+
lit-html/directives/live.js:
|
|
589
670
|
(**
|
|
590
671
|
* @license
|
|
591
672
|
* Copyright 2020 Google LLC
|