pm2-orbit 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +220 -0
- package/bin/pm2-orbit.js +124 -0
- package/dist/server.js +1008 -0
- package/dist-ui/assets/charts-U3JqdBjU.js +3 -0
- package/dist-ui/assets/cmdk-D6Y8xHyf.js +49 -0
- package/dist-ui/assets/icons-DvbqpVzZ.js +234 -0
- package/dist-ui/assets/index-OYqKkh7V.css +1 -0
- package/dist-ui/assets/index-pRE_kpC2.js +56 -0
- package/dist-ui/assets/react-vendor-l0sNRNKZ.js +1 -0
- package/dist-ui/assets/table-virtual-Oq2FLz9e.js +30 -0
- package/dist-ui/favicon.svg +4 -0
- package/dist-ui/fonts/Exo-300.woff2 +0 -0
- package/dist-ui/fonts/Exo-400.woff2 +0 -0
- package/dist-ui/fonts/Exo-600.woff2 +0 -0
- package/dist-ui/fonts/JetBrainsMono-400.woff2 +0 -0
- package/dist-ui/index.html +62 -0
- package/package.json +77 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{r as $e,g as Ve,a as z}from"./icons-DvbqpVzZ.js";var q={exports:{}},M={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-dom.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ge;function Oe(){if(ge)return M;ge=1;var e=$e();function o(a){var l="https://react.dev/errors/"+a;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+a+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var n={d:{f:t,r:function(){throw Error(o(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(a,l,d){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:h==null?null:""+h,children:a,containerInfo:l,implementation:d}}var r=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(a,l){if(a==="font")return"";if(typeof l=="string")return l==="use-credentials"?l:""}return M.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,M.createPortal=function(a,l){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)throw Error(o(299));return s(a,l,null,d)},M.flushSync=function(a){var l=r.T,d=n.p;try{if(r.T=null,n.p=2,a)return a()}finally{r.T=l,n.p=d,n.d.f()}},M.preconnect=function(a,l){typeof a=="string"&&(l?(l=l.crossOrigin,l=typeof l=="string"?l==="use-credentials"?l:"":void 0):l=null,n.d.C(a,l))},M.prefetchDNS=function(a){typeof a=="string"&&n.d.D(a)},M.preinit=function(a,l){if(typeof a=="string"&&l&&typeof l.as=="string"){var d=l.as,h=u(d,l.crossOrigin),c=typeof l.integrity=="string"?l.integrity:void 0,g=typeof l.fetchPriority=="string"?l.fetchPriority:void 0;d==="style"?n.d.S(a,typeof l.precedence=="string"?l.precedence:void 0,{crossOrigin:h,integrity:c,fetchPriority:g}):d==="script"&&n.d.X(a,{crossOrigin:h,integrity:c,fetchPriority:g,nonce:typeof l.nonce=="string"?l.nonce:void 0})}},M.preinitModule=function(a,l){if(typeof a=="string")if(typeof l=="object"&&l!==null){if(l.as==null||l.as==="script"){var d=u(l.as,l.crossOrigin);n.d.M(a,{crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0})}}else l==null&&n.d.M(a)},M.preload=function(a,l){if(typeof a=="string"&&typeof l=="object"&&l!==null&&typeof l.as=="string"){var d=l.as,h=u(d,l.crossOrigin);n.d.L(a,d,{crossOrigin:h,integrity:typeof l.integrity=="string"?l.integrity:void 0,nonce:typeof l.nonce=="string"?l.nonce:void 0,type:typeof l.type=="string"?l.type:void 0,fetchPriority:typeof l.fetchPriority=="string"?l.fetchPriority:void 0,referrerPolicy:typeof l.referrerPolicy=="string"?l.referrerPolicy:void 0,imageSrcSet:typeof l.imageSrcSet=="string"?l.imageSrcSet:void 0,imageSizes:typeof l.imageSizes=="string"?l.imageSizes:void 0,media:typeof l.media=="string"?l.media:void 0})}},M.preloadModule=function(a,l){if(typeof a=="string")if(l){var d=u(l.as,l.crossOrigin);n.d.m(a,{as:typeof l.as=="string"&&l.as!=="script"?l.as:void 0,crossOrigin:d,integrity:typeof l.integrity=="string"?l.integrity:void 0})}else n.d.m(a)},M.requestFormReset=function(a){n.d.r(a)},M.unstable_batchedUpdates=function(a,l){return a(l)},M.useFormState=function(a,l,d){return r.H.useFormState(a,l,d)},M.useFormStatus=function(){return r.H.useHostTransitionStatus()},M.version="19.2.7",M}var de;function Pe(){if(de)return q.exports;de=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(o){console.error(o)}}return e(),q.exports=Oe(),q.exports}var me=Pe();const Lt=Ve(me);/**
|
|
10
|
+
* table-core
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) TanStack
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the MIT license found in the
|
|
15
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
16
|
+
*
|
|
17
|
+
* @license MIT
|
|
18
|
+
*/function O(e,o){return typeof e=="function"?e(o):e}function I(e,o){return t=>{o.setState(n=>({...n,[e]:O(t,n[e])}))}}function N(e){return e instanceof Function}function ze(e){return Array.isArray(e)&&e.every(o=>typeof o=="number")}function Ae(e,o){const t=[],n=i=>{i.forEach(s=>{t.push(s);const r=o(s);r!=null&&r.length&&n(r)})};return n(e),t}function C(e,o,t){let n=[],i;return s=>{let r;t.key&&t.debug&&(r=Date.now());const u=e(s);if(!(u.length!==n.length||u.some((d,h)=>n[h]!==d)))return i;n=u;let l;if(t.key&&t.debug&&(l=Date.now()),i=o(...u),t==null||t.onChange==null||t.onChange(i),t.key&&t.debug&&t!=null&&t.debug()){const d=Math.round((Date.now()-r)*100)/100,h=Math.round((Date.now()-l)*100)/100,c=h/16,g=(f,p)=>{for(f=String(f);f.length<p;)f=" "+f;return f};console.info(`%c⏱ ${g(h,5)} /${g(d,5)} ms`,`
|
|
19
|
+
font-size: .6rem;
|
|
20
|
+
font-weight: bold;
|
|
21
|
+
color: hsl(${Math.max(0,Math.min(120-120*c,120))}deg 100% 31%);`,t?.key)}return i}}function R(e,o,t,n){return{debug:()=>{var i;return(i=e?.debugAll)!=null?i:e[o]},key:!1,onChange:n}}function De(e,o,t,n){const i=()=>{var r;return(r=s.getValue())!=null?r:e.options.renderFallbackValue},s={id:`${o.id}_${t.id}`,row:o,column:t,getValue:()=>o.getValue(n),renderValue:i,getContext:C(()=>[e,t,o,s],(r,u,a,l)=>({table:r,column:u,row:a,cell:l,getValue:l.getValue,renderValue:l.renderValue}),R(e.options,"debugCells"))};return e._features.forEach(r=>{r.createCell==null||r.createCell(s,t,o,e)},{}),s}function Te(e,o,t,n){var i,s;const u={...e._getDefaultColumnDef(),...o},a=u.accessorKey;let l=(i=(s=u.id)!=null?s:a?typeof String.prototype.replaceAll=="function"?a.replaceAll(".","_"):a.replace(/\./g,"_"):void 0)!=null?i:typeof u.header=="string"?u.header:void 0,d;if(u.accessorFn?d=u.accessorFn:a&&(a.includes(".")?d=c=>{let g=c;for(const p of a.split(".")){var f;g=(f=g)==null?void 0:f[p]}return g}:d=c=>c[u.accessorKey]),!l)throw new Error;let h={id:`${String(l)}`,accessorFn:d,parent:n,depth:t,columnDef:u,columns:[],getFlatColumns:C(()=>[!0],()=>{var c;return[h,...(c=h.columns)==null?void 0:c.flatMap(g=>g.getFlatColumns())]},R(e.options,"debugColumns")),getLeafColumns:C(()=>[e._getOrderColumnsFn()],c=>{var g;if((g=h.columns)!=null&&g.length){let f=h.columns.flatMap(p=>p.getLeafColumns());return c(f)}return[h]},R(e.options,"debugColumns"))};for(const c of e._features)c.createColumn==null||c.createColumn(h,e);return h}const y="debugHeaders";function ce(e,o,t){var n;let s={id:(n=t.id)!=null?n:o.id,column:o,index:t.index,isPlaceholder:!!t.isPlaceholder,placeholderId:t.placeholderId,depth:t.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const r=[],u=a=>{a.subHeaders&&a.subHeaders.length&&a.subHeaders.map(u),r.push(a)};return u(s),r},getContext:()=>({table:e,header:s,column:o})};return e._features.forEach(r=>{r.createHeader==null||r.createHeader(s,e)}),s}const Le={createTable:e=>{e.getHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,i)=>{var s,r;const u=(s=n?.map(h=>t.find(c=>c.id===h)).filter(Boolean))!=null?s:[],a=(r=i?.map(h=>t.find(c=>c.id===h)).filter(Boolean))!=null?r:[],l=t.filter(h=>!(n!=null&&n.includes(h.id))&&!(i!=null&&i.includes(h.id)));return G(o,[...u,...l,...a],e)},R(e.options,y)),e.getCenterHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n,i)=>(t=t.filter(s=>!(n!=null&&n.includes(s.id))&&!(i!=null&&i.includes(s.id))),G(o,t,e,"center")),R(e.options,y)),e.getLeftHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(o,t,n)=>{var i;const s=(i=n?.map(r=>t.find(u=>u.id===r)).filter(Boolean))!=null?i:[];return G(o,s,e,"left")},R(e.options,y)),e.getRightHeaderGroups=C(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(o,t,n)=>{var i;const s=(i=n?.map(r=>t.find(u=>u.id===r)).filter(Boolean))!=null?i:[];return G(o,s,e,"right")},R(e.options,y)),e.getFooterGroups=C(()=>[e.getHeaderGroups()],o=>[...o].reverse(),R(e.options,y)),e.getLeftFooterGroups=C(()=>[e.getLeftHeaderGroups()],o=>[...o].reverse(),R(e.options,y)),e.getCenterFooterGroups=C(()=>[e.getCenterHeaderGroups()],o=>[...o].reverse(),R(e.options,y)),e.getRightFooterGroups=C(()=>[e.getRightHeaderGroups()],o=>[...o].reverse(),R(e.options,y)),e.getFlatHeaders=C(()=>[e.getHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,y)),e.getLeftFlatHeaders=C(()=>[e.getLeftHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,y)),e.getCenterFlatHeaders=C(()=>[e.getCenterHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,y)),e.getRightFlatHeaders=C(()=>[e.getRightHeaderGroups()],o=>o.map(t=>t.headers).flat(),R(e.options,y)),e.getCenterLeafHeaders=C(()=>[e.getCenterFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,y)),e.getLeftLeafHeaders=C(()=>[e.getLeftFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,y)),e.getRightLeafHeaders=C(()=>[e.getRightFlatHeaders()],o=>o.filter(t=>{var n;return!((n=t.subHeaders)!=null&&n.length)}),R(e.options,y)),e.getLeafHeaders=C(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(o,t,n)=>{var i,s,r,u,a,l;return[...(i=(s=o[0])==null?void 0:s.headers)!=null?i:[],...(r=(u=t[0])==null?void 0:u.headers)!=null?r:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[]].map(d=>d.getLeafHeaders()).flat()},R(e.options,y))}};function G(e,o,t,n){var i,s;let r=0;const u=function(c,g){g===void 0&&(g=1),r=Math.max(r,g),c.filter(f=>f.getIsVisible()).forEach(f=>{var p;(p=f.columns)!=null&&p.length&&u(f.columns,g+1)},0)};u(e);let a=[];const l=(c,g)=>{const f={depth:g,id:[n,`${g}`].filter(Boolean).join("_"),headers:[]},p=[];c.forEach(S=>{const m=[...p].reverse()[0],w=S.column.depth===f.depth;let v,F=!1;if(w&&S.column.parent?v=S.column.parent:(v=S.column,F=!0),m&&m?.column===v)m.subHeaders.push(S);else{const _=ce(t,v,{id:[n,g,v.id,S?.id].filter(Boolean).join("_"),isPlaceholder:F,placeholderId:F?`${p.filter(x=>x.column===v).length}`:void 0,depth:g,index:p.length});_.subHeaders.push(S),p.push(_)}f.headers.push(S),S.headerGroup=f}),a.push(f),g>0&&l(p,g-1)},d=o.map((c,g)=>ce(t,c,{depth:r,index:g}));l(d,r-1),a.reverse();const h=c=>c.filter(f=>f.column.getIsVisible()).map(f=>{let p=0,S=0,m=[0];f.subHeaders&&f.subHeaders.length?(m=[],h(f.subHeaders).forEach(v=>{let{colSpan:F,rowSpan:_}=v;p+=F,m.push(_)})):p=1;const w=Math.min(...m);return S=S+w,f.colSpan=p,f.rowSpan=S,{colSpan:p,rowSpan:S}});return h((i=(s=a[0])==null?void 0:s.headers)!=null?i:[]),a}const se=(e,o,t,n,i,s,r)=>{let u={id:o,index:n,original:t,depth:i,parentId:r,_valuesCache:{},_uniqueValuesCache:{},getValue:a=>{if(u._valuesCache.hasOwnProperty(a))return u._valuesCache[a];const l=e.getColumn(a);if(l!=null&&l.accessorFn)return u._valuesCache[a]=l.accessorFn(u.original,n),u._valuesCache[a]},getUniqueValues:a=>{if(u._uniqueValuesCache.hasOwnProperty(a))return u._uniqueValuesCache[a];const l=e.getColumn(a);if(l!=null&&l.accessorFn)return l.columnDef.getUniqueValues?(u._uniqueValuesCache[a]=l.columnDef.getUniqueValues(u.original,n),u._uniqueValuesCache[a]):(u._uniqueValuesCache[a]=[u.getValue(a)],u._uniqueValuesCache[a])},renderValue:a=>{var l;return(l=u.getValue(a))!=null?l:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Ae(u.subRows,a=>a.subRows),getParentRow:()=>u.parentId?e.getRow(u.parentId,!0):void 0,getParentRows:()=>{let a=[],l=u;for(;;){const d=l.getParentRow();if(!d)break;a.push(d),l=d}return a.reverse()},getAllCells:C(()=>[e.getAllLeafColumns()],a=>a.map(l=>De(e,u,l,l.id)),R(e.options,"debugRows")),_getAllCellsByColumnId:C(()=>[u.getAllCells()],a=>a.reduce((l,d)=>(l[d.column.id]=d,l),{}),R(e.options,"debugRows"))};for(let a=0;a<e._features.length;a++){const l=e._features[a];l==null||l.createRow==null||l.createRow(u,e)}return u},He={createColumn:(e,o)=>{e._getFacetedRowModel=o.options.getFacetedRowModel&&o.options.getFacetedRowModel(o,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():o.getPreFilteredRowModel(),e._getFacetedUniqueValues=o.options.getFacetedUniqueValues&&o.options.getFacetedUniqueValues(o,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=o.options.getFacetedMinMaxValues&&o.options.getFacetedMinMaxValues(o,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Se=(e,o,t)=>{var n,i;const s=t==null||(n=t.toString())==null?void 0:n.toLowerCase();return!!(!((i=e.getValue(o))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(s))};Se.autoRemove=e=>E(e);const ve=(e,o,t)=>{var n;return!!(!((n=e.getValue(o))==null||(n=n.toString())==null)&&n.includes(t))};ve.autoRemove=e=>E(e);const Ce=(e,o,t)=>{var n;return((n=e.getValue(o))==null||(n=n.toString())==null?void 0:n.toLowerCase())===t?.toLowerCase()};Ce.autoRemove=e=>E(e);const Re=(e,o,t)=>{var n;return(n=e.getValue(o))==null?void 0:n.includes(t)};Re.autoRemove=e=>E(e);const we=(e,o,t)=>!t.some(n=>{var i;return!((i=e.getValue(o))!=null&&i.includes(n))});we.autoRemove=e=>E(e)||!(e!=null&&e.length);const _e=(e,o,t)=>t.some(n=>{var i;return(i=e.getValue(o))==null?void 0:i.includes(n)});_e.autoRemove=e=>E(e)||!(e!=null&&e.length);const Fe=(e,o,t)=>e.getValue(o)===t;Fe.autoRemove=e=>E(e);const Me=(e,o,t)=>e.getValue(o)==t;Me.autoRemove=e=>E(e);const re=(e,o,t)=>{let[n,i]=t;const s=e.getValue(o);return s>=n&&s<=i};re.resolveFilterValue=e=>{let[o,t]=e,n=typeof o!="number"?parseFloat(o):o,i=typeof t!="number"?parseFloat(t):t,s=o===null||Number.isNaN(n)?-1/0:n,r=t===null||Number.isNaN(i)?1/0:i;if(s>r){const u=s;s=r,r=u}return[s,r]};re.autoRemove=e=>E(e)||E(e[0])&&E(e[1]);const V={includesString:Se,includesStringSensitive:ve,equalsString:Ce,arrIncludes:Re,arrIncludesAll:we,arrIncludesSome:_e,equals:Fe,weakEquals:Me,inNumberRange:re};function E(e){return e==null||e===""}const Ge={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:I("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,o)=>{e.getAutoFilterFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t?.getValue(e.id);return typeof n=="string"?V.includesString:typeof n=="number"?V.inNumberRange:typeof n=="boolean"||n!==null&&typeof n=="object"?V.equals:Array.isArray(n)?V.arrIncludes:V.weakEquals},e.getFilterFn=()=>{var t,n;return N(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(t=(n=o.options.filterFns)==null?void 0:n[e.columnDef.filterFn])!=null?t:V[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,n,i;return((t=e.columnDef.enableColumnFilter)!=null?t:!0)&&((n=o.options.enableColumnFilters)!=null?n:!0)&&((i=o.options.enableFilters)!=null?i:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return(t=o.getState().columnFilters)==null||(t=t.find(n=>n.id===e.id))==null?void 0:t.value},e.getFilterIndex=()=>{var t,n;return(t=(n=o.getState().columnFilters)==null?void 0:n.findIndex(i=>i.id===e.id))!=null?t:-1},e.setFilterValue=t=>{o.setColumnFilters(n=>{const i=e.getFilterFn(),s=n?.find(d=>d.id===e.id),r=O(t,s?s.value:void 0);if(fe(i,r,e)){var u;return(u=n?.filter(d=>d.id!==e.id))!=null?u:[]}const a={id:e.id,value:r};if(s){var l;return(l=n?.map(d=>d.id===e.id?a:d))!=null?l:[]}return n!=null&&n.length?[...n,a]:[a]})}},createRow:(e,o)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=o=>{const t=e.getAllLeafColumns(),n=i=>{var s;return(s=O(o,i))==null?void 0:s.filter(r=>{const u=t.find(a=>a.id===r.id);if(u){const a=u.getFilterFn();if(fe(a,r.value,u))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(n)},e.resetColumnFilters=o=>{var t,n;e.setColumnFilters(o?[]:(t=(n=e.initialState)==null?void 0:n.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())}};function fe(e,o,t){return(e&&e.autoRemove?e.autoRemove(o,t):!1)||typeof o>"u"||typeof o=="string"&&!o}const ke=(e,o,t)=>t.reduce((n,i)=>{const s=i.getValue(e);return n+(typeof s=="number"?s:0)},0),Be=(e,o,t)=>{let n;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(n>s||n===void 0&&s>=s)&&(n=s)}),n},je=(e,o,t)=>{let n;return t.forEach(i=>{const s=i.getValue(e);s!=null&&(n<s||n===void 0&&s>=s)&&(n=s)}),n},Ne=(e,o,t)=>{let n,i;return t.forEach(s=>{const r=s.getValue(e);r!=null&&(n===void 0?r>=r&&(n=i=r):(n>r&&(n=r),i<r&&(i=r)))}),[n,i]},qe=(e,o)=>{let t=0,n=0;if(o.forEach(i=>{let s=i.getValue(e);s!=null&&(s=+s)>=s&&(++t,n+=s)}),t)return n/t},Ue=(e,o)=>{if(!o.length)return;const t=o.map(s=>s.getValue(e));if(!ze(t))return;if(t.length===1)return t[0];const n=Math.floor(t.length/2),i=t.sort((s,r)=>s-r);return t.length%2!==0?i[n]:(i[n-1]+i[n])/2},We=(e,o)=>Array.from(new Set(o.map(t=>t.getValue(e))).values()),be=(e,o)=>new Set(o.map(t=>t.getValue(e))).size,Ke=(e,o)=>o.length,U={sum:ke,min:Be,max:je,extent:Ne,mean:qe,median:Ue,unique:We,uniqueCount:be,count:Ke},Xe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var o,t;return(o=(t=e.getValue())==null||t.toString==null?void 0:t.toString())!=null?o:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:I("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,o)=>{e.toggleGrouping=()=>{o.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(n=>n!==e.id):[...t??[],e.id])},e.getCanGroup=()=>{var t,n;return((t=e.columnDef.enableGrouping)!=null?t:!0)&&((n=o.options.enableGrouping)!=null?n:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.includes(e.id)},e.getGroupedIndex=()=>{var t;return(t=o.getState().grouping)==null?void 0:t.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const t=o.getCoreRowModel().flatRows[0],n=t?.getValue(e.id);if(typeof n=="number")return U.sum;if(Object.prototype.toString.call(n)==="[object Date]")return U.extent},e.getAggregationFn=()=>{var t,n;if(!e)throw new Error;return N(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(t=(n=o.options.aggregationFns)==null?void 0:n[e.columnDef.aggregationFn])!=null?t:U[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=o=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(o),e.resetGrouping=o=>{var t,n;e.setGrouping(o?[]:(t=(n=e.initialState)==null?void 0:n.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,o)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=t=>{if(e._groupingValuesCache.hasOwnProperty(t))return e._groupingValuesCache[t];const n=o.getColumn(t);return n!=null&&n.columnDef.getGroupingValue?(e._groupingValuesCache[t]=n.columnDef.getGroupingValue(e.original),e._groupingValuesCache[t]):e.getValue(t)},e._groupingValuesCache={}},createCell:(e,o,t,n)=>{e.getIsGrouped=()=>o.getIsGrouped()&&o.id===t.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&o.getIsGrouped(),e.getIsAggregated=()=>{var i;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((i=t.subRows)!=null&&i.length)}}};function Je(e,o,t){if(!(o!=null&&o.length)||!t)return e;const n=e.filter(s=>!o.includes(s.id));return t==="remove"?n:[...o.map(s=>e.find(r=>r.id===s)).filter(Boolean),...n]}const Ye={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:I("columnOrder",e)}),createColumn:(e,o)=>{e.getIndex=C(t=>[H(o,t)],t=>t.findIndex(n=>n.id===e.id),R(o.options,"debugColumns")),e.getIsFirstColumn=t=>{var n;return((n=H(o,t)[0])==null?void 0:n.id)===e.id},e.getIsLastColumn=t=>{var n;const i=H(o,t);return((n=i[i.length-1])==null?void 0:n.id)===e.id}},createTable:e=>{e.setColumnOrder=o=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(o),e.resetColumnOrder=o=>{var t;e.setColumnOrder(o?[]:(t=e.initialState.columnOrder)!=null?t:[])},e._getOrderColumnsFn=C(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(o,t,n)=>i=>{let s=[];if(!(o!=null&&o.length))s=i;else{const r=[...o],u=[...i];for(;u.length&&r.length;){const a=r.shift(),l=u.findIndex(d=>d.id===a);l>-1&&s.push(u.splice(l,1)[0])}s=[...s,...u]}return Je(s,t,n)},R(e.options,"debugTable"))}},W=()=>({left:[],right:[]}),Qe={getInitialState:e=>({columnPinning:W(),...e}),getDefaultOptions:e=>({onColumnPinningChange:I("columnPinning",e)}),createColumn:(e,o)=>{e.pin=t=>{const n=e.getLeafColumns().map(i=>i.id).filter(Boolean);o.setColumnPinning(i=>{var s,r;if(t==="right"){var u,a;return{left:((u=i?.left)!=null?u:[]).filter(h=>!(n!=null&&n.includes(h))),right:[...((a=i?.right)!=null?a:[]).filter(h=>!(n!=null&&n.includes(h))),...n]}}if(t==="left"){var l,d;return{left:[...((l=i?.left)!=null?l:[]).filter(h=>!(n!=null&&n.includes(h))),...n],right:((d=i?.right)!=null?d:[]).filter(h=>!(n!=null&&n.includes(h)))}}return{left:((s=i?.left)!=null?s:[]).filter(h=>!(n!=null&&n.includes(h))),right:((r=i?.right)!=null?r:[]).filter(h=>!(n!=null&&n.includes(h)))}})},e.getCanPin=()=>e.getLeafColumns().some(n=>{var i,s,r;return((i=n.columnDef.enablePinning)!=null?i:!0)&&((s=(r=o.options.enableColumnPinning)!=null?r:o.options.enablePinning)!=null?s:!0)}),e.getIsPinned=()=>{const t=e.getLeafColumns().map(u=>u.id),{left:n,right:i}=o.getState().columnPinning,s=t.some(u=>n?.includes(u)),r=t.some(u=>i?.includes(u));return s?"left":r?"right":!1},e.getPinnedIndex=()=>{var t,n;const i=e.getIsPinned();return i?(t=(n=o.getState().columnPinning)==null||(n=n[i])==null?void 0:n.indexOf(e.id))!=null?t:-1:0}},createRow:(e,o)=>{e.getCenterVisibleCells=C(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left,o.getState().columnPinning.right],(t,n,i)=>{const s=[...n??[],...i??[]];return t.filter(r=>!s.includes(r.column.id))},R(o.options,"debugRows")),e.getLeftVisibleCells=C(()=>[e._getAllVisibleCells(),o.getState().columnPinning.left],(t,n)=>(n??[]).map(s=>t.find(r=>r.column.id===s)).filter(Boolean).map(s=>({...s,position:"left"})),R(o.options,"debugRows")),e.getRightVisibleCells=C(()=>[e._getAllVisibleCells(),o.getState().columnPinning.right],(t,n)=>(n??[]).map(s=>t.find(r=>r.column.id===s)).filter(Boolean).map(s=>({...s,position:"right"})),R(o.options,"debugRows"))},createTable:e=>{e.setColumnPinning=o=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(o),e.resetColumnPinning=o=>{var t,n;return e.setColumnPinning(o?W():(t=(n=e.initialState)==null?void 0:n.columnPinning)!=null?t:W())},e.getIsSomeColumnsPinned=o=>{var t;const n=e.getState().columnPinning;if(!o){var i,s;return!!((i=n.left)!=null&&i.length||(s=n.right)!=null&&s.length)}return!!((t=n[o])!=null&&t.length)},e.getLeftLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(o,t)=>(t??[]).map(n=>o.find(i=>i.id===n)).filter(Boolean),R(e.options,"debugColumns")),e.getRightLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(o,t)=>(t??[]).map(n=>o.find(i=>i.id===n)).filter(Boolean),R(e.options,"debugColumns")),e.getCenterLeafColumns=C(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(o,t,n)=>{const i=[...t??[],...n??[]];return o.filter(s=>!i.includes(s.id))},R(e.options,"debugColumns"))}};function Ze(e){return e||(typeof document<"u"?document:null)}const k={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},b=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),et={getDefaultColumnDef:()=>k,getInitialState:e=>({columnSizing:{},columnSizingInfo:b(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:I("columnSizing",e),onColumnSizingInfoChange:I("columnSizingInfo",e)}),createColumn:(e,o)=>{e.getSize=()=>{var t,n,i;const s=o.getState().columnSizing[e.id];return Math.min(Math.max((t=e.columnDef.minSize)!=null?t:k.minSize,(n=s??e.columnDef.size)!=null?n:k.size),(i=e.columnDef.maxSize)!=null?i:k.maxSize)},e.getStart=C(t=>[t,H(o,t),o.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((i,s)=>i+s.getSize(),0),R(o.options,"debugColumns")),e.getAfter=C(t=>[t,H(o,t),o.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((i,s)=>i+s.getSize(),0),R(o.options,"debugColumns")),e.resetSize=()=>{o.setColumnSizing(t=>{let{[e.id]:n,...i}=t;return i})},e.getCanResize=()=>{var t,n;return((t=e.columnDef.enableResizing)!=null?t:!0)&&((n=o.options.enableColumnResizing)!=null?n:!0)},e.getIsResizing=()=>o.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,o)=>{e.getSize=()=>{let t=0;const n=i=>{if(i.subHeaders.length)i.subHeaders.forEach(n);else{var s;t+=(s=i.column.getSize())!=null?s:0}};return n(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 n=o.getColumn(e.column.id),i=n?.getCanResize();return s=>{if(!n||!i||(s.persist==null||s.persist(),K(s)&&s.touches&&s.touches.length>1))return;const r=e.getSize(),u=e?e.getLeafHeaders().map(m=>[m.column.id,m.column.getSize()]):[[n.id,n.getSize()]],a=K(s)?Math.round(s.touches[0].clientX):s.clientX,l={},d=(m,w)=>{typeof w=="number"&&(o.setColumnSizingInfo(v=>{var F,_;const x=o.options.columnResizeDirection==="rtl"?-1:1,$=(w-((F=v?.startOffset)!=null?F:0))*x,D=Math.max($/((_=v?.startSize)!=null?_:0),-.999999);return v.columnSizingStart.forEach(xe=>{let[Ee,ae]=xe;l[Ee]=Math.round(Math.max(ae+ae*D,0)*100)/100}),{...v,deltaOffset:$,deltaPercentage:D}}),(o.options.columnResizeMode==="onChange"||m==="end")&&o.setColumnSizing(v=>({...v,...l})))},h=m=>d("move",m),c=m=>{d("end",m),o.setColumnSizingInfo(w=>({...w,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},g=Ze(t),f={moveHandler:m=>h(m.clientX),upHandler:m=>{g?.removeEventListener("mousemove",f.moveHandler),g?.removeEventListener("mouseup",f.upHandler),c(m.clientX)}},p={moveHandler:m=>(m.cancelable&&(m.preventDefault(),m.stopPropagation()),h(m.touches[0].clientX),!1),upHandler:m=>{var w;g?.removeEventListener("touchmove",p.moveHandler),g?.removeEventListener("touchend",p.upHandler),m.cancelable&&(m.preventDefault(),m.stopPropagation()),c((w=m.touches[0])==null?void 0:w.clientX)}},S=tt()?{passive:!1}:!1;K(s)?(g?.addEventListener("touchmove",p.moveHandler,S),g?.addEventListener("touchend",p.upHandler,S)):(g?.addEventListener("mousemove",f.moveHandler,S),g?.addEventListener("mouseup",f.upHandler,S)),o.setColumnSizingInfo(m=>({...m,startOffset:a,startSize:r,deltaOffset:0,deltaPercentage:0,columnSizingStart:u,isResizingColumn:n.id}))}}},createTable:e=>{e.setColumnSizing=o=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(o),e.setColumnSizingInfo=o=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(o),e.resetColumnSizing=o=>{var t;e.setColumnSizing(o?{}:(t=e.initialState.columnSizing)!=null?t:{})},e.resetHeaderSizeInfo=o=>{var t;e.setColumnSizingInfo(o?b():(t=e.initialState.columnSizingInfo)!=null?t:b())},e.getTotalSize=()=>{var o,t;return(o=(t=e.getHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getLeftTotalSize=()=>{var o,t;return(o=(t=e.getLeftHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getCenterTotalSize=()=>{var o,t;return(o=(t=e.getCenterHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0},e.getRightTotalSize=()=>{var o,t;return(o=(t=e.getRightHeaderGroups()[0])==null?void 0:t.headers.reduce((n,i)=>n+i.getSize(),0))!=null?o:0}}};let B=null;function tt(){if(typeof B=="boolean")return B;let e=!1;try{const o={get passive(){return e=!0,!1}},t=()=>{};window.addEventListener("test",t,o),window.removeEventListener("test",t)}catch{e=!1}return B=e,B}function K(e){return e.type==="touchstart"}const nt={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:I("columnVisibility",e)}),createColumn:(e,o)=>{e.toggleVisibility=t=>{e.getCanHide()&&o.setColumnVisibility(n=>({...n,[e.id]:t??!e.getIsVisible()}))},e.getIsVisible=()=>{var t,n;const i=e.columns;return(t=i.length?i.some(s=>s.getIsVisible()):(n=o.getState().columnVisibility)==null?void 0:n[e.id])!=null?t:!0},e.getCanHide=()=>{var t,n;return((t=e.columnDef.enableHiding)!=null?t:!0)&&((n=o.options.enableHiding)!=null?n:!0)},e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,o)=>{e._getAllVisibleCells=C(()=>[e.getAllCells(),o.getState().columnVisibility],t=>t.filter(n=>n.column.getIsVisible()),R(o.options,"debugRows")),e.getVisibleCells=C(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(t,n,i)=>[...t,...n,...i],R(o.options,"debugRows"))},createTable:e=>{const o=(t,n)=>C(()=>[n(),n().filter(i=>i.getIsVisible()).map(i=>i.id).join("_")],i=>i.filter(s=>s.getIsVisible==null?void 0:s.getIsVisible()),R(e.options,"debugColumns"));e.getVisibleFlatColumns=o("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=o("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=o("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=o("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=o("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:(n=e.initialState.columnVisibility)!=null?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=(n=t)!=null?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((i,s)=>({...i,[s.id]:t||!(s.getCanHide!=null&&s.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 n;e.toggleAllColumnsVisible((n=t.target)==null?void 0:n.checked)}}};function H(e,o){return o?o==="center"?e.getCenterVisibleLeafColumns():o==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const it={createTable:e=>{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()}}},ot={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:I("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:o=>{var t;const n=(t=e.getCoreRowModel().flatRows[0])==null||(t=t._getAllCellsByColumnId()[o.id])==null?void 0:t.getValue();return typeof n=="string"||typeof n=="number"}}),createColumn:(e,o)=>{e.getCanGlobalFilter=()=>{var t,n,i,s;return((t=e.columnDef.enableGlobalFilter)!=null?t:!0)&&((n=o.options.enableGlobalFilter)!=null?n:!0)&&((i=o.options.enableFilters)!=null?i:!0)&&((s=o.options.getColumnCanGlobalFilter==null?void 0:o.options.getColumnCanGlobalFilter(e))!=null?s:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>V.includesString,e.getGlobalFilterFn=()=>{var o,t;const{globalFilterFn:n}=e.options;return N(n)?n:n==="auto"?e.getGlobalAutoFilterFn():(o=(t=e.options.filterFns)==null?void 0:t[n])!=null?o:V[n]},e.setGlobalFilter=o=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(o)},e.resetGlobalFilter=o=>{e.setGlobalFilter(o?void 0:e.initialState.globalFilter)}}},st={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:I("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let o=!1,t=!1;e._autoResetExpanded=()=>{var n,i;if(!o){e._queue(()=>{o=!0});return}if((n=(i=e.options.autoResetAll)!=null?i:e.options.autoResetExpanded)!=null?n:!e.options.manualExpanding){if(t)return;t=!0,e._queue(()=>{e.resetExpanded(),t=!1})}},e.setExpanded=n=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(n),e.toggleAllRowsExpanded=n=>{n??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=n=>{var i,s;e.setExpanded(n?{}:(i=(s=e.initialState)==null?void 0:s.expanded)!=null?i:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(n=>n.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>n=>{n.persist==null||n.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const n=e.getState().expanded;return n===!0||Object.values(n).some(Boolean)},e.getIsAllRowsExpanded=()=>{const n=e.getState().expanded;return typeof n=="boolean"?n===!0:!(!Object.keys(n).length||e.getRowModel().flatRows.some(i=>!i.getIsExpanded()))},e.getExpandedDepth=()=>{let n=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(s=>{const r=s.split(".");n=Math.max(n,r.length)}),n},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,o)=>{e.toggleExpanded=t=>{o.setExpanded(n=>{var i;const s=n===!0?!0:!!(n!=null&&n[e.id]);let r={};if(n===!0?Object.keys(o.getRowModel().rowsById).forEach(u=>{r[u]=!0}):r=n,t=(i=t)!=null?i:!s,!s&&t)return{...r,[e.id]:!0};if(s&&!t){const{[e.id]:u,...a}=r;return a}return n})},e.getIsExpanded=()=>{var t;const n=o.getState().expanded;return!!((t=o.options.getIsRowExpanded==null?void 0:o.options.getIsRowExpanded(e))!=null?t:n===!0||n?.[e.id])},e.getCanExpand=()=>{var t,n,i;return(t=o.options.getRowCanExpand==null?void 0:o.options.getRowCanExpand(e))!=null?t:((n=o.options.enableExpanding)!=null?n:!0)&&!!((i=e.subRows)!=null&&i.length)},e.getIsAllParentsExpanded=()=>{let t=!0,n=e;for(;t&&n.parentId;)n=o.getRow(n.parentId,!0),t=n.getIsExpanded();return t},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},ee=0,te=10,X=()=>({pageIndex:ee,pageSize:te}),rt={getInitialState:e=>({...e,pagination:{...X(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:I("pagination",e)}),createTable:e=>{let o=!1,t=!1;e._autoResetPageIndex=()=>{var n,i;if(!o){e._queue(()=>{o=!0});return}if((n=(i=e.options.autoResetAll)!=null?i:e.options.autoResetPageIndex)!=null?n:!e.options.manualPagination){if(t)return;t=!0,e._queue(()=>{e.resetPageIndex(),t=!1})}},e.setPagination=n=>{const i=s=>O(n,s);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(i)},e.resetPagination=n=>{var i;e.setPagination(n?X():(i=e.initialState.pagination)!=null?i:X())},e.setPageIndex=n=>{e.setPagination(i=>{let s=O(n,i.pageIndex);const r=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return s=Math.max(0,Math.min(s,r)),{...i,pageIndex:s}})},e.resetPageIndex=n=>{var i,s;e.setPageIndex(n?ee:(i=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageIndex)!=null?i:ee)},e.resetPageSize=n=>{var i,s;e.setPageSize(n?te:(i=(s=e.initialState)==null||(s=s.pagination)==null?void 0:s.pageSize)!=null?i:te)},e.setPageSize=n=>{e.setPagination(i=>{const s=Math.max(1,O(n,i.pageSize)),r=i.pageSize*i.pageIndex,u=Math.floor(r/s);return{...i,pageIndex:u,pageSize:s}})},e.setPageCount=n=>e.setPagination(i=>{var s;let r=O(n,(s=e.options.pageCount)!=null?s:-1);return typeof r=="number"&&(r=Math.max(-1,r)),{...i,pageCount:r}}),e.getPageOptions=C(()=>[e.getPageCount()],n=>{let i=[];return n&&n>0&&(i=[...new Array(n)].fill(null).map((s,r)=>r)),i},R(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:n}=e.getState().pagination,i=e.getPageCount();return i===-1?!0:i===0?!1:n<i-1},e.previousPage=()=>e.setPageIndex(n=>n-1),e.nextPage=()=>e.setPageIndex(n=>n+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-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 n;return(n=e.options.pageCount)!=null?n:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var n;return(n=e.options.rowCount)!=null?n:e.getPrePaginationRowModel().rows.length}}},J=()=>({top:[],bottom:[]}),lt={getInitialState:e=>({rowPinning:J(),...e}),getDefaultOptions:e=>({onRowPinningChange:I("rowPinning",e)}),createRow:(e,o)=>{e.pin=(t,n,i)=>{const s=n?e.getLeafRows().map(a=>{let{id:l}=a;return l}):[],r=i?e.getParentRows().map(a=>{let{id:l}=a;return l}):[],u=new Set([...r,e.id,...s]);o.setRowPinning(a=>{var l,d;if(t==="bottom"){var h,c;return{top:((h=a?.top)!=null?h:[]).filter(p=>!(u!=null&&u.has(p))),bottom:[...((c=a?.bottom)!=null?c:[]).filter(p=>!(u!=null&&u.has(p))),...Array.from(u)]}}if(t==="top"){var g,f;return{top:[...((g=a?.top)!=null?g:[]).filter(p=>!(u!=null&&u.has(p))),...Array.from(u)],bottom:((f=a?.bottom)!=null?f:[]).filter(p=>!(u!=null&&u.has(p)))}}return{top:((l=a?.top)!=null?l:[]).filter(p=>!(u!=null&&u.has(p))),bottom:((d=a?.bottom)!=null?d:[]).filter(p=>!(u!=null&&u.has(p)))}})},e.getCanPin=()=>{var t;const{enableRowPinning:n,enablePinning:i}=o.options;return typeof n=="function"?n(e):(t=n??i)!=null?t:!0},e.getIsPinned=()=>{const t=[e.id],{top:n,bottom:i}=o.getState().rowPinning,s=t.some(u=>n?.includes(u)),r=t.some(u=>i?.includes(u));return s?"top":r?"bottom":!1},e.getPinnedIndex=()=>{var t,n;const i=e.getIsPinned();if(!i)return-1;const s=(t=i==="top"?o.getTopRows():o.getBottomRows())==null?void 0:t.map(r=>{let{id:u}=r;return u});return(n=s?.indexOf(e.id))!=null?n:-1}},createTable:e=>{e.setRowPinning=o=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(o),e.resetRowPinning=o=>{var t,n;return e.setRowPinning(o?J():(t=(n=e.initialState)==null?void 0:n.rowPinning)!=null?t:J())},e.getIsSomeRowsPinned=o=>{var t;const n=e.getState().rowPinning;if(!o){var i,s;return!!((i=n.top)!=null&&i.length||(s=n.bottom)!=null&&s.length)}return!!((t=n[o])!=null&&t.length)},e._getPinnedRows=(o,t,n)=>{var i;return((i=e.options.keepPinnedRows)==null||i?(t??[]).map(r=>{const u=e.getRow(r,!0);return u.getIsAllParentsExpanded()?u:null}):(t??[]).map(r=>o.find(u=>u.id===r))).filter(Boolean).map(r=>({...r,position:n}))},e.getTopRows=C(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(o,t)=>e._getPinnedRows(o,t,"top"),R(e.options,"debugRows")),e.getBottomRows=C(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(o,t)=>e._getPinnedRows(o,t,"bottom"),R(e.options,"debugRows")),e.getCenterRows=C(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(o,t,n)=>{const i=new Set([...t??[],...n??[]]);return o.filter(s=>!i.has(s.id))},R(e.options,"debugRows"))}},ut={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:I("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=o=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(o),e.resetRowSelection=o=>{var t;return e.setRowSelection(o?{}:(t=e.initialState.rowSelection)!=null?t:{})},e.toggleAllRowsSelected=o=>{e.setRowSelection(t=>{o=typeof o<"u"?o:!e.getIsAllRowsSelected();const n={...t},i=e.getPreGroupedRowModel().flatRows;return o?i.forEach(s=>{s.getCanSelect()&&(n[s.id]=!0)}):i.forEach(s=>{delete n[s.id]}),n})},e.toggleAllPageRowsSelected=o=>e.setRowSelection(t=>{const n=typeof o<"u"?o:!e.getIsAllPageRowsSelected(),i={...t};return e.getRowModel().rows.forEach(s=>{ne(i,s.id,n,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=C(()=>[e.getState().rowSelection,e.getCoreRowModel()],(o,t)=>Object.keys(o).length?Y(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getFilteredSelectedRowModel=C(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(o,t)=>Object.keys(o).length?Y(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getGroupedSelectedRowModel=C(()=>[e.getState().rowSelection,e.getSortedRowModel()],(o,t)=>Object.keys(o).length?Y(e,t):{rows:[],flatRows:[],rowsById:{}},R(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const o=e.getFilteredRowModel().flatRows,{rowSelection:t}=e.getState();let n=!!(o.length&&Object.keys(t).length);return n&&o.some(i=>i.getCanSelect()&&!t[i.id])&&(n=!1),n},e.getIsAllPageRowsSelected=()=>{const o=e.getPaginationRowModel().flatRows.filter(i=>i.getCanSelect()),{rowSelection:t}=e.getState();let n=!!o.length;return n&&o.some(i=>!t[i.id])&&(n=!1),n},e.getIsSomeRowsSelected=()=>{var o;const t=Object.keys((o=e.getState().rowSelection)!=null?o:{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const o=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:o.filter(t=>t.getCanSelect()).some(t=>t.getIsSelected()||t.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>o=>{e.toggleAllRowsSelected(o.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>o=>{e.toggleAllPageRowsSelected(o.target.checked)}},createRow:(e,o)=>{e.toggleSelected=(t,n)=>{const i=e.getIsSelected();o.setRowSelection(s=>{var r;if(t=typeof t<"u"?t:!i,e.getCanSelect()&&i===t)return s;const u={...s};return ne(u,e.id,t,(r=n?.selectChildren)!=null?r:!0,o),u})},e.getIsSelected=()=>{const{rowSelection:t}=o.getState();return le(e,t)},e.getIsSomeSelected=()=>{const{rowSelection:t}=o.getState();return ie(e,t)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:t}=o.getState();return ie(e,t)==="all"},e.getCanSelect=()=>{var t;return typeof o.options.enableRowSelection=="function"?o.options.enableRowSelection(e):(t=o.options.enableRowSelection)!=null?t:!0},e.getCanSelectSubRows=()=>{var t;return typeof o.options.enableSubRowSelection=="function"?o.options.enableSubRowSelection(e):(t=o.options.enableSubRowSelection)!=null?t:!0},e.getCanMultiSelect=()=>{var t;return typeof o.options.enableMultiRowSelection=="function"?o.options.enableMultiRowSelection(e):(t=o.options.enableMultiRowSelection)!=null?t:!0},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var i;t&&e.toggleSelected((i=n.target)==null?void 0:i.checked)}}}},ne=(e,o,t,n,i)=>{var s;const r=i.getRow(o,!0);t?(r.getCanMultiSelect()||Object.keys(e).forEach(u=>delete e[u]),r.getCanSelect()&&(e[o]=!0)):delete e[o],n&&(s=r.subRows)!=null&&s.length&&r.getCanSelectSubRows()&&r.subRows.forEach(u=>ne(e,u.id,t,n,i))};function Y(e,o){const t=e.getState().rowSelection,n=[],i={},s=function(r,u){return r.map(a=>{var l;const d=le(a,t);if(d&&(n.push(a),i[a.id]=a),(l=a.subRows)!=null&&l.length&&(a={...a,subRows:s(a.subRows)}),d)return a}).filter(Boolean)};return{rows:s(o.rows),flatRows:n,rowsById:i}}function le(e,o){var t;return(t=o[e.id])!=null?t:!1}function ie(e,o,t){var n;if(!((n=e.subRows)!=null&&n.length))return!1;let i=!0,s=!1;return e.subRows.forEach(r=>{if(!(s&&!i)&&(r.getCanSelect()&&(le(r,o)?s=!0:i=!1),r.subRows&&r.subRows.length)){const u=ie(r,o);u==="all"?s=!0:(u==="some"&&(s=!0),i=!1)}}),i?"all":s?"some":!1}const oe=/([0-9]+)/gm,at=(e,o,t)=>ye(P(e.getValue(t)).toLowerCase(),P(o.getValue(t)).toLowerCase()),gt=(e,o,t)=>ye(P(e.getValue(t)),P(o.getValue(t))),dt=(e,o,t)=>ue(P(e.getValue(t)).toLowerCase(),P(o.getValue(t)).toLowerCase()),ct=(e,o,t)=>ue(P(e.getValue(t)),P(o.getValue(t))),ft=(e,o,t)=>{const n=e.getValue(t),i=o.getValue(t);return n>i?1:n<i?-1:0},ht=(e,o,t)=>ue(e.getValue(t),o.getValue(t));function ue(e,o){return e===o?0:e>o?1:-1}function P(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function ye(e,o){const t=e.split(oe).filter(Boolean),n=o.split(oe).filter(Boolean);for(;t.length&&n.length;){const i=t.shift(),s=n.shift(),r=parseInt(i,10),u=parseInt(s,10),a=[r,u].sort();if(isNaN(a[0])){if(i>s)return 1;if(s>i)return-1;continue}if(isNaN(a[1]))return isNaN(r)?-1:1;if(r>u)return 1;if(u>r)return-1}return t.length-n.length}const T={alphanumeric:at,alphanumericCaseSensitive:gt,text:dt,textCaseSensitive:ct,datetime:ft,basic:ht},pt={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:I("sorting",e),isMultiSortEvent:o=>o.shiftKey}),createColumn:(e,o)=>{e.getAutoSortingFn=()=>{const t=o.getFilteredRowModel().flatRows.slice(10);let n=!1;for(const i of t){const s=i?.getValue(e.id);if(Object.prototype.toString.call(s)==="[object Date]")return T.datetime;if(typeof s=="string"&&(n=!0,s.split(oe).length>1))return T.alphanumeric}return n?T.text:T.basic},e.getAutoSortDir=()=>{const t=o.getFilteredRowModel().flatRows[0];return typeof t?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var t,n;if(!e)throw new Error;return N(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(t=(n=o.options.sortingFns)==null?void 0:n[e.columnDef.sortingFn])!=null?t:T[e.columnDef.sortingFn]},e.toggleSorting=(t,n)=>{const i=e.getNextSortingOrder(),s=typeof t<"u"&&t!==null;o.setSorting(r=>{const u=r?.find(g=>g.id===e.id),a=r?.findIndex(g=>g.id===e.id);let l=[],d,h=s?t:i==="desc";if(r!=null&&r.length&&e.getCanMultiSort()&&n?u?d="toggle":d="add":r!=null&&r.length&&a!==r.length-1?d="replace":u?d="toggle":d="replace",d==="toggle"&&(s||i||(d="remove")),d==="add"){var c;l=[...r,{id:e.id,desc:h}],l.splice(0,l.length-((c=o.options.maxMultiSortColCount)!=null?c:Number.MAX_SAFE_INTEGER))}else d==="toggle"?l=r.map(g=>g.id===e.id?{...g,desc:h}:g):d==="remove"?l=r.filter(g=>g.id!==e.id):l=[{id:e.id,desc:h}];return l})},e.getFirstSortDir=()=>{var t,n;return((t=(n=e.columnDef.sortDescFirst)!=null?n:o.options.sortDescFirst)!=null?t:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=t=>{var n,i;const s=e.getFirstSortDir(),r=e.getIsSorted();return r?r!==s&&((n=o.options.enableSortingRemoval)==null||n)&&(!(t&&(i=o.options.enableMultiRemove)!=null)||i)?!1:r==="desc"?"asc":"desc":s},e.getCanSort=()=>{var t,n;return((t=e.columnDef.enableSorting)!=null?t:!0)&&((n=o.options.enableSorting)!=null?n:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var t,n;return(t=(n=e.columnDef.enableMultiSort)!=null?n:o.options.enableMultiSort)!=null?t:!!e.accessorFn},e.getIsSorted=()=>{var t;const n=(t=o.getState().sorting)==null?void 0:t.find(i=>i.id===e.id);return n?n.desc?"desc":"asc":!1},e.getSortIndex=()=>{var t,n;return(t=(n=o.getState().sorting)==null?void 0:n.findIndex(i=>i.id===e.id))!=null?t:-1},e.clearSorting=()=>{o.setSorting(t=>t!=null&&t.length?t.filter(n=>n.id!==e.id):[])},e.getToggleSortingHandler=()=>{const t=e.getCanSort();return n=>{t&&(n.persist==null||n.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?o.options.isMultiSortEvent==null?void 0:o.options.isMultiSortEvent(n):!1))}}},createTable:e=>{e.setSorting=o=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(o),e.resetSorting=o=>{var t,n;e.setSorting(o?[]:(t=(n=e.initialState)==null?void 0:n.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())}},mt=[Le,nt,Ye,Qe,He,Ge,it,ot,pt,Xe,st,rt,lt,ut,et];function St(e){var o,t;const n=[...mt,...(o=e._features)!=null?o:[]];let i={_features:n};const s=i._features.reduce((c,g)=>Object.assign(c,g.getDefaultOptions==null?void 0:g.getDefaultOptions(i)),{}),r=c=>i.options.mergeOptions?i.options.mergeOptions(s,c):{...s,...c};let a={...{},...(t=e.initialState)!=null?t:{}};i._features.forEach(c=>{var g;a=(g=c.getInitialState==null?void 0:c.getInitialState(a))!=null?g:a});const l=[];let d=!1;const h={_features:n,options:{...s,...e},initialState:a,_queue:c=>{l.push(c),d||(d=!0,Promise.resolve().then(()=>{for(;l.length;)l.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{i.setState(i.initialState)},setOptions:c=>{const g=O(c,i.options);i.options=r(g)},getState:()=>i.options.state,setState:c=>{i.options.onStateChange==null||i.options.onStateChange(c)},_getRowId:(c,g,f)=>{var p;return(p=i.options.getRowId==null?void 0:i.options.getRowId(c,g,f))!=null?p:`${f?[f.id,g].join("."):g}`},getCoreRowModel:()=>(i._getCoreRowModel||(i._getCoreRowModel=i.options.getCoreRowModel(i)),i._getCoreRowModel()),getRowModel:()=>i.getPaginationRowModel(),getRow:(c,g)=>{let f=(g?i.getPrePaginationRowModel():i.getRowModel()).rowsById[c];if(!f&&(f=i.getCoreRowModel().rowsById[c],!f))throw new Error;return f},_getDefaultColumnDef:C(()=>[i.options.defaultColumn],c=>{var g;return c=(g=c)!=null?g:{},{header:f=>{const p=f.header.column.columnDef;return p.accessorKey?p.accessorKey:p.accessorFn?p.id:null},cell:f=>{var p,S;return(p=(S=f.renderValue())==null||S.toString==null?void 0:S.toString())!=null?p:null},...i._features.reduce((f,p)=>Object.assign(f,p.getDefaultColumnDef==null?void 0:p.getDefaultColumnDef()),{}),...c}},R(e,"debugColumns")),_getColumnDefs:()=>i.options.columns,getAllColumns:C(()=>[i._getColumnDefs()],c=>{const g=function(f,p,S){return S===void 0&&(S=0),f.map(m=>{const w=Te(i,m,S,p),v=m;return w.columns=v.columns?g(v.columns,w,S+1):[],w})};return g(c)},R(e,"debugColumns")),getAllFlatColumns:C(()=>[i.getAllColumns()],c=>c.flatMap(g=>g.getFlatColumns()),R(e,"debugColumns")),_getAllFlatColumnsById:C(()=>[i.getAllFlatColumns()],c=>c.reduce((g,f)=>(g[f.id]=f,g),{}),R(e,"debugColumns")),getAllLeafColumns:C(()=>[i.getAllColumns(),i._getOrderColumnsFn()],(c,g)=>{let f=c.flatMap(p=>p.getLeafColumns());return g(f)},R(e,"debugColumns")),getColumn:c=>i._getAllFlatColumnsById()[c]};Object.assign(i,h);for(let c=0;c<i._features.length;c++){const g=i._features[c];g==null||g.createTable==null||g.createTable(i)}return i}function Ht(){return e=>C(()=>[e.options.data],o=>{const t={rows:[],flatRows:[],rowsById:{}},n=function(i,s,r){s===void 0&&(s=0);const u=[];for(let l=0;l<i.length;l++){const d=se(e,e._getRowId(i[l],l,r),i[l],l,s,void 0,r?.id);if(t.flatRows.push(d),t.rowsById[d.id]=d,u.push(d),e.options.getSubRows){var a;d.originalSubRows=e.options.getSubRows(i[l],l),(a=d.originalSubRows)!=null&&a.length&&(d.subRows=n(d.originalSubRows,s+1,d))}}return u};return t.rows=n(o),t},R(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function vt(e,o,t){return t.options.filterFromLeafRows?Ct(e,o,t):Rt(e,o,t)}function Ct(e,o,t){var n;const i=[],s={},r=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,u=function(a,l){l===void 0&&(l=0);const d=[];for(let c=0;c<a.length;c++){var h;let g=a[c];const f=se(t,g.id,g.original,g.index,g.depth,void 0,g.parentId);if(f.columnFilters=g.columnFilters,(h=g.subRows)!=null&&h.length&&l<r){if(f.subRows=u(g.subRows,l+1),g=f,o(g)&&!f.subRows.length){d.push(g),s[g.id]=g,i.push(g);continue}if(o(g)||f.subRows.length){d.push(g),s[g.id]=g,i.push(g);continue}}else g=f,o(g)&&(d.push(g),s[g.id]=g,i.push(g))}return d};return{rows:u(e),flatRows:i,rowsById:s}}function Rt(e,o,t){var n;const i=[],s={},r=(n=t.options.maxLeafRowFilterDepth)!=null?n:100,u=function(a,l){l===void 0&&(l=0);const d=[];for(let c=0;c<a.length;c++){let g=a[c];if(o(g)){var h;if((h=g.subRows)!=null&&h.length&&l<r){const p=se(t,g.id,g.original,g.index,g.depth,void 0,g.parentId);p.subRows=u(g.subRows,l+1),g=p}d.push(g),i.push(g),s[g.id]=g}}return d};return{rows:u(e),flatRows:i,rowsById:s}}function Gt(){return e=>C(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(o,t,n)=>{if(!o.rows.length||!(t!=null&&t.length)&&!n){for(let c=0;c<o.flatRows.length;c++)o.flatRows[c].columnFilters={},o.flatRows[c].columnFiltersMeta={};return o}const i=[],s=[];(t??[]).forEach(c=>{var g;const f=e.getColumn(c.id);if(!f)return;const p=f.getFilterFn();p&&i.push({id:c.id,filterFn:p,resolvedValue:(g=p.resolveFilterValue==null?void 0:p.resolveFilterValue(c.value))!=null?g:c.value})});const r=(t??[]).map(c=>c.id),u=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter(c=>c.getCanGlobalFilter());n&&u&&a.length&&(r.push("__global__"),a.forEach(c=>{var g;s.push({id:c.id,filterFn:u,resolvedValue:(g=u.resolveFilterValue==null?void 0:u.resolveFilterValue(n))!=null?g:n})}));let l,d;for(let c=0;c<o.flatRows.length;c++){const g=o.flatRows[c];if(g.columnFilters={},i.length)for(let f=0;f<i.length;f++){l=i[f];const p=l.id;g.columnFilters[p]=l.filterFn(g,p,l.resolvedValue,S=>{g.columnFiltersMeta[p]=S})}if(s.length){for(let f=0;f<s.length;f++){d=s[f];const p=d.id;if(d.filterFn(g,p,d.resolvedValue,S=>{g.columnFiltersMeta[p]=S})){g.columnFilters.__global__=!0;break}}g.columnFilters.__global__!==!0&&(g.columnFilters.__global__=!1)}}const h=c=>{for(let g=0;g<r.length;g++)if(c.columnFilters[r[g]]===!1)return!1;return!0};return vt(o.rows,h,e)},R(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function kt(){return e=>C(()=>[e.getState().sorting,e.getPreSortedRowModel()],(o,t)=>{if(!t.rows.length||!(o!=null&&o.length))return t;const n=e.getState().sorting,i=[],s=n.filter(a=>{var l;return(l=e.getColumn(a.id))==null?void 0:l.getCanSort()}),r={};s.forEach(a=>{const l=e.getColumn(a.id);l&&(r[a.id]={sortUndefined:l.columnDef.sortUndefined,invertSorting:l.columnDef.invertSorting,sortingFn:l.getSortingFn()})});const u=a=>{const l=a.map(d=>({...d}));return l.sort((d,h)=>{for(let g=0;g<s.length;g+=1){var c;const f=s[g],p=r[f.id],S=p.sortUndefined,m=(c=f?.desc)!=null?c:!1;let w=0;if(S){const v=d.getValue(f.id),F=h.getValue(f.id),_=v===void 0,x=F===void 0;if(_||x){if(S==="first")return _?-1:1;if(S==="last")return _?1:-1;w=_&&x?0:_?S:-S}}if(w===0&&(w=p.sortingFn(d,h,f.id)),w!==0)return m&&(w*=-1),p.invertSorting&&(w*=-1),w}return d.index-h.index}),l.forEach(d=>{var h;i.push(d),(h=d.subRows)!=null&&h.length&&(d.subRows=u(d.subRows))}),l};return{rows:u(t.rows),flatRows:i,rowsById:t.rowsById}},R(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}/**
|
|
22
|
+
* react-table
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) TanStack
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the MIT license found in the
|
|
27
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
28
|
+
*
|
|
29
|
+
* @license MIT
|
|
30
|
+
*/function Bt(e){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[t]=z.useState(()=>({current:St(o)})),[n,i]=z.useState(()=>t.current.initialState);return t.current.setOptions(s=>({...s,...e,state:{...n,...e.state},onStateChange:r=>{i(r),e.onStateChange==null||e.onStateChange(r)}})),t.current}function wt(e,o,t){const n=new Array(e);return new Proxy(n,{get(i,s,r){if(typeof s=="string"){const u=s.charCodeAt(0);if(u>=48&&u<=57){const a=+s;if(Number.isInteger(a)&&a>=0&&a<e){let l=i[a];if(!l){const d=o[a*2];l=i[a]={index:a,key:t(a),start:d,size:o[a*2+1],end:d+o[a*2+1],lane:0}}return l}}if(s==="length")return e}return Reflect.get(i,s,r)}})}function A(e,o,t){let n=t.initialDeps??[],i,s=!0;function r(){const u=e();return(u.length!==n.length||u.some((l,d)=>n[d]!==l))&&(n=u,i=o(...u),t?.onChange&&!(s&&t.skipInitialOnChange)&&t.onChange(i),s=!1),i}return r.updateDeps=u=>{n=u},r}function he(e,o){if(e===void 0)throw new Error("Unexpected undefined");return e}const _t=(e,o)=>Math.abs(e-o)<1.01,Ft=(e,o,t)=>{let n;return function(...i){e.clearTimeout(n),n=e.setTimeout(()=>o.apply(this,i),t)}};let L;const Q=()=>{if(L!==void 0)return L;if(typeof navigator>"u")return L=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return L=!0;const e=navigator.maxTouchPoints;return L=navigator.platform==="MacIntel"&&e!==void 0&&e>0},pe=e=>{const{offsetWidth:o,offsetHeight:t}=e;return{width:o,height:t}},Mt=e=>e,yt=e=>{const o=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1)-o+1,i=new Array(n);for(let s=0;s<n;s++)i[s]=o+s;return i},It=(e,o)=>{const t=e.scrollElement;if(!t)return;const n=e.targetWindow;if(!n)return;const i=r=>{const{width:u,height:a}=r;o({width:Math.round(u),height:Math.round(a)})};if(i(pe(t)),!n.ResizeObserver)return()=>{};const s=new n.ResizeObserver(r=>{const u=()=>{const a=r[0];if(a?.borderBoxSize){const l=a.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(pe(t))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(u):u()});return s.observe(t,{box:"border-box"}),()=>{s.unobserve(t)}},j={passive:!0},xt=typeof window>"u"?!0:"onscrollend"in window,Et=(e,o,t)=>{const n=e.scrollElement;if(!n)return;const i=e.targetWindow;if(!i)return;const s=e.options.useScrollendEvent&&xt;let r=0;const u=s?null:Ft(i,()=>o(r,!1),e.options.isScrollingResetDelay),a=h=>()=>{r=t(n),u?.(),o(r,h)},l=a(!0),d=a(!1);return n.addEventListener("scroll",l,j),s&&n.addEventListener("scrollend",d,j),()=>{n.removeEventListener("scroll",l),s&&n.removeEventListener("scrollend",d)}},$t=(e,o)=>Et(e,o,t=>{const{horizontal:n,isRtl:i}=e.options;return n?t.scrollLeft*(i&&-1||1):t.scrollTop}),Vt=(e,o,t)=>{if(t.options.useCachedMeasurements){const n=t.indexFromElement(e),i=t.options.getItemKey(n);return t.itemSizeCache.get(i)??t.options.estimateSize(n)}if(o?.borderBoxSize){const n=o.borderBoxSize[0];if(n)return Math.round(n[t.options.horizontal?"inlineSize":"blockSize"])}if(!o){const n=t.indexFromElement(e),i=t.options.getItemKey(n),s=t.itemSizeCache.get(i);if(s!==void 0)return s}return e[t.options.horizontal?"offsetWidth":"offsetHeight"]},Ot=(e,{adjustments:o=0,behavior:t},n)=>{var i,s;(s=(i=n.scrollElement)==null?void 0:i.scrollTo)==null||s.call(i,{[n.options.horizontal?"left":"top"]:e+o,behavior:t})},Pt=Ot;class zt{constructor(o){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=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.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var t,n,i;return((i=(n=(t=this.targetWindow)==null?void 0:t.performance)==null?void 0:n.now)==null?void 0:i.call(n))??Date.now()},this.observer=(()=>{let t=null;const n=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{const r=()=>{const u=s.target,a=this.indexFromElement(u);if(!u.isConnected){this.observer.unobserve(u);for(const[l,d]of this.elementsCache)if(d===u){this.elementsCache.delete(l);break}return}this.shouldMeasureDuringScroll(a)&&this.resizeItem(a,this.options.measureElement(u,s,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()})}));return{disconnect:()=>{var i;(i=n())==null||i.disconnect(),t=null},observe:i=>{var s;return(s=n())==null?void 0:s.observe(i,{box:"border-box"})},unobserve:i=>{var s;return(s=n())==null?void 0:s.unobserve(i)}}})(),this.range=null,this.setOptions=t=>{var n,i;const s={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Mt,rangeExtractor:yt,onChange:()=>{},measureElement:Vt,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(const c in t){const g=t[c];g!==void 0&&(s[c]=g)}const r=this.options;let u=null,a=null,l=!1;if(r!==void 0&&r.enabled&&s.enabled&&s.anchorTo==="end"&&this.scrollElement!==null){const c=r.count,g=s.count,f=this.getMeasurements(),p=c>0?((n=f[0])==null?void 0:n.key)??r.getItemKey(0):null,S=c>0?((i=f[c-1])==null?void 0:i.key)??r.getItemKey(c-1):null;if(g!==c||c>0&&g>0&&(s.getItemKey(0)!==p||s.getItemKey(g-1)!==S)){l=!0;const v=c>0?this.getVirtualItemForOffset(this.getScrollOffset())??f[0]:null;v&&(u=[v.key,this.getScrollOffset()-v.start]);const F=s.followOnAppend===!0?"auto":s.followOnAppend||null;F&&g>c&&this.isAtEnd(r.scrollEndThreshold)&&(c===0||s.getItemKey(g-1)!==S)&&(a=F)}}this.options=s,l&&(this.pendingMin=0,this.itemSizeCacheVersion++);let d=!1,h=0;if(u&&this.scrollOffset!==null){const[c,g]=u,f=this.getMeasurements(),{count:p,getItemKey:S}=this.options;let m=0;for(;m<p&&S(m)!==c;)m++;if(m<p){const w=f[m];if(w){const v=w.start+g;v!==this.scrollOffset&&(h=v-this.scrollOffset,this.scrollOffset=v,d=!0)}}}(d||a)&&(this.pendingScrollAnchor=[d?u[0]:null,d?u[1]:0,a,h])},this.notify=t=>{var n,i;(i=(n=this.options).onChange)==null||i.call(n,this,t)},this.maybeNotify=A(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),t=>{this.notify(t)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}if(this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,r)=>{r&&this._intendedScrollOffset===null&&s===this.scrollOffset||(this._intendedScrollOffset!==null&&Math.abs(s-this._intendedScrollOffset)<1.5&&(s=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=r,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify())})),"addEventListener"in this.scrollElement){const s=this.scrollElement,r=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},u=()=>{this._iosTouching=!1,!(!Q()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};s.addEventListener("touchstart",r,j),s.addEventListener("touchend",u,j),this.unsubs.push(()=>{s.removeEventListener("touchstart",r),s.removeEventListener("touchend",u),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const i=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled){const[s,r,u,a]=i;s!==null&&!u&&(Q()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?a!==0&&(this._iosDeferredAdjustment+=a):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),u&&this.scrollToEnd({behavior:u})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const t=this.getScrollOffset(),n=this.getMaxScrollOffset();if(t<0||t>n)return;const i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(t,{adjustments:this.scrollAdjustments+=i,behavior:void 0})},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.getFurthestMeasurement=(t,n)=>{const i=new Map,s=new Map;for(let r=n-1;r>=0;r--){const u=t[r];if(i.has(u.lane))continue;const a=s.get(u.lane);if(a==null||u.end>a.end?s.set(u.lane,u):u.end<a.end&&i.set(u.lane,!0),i.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((r,u)=>r.end===u.end?r.index-u.index:r.end-u.end)[0]:void 0},this.getMeasurementOptions=A(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(t,n,i,s,r,u,a)=>(this.prevLanes!==void 0&&this.prevLanes!==u&&(this.lanesChangedFlag=!0),this.prevLanes=u,this.pendingMin=null,{count:t,paddingStart:n,scrollMargin:i,getItemKey:s,enabled:r,lanes:u,laneAssignmentMode:a}),{key:!1}),this.getMeasurements=A(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:t,paddingStart:n,scrollMargin:i,getItemKey:s,enabled:r,lanes:u,laneAssignmentMode:a},l)=>{const d=this.itemSizeCache;if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>t)for(const f of this.laneAssignments.keys())f>=t&&this.laneAssignments.delete(f);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(f=>{this.itemSizeCache.set(f.key,f.size)}));const h=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===t&&(this.lanesSettling=!1),u===1){const f=this.options.gap,p=t*2;let S=this._flatMeasurements;if(!S||S.length<p){const v=new Float64Array(p);S&&h>0&&v.set(S.subarray(0,h*2)),S=v,this._flatMeasurements=S}let m;if(h===0)m=n+i;else{const v=h-1;m=S[v*2]+S[v*2+1]+f}for(let v=h;v<t;v++){const F=s(v),_=d.get(F),x=typeof _=="number"?_:this.options.estimateSize(v);S[v*2]=m,S[v*2+1]=x,m+=x+f}const w=wt(t,S,s);return this.measurementsCache=w,w}const c=this.measurementsCache.slice(0,h),g=new Array(u).fill(void 0);for(let f=0;f<h;f++){const p=c[f];p&&(g[p.lane]=f)}for(let f=h;f<t;f++){const p=s(f),S=this.laneAssignments.get(f);let m,w;const v=a==="estimate"||d.has(p);if(S!==void 0&&this.options.lanes>1){m=S;const $=g[m],D=$!==void 0?c[$]:void 0;w=D?D.end+this.options.gap:n+i}else{const $=this.options.lanes===1?c[f-1]:this.getFurthestMeasurement(c,f);w=$?$.end+this.options.gap:n+i,m=$?$.lane:f%this.options.lanes,this.options.lanes>1&&v&&this.laneAssignments.set(f,m)}const F=d.get(p),_=typeof F=="number"?F:this.options.estimateSize(f),x=w+_;c[f]={index:f,start:w,size:_,end:x,key:p,lane:m},g[m]=f}return this.measurementsCache=c,c},{key:!1,debug:()=>this.options.debug}),this.calculateRange=A(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(t,n,i,s)=>this.range=t.length>0&&n>0?At({measurements:t,outerSize:n,scrollOffset:i,lanes:s,flat:s===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=A(()=>{let t=null,n=null;const i=this.calculateRange();return i&&(t=i.startIndex,n=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,t,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,t,n]},(t,n,i,s,r)=>s===null||r===null?[]:t({startIndex:s,endIndex:r,overscan:n,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=t=>{const n=this.options.indexAttribute,i=t.getAttribute(n);return i?parseInt(i,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=t=>{var n;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((n=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:n.index);if(i!==void 0&&this.range){const s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),r=Math.max(0,i-s),u=Math.min(this.options.count-1,i+s);return t>=r&&t<=u}return!0},this.measureElement=t=>{if(!t){this.elementsCache.forEach((r,u)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(u))});return}const n=this.indexFromElement(t),i=this.options.getItemKey(n),s=this.elementsCache.get(i);s!==t&&(s&&this.observer.unobserve(s),this.observer.observe(t),this.elementsCache.set(i,t)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(n)&&this.resizeItem(n,this.options.measureElement(t,void 0,this))},this.resizeItem=(t,n)=>{var i,s;if(t<0||t>=this.options.count)return;let r,u,a;const l=this._flatMeasurements;if(this.options.lanes===1&&l!==null)a=this.options.getItemKey(t),u=l[t*2],r=l[t*2+1];else{const c=this.measurementsCache[t];if(!c)return;a=c.key,u=c.start,r=c.size}const d=this.itemSizeCache.get(a)??r,h=n-d;if(h!==0){const c=this.options.anchorTo==="end"&&((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=c?this.getTotalSize():0,f=((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[t]??{index:t,key:a,start:u,size:r,end:u+r,lane:0},h,this):u<this.getScrollOffset()+this.scrollAdjustments&&(!this.itemSizeCache.has(a)||this.scrollDirection!=="backward"));(this.pendingMin===null||t<this.pendingMin)&&(this.pendingMin=t),this.itemSizeCache.set(a,n),this.itemSizeCacheVersion++,c?this.applyScrollAdjustment(this.getTotalSize()-g):f&&this.applyScrollAdjustment(h),this.notify(!1)}},this.getVirtualItems=A(()=>[this.getVirtualIndexes(),this.getMeasurements()],(t,n)=>{const i=[];for(let s=0,r=t.length;s<r;s++){const u=t[s],a=n[u];i.push(a)}return i},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const n=this.getMeasurements();if(n.length===0)return;const i=this._flatMeasurements,s=this.options.lanes===1&&i!=null,r=Ie(0,n.length-1,s?u=>i[u*2]:u=>he(n[u]).start,t);return he(n[r])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const t=this.scrollElement.document.documentElement;return this.options.horizontal?t.scrollWidth-this.scrollElement.innerWidth:t.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(t=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=t,this.getOffsetForAlignment=(t,n,i=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),r=this.getScrollOffset();n==="auto"&&(n=t>=r+s?"end":"start"),n==="center"?t+=(i-s)/2:n==="end"&&(t-=s);const u=this.getMaxScrollOffset();return Math.max(Math.min(u,t),0)},this.getOffsetForIndex=(t,n="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const i=this.getSize(),s=this.getScrollOffset(),r=this.measurementsCache[t];if(!r)return;if(n==="auto")if(r.end>=s+i-this.options.scrollPaddingEnd)n="end";else if(r.start<=s+this.options.scrollPaddingStart)n="start";else return[s,n];if(n==="end"&&t===this.options.count-1)return[this.getMaxScrollOffset(),n];const u=n==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(u,n,r.size),n]},this.scrollToOffset=(t,{align:n="start",behavior:i="auto"}={})=>{const s=this.getOffsetForAlignment(t,n),r=this.now();this.scrollState={index:null,align:n,behavior:i,startedAt:r,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(t,{align:n="auto",behavior:i="auto"}={})=>{t=Math.max(0,Math.min(t,this.options.count-1));const s=this.getOffsetForIndex(t,n);if(!s)return;const[r,u]=s,a=this.now();this.scrollState={index:t,align:u,behavior:i,startedAt:a,lastTargetOffset:r,stableFrames:0},this._scrollToOffset(r,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(t,{behavior:n="auto"}={})=>{const i=this.getScrollOffset()+t,s=this.now();this.scrollState={index:null,align:"start",behavior:n,startedAt:s,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:n}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:t="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:t});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:t})},this.getTotalSize=()=>{var t;const n=this.getMeasurements();let i;if(n.length===0)i=this.options.paddingStart;else if(this.options.lanes===1){const s=n.length-1,r=this._flatMeasurements;r!=null?i=r[s*2]+r[s*2+1]:i=((t=n[s])==null?void 0:t.end)??0}else{const s=Array(this.options.lanes).fill(null);let r=n.length-1;for(;r>=0&&s.some(u=>u===null);){const u=n[r];s[u.lane]===null&&(s[u.lane]=u.end),r--}i=Math.max(...s.filter(u=>u!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const t=[];if(this.itemSizeCache.size===0)return t;const n=this.getMeasurements();for(const i of n)i&&this.itemSizeCache.has(i.key)&&t.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return t},this._scrollToOffset=(t,{adjustments:n,behavior:i})=>{this._intendedScrollOffset=t+(n??0),this.options.scrollToFn(t,{behavior:i,adjustments:n},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(o)}applyScrollAdjustment(o,t){o!==0&&(Q()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=o:(this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:t}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollAdjustments=0)))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const n=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=n?n[0]:this.scrollState.lastTargetOffset,s=1,r=i!==this.scrollState.lastTargetOffset;if(!r&&_t(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=s){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,r){const u=this.getSize()||600,a=Math.abs(i-this.getScrollOffset()),l=this.scrollState.behavior==="smooth"&&a>u;this.scrollState.lastTargetOffset=i,l||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:l?"smooth":"auto"})}this.scheduleScrollReconcile()}}const Ie=(e,o,t,n)=>{for(;e<=o;){const i=(e+o)/2|0,s=t(i);if(s<n)e=i+1;else if(s>n)o=i-1;else return i}return e>0?e-1:0};function At({measurements:e,outerSize:o,scrollOffset:t,lanes:n,flat:i}){const s=e.length-1,r=i?d=>i[d*2]:d=>e[d].start,u=i?d=>i[d*2]+i[d*2+1]:d=>e[d].end;if(e.length<=n)return{startIndex:0,endIndex:s};let a=Ie(0,s,r,t),l=a;if(n===1)for(;l<s&&u(l)<t+o;)l++;else if(n>1){const d=Array(n).fill(0);for(;l<s&&d.some(c=>c<t+o);){const c=e[l];d[c.lane]=c.end,l++}const h=Array(n).fill(t+o);for(;a>=0&&h.some(c=>c>=t);){const c=e[a];h[c.lane]=c.start,a--}a=Math.max(0,a-a%n),l=Math.min(s,l+(n-1-l%n))}return{startIndex:a,endIndex:l}}const Z=typeof document<"u"?z.useLayoutEffect:z.useEffect;function Dt({useFlushSync:e=!0,directDomUpdates:o=!1,directDomUpdatesMode:t="transform",...n}){const i=z.useReducer(l=>l+1,0)[1],s=z.useRef({enabled:o,mode:t,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});s.current.enabled=o,s.current.mode=t;const r=l=>{const d=s.current;if(!d.enabled||!d.container)return;const h=l.getTotalSize();if(h!==d.lastSize){d.lastSize=h;const m=l.options.horizontal?"width":"height";d.container.style[m]=`${h}px`}const c=!!l.options.horizontal,g=d.mode==="transform",f=c?"left":"top",p=l.options.scrollMargin,S=l.getVirtualItems();for(const m of S){const w=m.start-p,v=l.elementsCache.get(m.key);v&&d.lastPositions.get(v)!==w&&(d.lastPositions.set(v,w),g?v.style.transform=c?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:v.style[f]=`${w}px`)}},u={...n,onChange:(l,d)=>{var h;const c=s.current;let g=!0;if(c.enabled){r(l);const f=l.range,p=c.prevRange;g=!p||p.isScrolling!==l.isScrolling||p.startIndex!==f?.startIndex||p.endIndex!==f?.endIndex,g&&(c.prevRange=f?{startIndex:f.startIndex,endIndex:f.endIndex,isScrolling:l.isScrolling}:null)}g&&(e&&d?me.flushSync(i):i()),(h=n.onChange)==null||h.call(n,l,d)}},[a]=z.useState(()=>{const l=new zt(u);return Object.assign(l,{containerRef:d=>{const h=s.current;if(h.container=d,h.lastSize=null,d&&h.enabled){const c=l.getTotalSize();h.lastSize=c;const g=l.options.horizontal?"width":"height";d.style[g]=`${c}px`}}})});return a.setOptions(u),Z(()=>a._didMount(),[]),Z(()=>a._willUpdate()),Z(()=>{r(a)}),a}function jt(e){return Dt({observeElementRect:It,observeElementOffset:$t,scrollToFn:Pt,...e})}export{Pe as a,jt as b,kt as c,Ht as d,Gt as g,me as r,Bt as u,Lt as v};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en" class="dark">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
7
|
+
<title>PM2 Orbit</title>
|
|
8
|
+
<style>
|
|
9
|
+
@font-face {
|
|
10
|
+
font-family: 'Exo';
|
|
11
|
+
font-style: normal;
|
|
12
|
+
font-weight: 300;
|
|
13
|
+
font-display: swap;
|
|
14
|
+
src: url('/fonts/Exo-300.woff2') format('woff2');
|
|
15
|
+
}
|
|
16
|
+
@font-face {
|
|
17
|
+
font-family: 'Exo';
|
|
18
|
+
font-style: normal;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
font-display: swap;
|
|
21
|
+
src: url('/fonts/Exo-400.woff2') format('woff2');
|
|
22
|
+
}
|
|
23
|
+
@font-face {
|
|
24
|
+
font-family: 'Exo';
|
|
25
|
+
font-style: normal;
|
|
26
|
+
font-weight: 600;
|
|
27
|
+
font-display: swap;
|
|
28
|
+
src: url('/fonts/Exo-600.woff2') format('woff2');
|
|
29
|
+
}
|
|
30
|
+
@font-face {
|
|
31
|
+
font-family: 'JetBrains Mono';
|
|
32
|
+
font-style: normal;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
font-display: swap;
|
|
35
|
+
src: url('/fonts/JetBrainsMono-400.woff2') format('woff2');
|
|
36
|
+
}
|
|
37
|
+
</style>
|
|
38
|
+
<script>
|
|
39
|
+
(function() {
|
|
40
|
+
try {
|
|
41
|
+
var stored = localStorage.getItem('pm2-orbit-theme');
|
|
42
|
+
var theme = stored || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
43
|
+
if (theme === 'dark' || (theme === 'system' && matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
44
|
+
document.documentElement.classList.add('dark');
|
|
45
|
+
} else {
|
|
46
|
+
document.documentElement.classList.remove('dark');
|
|
47
|
+
document.documentElement.classList.add('light');
|
|
48
|
+
}
|
|
49
|
+
} catch (_) {}
|
|
50
|
+
})();
|
|
51
|
+
</script>
|
|
52
|
+
<script type="module" crossorigin src="/assets/index-pRE_kpC2.js"></script>
|
|
53
|
+
<link rel="modulepreload" crossorigin href="/assets/icons-DvbqpVzZ.js">
|
|
54
|
+
<link rel="modulepreload" crossorigin href="/assets/table-virtual-Oq2FLz9e.js">
|
|
55
|
+
<link rel="modulepreload" crossorigin href="/assets/cmdk-D6Y8xHyf.js">
|
|
56
|
+
<link rel="modulepreload" crossorigin href="/assets/charts-U3JqdBjU.js">
|
|
57
|
+
<link rel="stylesheet" crossorigin href="/assets/index-OYqKkh7V.css">
|
|
58
|
+
</head>
|
|
59
|
+
<body>
|
|
60
|
+
<div id="root"></div>
|
|
61
|
+
</body>
|
|
62
|
+
</html>
|
package/package.json
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pm2-orbit",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist/",
|
|
6
|
+
"dist-ui/",
|
|
7
|
+
"bin/"
|
|
8
|
+
],
|
|
9
|
+
"description": "High-performance PM2 monitoring dashboard — event-driven, 1000+ processes, < 150KB",
|
|
10
|
+
"main": "dist/server.js",
|
|
11
|
+
"bin": {
|
|
12
|
+
"pm2-orbit": "bin/pm2-orbit.js"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"dev:ui": "cd ui && vite",
|
|
16
|
+
"dev:server": "tsx watch src/server.ts",
|
|
17
|
+
"dev": "concurrently -k -n ui,server -c blue,green \"npm:dev:ui\" \"npm:dev:server\"",
|
|
18
|
+
"build": "node build.js",
|
|
19
|
+
"start": "node dist/server.js",
|
|
20
|
+
"lint": "tsc --noEmit",
|
|
21
|
+
"typecheck": "tsc --noEmit && cd ui && tsc --noEmit",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"test:e2e": "vitest --config vitest.e2e.config.ts",
|
|
25
|
+
"prepare": "husky",
|
|
26
|
+
"prepublishOnly": "npm run build",
|
|
27
|
+
"postinstall": "node -e \"try{require.resolve('pm2')}catch{console.log('\\n ℹ Install pm2 for process monitoring: npm install -g pm2\\n')}\""
|
|
28
|
+
},
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@fastify/compress": "^7",
|
|
34
|
+
"@fastify/cors": "^10",
|
|
35
|
+
"@fastify/helmet": "^11",
|
|
36
|
+
"@fastify/rate-limit": "^10",
|
|
37
|
+
"@fastify/static": "^9.1.3",
|
|
38
|
+
"fastify": "^5",
|
|
39
|
+
"mri": "^1.2",
|
|
40
|
+
"open": "^10",
|
|
41
|
+
"systeminformation": "^5.31.11",
|
|
42
|
+
"ws": "^8"
|
|
43
|
+
},
|
|
44
|
+
"optionalDependencies": {
|
|
45
|
+
"better-sqlite3": "^11",
|
|
46
|
+
"nodemailer": "^9.0.1",
|
|
47
|
+
"pm2": "^7"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@tailwindcss/postcss": "^4",
|
|
51
|
+
"@testing-library/react": "^14",
|
|
52
|
+
"@types/node": "^26.0.1",
|
|
53
|
+
"@types/nodemailer": "^8.0.1",
|
|
54
|
+
"@types/ws": "^8.18.1",
|
|
55
|
+
"@vitejs/plugin-react": "^4",
|
|
56
|
+
"autoprefixer": "^10",
|
|
57
|
+
"concurrently": "^8",
|
|
58
|
+
"esbuild": "^0.25",
|
|
59
|
+
"husky": "^9",
|
|
60
|
+
"lint-staged": "^15",
|
|
61
|
+
"postcss": "^8",
|
|
62
|
+
"tailwindcss": "^4",
|
|
63
|
+
"tsx": "^4",
|
|
64
|
+
"typescript": "^5",
|
|
65
|
+
"vite": "^6",
|
|
66
|
+
"vitest": "^3"
|
|
67
|
+
},
|
|
68
|
+
"keywords": [
|
|
69
|
+
"pm2",
|
|
70
|
+
"monitoring",
|
|
71
|
+
"dashboard",
|
|
72
|
+
"devops",
|
|
73
|
+
"nodejs",
|
|
74
|
+
"react"
|
|
75
|
+
],
|
|
76
|
+
"license": "MIT"
|
|
77
|
+
}
|