import{c as Re,m as D,ar as we,as as _e}from"./vendor-TCjgV7Sn.js";/**
   * match-sorter-utils
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */const se={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",Ĳ:"IJ",ĳ:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ŉ:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},$e=Object.keys(se).join("|"),Fe=new RegExp($e,"g");function Ae(e){return e.replace(Fe,n=>se[n])}/**
 * @name match-sorter
 * @license MIT license.
 * @copyright (c) 2099 Kent C. Dodds
 * @author Kent C. Dodds <me@kentcdodds.com> (https://kentcdodds.com)
 */const F={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function St(e,n,t){var o;if(t=t||{},t.threshold=(o=t.threshold)!=null?o:F.MATCHES,!t.accessors){const l=ne(e,n,t);return{rankedValue:e,rank:l,accessorIndex:-1,accessorThreshold:t.threshold,passed:l>=t.threshold}}const r=ye(e,t.accessors),i={rankedValue:e,rank:F.NO_MATCH,accessorIndex:-1,accessorThreshold:t.threshold,passed:!1};for(let l=0;l<r.length;l++){const s=r[l];let u=ne(s.itemValue,n,t);const{minRanking:d,maxRanking:a,threshold:f=t.threshold}=s.attributes;u<d&&u>=F.MATCHES?u=d:u>a&&(u=a),u=Math.min(u,a),u>=f&&u>i.rank&&(i.rank=u,i.passed=!0,i.accessorIndex=l,i.accessorThreshold=f,i.rankedValue=s.itemValue)}return i}function ne(e,n,t){return e=oe(e,t),n=oe(n,t),n.length>e.length?F.NO_MATCH:e===n?F.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),n=n.toLowerCase(),e===n?F.EQUAL:e.startsWith(n)?F.STARTS_WITH:e.includes(` ${n}`)?F.WORD_STARTS_WITH:e.includes(n)?F.CONTAINS:n.length===1?F.NO_MATCH:Ve(e).includes(n)?F.ACRONYM:Me(e,n))}function Ve(e){let n="";return e.split(" ").forEach(o=>{o.split("-").forEach(i=>{n+=i.substr(0,1)})}),n}function Me(e,n){let t=0,o=0;function r(u,d,a){for(let f=a,c=d.length;f<c;f++)if(d[f]===u)return t+=1,f+1;return-1}function i(u){const d=1/u,a=t/n.length;return F.MATCHES+a*d}const l=r(n[0],e,0);if(l<0)return F.NO_MATCH;o=l;for(let u=1,d=n.length;u<d;u++){const a=n[u];if(o=r(a,e,o),!(o>-1))return F.NO_MATCH}const s=o-l;return i(s)}function oe(e,n){let{keepDiacritics:t}=n;return e=`${e}`,t||(e=Ae(e)),e}function Ie(e,n){let t=n;typeof n=="object"&&(t=n.accessor);const o=t(e);return o==null?[]:Array.isArray(o)?o:[String(o)]}function ye(e,n){const t=[];for(let o=0,r=n.length;o<r;o++){const i=n[o],l=xe(i),s=Ie(e,i);for(let u=0,d=s.length;u<d;u++)t.push({itemValue:s[u],attributes:l})}return t}const re={maxRanking:1/0,minRanking:-1/0};function xe(e){return typeof e=="function"?re:{...re,...e}}/**
   * table-core
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function I(e,n){return typeof e=="function"?e(n):e}function A(e,n){return t=>{n.setState(o=>({...o,[e]:I(t,o[e])}))}}function z(e){return e instanceof Function}function Pe(e){return Array.isArray(e)&&e.every(n=>typeof n=="number")}function ae(e,n){const t=[],o=r=>{r.forEach(i=>{t.push(i);const l=n(i);l!=null&&l.length&&o(l)})};return o(e),t}function C(e,n,t){let o=[],r;return()=>{let i;t.key&&t.debug&&(i=Date.now());const l=e();if(!(l.length!==o.length||l.some((d,a)=>o[a]!==d)))return r;o=l;let u;if(t.key&&t.debug&&(u=Date.now()),r=n(...l),t==null||t.onChange==null||t.onChange(r),t.key&&t.debug&&t!=null&&t.debug()){const d=Math.round((Date.now()-i)*100)/100,a=Math.round((Date.now()-u)*100)/100,f=a/16,c=(g,p)=>{for(g=String(g);g.length<p;)g=" "+g;return g};console.info(`%c⏱ ${c(a,5)} /${c(d,5)} ms`,`
            font-size: .6rem;
            font-weight: bold;
            color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,t==null?void 0:t.key)}return r}}function Ee(e,n,t,o){var r,i;const s={...e._getDefaultColumnDef(),...n},u=s.accessorKey;let d=(r=(i=s.id)!=null?i:u?u.replace(".","_"):void 0)!=null?r:typeof s.header=="string"?s.header:void 0,a;if(s.accessorFn?a=s.accessorFn:u&&(u.includes(".")?a=c=>{let g=c;for(const S of u.split(".")){var p;g=(p=g)==null?void 0:p[S]}return g}:a=c=>c[s.accessorKey]),!d)throw new Error;let f={id:`${String(d)}`,accessorFn:a,parent:o,depth:t,columnDef:s,columns:[],getFlatColumns:C(()=>[!0],()=>{var c;return[f,...(c=f.columns)==null?void 0:c.flatMap(g=>g.getFlatColumns())]},{key:"column.getFlatColumns",debug:()=>{var c;return(c=e.options.debugAll)!=null?c:e.options.debugColumns}}),getLeafColumns:C(()=>[e._getOrderColumnsFn()],c=>{var g;if((g=f.columns)!=null&&g.length){let p=f.columns.flatMap(S=>S.getLeafColumns());return c(p)}return[f]},{key:"column.getLeafColumns",debug:()=>{var c;return(c=e.options.debugAll)!=null?c:e.options.debugColumns}})};for(const c of e._features)c.createColumn==null||c.createColumn(f,e);return f}function ie(e,n,t){var o;let i={id:(o=t.id)!=null?o:n.id,column:n,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const l=[],s=u=>{u.subHeaders&&u.subHeaders.length&&u.subHeaders.map(s),l.push(u)};return s(i),l},getContext:()=>({table:e,header:i,column:n})};return e._features.forEach(l=>{l.createHeader==null||l.createHeader(i,e)}),i}const He={createTable:e=>{e.getHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>{var i,l;const s=(i=o==null?void 0:o.map(f=>t.find(c=>c.id===f)).filter(Boolean))!=null?i:[],u=(l=r==null?void 0:r.map(f=>t.find(c=>c.id===f)).filter(Boolean))!=null?l:[],d=t.filter(f=>!(o!=null&&o.includes(f.id))&&!(r!=null&&r.includes(f.id)));return G(n,[...s,...d,...u],e)},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getCenterHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o,r)=>(t=t.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),G(n,t,e,"center")),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getLeftHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(n,t,o)=>{var r;const i=(r=o==null?void 0:o.map(l=>t.find(s=>s.id===l)).filter(Boolean))!=null?r:[];return G(n,i,e,"left")},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getRightHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(n,t,o)=>{var r;const i=(r=o==null?void 0:o.map(l=>t.find(s=>s.id===l)).filter(Boolean))!=null?r:[];return G(n,i,e,"right")},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getFooterGroups=C(()=>[e.getHeaderGroups()],n=>[...n].reverse(),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getLeftFooterGroups=C(()=>[e.getLeftHeaderGroups()],n=>[...n].reverse(),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getCenterFooterGroups=C(()=>[e.getCenterHeaderGroups()],n=>[...n].reverse(),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getRightFooterGroups=C(()=>[e.getRightHeaderGroups()],n=>[...n].reverse(),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getFlatHeaders=C(()=>[e.getHeaderGroups()],n=>n.map(t=>t.headers).flat(),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getLeftFlatHeaders=C(()=>[e.getLeftHeaderGroups()],n=>n.map(t=>t.headers).flat(),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getCenterFlatHeaders=C(()=>[e.getCenterHeaderGroups()],n=>n.map(t=>t.headers).flat(),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getRightFlatHeaders=C(()=>[e.getRightHeaderGroups()],n=>n.map(t=>t.headers).flat(),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getCenterLeafHeaders=C(()=>[e.getCenterFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getLeftLeafHeaders=C(()=>[e.getLeftFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getRightLeafHeaders=C(()=>[e.getRightFlatHeaders()],n=>n.filter(t=>{var o;return!((o=t.subHeaders)!=null&&o.length)}),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}}),e.getLeafHeaders=C(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(n,t,o)=>{var r,i,l,s,u,d;return[...(r=(i=n[0])==null?void 0:i.headers)!=null?r:[],...(l=(s=t[0])==null?void 0:s.headers)!=null?l:[],...(u=(d=o[0])==null?void 0:d.headers)!=null?u:[]].map(a=>a.getLeafHeaders()).flat()},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugHeaders}})}};function G(e,n,t,o){var r,i;let l=0;const s=function(c,g){g===void 0&&(g=1),l=Math.max(l,g),c.filter(p=>p.getIsVisible()).forEach(p=>{var S;(S=p.columns)!=null&&S.length&&s(p.columns,g+1)},0)};s(e);let u=[];const d=(c,g)=>{const p={depth:g,id:[o,`${g}`].filter(Boolean).join("_"),headers:[]},S=[];c.forEach(h=>{const m=[...S].reverse()[0],_=h.column.depth===p.depth;let v,$=!1;if(_&&h.column.parent?v=h.column.parent:(v=h.column,$=!0),m&&(m==null?void 0:m.column)===v)m.subHeaders.push(h);else{const w=ie(t,v,{id:[o,g,v.id,h==null?void 0:h.id].filter(Boolean).join("_"),isPlaceholder:$,placeholderId:$?`${S.filter(R=>R.column===v).length}`:void 0,depth:g,index:S.length});w.subHeaders.push(h),S.push(w)}p.headers.push(h),h.headerGroup=p}),u.push(p),g>0&&d(S,g-1)},a=n.map((c,g)=>ie(t,c,{depth:l,index:g}));d(a,l-1),u.reverse();const f=c=>c.filter(p=>p.column.getIsVisible()).map(p=>{let S=0,h=0,m=[0];p.subHeaders&&p.subHeaders.length?(m=[],f(p.subHeaders).forEach(v=>{let{colSpan:$,rowSpan:w}=v;S+=$,m.push(w)})):S=1;const _=Math.min(...m);return h=h+_,p.colSpan=S,p.rowSpan=h,{colSpan:S,rowSpan:h}});return f((r=(i=u[0])==null?void 0:i.headers)!=null?r:[]),u}const O={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},b=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),De={getDefaultColumnDef:()=>O,getInitialState:e=>({columnSizing:{},columnSizingInfo:b(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:A("columnSizing",e),onColumnSizingInfoChange:A("columnSizingInfo",e)}),createColumn:(e,n)=>{e.getSize=()=>{var t,o,r;const i=n.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:O.minSize,(o=i??e.columnDef.size)!=null?o:O.size),(r=e.columnDef.maxSize)!=null?r:O.maxSize)},e.getStart=t=>{const o=t?t==="left"?n.getLeftVisibleLeafColumns():n.getRightVisibleLeafColumns():n.getVisibleLeafColumns(),r=o.findIndex(i=>i.id===e.id);if(r>0){const i=o[r-1];return i.getStart(t)+i.getSize()}return 0},e.resetSize=()=>{n.setColumnSizing(t=>{let{[e.id]:o,...r}=t;return r})},e.getCanResize=()=>{var t,o;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((o=n.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>n.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,n)=>{e.getSize=()=>{let t=0;const o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;t+=(i=r.column.getSize())!=null?i:0}};return o(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=t=>{const o=n.getColumn(e.column.id),r=o==null?void 0:o.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),T(i)&&i.touches&&i.touches.length>1))return;const l=e.getSize(),s=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[o.id,o.getSize()]],u=T(i)?Math.round(i.touches[0].clientX):i.clientX,d={},a=(m,_)=>{typeof _=="number"&&(n.setColumnSizingInfo(v=>{var $,w;const R=n.options.columnResizeDirection==="rtl"?-1:1,x=(_-(($=v==null?void 0:v.startOffset)!=null?$:0))*R,P=Math.max(x/((w=v==null?void 0:v.startSize)!=null?w:0),-.999999);return v.columnSizingStart.forEach(H=>{let[ve,te]=H;d[ve]=Math.round(Math.max(te+te*P,0)*100)/100}),{...v,deltaOffset:x,deltaPercentage:P}}),(n.options.columnResizeMode==="onChange"||m==="end")&&n.setColumnSizing(v=>({...v,...d})))},f=m=>a("move",m),c=m=>{a("end",m),n.setColumnSizingInfo(_=>({..._,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=t||typeof document<"u"?document:null,p={moveHandler:m=>f(m.clientX),upHandler:m=>{g==null||g.removeEventListener("mousemove",p.moveHandler),g==null||g.removeEventListener("mouseup",p.upHandler),c(m.clientX)}},S={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),f(m.touches[0].clientX),!1),upHandler:m=>{var _;g==null||g.removeEventListener("touchmove",S.moveHandler),g==null||g.removeEventListener("touchend",S.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),c((_=m.touches[0])==null?void 0:_.clientX)}},h=Ge()?{passive:!1}:!1;T(i)?(g==null||g.addEventListener("touchmove",S.moveHandler,h),g==null||g.addEventListener("touchend",S.upHandler,h)):(g==null||g.addEventListener("mousemove",p.moveHandler,h),g==null||g.addEventListener("mouseup",p.upHandler,h)),n.setColumnSizingInfo(m=>({...m,startOffset:u,startSize:l,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=n=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(n),e.setColumnSizingInfo=n=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(n),e.resetColumnSizing=n=>{var t;e.setColumnSizing(n?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=n=>{var t;e.setColumnSizingInfo(n?b():(t=e.initialState.columnSizingInfo)!=null?t:b())},e.getTotalSize=()=>{var n,t;return(n=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getLeftTotalSize=()=>{var n,t;return(n=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getCenterTotalSize=()=>{var n,t;return(n=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0},e.getRightTotalSize=()=>{var n,t;return(n=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((o,r)=>o+r.getSize(),0))!=null?n:0}}};let L=null;function Ge(){if(typeof L=="boolean")return L;let e=!1;try{const n={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,n),window.removeEventListener("test",t)}catch{e=!1}return L=e,L}function T(e){return e.type==="touchstart"}const Oe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:A("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let n=!1,t=!1;e._autoResetExpanded=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{const o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const l=i.split(".");o=Math.max(o,l.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,n)=>{e.toggleExpanded=t=>{n.setExpanded(o=>{var r;const i=o===!0?!0:!!(o!=null&&o[e.id]);let l={};if(o===!0?Object.keys(n.getRowModel().rowsById).forEach(s=>{l[s]=!0}):l=o,t=(r=t)!=null?r:!i,!i&&t)return{...l,[e.id]:!0};if(i&&!t){const{[e.id]:s,...u}=l;return u}return o})},e.getIsExpanded=()=>{var t;const o=n.getState().expanded;return!!((t=n.options.getIsRowExpanded==null?void 0:n.options.getIsRowExpanded(e))!=null?t:o===!0||o!=null&&o[e.id])},e.getCanExpand=()=>{var t,o,r;return(t=n.options.getRowCanExpand==null?void 0:n.options.getRowCanExpand(e))!=null?t:((o=n.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let t=!0,o=e;for(;t&&o.parentId;)o=n.getRow(o.parentId,!0),t=o.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},ge=(e,n,t)=>{var o;const r=t.toLowerCase();return!!(!((o=e.getValue(n))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(r))};ge.autoRemove=e=>V(e);const de=(e,n,t)=>{var o;return!!(!((o=e.getValue(n))==null||(o=o.toString())==null)&&o.includes(t))};de.autoRemove=e=>V(e);const fe=(e,n,t)=>{var o;return((o=e.getValue(n))==null||(o=o.toString())==null?void 0:o.toLowerCase())===(t==null?void 0:t.toLowerCase())};fe.autoRemove=e=>V(e);const ce=(e,n,t)=>{var o;return(o=e.getValue(n))==null?void 0:o.includes(t)};ce.autoRemove=e=>V(e)||!(e!=null&&e.length);const pe=(e,n,t)=>!t.some(o=>{var r;return!((r=e.getValue(n))!=null&&r.includes(o))});pe.autoRemove=e=>V(e)||!(e!=null&&e.length);const Se=(e,n,t)=>t.some(o=>{var r;return(r=e.getValue(n))==null?void 0:r.includes(o)});Se.autoRemove=e=>V(e)||!(e!=null&&e.length);const me=(e,n,t)=>e.getValue(n)===t;me.autoRemove=e=>V(e);const Ce=(e,n,t)=>e.getValue(n)==t;Ce.autoRemove=e=>V(e);const J=(e,n,t)=>{let[o,r]=t;const i=e.getValue(n);return i>=o&&i<=r};J.resolveFilterValue=e=>{let[n,t]=e,o=typeof n!="number"?parseFloat(n):n,r=typeof t!="number"?parseFloat(t):t,i=n===null||Number.isNaN(o)?-1/0:o,l=t===null||Number.isNaN(r)?1/0:r;if(i>l){const s=i;i=l,l=s}return[i,l]};J.autoRemove=e=>V(e)||V(e[0])&&V(e[1]);const M={includesString:ge,includesStringSensitive:de,equalsString:fe,arrIncludes:ce,arrIncludesAll:pe,arrIncludesSome:Se,equals:me,weakEquals:Ce,inNumberRange:J};function V(e){return e==null||e===""}const Le={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:A("columnFilters",e),onGlobalFilterChange:A("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:n=>{var t;const o=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[n.id])==null?void 0:t.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t==null?void 0:t.getValue(e.id);return typeof o=="string"?M.includesString:typeof o=="number"?M.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?M.equals:Array.isArray(o)?M.arrIncludes:M.weakEquals},e.getFilterFn=()=>{var t,o;return z(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(o=n.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?t:M[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,o,r;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((o=n.options.enableColumnFilters)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var t,o,r,i;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((o=n.options.enableGlobalFilter)!=null?o:!0)&&((r=n.options.enableFilters)!=null?r:!0)&&((i=n.options.getColumnCanGlobalFilter==null?void 0:n.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=n.getState().columnFilters)==null||(t=t.find(o=>o.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,o;return(t=(o=n.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.setFilterValue=t=>{n.setColumnFilters(o=>{const r=e.getFilterFn(),i=o==null?void 0:o.find(a=>a.id===e.id),l=I(t,i?i.value:void 0);if(le(r,l,e)){var s;return(s=o==null?void 0:o.filter(a=>a.id!==e.id))!=null?s:[]}const u={id:e.id,value:l};if(i){var d;return(d=o==null?void 0:o.map(a=>a.id===e.id?u:a))!=null?d:[]}return o!=null&&o.length?[...o,u]:[u]})},e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,n)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>M.includesString,e.getGlobalFilterFn=()=>{var n,t;const{globalFilterFn:o}=e.options;return z(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(n=(t=e.options.filterFns)==null?void 0:t[o])!=null?n:M[o]},e.setColumnFilters=n=>{const t=e.getAllLeafColumns(),o=r=>{var i;return(i=I(n,r))==null?void 0:i.filter(l=>{const s=t.find(u=>u.id===l.id);if(s){const u=s.getFilterFn();if(le(u,l.value,s))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.setGlobalFilter=n=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(n)},e.resetGlobalFilter=n=>{e.setGlobalFilter(n?void 0:e.initialState.globalFilter)},e.resetColumnFilters=n=>{var t,o;e.setColumnFilters(n?[]:(t=(o=e.initialState)==null?void 0:o.columnFilters)!=null?t:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function le(e,n,t){return(e&&e.autoRemove?e.autoRemove(n,t):!1)||typeof n>"u"||typeof n=="string"&&!n}const ze=(e,n,t)=>t.reduce((o,r)=>{const i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),ke=(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},be=(e,n,t)=>{let o;return t.forEach(r=>{const i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},Te=(e,n,t)=>{let o,r;return t.forEach(i=>{const l=i.getValue(e);l!=null&&(o===void 0?l>=l&&(o=r=l):(o>l&&(o=l),r<l&&(r=l)))}),[o,r]},Be=(e,n)=>{let t=0,o=0;if(n.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++t,o+=i)}),t)return o/t},Ue=(e,n)=>{if(!n.length)return;const t=n.map(i=>i.getValue(e));if(!Pe(t))return;if(t.length===1)return t[0];const o=Math.floor(t.length/2),r=t.sort((i,l)=>i-l);return t.length%2!==0?r[o]:(r[o-1]+r[o])/2},Ne=(e,n)=>Array.from(new Set(n.map(t=>t.getValue(e))).values()),qe=(e,n)=>new Set(n.map(t=>t.getValue(e))).size,je=(e,n)=>n.length,B={sum:ze,min:ke,max:be,extent:Te,mean:Be,median:Ue,unique:Ne,uniqueCount:qe,count:je},Xe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var n,t;return(n=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?n:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:A("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,n)=>{e.toggleGrouping=()=>{n.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(o=>o!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,o,r,i;return(t=(o=(r=(i=e.columnDef.enableGrouping)!=null?i:!0)!=null?r:n.options.enableGrouping)!=null?o:!0)!=null?t:!!e.accessorFn},e.getIsGrouped=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=n.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=n.getCoreRowModel().flatRows[0],o=t==null?void 0:t.getValue(e.id);if(typeof o=="number")return B.sum;if(Object.prototype.toString.call(o)==="[object Date]")return B.extent},e.getAggregationFn=()=>{var t,o;if(!e)throw new Error;return z(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(o=n.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?t:B[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=n=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(n),e.resetGrouping=n=>{var t,o;e.setGrouping(n?[]:(t=(o=e.initialState)==null?void 0:o.grouping)!=null?t:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,n)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const o=n.getColumn(t);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[t]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,n,t,o)=>{e.getIsGrouped=()=>n.getIsGrouped()&&n.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&n.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=t.subRows)!=null&&r.length)}}};function We(e,n,t){if(!(n!=null&&n.length)||!t)return e;const o=e.filter(i=>!n.includes(i.id));return t==="remove"?o:[...n.map(i=>e.find(l=>l.id===i)).filter(Boolean),...o]}const Ke={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:A("columnOrder",e)}),createTable:e=>{e.setColumnOrder=n=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(n),e.resetColumnOrder=n=>{var t;e.setColumnOrder(n?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=C(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(n,t,o)=>r=>{let i=[];if(!(n!=null&&n.length))i=r;else{const l=[...n],s=[...r];for(;s.length&&l.length;){const u=l.shift(),d=s.findIndex(a=>a.id===u);d>-1&&i.push(s.splice(d,1)[0])}i=[...i,...s]}return We(i,t,o)},{key:!1})}},X=0,W=10,U=()=>({pageIndex:X,pageSize:W}),Ye={getInitialState:e=>({...e,pagination:{...U(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:A("pagination",e)}),createTable:e=>{let n=!1,t=!1;e._autoResetPageIndex=()=>{var o,r;if(!n){e._queue(()=>{n=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=o=>{const r=i=>I(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?U():(r=e.initialState.pagination)!=null?r:U())},e.setPageIndex=o=>{e.setPagination(r=>{let i=I(o,r.pageIndex);const l=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,l)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?X:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:X)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?W:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:W)},e.setPageSize=o=>{e.setPagination(r=>{const i=Math.max(1,I(o,r.pageSize)),l=r.pageSize*r.pageIndex,s=Math.floor(l/i);return{...r,pageIndex:s,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let l=I(o,(i=e.options.pageCount)!=null?i:-1);return typeof l=="number"&&(l=Math.max(-1,l)),{...r,pageCount:l}}),e.getPageOptions=C(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,l)=>l)),r},{key:!1,debug:()=>{var o;return(o=e.options.debugAll)!=null?o:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},N=()=>({left:[],right:[]}),q=()=>({top:[],bottom:[]}),Qe={getInitialState:e=>({columnPinning:N(),rowPinning:q(),...e}),getDefaultOptions:e=>({onColumnPinningChange:A("columnPinning",e),onRowPinningChange:A("rowPinning",e)}),createColumn:(e,n)=>{e.pin=t=>{const o=e.getLeafColumns().map(r=>r.id).filter(Boolean);n.setColumnPinning(r=>{var i,l;if(t==="right"){var s,u;return{left:((s=r==null?void 0:r.left)!=null?s:[]).filter(f=>!(o!=null&&o.includes(f))),right:[...((u=r==null?void 0:r.right)!=null?u:[]).filter(f=>!(o!=null&&o.includes(f))),...o]}}if(t==="left"){var d,a;return{left:[...((d=r==null?void 0:r.left)!=null?d:[]).filter(f=>!(o!=null&&o.includes(f))),...o],right:((a=r==null?void 0:r.right)!=null?a:[]).filter(f=>!(o!=null&&o.includes(f)))}}return{left:((i=r==null?void 0:r.left)!=null?i:[]).filter(f=>!(o!=null&&o.includes(f))),right:((l=r==null?void 0:r.right)!=null?l:[]).filter(f=>!(o!=null&&o.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,l;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(l=n.options.enableColumnPinning)!=null?l:n.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(s=>s.id),{left:o,right:r}=n.getState().columnPinning,i=t.some(s=>o==null?void 0:o.includes(s)),l=t.some(s=>r==null?void 0:r.includes(s));return i?"left":l?"right":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();return r?(t=(o=n.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?t:-1:0}},createRow:(e,n)=>{e.pin=(t,o,r)=>{const i=o?e.getLeafRows().map(u=>{let{id:d}=u;return d}):[],l=r?e.getParentRows().map(u=>{let{id:d}=u;return d}):[],s=new Set([...l,e.id,...i]);n.setRowPinning(u=>{var d,a;if(t==="bottom"){var f,c;return{top:((f=u==null?void 0:u.top)!=null?f:[]).filter(S=>!(s!=null&&s.has(S))),bottom:[...((c=u==null?void 0:u.bottom)!=null?c:[]).filter(S=>!(s!=null&&s.has(S))),...Array.from(s)]}}if(t==="top"){var g,p;return{top:[...((g=u==null?void 0:u.top)!=null?g:[]).filter(S=>!(s!=null&&s.has(S))),...Array.from(s)],bottom:((p=u==null?void 0:u.bottom)!=null?p:[]).filter(S=>!(s!=null&&s.has(S)))}}return{top:((d=u==null?void 0:u.top)!=null?d:[]).filter(S=>!(s!=null&&s.has(S))),bottom:((a=u==null?void 0:u.bottom)!=null?a:[]).filter(S=>!(s!=null&&s.has(S)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:o,enablePinning:r}=n.options;return typeof o=="function"?o(e):(t=o??r)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:o,bottom:r}=n.getState().rowPinning,i=t.some(s=>o==null?void 0:o.includes(s)),l=t.some(s=>r==null?void 0:r.includes(s));return i?"top":l?"bottom":!1},e.getPinnedIndex=()=>{var t,o;const r=e.getIsPinned();if(!r)return-1;const i=(t=n._getPinnedRows(r))==null?void 0:t.map(l=>{let{id:s}=l;return s});return(o=i==null?void 0:i.indexOf(e.id))!=null?o:-1},e.getCenterVisibleCells=C(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,n.getState().columnPinning.right],(t,o,r)=>{const i=[...o??[],...r??[]];return t.filter(l=>!i.includes(l.column.id))},{key:!1,debug:()=>{var t;return(t=n.options.debugAll)!=null?t:n.options.debugRows}}),e.getLeftVisibleCells=C(()=>[e._getAllVisibleCells(),n.getState().columnPinning.left,,],(t,o)=>(o??[]).map(i=>t.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),{key:!1,debug:()=>{var t;return(t=n.options.debugAll)!=null?t:n.options.debugRows}}),e.getRightVisibleCells=C(()=>[e._getAllVisibleCells(),n.getState().columnPinning.right],(t,o)=>(o??[]).map(i=>t.find(l=>l.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),{key:!1,debug:()=>{var t;return(t=n.options.debugAll)!=null?t:n.options.debugRows}})},createTable:e=>{e.setColumnPinning=n=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(n),e.resetColumnPinning=n=>{var t,o;return e.setColumnPinning(n?N():(t=(o=e.initialState)==null?void 0:o.columnPinning)!=null?t:N())},e.getIsSomeColumnsPinned=n=>{var t;const o=e.getState().columnPinning;if(!n){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e.getLeftLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugColumns}}),e.getRightLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(n,t)=>(t??[]).map(o=>n.find(r=>r.id===o)).filter(Boolean),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugColumns}}),e.getCenterLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(n,t,o)=>{const r=[...t??[],...o??[]];return n.filter(i=>!r.includes(i.id))},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugColumns}}),e.setRowPinning=n=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(n),e.resetRowPinning=n=>{var t,o;return e.setRowPinning(n?q():(t=(o=e.initialState)==null?void 0:o.rowPinning)!=null?t:q())},e.getIsSomeRowsPinned=n=>{var t;const o=e.getState().rowPinning;if(!n){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((t=o[n])!=null&&t.length)},e._getPinnedRows=n=>C(()=>[e.getRowModel().rows,e.getState().rowPinning[n]],(t,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(o??[]).map(l=>{const s=e.getRow(l,!0);return s.getIsAllParentsExpanded()?s:null}):(o??[]).map(l=>t.find(s=>s.id===l))).filter(Boolean).map(l=>({...l,position:n}))},{key:!1,debug:()=>{var t;return(t=e.options.debugAll)!=null?t:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=C(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(n,t,o)=>{const r=new Set([...t??[],...o??[]]);return n.filter(i=>!r.has(i.id))},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugRows}})}},Je={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:A("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=n=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(n),e.resetRowSelection=n=>{var t;return e.setRowSelection(n?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=n=>{e.setRowSelection(t=>{n=typeof n<"u"?n:!e.getIsAllRowsSelected();const o={...t},r=e.getPreGroupedRowModel().flatRows;return n?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=n=>e.setRowSelection(t=>{const o=typeof n<"u"?n:!e.getIsAllPageRowsSelected(),r={...t};return e.getRowModel().rows.forEach(i=>{K(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=C(()=>[e.getState().rowSelection,e.getCoreRowModel()],(n,t)=>Object.keys(n).length?j(e,t):{rows:[],flatRows:[],rowsById:{}},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable}}),e.getFilteredSelectedRowModel=C(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(n,t)=>Object.keys(n).length?j(e,t):{rows:[],flatRows:[],rowsById:{}},{key:"getFilteredSelectedRowModel",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable}}),e.getGroupedSelectedRowModel=C(()=>[e.getState().rowSelection,e.getSortedRowModel()],(n,t)=>Object.keys(n).length?j(e,t):{rows:[],flatRows:[],rowsById:{}},{key:"getGroupedSelectedRowModel",debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const n=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let o=!!(n.length&&Object.keys(t).length);return o&&n.some(r=>r.getCanSelect()&&!t[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:t}=e.getState();let o=!!n.length;return o&&n.some(r=>!t[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var n;const t=Object.keys((n=e.getState().rowSelection)!=null?n:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const n=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:n.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>n=>{e.toggleAllRowsSelected(n.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>n=>{e.toggleAllPageRowsSelected(n.target.checked)}},createRow:(e,n)=>{e.toggleSelected=(t,o)=>{const r=e.getIsSelected();n.setRowSelection(i=>{var l;if(t=typeof t<"u"?t:!r,e.getCanSelect()&&r===t)return i;const s={...i};return K(s,e.id,t,(l=o==null?void 0:o.selectChildren)!=null?l:!0,n),s})},e.getIsSelected=()=>{const{rowSelection:t}=n.getState();return Z(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=n.getState();return Y(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=n.getState();return Y(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof n.options.enableRowSelection=="function"?n.options.enableRowSelection(e):(t=n.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof n.options.enableSubRowSelection=="function"?n.options.enableSubRowSelection(e):(t=n.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof n.options.enableMultiRowSelection=="function"?n.options.enableMultiRowSelection(e):(t=n.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return o=>{var r;t&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},K=(e,n,t,o,r)=>{var i;const l=r.getRow(n,!0);t?(l.getCanMultiSelect()||Object.keys(e).forEach(s=>delete e[s]),l.getCanSelect()&&(e[n]=!0)):delete e[n],o&&(i=l.subRows)!=null&&i.length&&l.getCanSelectSubRows()&&l.subRows.forEach(s=>K(e,s.id,t,o,r))};function j(e,n){const t=e.getState().rowSelection,o=[],r={},i=function(l,s){return l.map(u=>{var d;const a=Z(u,t);if(a&&(o.push(u),r[u.id]=u),(d=u.subRows)!=null&&d.length&&(u={...u,subRows:i(u.subRows)}),a)return u}).filter(Boolean)};return{rows:i(n.rows),flatRows:o,rowsById:r}}function Z(e,n){var t;return(t=n[e.id])!=null?t:!1}function Y(e,n,t){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(l=>{if(!(i&&!r)&&(l.getCanSelect()&&(Z(l,n)?i=!0:r=!1),l.subRows&&l.subRows.length)){const s=Y(l,n);s==="all"?i=!0:(s==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}const Q=/([0-9]+)/gm,Ze=(e,n,t)=>he(y(e.getValue(t)).toLowerCase(),y(n.getValue(t)).toLowerCase()),et=(e,n,t)=>he(y(e.getValue(t)),y(n.getValue(t))),tt=(e,n,t)=>ee(y(e.getValue(t)).toLowerCase(),y(n.getValue(t)).toLowerCase()),nt=(e,n,t)=>ee(y(e.getValue(t)),y(n.getValue(t))),ot=(e,n,t)=>{const o=e.getValue(t),r=n.getValue(t);return o>r?1:o<r?-1:0},rt=(e,n,t)=>ee(e.getValue(t),n.getValue(t));function ee(e,n){return e===n?0:e>n?1:-1}function y(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function he(e,n){const t=e.split(Q).filter(Boolean),o=n.split(Q).filter(Boolean);for(;t.length&&o.length;){const r=t.shift(),i=o.shift(),l=parseInt(r,10),s=parseInt(i,10),u=[l,s].sort();if(isNaN(u[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(u[1]))return isNaN(l)?-1:1;if(l>s)return 1;if(s>l)return-1}return t.length-o.length}const E={alphanumeric:Ze,alphanumericCaseSensitive:et,text:tt,textCaseSensitive:nt,datetime:ot,basic:rt},it={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:A("sorting",e),isMultiSortEvent:n=>n.shiftKey}),createColumn:(e,n)=>{e.getAutoSortingFn=()=>{const t=n.getFilteredRowModel().flatRows.slice(10);let o=!1;for(const r of t){const i=r==null?void 0:r.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return E.datetime;if(typeof i=="string"&&(o=!0,i.split(Q).length>1))return E.alphanumeric}return o?E.text:E.basic},e.getAutoSortDir=()=>{const t=n.getFilteredRowModel().flatRows[0];return typeof(t==null?void 0:t.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,o;if(!e)throw new Error;return z(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(o=n.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?t:E[e.columnDef.sortingFn]},e.toggleSorting=(t,o)=>{const r=e.getNextSortingOrder(),i=typeof t<"u"&&t!==null;n.setSorting(l=>{const s=l==null?void 0:l.find(g=>g.id===e.id),u=l==null?void 0:l.findIndex(g=>g.id===e.id);let d=[],a,f=i?t:r==="desc";if(l!=null&&l.length&&e.getCanMultiSort()&&o?s?a="toggle":a="add":l!=null&&l.length&&u!==l.length-1?a="replace":s?a="toggle":a="replace",a==="toggle"&&(i||r||(a="remove")),a==="add"){var c;d=[...l,{id:e.id,desc:f}],d.splice(0,d.length-((c=n.options.maxMultiSortColCount)!=null?c:Number.MAX_SAFE_INTEGER))}else a==="toggle"?d=l.map(g=>g.id===e.id?{...g,desc:f}:g):a==="remove"?d=l.filter(g=>g.id!==e.id):d=[{id:e.id,desc:f}];return d})},e.getFirstSortDir=()=>{var t,o;return((t=(o=e.columnDef.sortDescFirst)!=null?o:n.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var o,r;const i=e.getFirstSortDir(),l=e.getIsSorted();return l?l!==i&&((o=n.options.enableSortingRemoval)==null||o)&&(!(t&&(r=n.options.enableMultiRemove)!=null)||r)?!1:l==="desc"?"asc":"desc":i},e.getCanSort=()=>{var t,o;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((o=n.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,o;return(t=(o=e.columnDef.enableMultiSort)!=null?o:n.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const o=(t=n.getState().sorting)==null?void 0:t.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,o;return(t=(o=n.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?t:-1},e.clearSorting=()=>{n.setSorting(t=>t!=null&&t.length?t.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return o=>{t&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?n.options.isMultiSortEvent==null?void 0:n.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=n=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(n),e.resetSorting=n=>{var t,o;e.setSorting(n?[]:(t=(o=e.initialState)==null?void 0:o.sorting)!=null?t:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},lt={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:A("columnVisibility",e)}),createColumn:(e,n)=>{e.toggleVisibility=t=>{e.getCanHide()&&n.setColumnVisibility(o=>({...o,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,o;return(t=(o=n.getState().columnVisibility)==null?void 0:o[e.id])!=null?t:!0},e.getCanHide=()=>{var t,o;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((o=n.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,n)=>{e._getAllVisibleCells=C(()=>[e.getAllCells(),n.getState().columnVisibility],t=>t.filter(o=>o.column.getIsVisible()),{key:"row._getAllVisibleCells",debug:()=>{var t;return(t=n.options.debugAll)!=null?t:n.options.debugRows}}),e.getVisibleCells=C(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,o,r)=>[...t,...o,...r],{key:!1,debug:()=>{var t;return(t=n.options.debugAll)!=null?t:n.options.debugRows}})},createTable:e=>{const n=(t,o)=>C(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),{key:t,debug:()=>{var r;return(r=e.options.debugAll)!=null?r:e.options.debugColumns}});e.getVisibleFlatColumns=n("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=n("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=n("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=n("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=n("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var o;e.setColumnVisibility(t?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=t=>{var o;t=(o=t)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:t||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(t=>!(t.getIsVisible!=null&&t.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(t=>t.getIsVisible==null?void 0:t.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var o;e.toggleAllColumnsVisible((o=t.target)==null?void 0:o.checked)}}},ue=[He,lt,Ke,Qe,Le,it,Xe,Oe,Ye,Je,De];function ut(e){var n;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let t={_features:ue};const o=t._features.reduce((a,f)=>Object.assign(a,f.getDefaultOptions==null?void 0:f.getDefaultOptions(t)),{}),r=a=>t.options.mergeOptions?t.options.mergeOptions(o,a):{...o,...a};let l={...{},...(n=e.initialState)!=null?n:{}};t._features.forEach(a=>{var f;l=(f=a.getInitialState==null?void 0:a.getInitialState(l))!=null?f:l});const s=[];let u=!1;const d={_features:ue,options:{...o,...e},initialState:l,_queue:a=>{s.push(a),u||(u=!0,Promise.resolve().then(()=>{for(;s.length;)s.shift()();u=!1}).catch(f=>setTimeout(()=>{throw f})))},reset:()=>{t.setState(t.initialState)},setOptions:a=>{const f=I(a,t.options);t.options=r(f)},getState:()=>t.options.state,setState:a=>{t.options.onStateChange==null||t.options.onStateChange(a)},_getRowId:(a,f,c)=>{var g;return(g=t.options.getRowId==null?void 0:t.options.getRowId(a,f,c))!=null?g:`${c?[c.id,f].join("."):f}`},getCoreRowModel:()=>(t._getCoreRowModel||(t._getCoreRowModel=t.options.getCoreRowModel(t)),t._getCoreRowModel()),getRowModel:()=>t.getPaginationRowModel(),getRow:(a,f)=>{let c=(f?t.getPrePaginationRowModel():t.getRowModel()).rowsById[a];if(!c&&(c=t.getCoreRowModel().rowsById[a],!c))throw new Error;return c},_getDefaultColumnDef:C(()=>[t.options.defaultColumn],a=>{var f;return a=(f=a)!=null?f:{},{header:c=>{const g=c.header.column.columnDef;return g.accessorKey?g.accessorKey:g.accessorFn?g.id:null},cell:c=>{var g,p;return(g=(p=c.renderValue())==null||p.toString==null?void 0:p.toString())!=null?g:null},...t._features.reduce((c,g)=>Object.assign(c,g.getDefaultColumnDef==null?void 0:g.getDefaultColumnDef()),{}),...a}},{debug:()=>{var a;return(a=t.options.debugAll)!=null?a:t.options.debugColumns},key:!1}),_getColumnDefs:()=>t.options.columns,getAllColumns:C(()=>[t._getColumnDefs()],a=>{const f=function(c,g,p){return p===void 0&&(p=0),c.map(S=>{const h=Ee(t,S,p,g),m=S;return h.columns=m.columns?f(m.columns,h,p+1):[],h})};return f(a)},{key:!1,debug:()=>{var a;return(a=t.options.debugAll)!=null?a:t.options.debugColumns}}),getAllFlatColumns:C(()=>[t.getAllColumns()],a=>a.flatMap(f=>f.getFlatColumns()),{key:!1,debug:()=>{var a;return(a=t.options.debugAll)!=null?a:t.options.debugColumns}}),_getAllFlatColumnsById:C(()=>[t.getAllFlatColumns()],a=>a.reduce((f,c)=>(f[c.id]=c,f),{}),{key:!1,debug:()=>{var a;return(a=t.options.debugAll)!=null?a:t.options.debugColumns}}),getAllLeafColumns:C(()=>[t.getAllColumns(),t._getOrderColumnsFn()],(a,f)=>{let c=a.flatMap(g=>g.getLeafColumns());return f(c)},{key:!1,debug:()=>{var a;return(a=t.options.debugAll)!=null?a:t.options.debugColumns}}),getColumn:a=>t._getAllFlatColumnsById()[a]};Object.assign(t,d);for(let a=0;a<t._features.length;a++){const f=t._features[a];f==null||f.createTable==null||f.createTable(t)}return t}function st(e,n,t,o){const r=()=>{var l;return(l=i.getValue())!=null?l:e.options.renderFallbackValue},i={id:`${n.id}_${t.id}`,row:n,column:t,getValue:()=>n.getValue(o),renderValue:r,getContext:C(()=>[e,t,n,i],(l,s,u,d)=>({table:l,column:s,row:u,cell:d,getValue:d.getValue,renderValue:d.renderValue}),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach(l=>{l.createCell==null||l.createCell(i,t,n,e)},{}),i}const k=(e,n,t,o,r,i,l)=>{let s={id:n,index:o,original:t,depth:r,parentId:l,_valuesCache:{},_uniqueValuesCache:{},getValue:u=>{if(s._valuesCache.hasOwnProperty(u))return s._valuesCache[u];const d=e.getColumn(u);if(d!=null&&d.accessorFn)return s._valuesCache[u]=d.accessorFn(s.original,o),s._valuesCache[u]},getUniqueValues:u=>{if(s._uniqueValuesCache.hasOwnProperty(u))return s._uniqueValuesCache[u];const d=e.getColumn(u);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(s._uniqueValuesCache[u]=d.columnDef.getUniqueValues(s.original,o),s._uniqueValuesCache[u]):(s._uniqueValuesCache[u]=[s.getValue(u)],s._uniqueValuesCache[u])},renderValue:u=>{var d;return(d=s.getValue(u))!=null?d:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>ae(s.subRows,u=>u.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let u=[],d=s;for(;;){const a=d.getParentRow();if(!a)break;u.push(a),d=a}return u.reverse()},getAllCells:C(()=>[e.getAllLeafColumns()],u=>u.map(d=>st(e,s,d,d.id)),{key:!1,debug:()=>{var u;return(u=e.options.debugAll)!=null?u:e.options.debugRows}}),_getAllCellsByColumnId:C(()=>[s.getAllCells()],u=>u.reduce((d,a)=>(d[a.column.id]=a,d),{}),{key:"row.getAllCellsByColumnId",debug:()=>{var u;return(u=e.options.debugAll)!=null?u:e.options.debugRows}})};for(let u=0;u<e._features.length;u++){const d=e._features[u];d==null||d.createRow==null||d.createRow(s,e)}return s};function mt(){return e=>C(()=>[e.options.data],n=>{const t={rows:[],flatRows:[],rowsById:{}},o=function(r,i,l){i===void 0&&(i=0);const s=[];for(let d=0;d<r.length;d++){const a=k(e,e._getRowId(r[d],d,l),r[d],d,i,void 0,l==null?void 0:l.id);if(t.flatRows.push(a),t.rowsById[a.id]=a,s.push(a),e.options.getSubRows){var u;a.originalSubRows=e.options.getSubRows(r[d],d),(u=a.originalSubRows)!=null&&u.length&&(a.subRows=o(a.originalSubRows,i+1,a))}}return s};return t.rows=o(n),t},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function at(e,n,t){return t.options.filterFromLeafRows?gt(e,n,t):dt(e,n,t)}function gt(e,n,t){var o;const r=[],i={},l=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,s=function(u,d){d===void 0&&(d=0);const a=[];for(let c=0;c<u.length;c++){var f;let g=u[c];const p=k(t,g.id,g.original,g.index,g.depth,void 0,g.parentId);if(p.columnFilters=g.columnFilters,(f=g.subRows)!=null&&f.length&&d<l){if(p.subRows=s(g.subRows,d+1),g=p,n(g)&&!p.subRows.length){a.push(g),i[g.id]=g,r.push(g);continue}if(n(g)||p.subRows.length){a.push(g),i[g.id]=g,r.push(g);continue}}else g=p,n(g)&&(a.push(g),i[g.id]=g,r.push(g))}return a};return{rows:s(e),flatRows:r,rowsById:i}}function dt(e,n,t){var o;const r=[],i={},l=(o=t.options.maxLeafRowFilterDepth)!=null?o:100,s=function(u,d){d===void 0&&(d=0);const a=[];for(let c=0;c<u.length;c++){let g=u[c];if(n(g)){var f;if((f=g.subRows)!=null&&f.length&&d<l){const S=k(t,g.id,g.original,g.index,g.depth,void 0,g.parentId);S.subRows=s(g.subRows,d+1),g=S}a.push(g),r.push(g),i[g.id]=g}}return a};return{rows:s(e),flatRows:r,rowsById:i}}function Ct(){return e=>C(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(n,t,o)=>{if(!n.rows.length||!(t!=null&&t.length)&&!o){for(let c=0;c<n.flatRows.length;c++)n.flatRows[c].columnFilters={},n.flatRows[c].columnFiltersMeta={};return n}const r=[],i=[];(t??[]).forEach(c=>{var g;const p=e.getColumn(c.id);if(!p)return;const S=p.getFilterFn();S&&r.push({id:c.id,filterFn:S,resolvedValue:(g=S.resolveFilterValue==null?void 0:S.resolveFilterValue(c.value))!=null?g:c.value})});const l=t.map(c=>c.id),s=e.getGlobalFilterFn(),u=e.getAllLeafColumns().filter(c=>c.getCanGlobalFilter());o&&s&&u.length&&(l.push("__global__"),u.forEach(c=>{var g;i.push({id:c.id,filterFn:s,resolvedValue:(g=s.resolveFilterValue==null?void 0:s.resolveFilterValue(o))!=null?g:o})}));let d,a;for(let c=0;c<n.flatRows.length;c++){const g=n.flatRows[c];if(g.columnFilters={},r.length)for(let p=0;p<r.length;p++){d=r[p];const S=d.id;g.columnFilters[S]=d.filterFn(g,S,d.resolvedValue,h=>{g.columnFiltersMeta[S]=h})}if(i.length){for(let p=0;p<i.length;p++){a=i[p];const S=a.id;if(a.filterFn(g,S,a.resolvedValue,h=>{g.columnFiltersMeta[S]=h})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const f=c=>{for(let g=0;g<l.length;g++)if(c.columnFilters[l[g]]===!1)return!1;return!0};return at(n.rows,f,e)},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function ht(){return e=>C(()=>[e.getState().sorting,e.getPreSortedRowModel()],(n,t)=>{if(!t.rows.length||!(n!=null&&n.length))return t;const o=e.getState().sorting,r=[],i=o.filter(u=>{var d;return(d=e.getColumn(u.id))==null?void 0:d.getCanSort()}),l={};i.forEach(u=>{const d=e.getColumn(u.id);d&&(l[u.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});const s=u=>{const d=u.map(a=>({...a}));return d.sort((a,f)=>{for(let g=0;g<i.length;g+=1){var c;const p=i[g],S=l[p.id],h=(c=p==null?void 0:p.desc)!=null?c:!1;let m=0;if(S.sortUndefined){const _=a.getValue(p.id),v=f.getValue(p.id),$=_===void 0,w=v===void 0;($||w)&&(m=$&&w?0:$?S.sortUndefined:-S.sortUndefined)}if(m===0&&(m=S.sortingFn(a,f,p.id)),m!==0)return h&&(m*=-1),S.invertSorting&&(m*=-1),m}return a.index-f.index}),d.forEach(a=>{var f;r.push(a),(f=a.subRows)!=null&&f.length&&(a.subRows=s(a.subRows))}),d};return{rows:s(t.rows),flatRows:r,rowsById:t.rowsById}},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})}function vt(){return e=>C(()=>[e.getState().grouping,e.getPreGroupedRowModel()],(n,t)=>{if(!t.rows.length||!n.length)return t;const o=n.filter(u=>e.getColumn(u)),r=[],i={},l=function(u,d,a){if(d===void 0&&(d=0),d>=o.length)return u.map(p=>(p.depth=d,r.push(p),i[p.id]=p,p.subRows&&(p.subRows=l(p.subRows,d+1,p.id)),p));const f=o[d],c=ft(u,f);return Array.from(c.entries()).map((p,S)=>{let[h,m]=p,_=`${f}:${h}`;_=a?`${a}>${_}`:_;const v=l(m,d+1,_),$=d?ae(m,R=>R.subRows):m,w=k(e,_,$[0].original,S,d,void 0,a);return Object.assign(w,{groupingColumnId:f,groupingValue:h,subRows:v,leafRows:$,getValue:R=>{if(o.includes(R)){if(w._valuesCache.hasOwnProperty(R))return w._valuesCache[R];if(m[0]){var x;w._valuesCache[R]=(x=m[0].getValue(R))!=null?x:void 0}return w._valuesCache[R]}if(w._groupingValuesCache.hasOwnProperty(R))return w._groupingValuesCache[R];const P=e.getColumn(R),H=P==null?void 0:P.getAggregationFn();if(H)return w._groupingValuesCache[R]=H(R,$,m),w._groupingValuesCache[R]}}),v.forEach(R=>{r.push(R),i[R.id]=R}),w})},s=l(t.rows,0);return s.forEach(u=>{r.push(u),i[u.id]=u}),{rows:s,flatRows:r,rowsById:i}},{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable},onChange:()=>{e._queue(()=>{e._autoResetExpanded(),e._autoResetPageIndex()})}})}function ft(e,n){const t=new Map;return e.reduce((o,r)=>{const i=`${r.getGroupingValue(n)}`,l=o.get(i);return l?l.push(r):o.set(i,[r]),o},t)}function Rt(){return e=>C(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(n,t,o)=>!t.rows.length||n!==!0&&!Object.keys(n??{}).length||!o?t:ct(t),{key:!1,debug:()=>{var n;return(n=e.options.debugAll)!=null?n:e.options.debugTable}})}function ct(e){const n=[],t=o=>{var r;n.push(o),(r=o.subRows)!=null&&r.length&&o.getIsExpanded()&&o.subRows.forEach(t)};return e.rows.forEach(t),{rows:n,flatRows:e.flatRows,rowsById:e.rowsById}}/**
   * solid-table
   *
   * Copyright (c) TanStack
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE.md file in the root directory of this source tree.
   *
   * @license MIT
   */function wt(e,n){return e?typeof e=="function"?Re(e,n):e:null}function _t(e){const n=D({state:{},onStateChange:()=>{},renderFallbackValue:null,mergeOptions:(i,l)=>D(i,l)},e),t=ut(n),[o,r]=we(t.initialState);return _e(()=>{t.setOptions(i=>D(i,e,{state:D(o,e.state||{}),onStateChange:l=>{r(l),e.onStateChange==null||e.onStateChange(l)}}))}),t}export{ht as a,Rt as b,_t as c,vt as d,mt as e,wt as f,Ct as g,St as r};
