argus-table 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  var e=globalThis,t=e.ShadowRoot&&(e.ShadyCSS===void 0||e.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,n=Symbol(),r=/* @__PURE__ */ new WeakMap,i=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,n=this.t;if(t&&e===void 0){let t=n!==void 0&&n.length===1;t&&(e=r.get(n)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),t&&r.set(n,e))}return e}toString(){return this.cssText}},a=e=>new i(typeof e==`string`?e:e+``,void 0,n),o=(e,...t)=>new i(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,n),s=(n,r)=>{if(t)n.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let t of r){let r=document.createElement(`style`),i=e.litNonce;i!==void 0&&r.setAttribute(`nonce`,i),r.textContent=t.cssText,n.appendChild(r)}},c=t?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return a(t)})(e):e,{is:l,defineProperty:u,getOwnPropertyDescriptor:d,getOwnPropertyNames:f,getOwnPropertySymbols:p,getPrototypeOf:m}=Object,h=globalThis,g=h.trustedTypes,_=g?g.emptyScript:``,v=h.reactiveElementPolyfillSupport,y=(e,t)=>e,b={toAttribute(e,t){switch(t){case Boolean:e=e?_:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},x=(e,t)=>!l(e,t),ee={attribute:!0,type:String,converter:b,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol(`metadata`),h.litPropertyMetadata??=/* @__PURE__ */ new WeakMap;var S=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ee){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&u(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=d(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ee}static _$Ei(){if(this.hasOwnProperty(y(`elementProperties`)))return;let e=m(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(y(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y(`properties`))){let e=this.properties,t=[...f(e),...p(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=/* @__PURE__ */ new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(c(e))}else e!==void 0&&t.push(c(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=/* @__PURE__ */ new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=/* @__PURE__ */ new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=/* @__PURE__ */ new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return s(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?b:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?b:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??x)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=/* @__PURE__ */ new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=/* @__PURE__ */ new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=/* @__PURE__ */ new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};S.elementStyles=[],S.shadowRootOptions={mode:`open`},S[y(`elementProperties`)]=/* @__PURE__ */ new Map,S[y(`finalized`)]=/* @__PURE__ */ new Map,v?.({ReactiveElement:S}),(h.reactiveElementVersions??=[]).push(`2.1.2`);var te=globalThis,ne=e=>e,re=te.trustedTypes,ie=re?re.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,ae=`$lit$`,C=`lit$${Math.random().toFixed(9).slice(2)}$`,oe=`?`+C,se=`<${oe}>`,w=document,ce=()=>w.createComment(``),le=e=>e===null||typeof e!=`object`&&typeof e!=`function`,ue=Array.isArray,de=e=>ue(e)||typeof e?.[Symbol.iterator]==`function`,fe=`[
2
2
  \f\r]`,pe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,me=/-->/g,he=/>/g,T=RegExp(`>|${fe}(?:([^\\s"'>=/]+)(${fe}*=${fe}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),ge=/'/g,_e=/"/g,ve=/^(?:script|style|textarea|title)$/i,E=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),D=Symbol.for(`lit-noChange`),O=Symbol.for(`lit-nothing`),ye=/* @__PURE__ */ new WeakMap,k=w.createTreeWalker(w,129);function be(e,t){if(!ue(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return ie===void 0?t:ie.createHTML(t)}var xe=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=pe;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===pe?c[1]===`!--`?o=me:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=T):(ve.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=T):o=he:o===T?c[0]===`>`?(o=i??pe,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?T:c[3]===`"`?_e:ge):o===_e||o===ge?o=T:o===me||o===he?o=pe:(o=T,i=void 0);let d=o===T&&e[t+1].startsWith(`/>`)?` `:``;a+=o===pe?n+se:l>=0?(r.push(s),n.slice(0,l)+ae+n.slice(l)+C+d):n+C+(l===-2?t:d)}return[be(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},Se=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=xe(t,n);if(this.el=e.createElement(l,r),k.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=k.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(ae)){let t=u[o++],n=i.getAttribute(e).split(C),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Ee:r[1]===`?`?De:r[1]===`@`?Oe:Te}),i.removeAttribute(e)}else e.startsWith(C)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(ve.test(i.tagName)){let e=i.textContent.split(C),t=e.length-1;if(t>0){i.textContent=re?re.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],ce()),k.nextNode(),c.push({type:2,index:++a});i.append(e[t],ce())}}}else if(i.nodeType===8){if(i.data===oe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(C,e+1))!==-1;)c.push({type:7,index:a}),e+=C.length-1}}a++}}static createElement(e,t){let n=w.createElement(`template`);return n.innerHTML=e,n}};function A(e,t,n=e,r){if(t===D)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=le(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=A(e,i._$AS(e,t.values),i,r)),t}var Ce=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??w).importNode(t,!0);k.currentNode=r;let i=k.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new we(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new ke(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=k.nextNode(),a++)}return k.currentNode=w,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},we=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=O,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=A(this,e,t),le(e)?e===O||e==null||e===``?(this._$AH!==O&&this._$AR(),this._$AH=O):e!==this._$AH&&e!==D&&this._(e):e._$litType$===void 0?e.nodeType===void 0?de(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==O&&le(this._$AH)?this._$AA.nextSibling.data=e:this.T(w.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Se.createElement(be(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Ce(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=ye.get(e.strings);return t===void 0&&ye.set(e.strings,t=new Se(e)),t}k(t){ue(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(ce()),this.O(ce()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=ne(e).nextSibling;ne(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Te=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=O,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(/* @__PURE__ */ new String),this.strings=n):this._$AH=O}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=A(this,e,t,0),a=!le(e)||e!==this._$AH&&e!==D,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=A(this,r[n+o],t,o),s===D&&(s=this._$AH[o]),a||=!le(s)||s!==this._$AH[o],s===O?e=O:e!==O&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===O?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Ee=class extends Te{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===O?void 0:e}},De=class extends Te{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==O)}},Oe=class extends Te{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=A(this,e,t,0)??O)===D)return;let n=this._$AH,r=e===O&&n!==O||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==O&&(n===O||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},ke=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){A(this,e)}},Ae={M:ae,P:C,A:oe,C:1,L:xe,R:Ce,D:de,V:A,I:we,H:Te,N:De,U:Oe,B:Ee,F:ke},je=te.litHtmlPolyfillSupport;je?.(Se,we),(te.litHtmlVersions??=[]).push(`3.3.3`);var Me=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new we(t.insertBefore(ce(),e),e,void 0,n??{})}return i._$AI(e),i},Ne=globalThis,Pe=class extends S{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Me(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return D}};Pe._$litElement$=!0,Pe.finalized=!0,Ne.litElementHydrateSupport?.({LitElement:Pe});var Fe=Ne.litElementPolyfillSupport;Fe?.({LitElement:Pe}),(Ne.litElementVersions??=[]).push(`4.2.2`);var Ie=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},Le={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:x},Re=(e=Le,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=/* @__PURE__ */ new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function j(e){return(t,n)=>typeof n==`object`?Re(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}var ze={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Be=e=>(...t)=>({_$litDirective$:e,values:t}),Ve=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},He=Be(class extends Ve{constructor(e){if(super(e),e.type!==ze.CHILD)throw Error(`templateContent can only be used in child bindings`)}render(e){return this.vt===e?D:(this.vt=e,document.importNode(e.content,!0))}});function M(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var Ue=/* @__PURE__ */ new WeakMap;function We(e,t){Ue.set(e,t)}function Ge(e){Ue.delete(e)}function Ke(e){e&&Ue.get(e)?.()}var qe={fromAttribute(e){if(e===null)return;let t=e.trim().toLowerCase();if(t===`auto`)return`auto`;let n=/^(\d*\.?\d+)(px|fr)?$/.exec(t);if(!n)return;let r=Number(n[1]);return n[2]===`fr`?{flex:r}:r}},Je={fromAttribute(e){return e===null?void 0:e.trim().toLowerCase()!==`false`}},N=class extends S{constructor(...e){super(...e),this.columnId=``,this.#e=null,this.#n=new MutationObserver(()=>{this.#t=void 0,this.requestUpdate()})}#e;#t;#n;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#n.observe(this,{childList:!0}),this.#e=this.parentElement,Ke(this.#e)}disconnectedCallback(){super.disconnectedCallback(),this.#n.disconnect();let e=this.#e;this.#e=null,Ke(e)}toColumnDef(){if(this.#t)return this.#t;let e=[...this.children].find(e=>e instanceof HTMLTemplateElement);return this.#t={id:this.columnId,header:this.header,accessor:this.accessor,cell:this.cell??(e&&(()=>E`${He(e)}`)),width:this.width,minWidth:this.minWidth,maxWidth:this.maxWidth,pin:this.pin,align:this.align,sortable:this.sortable,resizable:this.resizable,reorderable:this.reorderable}}willUpdate(){this.#t=void 0}updated(){Ke(this.#e)}};M([j({attribute:`column-id`})],N.prototype,`columnId`,void 0),M([j()],N.prototype,`header`,void 0),M([j()],N.prototype,`accessor`,void 0),M([j({attribute:!1})],N.prototype,`cell`,void 0),M([j({converter:qe})],N.prototype,`width`,void 0),M([j({attribute:`min-width`,type:Number})],N.prototype,`minWidth`,void 0),M([j({attribute:`max-width`,type:Number})],N.prototype,`maxWidth`,void 0),M([j()],N.prototype,`pin`,void 0),M([j()],N.prototype,`align`,void 0),M([j({converter:Je})],N.prototype,`sortable`,void 0),M([j({converter:Je})],N.prototype,`resizable`,void 0),M([j({converter:Je})],N.prototype,`reorderable`,void 0),N=M([Ie(`argus-column`)],N);var Ye=`important`,Xe=` !`+Ye,Ze=Be(class extends Ve{constructor(e){if(super(e),e.type!==ze.ATTRIBUTE||e.name!==`style`||e.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(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r==null?t:t+`${n=n.includes(`-`)?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,`-$&`).toLowerCase()}:${r};`},``)}update(e,[t]){let{style:n}=e.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(let e of this.ft)t[e]??(this.ft.delete(e),e.includes(`-`)?n.removeProperty(e):n[e]=null);for(let e in t){let r=t[e];if(r!=null){this.ft.add(e);let t=typeof r==`string`&&r.endsWith(Xe);e.includes(`-`)||t?n.setProperty(e,t?r.slice(0,-11):r,t?Ye:``):n[e]=r}}return D}}),Qe=/* @__PURE__ */ new Map;function $e(e,t){let n=Qe.get(t);n||(n=t.split(`.`),Qe.set(t,n));let r=e;for(let e of n){if(r==null)return;r=r[e]}return r}function et(e){return e!==void 0&&Number.isFinite(e)?e:void 0}function tt(e){let t=/* @__PURE__ */ new Set;return e.map((e,n)=>{if(typeof e.id!=`string`||e.id===``)throw Error(`argus-table: column at index ${String(n)} needs a non-empty string id.`);if(t.has(e.id))throw Error(`argus-table: column id '${e.id}' is used more than once.`);t.add(e.id);let r=Math.max(0,et(e.minWidth)??40),i=Math.max(r,et(e.maxWidth)??1/0),a=e=>Math.min(i,Math.max(r,e)),o=e.pin===`start`||e.pin===`end`?e.pin:void 0,{width:s}=e,c=o===void 0&&typeof s==`object`&&Number.isFinite(s.flex)&&s.flex>0?s.flex:void 0,l=s===`auto`,u=typeof s==`number`?et(s):void 0,d=c===void 0?a(u??150):r,{accessor:f}=e,p=typeof f==`function`?f:typeof f==`string`?e=>$e(e,f):()=>void 0;return{id:e.id,index:n,header:e.header,cell:e.cell,getValue:p,hasAccessor:f!==void 0,width:d,flex:c,auto:l,minWidth:r,maxWidth:i,pin:o,sortable:e.sortable===!0,resizable:e.resizable!==!1,reorderable:e.reorderable!==!1,align:e.align??`start`}})}var nt=e=>e.pin??`center`;function rt(e,t){let n=new Map(t.map(e=>[e.id,e])),r=/* @__PURE__ */ new Set,i={start:[],center:[],end:[]};for(let t of e){let e=n.get(t);e&&!r.has(t)&&(r.add(t),i[nt(e)].push(t))}for(let e of t)r.has(e.id)||i[nt(e)].push(e.id);return[...i.start,...i.center,...i.end]}function it(e,t,n,r){let i=t.find(e=>e.id===n);if(!i?.reorderable||!Number.isInteger(r))return;let a=rt(e,t);if(r===a.indexOf(n))return;let o=new Map(t.map(e=>[e.id,nt(e)])),s=nt(i),c=a.findIndex(e=>o.get(e)===s),l=a.findLastIndex(e=>o.get(e)===s);if(r<c||r>l)return;let u=a.filter(e=>e!==n);return u.splice(r,0,n),u}function at(e,t){return typeof e==`function`?e(t):e}function P(e){if(Array.isArray(e))return e.map(P);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?F():{},r=Object.keys(e);for(let t=0;t<r.length;t++){let i=r[t];Object.defineProperty(n,i,{configurable:!0,enumerable:!0,value:P(e[i]),writable:!0})}return n}return e}function F(){return Object.create(null)}function ot(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function st(e,t){return n=>{(t.options.atoms?.[e]??t.baseAtoms[e]).set(e=>at(n,e))}}function ct(e){if(typeof e!=`object`||!e)return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function lt(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var ut=3;function dt(e,t){return ft(e,t,ut)}function ft(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!ct(e)||!ct(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;let r=lt(e),i=lt(t);if(r.length!==i.length)return!1;let a=e,o=t;for(let e=0;e<r.length;e++){let i=r[e];if(!Object.prototype.propertyIsEnumerable.call(t,i)||!ft(a[i],o[i],n-1))return!1}return!0}function pt(e,t,n,r=dt){let i=`on${t.charAt(0).toUpperCase()}${t.slice(1)}Change`,a=e.options[i];a&&a(e=>{let t=at(n,e);return r(e,t)?e:t})}function mt(e){return e instanceof Function}function ht(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}var gt=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e<l.length;e++)if(l[e]!==o[e]){u=!0;break}}return n?.(u),u&&(o=l,a?.(),s=e(...l??[]),r?.(s)),s}};function _t(e){let t=!1;return()=>{t?e():t=!0}}function vt({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o={onAfterUpdate:r?()=>{let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))}:void 0};return gt({...a,...o})}function yt(e,t=`_`){let[n,r]=e.replace(t,` `).split(` `);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function I(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=yt(r);t[n]=a?vt({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function L(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=yt(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=vt({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function R(e,t,n,...r){return e[t]?.(...r)??n(e,...r)}function bt(e){return e.row.getValue(e.column.id)}function xt(e){return e.getValue()??e.table.options.renderFallbackValue}function St(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}var Ct={assignCellPrototype:(e,t)=>{L(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>bt(e)},cell_renderValue:{fn:e=>xt(e)},cell_getContext:{fn:e=>St(e),memoDeps:e=>[e]}})}};function wt(e){if(!e._columnPrototype){e._columnPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignColumnPrototype?.(e._columnPrototype,e)}return e._columnPrototype}function Tt(e,t,n,r){let i={...e.getDefaultColumnDef(),...t},a=i.accessorKey,o=a===void 0?void 0:String(a),s=i.id??o?.replaceAll(`.`,`_`)??(typeof i.header==`string`?i.header:void 0),c;if(i.accessorFn)c=i.accessorFn;else if(a!==void 0){if(typeof a==`string`&&a.includes(`.`)){let e=a.split(`.`);c=t=>{let n=t;for(let t=0;t<e.length;t++){let r=e[t];n=n?.[r]}return n}}else c=e=>e[i.accessorKey]}if(!s)throw Error();let l=wt(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;e<d.length;e++)d[e](u);return u}function z(e){return e.getIsVisible?.()??!0}function B(e){return e.getVisibleLeafColumns?.()??e.getAllLeafColumns()}function Et(e){return e.getVisibleCells?.()??e.getAllCells()}function Dt(e){return e.getVisibleCellsByColumnId?.()??e.getAllCellsByColumnId()}function Ot(e,t){let n=e,r=t;return n.getOrderColumnsFn?.()(r)??n._orderGroupedColumns?.(r)??t}function kt(e,t,n,r){return e._orderByColumnPinning?.(t,n,r)??t}function V(e,t){return e.getPinnedVisibleLeafColumns?.(t)??(t&&t!==`center`?[]:B(e))}function At(e,t){return e._expandRows?.(t)??t}function jt(e){e.autoResetExpanded?.()}function Mt(e){e.autoResetPageIndex?.()}function Nt(e){e.autoResetSorting?.()}function Pt(e){e.autoResetCellSelection?.()}function Ft(e){return[e,...e.columns.flatMap(e=>e.getFlatColumns())]}function It(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return Ot(e.table,t)}return[e]}function Lt(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function Rt(e,t,n,r=0){let i=Array(t.length);for(let a=0;a<t.length;a++){if(!(a in t))continue;let o=t[a],s=Tt(e,o,r,n),c=o;s.columns=c.columns?Rt(e,c.columns,s,r+1):[],i[a]=s}return i}function zt(e){return Rt(e,e.options.columns)}function Bt(e){return e.getAllColumns().flatMap(e=>e.getFlatColumns())}function Vt(e){let t=F(),n=e.getAllFlatColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function Ht(e){return Ot(e,e.getAllColumns().flatMap(e=>e.getLeafColumns()))}function Ut(e){let t=F(),n=e.getAllLeafColumns();for(let e=0;e<n.length;e++){let r=n[e];t[r.id]=r}return t}function Wt(e,t){return e.getAllFlatColumnsById()[t]}var Gt={assignColumnPrototype:(e,t)=>{L(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>Ft(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>It(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{I(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>Lt(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>zt(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>Bt(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>Vt(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>Ht(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>Ut(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>Wt(e,t)}})}};function Kt(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignHeaderPrototype?.(e._headerPrototype,e)}return e._headerPrototype}function qt(e,t,n){let r=Kt(e),i=Object.create(r);i.colSpan=0,i.column=t,i.depth=n.depth,i.headerGroup=null,i.id=n.id??t.id,i.index=n.index,i.isPlaceholder=!!n.isPlaceholder,i.placeholderId=n.placeholderId,i.rowSpan=0,i.subHeaders=[];let a=e._headerInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function Jt(e,t=1){let n=t;for(let r=0;r<e.length;r++){let i=e[r];z(i)&&i.columns.length&&(n=Math.max(n,Jt(i.columns,t+1)))}return n}function Yt(e,t){return e?`${e}_${t}`:String(t)}function Xt(e,t,n,r){let i=e??``;return t&&(i=i?`${i}_${t}`:String(t)),n&&(i=i?`${i}_${n}`:n),r&&(i=i?`${i}_${r}`:r),i}function Zt(e,t){let n=0;for(let r=0;r<e.length;r++)e[r].column===t&&n++;return n}function Qt(e,t,n,r,i,a){let o={depth:t,id:Yt(r,t),headers:[]},s=[];for(let i=0;i<e.length;i++){if(!(i in e))continue;let a=e[i],c=s[s.length-1],l=a.column.depth===o.depth,u,d=!1;if(l&&a.column.parent?u=a.column.parent:(u=a.column,d=!0),c&&c.column===u)c.subHeaders.push(a);else{let e=qt(n,u,{id:Xt(r,t,u.id,a.id),isPlaceholder:d,placeholderId:d?String(Zt(s,u)):void 0,depth:t,index:s.length});e.subHeaders.push(a),s.push(e)}o.headers.push(a),a.headerGroup=o}for(let e=0;e<a.length;e++)a[e](o);i.push(o),t>0&&Qt(s,t-1,n,r,i,a)}function $t(e){for(let t=0;t<e.length;t++){let n=e[t];if(!z(n.column))continue;let r=0;if(n.subHeaders.length){$t(n.subHeaders);for(let e=0;e<n.subHeaders.length;e++){let t=n.subHeaders[e];z(t.column)&&(r+=t.colSpan)}}else r=1;if(n.colSpan=r,n.isPlaceholder&&n.subHeaders.length===1&&n.subHeaders[0].column===n.column){let e=1,t=n.subHeaders[0];for(;t;)t.rowSpan=0,e++,t=t.subHeaders.length===1&&t.subHeaders[0].column===n.column?t.subHeaders[0]:void 0;n.rowSpan=e}else n.rowSpan=1}}function en(e,t,n,r){let i=Jt(e),a=[],o=n._headerGroupInstanceInitFns,s=Array(t.length);for(let e=0;e<t.length;e++)e in t&&(s[e]=qt(n,t[e],{depth:i,index:e}));return Qt(s,i-1,n,r,a,o),a.reverse(),$t(a[0]?.headers??[]),a}function tn(e,t){for(let n=0;n<e.subHeaders.length;n++)tn(e.subHeaders[n],t);t.push(e)}function nn(e){let t=[];return tn(e,t),t}function rn(e){return{column:e.column,header:e,table:e.column.table}}function an(e){return en(e.getAllColumns(),kt(e,B(e),e=>e.id),e)}function on(e){return[...e.getHeaderGroups()].reverse()}function sn(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function cn(e){let t=e.getHeaderGroups()[0]?.headers??[],n=[];for(let e=0;e<t.length;e++){let r=t[e].getLeafHeaders();for(let e=0;e<r.length;e++)n.push(r[e])}return n}var ln={assignHeaderPrototype:(e,t)=>{L(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>nn(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>rn(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{I(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>an(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>on(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>sn(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>cn(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function un(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignRowPrototype?.(e._rowPrototype,e)}return e._rowPrototype}var dn=(e,t,n,r,i,a,o)=>{let s=un(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=F(),c._valuesCache=F(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;e<l.length;e++)l[e](c);return c};function fn(){return e=>vt({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>mn(e,e.options.data),onAfterUpdate:_t(()=>{jt(e),Mt(e),Nt(e),Pt(e)})})}function pn(e,t,n,r=0,i){let a=[];for(let o=0;o<n.length;o++){let s=n[o],c=dn(e,e.getRowId(s,o,i),s,o,r,void 0,i?.id);t.flatRows.push(c),t.rowsById[c.id]=c,a.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(s,o),c.originalSubRows?.length&&(c.subRows=pn(e,t,c.originalSubRows,r+1,c)))}return a}function mn(e,t){let n={rows:[],flatRows:[],rowsById:F()};return n.rows=pn(e,n,t),n}function hn(e){return e._rowModels.coreRowModel||(e._rowModels.coreRowModel=e.options.features.coreRowModel?.(e)??fn()(e)),e._rowModels.coreRowModel()}function gn(e){return e.getCoreRowModel()}function _n(e){return e._rowModels.filteredRowModel||(e._rowModels.filteredRowModel=e.options.features.filteredRowModel?.(e)),e.options.manualFiltering||!e._rowModels.filteredRowModel?e.getPreFilteredRowModel():e._rowModels.filteredRowModel()}function vn(e){return e.getFilteredRowModel()}function yn(e){return e._rowModels.groupedRowModel||(e._rowModels.groupedRowModel=e.options.features.groupedRowModel?.(e)),e.options.manualGrouping||!e._rowModels.groupedRowModel?e.getPreGroupedRowModel():e._rowModels.groupedRowModel()}function bn(e){return e.getGroupedRowModel()}function xn(e){return e._rowModels.sortedRowModel||(e._rowModels.sortedRowModel=e.options.features.sortedRowModel?.(e)),e.options.manualSorting||!e._rowModels.sortedRowModel?e.getPreSortedRowModel():e._rowModels.sortedRowModel()}function Sn(e){return e.getSortedRowModel()}function Cn(e){return e._rowModels.expandedRowModel||(e._rowModels.expandedRowModel=e.options.features.expandedRowModel?.(e)),e.options.manualExpanding||!e._rowModels.expandedRowModel?e.getPreExpandedRowModel():e._rowModels.expandedRowModel()}function wn(e){return e.getExpandedRowModel()}function Tn(e){return e._rowModels.paginatedRowModel||(e._rowModels.paginatedRowModel=e.options.features.paginatedRowModel?.(e)),e.options.manualPagination||!e._rowModels.paginatedRowModel?e.getPrePaginatedRowModel():e._rowModels.paginatedRowModel()}function En(e){return e.getPaginatedRowModel()}var Dn={constructTableAPIs:e=>{I(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>hn(e)},table_getPreFilteredRowModel:{fn:()=>gn(e)},table_getFilteredRowModel:{fn:()=>_n(e)},table_getPreGroupedRowModel:{fn:()=>vn(e)},table_getGroupedRowModel:{fn:()=>yn(e)},table_getPreSortedRowModel:{fn:()=>bn(e)},table_getSortedRowModel:{fn:()=>xn(e)},table_getPreExpandedRowModel:{fn:()=>Sn(e)},table_getExpandedRowModel:{fn:()=>Cn(e)},table_getPrePaginatedRowModel:{fn:()=>wn(e)},table_getPaginatedRowModel:{fn:()=>Tn(e)},table_getRowModel:{fn:()=>En(e)}})}};function On(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;n<t.length;n++)t[n].assignCellPrototype?.(e._cellPrototype,e)}return e._cellPrototype}function kn(e,t,n){let r=On(n),i=Object.create(r);i.column=e,i.id=`${t.id}_${e.id}`,i.row=t;let a=n._cellInstanceInitFns;for(let e=0;e<a.length;e++)a[e](i);return i}function An(e){let t=e.table.getRowsInDisplayOrder(),n=e._displayIndexCache;return t[n]===e?n:-1}function jn(e){let t=e.getPrePaginatedRowModel(),n=e.options.paginateExpandedRows===!1?At(e,t).rows:t.rows;for(let e=0;e<n.length;e++)n[e]._displayIndexCache=e;return n}function Mn(e,t){if(ot(e._valuesCache,t))return e._valuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return e._valuesCache[t]=n.accessorFn(e.original,e.index),e._valuesCache[t]}function Nn(e,t){if(ot(e._uniqueValuesCache,t))return e._uniqueValuesCache[t];let n=e.table.getColumn(t);if(n?.accessorFn)return n.columnDef.getUniqueValues?(e._uniqueValuesCache[t]=n.columnDef.getUniqueValues(e.original,e.index),e._uniqueValuesCache[t]):(e._uniqueValuesCache[t]=[e.getValue(t)],e._uniqueValuesCache[t])}function Pn(e,t){return e.getValue(t)??e.table.options.renderFallbackValue}function Fn(e){return ht(e.subRows,e=>e.subRows)}function In(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e<t.length;e++)n=Math.max(n,t[e].depth);return n}function Ln(e){if(e.parentId)return e.table.getCoreRowModel().rowsById[e.parentId]??e.table.getRow(e.parentId,!0)}function Rn(e){let t=[],n=e;for(;;){let e=n.getParentRow();if(!e)break;t.push(e),n=e}return t.reverse()}function zn(e){let t=e.table.getAllLeafColumns(),n=e._cellsCache;n||=e._cellsCache=/* @__PURE__ */ new WeakMap;let r=Array(t.length);for(let i=0;i<t.length;i++){let a=t[i],o=n.get(a);o||(o=kn(a,e,e.table),n.set(a,o)),r[i]=o}return r}function Bn(e){let t=F(),n=e.getAllCells();for(let e=0;e<n.length;e++){let r=n[e];t[r.column.id]=r}return t}function Vn(e,t,n,r){return t.options.getRowId?.(e,n,r)??(r?`${r.id}.${n}`:String(n))}function Hn(e,t,n){let r=(n?e.getPrePaginatedRowModel():e.getRowModel()).rowsById[t];if(!r&&(r=e.getCoreRowModel().rowsById[t],!r))throw Error();return r}var Un={assignRowPrototype:(e,t)=>{L(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>An(e)},row_getAllCellsByColumnId:{fn:e=>Bn(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>zn(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>Fn(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>Ln(e)},row_getParentRows:{fn:e=>Rn(e)},row_getUniqueValues:{fn:(e,t)=>Nn(e,t)},row_getValue:{fn:(e,t)=>Mn(e,t)},row_renderValue:{fn:(e,t)=>Pn(e,t)}})},constructTableAPIs:e=>{I(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>jn(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>Vn(t,e,n,r)},table_getRow:{fn:(t,n)=>Hn(e,t,n)},table_getMaxSubRowDepth:{fn:()=>In(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function Wn(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function Gn(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{Wn(e,t,n),e._reactivity.commit?.()})}function Kn(e){let t=P(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r];e.baseAtoms[i].set(t[i])}});let n=Object.values(e._features);for(let t=0;t<n.length;t++)n[t].resetTableInstanceData?.(e)}function qn(e,t){let{features:n,atoms:r,initialState:i}=e.options;if(!e.options.mergeOptions)return{...e.options,...t,features:n,atoms:r,initialState:i};let a=e.options.mergeOptions(e.options,t),o={...Object.getOwnPropertyDescriptors(a)};return Object.defineProperties(Object.create(Object.getPrototypeOf(a)),{...o,features:{value:n,enumerable:!0,configurable:!0,writable:!0},atoms:{value:r,enumerable:!0,configurable:!0,writable:!0},initialState:{value:i,enumerable:!0,configurable:!0,writable:!0}})}function Jn(e,t,n){let r=qn(e,at(t,e.options));e.optionsStore?e.optionsStore.set(()=>r):e.options=r,n?.syncExternalState!==!1&&Gn(e,r.state??null)}var Yn={coreCellsFeature:Ct,coreColumnsFeature:Gt,coreHeadersFeature:ln,coreRowModelsFeature:Dn,coreRowsFeature:Un,coreTablesFeature:{constructTableAPIs:e=>{I(`coreTablesFeature`,e,{table_reset:{fn:()=>Kn(e)},table_setOptions:{fn:t=>Jn(e,t)}})}}};function Xn(e){return e}function Zn(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}/* @__NO_SIDE_EFFECTS__ */
3
- function Qn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function $n(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var er=[],tr=0,{link:nr,unlink:rr,propagate:ir,checkDirty:ar,shallowPropagate:or}=/* @__PURE__ */ Qn({update(e){return e._update()},notify(e){er[cr++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,dr(e))}}),sr=0,cr=0,H,lr=0;function ur(e){try{++lr,e()}finally{--lr||fr()}}function dr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=rr(n,e)}function fr(){if(!(lr>0)){for(;sr<cr;){let e=er[sr];er[sr++]=void 0,e.notify()}sr=0,cr=0}}function pr(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return H!==void 0&&nr(i,H,tr),i._snapshot},subscribe(e){let t=$n(e),n={current:!1},r=mr(()=>{i.get(),n.current?(H=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=H,o=t?.compare??Object.is;if(n)H=i,++tr,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{H=a,n&&(i.flags&=-5),dr(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&ar(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&or(e)}}else e&32&&(i.flags=e&-33);return H!==void 0&&nr(i,H,tr),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ir(e),or(e),fr())}},i}function mr(e){let t=()=>{let t=H;H=n,++tr,n.depsTail=void 0,n.flags=6;try{return e()}finally{H=t,n.flags&=-5,dr(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&ar(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,dr(this)}};return t(),n}function hr(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=gr(e);if(n.length!==gr(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function gr(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function _r(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),P(t)}function vr(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:c,filterFns:l,filterMeta:u,filteredRowModel:d,groupedRowModel:f,paginatedRowModel:p,sortFns:m,sortedRowModel:h,tableMeta:g,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...Yn,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:l,sortFns:m},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=_r(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e<x.length;e++){let n=x[e];v.baseAtoms[n]=t.createWritableAtom(v.initialState[n],{debugName:`table/baseAtoms/${n}`}),v.atoms[n]=t.createReadonlyAtom(()=>{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&ot(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}Wn(v),v.store=Zn(t.createReadonlyAtom(()=>{let e={};for(let t=0;t<x.length;t++){let n=x[t];e[n]=v.atoms[n].get()}return e},{compare:hr,debugName:`table/store`}));for(let e=0;e<y.length;e++){let t=y[e];t.initTableInstanceData?.(v),t.initCellInstanceData&&v._cellInstanceInitFns.push(t.initCellInstanceData.bind(t)),t.initColumnInstanceData&&v._columnInstanceInitFns.push(t.initColumnInstanceData.bind(t)),t.initHeaderGroupInstanceData&&v._headerGroupInstanceInitFns.push(t.initHeaderGroupInstanceData.bind(t)),t.initHeaderInstanceData&&v._headerInstanceInitFns.push(t.initHeaderInstanceData.bind(t)),t.initRowInstanceData&&v._rowInstanceInitFns.push(t.initRowInstanceData.bind(t)),t.constructTableAPIs?.(v)}return v}function U(){return{start:[],end:[]}}function yr(e,t){let n=e.getLeafColumns(),r=[];for(let e=0;e<n.length;e++){let t=n[e].id;t&&r.push(t)}Er(e.table,e=>t===`end`?{start:e.start.filter(e=>!r.includes(e)),end:[...e.end.filter(e=>!r.includes(e)),...r]}:t===`start`?{start:[...e.start.filter(e=>!r.includes(e)),...r],end:e.end.filter(e=>!r.includes(e))}:{start:e.start.filter(e=>!r.includes(e)),end:e.end.filter(e=>!r.includes(e))})}function br(e){return e.getLeafColumns().some(t=>(t.columnDef.enablePinning??!0)&&(e.table.options.enableColumnPinning??!0))}function xr(e){let t=e.getLeafColumns(),{start:n,end:r}=e.table.atoms.columnPinning?.get()??U();for(let e=0;e<t.length;e++)if(n.includes(t[e].id))return`start`;for(let e=0;e<t.length;e++)if(r.includes(t[e].id))return`end`;return!1}function Sr(e){let t=xr(e);return t?e.table.atoms.columnPinning?.get()?.[t].indexOf(e.id)??-1:0}function Cr(e){let t=Et(e),{start:n,end:r}=e.table.atoms.columnPinning?.get()??U();if(!n.length&&!r.length)return t;let i=[...n,...r];return t.filter(e=>!i.includes(e.column.id))}function wr(e){let{start:t}=e.table.atoms.columnPinning?.get()??U();if(!t.length)return[];let n=Dt(e),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&(i.position=`start`,r.push(i))}return r}function Tr(e){let{end:t}=e.table.atoms.columnPinning?.get()??U();if(!t.length)return[];let n=Dt(e),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&(i.position=`end`,r.push(i))}return r}function Er(e,t){pt(e,`columnPinning`,t)}function Dr(e,t){Er(e,t?U():P(e.initialState.columnPinning??U()))}function Or(e,t){let n=e.atoms.columnPinning?.get();return t?!!n?.[t].length:!!(n?.start.length||n?.end.length)}function W(e){let t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{start:r}=e.atoms.columnPinning?.get()??U(),i=[];for(let e=0;e<r.length;e++){let t=n[r[e]];t&&z(t)&&i.push(t)}return en(t,i,e,`start`)}function G(e){let t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{end:r}=e.atoms.columnPinning?.get()??U(),i=[];for(let e=0;e<r.length;e++){let t=n[r[e]];t&&z(t)&&i.push(t)}return en(t,i,e,`end`)}function kr(e){let t=e.getAllColumns(),n=B(e),{start:r,end:i}=e.atoms.columnPinning?.get()??U();if(r.length||i.length){let e=[...r,...i];n=n.filter(t=>!e.includes(t.id))}return en(t,n,e,`center`)}function Ar(e){return[...R(e,`getStartHeaderGroups`,W)].reverse()}function jr(e){return[...R(e,`getEndHeaderGroups`,G)].reverse()}function Mr(e){return[...R(e,`getCenterHeaderGroups`,kr)].reverse()}function Nr(e){let t=R(e,`getStartHeaderGroups`,W),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Pr(e){let t=R(e,`getEndHeaderGroups`,G),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Fr(e){let t=R(e,`getCenterHeaderGroups`,kr),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Ir(e){return R(e,`getStartFlatHeaders`,Nr).filter(e=>!e.subHeaders.length)}function Lr(e){return R(e,`getEndFlatHeaders`,Pr).filter(e=>!e.subHeaders.length)}function Rr(e){return R(e,`getCenterFlatHeaders`,Fr).filter(e=>!e.subHeaders.length)}function zr(e){let{start:t}=e.atoms.columnPinning?.get()??U(),n=e.getAllLeafColumnsById(),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&r.push(i)}return r}function Br(e){let{end:t}=e.atoms.columnPinning?.get()??U(),n=e.getAllLeafColumnsById(),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&r.push(i)}return r}function Vr(e){let{start:t,end:n}=e.atoms.columnPinning?.get()??U();if(!t.length&&!n.length)return e.getAllLeafColumns();let r=[...t,...n];return e.getAllLeafColumns().filter(e=>!r.includes(e.id))}function Hr(e,t){return t?t===`start`?R(e,`getStartLeafColumns`,zr):t===`end`?R(e,`getEndLeafColumns`,Br):R(e,`getCenterLeafColumns`,Vr):e.getAllLeafColumns()}function Ur(e){return R(e,`getStartLeafColumns`,zr).filter(e=>z(e))}function Wr(e){return R(e,`getEndLeafColumns`,Br).filter(e=>z(e))}function Gr(e){return R(e,`getCenterLeafColumns`,Vr).filter(e=>z(e))}function Kr(e,t){return t?t===`start`?R(e,`getStartVisibleLeafColumns`,Ur):t===`end`?R(e,`getEndVisibleLeafColumns`,Wr):R(e,`getCenterVisibleLeafColumns`,Gr):B(e)}function qr(e,t,n,r){let i=e.atoms.columnPinning?.get();if(!i||!i.start.length&&!i.end.length)return t;let{start:a,end:o}=i,s=r?.();if(!s){s=F();for(let e=0;e<t.length;e++)s[n(t[e])]=t[e]}let c=[];for(let e=0;e<a.length;e++){let t=s[a[e]];t&&c.push(t)}for(let e=0;e<t.length;e++){let r=n(t[e]);!a.includes(r)&&!o.includes(r)&&c.push(t[e])}for(let e=0;e<o.length;e++){let t=s[o[e]];t&&c.push(t)}return c}var Jr={getInitialState:e=>({columnPinning:{...U(),...e.columnPinning},...e}),getDefaultTableOptions:e=>({onColumnPinningChange:st(`columnPinning`,e)}),assignColumnPrototype:(e,t)=>{L(`columnPinningFeature`,e,t,{column_pin:{fn:(e,t)=>yr(e,t)},column_getCanPin:{fn:e=>br(e)},column_getPinnedIndex:{fn:e=>Sr(e)},column_getIsPinned:{fn:e=>xr(e)}})},assignRowPrototype:(e,t)=>{L(`columnPinningFeature`,e,t,{row_getCenterVisibleCells:{fn:e=>Cr(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get(),e.table.atoms.columnVisibility?.get()]},row_getStartVisibleCells:{fn:e=>wr(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.start,e.table.atoms.columnVisibility?.get()]},row_getEndVisibleCells:{fn:e=>Tr(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.end,e.table.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{I(`columnPinningFeature`,e,{table_setColumnPinning:{fn:t=>Er(e,t)},table_resetColumnPinning:{fn:t=>Dr(e,t)},table_getIsSomeColumnsPinned:{fn:t=>Or(e,t)},table__orderByColumnPinning:{fn:(t,n,r)=>qr(e,t,n,r)},table_getStartHeaderGroups:{fn:()=>W(e),memoDeps:()=>[e.getAllColumns(),B(e),e.atoms.columnPinning?.get()?.start,e.atoms.columnOrder?.get()]},table_getCenterHeaderGroups:{fn:()=>kr(e),memoDeps:()=>[e.getAllColumns(),B(e),e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get()]},table_getEndHeaderGroups:{fn:()=>G(e),memoDeps:()=>[e.getAllColumns(),B(e),e.atoms.columnPinning?.get()?.end,e.atoms.columnOrder?.get()]},table_getStartFooterGroups:{fn:()=>Ar(e),memoDeps:()=>[R(e,`getStartHeaderGroups`,W)]},table_getCenterFooterGroups:{fn:()=>Mr(e),memoDeps:()=>[R(e,`getCenterHeaderGroups`,kr)]},table_getEndFooterGroups:{fn:()=>jr(e),memoDeps:()=>[R(e,`getEndHeaderGroups`,G)]},table_getStartFlatHeaders:{fn:()=>Nr(e),memoDeps:()=>[R(e,`getStartHeaderGroups`,W)]},table_getEndFlatHeaders:{fn:()=>Pr(e),memoDeps:()=>[R(e,`getEndHeaderGroups`,G)]},table_getCenterFlatHeaders:{fn:()=>Fr(e),memoDeps:()=>[R(e,`getCenterHeaderGroups`,kr)]},table_getStartLeafHeaders:{fn:()=>Ir(e),memoDeps:()=>[R(e,`getStartHeaderGroups`,W)]},table_getEndLeafHeaders:{fn:()=>Lr(e),memoDeps:()=>[R(e,`getEndHeaderGroups`,G)]},table_getCenterLeafHeaders:{fn:()=>Rr(e),memoDeps:()=>[R(e,`getCenterHeaderGroups`,kr)]},table_getStartLeafColumns:{fn:()=>zr(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndLeafColumns:{fn:()=>Br(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterLeafColumns:{fn:()=>Vr(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedLeafColumns:{fn:t=>Hr(e,t)},table_getStartVisibleLeafColumns:{fn:()=>Ur(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterVisibleLeafColumns:{fn:()=>Gr(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndVisibleLeafColumns:{fn:()=>Wr(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedVisibleLeafColumns:{fn:t=>Kr(e,t)}})}};function Yr(){return F()}function Xr(){return{size:150,minSize:20,maxSize:2**53-1}}function Zr(e){let t=Xr(),n=e.table.atoms.columnSizing?.get(),r=n&&ot(n,e.id)?n[e.id]:void 0;return Math.min(Math.max(e.columnDef.minSize??t.minSize,r??e.columnDef.size??t.size),e.columnDef.maxSize??t.maxSize)}function Qr(e){let t=F(),n=F(),r=Array(e.length),i=0;for(let n=0;n<e.length;n++){let a=e[n],o=R(a,`getSize`,Zr);r[n]=o,t[a.id]=i,i+=o}let a=0;for(let t=e.length-1;t>=0;t--)n[e[t].id]=a,a+=r[t];return{starts:t,afters:n}}function $r(e){return{all:Qr(V(e)),center:Qr(V(e,`center`)),start:Qr(V(e,`start`)),end:Qr(V(e,`end`))}}function ei(e){return e===`start`?`start`:e===`end`?`end`:e===`center`?`center`:`all`}function ti(e,t){return R(e.table,`getColumnOffsets`,$r)[ei(t)].starts[e.id]??0}function ni(e,t){return R(e.table,`getColumnOffsets`,$r)[ei(t)].afters[e.id]??0}function ri(e){si(e.table,t=>{let n=F(),r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i];a!==e.id&&(n[a]=t[a])}return n})}function ii(e){if(!e.subHeaders.length)return Zr(e.column);let t=0;for(let n=0;n<e.subHeaders.length;n++)t+=ii(e.subHeaders[n]);return t}function ai(e){return ii(e)}function oi(e){if(e.index>0){let t=e.headerGroup?.headers[e.index-1];if(t)return R(t,`getStart`,oi)+R(t,`getSize`,ai)}return 0}function si(e,t){e.options.onColumnSizingChange?.(t)}function ci(e,t){si(e,t?F():Object.assign(F(),P(e.initialState.columnSizing??{})))}function li(e){let t=0;for(let n=0;n<e.length;n++)t+=R(e[n],`getSize`,Zr);return t}function ui(e){return e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+ai(t),0)??0}function di(e){return li(V(e,`start`))}function fi(e){return li(V(e,`center`))}function pi(e){return li(V(e,`end`))}var mi={getInitialState:e=>({columnSizing:Yr(),...e}),getDefaultColumnDef:()=>Xr(),getDefaultTableOptions:e=>({onColumnSizingChange:st(`columnSizing`,e)}),assignColumnPrototype:(e,t)=>{L(`columnSizingFeature`,e,t,{column_getSize:{fn:e=>Zr(e),memoDeps:e=>[t.options.columns,t.atoms.columnSizing?.get()?.[e.id]]},column_getStart:{fn:(e,t)=>ti(e,t)},column_getAfter:{fn:(e,t)=>ni(e,t)},column_resetSize:{fn:e=>ri(e)}})},assignHeaderPrototype:(e,t)=>{L(`columnSizingFeature`,e,t,{header_getSize:{fn:e=>ai(e),memoDeps:e=>[t.options.columns,e.column.columns.length>0?t.atoms.columnSizing?.get():t.atoms.columnSizing?.get()?.[e.column.id]]},header_getStart:{fn:e=>oi(e),memoDeps:()=>[t.options.columns,t.atoms.columnSizing?.get(),t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode]}})},constructTableAPIs:e=>{I(`columnSizingFeature`,e,{table_getColumnOffsets:{fn:()=>$r(e),memoDeps:()=>[e.options.columns,e.atoms.columnSizing?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_setColumnSizing:{fn:t=>si(e,t)},table_resetColumnSizing:{fn:t=>ci(e,t)},table_getTotalSize:{fn:()=>ui(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getStartTotalSize:{fn:()=>di(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getCenterTotalSize:{fn:()=>fi(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getEndTotalSize:{fn:()=>pi(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]}})}},hi=/([0-9]+)/gm;/* @__NO_SIDE_EFFECTS__ */
4
- function gi(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r),o=t.resolveDataValue;return o&&(i=o(i),a=o(a)),t.sort(i,a,e,n,r)},e);return t}var _i=/* @__PURE__ */ gi({resolveDataValue:e=>Ci(e).toLowerCase(),sort:(e,t)=>wi(e,t)}),vi=/* @__PURE__ */ gi({resolveDataValue:e=>Ci(e).toLowerCase(),sort:(e,t)=>xi(e,t)}),yi=/* @__PURE__ */ gi({resolveDataValue:e=>Si(e),sort:(e,t)=>e>t?1:e<t?-1:0}),bi=/* @__PURE__ */ gi({sort:(e,t)=>xi(e,t)});function xi(e,t){return e===t?0:e>t?1:-1}function Si(e){return e instanceof Date?e.getTime():e}function Ci(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function wi(e,t){let n=0,r=0,i=e.length,a=t.length;for(;n<i&&r<a;){let i=Ti(e.charCodeAt(n)),a=Ti(t.charCodeAt(r)),o=Ei(e,n,i),s=Ei(t,r,a);if(!i&&!a){let i=Di(e,n,o,t,r,s);if(i)return i;n=o,r=s;continue}if(i!==a)return i?1:-1;let c=Oi(e,n,o,t,r,s);if(c)return c;n=o,r=s}return Ai(e,n)-Ai(t,r)}function Ti(e){return e>=48&&e<=57}function Ei(e,t,n){let r=t+1;for(;r<e.length&&Ti(e.charCodeAt(r))===n;)r++;return r}function Di(e,t,n,r,i,a){let o=n-t,s=a-i,c=o<s?o:s;for(let n=0;n<c;n++){let a=e.charCodeAt(t+n),o=r.charCodeAt(i+n);if(a>o)return 1;if(o>a)return-1}return o>s?1:s>o?-1:0}function Oi(e,t,n,r,i,a){let o=t;for(;o<n&&e.charCodeAt(o)===48;)o++;let s=i;for(;s<a&&r.charCodeAt(s)===48;)s++;let c=n-o,l=a-s;if(c===0&&l===0)return 0;if(c<=15&&l<=15){let t=ki(e,o,n),i=ki(r,s,a);return t>i?1:i>t?-1:0}let u=parseInt(e.slice(t,n),10),d=parseInt(r.slice(i,a),10);return u>d?1:d>u?-1:0}function ki(e,t,n){let r=0;for(let i=t;i<n;i++)r=r*10+e.charCodeAt(i)-48;return r}function Ai(e,t){let n=0,r=t;for(;r<e.length;)n++,r=Ei(e,r,Ti(e.charCodeAt(r)));return n}function ji(){return[]}function Mi(e,t){pt(e,`sorting`,t)}function Ni(e,t){Mi(e,t?[]:P(e.initialState.sorting??[]))}function Pi(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&Ni(e)}function Fi(e){let t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10),r,i=!1;for(let t=0;t<n.length;t++){let a=n[t].getValue(e.id);if(Object.prototype.toString.call(a)===`[object Date]`){r=`datetime`;break}if(typeof a==`string`&&(i=!0,a.split(hi).length>1)){r=`alphanumeric`;break}}if(!r&&i&&(r=`text`),r){let e=t?.[r];if(e||r===`alphanumeric`&&(e=t?.text),e)return e}return bi}function Ii(e){let t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<t.length;n++){let r=t[n].getValue(e.id);if(r!=null)return typeof r==`string`?`asc`:`desc`}return`desc`}function Li(e){let t=e.table._rowModelFns.sortFns;return mt(e.columnDef.sortFn)?e.columnDef.sortFn:e.columnDef.sortFn===`auto`?Fi(e):t?.[e.columnDef.sortFn]??bi}function Ri(e,t,n){let r=Bi(e,n&&Hi(e)),i=t!==void 0;Mi(e.table,a=>{let o=a.findIndex(t=>t.id===e.id),s=o===-1?void 0:a[o],c=[],l,u=i?t:r===`desc`,d=!!(a.length&&Hi(e)&&n);return l=d?s?`toggle`:`add`:s?`toggle`:`replace`,l===`toggle`&&(i||r||(l=`remove`)),l===`add`?(c=[...a,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??2**53-1))):c=l===`toggle`?d?a.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:l===`remove`?d?a.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function zi(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??Ii(e)===`desc`?`desc`:`asc`}function Bi(e,t){let n=zi(e),r=Ui(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r===`desc`?`asc`:`desc`:n}function Vi(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function Hi(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function Ui(e){let t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return t?t.desc?`desc`:`asc`:!1}function Wi(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function Gi(e){Mi(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}function Ki(e){let t=Vi(e);return n=>{t&&Ri(e,void 0,Hi(e)?e.table.options.isMultiSortEvent?.(n):!1)}}var qi={getInitialState(e){return{sorting:ji(),...e}},getDefaultColumnDef(){return{sortFn:`auto`,sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:st(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}},assignColumnPrototype(e,t){L(`rowSortingFeature`,e,t,{column_getAutoSortFn:{fn:e=>Fi(e)},column_getAutoSortDir:{fn:e=>Ii(e)},column_getSortFn:{fn:e=>Li(e)},column_toggleSorting:{fn:(e,t,n)=>Ri(e,t,n)},column_getFirstSortDir:{fn:e=>zi(e)},column_getNextSortingOrder:{fn:(e,t)=>Bi(e,t)},column_getCanSort:{fn:e=>Vi(e)},column_getCanMultiSort:{fn:e=>Hi(e)},column_getIsSorted:{fn:e=>Ui(e)},column_getSortIndex:{fn:e=>Wi(e)},column_clearSorting:{fn:e=>Gi(e)},column_getToggleSortingHandler:{fn:e=>Ki(e)}})},constructTableAPIs(e){I(`rowSortingFeature`,e,{table_autoResetSorting:{fn:()=>Pi(e)},table_setSorting:{fn:t=>Mi(e,t)},table_resetSorting:{fn:t=>Ni(e,t)}})}};function Ji(){return{createOptionsStore:!0,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},batch:ur,schedule:e=>queueMicrotask(e),untrack:e=>e(),createReadonlyAtom:(e,t)=>pr(()=>e(),{compare:t?.compare}),createWritableAtom:(e,t)=>pr(e,{compare:t?.compare})}}function Yi(){return e=>{let t;return()=>{let n=e.getPreSortedRowModel(),r=e.options.state?.sorting,i=t;if(i&&i.sorting===r&&i.source===n)return i.model;let a=Xi(e,n,r??[]);return t={sorting:r,source:n,model:a},a}}}function Xi(e,t,n){let r=t.rows,i=[];for(let{id:t,desc:a}of n){let n=e.getColumn(t);if(!n||!Vi(n))continue;let o=Li(n),s=n.columnDef,c=n.accessorFn,l=o.resolveDataValue,u=s.sortUndefined;i.push({keys:r.map(e=>{let t=c?.(e.original,e.index);return l&&!(t===void 0&&u)?l(t):t}),compare:o.sort,sign:(a?-1:1)*(s.invertSorting?-1:1),sortUndefined:u})}if(!i.length||!r.length)return t;let a=r.map((e,t)=>t).sort((e,t)=>{for(let{keys:n,compare:r,sign:a,sortUndefined:o}of i){let i=n[e],s=n[t],c=0;if(o&&(i===void 0||s===void 0)){if(i===void 0&&s===void 0)continue;if(o===`first`)return i===void 0?-1:1;if(o===`last`)return i===void 0?1:-1;c=i===void 0?o:-o}if(c===0&&(c=r(i,s)),c!==0)return c*a}return(r[e]?.index??e)-(r[t]?.index??t)}).map(e=>r[e]).filter(e=>e!==void 0);return{rows:a,flatRows:a,rowsById:t.rowsById}}var Zi=Xn({coreReactivityFeature:Ji(),columnPinningFeature:Jr,columnSizingFeature:mi,rowSortingFeature:qi,sortedRowModel:Yi(),sortFns:{alphanumeric:_i,basic:bi,datetime:yi,text:vi}}),Qi=(e,t)=>String(t);function $i(e){return{id:e.id,accessorFn:e.getValue,size:e.width,minSize:e.minWidth,maxSize:e.maxWidth,enableSorting:e.sortable,sortUndefined:`last`}}function ea(e){let t=e,n=tt(t.columns),r=new Map(n.map(e=>[e.id,e])),i=new Map(n.map(e=>[e.id,$i(e)])),a,o,s=()=>{if(o)return o;let e=t.autoWidths;if(!e)return o=t.columnSizing;let r={};for(let t of n){let n=e[t.id];t.auto&&n!==void 0&&Number.isFinite(n)&&(r[t.id]=Math.min(t.maxWidth,Math.max(t.minWidth,n)))}return o={...r,...t.columnSizing}},c,l=()=>c??=rt(t.columnOrder??[],n),u=/* @__PURE__ */ new WeakMap,d,f,p=()=>{let e=l();if(f?.order!==e){let t=e=>r.get(e)?.pin;f={order:e,columns:e.flatMap(e=>i.get(e)??[]),pinning:{start:e.filter(e=>t(e)===`start`),end:e.filter(e=>t(e)===`end`)}}}return f},m=()=>({features:Zi,columns:p().columns,data:t.remote?[]:t.data,getRowId:t.getRowId??Qi,state:{sorting:t.sorting,columnSizing:s(),columnPinning:p().pinning},onSortingChange:()=>void 0,onColumnSizingChange:()=>void 0,onColumnPinningChange:()=>void 0}),h=vr(m()),g=()=>h.getRowModel().rows,_=e=>t.pinnedRows?.[e]??[],v=()=>{let e=h.getStartLeafColumns(),n=h.getCenterLeafColumns(),i=h.getEndLeafColumns(),a=t.sorting,o=(e,n,i,o)=>{let s=r.get(e.id);if(!s)throw Error(`argus-table: unknown column '${e.id}'.`);let c=a.find(t=>t.id===e.id);return{id:s.id,colIndex:n,pin:s.pin,offset:i,pinEdge:o,width:e.getSize(),flex:t.columnSizing[s.id]===void 0?s.flex:void 0,auto:s.auto&&t.columnSizing[s.id]===void 0,minWidth:s.minWidth,maxWidth:s.maxWidth,sortable:s.sortable,resizable:s.resizable,reorderable:s.reorderable,align:s.align,sorted:c?c.desc?`desc`:`asc`:!1,header:s.header,cell:s.cell,hasAccessor:s.hasAccessor}};return[...e.map((t,n)=>o(t,n+1,t.getStart(`start`),n===e.length-1)),...n.map((t,n)=>o(t,e.length+n+1,t.getStart(`center`),!1)),...i.map((t,r)=>o(t,e.length+n.length+r+1,t.getAfter(`end`),r===0))]};return{update(e){let s={...t,...e};Object.keys(e).some(n=>e[n]!==t[n])&&(e.columns&&e.columns!==t.columns&&(n=tt(e.columns),r=new Map(n.map(e=>[e.id,e])),i=new Map(n.map(e=>[e.id,$i(e)]))),(s.columns!==t.columns||s.columnSizing!==t.columnSizing||s.autoWidths!==t.autoWidths)&&(o=void 0),(s.columns!==t.columns||s.columnOrder!==t.columnOrder)&&(c=void 0),t=s,a=void 0,h.setOptions(e=>({...e,...m()})))},get columns(){return a??=v()},get rowCount(){return t.remote?.rowCount??g().length},get totalWidth(){return h.getTotalSize()},rowAt(e){if(t.remote){let n=t.remote.entryAt(e);return n&&{id:n.id,index:e,original:n.row}}let n=g()[e];if(!n)return;let r=u.get(n);return r?.index!==e&&(r={id:n.id,index:e,original:n.original},u.set(n,r)),r},indexOf(e){if(t.remote)return t.remote.indexOf(e);let n=g();return d?.rows!==n&&(d={rows:n,map:new Map(n.map((e,t)=>[e.id,t]))}),d.map.get(e)},valueAt(e,n){if(t.remote){let i=t.remote.entryAt(e);return i&&r.get(n)?.getValue(i.row,e)}return g()[e]?.getValue(n)},cellContext(e,n){if(t.remote){let i=t.remote.entryAt(e),a=r.get(n);return!i||!a?void 0:{row:i.row,rowId:i.id,index:e,columnId:n,value:a.getValue(i.row,e)}}let i=g()[e];if(i&&r.has(n))return{row:i.original,rowId:i.id,index:e,columnId:n,value:i.getValue(n)}},nextSorting(e){if(r.get(e)?.sortable!==!0)return;let n=t.sorting.find(t=>t.id===e);return n?n.desc?[]:[{id:e,desc:!0}]:[{id:e,desc:!1}]},nextSizing(e,n){let i=r.get(e);if(!i?.resizable||!Number.isFinite(n))return;let a=Math.round(Math.min(i.maxWidth,Math.max(i.minWidth,n)));return{...t.columnSizing,[e]:a}},orderOf(e){return e===void 0?l():rt(e,n)},nextOrder(e,t,r){return it(r??l(),n,e,t)},pinnedCount(e){return _(e).length},pinnedRowAt(e,n){if(n<0||n>=_(e).length)return;let r=_(e)[n];return{id:t.getRowId?t.getRowId(r,n):`${e}-${String(n)}`,index:n,original:r}},pinnedValueAt(e,t,n){if(!(t<0||t>=_(e).length))return r.get(n)?.getValue(_(e)[t],t)},pinnedCellContext(e,t,n){let i=this.pinnedRowAt(e,t),a=r.get(n);if(i&&a)return{row:i.original,rowId:i.id,index:t,columnId:n,value:a.getValue(i.original,t),pinned:e}}}}var ta=class{constructor(e,t,n){this.top=e,this.body=t,this.bottom=n}get total(){return 1+this.top+this.body+this.bottom}position({section:e,index:t}){switch(e){case`header`:return 0;case`top`:return 1+t;case`body`:return 1+this.top+t;case`bottom`:return 1+this.top+this.body+t}}at(e){if(!Number.isInteger(e)||e<0||e>=this.total)return;if(e===0)return{section:`header`,index:0};let t=e-1;return t<this.top?{section:`top`,index:t}:(t-=this.top,t<this.body?{section:`body`,index:t}:{section:`bottom`,index:t-this.body})}ariaRowIndex(e){return this.position(e)+1}fromAriaRowIndex(e){return this.at(e-1)}};function na(e){let t=e,n=!1;return{get value(){return t},get controlled(){return n},set(e){e===void 0?n=!1:(n=!0,t=e)},request(e){return n||(t=e),{value:e,applied:!n}}}}var ra=class{#e=/* @__PURE__ */ new Map;#t=[];#n=0;#r;get size(){return this.#n}get pinned(){return this.#r}pin(e){this.#r=e}slotOf(e){return this.#e.get(e)}update(e){let t=new Set(e);this.#r!==void 0&&t.add(this.#r);for(let[e,n]of this.#e)t.has(e)||(this.#e.delete(e),this.#t.push(n));for(let e of t)this.#e.has(e)||this.#e.set(e,this.#t.pop()??this.#n++);let n=[];for(let[e,t]of this.#e)n.push({id:e,slot:t});return n.sort((e,t)=>e.slot-t.slot)}clear(){this.#e.clear(),this.#t=[],this.#n=0,this.#r=void 0}},ia=class{#e=0;#t=1/0;#n;configure(e,t){return e===this.#e&&t===this.#t?!1:(this.#e=e,this.#t=t,this.#n=void 0,!0)}get scaled(){return this.#e>this.#t}get size(){return Math.min(this.#e,this.#t)}get excess(){return this.#e-this.size}toLogical(e,t){if(!this.scaled||t<=0)return e;let n=this.#n;return n?.physical===e?n.logical:aa(e,t)*(t+this.excess)/t}toPhysical(e,t){if(!this.scaled||t<=0)return e;let n=t+this.excess;return aa(e,n)*t/n}land(e,t){this.#n=this.scaled?{physical:t,logical:e}:void 0}},aa=(e,t)=>Math.min(Math.max(e,0),t),oa=class{#e;#t=/* @__PURE__ */ new Map;#n=/* @__PURE__ */ new Map;#r=/* @__PURE__ */ new Set;#i=/* @__PURE__ */ new Map;#a;#o;constructor(e){this.pageSize=Math.max(1,Math.floor(e.pageSize)),this.#e=e.getRowId??((e,t)=>String(t)),this.#a=Math.max(0,Math.floor(e.rowCount??this.pageSize)),this.#o=e.totalKnown??!1}get rowCount(){return this.#a}get totalKnown(){return this.#o}pageOf(e){return Math.floor(e/this.pageSize)}entryAt(e){if(!(e<0||e>=this.#a))return this.#t.get(this.pageOf(e))?.[e%this.pageSize]}indexOf(e){return this.#i.get(e)}stateAt(e){return this.entryAt(e)?`loaded`:this.#r.has(this.pageOf(e))?`error`:`loading`}missingPages(e,t){let n=Math.min(t,this.#a)-1,r=[];if(n<0)return r;for(let t=this.pageOf(Math.max(0,e));t<=this.pageOf(n);t++)this.#t.has(t)||this.#n.has(t)||this.#r.has(t)||r.push(t);return r}begin(e){let t=e*this.pageSize,n=t+this.pageSize;return this.#o&&(n=Math.min(n,this.#a)),this.#r.delete(e),this.#n.set(e,n),{start:t,end:n}}resolve(e,t,n){let r=this.#n.get(e);if(r===void 0)return!1;this.#n.delete(e);let i=e*this.pageSize,a=r-i,o=t.slice(0,a).map((e,t)=>({id:this.#e(e,i+t),row:e}));return this.#c(e),o.length>0&&this.#t.set(e,o),o.forEach((e,t)=>this.#i.set(e.id,i+t)),n!==void 0&&Number.isFinite(n)&&n>=0?this.#s(Math.floor(n),!0):o.length<a?this.#s(i+o.length,!0):this.#o||this.#s(Math.max(this.#a,r+this.pageSize),!1),!0}fail(e){return this.#n.delete(e)?(this.#r.add(e),!0):!1}retry(e){this.#r.delete(e)}cancel(e){this.#n.delete(e)}isFailed(e){return this.#r.has(e)}inFlightOutside(e,t){let n=this.pageOf(Math.max(0,e)),r=this.pageOf(Math.max(0,t-1));return[...this.#n.keys()].filter(e=>e<n||e>r)}evictOutside(e,t){let n=this.pageOf(Math.max(0,e))-10,r=this.pageOf(Math.max(0,t-1))+10;for(let e of[...this.#t.keys()])(e<n||e>r)&&this.#c(e);for(let e of[...this.#r])(e<n||e>r)&&this.#r.delete(e)}get loadedPages(){return this.#t.size}#s(e,t){this.#a=e,this.#o=t;for(let t of[...this.#t.keys()])t*this.pageSize>=e&&this.#c(t)}#c(e){let t=this.#t.get(e);if(!t)return;let n=e*this.pageSize;t.forEach((e,t)=>{this.#i.get(e.id)===n+t&&this.#i.delete(e.id)}),this.#t.delete(e)}},K;function sa(e,t){K?.isConnected&&K.ownerDocument===e||(K=e.createElement(`div`),K.setAttribute(`aria-live`,`polite`),K.setAttribute(`aria-atomic`,`true`),K.dataset.argusAnnouncer=``,K.style.cssText=`position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap`,e.body.append(K));let n=K;n.textContent=``,setTimeout(()=>{n.textContent=t},50)}function ca(e,t){let n=new Set(t),r=/* @__PURE__ */ new Map;if(n.size===0)return r;let i=[...e.querySelectorAll(`[data-col]`)].filter(e=>n.has(e.dataset.col??``)&&!e.parentElement?.matches(`[part~="row-loading"]`));for(let e of i)e.setAttribute(`data-measure`,``);for(let e of i){let t=e.dataset.col??``,n=Math.ceil(e.getBoundingClientRect().width);n>0&&n>(r.get(t)??0)&&r.set(t,n)}for(let e of i)e.removeAttribute(`data-measure`);return r}var la=class{#e;#t;#n;constructor(e){this.widths={},this.#e=/* @__PURE__ */ new Map,this.#t=!1,this.#n=e}sync(e){let t=new Set(e);for(let e of this.#e.keys())t.has(e)||this.#e.delete(e);let n=Object.entries(this.widths).filter(([e])=>t.has(e));n.length!==Object.keys(this.widths).length&&(this.widths=Object.fromEntries(n))}measure(e,t,n){let r=t.filter(e=>e.auto).map(e=>e.id).filter(e=>{let t=this.#e.get(e);return t===void 0||t===`provisional`&&n});if(r.length===0)return!1;let i=ca(e,r),a=typeof document<`u`&&document.fonts.status===`loading`,o;for(let[e,t]of i)this.#e.set(e,a?`fonts`:n?`final`:`provisional`),this.widths[e]!==t&&((o??={...this.widths})[e]=t);return a&&i.size>0&&this.#r(),o&&(this.widths=o),o!==void 0}#r(){this.#t||(this.#t=!0,document.fonts.ready.then(()=>{this.#t=!1;let e=!1;for(let[t,n]of this.#e)n===`fonts`&&(this.#e.delete(t),e=!0);e&&this.#n()}))}},ua=class{#e;#t=[];#n=!0;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=!0,We(this.#e,()=>{this.#n=!0,this.#e.requestUpdate()})}hostDisconnected(){Ge(this.#e)}get present(){return this.defs.length>0}get defs(){return this.#n&&(this.#n=!1,this.#t=[...this.#e.children].filter(e=>e instanceof N).map(e=>e.toColumnDef())),this.#t}},da=class{#e;#t={source:void 0,sorting:[],getRowId:void 0};#n;#r=/* @__PURE__ */ new Map;#i;#a;#o=[];constructor(e){this.#e=e,e.addController(this)}hostDisconnected(){clearTimeout(this.#a),this.#a=void 0,this.#c()}hostConnected(){this.#i=void 0}get rows(){return this.#n}configure(e){let t=this.#t;this.#t=e,e.source?e.source!==t.source||!this.#n?this.#s({rowCount:void 0,totalKnown:!1}):(e.sorting!==t.sorting||e.getRowId!==t.getRowId)&&this.#s({rowCount:this.#n.rowCount,totalKnown:this.#n.totalKnown}):this.#s(void 0)}refresh(){this.#n&&(this.#s({rowCount:this.#n.rowCount,totalKnown:!1}),this.#e.requestUpdate())}stateAt(e){return this.#n?.stateAt(e)??`loaded`}request(e,t){let n=this.#n;if(!n)return;let r=this.#i,i=r?.start!==e||r.end!==t;if(this.#i={start:e,end:t},i)clearTimeout(this.#a);else if(this.#a!==void 0||n.missingPages(e,t).length===0)return;this.#a=setTimeout(()=>{this.#a=void 0,this.#l()},50)}retry(e){let t=this.#n,n=t?.pageOf(e);t&&n!==void 0&&t.isFailed(n)&&(t.retry(n),this.#i=void 0,this.#e.requestUpdate())}takeErrors(){let e=this.#o;return this.#o=[],e}#s(e){clearTimeout(this.#a),this.#a=void 0,this.#c(),this.#i=void 0,this.#o=[];let{source:t,getRowId:n}=this.#t;this.#n=t&&e?new oa({pageSize:t.pageSize??100,getRowId:n,rowCount:e.rowCount,totalKnown:e.totalKnown}):void 0}#c(){for(let[e,t]of this.#r)t.abort(),this.#n?.cancel(e);this.#r.clear()}#l(){let e=this.#n,t=this.#i;if(!e||!t)return;let n=e.pageSize;for(let r of e.inFlightOutside(t.start-n,t.end+n))this.#r.get(r)?.abort(),this.#r.delete(r),e.cancel(r);e.evictOutside(t.start,t.end);for(let n of e.missingPages(t.start,t.end))this.#u(e,n)}#u(e,t){let n=this.#t.source;if(!n)return;let{start:r,end:i}=e.begin(t),a=new AbortController;this.#r.set(t,a);let o=()=>!a.signal.aborted&&e===this.#n,s;try{s=Promise.resolve(n.getRows({start:r,end:i,sorting:this.#t.sorting,signal:a.signal}))}catch(e){s=Promise.reject(e instanceof Error?e:Error(String(e)))}s.then(n=>{if(!o())return;let{rows:r,total:i}=n??{};if(!Array.isArray(r))throw TypeError(`argus-table: getRows() must resolve to { rows: [], total? }.`);this.#r.delete(t),e.resolve(t,r,typeof i==`number`?i:void 0),this.#e.requestUpdate()}).catch(n=>{o()&&(this.#r.delete(t),e.fail(t),this.#o.push({error:n,start:r,end:i}),this.#e.requestUpdate())})}},fa=150,pa=class{#e;#t;#n=0;#r;#i;constructor(e,t){this.#e=t,e.addController(this)}hostConnected(){this.#a()}hostUpdated(){this.#a()}hostDisconnected(){this.#t?.removeEventListener(`scroll`,this.#o),this.#i?.disconnect(),clearTimeout(this.#r),this.#t=void 0}measure(){let e=this.#t;if(e){e.style.setProperty(`--_max-x`,`${String(Math.max(0,e.scrollWidth-e.clientWidth))}px`);for(let t of e.parentNode?.querySelectorAll(`:scope > .pin-shadow`)??[])t.style.setProperty(`--_view-h`,`${String(e.clientHeight)}px`),t.style.setProperty(`--_sb-x`,`${String(e.offsetWidth-e.clientWidth)}px`);this.#n=e.scrollLeft,e.style.setProperty(`--_sx`,`${String(this.#n)}px`)}}#a(){let e=this.#e();e&&e!==this.#t&&(this.#t=e,e.addEventListener(`scroll`,this.#o,{passive:!0}),this.#i??=new ResizeObserver(()=>{this.measure()}),this.#i.observe(e),this.measure())}#o=()=>{let e=this.#t;e&&e.scrollLeft!==this.#n&&(this.#n=e.scrollLeft,e.toggleAttribute(`data-hscroll`,!0),clearTimeout(this.#r),this.#r=setTimeout(()=>{this.measure(),e.removeAttribute(`data-hscroll`)},fa))}};function ma(e,t,n,r){let i=e.findIndex(e=>e.id===t),a=e[0],o=e.at(-1);if(i<0||!a||!o)return;let s=e.findIndex(e=>(n-(e.rect.left+e.rect.right)/2)*r<0);if(s<0&&(s=e.length),s===i||s===i+1)return;let c=a.index+(s>i?s-1:s),l=e[s];return l?{to:c,columnId:l.id,edge:`start`}:{to:c,columnId:o.id,edge:`end`}}var ha=4,ga=40,_a=16,va=`button,input,select,textarea,a[href],label,[contenteditable]`;function ya(e,t){if(e.button!==0||e.pointerType===`touch`)return!1;for(let n of e.composedPath()){if(n===t)return!0;if(n instanceof Element&&(n instanceof HTMLElement&&n.dataset.resizeCol!==void 0||n.matches(va)))return!1}return!1}function ba(e,t,n){let r=e.ownerDocument.defaultView??window,i=t.clientX,a=t.clientY,o=i,s=!1,c=0,l,u=(e,t)=>e?.to===t?.to&&e?.columnId===t?.columnId&&e?.edge===t?.edge,d=()=>{if(c=0,!s)return;let e=n.scrollArea();if(e){let t=o<e.left+ga?-Math.min(1,(e.left+ga-o)/ga):o>e.right-ga?Math.min(1,(o-(e.right-ga))/ga):0;t!==0&&(n.scroller.scrollLeft+=Math.round(t*_a)),o=Math.min(Math.max(o,e.left),e.right)}let t=n.targetAt(o);u(t,l)||(l=t,n.onTarget(l)),c=r.requestAnimationFrame(d)},f=new AbortController,p=t=>{c&&r.cancelAnimationFrame(c),c=0,f.abort(),t&&e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId)},m=l=>{if(l.pointerId===t.pointerId){if(o=l.clientX,!s){if(Math.hypot(o-i,l.clientY-a)<ha)return;s=!0;try{e.setPointerCapture(l.pointerId)}catch{}n.onStart()}l.preventDefault(),c||=r.requestAnimationFrame(d)}},h=e=>{if(e.pointerId!==t.pointerId||(p(e),!s))return;o=e.clientX;let i=n.scrollArea();i&&(o=Math.min(Math.max(o,i.left),i.right)),xa(r),n.onDrop(n.targetAt(o))},g=e=>{e.pointerId===t.pointerId&&(p(e),s&&n.onCancel())},_=e=>{s&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),p(),xa(r,!1),n.onCancel())},v={capture:!0,signal:f.signal};r.addEventListener(`pointermove`,m,v),r.addEventListener(`pointerup`,h,v),r.addEventListener(`pointercancel`,g,v),r.addEventListener(`keydown`,_,v)}function xa(e,t=!0){let n=e=>{e.preventDefault(),e.stopPropagation()},r=()=>{setTimeout(()=>{e.removeEventListener(`click`,n,{capture:!0})})};e.addEventListener(`click`,n,{capture:!0,once:!0}),t?r():e.addEventListener(`pointerup`,r,{capture:!0,once:!0})}function Sa(e,t,n,r,i){let a=t.clientX,o=0,s,c=()=>{o=0,s!==void 0&&i(s),s=void 0},l=!1,u=e=>{l||=e.clientX!==a,l&&(s=n+(e.clientX-a)*r,o||=requestAnimationFrame(c))},d=t=>{t.type===`pointerup`&&u(t),o&&cancelAnimationFrame(o),c(),e.removeAttribute(`data-active`),e.removeEventListener(`pointermove`,u),e.removeEventListener(`pointerup`,d),e.removeEventListener(`pointercancel`,d),e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId)};t.preventDefault();try{e.setPointerCapture(t.pointerId)}catch{}e.setAttribute(`data-active`,``),e.addEventListener(`pointermove`,u),e.addEventListener(`pointerup`,d),e.addEventListener(`pointercancel`,d)}var Ca=class{constructor(){this.model=ea({columns:[],data:[],getRowId:void 0,sorting:[],columnSizing:{},columnOrder:[]})}update(e){this.model.update(e)}};function wa(e){return typeof e==`object`?e.key:e}function Ta(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function Ea(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function Da(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var q=(e,t)=>Math.abs(e-t)<1.01,Oa=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function ka({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:a,clampedMaxAtWrite:o}){return t&&a===null&&e===i?`spurious`:a!==null&&Math.abs(e-a.target)<1.5?`readBack`:a!==null&&!a.smooth&&n!==null&&a.target>n+r+.5&&Math.abs(e-(n+r))<1.5||a!==null&&!a.smooth&&a.lowMaxes?.some(t=>Math.abs(e-t)<1.5)?`clampedReadBack`:o!==null&&Math.abs(e-o)<1.5?`clampedEcho`:`external`}var Aa=e=>e===`smooth`||e===`smoothFinishing`;function ja({kind:e,offset:t,command:n,target:r}){return e!==`spurious`&&e!==`readBack`&&e!==`clampedReadBack`&&n?.index!=null&&n.phase!==`queued`&&!Aa(n.phase)&&!q(t,n.lastTargetOffset)&&!q(t,r())&&e!==`clampedEcho`}var Ma=40;function Na(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<Ma;)n--;if(n<0)return!1;let r=e[n],i=n-1;for(;i>=0&&r.t-e[i].t<Ma;)i--;if(i<0)return!1;let a=e[i],o=(t.offset-r.offset)/(t.t-r.t),s=(r.offset-a.offset)/(r.t-a.t);return o*s>=0&&Math.abs(o)>=2*Math.abs(s)&&Math.abs(o)-Math.abs(s)>=.8}function Pa(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<Ma;)n--;if(n<0)return!1;let r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}var Fa,Ia=()=>{if(Fa!==void 0)return Fa;if(typeof navigator>`u`)return Fa=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Fa=!0;let e=navigator.maxTouchPoints;return Fa=navigator.platform===`MacIntel`&&e!==void 0&&e>0},La,Ra=()=>La===void 0?La=Ia()&&typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`overflow-anchor: auto`):La,za=()=>!Ia()||Ra(),J={capture:!0,passive:!0},Ba=class{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!==`lateFling`,this.dragging=()=>this._touch?.phase===`down`&&this._touch.moved,this.tail=()=>this._touch?.phase===`tail`?this._touch.moved?`fling`:`tap`:null,this.onScroll=({isScrolling:e,ownReadBack:t,moved:n,external:r})=>(e&&this._touch?.phase===`tail`?this._openTail(this._touch.moved||!t,!1):this._touch?.phase===`lateFling`&&(this.host.now()>this._touch.until?this._touch=null:r&&e&&n&&this._openTail(!0,!1)),!t&&e&&n&&this._touch?.phase===`down`?(this._touch.moved=!0,!0):!1),this.touchStart=()=>{this.end(),this._touch={phase:`down`,moved:!1}},this.touchEnd=()=>{let e=this._touch?.phase===`down`&&this._touch.moved;this.end(),this._openTail(e,e)},this.end=()=>{let e=this.host.getWindow();this._touch?.phase===`tail`&&e!=null&&e.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),n=()=>this.touchEnd();return e.addEventListener(`touchstart`,t,J),e.addEventListener(`touchend`,n,J),e.addEventListener(`touchcancel`,n,J),()=>{e.removeEventListener(`touchstart`,t,J),e.removeEventListener(`touchend`,n,J),e.removeEventListener(`touchcancel`,n,J),this.end()}},this._openTail=(e,t)=>{let n=this.host.getWindow();if(n==null)return;this.end();let r={phase:`tail`,moved:e,awaitingFling:t,timerId:n.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(r.moved,r.awaitingFling):(this._touch=r.awaitingFling?{phase:`lateFling`,until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=r}}get touch(){return this._touch}},Va=e=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},Ha=e=>{let t=/* @__PURE__ */ new Set;return{schedule:n=>{let r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(t=>e.cancelAnimationFrame(t)),t.clear()}}},Ua=e=>e,Wa=e=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let e=0;e<r;e++)i[e]=n+e;return i},Ga=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Va(n)),!r.ResizeObserver)return()=>{};let a=Ha(r),o=new r.ResizeObserver(()=>{let t=()=>{i(Va(n))};e.options.useAnimationFrameWithResizeObserver?a.schedule(t):t()});return o.observe(n,{box:`content-box`}),()=>{o.unobserve(n),a.cancel()}},Ka={passive:!0},qa=typeof window>`u`||`onscrollend`in window,Ja=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&qa,o=0,s=a?null:Oa(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Ka),a&&r.addEventListener(`scrollend`,u,Ka),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Ya=(e,t)=>Ja(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Xa=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},Za=(e,{adjustments:t=0,behavior:n},r)=>{var i;let{scrollElement:a,options:o}=r,s=e+t,c=o.horizontal&&o.isRtl&&a!==null&&`ownerDocument`in a;(i=a?.scrollTo)==null||i.call(a,{[o.horizontal?`left`:`top`]:c?-s:s,behavior:n})},Qa=(e,t)=>e===`smooth`?t?`smoothLanded`:`smooth`:`instant`,$a=e=>e?.phase===`smooth`||e?.phase===`smoothLanded`;function eo(e,t,n,r){if(t===0)return!1;let i=r(0),a=/* @__PURE__ */ new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var to=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=/* @__PURE__ */ new Map,this.itemSizeCacheVersion=0,this.laneAssignments=/* @__PURE__ */ new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new Ba({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if(e?.phase!==`queued`||this.pendingWrite!==null)return!1;let t=this._readElementOffset();return t===null||this._lastElementOffset===null||Math.abs(t-this._lastElementOffset)<1?!1:(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;e?.phase===`queued`&&Pa(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=/* @__PURE__ */ new Map,this._resizeBatch=null,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=/* @__PURE__ */ (()=>{let e=null,t=null,n=!1,r=!1,i=/* @__PURE__ */ new Set,a=()=>{if(e)return e;let r=this.targetWindow;if(!r||!r.ResizeObserver)return null;let i=t=Ha(r);return e=new r.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(o)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)i.schedule(t);else{n=!0;try{t()}finally{n=!1}}})},o=e=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};return{disconnect:()=>{var n;(n=a())==null||n.disconnect(),t?.cancel(),i.clear(),r=!1,e=null,t=null},observe:o=>{let s=a();s&&(n?(i.add(o),r||(r=!0,t?.schedule(()=>{r=!1,i.forEach(t=>{t.isConnected&&e?.observe(t,{box:`border-box`})}),i.clear()}))):s.observe(o,{box:`border-box`}))},unobserve:e=>{var t;i.delete(e),(t=a())==null||t.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ua,rangeExtractor:Wa,onChange:()=>{},measureElement:Xa,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>wa(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||eo(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:s}=this.options,c=0;for(;c<a&&s(c)!==e;)c++;if(c<a){let e=n[c];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(o=n-this.scrollOffset,this.scrollOffset=n)}}}i?this.pendingScrollAnchor={kind:`follow`,behavior:i}:o!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:`anchor`,delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Ea(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(e=this._momentumStop)==null||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{let n=t?this._elementMaxScrollOffset():null,r=this._reportedOverscroll;this._reportedOverscroll=e<0||n!==null&&e>n+1;let i=e;this._lastElementOffset=i,e=this._toLayoutOffset(e);let a=this._classifyScrollEvent(e,t,n);if(a===`spurious`)return;a===`readBack`?e=this.pendingWrite.target:a===`clampedReadBack`&&this.scrollState?.index!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:ja({kind:a,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let o=this.getScrollOffset(),s=this.scrollDirection;this.scrollDirection=t?o===e?this.scrollDirection:o<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t;let c=this.scrollState;if(c?.phase===`queued`&&a===`external`&&t){if(r||this._reportedOverscroll)c.samples=[];else{let e=this.now();c.samples=[...(c.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:i}],(s!==null&&this.scrollDirection!==s||Na(c.samples))&&(this.scrollState=null)}}this._iosGesture.onScroll({isScrolling:t,ownReadBack:a===`readBack`,moved:e!==o,external:a===`external`&&this.scrollState?.phase!==`smooth`&&this.scrollState?.phase!==`smoothFinishing`})&&this.scrollState?.phase===`queued`&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let t=this.pendingScrollAnchor;this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled&&(t.kind===`anchor`?this._canWriteScroll()?$a(this.scrollState)&&!q(this.getScrollOffset()-t.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(t.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=t.delta,this._followOffsetTarget(t.delta),this.notify(!1)):this.scrollToEnd({behavior:t.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,n)=>ka({offset:e,isScrolling:t,elementMax:n,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:this._clampedAdjustment?.maxAtWrite??null}),this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(e===null||e.phase!==`queued`)return;let{behavior:t}=e;this.getMeasurements();let n=this.getScrollStateTarget(e);e.lastTargetOffset=n,this._clampedAdjustment=null,e.phase=Qa(t,e.index!=null&&q(n,this.getScrollOffset())),this._scrollToOffset(n,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(e==null)return null;let{horizontal:t,isRtl:n}=this.options;return typeof e.scrollTop==`number`?t?e.scrollLeft*(n&&-1||1):e.scrollTop:typeof e.scrollY==`number`?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(Ia()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||this.scrollState?.phase===`smooth`)return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let t=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(t),this._scrollToOffset(t)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Ea(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=Ea(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=Ta(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Ea(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes,this._getLayoutTotalSize()+this.options.scrollMargin],(e,t,n,r,i)=>{if(e.length===0||t===0)return this.range=null,null;let a=Math.max(i-t,0);return this.range=io(e,t,Math.min(n,a),r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Ea(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,n,r,i,a)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!$a(this.scrollState))return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n;if(!this.isIndexInRange(e))return;this._resizeBatch?.sync&&this.getMeasurements();let r,i,a,o=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&o!=null)a=this.options.getItemKey(e),i=o[e*2],r=o[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;a=t.key,i=t.start,r=t.size}let s=this.itemSizeCache.get(a)??r,c=t-s;if(c!==0){let o=this.options.anchorTo===`end`&&!$a(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,l=o?this._getLayoutTotalSize():0,u=this.getScrollOffset(),d=this.itemSizeCache.has(a)?i+s<=u&&this.scrollDirection!==`backward`:i<u,f=!$a(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?d:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:a,start:i,size:r,end:i+r,lane:0},c,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(a,t),this.itemSizeCacheVersion++;let p=!1;if(this._awaitingCommandReadBack()||(o?p=this.applyScrollAdjustment(this._getLayoutTotalSize()-l):f&&(p=this.applyScrollAdjustment(c))),this._resizeBatch){this._resizeBatch.notify=!0,(n=this._resizeBatch).sync||(n.sync=p);return}this.notify(p),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=Ea(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,n)=>{let r=[];for(let i=0,a=e.length;i<a;i++){let a=t[e[i]];r.push(n===0?a:{...a,start:a.start-n,end:a.end-n})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return Da(t[no(0,t.length-1,r?e=>n[e*2]:e=>Da(t[e]).start,e)])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(e===null)return;let t=this.pendingWrite,n=Math.max(e,0)+this._holdOffset;if(n>=t.target)return;let r=t.lowMaxes??=[];r[r.length-1]!==n&&r.push(n)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{let t=e+this._holdOffset;return this.pendingScrollAnchor?.kind===`anchor`&&(t+=this.pendingScrollAnchor.delta),t},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(e===null)return null;if(`scrollHeight`in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(`document`in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,n=this.targetWindow;if(t===null||n===null)return;let r=`document`in t?t.document.scrollingElement:t;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:i}=r,a=this.options.horizontal?`overflow-x`:`overflow-y`,o=i.getPropertyValue(a),s=i.getPropertyPriority(a),c=()=>this.options.horizontal?r.clientHeight:r.clientWidth,l=c();if(i.setProperty(a,`hidden`,`important`),c()!==l){i.setProperty(a,o,s);return}let u={restore:()=>i.getPropertyValue(a)!==`hidden`||i.getPropertyPriority(a)!==`important`?!1:(i.setProperty(a,o,s),!0),done:e};this._momentumStop=u,n.requestAnimationFrame(()=>n.requestAnimationFrame(()=>{this._momentumStop===u&&(this._momentumStop=null,u.restore()&&u.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(t===null)return null;let n=t+this._holdOffset;return e>n+.5?{target:e,maxAtWrite:n}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.getMeasurements()[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),n,`absolute`)},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._startScroll({index:e,align:a},i,n,`absolute`)},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,`start`);this._startScroll({index:null,align:`start`},n,t,`relative`)},this.scrollToEnd=({behavior:e=`auto`}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:`end`,toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,`absolute`):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n}={})=>{let r={target:e+(t??0),smooth:n===`smooth`};return this.pendingWrite=r,this.options.scrollToFn(e-this._holdOffset,{behavior:n,adjustments:t},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(Ia()&&this._iosGesture.dragging())&&e!==null&&!q(e,this.getScrollOffset())},this._followOffsetTarget=e=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let r=this._scrollToOffset(n,{adjustments:e,behavior:t});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}return this._holdOffset+=e,this.scrollOffset!==null&&(this.scrollOffset+=e),!0}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase===`queued`){this.scheduleScrollReconcile();return}this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&q(e,this.getScrollOffset())){if(this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothLanded`:this.scrollState.phase===`smoothFinishing`&&(this.scrollState.phase=`instant`),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=$a(this.scrollState)&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.phase=`smooth`:this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothFinishing`:this.scrollState.phase===`smoothLanded`&&(this.scrollState.phase=`instant`),this._scrollToOffset(e,{behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let i=this._iosGesture.tail();if(r===`absolute`&&i!==null){if(i===`fling`&&za()){this._stopMomentum(()=>{this.scrollState?.phase!==`queued`||this._iosGesture.tail()!==`fling`||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:`queued`,behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:Qa(n,e.index!=null&&q(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}},no=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function ro(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function io(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=ro(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=no(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var ao=class{constructor(e,t){this.cleanup=()=>{},this.host=e,this.options={...t},this.virtualizer=new to(this.resolveOptions(this.options)),this.host.addController(this)}getVirtualizer(){return this.virtualizer}setOptions(e){this.applyOptions(e)&&(this.virtualizer.setOptions(this.resolveOptions(this.options)),this.virtualizer._willUpdate(),this.host.requestUpdate())}hostConnected(){this.cleanup=this.virtualizer._didMount(),this.virtualizer._willUpdate(),this.host.requestUpdate()}hostUpdated(){this.virtualizer._willUpdate()}hostDisconnected(){this.cleanup()}applyOptions(e){let t={...this.options},n=!1;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];i!==void 0&&(Object.is(t[r],i)||(n=!0,Object.assign(t,{[r]:i})))}return n&&(this.options=t),n}resolveOptions(e){return{...e,onChange:(t,n)=>{var r;this.host.updateComplete.then(()=>this.host.requestUpdate()),(r=e.onChange)==null||r.call(e,t,n)}}}},oo=class extends ao{constructor(e,t){super(e,{observeElementRect:Ga,observeElementOffset:Ya,scrollToFn:Za,...t})}},so=class{#e;#t=new ra;#n=new ia;#r;#i;#a;#o;#s={count:0,rowHeight:40,overscan:6,rowIdAt:String,cap:1/0};#c;constructor(e,t){this.#r=e,this.#i=t,this.#e=new oo(e,{count:0,getScrollElement:()=>this.#l(),observeElementRect:(e,t)=>{let n=this.#a;if(!n)return;let r=()=>{t({width:n.clientWidth,height:n.clientHeight})};r();let i=new ResizeObserver(r);return i.observe(n),()=>{i.disconnect()}},estimateSize:()=>this.#s.rowHeight,overscan:this.#s.overscan}),e.addController(this)}#l(){let e=this.#i();return e?(this.#a===e&&this.#o||(this.#a=e,this.#o=new Proxy(e,{get:(e,t)=>{if(t===`scrollTop`)return this.#u(e);if(t===`scrollHeight`)return e.scrollHeight+this.#n.excess;if(t===`scrollTo`)return t=>{t.top===void 0?e.scrollTo(t):this.#d(e,t.top,t.behavior)};let n=Reflect.get(e,t);return typeof n==`function`?n.bind(e):n}})),this.#o):null}#u(e){let t=e.scrollTop,n=this.#n;return n.scaled?n.toLogical(t,e.scrollHeight-e.clientHeight):t}#d(e,t,n,r){let i=this.#n;if(!i.scaled){e.scrollTo({top:t,behavior:n});return}let a=e.scrollHeight-e.clientHeight,o=Math.min(Math.max(t,0),a+i.excess),s=i.toPhysical(o,a);e.scrollTo({top:r?r(s):s,behavior:n}),n!==`smooth`&&i.land(o,e.scrollTop)}configure(e){let t=this.#s;this.#s=e,(e.count!==t.count||e.overscan!==t.overscan||e.rowHeight!==t.rowHeight)&&(this.#e.setOptions({count:e.count,overscan:e.overscan}),e.rowHeight!==t.rowHeight&&this.#e.getVirtualizer().measure());let n=this.#n.excess>0,r=this.#e.getVirtualizer().scrollOffset;this.#n.configure(e.count*e.rowHeight,e.cap)&&(n||this.#n.scaled)&&r!==null&&r>0&&(this.#c=r)}hostUpdated(){let e=this.#c;e!==void 0&&(this.#c=void 0,this.#a&&this.#d(this.#a,e),this.#r.requestUpdate())}computeWindow(){let e=this.#e.getVirtualizer(),t=e.getVirtualItems(),n=this.#n.scaled,r=this.#n.size,i=n?(e.scrollOffset??0)-(this.#a?.scrollTop??0):0,a=/* @__PURE__ */ new Map;for(let e of t)a.set(this.#s.rowIdAt(e.index),{index:e.index,start:e.start-i});let{keep:o,rowHeight:s}=this.#s;if(this.#t.pin(o?.id),o&&!a.has(o.id)){let e=o.index*s-i;a.set(o.id,{index:o.index,start:n?Math.min(Math.max(e,-s),r):e})}let c=[];for(let{id:e,slot:t}of this.#t.update(a.keys())){let n=a.get(e);n&&c.push({slot:t,...n})}let l=e.range;return{rows:c,totalSize:n?r:e.getTotalSize(),range:l?{start:l.startIndex,end:l.endIndex}:null}}get poolSize(){return this.#t.size}get scaled(){return this.#n.scaled}scrollToIndex(e,t=`start`){this.#e.getVirtualizer().scrollToIndex(e,{align:t})}scrollBy(e){let t=this.#a;t&&this.#d(t,this.#u(t)+e)}reveal(e,t,n){let r=this.#a;if(!r)return!1;let{rowHeight:i}=this.#s,a=this.#u(r),o=r.clientHeight-t-n,s=e*i,c,l;return s<a?(c=s,l=Math.floor):s+i>a+o?(c=s+i-o,l=Math.ceil):c=a,c!==a&&this.#d(r,c,void 0,l),this.#e.getVirtualizer().scrollOffset!==this.#u(r)}},co=`argus-range-change`,lo=`argus-sort-change`,uo=`argus-column-resize`,fo=`argus-column-reorder`,po=`argus-row-click`,mo=`argus-cell-click`,ho=`argus-load-error`;function Y(e,t,n){return e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}var go=[32e6,16e6,8e6,4e6,2e6],_o=2e6,vo=1e3,yo,bo=0,xo=/* @__PURE__ */ new Set;function So(){if(window.devicePixelRatio!==bo){bo=window.devicePixelRatio,yo=void 0;for(let e of xo)e()}}function Co(){if(yo!==void 0)return yo;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.style.cssText=`position:fixed;inset-block-start:0;inset-inline-start:0;inline-size:1px;visibility:hidden;pointer-events:none`,document.body.append(e),yo=go.find(t=>(e.style.blockSize=`${String(t)}px`,e.offsetHeight>=t-1))??_o,e.remove(),yo}function wo(e,t){return e+t<_o?1/0:Math.max(Co()-t-vo,0)}function To(e){return xo.size===0&&(bo=window.devicePixelRatio,window.addEventListener(`resize`,So,{passive:!0})),xo.add(e),()=>{xo.delete(e),xo.size===0&&window.removeEventListener(`resize`,So)}}var{I:Eo}=Ae,Do=e=>e,Oo=()=>document.createComment(``),ko=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new Eo(r.insertBefore(Oo(),i),r.insertBefore(Oo(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=Do(e).nextSibling;Do(r).insertBefore(e,i),e=t}}}return n},X=(e,t,n=e)=>(e._$AI(t,n),e),Ao={},jo=(e,t=Ao)=>e._$AH=t,Mo=e=>e._$AH,No=e=>{e._$AR(),e._$AA.remove()},Po=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},Z=Be(class extends Ve{constructor(e){if(super(e),e.type!==ze.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=Mo(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=X(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=X(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=X(i[d],a[m]),ko(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=X(i[f],a[p]),ko(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=Po(o,p,m),u=Po(s,d,f)),l.has(s[d])){if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=ko(e,i[d]);X(t,a[p]),c[p]=t}else c[p]=X(n,a[p]),ko(e,i[d],n),i[t]=null;p++}else No(i[f]),f--}else No(i[d]),d++;for(;p<=m;){let t=ko(e,c[m+1]);X(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&No(e)}return this.ut=o,jo(e,c),D}});function Fo(e){return e==null?O:typeof e==`number`?String(e):e}function Io(e){return e==null?``:e instanceof Date?e.toLocaleString():typeof e==`object`?JSON.stringify(e):String(e)}var Lo=(e,t)=>`c-${String(e)}-${String(t)}`,Ro=e=>`h-${String(e)}`,zo=(e,t,n)=>`${e===`top`?`t`:`b`}-${String(t)}-${String(n)}`;function Bo(e,t=!1){let n=t?`cell cell-pinned-row`:`cell`;return e.pin&&(n+=e.pinEdge?` cell-pinned cell-pinned-edge`:` cell-pinned`),e.sorted&&(n+=` cell-sorted`),n}function Vo(e){if(e)return e===`asc`?`ascending`:`descending`}function Ho(e){return e.pin?`--_pin-offset: ${String(e.offset)}px`:void 0}function Uo(e,t,n,r,i,a){return E`<div
3
+ function Qn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0)n=e.nextSub;else{for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function $n(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var er=[],tr=0,{link:nr,unlink:rr,propagate:ir,checkDirty:ar,shallowPropagate:or}=/* @__PURE__ */ Qn({update(e){return e._update()},notify(e){er[cr++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,dr(e))}}),sr=0,cr=0,H,lr=0;function ur(e){try{++lr,e()}finally{--lr||fr()}}function dr(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=rr(n,e)}function fr(){if(!(lr>0)){for(;sr<cr;){let e=er[sr];er[sr++]=void 0,e.notify()}sr=0,cr=0}}function pr(e,t){let n=typeof e==`function`,r=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:+!n,get(){return H!==void 0&&nr(i,H,tr),i._snapshot},subscribe(e){let t=$n(e),n={current:!1},r=mr(()=>{i.get(),n.current?(H=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=H,o=t?.compare??Object.is;if(n)H=i,++tr,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{H=a,n&&(i.flags&=-5),dr(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&ar(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&or(e)}}else e&32&&(i.flags=e&-33);return H!==void 0&&nr(i,H,tr),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ir(e),or(e),fr())}},i}function mr(e){let t=()=>{let t=H;H=n,++tr,n.depsTail=void 0,n.flags=6;try{return e()}finally{H=t,n.flags&=-5,dr(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&ar(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,dr(this)}};return t(),n}function hr(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=gr(e);if(n.length!==gr(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}function gr(e){return Object.keys(e).concat(Object.getOwnPropertySymbols(e))}function _r(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),P(t)}function vr(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:c,filterFns:l,filterMeta:u,filteredRowModel:d,groupedRowModel:f,paginatedRowModel:p,sortFns:m,sortedRowModel:h,tableMeta:g,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{...Yn,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:l,sortFns:m},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=_r(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e<x.length;e++){let n=x[e];v.baseAtoms[n]=t.createWritableAtom(v.initialState[n],{debugName:`table/baseAtoms/${n}`}),v.atoms[n]=t.createReadonlyAtom(()=>{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&ot(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}Wn(v),v.store=Zn(t.createReadonlyAtom(()=>{let e={};for(let t=0;t<x.length;t++){let n=x[t];e[n]=v.atoms[n].get()}return e},{compare:hr,debugName:`table/store`}));for(let e=0;e<y.length;e++){let t=y[e];t.initTableInstanceData?.(v),t.initCellInstanceData&&v._cellInstanceInitFns.push(t.initCellInstanceData.bind(t)),t.initColumnInstanceData&&v._columnInstanceInitFns.push(t.initColumnInstanceData.bind(t)),t.initHeaderGroupInstanceData&&v._headerGroupInstanceInitFns.push(t.initHeaderGroupInstanceData.bind(t)),t.initHeaderInstanceData&&v._headerInstanceInitFns.push(t.initHeaderInstanceData.bind(t)),t.initRowInstanceData&&v._rowInstanceInitFns.push(t.initRowInstanceData.bind(t)),t.constructTableAPIs?.(v)}return v}function U(){return{start:[],end:[]}}function yr(e,t){let n=e.getLeafColumns(),r=[];for(let e=0;e<n.length;e++){let t=n[e].id;t&&r.push(t)}Er(e.table,e=>t===`end`?{start:e.start.filter(e=>!r.includes(e)),end:[...e.end.filter(e=>!r.includes(e)),...r]}:t===`start`?{start:[...e.start.filter(e=>!r.includes(e)),...r],end:e.end.filter(e=>!r.includes(e))}:{start:e.start.filter(e=>!r.includes(e)),end:e.end.filter(e=>!r.includes(e))})}function br(e){return e.getLeafColumns().some(t=>(t.columnDef.enablePinning??!0)&&(e.table.options.enableColumnPinning??!0))}function xr(e){let t=e.getLeafColumns(),{start:n,end:r}=e.table.atoms.columnPinning?.get()??U();for(let e=0;e<t.length;e++)if(n.includes(t[e].id))return`start`;for(let e=0;e<t.length;e++)if(r.includes(t[e].id))return`end`;return!1}function Sr(e){let t=xr(e);return t?e.table.atoms.columnPinning?.get()?.[t].indexOf(e.id)??-1:0}function Cr(e){let t=Et(e),{start:n,end:r}=e.table.atoms.columnPinning?.get()??U();if(!n.length&&!r.length)return t;let i=[...n,...r];return t.filter(e=>!i.includes(e.column.id))}function wr(e){let{start:t}=e.table.atoms.columnPinning?.get()??U();if(!t.length)return[];let n=Dt(e),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&(i.position=`start`,r.push(i))}return r}function Tr(e){let{end:t}=e.table.atoms.columnPinning?.get()??U();if(!t.length)return[];let n=Dt(e),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&(i.position=`end`,r.push(i))}return r}function Er(e,t){pt(e,`columnPinning`,t)}function Dr(e,t){Er(e,t?U():P(e.initialState.columnPinning??U()))}function Or(e,t){let n=e.atoms.columnPinning?.get();return t?!!n?.[t].length:!!(n?.start.length||n?.end.length)}function W(e){let t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{start:r}=e.atoms.columnPinning?.get()??U(),i=[];for(let e=0;e<r.length;e++){let t=n[r[e]];t&&z(t)&&i.push(t)}return en(t,i,e,`start`)}function G(e){let t=e.getAllColumns(),n=e.getAllLeafColumnsById(),{end:r}=e.atoms.columnPinning?.get()??U(),i=[];for(let e=0;e<r.length;e++){let t=n[r[e]];t&&z(t)&&i.push(t)}return en(t,i,e,`end`)}function K(e){let t=e.getAllColumns(),n=B(e),{start:r,end:i}=e.atoms.columnPinning?.get()??U();if(r.length||i.length){let e=[...r,...i];n=n.filter(t=>!e.includes(t.id))}return en(t,n,e,`center`)}function kr(e){return[...R(e,`getStartHeaderGroups`,W)].reverse()}function Ar(e){return[...R(e,`getEndHeaderGroups`,G)].reverse()}function jr(e){return[...R(e,`getCenterHeaderGroups`,K)].reverse()}function Mr(e){let t=R(e,`getStartHeaderGroups`,W),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Nr(e){let t=R(e,`getEndHeaderGroups`,G),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Pr(e){let t=R(e,`getCenterHeaderGroups`,K),n=[];for(let e=0;e<t.length;e++){let r=t[e].headers;for(let e=0;e<r.length;e++)n.push(r[e])}return n}function Fr(e){return R(e,`getStartFlatHeaders`,Mr).filter(e=>!e.subHeaders.length)}function Ir(e){return R(e,`getEndFlatHeaders`,Nr).filter(e=>!e.subHeaders.length)}function Lr(e){return R(e,`getCenterFlatHeaders`,Pr).filter(e=>!e.subHeaders.length)}function Rr(e){let{start:t}=e.atoms.columnPinning?.get()??U(),n=e.getAllLeafColumnsById(),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&r.push(i)}return r}function zr(e){let{end:t}=e.atoms.columnPinning?.get()??U(),n=e.getAllLeafColumnsById(),r=[];for(let e=0;e<t.length;e++){let i=n[t[e]];i&&r.push(i)}return r}function Br(e){let{start:t,end:n}=e.atoms.columnPinning?.get()??U();if(!t.length&&!n.length)return e.getAllLeafColumns();let r=[...t,...n];return e.getAllLeafColumns().filter(e=>!r.includes(e.id))}function Vr(e,t){return t?t===`start`?R(e,`getStartLeafColumns`,Rr):t===`end`?R(e,`getEndLeafColumns`,zr):R(e,`getCenterLeafColumns`,Br):e.getAllLeafColumns()}function Hr(e){return R(e,`getStartLeafColumns`,Rr).filter(e=>z(e))}function Ur(e){return R(e,`getEndLeafColumns`,zr).filter(e=>z(e))}function Wr(e){return R(e,`getCenterLeafColumns`,Br).filter(e=>z(e))}function Gr(e,t){return t?t===`start`?R(e,`getStartVisibleLeafColumns`,Hr):t===`end`?R(e,`getEndVisibleLeafColumns`,Ur):R(e,`getCenterVisibleLeafColumns`,Wr):B(e)}function Kr(e,t,n,r){let i=e.atoms.columnPinning?.get();if(!i||!i.start.length&&!i.end.length)return t;let{start:a,end:o}=i,s=r?.();if(!s){s=F();for(let e=0;e<t.length;e++)s[n(t[e])]=t[e]}let c=[];for(let e=0;e<a.length;e++){let t=s[a[e]];t&&c.push(t)}for(let e=0;e<t.length;e++){let r=n(t[e]);!a.includes(r)&&!o.includes(r)&&c.push(t[e])}for(let e=0;e<o.length;e++){let t=s[o[e]];t&&c.push(t)}return c}var qr={getInitialState:e=>({columnPinning:{...U(),...e.columnPinning},...e}),getDefaultTableOptions:e=>({onColumnPinningChange:st(`columnPinning`,e)}),assignColumnPrototype:(e,t)=>{L(`columnPinningFeature`,e,t,{column_pin:{fn:(e,t)=>yr(e,t)},column_getCanPin:{fn:e=>br(e)},column_getPinnedIndex:{fn:e=>Sr(e)},column_getIsPinned:{fn:e=>xr(e)}})},assignRowPrototype:(e,t)=>{L(`columnPinningFeature`,e,t,{row_getCenterVisibleCells:{fn:e=>Cr(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get(),e.table.atoms.columnVisibility?.get()]},row_getStartVisibleCells:{fn:e=>wr(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.start,e.table.atoms.columnVisibility?.get()]},row_getEndVisibleCells:{fn:e=>Tr(e),memoDeps:e=>[e.getAllCells(),e.table.atoms.columnPinning?.get()?.end,e.table.atoms.columnVisibility?.get()]}})},constructTableAPIs:e=>{I(`columnPinningFeature`,e,{table_setColumnPinning:{fn:t=>Er(e,t)},table_resetColumnPinning:{fn:t=>Dr(e,t)},table_getIsSomeColumnsPinned:{fn:t=>Or(e,t)},table__orderByColumnPinning:{fn:(t,n,r)=>Kr(e,t,n,r)},table_getStartHeaderGroups:{fn:()=>W(e),memoDeps:()=>[e.getAllColumns(),B(e),e.atoms.columnPinning?.get()?.start,e.atoms.columnOrder?.get()]},table_getCenterHeaderGroups:{fn:()=>K(e),memoDeps:()=>[e.getAllColumns(),B(e),e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get()]},table_getEndHeaderGroups:{fn:()=>G(e),memoDeps:()=>[e.getAllColumns(),B(e),e.atoms.columnPinning?.get()?.end,e.atoms.columnOrder?.get()]},table_getStartFooterGroups:{fn:()=>kr(e),memoDeps:()=>[R(e,`getStartHeaderGroups`,W)]},table_getCenterFooterGroups:{fn:()=>jr(e),memoDeps:()=>[R(e,`getCenterHeaderGroups`,K)]},table_getEndFooterGroups:{fn:()=>Ar(e),memoDeps:()=>[R(e,`getEndHeaderGroups`,G)]},table_getStartFlatHeaders:{fn:()=>Mr(e),memoDeps:()=>[R(e,`getStartHeaderGroups`,W)]},table_getEndFlatHeaders:{fn:()=>Nr(e),memoDeps:()=>[R(e,`getEndHeaderGroups`,G)]},table_getCenterFlatHeaders:{fn:()=>Pr(e),memoDeps:()=>[R(e,`getCenterHeaderGroups`,K)]},table_getStartLeafHeaders:{fn:()=>Fr(e),memoDeps:()=>[R(e,`getStartHeaderGroups`,W)]},table_getEndLeafHeaders:{fn:()=>Ir(e),memoDeps:()=>[R(e,`getEndHeaderGroups`,G)]},table_getCenterLeafHeaders:{fn:()=>Lr(e),memoDeps:()=>[R(e,`getCenterHeaderGroups`,K)]},table_getStartLeafColumns:{fn:()=>Rr(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndLeafColumns:{fn:()=>zr(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterLeafColumns:{fn:()=>Br(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedLeafColumns:{fn:t=>Vr(e,t)},table_getStartVisibleLeafColumns:{fn:()=>Hr(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getCenterVisibleLeafColumns:{fn:()=>Wr(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getEndVisibleLeafColumns:{fn:()=>Ur(e),memoDeps:()=>[e.options.columns,e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_getPinnedVisibleLeafColumns:{fn:t=>Gr(e,t)}})}};function Jr(){return F()}function Yr(){return{size:150,minSize:20,maxSize:2**53-1}}function Xr(e){let t=Yr(),n=e.table.atoms.columnSizing?.get(),r=n&&ot(n,e.id)?n[e.id]:void 0;return Math.min(Math.max(e.columnDef.minSize??t.minSize,r??e.columnDef.size??t.size),e.columnDef.maxSize??t.maxSize)}function Zr(e){let t=F(),n=F(),r=Array(e.length),i=0;for(let n=0;n<e.length;n++){let a=e[n],o=R(a,`getSize`,Xr);r[n]=o,t[a.id]=i,i+=o}let a=0;for(let t=e.length-1;t>=0;t--)n[e[t].id]=a,a+=r[t];return{starts:t,afters:n}}function Qr(e){return{all:Zr(V(e)),center:Zr(V(e,`center`)),start:Zr(V(e,`start`)),end:Zr(V(e,`end`))}}function $r(e){return e===`start`?`start`:e===`end`?`end`:e===`center`?`center`:`all`}function ei(e,t){return R(e.table,`getColumnOffsets`,Qr)[$r(t)].starts[e.id]??0}function ti(e,t){return R(e.table,`getColumnOffsets`,Qr)[$r(t)].afters[e.id]??0}function ni(e){oi(e.table,t=>{let n=F(),r=Object.keys(t);for(let i=0;i<r.length;i++){let a=r[i];a!==e.id&&(n[a]=t[a])}return n})}function ri(e){if(!e.subHeaders.length)return Xr(e.column);let t=0;for(let n=0;n<e.subHeaders.length;n++)t+=ri(e.subHeaders[n]);return t}function ii(e){return ri(e)}function ai(e){if(e.index>0){let t=e.headerGroup?.headers[e.index-1];if(t)return R(t,`getStart`,ai)+R(t,`getSize`,ii)}return 0}function oi(e,t){e.options.onColumnSizingChange?.(t)}function si(e,t){oi(e,t?F():Object.assign(F(),P(e.initialState.columnSizing??{})))}function ci(e){let t=0;for(let n=0;n<e.length;n++)t+=R(e[n],`getSize`,Xr);return t}function li(e){return e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+ii(t),0)??0}function ui(e){return ci(V(e,`start`))}function di(e){return ci(V(e,`center`))}function fi(e){return ci(V(e,`end`))}var pi={getInitialState:e=>({columnSizing:Jr(),...e}),getDefaultColumnDef:()=>Yr(),getDefaultTableOptions:e=>({onColumnSizingChange:st(`columnSizing`,e)}),assignColumnPrototype:(e,t)=>{L(`columnSizingFeature`,e,t,{column_getSize:{fn:e=>Xr(e),memoDeps:e=>[t.options.columns,t.atoms.columnSizing?.get()?.[e.id]]},column_getStart:{fn:(e,t)=>ei(e,t)},column_getAfter:{fn:(e,t)=>ti(e,t)},column_resetSize:{fn:e=>ni(e)}})},assignHeaderPrototype:(e,t)=>{L(`columnSizingFeature`,e,t,{header_getSize:{fn:e=>ii(e),memoDeps:e=>[t.options.columns,e.column.columns.length>0?t.atoms.columnSizing?.get():t.atoms.columnSizing?.get()?.[e.column.id]]},header_getStart:{fn:e=>ai(e),memoDeps:()=>[t.options.columns,t.atoms.columnSizing?.get(),t.atoms.columnOrder?.get(),t.atoms.columnPinning?.get(),t.atoms.columnVisibility?.get(),t.atoms.grouping?.get(),t.options.groupedColumnMode]}})},constructTableAPIs:e=>{I(`columnSizingFeature`,e,{table_getColumnOffsets:{fn:()=>Qr(e),memoDeps:()=>[e.options.columns,e.atoms.columnSizing?.get(),e.atoms.columnOrder?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.atoms.grouping?.get(),e.options.groupedColumnMode]},table_setColumnSizing:{fn:t=>oi(e,t)},table_resetColumnSizing:{fn:t=>si(e,t)},table_getTotalSize:{fn:()=>li(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getStartTotalSize:{fn:()=>ui(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getCenterTotalSize:{fn:()=>di(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]},table_getEndTotalSize:{fn:()=>fi(e),memoDeps:()=>[e.atoms.columnSizing?.get(),e.getHeaderGroups()]}})}},mi=/([0-9]+)/gm;/* @__NO_SIDE_EFFECTS__ */
4
+ function hi(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r),o=t.resolveDataValue;return o&&(i=o(i),a=o(a)),t.sort(i,a,e,n,r)},e);return t}var gi=/* @__PURE__ */ hi({resolveDataValue:e=>Si(e).toLowerCase(),sort:(e,t)=>Ci(e,t)}),_i=/* @__PURE__ */ hi({resolveDataValue:e=>Si(e).toLowerCase(),sort:(e,t)=>bi(e,t)}),vi=/* @__PURE__ */ hi({resolveDataValue:e=>xi(e),sort:(e,t)=>e>t?1:e<t?-1:0}),yi=/* @__PURE__ */ hi({sort:(e,t)=>bi(e,t)});function bi(e,t){return e===t?0:e>t?1:-1}function xi(e){return e instanceof Date?e.getTime():e}function Si(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function Ci(e,t){let n=0,r=0,i=e.length,a=t.length;for(;n<i&&r<a;){let i=wi(e.charCodeAt(n)),a=wi(t.charCodeAt(r)),o=Ti(e,n,i),s=Ti(t,r,a);if(!i&&!a){let i=Ei(e,n,o,t,r,s);if(i)return i;n=o,r=s;continue}if(i!==a)return i?1:-1;let c=Di(e,n,o,t,r,s);if(c)return c;n=o,r=s}return ki(e,n)-ki(t,r)}function wi(e){return e>=48&&e<=57}function Ti(e,t,n){let r=t+1;for(;r<e.length&&wi(e.charCodeAt(r))===n;)r++;return r}function Ei(e,t,n,r,i,a){let o=n-t,s=a-i,c=o<s?o:s;for(let n=0;n<c;n++){let a=e.charCodeAt(t+n),o=r.charCodeAt(i+n);if(a>o)return 1;if(o>a)return-1}return o>s?1:s>o?-1:0}function Di(e,t,n,r,i,a){let o=t;for(;o<n&&e.charCodeAt(o)===48;)o++;let s=i;for(;s<a&&r.charCodeAt(s)===48;)s++;let c=n-o,l=a-s;if(c===0&&l===0)return 0;if(c<=15&&l<=15){let t=Oi(e,o,n),i=Oi(r,s,a);return t>i?1:i>t?-1:0}let u=parseInt(e.slice(t,n),10),d=parseInt(r.slice(i,a),10);return u>d?1:d>u?-1:0}function Oi(e,t,n){let r=0;for(let i=t;i<n;i++)r=r*10+e.charCodeAt(i)-48;return r}function ki(e,t){let n=0,r=t;for(;r<e.length;)n++,r=Ti(e,r,wi(e.charCodeAt(r)));return n}function Ai(){return[]}function ji(e,t){pt(e,`sorting`,t)}function Mi(e,t){ji(e,t?[]:P(e.initialState.sorting??[]))}function Ni(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&Mi(e)}function Pi(e){let t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10),r,i=!1;for(let t=0;t<n.length;t++){let a=n[t].getValue(e.id);if(Object.prototype.toString.call(a)===`[object Date]`){r=`datetime`;break}if(typeof a==`string`&&(i=!0,a.split(mi).length>1)){r=`alphanumeric`;break}}if(!r&&i&&(r=`text`),r){let e=t?.[r];if(e||r===`alphanumeric`&&(e=t?.text),e)return e}return yi}function Fi(e){let t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n<t.length;n++){let r=t[n].getValue(e.id);if(r!=null)return typeof r==`string`?`asc`:`desc`}return`desc`}function Ii(e){let t=e.table._rowModelFns.sortFns;return mt(e.columnDef.sortFn)?e.columnDef.sortFn:e.columnDef.sortFn===`auto`?Pi(e):t?.[e.columnDef.sortFn]??yi}function Li(e,t,n){let r=zi(e,n&&Vi(e)),i=t!==void 0;ji(e.table,a=>{let o=a.findIndex(t=>t.id===e.id),s=o===-1?void 0:a[o],c=[],l,u=i?t:r===`desc`,d=!!(a.length&&Vi(e)&&n);return l=d?s?`toggle`:`add`:s?`toggle`:`replace`,l===`toggle`&&(i||r||(l=`remove`)),l===`add`?(c=[...a,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??2**53-1))):c=l===`toggle`?d?a.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:l===`remove`?d?a.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function Ri(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??Fi(e)===`desc`?`desc`:`asc`}function zi(e,t){let n=Ri(e),r=Hi(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r===`desc`?`asc`:`desc`:n}function Bi(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function Vi(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function Hi(e){let t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return t?t.desc?`desc`:`asc`:!1}function Ui(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function Wi(e){ji(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}function Gi(e){let t=Bi(e);return n=>{t&&Li(e,void 0,Vi(e)?e.table.options.isMultiSortEvent?.(n):!1)}}var Ki={getInitialState(e){return{sorting:Ai(),...e}},getDefaultColumnDef(){return{sortFn:`auto`,sortUndefined:1}},getDefaultTableOptions(e){return{autoResetSorting:!1,onSortingChange:st(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}},assignColumnPrototype(e,t){L(`rowSortingFeature`,e,t,{column_getAutoSortFn:{fn:e=>Pi(e)},column_getAutoSortDir:{fn:e=>Fi(e)},column_getSortFn:{fn:e=>Ii(e)},column_toggleSorting:{fn:(e,t,n)=>Li(e,t,n)},column_getFirstSortDir:{fn:e=>Ri(e)},column_getNextSortingOrder:{fn:(e,t)=>zi(e,t)},column_getCanSort:{fn:e=>Bi(e)},column_getCanMultiSort:{fn:e=>Vi(e)},column_getIsSorted:{fn:e=>Hi(e)},column_getSortIndex:{fn:e=>Ui(e)},column_clearSorting:{fn:e=>Wi(e)},column_getToggleSortingHandler:{fn:e=>Gi(e)}})},constructTableAPIs(e){I(`rowSortingFeature`,e,{table_autoResetSorting:{fn:()=>Ni(e)},table_setSorting:{fn:t=>ji(e,t)},table_resetSorting:{fn:t=>Mi(e,t)}})}};function qi(){return{createOptionsStore:!0,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},batch:ur,schedule:e=>queueMicrotask(e),untrack:e=>e(),createReadonlyAtom:(e,t)=>pr(()=>e(),{compare:t?.compare}),createWritableAtom:(e,t)=>pr(e,{compare:t?.compare})}}function Ji(){return e=>{let t;return()=>{let n=e.getPreSortedRowModel(),r=e.options.state?.sorting,i=t;if(i&&i.sorting===r&&i.source===n)return i.model;let a=Yi(e,n,r??[]);return t={sorting:r,source:n,model:a},a}}}function Yi(e,t,n){let r=t.rows,i=[];for(let{id:t,desc:a}of n){let n=e.getColumn(t);if(!n||!Bi(n))continue;let o=Ii(n),s=n.columnDef,c=n.accessorFn,l=o.resolveDataValue,u=s.sortUndefined;i.push({keys:r.map(e=>{let t=c?.(e.original,e.index);return l&&!(t===void 0&&u)?l(t):t}),compare:o.sort,sign:(a?-1:1)*(s.invertSorting?-1:1),sortUndefined:u})}if(!i.length||!r.length)return t;let a=r.map((e,t)=>t).sort((e,t)=>{for(let{keys:n,compare:r,sign:a,sortUndefined:o}of i){let i=n[e],s=n[t],c=0;if(o&&(i===void 0||s===void 0)){if(i===void 0&&s===void 0)continue;if(o===`first`)return i===void 0?-1:1;if(o===`last`)return i===void 0?1:-1;c=i===void 0?o:-o}if(c===0&&(c=r(i,s)),c!==0)return c*a}return(r[e]?.index??e)-(r[t]?.index??t)}).map(e=>r[e]).filter(e=>e!==void 0);return{rows:a,flatRows:a,rowsById:t.rowsById}}var Xi=Xn({coreReactivityFeature:qi(),columnPinningFeature:qr,columnSizingFeature:pi,rowSortingFeature:Ki,sortedRowModel:Ji(),sortFns:{alphanumeric:gi,basic:yi,datetime:vi,text:_i}}),Zi=(e,t)=>String(t);function Qi(e){return{id:e.id,accessorFn:e.getValue,size:e.width,minSize:e.minWidth,maxSize:e.maxWidth,enableSorting:e.sortable,sortUndefined:`last`}}function $i(e){let t=e,n=tt(t.columns),r=new Map(n.map(e=>[e.id,e])),i=new Map(n.map(e=>[e.id,Qi(e)])),a,o,s=()=>{if(o)return o;let e=t.autoWidths;if(!e)return o=t.columnSizing;let r={};for(let t of n){let n=e[t.id];t.auto&&n!==void 0&&Number.isFinite(n)&&(r[t.id]=Math.min(t.maxWidth,Math.max(t.minWidth,n)))}return o={...r,...t.columnSizing}},c,l=()=>c??=rt(t.columnOrder??[],n),u=/* @__PURE__ */ new WeakMap,d,f,p=()=>{let e=l();if(f?.order!==e){let t=e=>r.get(e)?.pin;f={order:e,columns:e.flatMap(e=>i.get(e)??[]),pinning:{start:e.filter(e=>t(e)===`start`),end:e.filter(e=>t(e)===`end`)}}}return f},m=()=>({features:Xi,columns:p().columns,data:t.remote?[]:t.data,getRowId:t.getRowId??Zi,state:{sorting:t.sorting,columnSizing:s(),columnPinning:p().pinning},onSortingChange:()=>void 0,onColumnSizingChange:()=>void 0,onColumnPinningChange:()=>void 0}),h=vr(m()),g=()=>h.getRowModel().rows,_=e=>t.pinnedRows?.[e]??[],v=()=>{let e=h.getStartLeafColumns(),n=h.getCenterLeafColumns(),i=h.getEndLeafColumns(),a=t.sorting,o=(e,n,i,o)=>{let s=r.get(e.id);if(!s)throw Error(`argus-table: unknown column '${e.id}'.`);let c=a.find(t=>t.id===e.id);return{id:s.id,colIndex:n,pin:s.pin,offset:i,pinEdge:o,width:e.getSize(),flex:t.columnSizing[s.id]===void 0?s.flex:void 0,auto:s.auto&&t.columnSizing[s.id]===void 0,minWidth:s.minWidth,maxWidth:s.maxWidth,sortable:s.sortable,resizable:s.resizable,reorderable:s.reorderable,align:s.align,sorted:c?c.desc?`desc`:`asc`:!1,header:s.header,cell:s.cell,hasAccessor:s.hasAccessor}};return[...e.map((t,n)=>o(t,n+1,t.getStart(`start`),n===e.length-1)),...n.map((t,n)=>o(t,e.length+n+1,t.getStart(`center`),!1)),...i.map((t,r)=>o(t,e.length+n.length+r+1,t.getAfter(`end`),r===0))]};return{update(e){let s={...t,...e};Object.keys(e).some(n=>e[n]!==t[n])&&(e.columns&&e.columns!==t.columns&&(n=tt(e.columns),r=new Map(n.map(e=>[e.id,e])),i=new Map(n.map(e=>[e.id,Qi(e)]))),(s.columns!==t.columns||s.columnSizing!==t.columnSizing||s.autoWidths!==t.autoWidths)&&(o=void 0),(s.columns!==t.columns||s.columnOrder!==t.columnOrder)&&(c=void 0),t=s,a=void 0,h.setOptions(e=>({...e,...m()})))},get columns(){return a??=v()},get rowCount(){return t.remote?.rowCount??g().length},get totalWidth(){return h.getTotalSize()},rowAt(e){if(t.remote){let n=t.remote.entryAt(e);return n&&{id:n.id,index:e,original:n.row}}let n=g()[e];if(!n)return;let r=u.get(n);return r?.index!==e&&(r={id:n.id,index:e,original:n.original},u.set(n,r)),r},indexOf(e){if(t.remote)return t.remote.indexOf(e);let n=g();return d?.rows!==n&&(d={rows:n,map:new Map(n.map((e,t)=>[e.id,t]))}),d.map.get(e)},valueAt(e,n){if(t.remote){let i=t.remote.entryAt(e);return i&&r.get(n)?.getValue(i.row,e)}return g()[e]?.getValue(n)},cellContext(e,n){if(t.remote){let i=t.remote.entryAt(e),a=r.get(n);return!i||!a?void 0:{row:i.row,rowId:i.id,index:e,columnId:n,value:a.getValue(i.row,e)}}let i=g()[e];if(i&&r.has(n))return{row:i.original,rowId:i.id,index:e,columnId:n,value:i.getValue(n)}},nextSorting(e){if(r.get(e)?.sortable!==!0)return;let n=t.sorting.find(t=>t.id===e);return n?n.desc?[]:[{id:e,desc:!0}]:[{id:e,desc:!1}]},nextSizing(e,n){let i=r.get(e);if(!i?.resizable||!Number.isFinite(n))return;let a=Math.round(Math.min(i.maxWidth,Math.max(i.minWidth,n)));return{...t.columnSizing,[e]:a}},orderOf(e){return e===void 0?l():rt(e,n)},nextOrder(e,t,r){return it(r??l(),n,e,t)},pinnedCount(e){return _(e).length},pinnedRowAt(e,n){if(n<0||n>=_(e).length)return;let r=_(e)[n];return{id:t.getRowId?t.getRowId(r,n):`${e}-${String(n)}`,index:n,original:r}},pinnedValueAt(e,t,n){if(!(t<0||t>=_(e).length))return r.get(n)?.getValue(_(e)[t],t)},pinnedCellContext(e,t,n){let i=this.pinnedRowAt(e,t),a=r.get(n);if(i&&a)return{row:i.original,rowId:i.id,index:t,columnId:n,value:a.getValue(i.original,t),pinned:e}}}}var ea=class{constructor(e,t,n){this.top=e,this.body=t,this.bottom=n}get total(){return 1+this.top+this.body+this.bottom}position({section:e,index:t}){switch(e){case`header`:return 0;case`top`:return 1+t;case`body`:return 1+this.top+t;case`bottom`:return 1+this.top+this.body+t}}at(e){if(!Number.isInteger(e)||e<0||e>=this.total)return;if(e===0)return{section:`header`,index:0};let t=e-1;return t<this.top?{section:`top`,index:t}:(t-=this.top,t<this.body?{section:`body`,index:t}:{section:`bottom`,index:t-this.body})}ariaRowIndex(e){return this.position(e)+1}fromAriaRowIndex(e){return this.at(e-1)}};function ta(e){let t=e,n=!1;return{get value(){return t},get controlled(){return n},set(e){e===void 0?n=!1:(n=!0,t=e)},request(e){return n||(t=e),{value:e,applied:!n}}}}var na=class{#e=/* @__PURE__ */ new Map;#t=[];#n=0;#r;get size(){return this.#n}get pinned(){return this.#r}pin(e){this.#r=e}slotOf(e){return this.#e.get(e)}update(e){let t=new Set(e);this.#r!==void 0&&t.add(this.#r);for(let[e,n]of this.#e)t.has(e)||(this.#e.delete(e),this.#t.push(n));for(let e of t)this.#e.has(e)||this.#e.set(e,this.#t.pop()??this.#n++);let n=[];for(let[e,t]of this.#e)n.push({id:e,slot:t});return n.sort((e,t)=>e.slot-t.slot)}clear(){this.#e.clear(),this.#t=[],this.#n=0,this.#r=void 0}},ra=class{#e=0;#t=1/0;#n;configure(e,t){return e===this.#e&&t===this.#t?!1:(this.#e=e,this.#t=t,this.#n=void 0,!0)}get scaled(){return this.#e>this.#t}get size(){return Math.min(this.#e,this.#t)}get excess(){return this.#e-this.size}toLogical(e,t){if(!this.scaled||t<=0)return e;let n=this.#n;return n?.physical===e?n.logical:ia(e,t)*(t+this.excess)/t}toPhysical(e,t){if(!this.scaled||t<=0)return e;let n=t+this.excess;return ia(e,n)*t/n}land(e,t){this.#n=this.scaled?{physical:t,logical:e}:void 0}},ia=(e,t)=>Math.min(Math.max(e,0),t);function aa(e,t){return e>0&&t>0?Math.ceil(e/t)+1:0}function oa({startIndex:e,endIndex:t,overscan:n,count:r},i){let a=Math.max(i,t-e+1),o=Math.min(r,a+2*n),s=Math.max(0,Math.min(e-n,r-o));return Array.from({length:o},(e,t)=>s+t)}var sa=class{#e;#t=/* @__PURE__ */ new Map;#n=/* @__PURE__ */ new Map;#r=/* @__PURE__ */ new Set;#i=/* @__PURE__ */ new Map;#a;#o;constructor(e){this.pageSize=Math.max(1,Math.floor(e.pageSize)),this.#e=e.getRowId??((e,t)=>String(t)),this.#a=Math.max(0,Math.floor(e.rowCount??this.pageSize)),this.#o=e.totalKnown??!1}get rowCount(){return this.#a}get totalKnown(){return this.#o}pageOf(e){return Math.floor(e/this.pageSize)}entryAt(e){if(!(e<0||e>=this.#a))return this.#t.get(this.pageOf(e))?.[e%this.pageSize]}indexOf(e){return this.#i.get(e)}stateAt(e){return this.entryAt(e)?`loaded`:this.#r.has(this.pageOf(e))?`error`:`loading`}missingPages(e,t){let n=Math.min(t,this.#a)-1,r=[];if(n<0)return r;for(let t=this.pageOf(Math.max(0,e));t<=this.pageOf(n);t++)this.#t.has(t)||this.#n.has(t)||this.#r.has(t)||r.push(t);return r}begin(e){let t=e*this.pageSize,n=t+this.pageSize;return this.#o&&(n=Math.min(n,this.#a)),this.#r.delete(e),this.#n.set(e,n),{start:t,end:n}}resolve(e,t,n){let r=this.#n.get(e);if(r===void 0)return!1;this.#n.delete(e);let i=e*this.pageSize,a=r-i,o=t.slice(0,a).map((e,t)=>({id:this.#e(e,i+t),row:e}));return this.#c(e),o.length>0&&this.#t.set(e,o),o.forEach((e,t)=>this.#i.set(e.id,i+t)),n!==void 0&&Number.isFinite(n)&&n>=0?this.#s(Math.floor(n),!0):o.length<a?this.#s(i+o.length,!0):this.#o||this.#s(Math.max(this.#a,r+this.pageSize),!1),!0}fail(e){return this.#n.delete(e)?(this.#r.add(e),!0):!1}retry(e){this.#r.delete(e)}cancel(e){this.#n.delete(e)}isFailed(e){return this.#r.has(e)}inFlightOutside(e,t){let n=this.pageOf(Math.max(0,e)),r=this.pageOf(Math.max(0,t-1));return[...this.#n.keys()].filter(e=>e<n||e>r)}evictOutside(e,t){let n=this.pageOf(Math.max(0,e))-10,r=this.pageOf(Math.max(0,t-1))+10;for(let e of[...this.#t.keys()])(e<n||e>r)&&this.#c(e);for(let e of[...this.#r])(e<n||e>r)&&this.#r.delete(e)}get loadedPages(){return this.#t.size}#s(e,t){this.#a=e,this.#o=t;for(let t of[...this.#t.keys()])t*this.pageSize>=e&&this.#c(t)}#c(e){let t=this.#t.get(e);if(!t)return;let n=e*this.pageSize;t.forEach((e,t)=>{this.#i.get(e.id)===n+t&&this.#i.delete(e.id)}),this.#t.delete(e)}},q;function ca(e,t){q?.isConnected&&q.ownerDocument===e||(q=e.createElement(`div`),q.setAttribute(`aria-live`,`polite`),q.setAttribute(`aria-atomic`,`true`),q.dataset.argusAnnouncer=``,q.style.cssText=`position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap`,e.body.append(q));let n=q;n.textContent=``,setTimeout(()=>{n.textContent=t},50)}function la(e,t){let n=new Set(t),r=/* @__PURE__ */ new Map;if(n.size===0)return r;let i=[...e.querySelectorAll(`[data-col]`)].filter(e=>n.has(e.dataset.col??``)&&!e.parentElement?.matches(`[part~="row-loading"]`));for(let e of i)e.setAttribute(`data-measure`,``);for(let e of i){let t=e.dataset.col??``,n=Math.ceil(e.getBoundingClientRect().width);n>0&&n>(r.get(t)??0)&&r.set(t,n)}for(let e of i)e.removeAttribute(`data-measure`);return r}var ua=class{#e;#t;#n;constructor(e){this.widths={},this.#e=/* @__PURE__ */ new Map,this.#t=!1,this.#n=e}sync(e){let t=new Set(e);for(let e of this.#e.keys())t.has(e)||this.#e.delete(e);let n=Object.entries(this.widths).filter(([e])=>t.has(e));n.length!==Object.keys(this.widths).length&&(this.widths=Object.fromEntries(n))}measure(e,t,n){let r=t.filter(e=>e.auto).map(e=>e.id).filter(e=>{let t=this.#e.get(e);return t===void 0||t===`provisional`&&n});if(r.length===0)return!1;let i=la(e,r),a=typeof document<`u`&&document.fonts.status===`loading`,o;for(let[e,t]of i)this.#e.set(e,a?`fonts`:n?`final`:`provisional`),this.widths[e]!==t&&((o??={...this.widths})[e]=t);return a&&i.size>0&&this.#r(),o&&(this.widths=o),o!==void 0}#r(){this.#t||(this.#t=!0,document.fonts.ready.then(()=>{this.#t=!1;let e=!1;for(let[t,n]of this.#e)n===`fonts`&&(this.#e.delete(t),e=!0);e&&this.#n()}))}},da=class{#e;#t=[];#n=!0;constructor(e){this.#e=e,e.addController(this)}hostConnected(){this.#n=!0,We(this.#e,()=>{this.#n=!0,this.#e.requestUpdate()})}hostDisconnected(){Ge(this.#e)}get present(){return this.defs.length>0}get defs(){return this.#n&&(this.#n=!1,this.#t=[...this.#e.children].filter(e=>e instanceof N).map(e=>e.toColumnDef())),this.#t}},fa=class{#e;#t={source:void 0,sorting:[],getRowId:void 0};#n;#r=/* @__PURE__ */ new Map;#i;#a;#o=[];constructor(e){this.#e=e,e.addController(this)}hostDisconnected(){clearTimeout(this.#a),this.#a=void 0,this.#c()}hostConnected(){this.#i=void 0}get rows(){return this.#n}configure(e){let t=this.#t;this.#t=e,e.source?e.source!==t.source||!this.#n?this.#s({rowCount:void 0,totalKnown:!1}):(e.sorting!==t.sorting||e.getRowId!==t.getRowId)&&this.#s({rowCount:this.#n.rowCount,totalKnown:this.#n.totalKnown}):this.#s(void 0)}refresh(){this.#n&&(this.#s({rowCount:this.#n.rowCount,totalKnown:!1}),this.#e.requestUpdate())}stateAt(e){return this.#n?.stateAt(e)??`loaded`}request(e,t){let n=this.#n;if(!n)return;let r=this.#i,i=r?.start!==e||r.end!==t;if(this.#i={start:e,end:t},i)clearTimeout(this.#a);else if(this.#a!==void 0||n.missingPages(e,t).length===0)return;this.#a=setTimeout(()=>{this.#a=void 0,this.#l()},50)}retry(e){let t=this.#n,n=t?.pageOf(e);t&&n!==void 0&&t.isFailed(n)&&(t.retry(n),this.#i=void 0,this.#e.requestUpdate())}takeErrors(){let e=this.#o;return this.#o=[],e}#s(e){clearTimeout(this.#a),this.#a=void 0,this.#c(),this.#i=void 0,this.#o=[];let{source:t,getRowId:n}=this.#t;this.#n=t&&e?new sa({pageSize:t.pageSize??100,getRowId:n,rowCount:e.rowCount,totalKnown:e.totalKnown}):void 0}#c(){for(let[e,t]of this.#r)t.abort(),this.#n?.cancel(e);this.#r.clear()}#l(){let e=this.#n,t=this.#i;if(!e||!t)return;let n=e.pageSize;for(let r of e.inFlightOutside(t.start-n,t.end+n))this.#r.get(r)?.abort(),this.#r.delete(r),e.cancel(r);e.evictOutside(t.start,t.end);for(let n of e.missingPages(t.start,t.end))this.#u(e,n)}#u(e,t){let n=this.#t.source;if(!n)return;let{start:r,end:i}=e.begin(t),a=new AbortController;this.#r.set(t,a);let o=()=>!a.signal.aborted&&e===this.#n,s;try{s=Promise.resolve(n.getRows({start:r,end:i,sorting:this.#t.sorting,signal:a.signal}))}catch(e){s=Promise.reject(e instanceof Error?e:Error(String(e)))}s.then(n=>{if(!o())return;let{rows:r,total:i}=n??{};if(!Array.isArray(r))throw TypeError(`argus-table: getRows() must resolve to { rows: [], total? }.`);this.#r.delete(t),e.resolve(t,r,typeof i==`number`?i:void 0),this.#e.requestUpdate()}).catch(n=>{o()&&(this.#r.delete(t),e.fail(t),this.#o.push({error:n,start:r,end:i}),this.#e.requestUpdate())})}},pa=150,ma=class{#e;#t;#n=0;#r;#i;constructor(e,t){this.#e=t,e.addController(this)}hostConnected(){this.#a()}hostUpdated(){this.#a()}hostDisconnected(){this.#t?.removeEventListener(`scroll`,this.#o),this.#i?.disconnect(),clearTimeout(this.#r),this.#t=void 0}measure(){let e=this.#t;if(e){e.style.setProperty(`--_max-x`,`${String(Math.max(0,e.scrollWidth-e.clientWidth))}px`);for(let t of e.parentNode?.querySelectorAll(`:scope > .pin-shadow`)??[])t.style.setProperty(`--_view-h`,`${String(e.clientHeight)}px`),t.style.setProperty(`--_sb-x`,`${String(e.offsetWidth-e.clientWidth)}px`);this.#n=e.scrollLeft,e.style.setProperty(`--_sx`,`${String(this.#n)}px`)}}#a(){let e=this.#e();e&&e!==this.#t&&(this.#t=e,e.addEventListener(`scroll`,this.#o,{passive:!0}),this.#i??=new ResizeObserver(()=>{this.measure()}),this.#i.observe(e),this.measure())}#o=()=>{let e=this.#t;e&&e.scrollLeft!==this.#n&&(this.#n=e.scrollLeft,e.toggleAttribute(`data-hscroll`,!0),clearTimeout(this.#r),this.#r=setTimeout(()=>{this.measure(),e.removeAttribute(`data-hscroll`)},pa))}};function ha(e,t,n,r){let i=e.findIndex(e=>e.id===t),a=e[0],o=e.at(-1);if(i<0||!a||!o)return;let s=e.findIndex(e=>(n-(e.rect.left+e.rect.right)/2)*r<0);if(s<0&&(s=e.length),s===i||s===i+1)return;let c=a.index+(s>i?s-1:s),l=e[s];return l?{to:c,columnId:l.id,edge:`start`}:{to:c,columnId:o.id,edge:`end`}}var ga=4,_a=40,va=16,ya=`button,input,select,textarea,a[href],label,[contenteditable]`;function ba(e,t){if(e.button!==0||e.pointerType===`touch`)return!1;for(let n of e.composedPath()){if(n===t)return!0;if(n instanceof Element&&(n instanceof HTMLElement&&n.dataset.resizeCol!==void 0||n.matches(ya)))return!1}return!1}function xa(e,t,n){let r=e.ownerDocument.defaultView??window,i=t.clientX,a=t.clientY,o=i,s=!1,c=0,l,u=(e,t)=>e?.to===t?.to&&e?.columnId===t?.columnId&&e?.edge===t?.edge,d=()=>{if(c=0,!s)return;let e=n.scrollArea();if(e){let t=o<e.left+_a?-Math.min(1,(e.left+_a-o)/_a):o>e.right-_a?Math.min(1,(o-(e.right-_a))/_a):0;t!==0&&(n.scroller.scrollLeft+=Math.round(t*va)),o=Math.min(Math.max(o,e.left),e.right)}let t=n.targetAt(o);u(t,l)||(l=t,n.onTarget(l)),c=r.requestAnimationFrame(d)},f=new AbortController,p=t=>{c&&r.cancelAnimationFrame(c),c=0,f.abort(),t&&e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId)},m=l=>{if(l.pointerId===t.pointerId){if(o=l.clientX,!s){if(Math.hypot(o-i,l.clientY-a)<ga)return;s=!0;try{e.setPointerCapture(l.pointerId)}catch{}n.onStart()}l.preventDefault(),c||=r.requestAnimationFrame(d)}},h=e=>{if(e.pointerId!==t.pointerId||(p(e),!s))return;o=e.clientX;let i=n.scrollArea();i&&(o=Math.min(Math.max(o,i.left),i.right)),Sa(r),n.onDrop(n.targetAt(o))},g=e=>{e.pointerId===t.pointerId&&(p(e),s&&n.onCancel())},_=e=>{s&&e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),p(),Sa(r,!1),n.onCancel())},v={capture:!0,signal:f.signal};r.addEventListener(`pointermove`,m,v),r.addEventListener(`pointerup`,h,v),r.addEventListener(`pointercancel`,g,v),r.addEventListener(`keydown`,_,v)}function Sa(e,t=!0){let n=e=>{e.preventDefault(),e.stopPropagation()},r=()=>{setTimeout(()=>{e.removeEventListener(`click`,n,{capture:!0})})};e.addEventListener(`click`,n,{capture:!0,once:!0}),t?r():e.addEventListener(`pointerup`,r,{capture:!0,once:!0})}function Ca(e,t,n,r,i){let a=t.clientX,o=0,s,c=()=>{o=0,s!==void 0&&i(s),s=void 0},l=!1,u=e=>{l||=e.clientX!==a,l&&(s=n+(e.clientX-a)*r,o||=requestAnimationFrame(c))},d=t=>{t.type===`pointerup`&&u(t),o&&cancelAnimationFrame(o),c(),e.removeAttribute(`data-active`),e.removeEventListener(`pointermove`,u),e.removeEventListener(`pointerup`,d),e.removeEventListener(`pointercancel`,d),e.hasPointerCapture(t.pointerId)&&e.releasePointerCapture(t.pointerId)};t.preventDefault();try{e.setPointerCapture(t.pointerId)}catch{}e.setAttribute(`data-active`,``),e.addEventListener(`pointermove`,u),e.addEventListener(`pointerup`,d),e.addEventListener(`pointercancel`,d)}var wa=class{constructor(){this.model=$i({columns:[],data:[],getRowId:void 0,sorting:[],columnSizing:{},columnOrder:[]})}update(e){this.model.update(e)}};function Ta(e){return typeof e==`object`?e.key:e}function Ea(e,t){let n=e.length;return new Proxy(e,{get(e,r,i){if(typeof r==`string`){let i=r.charCodeAt(0);if(i>=48&&i<=57){let i=+r;if(Number.isInteger(i)&&i>=0&&i<n){let n=e[i];if(typeof n!=`object`){let r=t[i*2];n=e[i]={index:i,key:n,start:r,size:t[i*2+1],end:r+t[i*2+1],lane:0}}return n}}if(r===`length`)return n}return Reflect.get(e,r,i)}})}function Da(e,t,n){let r=n.initialDeps??[],i,a=!0;function o(){let o=e();return(o.length!==r.length||o.some((e,t)=>r[t]!==e))&&(r=o,i=t(...o),n?.onChange&&!(a&&n.skipInitialOnChange)&&n.onChange(i),a=!1),i}return o.updateDeps=e=>{r=e},o}function Oa(e,t){if(e===void 0)throw Error(`Unexpected undefined${t?`: ${t}`:``}`);return e}var J=(e,t)=>Math.abs(e-t)<1.01,ka=(e,t,n)=>{let r;return Object.assign(function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)},{cancel:()=>{e.clearTimeout(r)}})};function Aa({offset:e,isScrolling:t,elementMax:n,holdOffset:r,scrollOffset:i,pendingWrite:a,clampedMaxAtWrite:o}){return t&&a===null&&e===i?`spurious`:a!==null&&Math.abs(e-a.target)<1.5?`readBack`:a!==null&&!a.smooth&&n!==null&&a.target>n+r+.5&&Math.abs(e-(n+r))<1.5||a!==null&&!a.smooth&&a.lowMaxes?.some(t=>Math.abs(e-t)<1.5)?`clampedReadBack`:o!==null&&Math.abs(e-o)<1.5?`clampedEcho`:`external`}var ja=e=>e===`smooth`||e===`smoothFinishing`;function Ma({kind:e,offset:t,command:n,target:r}){return e!==`spurious`&&e!==`readBack`&&e!==`clampedReadBack`&&n?.index!=null&&n.phase!==`queued`&&!ja(n.phase)&&!J(t,n.lastTargetOffset)&&!J(t,r())&&e!==`clampedEcho`}var Na=40;function Pa(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<Na;)n--;if(n<0)return!1;let r=e[n],i=n-1;for(;i>=0&&r.t-e[i].t<Na;)i--;if(i<0)return!1;let a=e[i],o=(t.offset-r.offset)/(t.t-r.t),s=(r.offset-a.offset)/(r.t-a.t);return o*s>=0&&Math.abs(o)>=2*Math.abs(s)&&Math.abs(o)-Math.abs(s)>=.8}function Fa(e){let t=e[e.length-1];if(t===void 0)return!1;let n=e.length-2;for(;n>=0&&t.t-e[n].t<Na;)n--;if(n<0)return!1;let r=e[n];return Math.abs(t.offset-r.offset)/(t.t-r.t)>=.05}var Ia,La=()=>{if(Ia!==void 0)return Ia;if(typeof navigator>`u`)return Ia=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return Ia=!0;let e=navigator.maxTouchPoints;return Ia=navigator.platform===`MacIntel`&&e!==void 0&&e>0},Ra,za=()=>Ra===void 0?Ra=La()&&typeof CSS<`u`&&typeof CSS.supports==`function`&&CSS.supports(`overflow-anchor: auto`):Ra,Ba=()=>!La()||za(),Va={capture:!0,passive:!0},Ha=class{constructor(e){this.host=e,this._touch=null,this.inMotion=()=>this._touch!==null&&this._touch.phase!==`lateFling`,this.dragging=()=>this._touch?.phase===`down`&&this._touch.moved,this.tail=()=>this._touch?.phase===`tail`?this._touch.moved?`fling`:`tap`:null,this.onScroll=({isScrolling:e,ownReadBack:t,moved:n,external:r})=>(e&&this._touch?.phase===`tail`?this._openTail(this._touch.moved||!t,!1):this._touch?.phase===`lateFling`&&(this.host.now()>this._touch.until?this._touch=null:r&&e&&n&&this._openTail(!0,!1)),!t&&e&&n&&this._touch?.phase===`down`?(this._touch.moved=!0,!0):!1),this.touchStart=()=>{this.end(),this._touch={phase:`down`,moved:!1}},this.touchEnd=()=>{let e=this._touch?.phase===`down`&&this._touch.moved;this.end(),this._openTail(e,e)},this.end=()=>{let e=this.host.getWindow();this._touch?.phase===`tail`&&e!=null&&e.clearTimeout(this._touch.timerId),this._touch=null},this.listen=e=>{let t=()=>this.touchStart(),n=()=>this.touchEnd();return e.addEventListener(`touchstart`,t,Va),e.addEventListener(`touchend`,n,Va),e.addEventListener(`touchcancel`,n,Va),()=>{e.removeEventListener(`touchstart`,t,Va),e.removeEventListener(`touchend`,n,Va),e.removeEventListener(`touchcancel`,n,Va),this.end()}},this._openTail=(e,t)=>{let n=this.host.getWindow();if(n==null)return;this.end();let r={phase:`tail`,moved:e,awaitingFling:t,timerId:n.setTimeout(()=>{this.host.tailStillMoving()?this._openTail(r.moved,r.awaitingFling):(this._touch=r.awaitingFling?{phase:`lateFling`,until:this.host.now()+1e3}:null,this.host.onTailClosed())},150)};this._touch=r}}get touch(){return this._touch}},Ua=e=>{let{clientWidth:t,clientHeight:n}=e;return{width:t,height:n}},Wa=e=>{let t=/* @__PURE__ */ new Set;return{schedule:n=>{let r=e.requestAnimationFrame(()=>{t.delete(r),n()});t.add(r)},cancel:()=>{t.forEach(t=>e.cancelAnimationFrame(t)),t.clear()}}},Ga=e=>e,Ka=e=>{let t=e.overscan*Math.max(e.lanes??1,1),n=Math.max(e.startIndex-t,0),r=Math.min(e.endIndex+t,e.count-1)-n+1,i=Array(r);for(let e=0;e<r;e++)i[e]=n+e;return i},qa=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let i=e=>{let{width:n,height:r}=e;t({width:Math.round(n),height:Math.round(r)})};if(i(Ua(n)),!r.ResizeObserver)return()=>{};let a=Wa(r),o=new r.ResizeObserver(()=>{let t=()=>{i(Ua(n))};e.options.useAnimationFrameWithResizeObserver?a.schedule(t):t()});return o.observe(n,{box:`content-box`}),()=>{o.unobserve(n),a.cancel()}},Ja={passive:!0},Ya=typeof window>`u`||`onscrollend`in window,Xa=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let i=e.targetWindow;if(!i)return;let a=e.options.useScrollendEvent&&Ya,o=0,s=a?null:ka(i,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=e=>()=>{o=n(r),s?.(),t(o,e)},l=c(!0),u=c(!1);return r.addEventListener(`scroll`,l,Ja),a&&r.addEventListener(`scrollend`,u,Ja),()=>{r.removeEventListener(`scroll`,l),a&&r.removeEventListener(`scrollend`,u),s?.cancel()}},Za=(e,t)=>Xa(e,t,t=>{let{horizontal:n,isRtl:r}=e.options;return n?t.scrollLeft*(r&&-1||1):t.scrollTop}),Qa=(e,t,n)=>{if(n.options.useCachedMeasurements){let t=n.indexFromElement(e),r=n.options.getItemKey(t);return n.itemSizeCache.get(r)??n.options.estimateSize(t)}if(t?.borderBoxSize){let e=t.borderBoxSize[0];if(e)return Math.round(e[n.options.horizontal?`inlineSize`:`blockSize`])}if(!t){let t=n.indexFromElement(e),r=n.options.getItemKey(t),i=n.itemSizeCache.get(r);if(i!==void 0)return i}return e[n.options.horizontal?`offsetWidth`:`offsetHeight`]},$a=(e,{adjustments:t=0,behavior:n},r)=>{var i;let{scrollElement:a,options:o}=r,s=e+t,c=o.horizontal&&o.isRtl&&a!==null&&`ownerDocument`in a;(i=a?.scrollTo)==null||i.call(a,{[o.horizontal?`left`:`top`]:c?-s:s,behavior:n})},eo=(e,t)=>e===`smooth`?t?`smoothLanded`:`smooth`:`instant`,to=e=>e?.phase===`smooth`||e?.phase===`smoothLanded`;function no(e,t,n,r){if(t===0)return!1;let i=r(0),a=/* @__PURE__ */ new Set,o=0;for(;o<e;){let e=n(o);if(e===i)break;a.add(e),o++}let s=e-o;if(s===0||s>=t)return!1;for(let e=0;e<s;e++)if(r(e)!==n(o+e))return!1;for(let e=s;e<t;e++)if(a.has(r(e)))return!1;return!0}var ro=class{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=/* @__PURE__ */ new Map,this.itemSizeCacheVersion=0,this.laneAssignments=/* @__PURE__ */ new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._iosGesture=new Ha({getWindow:()=>this.targetWindow,now:()=>this.now(),tailStillMoving:()=>{let e=this.scrollState;if(e?.phase!==`queued`||this.pendingWrite!==null)return!1;let t=this._readElementOffset();return t===null||this._lastElementOffset===null||Math.abs(t-this._lastElementOffset)<1?!1:(this._lastElementOffset=t,e.samples=[...e.samples??[],{t:this.now(),offset:t}],!0)},onTailClosed:()=>{let e=this.scrollState;e?.phase===`queued`&&Fa(e.samples??[])&&(this.scrollState=null),this._flushHoldIfReady(!0),this._writeAwaitingCommand(),this._retryClampedAdjustment()}}),this._lastElementOffset=null,this.pendingWrite=null,this._clampedAdjustment=null,this.elementsCache=/* @__PURE__ */ new Map,this._resizeBatch=null,this.now=()=>{var e;return((e=this.targetWindow?.performance)?.now)?.call(e)??Date.now()},this.observer=/* @__PURE__ */ (()=>{let e=null,t=null,n=!1,r=!1,i=/* @__PURE__ */ new Set,a=()=>{if(e)return e;let r=this.targetWindow;if(!r||!r.ResizeObserver)return null;let i=t=Wa(r);return e=new r.ResizeObserver(e=>{let t=()=>{let t={sync:!1};this._resizeBatch=t;try{e.forEach(o)}finally{this._resizeBatch=null,t.notify&&(this.notify(t.sync),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment(),this.measureElement(null))}};if(this.options.useAnimationFrameWithResizeObserver)i.schedule(t);else{n=!0;try{t()}finally{n=!1}}})},o=e=>{let t=e.target,n=this.indexFromElement(t);if(t.isConnected)this.isIndexInRange(n)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,e,this));else{this.observer.unobserve(t);for(let[e,n]of this.elementsCache)if(n===t){this.elementsCache.delete(e);break}}};return{disconnect:()=>{var n;(n=a())==null||n.disconnect(),t?.cancel(),i.clear(),r=!1,e=null,t=null},observe:o=>{let s=a();s&&(n?(i.add(o),r||(r=!0,t?.schedule(()=>{r=!1,i.forEach(t=>{t.isConnected&&e?.observe(t,{box:`border-box`})}),i.clear()}))):s.observe(o,{box:`border-box`}))},unobserve:e=>{var t;i.delete(e),(t=a())==null||t.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{let t={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Ga,rangeExtractor:Ka,onChange:()=>{},measureElement:Qa,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:`data-index`,initialMeasurementsCache:[],lanes:1,anchorTo:`start`,followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:`estimate`,useCachedMeasurements:!1};for(let n in e){let r=e[n];r!==void 0&&(t[n]=r)}let n=this.options,r=null,i=null,a=!1;if(n!==void 0&&n.enabled&&t.enabled&&t.anchorTo===`end`&&this.scrollElement!==null){let e=n.count,o=t.count,s=this.getMeasurements(),c=this._singleLaneMeasurements?.items??s,l=e=>Ta(c[e]),u=e>0?l(0):null,d=e>0?l(e-1):null;if(o!==e||e>0&&o>0&&(t.getItemKey(0)!==u||t.getItemKey(o-1)!==d)){a=!0;let c=e>0?this.getVirtualItemForOffset(this.getScrollOffset())??s[0]:null;c&&(r=[c.key,this.getScrollOffset()-c.start]);let u=t.followOnAppend===!0?`auto`:t.followOnAppend||null;u&&o>0&&this.isAtEnd(n.scrollEndThreshold)&&(e===0||t.getItemKey(o-1)!==d)&&(o>e||no(e,o,l,t.getItemKey))&&(i=u)}}this.options=t,a&&(this.pendingMin=0,this.itemSizeCacheVersion++);let o=null;if(r&&this.scrollOffset!==null&&!this._awaitingCommandReadBack()){let[e,t]=r,n=this.getMeasurements(),{count:a,getItemKey:s}=this.options,c=0;for(;c<a&&s(c)!==e;)c++;if(c<a){let e=n[c];if(e){let n=Math.max(0,e.start+t);!i&&n!==this.scrollOffset&&(o=n-this.scrollOffset,this.scrollOffset=n)}}}i?this.pendingScrollAnchor={kind:`follow`,behavior:i}:o!==null&&(this._canWriteScroll()?this.pendingScrollAnchor={kind:`anchor`,delta:o}:(this._holdOffset+=o,this._followOffsetTarget(o)))},this.notify=e=>{var t,n;(n=(t=this.options).onChange)==null||n.call(t,this,e)},this.maybeNotify=Da(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{var e;this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,(e=this._momentumStop)==null||e.restore(),this._momentumStop=null,this.isScrolling=!1,this.scrollDirection=null,this._holdOffset=0,this._reportedOverscroll=!1,this._clampedAdjustment=null,this.pendingWrite=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{let e=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==e){if(this.cleanup(),!e){this.maybeNotify();return}this.scrollElement=e,this.targetWindow=this.scrollElement&&`ownerDocument`in this.scrollElement?this.scrollElement.ownerDocument.defaultView:this.scrollElement?.window??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{let n=t?this._elementMaxScrollOffset():null,r=this._reportedOverscroll;this._reportedOverscroll=e<0||n!==null&&e>n+1;let i=e;this._lastElementOffset=i,e=this._toLayoutOffset(e);let a=this._classifyScrollEvent(e,t,n);if(a===`spurious`)return;a===`readBack`?e=this.pendingWrite.target:a===`clampedReadBack`&&this.scrollState?.index!=null&&e<this.getMaxScrollOffset()-1.5?this.scrollState.lastTargetOffset=e:Ma({kind:a,offset:e,command:this.scrollState,target:()=>this.getScrollStateTarget(this.scrollState)})&&(this.scrollState=null),this.pendingWrite=null,this._clampedAdjustment!==null&&Math.abs(e-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null);let o=this.getScrollOffset(),s=this.scrollDirection;this.scrollDirection=t?o===e?this.scrollDirection:o<e?`forward`:`backward`:null,this.scrollOffset=e,this.isScrolling=t;let c=this.scrollState;if(c?.phase===`queued`&&a===`external`&&t){if(r||this._reportedOverscroll)c.samples=[];else{let e=this.now();c.samples=[...(c.samples??[]).filter(t=>e-t.t<=200),{t:e,offset:i}],(s!==null&&this.scrollDirection!==s||Pa(c.samples))&&(this.scrollState=null)}}this._iosGesture.onScroll({isScrolling:t,ownReadBack:a===`readBack`,moved:e!==o,external:a===`external`&&this.scrollState?.phase!==`smooth`&&this.scrollState?.phase!==`smoothFinishing`})&&this.scrollState?.phase===`queued`&&(this.scrollState=null),this._flushHoldIfReady(!0),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),`addEventListener`in this.scrollElement&&this.unsubs.push(this._iosGesture.listen(this.scrollElement)),this._scrollToOffset(this.getScrollOffset())}this._noteClampMax();let t=this.pendingScrollAnchor;this.pendingScrollAnchor=null,t&&this.scrollElement&&this.options.enabled&&(t.kind===`anchor`?this._canWriteScroll()?to(this.scrollState)&&!J(this.getScrollOffset()-t.delta,this.scrollState.lastTargetOffset)||(this._followOffsetTarget(t.delta),this._scrollToOffset(this.getScrollOffset())):(this._holdOffset+=t.delta,this._followOffsetTarget(t.delta),this.notify(!1)):this.scrollToEnd({behavior:t.behavior})),this._flushHoldIfReady(!1),this._retryClampedAdjustment()},this._classifyScrollEvent=(e,t,n)=>Aa({offset:e,isScrolling:t,elementMax:n,holdOffset:this._holdOffset,scrollOffset:this.scrollOffset,pendingWrite:this.pendingWrite,clampedMaxAtWrite:this._clampedAdjustment?.maxAtWrite??null}),this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled||!this._canWriteScroll())return;let{target:e,maxAtWrite:t}=this._clampedAdjustment,n=this.getMaxScrollOffset();n>t+.5&&(this._clampedAdjustment=e>n+.5?{target:e,maxAtWrite:n}:null,this._scrollToOffset(e))},this._writeAwaitingCommand=()=>{let e=this.scrollState;if(e===null||e.phase!==`queued`)return;let{behavior:t}=e;this.getMeasurements();let n=this.getScrollStateTarget(e);e.lastTargetOffset=n,this._clampedAdjustment=null,e.phase=eo(t,e.index!=null&&J(n,this.getScrollOffset())),this._scrollToOffset(n,{behavior:t}),this.scheduleScrollReconcile()},this._readElementOffset=()=>{let e=this.scrollElement;if(e==null)return null;let{horizontal:t,isRtl:n}=this.options;return typeof e.scrollTop==`number`?t?e.scrollLeft*(n&&-1||1):e.scrollTop:typeof e.scrollY==`number`?t?e.scrollX:e.scrollY:null},this._canWriteScroll=()=>!(La()&&this._iosGesture.inMotion())&&!this._reportedOverscroll,this._flushHoldIfReady=e=>{if(this._holdOffset===0||!this.scrollElement||!this.options.enabled||!this._canWriteScroll()||this.scrollState?.phase===`smooth`)return;this._holdOffset=0,this.scrollOffset!==null&&this.scrollOffset<0&&(this.scrollOffset=0),this.notify(e);let t=this.getCommandWrittenOffset()??this.getScrollOffset();this._clampedAdjustment=this._clampedBy(t),this._scrollToOffset(t)},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?`width`:`height`]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset==`function`?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=Da(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(e,t,n,r,i,a,o,s)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s}),{key:!1}),this.isIndexInRange=e=>e>=0&&e<this.options.count,this.getMeasurements=Da(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:e,paddingStart:t,scrollMargin:n,getItemKey:r,enabled:i,lanes:a,laneAssignmentMode:o,gap:s},c)=>{let l=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(let t of this.laneAssignments.keys())t>=e&&this.laneAssignments.delete(t);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));let u=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1),a===1){let i=e*2,a=this._singleLaneMeasurements?.flat;if(!a||a.length<i){let e=new Float64Array(i);a&&u>0&&e.set(a.subarray(0,u*2)),a=e}let o=u===0?Array(e):this._singleLaneMeasurements.items.slice(),c;if(u===0)c=t+n;else{let e=u-1;c=a[e*2]+a[e*2+1]+s}for(let t=u;t<e;t++){let e=r(t);o[t]=e;let n=l.get(e),i=typeof n==`number`?n:this.options.estimateSize(t);a[t*2]=c,a[t*2+1]=i,c+=i+s}this._singleLaneMeasurements={flat:a,items:o};let d=Ea(o,a);return this.measurementsCache=d,d}let d=this.measurementsCache.slice(0,u),f=Array(a).fill(void 0),p=new Float64Array(a),m=0;for(let e=0;e<u;e++){let t=d[e];t&&(f[t.lane]===void 0&&m++,f[t.lane]=e,p[t.lane]=t.end)}for(let i=u;i<e;i++){let e=r(i),c=this.laneAssignments.get(i),u,h,g=o===`estimate`||l.has(e);if(c!==void 0&&this.options.lanes>1){u=c;let e=f[u],r=e===void 0?void 0:d[e];h=r?r.end+s:t+n}else if(m===a){let e=0,t=p[0],n=f[0];for(let r=1;r<a;r++){let i=p[r];(i<t||i===t&&f[r]<n)&&(e=r,t=i,n=f[r])}u=e,h=t+s,g&&this.laneAssignments.set(i,u)}else u=i%this.options.lanes,h=t+n,g&&this.laneAssignments.set(i,u);let _=l.get(e),v=typeof _==`number`?_:this.options.estimateSize(i),y=h+v;d[i]={index:i,start:h,size:v,end:y,key:e,lane:u},f[u]===void 0&&m++,f[u]=i,p[u]=y}return this.measurementsCache=d,d},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Da(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes,this._getLayoutTotalSize()+this.options.scrollMargin],(e,t,n,r,i)=>{if(e.length===0||t===0)return this.range=null,null;let a=Math.max(i-t,0);return this.range=oo(e,t,Math.min(n,a),r,r===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range},{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Da(()=>{let e=null,t=null,n=this.calculateRange();return n&&(e=n.startIndex,t=n.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t,this.options.lanes]},(e,t,n,r,i,a)=>r===null||i===null?[]:e({startIndex:r,endIndex:i,overscan:t,count:n,lanes:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{let t=this.options.indexAttribute,n=e.getAttribute(t);return n?parseInt(n,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=e=>{if(!to(this.scrollState))return!0;let t=this.scrollState.index??this.getVirtualItemForOffset(this.scrollState.lastTargetOffset)?.index;if(t!==void 0&&this.range){let n=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,t-n),i=Math.min(this.options.count-1,t+n);return e>=r&&e<=i}return!0},this.measureElement=e=>{if(!e){this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))});return}let t=this.indexFromElement(e);if(!this.isIndexInRange(t))return;let n=this.options.getItemKey(t),r=this.elementsCache.get(n);r!==e&&(r&&this.observer.unobserve(r),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(t)&&this.resizeItem(t,this.options.measureElement(e,void 0,this))},this.resizeItem=(e,t)=>{var n;if(!this.isIndexInRange(e))return;this._resizeBatch?.sync&&this.getMeasurements();let r,i,a,o=this._singleLaneMeasurements?.flat;if(this.options.lanes===1&&o!=null)a=this.options.getItemKey(e),i=o[e*2],r=o[e*2+1];else{let t=this.measurementsCache[e];if(!t)return;a=t.key,i=t.start,r=t.size}let s=this.itemSizeCache.get(a)??r,c=t-s;if(c!==0){let o=this.options.anchorTo===`end`&&!to(this.scrollState)&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,l=o?this._getLayoutTotalSize():0,u=this.getScrollOffset(),d=this.itemSizeCache.has(a)?i+s<=u&&this.scrollDirection!==`backward`:i<u,f=!to(this.scrollState)&&(this.shouldAdjustScrollPositionOnItemSizeChange===void 0?d:this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[e]??{index:e,key:a,start:i,size:r,end:i+r,lane:0},c,this));(this.pendingMin===null||e<this.pendingMin)&&(this.pendingMin=e),this.itemSizeCache.set(a,t),this.itemSizeCacheVersion++;let p=!1;if(this._awaitingCommandReadBack()||(o?p=this.applyScrollAdjustment(this._getLayoutTotalSize()-l):f&&(p=this.applyScrollAdjustment(c))),this._resizeBatch){this._resizeBatch.notify=!0,(n=this._resizeBatch).sync||(n.sync=p);return}this.notify(p),this._noteClampMax(),this._flushHoldIfReady(!0),this._retryClampedAdjustment()}},this.getVirtualItems=Da(()=>[this.getVirtualIndexes(),this.getMeasurements(),this._holdOffset],(e,t,n)=>{let r=[];for(let i=0,a=e.length;i<a;i++){let a=t[e[i]];r.push(n===0?a:{...a,start:a.start-n,end:a.end-n})}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{let t=this.getMeasurements();if(t.length===0)return;let n=this._singleLaneMeasurements?.flat,r=this.options.lanes===1&&n!=null;return Oa(t[io(0,t.length-1,r?e=>n[e*2]:e=>Oa(t[e]).start,e)])},this._noteClampMax=()=>{if(!this._awaitingCommandReadBack())return;let e=this._elementMaxScrollOffset();if(e===null)return;let t=this.pendingWrite,n=Math.max(e,0)+this._holdOffset;if(n>=t.target)return;let r=t.lowMaxes??=[];r[r.length-1]!==n&&r.push(n)},this.getMaxScrollOffset=()=>(this._elementMaxScrollOffset()??0)+this._holdOffset,this._toLayoutOffset=e=>{let t=e+this._holdOffset;return this.pendingScrollAnchor?.kind===`anchor`&&(t+=this.pendingScrollAnchor.delta),t},this._elementMaxScrollOffset=()=>{let e=this.scrollElement;if(e===null)return null;if(`scrollHeight`in e)return this.options.horizontal?e.scrollWidth-e.clientWidth:e.scrollHeight-e.clientHeight;if(`document`in e){let t=e.document.documentElement;return this.options.horizontal?t.scrollWidth-e.innerWidth:t.scrollHeight-e.innerHeight}return null},this._momentumStop=null,this._stopMomentum=e=>{let t=this.scrollElement,n=this.targetWindow;if(t===null||n===null)return;let r=`document`in t?t.document.scrollingElement:t;if(!r?.style)return;if(this._momentumStop){this._momentumStop.done=e;return}let{style:i}=r,a=this.options.horizontal?`overflow-x`:`overflow-y`,o=i.getPropertyValue(a),s=i.getPropertyPriority(a),c=()=>this.options.horizontal?r.clientHeight:r.clientWidth,l=c();if(i.setProperty(a,`hidden`,`important`),c()!==l){i.setProperty(a,o,s);return}let u={restore:()=>i.getPropertyValue(a)!==`hidden`||i.getPropertyPriority(a)!==`important`?!1:(i.setProperty(a,o,s),!0),done:e};this._momentumStop=u,n.requestAnimationFrame(()=>n.requestAnimationFrame(()=>{this._momentumStop===u&&(this._momentumStop=null,u.restore()&&u.done())}))},this._clampedBy=e=>{let t=this._elementMaxScrollOffset();if(t===null)return null;let n=t+this._holdOffset;return e>n+.5?{target:e,maxAtWrite:n}:null},this.getVirtualDistanceFromEnd=()=>Math.max(this._getLayoutTotalSize()+this.options.scrollMargin-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(e=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=e,this.getOffsetForAlignment=(e,t,n=0)=>{if(!this.scrollElement)return 0;let r=this.getSize(),i=this.getScrollOffset();t===`auto`&&(t=e>=i+r?`end`:`start`),t===`center`?e+=(n-r)/2:t===`end`&&(e-=r);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t=`auto`)=>{e=Math.max(0,Math.min(e,this.options.count-1));let n=this.getSize(),r=this.getScrollOffset(),i=this.getMeasurements()[e];if(!i)return;if(t===`auto`){if(i.end>=r+n-this.options.scrollPaddingEnd)t=`end`;else if(i.start<=r+this.options.scrollPaddingStart)t=`start`;else return[r,t]}if(t===`end`&&e===this.options.count-1){let e=this.getMaxScrollOffset(),n=e-this.options.paddingEnd+this.options.scrollPaddingEnd;return[Math.max(Math.min(n,e),0),t]}let a=t===`end`?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,i.size),t]},this.scrollToOffset=(e,{align:t=`start`,behavior:n=`auto`}={})=>{this._startScroll({index:null,align:t},this.getOffsetForAlignment(e,t),n,`absolute`)},this.scrollToIndex=(e,{align:t=`auto`,behavior:n=`auto`}={})=>{e=Math.max(0,Math.min(e,this.options.count-1));let r=this.getOffsetForIndex(e,t);if(!r)return;let[i,a]=r;this._startScroll({index:e,align:a},i,n,`absolute`)},this.scrollBy=(e,{behavior:t=`auto`}={})=>{let n=this.getOffsetForAlignment((this.getCommandWrittenOffset()??this.getScrollOffset())+e,`start`);this._startScroll({index:null,align:`start`},n,t,`relative`)},this.scrollToEnd=({behavior:e=`auto`}={})=>{this.options.count>0?this._startScroll({index:this.options.count-1,align:`end`,toEnd:!0},Math.max(this.getMaxScrollOffset(),0),e,`absolute`):this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:e})},this.cancelScroll=()=>{this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null},this.getTotalSize=()=>Math.max(this._getLayoutTotalSize()-this._holdOffset,0),this._getLayoutTotalSize=()=>{let e=this.getMeasurements(),t;if(e.length===0)t=this.options.paddingStart;else if(this.options.lanes===1){let n=e.length-1,r=this._singleLaneMeasurements?.flat;t=r==null?e[n]?.end??0:r[n*2]+r[n*2+1]}else{let n=Array(this.options.lanes).fill(null),r=e.length-1;for(;r>=0&&n.some(e=>e===null);){let t=e[r];n[t.lane]===null&&(n[t.lane]=t.end),r--}t=Math.max(...n.filter(e=>e!==null))}return Math.max(t-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let e=[];if(this.itemSizeCache.size===0)return e;let t=this.getMeasurements();for(let n of t)n&&this.itemSizeCache.has(n.key)&&e.push({index:n.index,key:n.key,start:n.start,size:n.size,end:n.end,lane:n.lane});return e},this._scrollToOffset=(e,{adjustments:t,behavior:n}={})=>{let r={target:e+(t??0),smooth:n===`smooth`};return this.pendingWrite=r,this.options.scrollToFn(e-this._holdOffset,{behavior:n,adjustments:t},this),r},this.getCommandWrittenOffset=()=>this.scrollState!==null&&this.pendingWrite!==null&&!this.pendingWrite.smooth?this.pendingWrite.target:null,this._awaitingCommandReadBack=()=>{let e=this.getCommandWrittenOffset();return!(La()&&this._iosGesture.dragging())&&e!==null&&!J(e,this.getScrollOffset())},this._followOffsetTarget=e=>{this.scrollState!==null&&this.scrollState.index==null&&(this.scrollState.lastTargetOffset+=e)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(e)}get scrollAdjustments(){return 0}applyScrollAdjustment(e,t){if(e===0)return!1;if(this._followOffsetTarget(e),this._canWriteScroll()){let n=this.getScrollOffset();this._clampedAdjustment=this._clampedBy(n+e);let r=this._scrollToOffset(n,{adjustments:e,behavior:t});return this.scrollOffset!==null&&(this.pendingWrite===r&&(this.scrollOffset+=e),this.scrollOffset<0&&(this.scrollOffset=0)),!0}return this._holdOffset+=e,this.scrollOffset!==null&&(this.scrollOffset+=e),!0}scheduleScrollReconcile(){this.targetWindow?this.rafId??=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}):this.scrollState=null}getScrollStateTarget(e){let t=e.toEnd?[Math.max(this.getMaxScrollOffset(),0)]:e.index==null?void 0:this.getOffsetForIndex(e.index,e.align);return t?t[0]:e.lastTargetOffset}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}if(this.scrollState.phase===`queued`){this.scheduleScrollReconcile();return}this.getMeasurements();let e=this.getScrollStateTarget(this.scrollState),t=this.scrollState.index==null?1:this.options.useAnimationFrameWithResizeObserver?3:2,n=e!==this.scrollState.lastTargetOffset;if(!n&&J(e,this.getScrollOffset())){if(this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothLanded`:this.scrollState.phase===`smoothFinishing`&&(this.scrollState.phase=`instant`),this.scrollState.stableFrames++,this.scrollState.stableFrames>=t){this.getScrollOffset()!==e&&this._scrollToOffset(e,{behavior:`auto`}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,n){let t=this.getSize()||600,n=Math.abs(e-this.getScrollOffset()),r=to(this.scrollState)&&n>t;this.scrollState.lastTargetOffset=e,r?this.scrollState.phase=`smooth`:this.scrollState.phase===`smooth`?this.scrollState.phase=`smoothFinishing`:this.scrollState.phase===`smoothLanded`&&(this.scrollState.phase=`instant`),this._scrollToOffset(e,{behavior:r?`smooth`:`auto`})}this.scheduleScrollReconcile()}_startScroll(e,t,n,r){this.pendingScrollAnchor=null,this._clampedAdjustment=null;let i=this._iosGesture.tail();if(r===`absolute`&&i!==null){if(i===`fling`&&Ba()){this._stopMomentum(()=>{this.scrollState?.phase!==`queued`||this._iosGesture.tail()!==`fling`||this._reportedOverscroll||(this._iosGesture.end(),this._flushHoldIfReady(!0),this._writeAwaitingCommand())}),this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,phase:`queued`,behavior:n,samples:[]},this.scheduleScrollReconcile();return}this._iosGesture.end()}this.scrollState={...e,startedAt:this.now(),lastTargetOffset:t,stableFrames:0,behavior:n,phase:eo(n,e.index!=null&&J(t,this.getScrollOffset()))},this._scrollToOffset(t,{behavior:n}),this.scheduleScrollReconcile()}},io=(e,t,n,r)=>{for(;e<=t;){let i=(e+t)/2|0,a=n(i);if(a<r)e=i+1;else if(a>r)t=i-1;else return i}return e>0?e-1:0};function ao(e,t,n){let r=0;for(;r<=t;){let i=(r+t)/2|0,a=e[i*2];if(a<n)r=i+1;else if(a>n)t=i-1;else return i}return r>0?r-1:0}function oo(e,t,n,r,i){let a=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:a};if(r===1&&i!==null){let e=ao(i,a,n),r=e,o=n+t;for(;r<a&&i[r*2]+i[r*2+1]<o;)r++;return{startIndex:e,endIndex:r}}let o=io(0,a,t=>e[t].start,n),s=o;if(r===1)for(;s<a&&e[s].end<n+t;)s++;else if(r>1){let i=Array(r).fill(0);for(;s<a&&i.some(e=>e<n+t);){let t=e[s];i[t.lane]=t.end,s++}let c=Array(r).fill(n+t);for(;o>=0&&c.some(e=>e>=n);){let t=e[o];c[t.lane]=t.start,o--}o=Math.max(0,o-o%r),s=Math.min(a,s+(r-1-s%r))}return{startIndex:o,endIndex:s}}var so=class{constructor(e,t){this.cleanup=()=>{},this.host=e,this.options={...t},this.virtualizer=new ro(this.resolveOptions(this.options)),this.host.addController(this)}getVirtualizer(){return this.virtualizer}setOptions(e){this.applyOptions(e)&&(this.virtualizer.setOptions(this.resolveOptions(this.options)),this.virtualizer._willUpdate(),this.host.requestUpdate())}hostConnected(){this.cleanup=this.virtualizer._didMount(),this.virtualizer._willUpdate(),this.host.requestUpdate()}hostUpdated(){this.virtualizer._willUpdate()}hostDisconnected(){this.cleanup()}applyOptions(e){let t={...this.options},n=!1;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;let i=e[r];i!==void 0&&(Object.is(t[r],i)||(n=!0,Object.assign(t,{[r]:i})))}return n&&(this.options=t),n}resolveOptions(e){return{...e,onChange:(t,n)=>{var r;this.host.updateComplete.then(()=>this.host.requestUpdate()),(r=e.onChange)==null||r.call(e,t,n)}}}},co=class extends so{constructor(e,t){super(e,{observeElementRect:qa,observeElementOffset:Za,scrollToFn:$a,...t})}},lo=class{#e;#t=new na;#n=new ra;#r;#i;#a;#o;#s={count:0,rowHeight:40,overscan:6,rowIdAt:String,cap:1/0};#c;constructor(e,t){this.#r=e,this.#i=t,this.#e=new co(e,{count:0,getScrollElement:()=>this.#l(),observeElementRect:(e,t)=>{let n=this.#a;if(!n)return;let r=()=>{t({width:n.clientWidth,height:n.clientHeight})};r();let i=new ResizeObserver(r);return i.observe(n),()=>{i.disconnect()}},estimateSize:()=>this.#s.rowHeight,overscan:this.#s.overscan,rangeExtractor:e=>oa(e,aa(this.#a?.clientHeight??0,this.#s.rowHeight))}),e.addController(this)}#l(){let e=this.#i();return e?(this.#a===e&&this.#o||(this.#a=e,this.#o=new Proxy(e,{get:(e,t)=>{if(t===`scrollTop`)return this.#u(e);if(t===`scrollHeight`)return e.scrollHeight+this.#n.excess;if(t===`scrollTo`)return t=>{t.top===void 0?e.scrollTo(t):this.#d(e,t.top,t.behavior)};let n=Reflect.get(e,t);return typeof n==`function`?n.bind(e):n}})),this.#o):null}#u(e){let t=e.scrollTop,n=this.#n;return n.scaled?n.toLogical(t,e.scrollHeight-e.clientHeight):t}#d(e,t,n,r){let i=this.#n;if(!i.scaled){e.scrollTo({top:t,behavior:n});return}let a=e.scrollHeight-e.clientHeight,o=Math.min(Math.max(t,0),a+i.excess),s=i.toPhysical(o,a);e.scrollTo({top:r?r(s):s,behavior:n}),n!==`smooth`&&i.land(o,e.scrollTop)}configure(e){let t=this.#s;this.#s=e,(e.count!==t.count||e.overscan!==t.overscan||e.rowHeight!==t.rowHeight)&&(this.#e.setOptions({count:e.count,overscan:e.overscan}),e.rowHeight!==t.rowHeight&&this.#e.getVirtualizer().measure());let n=this.#n.excess>0,r=this.#e.getVirtualizer().scrollOffset;this.#n.configure(e.count*e.rowHeight,e.cap)&&(n||this.#n.scaled)&&r!==null&&r>0&&(this.#c=r)}hostUpdated(){let e=this.#c;e!==void 0&&(this.#c=void 0,this.#a&&this.#d(this.#a,e),this.#r.requestUpdate())}computeWindow(){let e=this.#e.getVirtualizer(),t=e.getVirtualItems(),n=this.#n.scaled,r=this.#n.size,i=n?(e.scrollOffset??0)-(this.#a?.scrollTop??0):0,a=/* @__PURE__ */ new Map;for(let e of t)a.set(this.#s.rowIdAt(e.index),{index:e.index,start:e.start-i});let{keep:o,rowHeight:s}=this.#s;if(this.#t.pin(o?.id),o&&!a.has(o.id)){let e=o.index*s-i;a.set(o.id,{index:o.index,start:n?Math.min(Math.max(e,-s),r):e})}let c=[];for(let{id:e,slot:t}of this.#t.update(a.keys())){let n=a.get(e);n&&c.push({slot:t,...n})}let l=e.range;return{rows:c,totalSize:n?r:e.getTotalSize(),range:l?{start:l.startIndex,end:l.endIndex}:null}}get poolSize(){return this.#t.size}get scaled(){return this.#n.scaled}scrollToIndex(e,t=`start`){this.#e.getVirtualizer().scrollToIndex(e,{align:t})}scrollBy(e){let t=this.#a;t&&this.#d(t,this.#u(t)+e)}scrollToEdge(e){let t=this.#a;t&&this.#d(t,e===`start`?0:2**53-1)}reveal(e,t,n){let r=this.#a;if(!r)return!1;let{rowHeight:i}=this.#s,a=this.#u(r),o=r.clientHeight-t-n,s=e*i,c,l;return s<a?(c=s,l=Math.floor):s+i>a+o?(c=s+i-o,l=Math.ceil):c=a,c!==a&&this.#d(r,c,void 0,l),this.#e.getVirtualizer().scrollOffset!==this.#u(r)}},uo=`argus-range-change`,fo=`argus-sort-change`,po=`argus-column-resize`,mo=`argus-column-reorder`,ho=`argus-row-click`,go=`argus-cell-click`,_o=`argus-load-error`;function Y(e,t,n){return e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0,composed:!0}))}var vo=[32e6,16e6,8e6,4e6,2e6],yo=2e6,bo=1e3,xo,So=0,Co=/* @__PURE__ */ new Set;function wo(){if(window.devicePixelRatio!==So){So=window.devicePixelRatio,xo=void 0;for(let e of Co)e()}}function To(){if(xo!==void 0)return xo;let e=document.createElement(`div`);return e.setAttribute(`aria-hidden`,`true`),e.style.cssText=`position:fixed;inset-block-start:0;inset-inline-start:0;inline-size:1px;visibility:hidden;pointer-events:none`,document.body.append(e),xo=vo.find(t=>(e.style.blockSize=`${String(t)}px`,e.offsetHeight>=t-1))??yo,e.remove(),xo}function Eo(e,t){return e+t<yo?1/0:Math.max(To()-t-bo,0)}function Do(e){return Co.size===0&&(So=window.devicePixelRatio,window.addEventListener(`resize`,wo,{passive:!0})),Co.add(e),()=>{Co.delete(e),Co.size===0&&window.removeEventListener(`resize`,wo)}}var{I:Oo}=Ae,ko=e=>e,Ao=()=>document.createComment(``),jo=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new Oo(r.insertBefore(Ao(),i),r.insertBefore(Ao(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=ko(e).nextSibling;ko(r).insertBefore(e,i),e=t}}}return n},X=(e,t,n=e)=>(e._$AI(t,n),e),Mo={},No=(e,t=Mo)=>e._$AH=t,Po=e=>e._$AH,Fo=e=>{e._$AR(),e._$AA.remove()},Io=(e,t,n)=>{let r=/* @__PURE__ */ new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},Z=Be(class extends Ve{constructor(e){if(super(e),e.type!==ze.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=Po(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=X(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=X(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=X(i[d],a[m]),jo(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=X(i[f],a[p]),jo(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=Io(o,p,m),u=Io(s,d,f)),l.has(s[d])){if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=jo(e,i[d]);X(t,a[p]),c[p]=t}else c[p]=X(n,a[p]),jo(e,i[d],n),i[t]=null;p++}else Fo(i[f]),f--}else Fo(i[d]),d++;for(;p<=m;){let t=jo(e,c[m+1]);X(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&Fo(e)}return this.ut=o,No(e,c),D}});function Lo(e){return e==null?O:typeof e==`number`?String(e):e}function Ro(e){return e==null?``:e instanceof Date?e.toLocaleString():typeof e==`object`?JSON.stringify(e):String(e)}var zo=(e,t)=>`c-${String(e)}-${String(t)}`,Bo=e=>`h-${String(e)}`,Vo=(e,t,n)=>`${e===`top`?`t`:`b`}-${String(t)}-${String(n)}`;function Ho(e,t=!1){let n=t?`cell cell-pinned-row`:`cell`;return e.pin&&(n+=e.pinEdge?` cell-pinned cell-pinned-edge`:` cell-pinned`),e.sorted&&(n+=` cell-sorted`),n}function Uo(e){if(e)return e===`asc`?`ascending`:`descending`}function Wo(e){return e.pin?`--_pin-offset: ${String(e.offset)}px`:void 0}function Go(e,t,n,r,i,a){return E`<div
5
5
  part="body"
6
6
  role="rowgroup"
7
7
  style=${Ze({blockSize:`${String(n)}px`})}
8
8
  >
9
- ${Z(e,e=>e.slot,e=>Wo(e,t,e.index===r?.index?r.col:void 0,i,a))}
10
- </div>`}function Wo(e,t,n,r,i){let a=i?.stateAt(e.index)??`loaded`,o=e.index%2==0?`row row-even`:`row row-odd`;a!==`loaded`&&(o+=` row-loading`);let s=a===`error`?i?.retry.get(e.index):void 0;return E`<div
9
+ ${Z(e,e=>e.slot,e=>Ko(e,t,e.index===r?.index?r.col:void 0,i,a))}
10
+ </div>`}function Ko(e,t,n,r,i){let a=i?.stateAt(e.index)??`loaded`,o=e.index%2==0?`row row-even`:`row row-odd`;a!==`loaded`&&(o+=` row-loading`);let s=a===`error`?i?.retry.get(e.index):void 0;return E`<div
11
11
  part=${o}
12
12
  class="row"
13
13
  role="row"
@@ -15,19 +15,19 @@ function gi(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r)
15
15
  aria-busy=${a===`loading`?`true`:O}
16
16
  style=${Ze({transform:`translateY(${String(e.start)}px)`})}
17
17
  >
18
- ${Z(t,e=>e.id,t=>Go(t,t.id===n,Lo(e.slot,t.colIndex),!1,Ko(a,t.colIndex===1?s:void 0,e.index,i)))}
19
- </div>`}function Go(e,t,n,r,i=O){return E`<div
20
- part=${Bo(e,r)}
18
+ ${Z(t,e=>e.id,t=>qo(t,t.id===n,zo(e.slot,t.colIndex),!1,Jo(a,t.colIndex===1?s:void 0,e.index,i)))}
19
+ </div>`}function qo(e,t,n,r,i=O){return E`<div
20
+ part=${Ho(e,r)}
21
21
  role="gridcell"
22
22
  aria-colindex=${e.colIndex}
23
23
  tabindex=${t?0:-1}
24
24
  data-col=${e.id}
25
25
  data-align=${e.align}
26
26
  data-pin=${e.pin??O}
27
- style=${Ho(e)??O}
27
+ style=${Wo(e)??O}
28
28
  >
29
29
  ${i}<slot name=${n}></slot>
30
- </div>`}function Ko(e,t,n,r){return e===`loaded`?O:t!==void 0&&r?E`<button
30
+ </div>`}function Jo(e,t,n,r){return e===`loaded`?O:t!==void 0&&r?E`<button
31
31
  part="retry"
32
32
  type="button"
33
33
  tabindex="-1"
@@ -39,7 +39,7 @@ function gi(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r)
39
39
  </button>`:E`<div
40
40
  part=${e===`error`?`skeleton skeleton-error`:`skeleton`}
41
41
  aria-hidden="true"
42
- ></div>`}function qo(e,t,n,r){let i=t.columns;Me(E`${Z(i,e=>e.id,e=>E`<div slot=${Ro(e.colIndex)}>${Jo(e)}</div>`)}${Yo(t,`top`)}${Z(n,e=>e.slot,e=>Z(i,e=>e.id,n=>E`<div slot=${Lo(e.slot,n.colIndex)}>${Zo(t,e.index,n)}</div>`))}${Yo(t,`bottom`)}`,e,{host:e,renderBefore:r})}function Jo(e){let{header:t}=e;return Fo(typeof t==`function`?t():t)}function Yo(e,t){let n=e.columns;return Array.from({length:e.pinnedCount(t)},(e,t)=>t).map(r=>Z(n,e=>e.id,n=>E`<div slot=${zo(t,r,n.colIndex)}>${Xo(e,t,r,n)}</div>`))}function Xo(e,t,n,r){if(r.cell){let i=e.pinnedCellContext(t,n,r.id);return i?Fo(r.cell(i.row,i)):``}return r.hasAccessor?Io(e.pinnedValueAt(t,n,r.id)):``}function Zo(e,t,n){if(n.cell){let r=e.cellContext(t,n.id);return r?Fo(n.cell(r.row,r)):``}return n.hasAccessor?Io(e.valueAt(t,n.id)):``}function Qo(e,t,n,r){return E`<div part="header" role="rowgroup">
42
+ ></div>`}function Yo(e,t,n,r){let i=t.columns;Me(E`${Z(i,e=>e.id,e=>E`<div slot=${Bo(e.colIndex)}>${Xo(e)}</div>`)}${Zo(t,`top`)}${Z(n,e=>e.slot,e=>Z(i,e=>e.id,n=>E`<div slot=${zo(e.slot,n.colIndex)}>${$o(t,e.index,n)}</div>`))}${Zo(t,`bottom`)}`,e,{host:e,renderBefore:r})}function Xo(e){let{header:t}=e;return Lo(typeof t==`function`?t():t)}function Zo(e,t){let n=e.columns;return Array.from({length:e.pinnedCount(t)},(e,t)=>t).map(r=>Z(n,e=>e.id,n=>E`<div slot=${Vo(t,r,n.colIndex)}>${Qo(e,t,r,n)}</div>`))}function Qo(e,t,n,r){if(r.cell){let i=e.pinnedCellContext(t,n,r.id);return i?Lo(r.cell(i.row,i)):``}return r.hasAccessor?Ro(e.pinnedValueAt(t,n,r.id)):``}function $o(e,t,n){if(n.cell){let r=e.cellContext(t,n.id);return r?Lo(n.cell(r.row,r)):``}return n.hasAccessor?Ro(e.valueAt(t,n.id)):``}function es(e,t,n,r){return E`<div part="header" role="rowgroup">
43
43
  <div
44
44
  part="header-row"
45
45
  class="row"
@@ -50,21 +50,21 @@ function gi(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r)
50
50
  @dblclick=${t.dblclick}
51
51
  >
52
52
  ${Z(e,e=>e.id,e=>E`<div
53
- part=${$o(e,r)}
53
+ part=${ts(e,r)}
54
54
  role="columnheader"
55
55
  aria-colindex=${e.colIndex}
56
- aria-sort=${Vo(e.sorted)??O}
56
+ aria-sort=${Uo(e.sorted)??O}
57
57
  data-col=${e.id}
58
58
  data-sort-col=${e.sortable?e.id:O}
59
59
  data-move-col=${e.reorderable?e.id:O}
60
60
  tabindex=${e.id===n?0:-1}
61
61
  data-align=${e.align}
62
62
  data-pin=${e.pin??O}
63
- style=${Ho(e)??O}
63
+ style=${Wo(e)??O}
64
64
  >
65
- <slot name=${Ro(e.colIndex)}></slot>
65
+ <slot name=${Bo(e.colIndex)}></slot>
66
66
  ${e.sortable?E`<span class="sort-indicator" aria-hidden="true"></span>`:O}
67
- ${e.resizable?es(e):O}
67
+ ${e.resizable?ns(e):O}
68
68
  ${r?.target?.columnId===e.id?E`<span
69
69
  part="drop-indicator"
70
70
  data-edge=${r.target.edge}
@@ -72,7 +72,7 @@ function gi(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r)
72
72
  ></span>`:O}
73
73
  </div>`)}
74
74
  </div>
75
- </div>`}function $o(e,t){let n=e.sorted?`header-cell header-cell-sorted`:`header-cell`;return t?.columnId===e.id&&(n+=` header-cell-dragging`),n}function es(e){return E`<div
75
+ </div>`}function ts(e,t){let n=e.sorted?`header-cell header-cell-sorted`:`header-cell`;return t?.columnId===e.id&&(n+=` header-cell-dragging`),n}function ns(e){return E`<div
76
76
  part="resize-handle"
77
77
  role="separator"
78
78
  aria-orientation="vertical"
@@ -81,21 +81,21 @@ function gi(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r)
81
81
  aria-valuemin=${e.minWidth}
82
82
  aria-valuemax=${Number.isFinite(e.maxWidth)?e.maxWidth:O}
83
83
  data-resize-col=${e.id}
84
- ></div>`}function ts(e,t,n,r,i){return t===0?O:E`<div class="pinned" data-side=${e} role="rowgroup">
84
+ ></div>`}function rs(e,t,n,r,i){return t===0?O:E`<div class="pinned" data-side=${e} role="rowgroup">
85
85
  ${Array.from({length:t},(e,t)=>t).map(t=>E`<div
86
86
  part=${`row row-pinned row-pinned-${e}`}
87
87
  class="row"
88
88
  role="row"
89
89
  aria-rowindex=${r+t}
90
90
  >
91
- ${Z(n,e=>e.id,n=>Go(n,i?.index===t&&n.id===i.col,zo(e,t,n.colIndex),!0))}
91
+ ${Z(n,e=>e.id,n=>qo(n,i?.index===t&&n.id===i.col,Vo(e,t,n.colIndex),!0))}
92
92
  </div>`)}
93
- </div>`}var ns=o`@layer argus-base{:host{box-sizing:border-box;contain:content;color-scheme:light dark;block-size:400px;color:var(--argus-fg,CanvasText);background:var(--argus-bg,Canvas);font:var(--argus-font,inherit);border:var(--argus-outline,none);border-radius:var(--argus-radius,0);--_row-height:var(--argus-row-height,40px);--_pad:var(--argus-cell-padding-inline,12px);--_border:var(--argus-border-width,1px) solid var(--argus-border-color,light-dark(#e5e7eb,#374151));--_dir:1;display:block}:host(:dir(rtl)){--_dir:-1}:host([density=compact]){--_row-height:var(--argus-row-height,32px);--_pad:var(--argus-cell-padding-inline,8px)}:host([density=spacious]){--_row-height:var(--argus-row-height,52px);--_pad:var(--argus-cell-padding-inline,16px)}:host([hidden]){display:none}[part~=table]{overscroll-behavior:contain;block-size:100%;scroll-padding-block-start:calc((1 + var(--_pin-top-rows,0)) * var(--_row-height));scroll-padding-block-end:calc(var(--_pin-bottom-rows,0) * var(--_row-height));scroll-padding-inline:var(--_pin-start,0) var(--_pin-end,0);position:relative;overflow:auto}.row{grid-template-columns:var(--_cols);inline-size:var(--_width);min-inline-size:100%;block-size:var(--_row-height);box-sizing:border-box;display:grid}[part~=header]{z-index:2;position:sticky;inset-block-start:0}[part~=body]{contain:layout;position:relative}[part~=body]>.row{position:absolute;inset-block-start:0;inset-inline-start:0}[part~=row]{--_row-bg:var(--argus-bg,Canvas);--_row-surface:var(--_row-bg);background:var(--_row-surface)}[part~=row-odd]{--_row-bg:var(--argus-row-stripe-bg,var(--argus-bg,Canvas))}[part~=row]:hover{--_row-surface:var(--argus-row-hover-bg,var(--_row-bg))}.pinned{z-index:2;position:sticky}.pinned[data-side=top]{inset-block-start:var(--_row-height)}.pinned[data-side=bottom]{inset-block-end:0}[part~=row-pinned]{--_row-bg:var(--argus-pinned-row-bg,var(--argus-bg,Canvas))}[part~=cell],[part~=header-cell]{box-sizing:border-box;min-inline-size:0;padding-inline:var(--_pad);white-space:nowrap;border-block-end:var(--_border);align-items:center;display:flex;overflow:hidden}[part~=header-cell]{background:var(--argus-header-bg,light-dark(#f9fafb,#111827));color:var(--argus-header-fg,inherit);font-weight:600;position:relative}[part~=resize-handle]{z-index:1;cursor:col-resize;touch-action:none;inline-size:8px;position:absolute;inset-block:0;inset-inline-end:0}[part~=resize-handle]:after{content:"";background:var(--argus-resize-handle-color,light-dark(#9ca3af,#6b7280));opacity:0;inline-size:2px;position:absolute;inset-block:25%;inset-inline-end:0}[part~=header-cell]:hover [part~=resize-handle]:after,[part~=header-cell]:focus-visible [part~=resize-handle]:after,[part~=resize-handle][data-active]:after{opacity:1}[data-sort-col]{cursor:pointer;user-select:none}[data-move-col]{user-select:none}[data-dragging],[data-dragging] [part~=header-cell]{cursor:grabbing}[part~=header-cell-dragging]{opacity:.5}[part~=drop-indicator]{z-index:2;background:var(--argus-drop-indicator-color,Highlight);pointer-events:none;inline-size:2px;position:absolute;inset-block:0}[part~=drop-indicator][data-edge=start]{inset-inline-start:0}[part~=drop-indicator][data-edge=end]{inset-inline-end:0}[part~=header-cell]:focus-visible,[part~=cell]:focus-visible{outline:var(--argus-focus-ring,2px solid Highlight);outline-offset:-2px}.sort-indicator{visibility:hidden;border-bottom:.12em solid;border-right:.12em solid;flex:none;block-size:.35em;inline-size:.35em;margin-inline-start:.4em}[aria-sort] .sort-indicator{visibility:visible}[aria-sort=ascending] .sort-indicator{transform:translateY(.1em)rotate(-135deg)}[aria-sort=descending] .sort-indicator{transform:translateY(-.1em)rotate(45deg)}[data-align=end] .sort-indicator{order:-1;margin-inline:0 .4em}[data-pin]{z-index:1;position:sticky}[data-pin=start]{inset-inline-start:var(--_pin-offset)}[data-pin=end]{inset-inline-end:var(--_pin-offset)}[part~=row]>[data-pin]{position:relative;inset-inline:auto}[part~=row]>[data-pin=start]{transform:translateX(var(--_sx,0px))}[part~=row]>[data-pin=end]{transform:translateX(calc(var(--_sx,0px) - var(--_dir) * var(--_max-x,0px)))}[data-hscroll] [part~=row]>[data-pin]{position:sticky;transform:none}[data-hscroll] [part~=row]>[data-pin=start]{inset-inline-start:var(--_pin-offset)}[data-hscroll] [part~=row]>[data-pin=end]{inset-inline-end:var(--_pin-offset)}[part~=cell-pinned]{background:var(--_row-surface)}.pin-shadow{block-size:min(var(--_view-h,100%), var(--_content-h,100%));z-index:3;pointer-events:none;position:absolute;inset-block-start:0}.pin-shadow[data-side=start]{inset-inline-start:0}.pin-shadow[data-side=end]{inset-inline-end:var(--_sb-x,0px)}.pin-shadow:after{content:"";box-shadow:var(--argus-pinned-shadow,4px 0 6px -4px light-dark(#0003,#0009));transform:scaleX(var(--_dir));position:absolute;inset:0}.pin-shadow[data-side=end]:after{transform:scaleX(calc(-1 * var(--_dir)))}[data-align=center]{text-align:center;justify-content:center}[data-align=end]{text-align:end;justify-content:flex-end}::slotted(*){text-overflow:ellipsis;min-inline-size:0;overflow:hidden}[data-measure]{inline-size:max-content}[part~=skeleton]{background:var(--argus-skeleton-bg,color-mix(in srgb, currentColor 12%, transparent));border-radius:.3em;flex:none;block-size:.6em;inline-size:min(60%,8em);animation:1.6s ease-in-out infinite argus-skeleton-pulse}[part~=skeleton-error]{opacity:.5;animation:none}@keyframes argus-skeleton-pulse{50%{opacity:.45}}@media (prefers-reduced-motion:reduce){[part~=skeleton]{animation:none}}[part~=retry]{font:inherit;color:inherit;cursor:pointer}[part~=empty]{min-block-size:calc(100% - (1 + var(--_pin-top-rows,0) + var(--_pin-bottom-rows,0)) * var(--_row-height));padding:var(--_pad);box-sizing:border-box;justify-content:center;align-items:center;display:flex}.probe{inline-size:0;block-size:var(--_row-height);visibility:hidden;pointer-events:none;position:absolute;inset-block-start:0}}`;function rs(e){let t=e.attachInternals();return t.role=`grid`,t}function is(e){for(let t of e.composedPath())if(t instanceof HTMLElement){if(t.dataset.resizeCol!==void 0)return;if(t.dataset.sortCol!==void 0)return t.dataset.sortCol;if(t.getAttribute(`part`)===`header-row`)return}}var as=10,os={section:`header`,index:0};function Q(e){return new ta(e.pinnedCount(`top`),e.rowCount,e.pinnedCount(`bottom`))}function ss(e){if(!(e instanceof HTMLElement)||e.dataset.col===void 0)return;let t=e.getAttribute(`role`);return t===`gridcell`||t===`columnheader`?e:void 0}function cs(e,t){let n=e?.getAttribute(`aria-rowindex`);return n?t.fromAriaRowIndex(Number(n)):void 0}function ls(e,t,n,r){return t===0?O:E`<div
93
+ </div>`}var is=o`@layer argus-base{:host{box-sizing:border-box;contain:content;color-scheme:light dark;block-size:400px;color:var(--argus-fg,CanvasText);background:var(--argus-bg,Canvas);font:var(--argus-font,inherit);border:var(--argus-outline,none);border-radius:var(--argus-radius,0);--_row-height:var(--argus-row-height,40px);--_pad:var(--argus-cell-padding-inline,12px);--_border:var(--argus-border-width,1px) solid var(--argus-border-color,light-dark(#e5e7eb,#374151));--_dir:1;display:block}:host(:dir(rtl)){--_dir:-1}:host([density=compact]){--_row-height:var(--argus-row-height,32px);--_pad:var(--argus-cell-padding-inline,8px)}:host([density=spacious]){--_row-height:var(--argus-row-height,52px);--_pad:var(--argus-cell-padding-inline,16px)}:host([hidden]){display:none}[part~=table]{overscroll-behavior:contain;block-size:100%;position:relative;overflow:auto}[part~=body]>.row>[role=gridcell]{scroll-margin-block:calc((1 + var(--_pin-top-rows,0)) * var(--_row-height)) calc(var(--_pin-bottom-rows,0) * var(--_row-height))}[role=gridcell]:not([data-pin]),[role=columnheader]:not([data-pin]){scroll-margin-inline:var(--_pin-start,0) var(--_pin-end,0)}.row{grid-template-columns:var(--_cols);inline-size:var(--_width);min-inline-size:100%;block-size:var(--_row-height);box-sizing:border-box;display:grid}[part~=header]{z-index:2;position:sticky;inset-block-start:0}[part~=body]{contain:layout;position:relative}[part~=body]>.row{position:absolute;inset-block-start:0;inset-inline-start:0}[part~=row]{--_row-bg:var(--argus-bg,Canvas);--_row-surface:var(--_row-bg);background:var(--_row-surface)}[part~=row-odd]{--_row-bg:var(--argus-row-stripe-bg,var(--argus-bg,Canvas))}[part~=row]:hover{--_row-surface:var(--argus-row-hover-bg,var(--_row-bg))}.pinned{z-index:2;position:sticky}.pinned[data-side=top]{inset-block-start:var(--_row-height)}.pinned[data-side=bottom]{inset-block-end:0}[part~=row-pinned]{--_row-bg:var(--argus-pinned-row-bg,var(--argus-bg,Canvas))}[part~=cell],[part~=header-cell]{box-sizing:border-box;min-inline-size:0;padding-inline:var(--_pad);white-space:nowrap;border-block-end:var(--_border);align-items:center;display:flex;overflow:hidden}[part~=header-cell]{background:var(--argus-header-bg,light-dark(#f9fafb,#111827));color:var(--argus-header-fg,inherit);font-weight:600;position:relative}[part~=resize-handle]{z-index:1;cursor:col-resize;touch-action:none;inline-size:8px;position:absolute;inset-block:0;inset-inline-end:0}[part~=resize-handle]:after{content:"";background:var(--argus-resize-handle-color,light-dark(#9ca3af,#6b7280));opacity:0;inline-size:2px;position:absolute;inset-block:25%;inset-inline-end:0}[part~=header-cell]:hover [part~=resize-handle]:after,[part~=header-cell]:focus-visible [part~=resize-handle]:after,[part~=resize-handle][data-active]:after{opacity:1}[data-sort-col]{cursor:pointer;user-select:none}[data-move-col]{user-select:none}[data-dragging],[data-dragging] [part~=header-cell]{cursor:grabbing}[part~=header-cell-dragging]{opacity:.5}[part~=drop-indicator]{z-index:2;background:var(--argus-drop-indicator-color,Highlight);pointer-events:none;inline-size:2px;position:absolute;inset-block:0}[part~=drop-indicator][data-edge=start]{inset-inline-start:0}[part~=drop-indicator][data-edge=end]{inset-inline-end:0}[part~=header-cell]:focus-visible,[part~=cell]:focus-visible{outline:var(--argus-focus-ring,2px solid Highlight);outline-offset:-2px}.sort-indicator{visibility:hidden;border-bottom:.12em solid;border-right:.12em solid;flex:none;block-size:.35em;inline-size:.35em;margin-inline-start:.4em}[aria-sort] .sort-indicator{visibility:visible}[aria-sort=ascending] .sort-indicator{transform:translateY(.1em)rotate(-135deg)}[aria-sort=descending] .sort-indicator{transform:translateY(-.1em)rotate(45deg)}[data-align=end] .sort-indicator{order:-1;margin-inline:0 .4em}[data-pin]{z-index:1;position:sticky}[data-pin=start]{inset-inline-start:var(--_pin-offset)}[data-pin=end]{inset-inline-end:var(--_pin-offset)}[part~=row]>[data-pin]{position:relative;inset-inline:auto}[part~=row]>[data-pin=start]{transform:translateX(var(--_sx,0px))}[part~=row]>[data-pin=end]{transform:translateX(calc(var(--_sx,0px) - var(--_dir) * var(--_max-x,0px)))}[data-hscroll] [part~=row]>[data-pin]{position:sticky;transform:none}[data-hscroll] [part~=row]>[data-pin=start]{inset-inline-start:var(--_pin-offset)}[data-hscroll] [part~=row]>[data-pin=end]{inset-inline-end:var(--_pin-offset)}[part~=cell-pinned]{background:var(--_row-surface)}.pin-shadow{block-size:min(var(--_view-h,100%), var(--_content-h,100%));z-index:3;pointer-events:none;position:absolute;inset-block-start:0}.pin-shadow[data-side=start]{inset-inline-start:0}.pin-shadow[data-side=end]{inset-inline-end:var(--_sb-x,0px)}.pin-shadow:after{content:"";box-shadow:var(--argus-pinned-shadow,4px 0 6px -4px light-dark(#0003,#0009));transform:scaleX(var(--_dir));position:absolute;inset:0}.pin-shadow[data-side=end]:after{transform:scaleX(calc(-1 * var(--_dir)))}[data-align=center]{text-align:center;justify-content:center}[data-align=end]{text-align:end;justify-content:flex-end}::slotted(*){text-overflow:ellipsis;min-inline-size:0;overflow:hidden}[data-measure]{inline-size:max-content}[part~=skeleton]{background:var(--argus-skeleton-bg,color-mix(in srgb, currentColor 12%, transparent));border-radius:.3em;flex:none;block-size:.6em;inline-size:min(60%,8em);animation:1.6s ease-in-out infinite argus-skeleton-pulse}[part~=skeleton-error]{opacity:.5;animation:none}@keyframes argus-skeleton-pulse{50%{opacity:.45}}@media (prefers-reduced-motion:reduce){[part~=skeleton]{animation:none}}[part~=retry]{font:inherit;color:inherit;cursor:pointer}[part~=empty]{min-block-size:calc(100% - (1 + var(--_pin-top-rows,0) + var(--_pin-bottom-rows,0)) * var(--_row-height));padding:var(--_pad);box-sizing:border-box;justify-content:center;align-items:center;display:flex}.probe{inline-size:0;block-size:var(--_row-height);visibility:hidden;pointer-events:none;position:absolute;inset-block-start:0}}`;function as(e){let t=e.attachInternals();return t.role=`grid`,t}function os(e){for(let t of e.composedPath())if(t instanceof HTMLElement){if(t.dataset.resizeCol!==void 0)return;if(t.dataset.sortCol!==void 0)return t.dataset.sortCol;if(t.getAttribute(`part`)===`header-row`)return}}var ss=10,cs={section:`header`,index:0};function Q(e){return new ea(e.pinnedCount(`top`),e.rowCount,e.pinnedCount(`bottom`))}function ls(e){if(!(e instanceof HTMLElement)||e.dataset.col===void 0)return;let t=e.getAttribute(`role`);return t===`gridcell`||t===`columnheader`?e:void 0}function us(e,t){let n=e?.getAttribute(`aria-rowindex`);return n?t.fromAriaRowIndex(Number(n)):void 0}function ds(e,t,n,r){return t===0?O:E`<div
94
94
  class="pin-shadow"
95
95
  data-side=${e}
96
96
  aria-hidden="true"
97
97
  style=${Ze({inlineSize:`${String(t)}px`,"--_content-h":`${String((n+1)*r)}px`})}
98
- ></div>`}function us(e){return e.flex===void 0?`${String(e.width)}px`:`minmax(${String(e.minWidth)}px, ${String(e.flex)}fr)`}var $=class extends Pe{constructor(...e){super(...e),this.density=`comfortable`,this.#e=[],this.#t=[],this.#n=6,this.#r=na([]),this.#i=na({}),this.#a=na([]),this.#o=/* @__PURE__ */ new Map,this.#l=/* @__PURE__ */ new Map,this.#u=new la(()=>{this.requestUpdate()}),this.#f=!1,this.#m=rs(this),this.#h=new Ca,this.#g=new ua(this),this.#_=[],this.#v=!1,this.#y=!1,this.#x=new da(this),this.#S=!1,this.#C=new so(this,()=>this.renderRoot.querySelector(`[part~="table"]`)),this.#w=new pa(this,()=>this.renderRoot.querySelector(`[part~="table"]`)),this.#T=40,this.#D={rows:[],totalSize:0,range:null},this.#k=!1,this.#A=``,this.#I=e=>{let t=e.currentTarget;t.matches(`:focus`)&&t.parentElement?.focus({preventScroll:!0}),this.#x.retry(Number(t.dataset.row))},this.#z={click:e=>{let t=is(e);t!==void 0&&this.#ie(t)},pointerdown:e=>{if(e.button!==0)return;let t=e.composedPath()[0];if(!(t instanceof HTMLElement))return;let n=t.dataset.resizeCol,r=t.parentElement;n!==void 0&&r?Sa(t,e,r.getBoundingClientRect().width,this.#Y(),e=>{this.#X(n,e)}):this.#te(e)},dblclick:e=>{let t=e.composedPath()[0],n=t instanceof HTMLElement?t.dataset.resizeCol:void 0;n!==void 0&&this.#Z(ca(this.renderRoot,[n]))}},this.#B=e=>{let t=ss(e.composedPath()[0]??e.target??this),n=t?.dataset.col;if(!t||n===void 0)return;let r=e.currentTarget;if(e.key===`Tab`&&e.shiftKey){r.tabIndex=-1,t.addEventListener(`focusout`,()=>{r.removeAttribute(`tabindex`)},{once:!0});return}let i=t.getAttribute(`role`)===`columnheader`,{key:a}=e,o=a===`ArrowLeft`||a===`ArrowRight`;if(i&&o&&e.altKey&&e.shiftKey){e.preventDefault();let t=a===`ArrowRight`==(this.#Y()===1);this.#$(n,t?1:-1);return}if(i&&e.altKey&&o){e.preventDefault();let r=a===`ArrowRight`==(this.#Y()===1);this.#X(n,this.#J(n,t)+(r?as:-10));return}if(i&&(a===`Enter`||a===` `)&&t.dataset.sortCol!==void 0){e.preventDefault(),this.#ie(n);return}let s=e.ctrlKey||e.metaKey;if(e.altKey||e.shiftKey||s&&a!==`Home`&&a!==`End`)return;let c=this.#h.model,l=Q(c),u=i?os:cs(t.parentElement,l);if(!u)return;if(!i&&a===`Enter`){e.preventDefault(),u.section===`body`&&this.#x.stateAt(u.index)===`error`?this.#x.retry(u.index):this.#U(e.composedPath());return}let d=c.columns,f=l.position(u),p=l.total-1,m=l.position({section:`body`,index:0}),h=m+l.body-1,g=Math.floor(r.clientHeight/this.#T+.01),_=Math.max(1,g-1-l.top-l.bottom),v=d.findIndex(e=>e.id===n);switch(a){case`PageDown`:l.body>0&&f<=h&&(f=Math.min(Math.max(f,m-1)+_,h));break;case`PageUp`:l.body>0&&f>m&&(f=Math.max(Math.min(f,h+1)-_,m));break;case`ArrowDown`:f=Math.min(f+1,p);break;case`ArrowUp`:f=Math.max(f-1,0);break;case`ArrowRight`:v+=this.#Y();break;case`ArrowLeft`:v-=this.#Y();break;case`Home`:v=0,s&&(f=0,r.scrollTop=0);break;case`End`:v=d.length-1,s&&(f=p);break;default:return}e.preventDefault();let y=l.at(f)??os;a.startsWith(`Page`)&&u.section===`body`&&y.section===`body`&&this.#C.scrollBy((y.index-u.index)*this.#T),s&&a===`End`&&y.section===`bottom`&&(r.scrollTop=r.scrollHeight);let b=d[Math.min(Math.max(v,0),d.length-1)];b&&this.#G(y,b.id,c)},this.#V=e=>{let t=e.currentTarget;if(e.composedPath()[0]===t){let n=e.relatedTarget;n instanceof Node&&t.contains(n)||(this.#k=!0,this.requestUpdate())}else for(let t of e.composedPath()){let n=ss(t);if(n?.dataset.col!==void 0){let e=this.#h.model,t=n.getAttribute(`role`)===`columnheader`?os:cs(n.parentElement,Q(e)),{col:r}=n.dataset,i=this.#O;t&&(t.section!==i?.section||t.index!==i.index||r!==i.col)&&(this.#O={...t,rowId:this.#W(e,t),col:r},this.requestUpdate());return}if(t===e.currentTarget)return}},this.#H=e=>{this.#U(e.composedPath())}}static{this.styles=ns}get columns(){return this.#e}set columns(e){this.#e=e??[]}get data(){return this.#t}set data(e){this.#t=e??[]}get overscan(){return this.#n}set overscan(e){this.#n=e??6}get sorting(){return this.#r.value}set sorting(e){this.#r.set(e)}get columnSizing(){return this.#i.value}set columnSizing(e){this.#i.set(e)}get columnOrder(){return this.#a.value}set columnOrder(e){this.#a.set(e)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j;connectedCallback(){super.connectedCallback(),this.hasAttribute(`role`)||this.setAttribute(`role`,`grid`),this.hasUpdated&&this.#ae(),this.#j=To(()=>{this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback(),this.#E?.disconnect(),this.#j?.(),this.#j=void 0}#M(){return this.columns.length===0?this.#g.defs:(!this.#y&&this.#g.present&&(this.#y=!0,console.warn(`argus-table: the columns property is set, so <argus-column> children are ignored.`)),this.columns)}#N(){return this.#b?.parentNode!==this&&(this.#b=document.createComment(``),this.append(this.#b)),this.#b}async refresh(){this.#x.refresh(),this.requestUpdate(),await this.updateComplete}async autosizeColumns(e){await this.updateComplete;let t=this.#h.model.columns.filter(t=>t.resizable&&(e===void 0||e.includes(t.id))).map(e=>e.id);this.#Z(ca(this.renderRoot,t)),await this.updateComplete}async scrollToRow(e){await this.updateComplete,this.#C.scrollToIndex(e),await this.updateComplete}willUpdate(e){let t=this.#M();this.#v=t!==this.#_,this.#_=t,(e.has(`dataSource`)||e.has(`sorting`)||e.has(`getRowId`))&&(this.#x.configure({source:this.dataSource,sorting:this.#r.value,getRowId:this.getRowId}),this.dataSource&&this.hasUpdated&&e.has(`sorting`)&&(this.#S=!e.has(`dataSource`))),(this.#v||e.has(`data`)||e.has(`getRowId`)||e.has(`sorting`)||e.has(`columnSizing`)||e.has(`columnOrder`)||e.has(`pinnedRows`))&&(this.#v&&this.#u.sync(t.filter(e=>e.width===`auto`).map(e=>e.id)),this.#h.update({columns:t,data:this.data,getRowId:this.getRowId,sorting:this.#r.value,columnSizing:this.#i.value,columnOrder:this.#a.value,pinnedRows:this.pinnedRows}));let n=this.#u.widths;this.#f=n!==this.#d,this.#d=n,this.#h.update({remote:this.#x.rows,autoWidths:n});let r=this.#h.model;this.#q(r);let i=this.#O,a=this.#x.rows?.totalKnown===!1,o=Q(r);this.#m.ariaRowCount=a?`-1`:String(o.total),this.#m.ariaColCount=String(r.columns.length);let s=(1+o.top+o.bottom)*this.#T;this.#C.configure({count:r.rowCount,rowHeight:this.#T,cap:wo(r.rowCount*this.#T,s),overscan:Math.max(0,this.overscan),rowIdAt:e=>this.#L(r,e),keep:i?.section!==`body`||i.rowId===void 0?void 0:{id:i.rowId,index:i.index}})}render(){let e=this.#h.model,t=e.columns;this.#D=this.#C.computeWindow();let n=e=>t.reduce((t,n)=>n.pin===e?t+n.width:t,0),r=e=>`${String(n(e))}px`,i=Q(e),a={"--_cols":t.map(us).join(` `),"--_width":`${String(e.totalWidth)}px`,"--_pin-start":r(`start`),"--_pin-end":r(`end`),"--_pin-top-rows":String(i.top),"--_pin-bottom-rows":String(i.bottom)},o=this.#O,s=e=>o?.section===e?{index:o.index,col:o.col}:void 0,c=e=>i.ariaRowIndex({section:e,index:0});return this.rowHeight!==void 0&&this.rowHeight>0&&(a[`--_row-height`]=`${String(this.rowHeight)}px`),E`<div
98
+ ></div>`}function fs(e){return e.flex===void 0?`${String(e.width)}px`:`minmax(${String(e.minWidth)}px, ${String(e.flex)}fr)`}var $=class extends Pe{constructor(...e){super(...e),this.density=`comfortable`,this.#e=[],this.#t=[],this.#n=6,this.#r=ta([]),this.#i=ta({}),this.#a=ta([]),this.#o=/* @__PURE__ */ new Map,this.#l=/* @__PURE__ */ new Map,this.#u=new ua(()=>{this.requestUpdate()}),this.#f=!1,this.#m=as(this),this.#h=new wa,this.#g=new da(this),this.#_=[],this.#v=!1,this.#y=!1,this.#x=new fa(this),this.#S=!1,this.#C=new lo(this,()=>this.renderRoot.querySelector(`[part~="table"]`)),this.#w=new ma(this,()=>this.renderRoot.querySelector(`[part~="table"]`)),this.#T=40,this.#D={rows:[],totalSize:0,range:null},this.#k=!1,this.#A=``,this.#I=e=>{let t=e.currentTarget;t.matches(`:focus`)&&t.parentElement?.focus({preventScroll:!0}),this.#x.retry(Number(t.dataset.row))},this.#z={click:e=>{let t=os(e);t!==void 0&&this.#ie(t)},pointerdown:e=>{if(e.button!==0)return;let t=e.composedPath()[0];if(!(t instanceof HTMLElement))return;let n=t.dataset.resizeCol,r=t.parentElement;n!==void 0&&r?Ca(t,e,r.getBoundingClientRect().width,this.#Y(),e=>{this.#X(n,e)}):this.#te(e)},dblclick:e=>{let t=e.composedPath()[0],n=t instanceof HTMLElement?t.dataset.resizeCol:void 0;n!==void 0&&this.#Z(la(this.renderRoot,[n]))}},this.#B=e=>{let t=ls(e.composedPath()[0]??e.target??this),n=t?.dataset.col;if(!t||n===void 0)return;let r=e.currentTarget;if(e.key===`Tab`&&e.shiftKey){r.tabIndex=-1,t.addEventListener(`focusout`,()=>{r.removeAttribute(`tabindex`)},{once:!0});return}let i=t.getAttribute(`role`)===`columnheader`,{key:a}=e,o=a===`ArrowLeft`||a===`ArrowRight`;if(i&&o&&e.altKey&&e.shiftKey){e.preventDefault();let t=a===`ArrowRight`==(this.#Y()===1);this.#$(n,t?1:-1);return}if(i&&e.altKey&&o){e.preventDefault();let r=a===`ArrowRight`==(this.#Y()===1);this.#X(n,this.#J(n,t)+(r?ss:-10));return}if(i&&(a===`Enter`||a===` `)&&t.dataset.sortCol!==void 0){e.preventDefault(),this.#ie(n);return}let s=e.ctrlKey||e.metaKey;if(e.altKey||e.shiftKey||s&&a!==`Home`&&a!==`End`)return;let c=this.#h.model,l=Q(c),u=i?cs:us(t.parentElement,l);if(!u)return;if(!i&&a===`Enter`){e.preventDefault(),u.section===`body`&&this.#x.stateAt(u.index)===`error`?this.#x.retry(u.index):this.#U(e.composedPath());return}let d=c.columns,f=l.position(u),p=l.total-1,m=l.position({section:`body`,index:0}),h=m+l.body-1,g=Math.floor(r.clientHeight/this.#T+.01),_=Math.max(1,g-1-l.top-l.bottom),v=d.findIndex(e=>e.id===n);switch(a){case`PageDown`:l.body>0&&f<=h&&(f=Math.min(Math.max(f,m-1)+_,h));break;case`PageUp`:l.body>0&&f>m&&(f=Math.max(Math.min(f,h+1)-_,m));break;case`ArrowDown`:f=Math.min(f+1,p);break;case`ArrowUp`:f=Math.max(f-1,0);break;case`ArrowRight`:v+=this.#Y();break;case`ArrowLeft`:v-=this.#Y();break;case`Home`:v=0,s&&(f=0,this.#C.scrollToEdge(`start`));break;case`End`:v=d.length-1,s&&(f=p);break;default:return}e.preventDefault();let y=l.at(f)??cs;a.startsWith(`Page`)&&u.section===`body`&&y.section===`body`&&this.#C.scrollBy((y.index-u.index)*this.#T),s&&a===`End`&&y.section===`bottom`&&this.#C.scrollToEdge(`end`);let b=d[Math.min(Math.max(v,0),d.length-1)];b&&this.#G(y,b.id,c)},this.#V=e=>{let t=e.currentTarget;if(e.composedPath()[0]===t){let n=e.relatedTarget;n instanceof Node&&t.contains(n)||(this.#k=!0,this.requestUpdate())}else for(let t of e.composedPath()){let n=ls(t);if(n?.dataset.col!==void 0){let e=this.#h.model,t=n.getAttribute(`role`)===`columnheader`?cs:us(n.parentElement,Q(e)),{col:r}=n.dataset,i=this.#O;t&&(t.section!==i?.section||t.index!==i.index||r!==i.col)&&(this.#O={...t,rowId:this.#W(e,t),col:r},this.requestUpdate());return}if(t===e.currentTarget)return}},this.#H=e=>{this.#U(e.composedPath())}}static{this.styles=is}get columns(){return this.#e}set columns(e){this.#e=e??[]}get data(){return this.#t}set data(e){this.#t=e??[]}get overscan(){return this.#n}set overscan(e){this.#n=e??6}get sorting(){return this.#r.value}set sorting(e){this.#r.set(e)}get columnSizing(){return this.#i.value}set columnSizing(e){this.#i.set(e)}get columnOrder(){return this.#a.value}set columnOrder(e){this.#a.set(e)}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j;connectedCallback(){super.connectedCallback(),this.hasAttribute(`role`)||this.setAttribute(`role`,`grid`),this.hasUpdated&&this.#ae(),this.#j=Do(()=>{this.requestUpdate()})}disconnectedCallback(){super.disconnectedCallback(),this.#E?.disconnect(),this.#j?.(),this.#j=void 0}#M(){return this.columns.length===0?this.#g.defs:(!this.#y&&this.#g.present&&(this.#y=!0,console.warn(`argus-table: the columns property is set, so <argus-column> children are ignored.`)),this.columns)}#N(){return this.#b?.parentNode!==this&&(this.#b=document.createComment(``),this.append(this.#b)),this.#b}async refresh(){this.#x.refresh(),this.requestUpdate(),await this.updateComplete}async autosizeColumns(e){await this.updateComplete;let t=this.#h.model.columns.filter(t=>t.resizable&&(e===void 0||e.includes(t.id))).map(e=>e.id);this.#Z(la(this.renderRoot,t)),await this.updateComplete}async scrollToRow(e){await this.updateComplete,this.#C.scrollToIndex(e),await this.updateComplete}willUpdate(e){let t=this.#M();this.#v=t!==this.#_,this.#_=t,(e.has(`dataSource`)||e.has(`sorting`)||e.has(`getRowId`))&&(this.#x.configure({source:this.dataSource,sorting:this.#r.value,getRowId:this.getRowId}),this.dataSource&&this.hasUpdated&&e.has(`sorting`)&&(this.#S=!e.has(`dataSource`))),(this.#v||e.has(`data`)||e.has(`getRowId`)||e.has(`sorting`)||e.has(`columnSizing`)||e.has(`columnOrder`)||e.has(`pinnedRows`))&&(this.#v&&this.#u.sync(t.filter(e=>e.width===`auto`).map(e=>e.id)),this.#h.update({columns:t,data:this.data,getRowId:this.getRowId,sorting:this.#r.value,columnSizing:this.#i.value,columnOrder:this.#a.value,pinnedRows:this.pinnedRows}));let n=this.#u.widths;this.#f=n!==this.#d,this.#d=n,this.#h.update({remote:this.#x.rows,autoWidths:n});let r=this.#h.model;this.#q(r);let i=this.#O,a=this.#x.rows?.totalKnown===!1,o=Q(r);this.#m.ariaRowCount=a?`-1`:String(o.total),this.#m.ariaColCount=String(r.columns.length);let s=(1+o.top+o.bottom)*this.#T;this.#C.configure({count:r.rowCount,rowHeight:this.#T,cap:Eo(r.rowCount*this.#T,s),overscan:Math.max(0,this.overscan),rowIdAt:e=>this.#L(r,e),keep:i?.section!==`body`||i.rowId===void 0?void 0:{id:i.rowId,index:i.index}})}render(){let e=this.#h.model,t=e.columns;this.#D=this.#C.computeWindow();let n=e=>t.reduce((t,n)=>n.pin===e?t+n.width:t,0),r=e=>`${String(n(e))}px`,i=Q(e),a={"--_cols":t.map(fs).join(` `),"--_width":`${String(e.totalWidth)}px`,"--_pin-start":r(`start`),"--_pin-end":r(`end`),"--_pin-top-rows":String(i.top),"--_pin-bottom-rows":String(i.bottom)},o=this.#O,s=e=>o?.section===e?{index:o.index,col:o.col}:void 0,c=e=>i.ariaRowIndex({section:e,index:0});return this.rowHeight!==void 0&&this.rowHeight>0&&(a[`--_row-height`]=`${String(this.rowHeight)}px`),E`<div
99
99
  part="table"
100
100
  role="presentation"
101
101
  style=${Ze(a)}
@@ -104,12 +104,12 @@ function gi(e){let t=Object.assign((e,n,r)=>{let i=e.getValue(r),a=n.getValue(r)
104
104
  @focusin=${this.#V}
105
105
  @click=${this.#H}
106
106
  >
107
- ${Qo(t,this.#z,s(`header`)?.col,this.#s)}
108
- ${ts(`top`,i.top,t,c(`top`),s(`top`))}
109
- ${e.rowCount===0?E`<div part="empty"><slot name="empty">No rows</slot></div>`:Uo(this.#D.rows,t,this.#D.totalSize,s(`body`),c(`body`),this.#F())}
110
- ${ts(`bottom`,i.bottom,t,c(`bottom`),s(`bottom`))}
107
+ ${es(t,this.#z,s(`header`)?.col,this.#s)}
108
+ ${rs(`top`,i.top,t,c(`top`),s(`top`))}
109
+ ${e.rowCount===0?E`<div part="empty"><slot name="empty">No rows</slot></div>`:Go(this.#D.rows,t,this.#D.totalSize,s(`body`),c(`body`),this.#F())}
110
+ ${rs(`bottom`,i.bottom,t,c(`bottom`),s(`bottom`))}
111
111
  <div class="probe" aria-hidden="true"></div>
112
112
  </div>
113
- ${ls(`start`,n(`start`),i.total-1,this.#T)}
114
- ${ls(`end`,n(`end`),i.total-1,this.#T)}`}firstUpdated(){this.#ae(),this.#oe()}updated(e){let t=this.#h.model;if(qo(this,t,this.#D.rows,this.#N()),this.#P(t),this.#S){this.#S=!1;let e=this.renderRoot.querySelector(`[part~="table"]`);e&&(e.scrollTop=0)}if((this.#v||e.has(`columnSizing`)||e.has(`columnOrder`)||this.#f)&&this.#w.measure(),this.#k&&(this.#k=!1,this.#K()),(e.has(`density`)||e.has(`rowHeight`))&&this.#oe(),this.#l.size>0){let e=[...this.#l.values()];this.#l.clear();for(let t of e)Y(this,uo,t)}if(this.#c&&=(this.#ee(t,this.#c),void 0),this.#o.size>0){let e=[...this.#o.values()];this.#o.clear();for(let t of e)Y(this,fo,t)}if(this.#p){let e=this.#p;this.#p=void 0,Y(this,lo,{sorting:e})}let{range:n}=this.#D,r=n?`${String(n.start)}:${String(n.end)}`:``;if(n&&r!==this.#A&&(this.#A=r,Y(this,co,{start:n.start,end:n.end})),n){let e=Math.max(0,this.overscan);this.#x.request(Math.max(0,n.start-e),n.end+1+e)}for(let e of this.#x.takeErrors())Y(this,ho,e)}#P(e){let t=this.#D.rows.some(t=>e.rowAt(t.index)!==void 0);!t&&e.rowCount>0||this.#u.measure(this.renderRoot,e.columns,t)&&this.requestUpdate()}#F(){let e=this.#x.rows;if(!e)return;let t=this.#D.range?.start??0,n=/* @__PURE__ */ new Map;for(let{index:r}of this.#D.rows){if(r<t||e.stateAt(r)!==`error`)continue;let i=e.pageOf(r),a=n.get(i);(a===void 0||r<a)&&n.set(i,r)}let r=/* @__PURE__ */ new Map;for(let[t,i]of n){let n=t*e.pageSize,a=Math.min(n+e.pageSize,e.rowCount);r.set(i,`Retry loading rows ${String(n+1)} to ${String(a)}`)}return{stateAt:t=>e.stateAt(t),retry:r,onRetry:this.#I}}#I;#L(e,t){let n=e.rowAt(t)?.id;if(n!==void 0)return n;let r=this.#O;return r?.index===t&&r.rowId!==void 0?r.rowId:this.#R(t)}#R(e){return this.getRowId?`\u0000${String(e)}`:String(e)}#z;#B;#V;#H;#U(e){let t;for(let n of e){if(!(n instanceof HTMLElement))continue;let e=n.getAttribute(`role`);if(e===`gridcell`&&(t=n.dataset.col),e!==`row`)continue;let r=this.#h.model,i=cs(n,Q(r));if(!i||i.section===`header`)return;let{index:a}=i;if(i.section===`body`){let e=r.rowAt(a);if(!e)return;t!==void 0&&Y(this,mo,{row:e.original,columnId:t,value:r.valueAt(a,t)}),Y(this,po,{row:e.original,rowId:e.id,index:a});return}let o=i.section,s=r.pinnedRowAt(o,a);if(!s)return;t!==void 0&&Y(this,mo,{row:s.original,columnId:t,value:r.pinnedValueAt(o,a,t),pinned:o}),Y(this,po,{row:s.original,rowId:s.id,index:a,pinned:o});return}}#W(e,t){switch(t.section){case`header`:return;case`body`:return this.#L(e,t.index);default:return e.pinnedRowAt(t.section,t.index)?.id}}#G(e,t,n){this.#O={...e,rowId:this.#W(n,e),col:t},this.#k=!0,this.requestUpdate()}#K(){let e=this.#O;if(!e)return;let t=CSS.escape(e.col),n=Q(this.#h.model).ariaRowIndex(e),r=this.renderRoot.querySelector(`[role='row'][aria-rowindex="${String(n)}"] > [data-col="${t}"]`);if(r){if(r.focus({preventScroll:!0}),e.section===`body`&&this.#C.scaled){let t=Q(this.#h.model),n=(1+t.top)*this.#T;if(this.#C.reveal(e.index,n,t.bottom*this.#T)){this.#k=!0;return}}r.scrollIntoView({block:`nearest`,inline:`nearest`})}}#q(e){let t=e.columns,n=t[0];if(!n){this.#O=void 0;return}let r=this.#O??{...os,rowId:void 0,col:n.id},i=t.some(e=>e.id===r.col)?r.col:n.id,{section:a,index:o,rowId:s}=r,c=!1;if(a===`body`&&s!==void 0){let t=e.indexOf(s),n=o<e.rowCount&&e.rowAt(o)===void 0;t===void 0?n||(o=Math.min(o,e.rowCount-1),s=o>=0?e.rowAt(o)?.id??this.#R(o):void 0,c=!0):o=t}else if(a===`top`||a===`bottom`){let t=e.pinnedCount(a);o>=t&&(o=t-1,c=!0),s=o>=0?e.pinnedRowAt(a,o)?.id:void 0}o<0&&({section:a,index:o}=os,s=void 0),c&&this.matches(`:focus-within`)&&(this.#k=!0),a===r.section&&o===r.index&&s===r.rowId&&i===r.col&&this.#O||(this.#O={section:a,index:o,rowId:s,col:i})}#J(e,t){let n=this.#i.value[e];if(n!==void 0)return n;let r=this.#h.model.columns.find(t=>t.id===e);return r&&r.flex===void 0?r.width:t.getBoundingClientRect().width}#Y(){return getComputedStyle(this).direction===`rtl`?-1:1}#X(e,t){this.#Z(/* @__PURE__ */ new Map([[e,t]]))}#Z(e){let t=this.#h.model,n=this.#i.value,r=[];for(let[i,a]of e){let e=t.nextSizing(i,a)?.[i];e!==void 0&&e!==n[i]&&r.push([i,e])}if(r.length===0)return;let{value:i,applied:a}=this.#i.request({...n,...Object.fromEntries(r)}),o=r.map(([e,t])=>({columnId:e,width:t,sizing:i}));if(a){for(let e of this.#l.values())e.sizing=i;for(let e of o)this.#l.set(e.columnId,e);this.requestUpdate(`columnSizing`,n)}else for(let e of o)Y(this,uo,e)}#Q(e,t){let n=this.#a.value,r=this.#h.model.nextOrder(e,t,n);if(!r)return!1;let{value:i,applied:a}=this.#a.request(r);if(a){for(let e of this.#o.values())e.order=i;this.#o.set(e,{columnId:e,order:i}),this.requestUpdate(`columnOrder`,n)}else Y(this,fo,{columnId:e,order:i});return!0}#$(e,t){let n=this.#h.model,r=n.orderOf(this.#a.value).indexOf(e),i=n.columns.find(t=>t.id===e);r<0||!i||this.#Q(e,r+t)&&(this.#k=!0,this.#c??={id:e,from:i.colIndex},this.requestUpdate())}#ee(e,t){let n=e.columns.find(e=>e.id===t.id);if(!n||n.colIndex===t.from)return;let r=this.renderRoot.querySelector(`[role='columnheader'][data-col="${CSS.escape(t.id)}"] > slot`),i=r instanceof HTMLSlotElement?r.assignedNodes({flatten:!0}).map(e=>e.textContent).join(``).trim():``;sa(this.ownerDocument,`${i||t.id} moved to column ${String(n.colIndex)} of ${String(e.columns.length)}`)}#te(e){let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.getAttribute(`role`)===`columnheader`),n=t?.dataset.moveCol;if(!t||n===void 0||!ya(e,t))return;let r=this.renderRoot.querySelector(`[part~="table"]`);if(!r)return;let i=this.#h.model.columns.find(e=>e.id===n)?.pin;ba(t,e,{scroller:r,targetAt:e=>ma(this.#ne(i),n,e,this.#Y()),scrollArea:()=>i===void 0?this.#re(r):void 0,onStart:()=>{this.#s={columnId:n,target:void 0},this.requestUpdate()},onTarget:e=>{this.#s={columnId:n,target:e},this.requestUpdate()},onDrop:e=>{this.#s=void 0,e&&this.#Q(n,e.to)&&this.matches(`:focus-within`)&&(this.#k=!0),this.requestUpdate()},onCancel:()=>{this.#s=void 0,this.requestUpdate()}})}#ne(e){let t=[];return this.#h.model.columns.forEach((n,r)=>{if(n.pin!==e)return;let i=this.renderRoot.querySelector(`[role='columnheader'][data-col="${CSS.escape(n.id)}"]`);i&&t.push({id:n.id,index:r,rect:i.getBoundingClientRect()})}),t}#re(e){let t=this.#h.model.columns,n=e=>t.reduce((t,n)=>n.pin===e?t+n.width:t,0),r=this.#Y()===1,i=e.getBoundingClientRect().left+e.clientLeft;return{left:i+n(r?`start`:`end`),right:i+e.clientWidth-n(r?`end`:`start`)}}#ie(e){let t=this.#h.model.nextSorting(e);if(!t)return;let n=this.#r.value,{value:r,applied:i}=this.#r.request(t);i?(this.#p=r,this.requestUpdate(`sorting`,n)):Y(this,lo,{sorting:r})}#ae(){let e=this.renderRoot.querySelector(`.probe`);e&&(this.#E??=new ResizeObserver(()=>{this.#oe()}),this.#E.observe(e))}#oe(){let e=this.renderRoot.querySelector(`.probe`)?.getBoundingClientRect().height??0;e>0&&Math.abs(e-this.#T)>.01&&(this.#T=e,this.requestUpdate())}};M([j({attribute:!1})],$.prototype,`columns`,null),M([j({attribute:!1})],$.prototype,`data`,null),M([j({attribute:!1})],$.prototype,`dataSource`,void 0),M([j({attribute:!1})],$.prototype,`pinnedRows`,void 0),M([j({attribute:!1})],$.prototype,`getRowId`,void 0),M([j({attribute:`row-height`,type:Number})],$.prototype,`rowHeight`,void 0),M([j({reflect:!0})],$.prototype,`density`,void 0),M([j({type:Number})],$.prototype,`overscan`,null),M([j({attribute:!1})],$.prototype,`sorting`,null),M([j({attribute:!1})],$.prototype,`columnSizing`,null),M([j({attribute:!1})],$.prototype,`columnOrder`,null),$=M([Ie(`argus-table`)],$);export{N as ArgusColumn,$ as ArgusTable,mo as CELL_CLICK,fo as COLUMN_REORDER,uo as COLUMN_RESIZE,ho as LOAD_ERROR,co as RANGE_CHANGE,po as ROW_CLICK,lo as SORT_CHANGE};
113
+ ${ds(`start`,n(`start`),i.total-1,this.#T)}
114
+ ${ds(`end`,n(`end`),i.total-1,this.#T)}`}firstUpdated(){this.#ae(),this.#oe()}updated(e){let t=this.#h.model;if(Yo(this,t,this.#D.rows,this.#N()),this.#P(t),this.#S){this.#S=!1;let e=this.renderRoot.querySelector(`[part~="table"]`);e&&(e.scrollTop=0)}if((this.#v||e.has(`columnSizing`)||e.has(`columnOrder`)||this.#f)&&this.#w.measure(),this.#k&&(this.#k=!1,this.#K()),(e.has(`density`)||e.has(`rowHeight`))&&this.#oe(),this.#l.size>0){let e=[...this.#l.values()];this.#l.clear();for(let t of e)Y(this,po,t)}if(this.#c&&=(this.#ee(t,this.#c),void 0),this.#o.size>0){let e=[...this.#o.values()];this.#o.clear();for(let t of e)Y(this,mo,t)}if(this.#p){let e=this.#p;this.#p=void 0,Y(this,fo,{sorting:e})}let{range:n}=this.#D,r=n?`${String(n.start)}:${String(n.end)}`:``;if(n&&r!==this.#A&&(this.#A=r,Y(this,uo,{start:n.start,end:n.end})),n){let e=Math.max(0,this.overscan);this.#x.request(Math.max(0,n.start-e),n.end+1+e)}for(let e of this.#x.takeErrors())Y(this,_o,e)}#P(e){let t=this.#D.rows.some(t=>e.rowAt(t.index)!==void 0);!t&&e.rowCount>0||this.#u.measure(this.renderRoot,e.columns,t)&&this.requestUpdate()}#F(){let e=this.#x.rows;if(!e)return;let t=this.#D.range?.start??0,n=/* @__PURE__ */ new Map;for(let{index:r}of this.#D.rows){if(r<t||e.stateAt(r)!==`error`)continue;let i=e.pageOf(r),a=n.get(i);(a===void 0||r<a)&&n.set(i,r)}let r=/* @__PURE__ */ new Map;for(let[t,i]of n){let n=t*e.pageSize,a=Math.min(n+e.pageSize,e.rowCount);r.set(i,`Retry loading rows ${String(n+1)} to ${String(a)}`)}return{stateAt:t=>e.stateAt(t),retry:r,onRetry:this.#I}}#I;#L(e,t){let n=e.rowAt(t)?.id;if(n!==void 0)return n;let r=this.#O;return r?.index===t&&r.rowId!==void 0?r.rowId:this.#R(t)}#R(e){return this.getRowId?`\u0000${String(e)}`:String(e)}#z;#B;#V;#H;#U(e){let t;for(let n of e){if(!(n instanceof HTMLElement))continue;let e=n.getAttribute(`role`);if(e===`gridcell`&&(t=n.dataset.col),e!==`row`)continue;let r=this.#h.model,i=us(n,Q(r));if(!i||i.section===`header`)return;let{index:a}=i;if(i.section===`body`){let e=r.rowAt(a);if(!e)return;t!==void 0&&Y(this,go,{row:e.original,columnId:t,value:r.valueAt(a,t)}),Y(this,ho,{row:e.original,rowId:e.id,index:a});return}let o=i.section,s=r.pinnedRowAt(o,a);if(!s)return;t!==void 0&&Y(this,go,{row:s.original,columnId:t,value:r.pinnedValueAt(o,a,t),pinned:o}),Y(this,ho,{row:s.original,rowId:s.id,index:a,pinned:o});return}}#W(e,t){switch(t.section){case`header`:return;case`body`:return this.#L(e,t.index);default:return e.pinnedRowAt(t.section,t.index)?.id}}#G(e,t,n){this.#O={...e,rowId:this.#W(n,e),col:t},this.#k=!0,this.requestUpdate()}#K(){let e=this.#O;if(!e)return;let t=CSS.escape(e.col),n=Q(this.#h.model).ariaRowIndex(e),r=this.renderRoot.querySelector(`[role='row'][aria-rowindex="${String(n)}"] > [data-col="${t}"]`);if(r){if(r.focus({preventScroll:!0}),e.section===`body`&&this.#C.scaled){let t=Q(this.#h.model),n=(1+t.top)*this.#T;if(this.#C.reveal(e.index,n,t.bottom*this.#T)){this.#k=!0;return}}r.scrollIntoView({block:`nearest`,inline:`nearest`})}}#q(e){let t=e.columns,n=t[0];if(!n){this.#O=void 0;return}let r=this.#O??{...cs,rowId:void 0,col:n.id},i=t.some(e=>e.id===r.col)?r.col:n.id,{section:a,index:o,rowId:s}=r,c=!1;if(a===`body`&&s!==void 0){let t=e.indexOf(s),n=o<e.rowCount&&e.rowAt(o)===void 0;t===void 0?n||(o=Math.min(o,e.rowCount-1),s=o>=0?e.rowAt(o)?.id??this.#R(o):void 0,c=!0):o=t}else if(a===`top`||a===`bottom`){let t=e.pinnedCount(a);o>=t&&(o=t-1,c=!0),s=o>=0?e.pinnedRowAt(a,o)?.id:void 0}o<0&&({section:a,index:o}=cs,s=void 0),c&&this.matches(`:focus-within`)&&(this.#k=!0),a===r.section&&o===r.index&&s===r.rowId&&i===r.col&&this.#O||(this.#O={section:a,index:o,rowId:s,col:i})}#J(e,t){let n=this.#i.value[e];if(n!==void 0)return n;let r=this.#h.model.columns.find(t=>t.id===e);return r&&r.flex===void 0?r.width:t.getBoundingClientRect().width}#Y(){return getComputedStyle(this).direction===`rtl`?-1:1}#X(e,t){this.#Z(/* @__PURE__ */ new Map([[e,t]]))}#Z(e){let t=this.#h.model,n=this.#i.value,r=[];for(let[i,a]of e){let e=t.nextSizing(i,a)?.[i];e!==void 0&&e!==n[i]&&r.push([i,e])}if(r.length===0)return;let{value:i,applied:a}=this.#i.request({...n,...Object.fromEntries(r)}),o=r.map(([e,t])=>({columnId:e,width:t,sizing:i}));if(a){for(let e of this.#l.values())e.sizing=i;for(let e of o)this.#l.set(e.columnId,e);this.requestUpdate(`columnSizing`,n)}else for(let e of o)Y(this,po,e)}#Q(e,t){let n=this.#a.value,r=this.#h.model.nextOrder(e,t,n);if(!r)return!1;let{value:i,applied:a}=this.#a.request(r);if(a){for(let e of this.#o.values())e.order=i;this.#o.set(e,{columnId:e,order:i}),this.requestUpdate(`columnOrder`,n)}else Y(this,mo,{columnId:e,order:i});return!0}#$(e,t){let n=this.#h.model,r=n.orderOf(this.#a.value).indexOf(e),i=n.columns.find(t=>t.id===e);r<0||!i||this.#Q(e,r+t)&&(this.#k=!0,this.#c??={id:e,from:i.colIndex},this.requestUpdate())}#ee(e,t){let n=e.columns.find(e=>e.id===t.id);if(!n||n.colIndex===t.from)return;let r=this.renderRoot.querySelector(`[role='columnheader'][data-col="${CSS.escape(t.id)}"] > slot`),i=r instanceof HTMLSlotElement?r.assignedNodes({flatten:!0}).map(e=>e.textContent).join(``).trim():``;ca(this.ownerDocument,`${i||t.id} moved to column ${String(n.colIndex)} of ${String(e.columns.length)}`)}#te(e){let t=e.composedPath().find(e=>e instanceof HTMLElement&&e.getAttribute(`role`)===`columnheader`),n=t?.dataset.moveCol;if(!t||n===void 0||!ba(e,t))return;let r=this.renderRoot.querySelector(`[part~="table"]`);if(!r)return;let i=this.#h.model.columns.find(e=>e.id===n)?.pin;xa(t,e,{scroller:r,targetAt:e=>ha(this.#ne(i),n,e,this.#Y()),scrollArea:()=>i===void 0?this.#re(r):void 0,onStart:()=>{this.#s={columnId:n,target:void 0},this.requestUpdate()},onTarget:e=>{this.#s={columnId:n,target:e},this.requestUpdate()},onDrop:e=>{this.#s=void 0,e&&this.#Q(n,e.to)&&this.matches(`:focus-within`)&&(this.#k=!0),this.requestUpdate()},onCancel:()=>{this.#s=void 0,this.requestUpdate()}})}#ne(e){let t=[];return this.#h.model.columns.forEach((n,r)=>{if(n.pin!==e)return;let i=this.renderRoot.querySelector(`[role='columnheader'][data-col="${CSS.escape(n.id)}"]`);i&&t.push({id:n.id,index:r,rect:i.getBoundingClientRect()})}),t}#re(e){let t=this.#h.model.columns,n=e=>t.reduce((t,n)=>n.pin===e?t+n.width:t,0),r=this.#Y()===1,i=e.getBoundingClientRect().left+e.clientLeft;return{left:i+n(r?`start`:`end`),right:i+e.clientWidth-n(r?`end`:`start`)}}#ie(e){let t=this.#h.model.nextSorting(e);if(!t)return;let n=this.#r.value,{value:r,applied:i}=this.#r.request(t);i?(this.#p=r,this.requestUpdate(`sorting`,n)):Y(this,fo,{sorting:r})}#ae(){let e=this.renderRoot.querySelector(`.probe`);e&&(this.#E??=new ResizeObserver(()=>{this.#oe()}),this.#E.observe(e))}#oe(){let e=this.renderRoot.querySelector(`.probe`)?.getBoundingClientRect().height??0;e>0&&Math.abs(e-this.#T)>.01&&(this.#T=e,this.requestUpdate())}};M([j({attribute:!1})],$.prototype,`columns`,null),M([j({attribute:!1})],$.prototype,`data`,null),M([j({attribute:!1})],$.prototype,`dataSource`,void 0),M([j({attribute:!1})],$.prototype,`pinnedRows`,void 0),M([j({attribute:!1})],$.prototype,`getRowId`,void 0),M([j({attribute:`row-height`,type:Number})],$.prototype,`rowHeight`,void 0),M([j({reflect:!0})],$.prototype,`density`,void 0),M([j({type:Number})],$.prototype,`overscan`,null),M([j({attribute:!1})],$.prototype,`sorting`,null),M([j({attribute:!1})],$.prototype,`columnSizing`,null),M([j({attribute:!1})],$.prototype,`columnOrder`,null),$=M([Ie(`argus-table`)],$);export{N as ArgusColumn,$ as ArgusTable,go as CELL_CLICK,mo as COLUMN_REORDER,po as COLUMN_RESIZE,_o as LOAD_ERROR,uo as RANGE_CHANGE,ho as ROW_CLICK,fo as SORT_CHANGE};
115
115
  //# sourceMappingURL=argus-table.js.map