simple-table-core 0.7.84 → 0.7.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,2 +1,2 @@
1
- import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import{useState as t,useRef as o,useCallback as i,useEffect as a,useMemo as d,createContext as c,useContext as l,forwardRef as s,useLayoutEffect as u,Fragment as h,useReducer as f,createRef as v}from"react";var g=function(){return g=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},g.apply(this,arguments)};function m(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{c(t.next(e))}catch(e){i(e)}}function d(e){try{c(t.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,d)}c((t=t.apply(e,n||[])).next())}))}function w(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=d(0),a.throw=d(1),a.return=d(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function d(d){return function(c){return function(d){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,d[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&d[0]?t.return:d[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,d[1])).done)return o;switch(t=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return i.label++,{value:d[1],done:!1};case 5:i.label++,t=d[1],d=[0];continue;case 7:d=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==d[0]&&2!==d[0])){i=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){i.label=d[1];break}if(6===d[0]&&i.label<o[1]){i.label=o[1],o=d;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(d);break}o[2]&&i.ops.pop(),i.trys.pop();continue}d=n.call(e,i)}catch(e){d=[6,e],t=0}finally{r=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([d,c])}}}function p(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},I=function(r){var o=r.currentPage,i=r.hideFooter,a=r.nextIcon,d=r.onPageChange,c=r.onNextPage,l=r.prevIcon,s=r.shouldPaginate,u=r.totalPages,h=t(!0),f=h[0],v=h[1],p=!(o>1),C=!(o<u)&&!c||!f&&o===u;return i||!s?null:e("div",g({className:"st-footer"},{children:[n("button",g({className:"st-next-prev-btn ".concat(p?"disabled":""),onClick:function(){var e=o-1;e>=1&&d(e)},disabled:p},{children:l})),n("button",g({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){return m(void 0,void 0,void 0,(function(){var e,n;return w(this,(function(r){switch(r.label){case 0:return e=o===u,n=o+1,c&&e?[4,c(o)]:[3,2];case 1:if(!r.sent())return v(!1),[2];r.label=2;case 2:return(n<=u||c)&&d(n),[2]}}))}))},disabled:C},{children:a})),Array.from({length:u},(function(e,r){return n("button",g({onClick:function(){var e;(e=r+1)>=1&&e<=u&&d(e)},className:"st-page-btn ".concat(o===r+1?"active":"")},{children:r+1}),r)}))]}))},x=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},b=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},R=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},y=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},M=function(e){return e.position*(e.rowHeight+1)-1},E=function(e){return e.position*(e.rowHeight+1)},W=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},S=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},D=function(e){var n=e.rowId,r=e.accessor;return"".concat(n,"-").concat(r)},H=function(r){var t=r.value,o=r.onBlur,i=r.onChange;return e("select",g({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",g({value:"true"},{children:"True"})),n("option",g({value:"false"},{children:"False"}))]}))},k=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},L=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},N=function(e){var t=e.onChange,o=e.setIsEditing,i=e.value,a=function(e){null==t||t(e)},d=function(){o(!1)};return n(r,{children:"string"==typeof i||null==i?n(k,{defaultValue:i,onBlur:d,onChange:a}):"boolean"==typeof i?n(H,{onBlur:d,onChange:a,value:i}):"number"==typeof i?n(L,{defaultValue:i,onBlur:d,onChange:a}):null})},B=0,T=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===B||o-B>=t)&&(B=o,n(r))}},P=Date.now(),O={screenX:0,screenY:0},F=function(e,n,r){void 0===r&&(r=[]);for(var t=0;t<e.length;t++){var o=e[t];if(o.accessor===n)return p(p([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=F(o.children,n,p(p([],r,!0),[t],!1));if(i)return i}}return null};var A=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,d=e.hoveredHeaderRef,c=e.onColumnOrderChange,l=e.onTableHeaderDragEnd,s=(n=i.current,r=o(n),a((function(){JSON.stringify(r.current)!==JSON.stringify(n)&&(r.current=n)}),[n]),r.current);return{handleDragStart:function(e){t.current=e,P=Date.now()},handleDragOver:function(e){var n,r,o=e.event,a=e.hoveredHeader;if(o.preventDefault(),i.current){var c=o.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=o.screenX,h=o.screenY,f=Math.sqrt(Math.pow(u-O.screenX,2)+Math.pow(h-O.screenY,2));d.current=a;var v=i.current,g=F(v,(null===(n=t.current)||void 0===n?void 0:n.accessor)||""),m=F(v,a.accessor);if(g&&m){var w=g.length,p=m.length,C=m;if(w!==p){var I=p-w;I>0&&(C=m.slice(0,-I))}var x=function(e,n,r){var t=JSON.parse(JSON.stringify(e)),o=!1;function i(e,n){for(var r=e,t=0;t<n.length-1;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;i<n.length-1;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var d=i(t,n);return a(t,n,i(t,r)),a(t,r,d),{newHeaders:t,emergencyBreak:o}}(v,g,C),b=x.newHeaders,R=x.emergencyBreak;if(!(c||a.accessor===(null===(r=t.current)||void 0===r?void 0:r.accessor)||null===t.current||f<10||0===g.length||0===C.length||JSON.stringify(b)===JSON.stringify(i.current)||R)){var y=Date.now();JSON.stringify(b)===JSON.stringify(s)&&(y-P<1500||f<40)||(P=y,O={screenX:u,screenY:h},l(b))}}}},handleDragEnd:function(){t.current=null,d.current=null,null==c||c(i.current)}}},z=c(void 0),j=function(e){var r=e.children,t=e.value;return n(z.Provider,g({value:t},{children:r}))},U=function(){var e=l(z);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},J=s((function(r,d){var c,l,s=r.borderClass,u=r.colIndex,h=r.header,f=r.isHighlighted,v=r.isInitialFocused,m=r.onExpandRowClick,w=r.rowIndex,p=r.visibleRow,C=U(),I=C.cellRegistry,x=C.cellUpdateFlash,b=C.collapseIcon,R=C.draggedHeaderRef,y=C.expandIcon,M=C.handleMouseDown,E=C.handleMouseOver,S=C.headersRef,H=C.hoveredHeaderRef,k=C.onCellEdit,L=C.onTableHeaderDragEnd,B=p.depth,P=p.row,O=t(P.rowData[h.accessor]),F=O[0],z=O[1],j=t(!1),J=j[0],V=j[1],K=t(!1),X=K[0],q=K[1],G=o(null),Y=A({draggedHeaderRef:R,headersRef:S,hoveredHeaderRef:H,onTableHeaderDragEnd:L}).handleDragOver,$=T(),_="cell-".concat(w,"-").concat(u),Q=D({rowId:P.rowMeta.rowId,accessor:h.accessor});a((function(){if(I){var e="".concat(P.rowMeta.rowId,"-").concat(h.accessor);return I.set(e,{updateContent:function(e){F!==e?(z(e),x&&(q(!0),G.current&&clearTimeout(G.current),G.current=setTimeout((function(){q(!1)}),800))):z(e)}}),function(){I.delete(e),G.current&&clearTimeout(G.current)}}}),[I,x,P.rowMeta.rowId,h.accessor,F]),a((function(){if(X){var e=setTimeout((function(){q(!1)}),850);return function(){return clearTimeout(e)}}}),[X]),a((function(){z(P.rowData[h.accessor])}),[P.rowData,h.accessor]);var Z=Boolean(null===(l=null===(c=P.rowMeta)||void 0===c?void 0:c.children)||void 0===l?void 0:l.length),ee=Boolean(null==h?void 0:h.isEditable),ne="st-cell ".concat(B>0&&h.expandable?"st-cell-depth-".concat(B):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(ee?"clickable":""," ").concat(X?"st-cell-updating":""),re=i((function(e){z(e),null==k||k({accessor:h.accessor,newValue:e,row:P})}),[h.accessor,k,P]);return J?n("div",g({className:"st-cell-editing",id:W({accessor:h.accessor,rowIndex:w+1})},{children:n(N,{onChange:re,setIsEditing:V,value:F})})):e("div",g({className:ne,id:_,onDoubleClick:function(){return h.isEditable&&V(!0)},onMouseDown:function(){return M({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onMouseOver:function(){return E({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onDragOver:function(e){return $({callback:Y,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||J||(e.preventDefault(),V(!0))},ref:d,"data-row-index":w,"data-col-index":u,"data-row-id":P.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&Z?P.rowMeta.isExpanded?n("div",g({className:"st-sort-icon-container",onClick:function(){return m(P.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:b})):n("div",g({className:"st-sort-icon-container",onClick:function(){return m(P.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):null,n("span",g({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"")},{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:P}):F}))]}),Q)})),V=function(e){var t=e.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(e,["children"]);return U().allowAnimations?n(K,g({},o,{children:t})):n(r,{children:t})},K=function(e){var i=e.children,d=e.isBody,c=e.pauseAnimation,l=e.rowIndex,s=o(!1),h=U(),f=h.draggedHeaderRef,v=h.headersRef,g=h.mainBodyRef,m=h.shouldPaginate,w=t({}),p=w[0],C=w[1],I=o({}),x=v.current;return u((function(){if(x){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(W({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),d=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=d}}})),o}({currentHeaders:x,draggedHeaderRef:f,rowIndex:l});JSON.stringify(e)!==JSON.stringify(p)&&(I.current=p,C(e))}}),[p,x,f,d,l]),u((function(){var e=g.current,n=function(){s.current=!0},r=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[f,g]),a((function(){c||s.current||Object.keys(I.current).length&&x&&x.forEach((function(e){var n=document.getElementById(W({accessor:e.accessor,rowIndex:l}));if(n){var r=I.current[e.accessor],t=p[e.accessor];if(r&&t){var o=r.left-t.left,i=m?0:r.top-t.top,a=Math.abs(o),d=Math.abs(i);(a>10||d>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[p,x,d,c,I,l,m]),n(r,{children:i})},X=function(e){var r=e.columnIndices,t=e.headers,o=e.hiddenColumns,i=e.isWidthDragging,a=e.onExpandRowClick,d=e.pinned,c=e.rowIndex,l=e.rowIndices,s=e.visibleRow,u=t.filter((function(e){return S({hiddenColumns:o,header:e,pinned:d})}));return n(V,g({isBody:!0,pauseAnimation:i,rowIndex:c+1},{children:u.map((function(e){return n(q,{columnIndices:r,header:e,headers:t,hiddenColumns:o,onExpandRowClick:a,pinned:d,rowIndex:c,rowIndices:l,visibleRow:s},W({accessor:e.accessor,rowIndex:c+1}))}))}))},q=function(e){var r=e.columnIndices,t=e.header,o=e.headers,i=e.hiddenColumns,a=e.onExpandRowClick,d=e.pinned,c=e.rowIndex,l=e.rowIndices,s=e.visibleRow,u=r[t.accessor],f=U(),v=f.getBorderClass,g=f.isSelected,m=f.isInitialFocusedCell;if(t.children){var w=t.children.filter((function(e){return S({hiddenColumns:i,header:e,pinned:d})}));return n(h,{children:w.map((function(e){return n(q,{columnIndices:r,header:e,headers:o,hiddenColumns:i,onExpandRowClick:a,pinned:d,rowIndex:c,rowIndices:l,visibleRow:s},W({accessor:e.accessor,rowIndex:c+1}))}))})}var p={rowIndex:c,colIndex:u,rowId:s.row.rowMeta.rowId},C=v(p),I=g(p),x=m(p);return n(J,{borderClass:C,colIndex:u,header:t,isHighlighted:I,isInitialFocused:x,onExpandRowClick:a,rowIndex:c,visibleRow:s},W({accessor:t.accessor,rowIndex:c+1}))},G=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.headers,i=e.hiddenColumns,a=e.index,d=e.isWidthDragging,c=e.onExpandRowClick,l=e.pinned,s=e.rowHeight,u=e.rowIndices,h=e.visibleRow,f=h.position;return n("div",g({className:"st-row ".concat(f%2==0?"even":"odd"),style:{gridTemplateColumns:t,top:E({position:f,rowHeight:s}),height:"".concat(s,"px")}},{children:n(X,{columnIndices:r,headers:o,hiddenColumns:i,isWidthDragging:d,onExpandRowClick:c,pinned:l,rowIndex:a,rowIndices:u,visibleRow:h},a)}))},Y=function(e){var r=e.displayStrongBorder,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",g({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:M({position:t,rowHeight:o}),minWidth:"100%"}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},$=function(r){var t=r.columnIndices,o=r.headers,i=r.hiddenColumns,a=r.isWidthDragging,d=r.onExpandRowClick,c=r.pinned,l=r.ref,s=r.rowHeight,u=r.rowIndices,f=r.templateColumns,v=r.totalHeight,m=r.visibleRows,w=r.width,p=c?"st-body-pinned-".concat(c):"st-body-main";return n("div",g({className:p,ref:l,style:g({position:"relative",height:"".concat(v,"px"),width:w},!c&&{flexGrow:1})},{children:m.map((function(r,l){var v,g,w=m[l-1],p=Boolean((null==w?void 0:w.depth)!==(null==r?void 0:r.depth)&&(null===(g=null===(v=null==r?void 0:r.row.rowMeta)||void 0===v?void 0:v.children)||void 0===g?void 0:g.length)&&0===r.depth);return e(h,{children:[0!==l&&n(Y,{displayStrongBorder:p,position:r.position,rowHeight:s,templateColumns:f}),n(G,{columnIndices:t,gridTemplateColumns:f,headers:o,hiddenColumns:i,index:l,isWidthDragging:a,onExpandRowClick:d,pinned:c,rowHeight:s,rowIndices:u,visibleRow:r})]},r.position)}))}))};function _(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,d=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return S({hiddenColumns:r,header:e})})).forEach((function(e,n){d(e,0===n)}))};return t.forEach((function(e,n){d(e,0===n)})),n.current.filter((function(e){return!e.pinned&&S({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;d(e,r)})),o.forEach((function(e){d(e,!1)})),i}var Q=function(r){var i=r.flattenedRows,c=r.headerContainerRef,l=r.isWidthDragging,s=r.mainTemplateColumns,u=r.pinnedLeftColumns,h=r.pinnedLeftTemplateColumns,f=r.pinnedLeftWidth,v=r.pinnedRightColumns,m=r.pinnedRightTemplateColumns,w=r.pinnedRightWidth,p=r.setFlattenedRows,C=r.setScrollTop,I=r.visibleRows,x=U(),b=x.headersRef,R=x.hiddenColumns,y=x.mainBodyRef,M=x.rowHeight,E=x.scrollbarWidth,W=x.tableBodyContainerRef;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),d=i[0],c=i[1];a((function(){var e=null==n?void 0:n.current;if(d&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,d,o]),a((function(){var e=null==n?void 0:n.current,t=null==r?void 0:r.current;if(t&&e){var o=function(){if(t){var e=t.scrollHeight>t.clientHeight;c(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:c,mainSectionRef:W,scrollbarWidth:E});var S,D,H=o(null),k=(S=0,(D=function(e){e.forEach((function(e){S+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&D(e.rowMeta.children)}))})(i),S)*(M+1)-1,L=d((function(){return _({headersRef:b,hiddenColumns:R,pinnedLeftColumns:u,pinnedRightColumns:v})}),[b,R,u,v]),N=d((function(){var e={};return I.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[I]),B=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};p((function(e){return e.map(n)}))},T={headerContainerRef:c,headers:b.current,hiddenColumns:R,isWidthDragging:l,rowHeight:M,visibleRows:I,columnIndices:L,rowIndices:N};return e("div",g({className:"st-body-container",ref:W,onScroll:function(e){var n=e.currentTarget.scrollTop;H.current&&cancelAnimationFrame(H.current),H.current=requestAnimationFrame((function(){C(n)}))}},{children:[u.length>0&&n($,g({},T,{onExpandRowClick:B,pinned:"left",templateColumns:h,totalHeight:k,width:f})),n($,g({},T,{ref:y,onExpandRowClick:B,templateColumns:s,totalHeight:k})),v.length>0&&n($,g({},T,{onExpandRowClick:B,pinned:"right",templateColumns:m,totalHeight:k,width:w}))]}))},Z=function(e,n){a((function(){if(e.current){var r=e.current,t=function(){var e,t=null==r?void 0:r.scrollLeft;void 0!==t&&(null===(e=n.current)||void 0===e||e.scrollTo(t,0))};return r.addEventListener("scroll",t),function(){null==r||r.removeEventListener("scroll",t)}}}),[e,n])},ee=function(e){return void 0===e&&(e=0),e?e+1:0},ne=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return ne(e)})):[e]},re=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(W({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},te=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(W({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){te(e)}))},oe=function(e){return"number"==typeof e.minWidth?e.minWidth:40},ie=function(e){var n=e.header,r=e.headers,t=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,d=function(e){var n=e.header,r=e.headers,t=e.newWidth,o=n.pinned,i=0;return r.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=t:ne(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=t:i+=re(e))})))})),n.pinned?ee(i):i}({header:n,headers:r,newWidth:t});"left"===n.pinned?i(d):"right"===n.pinned?a(d):n.pinned||o(d)},ae=function(e){var n=e.event,r=e.forceUpdate,t=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,d=e.setIsWidthDragging,c=e.setMainBodyWidth,l=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,u=e.startWidth;d(!0),n.preventDefault();var h=n.clientX;if(i&&!i.hide){var f=oe(i),v=t-o>1,g=v?ne(i):[i],m=function(e){var n="right"===i.pinned?h-e.clientX:e.clientX-h;if(v&&g.length>1)de({delta:n,header:i,headersRef:a,leafHeaders:g,minWidth:f,setMainBodyWidth:c,setPinnedLeftWidth:l,setPinnedRightWidth:s,startWidth:u});else{var t=Math.max(u+n,f);i.width=t,ie({header:i,headers:a.current,newWidth:t,setMainBodyWidth:c,setPinnedLeftWidth:l,setPinnedRightWidth:s})}a.current.forEach((function(e){te(e)})),r()},w=function(){document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",w),d(!1)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",w)}},de=function(e){var n=e.delta,r=e.header,t=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,d=e.setPinnedLeftWidth,c=e.setPinnedRightWidth,l=e.startWidth,s=o.reduce((function(e,n){return Math.min(e,oe(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(l+n,s);ie({header:r,headers:t.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:d,setPinnedRightWidth:c});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,r=f*(n/u),t=Math.max(n+r,i);e.width=t}))},ce=s((function(r,t){var o,i,d=r.colIndex,c=r.forceHeadersUpdate,l=r.gridColumnEnd,s=r.gridColumnStart,u=r.gridRowEnd,h=r.gridRowStart,f=r.header,v=r.reverse,m=r.sort,w=U(),C=w.columnReordering,I=w.columnResizing,x=w.draggedHeaderRef,b=w.forceUpdate,R=w.headersRef,y=w.hoveredHeaderRef,M=w.onColumnOrderChange,E=w.onSort,S=w.onTableHeaderDragEnd,D=w.rowHeight,H=w.selectColumns,k=w.selectableColumns,L=w.setInitialFocusedCell,N=w.setIsWidthDragging,B=w.setMainBodyWidth,P=w.setPinnedLeftWidth,O=w.setPinnedRightWidth,F=w.setSelectedCells,z=w.setSelectedColumns,j=w.sortDownIcon,J=w.sortUpIcon,V=Boolean(null==f?void 0:f.isSortable),K="st-header-cell ".concat(f.accessor===(null===(o=y.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=x.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(V?"clickable":""," ").concat(C&&!V?"columnReordering":""," ").concat("right"===(null==f?void 0:f.align)?"right-aligned":"center"===(null==f?void 0:f.align)?"center-aligned":""," ").concat(f.children?"parent":""),X=A({draggedHeaderRef:x,headersRef:R,hoveredHeaderRef:y,onColumnOrderChange:M,onTableHeaderDragEnd:S}),q=X.handleDragStart,G=X.handleDragEnd,Y=X.handleDragOver,$=T(),_=function(e){var n=e.event,r=e.header;if(k){var t=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var d=a[i];o=t(d,o)}return o};return t(e,n),r}(r,d);return n.shiftKey&&H?z((function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort((function(e,n){return e-n})),o=r[0],i=Math.abs(n-o);r.forEach((function(e){var r=Math.abs(n-e);r<i&&(i=r,o=e)}));var a,d,c,l,s=p(p([],(a=o,d=n,c=Math.min(a,d),l=Math.max(a,d),Array.from({length:l-c+1},(function(e,n){return c+n}))),!0),t,!0);return new Set(p(p([],Array.from(e),!0),s,!0))})):H&&H(t),F(new Set),void L(null)}r.isSortable&&E(d,r.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!f)return null;var Q=I&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;$({callback:ae,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:l,gridColumnStart:s,header:f,headersRef:R,setIsWidthDragging:N,setMainBodyWidth:B,setPinnedLeftWidth:P,setPinnedRightWidth:O,startWidth:"object"==typeof t&&null!==t&&"current"in t?null===(n=t.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),Z=m&&m.key.accessor===f.accessor&&e("div",g({className:"st-sort-icon-container",onClick:function(e){return _({event:e,header:f})}},{children:["ascending"===m.direction&&J&&J,"descending"===m.direction&&j&&j]}));return e("div",g({className:K,id:W({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){$({callback:Y,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:t,style:g(g({gridRowStart:h,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:l},l-s>1?{}:{width:f.width}),u-h>1?{}:{height:D})},{children:[v&&Q,e("div",g({className:"st-header-label ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":""),draggable:C&&!f.disableReorder,onClick:function(e){return _({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),G(),c()},onDragStart:function(e){C&&f&&function(e){q(e)}(f)}},{children:["right"===f.align&&Z,null==f?void 0:f.label,"right"!==f.align&&Z]})),!v&&Q]}))})),le=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.handleScroll,i=e.headersRef,a=e.hiddenColumns,c=e.maxDepth,l=e.pinned,s=e.sectionRef,u=e.sort,h=f((function(e){return e+1}),0)[1],m=d((function(){var e=[],n=1,t=function(o,i,d){var s,u;if(void 0===d&&(d=!1),!S({hiddenColumns:a,header:o,pinned:l}))return 0;d||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return S({hiddenColumns:a,header:e,pinned:l})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,g=i,m=h>0?i+1:c+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:g,gridRowEnd:m,colIndex:r[o.accessor]}),o.children){var w=!0;o.children.forEach((function(e){S({hiddenColumns:a,header:e,pinned:l})&&(t(e,i+1,w),w=!1)}))}return v-f},o=i.current.filter((function(e){return S({hiddenColumns:a,header:e,pinned:l})})),d=!0;return o.forEach((function(e){t(e,1,d),d=!1})),e}),[i,a,c,l,r]);return n("div",g({className:"st-header-".concat(l?"pinned-".concat(l):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:t,display:"grid",position:"relative"}},{children:n(V,g({rowIndex:0},{children:m.map((function(e){return n(ce,{colIndex:e.colIndex,forceHeadersUpdate:h,gridColumnEnd:e.gridColumnEnd,gridColumnStart:e.gridColumnStart,gridRowEnd:e.gridRowEnd,gridRowStart:e.gridRowStart,header:e.header,ref:v(),reverse:"right"===l,sort:u},e.header.accessor)}))}))}))},se=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(se)):1},ue=function(r){var t=r.centerHeaderRef,o=r.headerContainerRef,i=r.headersRef,a=r.hiddenColumns,c=r.mainTemplateColumns,l=r.pinnedLeftColumns,s=r.pinnedLeftTemplateColumns,h=r.pinnedRightColumns,f=r.pinnedRightTemplateColumns,v=r.sort,m=U(),w=m.mainBodyRef,p=m.pinnedLeftRef,C=m.pinnedRightRef,I=m.setPinnedLeftWidth,x=m.setPinnedRightWidth;Z(w,t);var b=d((function(){return _({headersRef:i,hiddenColumns:a,pinnedLeftColumns:l,pinnedRightColumns:h})}),[i,a,l,h]),R=d((function(){var e=i.current,n=0;return e.forEach((function(e){if(S({hiddenColumns:a,header:e})){var r=se(e);n=Math.max(n,r)}})),{maxDepth:n}}),[i,a]).maxDepth;return u((function(){var e,n;I(ee(null===(e=p.current)||void 0===e?void 0:e.clientWidth)),x(ee(null===(n=C.current)||void 0===n?void 0:n.clientWidth))}),[p,C,I,x]),e("div",g({className:"st-header-container",ref:o},{children:[l.length>0&&n(le,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:R,pinned:"left",sectionRef:p,sort:v}),n(le,{columnIndices:b,gridTemplateColumns:c,handleScroll:function(e){var n,r,o=null===(n=t.current)||void 0===n?void 0:n.scrollLeft;void 0!==o&&(null===(r=w.current)||void 0===r||r.scrollTo(o,0))},headersRef:i,hiddenColumns:a,maxDepth:R,sectionRef:t,sort:v}),h.length>0&&n(le,{columnIndices:b,gridTemplateColumns:f,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:R,pinned:"right",sectionRef:C,sort:v})]}))},he=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(n,", ").concat(r,")"):"max(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},fe=function(r){var t=r.flattenedRows,i=r.isWidthDragging,a=r.pinnedLeftWidth,c=r.pinnedRightWidth,l=r.setFlattenedRows,s=r.setScrollTop,u=r.sort,h=r.visibleRows,f=U(),v=f.editColumns,m=f.headersRef,w=f.hiddenColumns,p=o(null),C=o(null),I=m.current.filter((function(e){return!e.pinned})),x=m.current.filter((function(e){return"left"===e.pinned})),b=m.current.filter((function(e){return"right"===e.pinned})),R=d((function(){return he({headers:x,hiddenColumns:w})}),[x,w]),y=d((function(){return he({headers:I,hiddenColumns:w})}),[I,w]),M=d((function(){return he({headers:b,hiddenColumns:w})}),[b,w]),E={flattenedRows:t,headerContainerRef:p,isWidthDragging:i,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftTemplateColumns:R,pinnedLeftWidth:a,pinnedRightColumns:b,pinnedRightTemplateColumns:M,pinnedRightWidth:c,setFlattenedRows:l,setScrollTop:s,visibleRows:h};return e("div",g({className:"st-content",style:{width:v?"calc(100% - 27.5px)":"100%"}},{children:[n(ue,g({},{centerHeaderRef:C,headerContainerRef:p,headersRef:m,hiddenColumns:w,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightTemplateColumns:M,sort:u})),n(Q,g({},E))]}))},ve=function(i){var d,c,l=i.mainBodyWidth,s=i.mainBodyRef,u=i.pinnedLeftWidth,h=i.pinnedRightWidth,f=i.setMainBodyWidth,v=i.tableBodyContainerRef,m=U().editColumns,w=t(!1),p=w[0],C=w[1],I=o(null),x=v.current&&v.current.scrollHeight>v.current.clientHeight,b=m?28:0,R=(m?h+1:h)+(v.current&&x?v.current.offsetWidth-v.current.clientWidth:0);return Z(s,I),a((function(){!function(){if(s.current){var e=s.current.scrollWidth;f(e)}}()}),[s,f]),a((function(){setTimeout((function(){!function(){if(s.current){var e=s.current.clientWidth;C(l>e)}}()}),1)}),[s,l,f]),p?e("div",g({className:"st-horizontal-scrollbar-container"},{children:[u>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(d=I.current)||void 0===d?void 0:d.offsetHeight}}),l>0&&n("div",g({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&s.current&&s.current.scrollTo({left:n,behavior:"auto"})},ref:I,style:{flexGrow:1}},{children:n("div",{style:{width:l,height:".3px"}})})),h>0&&n(r,{children:n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:R,height:null===(c=I.current)||void 0===c?void 0:c.offsetHeight}})}),b>0&&n("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},ge={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return ge.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?ge.string(e,n,r):"number"==typeof e&&"number"==typeof n?ge.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?ge.boolean(e,n,r):ge.string(String(e),String(n),r)}},me=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return ge.number(i,a,t)}return"date"===r?ge.date(String(e),String(n),t):"boolean"===r?ge.boolean(Boolean(e),Boolean(n),t):"enum"===r?ge.enum(String(e),String(n),t):ge.string(String(e),String(n),t)},we=function(e,n,r){var t,o=(null===(t=n.key)||void 0===t?void 0:t.type)||"string",i=n.direction,a=new Map,d=new Map,c="";e.forEach((function(e){var r;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var t=(e.rowData.sector||"group_".concat(a.size)).toString();c=t,d.set(c,e),a.has(c)||a.set(c,[])}else if(c){var o=a.get(c)||[];o.push(e),a.set(c,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(r=a.get(i))||void 0===r||r.push(e)}}));var l=[];return a.forEach((function(e,t){if(d.has(t)){var a=d.get(t);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=pe(a.rowMeta.children,n,r)),l.push(a)}var c=p([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],d=r.rowData[t];return me(a,d,o,i)}));l.push.apply(l,c.map((function(e){var t=g({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var o=pe(t.rowMeta.children,n,r);t.rowMeta=g(g({},t.rowMeta),{children:o})}return t})))})),l},pe=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction;return p([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],d=r.rowData[t];return me(a,d,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:pe(e.rowMeta.children,n,r)})}):e}))},Ce=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],c=d((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),l=t(c),s=l[0],u=l[1],h=d((function(){if(!i)return r;var e=function(e,n,r){return{sortedData:we(n,r,e),newSortConfig:r}}(n,r,i).sortedData;return e}),[r,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,r){var t=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===r)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},o=t(n);o&&a((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},Ie=function(r){var t=r.checked,o=void 0!==t&&t,i=r.children,a=r.onChange;return e("label",g({className:"st-checkbox-label"},{children:[n("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),n("span",g({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&n("span",{className:"st-checkbox-checkmark"})})),i]}))},xe=function(e,n,r,t){void 0===t&&(t=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!t.has(a.accessor)&&(t.add(a.accessor),a.children&&a.children.length>0)){var d=a.children.some((function(e){return e.accessor===n})),c=!1;if(!d)for(var l=0,s=a.children;l<s.length;l++){var u=s[l];if(xe([u],n,r,t),!1===r[u.accessor]){c=!0;break}}(d||c)&&(r[a.accessor]=!1)}}},be=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},Re=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(Re(e.children,n),be(e.children,n)&&(n[e.accessor]=!0))}))},ye=function(o){var i=o.allHeaders,a=o.depth,d=void 0===a?0:a,c=o.header,l=o.hiddenColumns,s=o.setHiddenColumns,u=t(!0),h=u[0],f=u[1],v=U(),m=v.expandIcon,w=v.collapseIcon,p=v.headersRef,C=v.setMainBodyWidth,I=v.setPinnedLeftWidth,x=v.setPinnedRightWidth,b="".concat(16*d,"px"),R=c.children&&c.children.length>0,y=l[c.accessor]||R&&c.children&&be(c.children,l);return e(r,{children:[e("div",g({className:"st-header-checkbox-item",style:{paddingLeft:b}},{children:[n("div",g({className:"st-header-icon-container"},{children:R?n("div",g({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?w:m})):null})),n(Ie,g({checked:y,onChange:function(e){var n=g({},l);(n[c.accessor]=e,e)?Re(i,n):(xe(i,c.accessor,n),R&&c.children&&c.children.length>0&&c.children.every((function(e){return!0===l[e.accessor]}))&&c.children[0]&&(n[c.children[0].accessor]=!1,xe(i,c.children[0].accessor,n)));s(n),p.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,r=e.setMainBodyWidth,t=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,d=0;n.forEach((function(e){if(!e.hide){var n=ne(e).reduce((function(e,n){return e+re(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:d+=n}}));var c=ee(i),l=ee(a);t(c),o(l),r(d)}({headers:p.current,setMainBodyWidth:C,setPinnedLeftWidth:I,setPinnedRightWidth:x})}},{children:c.label}))]})),R&&h&&c.children&&n("div",g({className:"st-nested-headers"},{children:c.children.map((function(e,r){return n(ye,{allHeaders:i,depth:d+1,header:e,hiddenColumns:l,setHiddenColumns:s},"".concat(e.accessor,"-").concat(r))}))}))]})},Me=function(e){var r=e.headers,t=e.open,o=e.position,i=e.setHiddenColumns,a=e.hiddenColumns,d="left"===o?"left":"";return n("div",g({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(d),onClick:function(e){return e.stopPropagation()}},{children:n("div",g({className:"st-column-editor-popout-content"},{children:r.map((function(e,t){return n(ye,{header:e,hiddenColumns:a,setHiddenColumns:i,allHeaders:r},"".concat(e.accessor,"-").concat(t))}))}))}))},Ee=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,d=r.headers,c=r.hiddenColumns,l=r.position,s=void 0===l?"right":l,u=r.setHiddenColumns,h=t(a),f=h[0],v=h[1];return i?e("div",g({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[n("div",g({className:"st-column-editor-text"},{children:o})),n(Me,{headers:d,open:f,position:s,setHiddenColumns:u,hiddenColumns:c})]})):null},We=function(e){var r=t(!1),o=r[0],i=r[1];return a((function(){i(!0)}),[]),o?n(Se,g({},e)):null},Se=function(r){var c=r.allowAnimations,l=void 0!==c&&c,s=r.cellUpdateFlash,h=void 0!==s&&s,v=r.collapseIcon,m=void 0===v?n(y,{className:"st-sort-icon"}):v,w=r.columnEditorPosition,p=void 0===w?"right":w,M=r.columnEditorText,E=void 0===M?"Columns":M,W=r.columnReordering,S=void 0!==W&&W,H=r.columnResizing,k=void 0!==H&&H,L=r.defaultHeaders,N=r.editColumns,B=void 0!==N&&N,T=r.editColumnsInitOpen,P=void 0!==T&&T,O=r.expandIcon,F=void 0===O?n(b,{className:"st-sort-icon"}):O,A=r.height,z=r.hideFooter,U=void 0!==z&&z,J=r.nextIcon,V=void 0===J?n(b,{className:"st-next-prev-icon"}):J,K=r.onCellEdit,X=r.onColumnOrderChange,q=r.onGridReady,G=r.onNextPage,Y=r.prevIcon,$=void 0===Y?n(x,{className:"st-next-prev-icon"}):Y,_=r.rowHeight,Q=void 0===_?40:_,Z=r.rows,ee=r.rowsPerPage,ne=void 0===ee?10:ee,re=r.selectableCells,te=void 0!==re&&re,oe=r.selectableColumns,ie=void 0!==oe&&oe,ae=r.shouldPaginate,de=void 0!==ae&&ae,ce=r.sortDownIcon,le=void 0===ce?n(y,{className:"st-sort-icon"}):ce,se=r.sortUpIcon,ue=void 0===se?n(R,{className:"st-sort-icon"}):se,he=r.tableRef,ge=r.theme,me=void 0===ge?"light":ge,we=o(null),pe=o(L),Ie=o(null),xe=o(null),be=o(null),Re=o(null),ye=o(null),Me=t(1),We=Me[0],Se=Me[1],De=t(!1),He=De[0],ke=De[1],Le=t(0),Ne=Le[0],Be=Le[1],Te=t(0),Pe=Te[0],Oe=Te[1],Fe=t(0),Ae=Fe[0],ze=Fe[1],je=t(0),Ue=je[0],Je=je[1],Ve=t(0),Ke=Ve[0],Xe=Ve[1],qe=Ce({headers:pe.current,tableRows:Z}),Ge=qe.sort,Ye=qe.sortedRows,$e=qe.hiddenColumns,_e=qe.setHiddenColumns,Qe=qe.updateSort;a((function(){null==q||q()}),[q]);var Ze=d((function(){if(!de)return Ye;var e=(We-1)*ne,n=e+ne;return Ye.slice(e,n)}),[We,ne,de,Ye]),en=t(Ze),nn=en[0],rn=en[1];a((function(){rn(Ze)}),[Ze]);var tn=d((function(){var e;if(!A)return window.innerHeight-Q;var n=document.querySelector(".simple-table-root"),r=0;if(A.endsWith("px"))r=parseInt(A,10);else if(A.endsWith("vh")){var t=parseInt(A,10);r=window.innerHeight*t/100}else if(A.endsWith("%")){var o=parseInt(A,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-Q)}),[A,Q]),on=d((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,d=[],c=0,l=Math.max(0,i-a*n),s=i+r+a*n,u=function(e,n){for(var r,t=0,o=e;t<o.length;t++){var i=o[t],h=c*a;if(h>=s)break;h+a>l&&d.push({row:i,depth:n,position:c,isLastGroupRow:Boolean(null===(r=i.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),c+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(t,0),d}({bufferRowCount:5,contentHeight:tn,flattenedRows:nn,rowHeight:Q,scrollTop:Ue})}),[tn,Q,nn,Ue]),an=f((function(e){return e+1}),0)[1],dn=function(e){var n=e.selectableCells,r=e.headers,c=e.visibleRows,l=t(new Set),s=l[0],u=l[1],h=t(new Set),f=h[0],v=h[1],g=t(null),m=g[0],w=g[1],p=t(null),I=p[0],x=p[1],b=o(!1),R=o(null),y=i((function(){var e=Array.from(s).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=c[o].row.rowData[r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[r,s,c]),M=i((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),d=t;d<=o;d++)for(var l=i;l<=a;l++)if(d>=0&&d<c.length){var s=c[d].row.rowMeta.rowId;r.add(C({colIndex:l,rowIndex:d,rowId:s}))}v(new Set),w(null),u(r)}),[c,v,w,u]),E=i((function(e){if(e.rowIndex>=0&&e.rowIndex<c.length&&e.colIndex>=0&&e.colIndex<r.length){var n=C(e);v(new Set),w(null),u(new Set([n])),x(e)}}),[r.length,c.length,v,w,u,x]),W=i((function(e,n){void 0===n&&(n=!1),u(new Set),x(null),v((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&w(e[e.length-1])}),[u,x,v,w]);a((function(){var e=function(e){if(n&&I){var t=I.rowIndex,o=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(c[t].row.rowMeta.rowId!==i){var a=c.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;t=a}if("ArrowUp"===e.key){if(e.preventDefault(),t>0){var d={rowIndex:t-1,colIndex:o,rowId:c[t-1].row.rowMeta.rowId};E(d)}}else"ArrowDown"===e.key?(e.preventDefault(),t<c.length-1&&(d={rowIndex:t+1,colIndex:o,rowId:c[t+1].row.rowMeta.rowId},E(d))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(d={rowIndex:t,colIndex:o-1,rowId:c[t].row.rowMeta.rowId},E(d))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<r.length-1&&(d={rowIndex:t,colIndex:o+1,rowId:c[t].row.rowMeta.rowId},E(d))):"Escape"===e.key&&(u(new Set),v(new Set),w(null),R.current=null,x(null))}else y()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[y,r.length,I,M,E,n,c]);var S=i((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=C({colIndex:n,rowIndex:r,rowId:t}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),D=i((function(e){var n,r,t,o,i,a,d=e.colIndex,l=e.rowIndex,s=e.rowId,u=[],h=null===(t=null===(r=null===(n=c[l-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:d,rowIndex:l+1,rowId:null===(a=null===(i=null===(o=c[l+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},g={colIndex:d-1,rowIndex:l,rowId:s},m={colIndex:d+1,rowIndex:l,rowId:s};return(!S({colIndex:d,rowIndex:l-1,rowId:h})||f.has(d)&&0===l)&&u.push("st-selected-top-border"),(!S(v)||f.has(d)&&l===c.length-1)&&u.push("st-selected-bottom-border"),S(g)||u.push("st-selected-left-border"),S(m)||u.push("st-selected-right-border"),u.join(" ")}),[S,c,f]),H=d((function(){return I?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===I.rowIndex&&r===I.colIndex&&t===I.rowId}:function(){return!1}}),[I]);return{getBorderClass:D,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex,o=e.rowId;if(n){b.current=!0,R.current={rowIndex:t,colIndex:r,rowId:o},v(new Set),w(null);var i=C({colIndex:r,rowIndex:t,rowId:o});u(new Set([i])),x({rowIndex:t,colIndex:r,rowId:o})}},handleMouseOver:function(e){var r=e.colIndex,t=e.rowIndex;if(e.rowId,n&&b.current&&R.current){for(var o=new Set,i=Math.min(R.current.rowIndex,t),a=Math.max(R.current.rowIndex,t),d=Math.min(R.current.colIndex,r),l=Math.max(R.current.colIndex,r),s=i;s<=a;s++)for(var h=d;h<=l;h++)if(s>=0&&s<c.length){var f=c[s].row.rowMeta.rowId;o.add(C({colIndex:h,rowIndex:s,rowId:f}))}u(o)}},handleMouseUp:function(){b.current=!1},isInitialFocusedCell:H,isSelected:S,lastSelectedColumnIndex:m,selectColumns:W,selectedCells:s,selectedColumns:f,setInitialFocusedCell:x,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:te,headers:pe.current,visibleRows:on}),cn=dn.getBorderClass,ln=dn.handleMouseDown,sn=dn.handleMouseOver,un=dn.handleMouseUp,hn=dn.isInitialFocusedCell,fn=dn.isSelected,vn=dn.selectColumns,gn=dn.setInitialFocusedCell,mn=dn.setSelectedCells,wn=dn.setSelectedColumns,pn=i((function(e,n){Qe(e,n)}),[Qe]),Cn=i((function(e){pe.current=e,an()}),[]);a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ie&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(mn(new Set),ie&&wn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ie,mn,wn]),u((function(){if(ye.current){var e=ye.current.offsetWidth-ye.current.clientWidth;Xe(e)}}),[]),u((function(){var e=function(){if(an(),ye.current){var e=ye.current.offsetWidth-ye.current.clientWidth;Xe(e)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]);var In=o(new Map);return a((function(){he&&(he.current={updateData:function(e){var n,r,t,o,i=e.accessor,a=e.rowIndex,d=e.newValue,c=null===(r=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===r?void 0:r.rowId;if(void 0!==c){var l=D({rowId:c,accessor:i}),s=In.current.get(l);s&&s.updateContent(d),void 0!==(null===(o=null===(t=null==Z?void 0:Z[a])||void 0===t?void 0:t.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=d)}}})}),[he,Z]),n(j,g({value:{allowAnimations:l,cellRegistry:In.current,cellUpdateFlash:h,collapseIcon:m,columnReordering:S,columnResizing:k,draggedHeaderRef:we,editColumns:B,expandIcon:F,forceUpdate:an,getBorderClass:cn,handleMouseDown:ln,handleMouseOver:sn,headersRef:pe,hiddenColumns:$e,hoveredHeaderRef:Ie,isInitialFocusedCell:hn,isSelected:fn,mainBodyRef:xe,onCellEdit:K,onColumnOrderChange:X,onSort:pn,onTableHeaderDragEnd:Cn,pinnedLeftRef:be,pinnedRightRef:Re,rowHeight:Q,scrollbarWidth:Ke,selectColumns:vn,selectableColumns:ie,setInitialFocusedCell:gn,setIsWidthDragging:ke,setMainBodyWidth:Be,setPinnedLeftWidth:Oe,setPinnedRightWidth:ze,setSelectedCells:mn,setSelectedColumns:wn,shouldPaginate:de,sortDownIcon:le,sortUpIcon:ue,tableBodyContainerRef:ye}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(me),style:A?{height:A}:{}},{children:[e("div",g({className:"st-wrapper-container"},{children:[e("div",g({className:"st-content-wrapper",onMouseUp:un,onMouseLeave:un},{children:[n(fe,{flattenedRows:nn,isWidthDragging:He,pinnedLeftWidth:Pe,pinnedRightWidth:Ae,setFlattenedRows:rn,setScrollTop:Je,sort:Ge,visibleRows:on}),n(Ee,{columnEditorText:E,editColumns:B,editColumnsInitOpen:P,headers:pe.current,hiddenColumns:$e,position:p,setHiddenColumns:_e})]})),n(ve,{mainBodyRef:xe,mainBodyWidth:Ne,pinnedLeftWidth:Pe,pinnedRightWidth:Ae,setMainBodyWidth:Be,tableBodyContainerRef:ye})]})),n(I,{currentPage:We,hideFooter:U,nextIcon:V,onPageChange:Se,onNextPage:G,prevIcon:$,shouldPaginate:de,totalPages:Math.ceil(Z.length/ne)})]}))}))};export{We as SimpleTable};
1
+ import{jsxs as e,jsx as n,Fragment as r}from"react/jsx-runtime";import{useState as t,useRef as o,useCallback as i,useEffect as a,useMemo as d,createContext as l,useContext as c,forwardRef as s,useLayoutEffect as u,Fragment as h,useReducer as f,createRef as v}from"react";var g=function(){return g=Object.assign||function(e){for(var n,r=1,t=arguments.length;r<t;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},g.apply(this,arguments)};function m(e,n,r,t){return new(r||(r=Promise))((function(o,i){function a(e){try{l(t.next(e))}catch(e){i(e)}}function d(e){try{l(t.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(a,d)}l((t=t.apply(e,n||[])).next())}))}function w(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=d(0),a.throw=d(1),a.return=d(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function d(d){return function(l){return function(d){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,d[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&d[0]?t.return:d[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,d[1])).done)return o;switch(t=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return i.label++,{value:d[1],done:!1};case 5:i.label++,t=d[1],d=[0];continue;case 7:d=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==d[0]&&2!==d[0])){i=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){i.label=d[1];break}if(6===d[0]&&i.label<o[1]){i.label=o[1],o=d;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(d);break}o[2]&&i.ops.pop(),i.trys.pop();continue}d=n.call(e,i)}catch(e){d=[6,e],t=0}finally{r=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([d,l])}}}function p(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;o<i;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var C=function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return"".concat(n,"-").concat(r,"-").concat(t)},I=function(r){var o=r.currentPage,i=r.hideFooter,a=r.nextIcon,d=r.onPageChange,l=r.onNextPage,c=r.prevIcon,s=r.shouldPaginate,u=r.totalPages,h=t(!0),f=h[0],v=h[1],p=!(o>1),C=!(o<u)&&!l||!f&&o===u;if(i||!s)return null;var I=function(){if(u<=15)return Array.from({length:u},(function(e,n){return n+1}));var e,n,r=[],t=15;if(o<=Math.ceil(7.5))e=1,n=14;else if(o>=u-Math.floor(7.5))e=Math.max(1,u-t+1),n=u;else{var i=Math.floor(7);e=o-i,n=o+(t-i-1)}for(var a=e;a<=n;a++)r.push(a);return n<u-1&&(r.push(-1),r.push(u)),r}();return e("div",g({className:"st-footer"},{children:[n("button",g({className:"st-next-prev-btn ".concat(p?"disabled":""),onClick:function(){var e=o-1;e>=1&&d(e)},disabled:p},{children:c})),n("button",g({className:"st-next-prev-btn ".concat(C?"disabled":""),onClick:function(){return m(void 0,void 0,void 0,(function(){var e,n;return w(this,(function(r){switch(r.label){case 0:return e=o===u,n=o+1,l&&e?[4,l(o)]:[3,2];case 1:if(!r.sent())return v(!1),[2];r.label=2;case 2:return(n<=u||l)&&d(n),[2]}}))}))},disabled:C},{children:a})),I.map((function(e,r){return e<0?n("span",g({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(e)):n("button",g({onClick:function(){return function(e){e>=1&&e<=u&&d(e)}(e)},className:"st-page-btn ".concat(o===e?"active":"")},{children:e}),"page-".concat(e))}))]}))},x=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},b=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},R=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},y=function(e){var r=e.className;return n("svg",g({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:n("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},M=function(e){return e.position*(e.rowHeight+1)-1},E=function(e){return e.position*(e.rowHeight+1)},W=function(e){var n=e.accessor,r=e.rowIndex;return"cell-".concat(n,"-").concat(r)},S=function(e){var n=e.hiddenColumns,r=e.header,t=e.pinned;return n[r.accessor]?null:!t&&!r.pinned||r.pinned===t||null},D=function(e){var n=e.rowId,r=e.accessor;return"".concat(n,"-").concat(r)},H=function(r){var t=r.value,o=r.onBlur,i=r.onChange;return e("select",g({value:t.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[n("option",g({value:"true"},{children:"True"})),n("option",g({value:"false"},{children:"False"}))]}))},k=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:t,onChange:function(e){var n=e.target.value;i(n)}})},N=function(e){var r=e.defaultValue,t=e.onBlur,i=e.onChange,a=o(null);return n("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:t,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},L=function(e){var t=e.onChange,o=e.setIsEditing,i=e.value,a=function(e){null==t||t(e)},d=function(){o(!1)};return n(r,{children:"string"==typeof i||null==i?n(k,{defaultValue:i,onBlur:d,onChange:a}):"boolean"==typeof i?n(H,{onBlur:d,onChange:a,value:i}):"number"==typeof i?n(N,{defaultValue:i,onBlur:d,onChange:a}):null})},B=0,T=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();(0===B||o-B>=t)&&(B=o,n(r))}},P=Date.now(),O={screenX:0,screenY:0},F=function(e,n,r){void 0===r&&(r=[]);for(var t=0;t<e.length;t++){var o=e[t];if(o.accessor===n)return p(p([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=F(o.children,n,p(p([],r,!0),[t],!1));if(i)return i}}return null};var A=function(e){var n,r,t=e.draggedHeaderRef,i=e.headersRef,d=e.hoveredHeaderRef,l=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,s=(n=i.current,r=o(n),a((function(){JSON.stringify(r.current)!==JSON.stringify(n)&&(r.current=n)}),[n]),r.current);return{handleDragStart:function(e){t.current=e,P=Date.now()},handleDragOver:function(e){var n,r,o=e.event,a=e.hoveredHeader;if(o.preventDefault(),i.current){var l=o.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=o.screenX,h=o.screenY,f=Math.sqrt(Math.pow(u-O.screenX,2)+Math.pow(h-O.screenY,2));d.current=a;var v=i.current,g=F(v,(null===(n=t.current)||void 0===n?void 0:n.accessor)||""),m=F(v,a.accessor);if(g&&m){var w=g.length,p=m.length,C=m;if(w!==p){var I=p-w;I>0&&(C=m.slice(0,-I))}var x=function(e,n,r){var t=JSON.parse(JSON.stringify(e)),o=!1;function i(e,n){for(var r=e,t=0;t<n.length-1;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;i<n.length-1;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var d=i(t,n);return a(t,n,i(t,r)),a(t,r,d),{newHeaders:t,emergencyBreak:o}}(v,g,C),b=x.newHeaders,R=x.emergencyBreak;if(!(l||a.accessor===(null===(r=t.current)||void 0===r?void 0:r.accessor)||null===t.current||f<10||0===g.length||0===C.length||JSON.stringify(b)===JSON.stringify(i.current)||R)){var y=Date.now();JSON.stringify(b)===JSON.stringify(s)&&(y-P<1500||f<40)||(P=y,O={screenX:u,screenY:h},c(b))}}}},handleDragEnd:function(){t.current=null,d.current=null,null==l||l(i.current)}}},z=l(void 0),j=function(e){var r=e.children,t=e.value;return n(z.Provider,g({value:t},{children:r}))},U=function(){var e=c(z);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},J=s((function(r,d){var l,c,s=r.borderClass,u=r.colIndex,h=r.header,f=r.isHighlighted,v=r.isInitialFocused,m=r.onExpandRowClick,w=r.rowIndex,p=r.visibleRow,C=U(),I=C.cellRegistry,x=C.cellUpdateFlash,b=C.collapseIcon,R=C.draggedHeaderRef,y=C.expandIcon,M=C.handleMouseDown,E=C.handleMouseOver,S=C.headersRef,H=C.hoveredHeaderRef,k=C.onCellEdit,N=C.onTableHeaderDragEnd,B=p.depth,P=p.row,O=t(P.rowData[h.accessor]),F=O[0],z=O[1],j=t(!1),J=j[0],V=j[1],K=t(!1),X=K[0],q=K[1],G=o(null),Y=A({draggedHeaderRef:R,headersRef:S,hoveredHeaderRef:H,onTableHeaderDragEnd:N}).handleDragOver,$=T(),_="cell-".concat(w,"-").concat(u),Q=D({rowId:P.rowMeta.rowId,accessor:h.accessor});a((function(){if(I){var e="".concat(P.rowMeta.rowId,"-").concat(h.accessor);return I.set(e,{updateContent:function(e){F!==e?(z(e),x&&(q(!0),G.current&&clearTimeout(G.current),G.current=setTimeout((function(){q(!1)}),800))):z(e)}}),function(){I.delete(e),G.current&&clearTimeout(G.current)}}}),[I,x,P.rowMeta.rowId,h.accessor,F]),a((function(){if(X){var e=setTimeout((function(){q(!1)}),850);return function(){return clearTimeout(e)}}}),[X]),a((function(){z(P.rowData[h.accessor])}),[P.rowData,h.accessor]);var Z=Boolean(null===(c=null===(l=P.rowMeta)||void 0===l?void 0:l.children)||void 0===c?void 0:c.length),ee=Boolean(null==h?void 0:h.isEditable),ne="st-cell ".concat(B>0&&h.expandable?"st-cell-depth-".concat(B):""," ").concat(f?v?"st-cell-selected-first ".concat(s):"st-cell-selected ".concat(s):""," ").concat(ee?"clickable":""," ").concat(X?"st-cell-updating":""),re=i((function(e){z(e),null==k||k({accessor:h.accessor,newValue:e,row:P})}),[h.accessor,k,P]);return J?n("div",g({className:"st-cell-editing",id:W({accessor:h.accessor,rowIndex:w+1})},{children:n(L,{onChange:re,setIsEditing:V,value:F})})):e("div",g({className:ne,id:_,onDoubleClick:function(){return h.isEditable&&V(!0)},onMouseDown:function(){return M({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onMouseOver:function(){return E({rowIndex:w,colIndex:u,rowId:P.rowMeta.rowId})},onDragOver:function(e){return $({callback:Y,callbackProps:{event:e,hoveredHeader:h},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!h.isEditable||J||(e.preventDefault(),V(!0))},ref:d,"data-row-index":w,"data-col-index":u,"data-row-id":P.rowMeta.rowId,"data-accessor":h.accessor},{children:[h.expandable&&Z?P.rowMeta.isExpanded?n("div",g({className:"st-sort-icon-container",onClick:function(){return m(P.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:b})):n("div",g({className:"st-sort-icon-container",onClick:function(){return m(P.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):null,n("span",g({className:"st-cell-content ".concat("right"===h.align?"right-aligned":"center"===h.align?"center-aligned":"")},{children:h.cellRenderer?h.cellRenderer({accessor:h.accessor,colIndex:u,row:P}):F}))]}),Q)})),V=function(e){var t=e.children,o=function(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);o<t.length;o++)n.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}(e,["children"]);return U().allowAnimations?n(K,g({},o,{children:t})):n(r,{children:t})},K=function(e){var i=e.children,d=e.isBody,l=e.pauseAnimation,c=e.rowIndex,s=o(!1),h=U(),f=h.draggedHeaderRef,v=h.headersRef,g=h.mainBodyRef,m=h.shouldPaginate,w=t({}),p=w[0],C=w[1],I=o({}),x=v.current;return u((function(){if(x){var e=function(e){var n=e.currentHeaders,r=e.draggedHeaderRef,t=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(W({accessor:e.accessor,rowIndex:t}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),d=i.getBoundingClientRect();a&&(null===(n=null==r?void 0:r.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=d}}})),o}({currentHeaders:x,draggedHeaderRef:f,rowIndex:c});JSON.stringify(e)!==JSON.stringify(p)&&(I.current=p,C(e))}}),[p,x,f,d,c]),u((function(){var e=g.current,n=function(){s.current=!0},r=function(){s.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",r),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",r)}}),[f,g]),a((function(){l||s.current||Object.keys(I.current).length&&x&&x.forEach((function(e){var n=document.getElementById(W({accessor:e.accessor,rowIndex:c}));if(n){var r=I.current[e.accessor],t=p[e.accessor];if(r&&t){var o=r.left-t.left,i=m?0:r.top-t.top,a=Math.abs(o),d=Math.abs(i);(a>10||d>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[p,x,d,l,I,c,m]),n(r,{children:i})},X=function(e){var r=e.columnIndices,t=e.headers,o=e.hiddenColumns,i=e.isWidthDragging,a=e.onExpandRowClick,d=e.pinned,l=e.rowIndex,c=e.rowIndices,s=e.visibleRow,u=t.filter((function(e){return S({hiddenColumns:o,header:e,pinned:d})}));return n(V,g({isBody:!0,pauseAnimation:i,rowIndex:l+1},{children:u.map((function(e){return n(q,{columnIndices:r,header:e,headers:t,hiddenColumns:o,onExpandRowClick:a,pinned:d,rowIndex:l,rowIndices:c,visibleRow:s},W({accessor:e.accessor,rowIndex:l+1}))}))}))},q=function(e){var r=e.columnIndices,t=e.header,o=e.headers,i=e.hiddenColumns,a=e.onExpandRowClick,d=e.pinned,l=e.rowIndex,c=e.rowIndices,s=e.visibleRow,u=r[t.accessor],f=U(),v=f.getBorderClass,g=f.isSelected,m=f.isInitialFocusedCell;if(t.children){var w=t.children.filter((function(e){return S({hiddenColumns:i,header:e,pinned:d})}));return n(h,{children:w.map((function(e){return n(q,{columnIndices:r,header:e,headers:o,hiddenColumns:i,onExpandRowClick:a,pinned:d,rowIndex:l,rowIndices:c,visibleRow:s},W({accessor:e.accessor,rowIndex:l+1}))}))})}var p={rowIndex:l,colIndex:u,rowId:s.row.rowMeta.rowId},C=v(p),I=g(p),x=m(p);return n(J,{borderClass:C,colIndex:u,header:t,isHighlighted:I,isInitialFocused:x,onExpandRowClick:a,rowIndex:l,visibleRow:s},W({accessor:t.accessor,rowIndex:l+1}))},G=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.headers,i=e.hiddenColumns,a=e.index,d=e.isWidthDragging,l=e.onExpandRowClick,c=e.pinned,s=e.rowHeight,u=e.rowIndices,h=e.visibleRow,f=h.position;return n("div",g({className:"st-row ".concat(f%2==0?"even":"odd"),style:{gridTemplateColumns:t,top:E({position:f,rowHeight:s}),height:"".concat(s,"px")}},{children:n(X,{columnIndices:r,headers:o,hiddenColumns:i,isWidthDragging:d,onExpandRowClick:l,pinned:c,rowIndex:a,rowIndices:u,visibleRow:h},a)}))},Y=function(e){var r=e.displayStrongBorder,t=e.position,o=e.rowHeight,i=e.templateColumns;return n("div",g({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:i,position:"absolute",top:M({position:t,rowHeight:o}),minWidth:"100%"}},{children:n("div",{style:{gridColumn:"1 / -1"}})}))},$=function(r){var t=r.columnIndices,o=r.headers,i=r.hiddenColumns,a=r.isWidthDragging,d=r.onExpandRowClick,l=r.pinned,c=r.ref,s=r.rowHeight,u=r.rowIndices,f=r.templateColumns,v=r.totalHeight,m=r.visibleRows,w=r.width,p=l?"st-body-pinned-".concat(l):"st-body-main";return n("div",g({className:p,ref:c,style:g({position:"relative",height:"".concat(v,"px"),width:w},!l&&{flexGrow:1})},{children:m.map((function(r,c){var v,g,w=m[c-1],p=Boolean((null==w?void 0:w.depth)!==(null==r?void 0:r.depth)&&(null===(g=null===(v=null==r?void 0:r.row.rowMeta)||void 0===v?void 0:v.children)||void 0===g?void 0:g.length)&&0===r.depth);return e(h,{children:[0!==c&&n(Y,{displayStrongBorder:p,position:r.position,rowHeight:s,templateColumns:f}),n(G,{columnIndices:t,gridTemplateColumns:f,headers:o,hiddenColumns:i,index:c,isWidthDragging:a,onExpandRowClick:d,pinned:l,rowHeight:s,rowIndices:u,visibleRow:r})]},r.position)}))}))};function _(e){var n=e.headersRef,r=e.hiddenColumns,t=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,d=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return S({hiddenColumns:r,header:e})})).forEach((function(e,n){d(e,0===n)}))};return t.forEach((function(e,n){d(e,0===n)})),n.current.filter((function(e){return!e.pinned&&S({hiddenColumns:r,header:e})})).forEach((function(e,n){var r=0===n&&0===t.length;d(e,r)})),o.forEach((function(e){d(e,!1)})),i}var Q=function(r){var i=r.flattenedRows,l=r.headerContainerRef,c=r.isWidthDragging,s=r.mainTemplateColumns,u=r.pinnedLeftColumns,h=r.pinnedLeftTemplateColumns,f=r.pinnedLeftWidth,v=r.pinnedRightColumns,m=r.pinnedRightTemplateColumns,w=r.pinnedRightWidth,p=r.setFlattenedRows,C=r.setScrollTop,I=r.visibleRows,x=U(),b=x.headersRef,R=x.hiddenColumns,y=x.mainBodyRef,M=x.rowHeight,E=x.scrollbarWidth,W=x.tableBodyContainerRef;!function(e){var n=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=t(!1),d=i[0],l=i[1];a((function(){var e=null==n?void 0:n.current;if(d&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[n,d,o]),a((function(){var e=null==n?void 0:n.current,t=null==r?void 0:r.current;if(t&&e){var o=function(){if(t){var e=t.scrollHeight>t.clientHeight;l(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(t),function(){t&&i.unobserve(t)}}}),[n,r])}({headerContainerRef:l,mainSectionRef:W,scrollbarWidth:E});var S,D,H=o(null),k=(S=0,(D=function(e){e.forEach((function(e){S+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&D(e.rowMeta.children)}))})(i),S)*(M+1)-1,N=d((function(){return _({headersRef:b,hiddenColumns:R,pinnedLeftColumns:u,pinnedRightColumns:v})}),[b,R,u,v]),L=d((function(){var e={};return I.forEach((function(n,r){var t=String(n.row.rowMeta.rowId);e[t]=r})),e}),[I]),B=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?g(g({},r),{rowMeta:g(g({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};p((function(e){return e.map(n)}))},T={headerContainerRef:l,headers:b.current,hiddenColumns:R,isWidthDragging:c,rowHeight:M,visibleRows:I,columnIndices:N,rowIndices:L};return e("div",g({className:"st-body-container",ref:W,onScroll:function(e){var n=e.currentTarget.scrollTop;H.current&&cancelAnimationFrame(H.current),H.current=requestAnimationFrame((function(){C(n)}))}},{children:[u.length>0&&n($,g({},T,{onExpandRowClick:B,pinned:"left",templateColumns:h,totalHeight:k,width:f})),n($,g({},T,{ref:y,onExpandRowClick:B,templateColumns:s,totalHeight:k})),v.length>0&&n($,g({},T,{onExpandRowClick:B,pinned:"right",templateColumns:m,totalHeight:k,width:w}))]}))},Z=function(e,n){a((function(){if(e.current){var r=e.current,t=function(){var e,t=null==r?void 0:r.scrollLeft;void 0!==t&&(null===(e=n.current)||void 0===e||e.scrollTo(t,0))};return r.addEventListener("scroll",t),function(){null==r||r.removeEventListener("scroll",t)}}}),[e,n])},ee=function(e){return void 0===e&&(e=0),e?e+1:0},ne=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return ne(e)})):[e]},re=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(W({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},te=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(W({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){te(e)}))},oe=function(e){return"number"==typeof e.minWidth?e.minWidth:40},ie=function(e){var n=e.header,r=e.headers,t=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,d=function(e){var n=e.header,r=e.headers,t=e.newWidth,o=n.pinned,i=0;return r.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=t:ne(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=t:i+=re(e))})))})),n.pinned?ee(i):i}({header:n,headers:r,newWidth:t});"left"===n.pinned?i(d):"right"===n.pinned?a(d):n.pinned||o(d)},ae=function(e){var n=e.event,r=e.forceUpdate,t=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,d=e.setIsWidthDragging,l=e.setMainBodyWidth,c=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,u=e.startWidth;d(!0),n.preventDefault();var h=n.clientX;if(i&&!i.hide){var f=oe(i),v=t-o>1,g=v?ne(i):[i],m=function(e){var n="right"===i.pinned?h-e.clientX:e.clientX-h;if(v&&g.length>1)de({delta:n,header:i,headersRef:a,leafHeaders:g,minWidth:f,setMainBodyWidth:l,setPinnedLeftWidth:c,setPinnedRightWidth:s,startWidth:u});else{var t=Math.max(u+n,f);i.width=t,ie({header:i,headers:a.current,newWidth:t,setMainBodyWidth:l,setPinnedLeftWidth:c,setPinnedRightWidth:s})}a.current.forEach((function(e){te(e)})),r()},w=function(){document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",w),d(!1)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",w)}},de=function(e){var n=e.delta,r=e.header,t=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,d=e.setPinnedLeftWidth,l=e.setPinnedRightWidth,c=e.startWidth,s=o.reduce((function(e,n){return Math.min(e,oe(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(c+n,s);ie({header:r,headers:t.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:d,setPinnedRightWidth:l});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,r=f*(n/u),t=Math.max(n+r,i);e.width=t}))},le=s((function(r,t){var o,i,d=r.colIndex,l=r.forceHeadersUpdate,c=r.gridColumnEnd,s=r.gridColumnStart,u=r.gridRowEnd,h=r.gridRowStart,f=r.header,v=r.reverse,m=r.sort,w=U(),C=w.columnReordering,I=w.columnResizing,x=w.draggedHeaderRef,b=w.forceUpdate,R=w.headersRef,y=w.hoveredHeaderRef,M=w.onColumnOrderChange,E=w.onSort,S=w.onTableHeaderDragEnd,D=w.rowHeight,H=w.selectColumns,k=w.selectableColumns,N=w.setInitialFocusedCell,L=w.setIsWidthDragging,B=w.setMainBodyWidth,P=w.setPinnedLeftWidth,O=w.setPinnedRightWidth,F=w.setSelectedCells,z=w.setSelectedColumns,j=w.sortDownIcon,J=w.sortUpIcon,V=Boolean(null==f?void 0:f.isSortable),K="st-header-cell ".concat(f.accessor===(null===(o=y.current)||void 0===o?void 0:o.accessor)?"st-hovered":""," ").concat((null===(i=x.current)||void 0===i?void 0:i.accessor)===f.accessor?"st-dragging":""," ").concat(V?"clickable":""," ").concat(C&&!V?"columnReordering":""," ").concat("right"===(null==f?void 0:f.align)?"right-aligned":"center"===(null==f?void 0:f.align)?"center-aligned":""," ").concat(f.children?"parent":""),X=A({draggedHeaderRef:x,headersRef:R,hoveredHeaderRef:y,onColumnOrderChange:M,onTableHeaderDragEnd:S}),q=X.handleDragStart,G=X.handleDragEnd,Y=X.handleDragOver,$=T(),_=function(e){var n=e.event,r=e.header;if(k){var t=function(e,n){if(!e.children||0===e.children.length)return[n];var r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var d=a[i];o=t(d,o)}return o};return t(e,n),r}(r,d);return n.shiftKey&&H?z((function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort((function(e,n){return e-n})),o=r[0],i=Math.abs(n-o);r.forEach((function(e){var r=Math.abs(n-e);r<i&&(i=r,o=e)}));var a,d,l,c,s=p(p([],(a=o,d=n,l=Math.min(a,d),c=Math.max(a,d),Array.from({length:c-l+1},(function(e,n){return l+n}))),!0),t,!0);return new Set(p(p([],Array.from(e),!0),s,!0))})):H&&H(t),F(new Set),void N(null)}r.isSortable&&E(d,r.accessor)};if(a((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!f)return null;var Q=I&&n("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;$({callback:ae,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:c,gridColumnStart:s,header:f,headersRef:R,setIsWidthDragging:L,setMainBodyWidth:B,setPinnedLeftWidth:P,setPinnedRightWidth:O,startWidth:"object"==typeof t&&null!==t&&"current"in t?null===(n=t.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),Z=m&&m.key.accessor===f.accessor&&e("div",g({className:"st-sort-icon-container",onClick:function(e){return _({event:e,header:f})}},{children:["ascending"===m.direction&&J&&J,"descending"===m.direction&&j&&j]}));return e("div",g({className:K,id:W({accessor:f.accessor,rowIndex:0}),onDragOver:function(e){$({callback:Y,callbackProps:{event:e,hoveredHeader:f},limit:50})},ref:t,style:g(g({gridRowStart:h,gridRowEnd:u,gridColumnStart:s,gridColumnEnd:c},c-s>1?{}:{width:f.width}),u-h>1?{}:{height:D})},{children:[v&&Q,e("div",g({className:"st-header-label ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":""),draggable:C&&!f.disableReorder,onClick:function(e){return _({event:e,header:f})},onDragEnd:function(e){e.preventDefault(),G(),l()},onDragStart:function(e){C&&f&&function(e){q(e)}(f)}},{children:["right"===f.align&&Z,null==f?void 0:f.label,"right"!==f.align&&Z]})),!v&&Q]}))})),ce=function(e){var r=e.columnIndices,t=e.gridTemplateColumns,o=e.handleScroll,i=e.headersRef,a=e.hiddenColumns,l=e.maxDepth,c=e.pinned,s=e.sectionRef,u=e.sort,h=f((function(e){return e+1}),0)[1],m=d((function(){var e=[],n=1,t=function(o,i,d){var s,u;if(void 0===d&&(d=!1),!S({hiddenColumns:a,header:o,pinned:c}))return 0;d||n++;var h=null!==(u=null===(s=o.children)||void 0===s?void 0:s.filter((function(e){return S({hiddenColumns:a,header:e,pinned:c})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,g=i,m=h>0?i+1:l+1;if(e.push({header:o,gridColumnStart:f,gridColumnEnd:v,gridRowStart:g,gridRowEnd:m,colIndex:r[o.accessor]}),o.children){var w=!0;o.children.forEach((function(e){S({hiddenColumns:a,header:e,pinned:c})&&(t(e,i+1,w),w=!1)}))}return v-f},o=i.current.filter((function(e){return S({hiddenColumns:a,header:e,pinned:c})})),d=!0;return o.forEach((function(e){t(e,1,d),d=!1})),e}),[i,a,l,c,r]);return n("div",g({className:"st-header-".concat(c?"pinned-".concat(c):"main")},o&&{onScroll:o},{ref:s,style:{gridTemplateColumns:t,display:"grid",position:"relative"}},{children:n(V,g({rowIndex:0},{children:m.map((function(e){return n(le,{colIndex:e.colIndex,forceHeadersUpdate:h,gridColumnEnd:e.gridColumnEnd,gridColumnStart:e.gridColumnStart,gridRowEnd:e.gridRowEnd,gridRowStart:e.gridRowStart,header:e.header,ref:v(),reverse:"right"===c,sort:u},e.header.accessor)}))}))}))},se=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(se)):1},ue=function(r){var t=r.centerHeaderRef,o=r.headerContainerRef,i=r.headersRef,a=r.hiddenColumns,l=r.mainTemplateColumns,c=r.pinnedLeftColumns,s=r.pinnedLeftTemplateColumns,h=r.pinnedRightColumns,f=r.pinnedRightTemplateColumns,v=r.sort,m=U(),w=m.mainBodyRef,p=m.pinnedLeftRef,C=m.pinnedRightRef,I=m.setPinnedLeftWidth,x=m.setPinnedRightWidth;Z(w,t);var b=d((function(){return _({headersRef:i,hiddenColumns:a,pinnedLeftColumns:c,pinnedRightColumns:h})}),[i,a,c,h]),R=d((function(){var e=i.current,n=0;return e.forEach((function(e){if(S({hiddenColumns:a,header:e})){var r=se(e);n=Math.max(n,r)}})),{maxDepth:n}}),[i,a]).maxDepth;return u((function(){var e,n;I(ee(null===(e=p.current)||void 0===e?void 0:e.clientWidth)),x(ee(null===(n=C.current)||void 0===n?void 0:n.clientWidth))}),[p,C,I,x]),e("div",g({className:"st-header-container",ref:o},{children:[c.length>0&&n(ce,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:R,pinned:"left",sectionRef:p,sort:v}),n(ce,{columnIndices:b,gridTemplateColumns:l,handleScroll:function(e){var n,r,o=null===(n=t.current)||void 0===n?void 0:n.scrollLeft;void 0!==o&&(null===(r=w.current)||void 0===r||r.scrollTo(o,0))},headersRef:i,hiddenColumns:a,maxDepth:R,sectionRef:t,sort:v}),h.length>0&&n(ce,{columnIndices:b,gridTemplateColumns:f,handleScroll:void 0,headersRef:i,hiddenColumns:a,maxDepth:R,pinned:"right",sectionRef:C,sort:v})]}))},he=function(e){var n=e.headers,r=e.hiddenColumns,t=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==r[e.accessor]&&(e.children?t({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=t({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(n,", ").concat(r,")"):"max(".concat(n,", ").concat(r,")"):r}(e)})).join(" "))},fe=function(r){var t=r.flattenedRows,i=r.isWidthDragging,a=r.pinnedLeftWidth,l=r.pinnedRightWidth,c=r.setFlattenedRows,s=r.setScrollTop,u=r.sort,h=r.visibleRows,f=U(),v=f.editColumns,m=f.headersRef,w=f.hiddenColumns,p=o(null),C=o(null),I=m.current.filter((function(e){return!e.pinned})),x=m.current.filter((function(e){return"left"===e.pinned})),b=m.current.filter((function(e){return"right"===e.pinned})),R=d((function(){return he({headers:x,hiddenColumns:w})}),[x,w]),y=d((function(){return he({headers:I,hiddenColumns:w})}),[I,w]),M=d((function(){return he({headers:b,hiddenColumns:w})}),[b,w]),E={flattenedRows:t,headerContainerRef:p,isWidthDragging:i,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftTemplateColumns:R,pinnedLeftWidth:a,pinnedRightColumns:b,pinnedRightTemplateColumns:M,pinnedRightWidth:l,setFlattenedRows:c,setScrollTop:s,visibleRows:h};return e("div",g({className:"st-content",style:{width:v?"calc(100% - 27.5px)":"100%"}},{children:[n(ue,g({},{centerHeaderRef:C,headerContainerRef:p,headersRef:m,hiddenColumns:w,mainTemplateColumns:y,pinnedLeftColumns:x,pinnedLeftTemplateColumns:R,pinnedRightColumns:b,pinnedRightTemplateColumns:M,sort:u})),n(Q,g({},E))]}))},ve=function(i){var d,l,c=i.mainBodyWidth,s=i.mainBodyRef,u=i.pinnedLeftWidth,h=i.pinnedRightWidth,f=i.setMainBodyWidth,v=i.tableBodyContainerRef,m=U().editColumns,w=t(!1),p=w[0],C=w[1],I=o(null),x=v.current&&v.current.scrollHeight>v.current.clientHeight,b=m?28:0,R=(m?h+1:h)+(v.current&&x?v.current.offsetWidth-v.current.clientWidth:0);return Z(s,I),a((function(){!function(){if(s.current){var e=s.current.scrollWidth;f(e)}}()}),[s,f]),a((function(){setTimeout((function(){!function(){if(s.current){var e=s.current.clientWidth;C(c>e)}}()}),1)}),[s,c,f]),p?e("div",g({className:"st-horizontal-scrollbar-container"},{children:[u>0&&n("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:u,height:null===(d=I.current)||void 0===d?void 0:d.offsetHeight}}),c>0&&n("div",g({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&s.current&&s.current.scrollTo({left:n,behavior:"auto"})},ref:I,style:{flexGrow:1}},{children:n("div",{style:{width:c,height:".3px"}})})),h>0&&n(r,{children:n("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:R,height:null===(l=I.current)||void 0===l?void 0:l.offsetHeight}})}),b>0&&n("div",{style:{width:b-1.5,height:"100%",flexShrink:0}})]})):null},ge={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"ascending"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"ascending"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"ascending"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"ascending"===r?i:-i},enum:function(e,n,r){return ge.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"ascending"===r?-1:1:null==n?"ascending"===r?1:-1:"string"==typeof e&&"string"==typeof n?ge.string(e,n,r):"number"==typeof e&&"number"==typeof n?ge.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?ge.boolean(e,n,r):ge.string(String(e),String(n),r)}},me=function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"ascending"===t?-1:1;if(null==n||""===n)return"ascending"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=String(e);if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return ge.number(i,a,t)}return"date"===r?ge.date(String(e),String(n),t):"boolean"===r?ge.boolean(Boolean(e),Boolean(n),t):"enum"===r?ge.enum(String(e),String(n),t):ge.string(String(e),String(n),t)},we=function(e,n,r){var t,o=(null===(t=n.key)||void 0===t?void 0:t.type)||"string",i=n.direction,a=new Map,d=new Map,l="";e.forEach((function(e){var r;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var t=(e.rowData.sector||"group_".concat(a.size)).toString();l=t,d.set(l,e),a.has(l)||a.set(l,[])}else if(l){var o=a.get(l)||[];o.push(e),a.set(l,o)}else{var i="default";a.has(i)||a.set(i,[]),null===(r=a.get(i))||void 0===r||r.push(e)}}));var c=[];return a.forEach((function(e,t){if(d.has(t)){var a=d.get(t);a.rowMeta.children&&a.rowMeta.children.length>0&&(a.rowMeta.children=pe(a.rowMeta.children,n,r)),c.push(a)}var l=p([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],d=r.rowData[t];return me(a,d,o,i)}));c.push.apply(c,l.map((function(e){var t=g({},e);if(t.rowMeta.children&&t.rowMeta.children.length>0){var o=pe(t.rowMeta.children,n,r);t.rowMeta=g(g({},t.rowMeta),{children:o})}return t})))})),c},pe=function(e,n,r){var t=r.find((function(e){return e.accessor===n.key.accessor})),o=(null==t?void 0:t.type)||"string",i=n.direction;return p([],e,!0).sort((function(e,r){if(!(null==e?void 0:e.rowData)||!(null==r?void 0:r.rowData))return 0;var t=n.key.accessor,a=e.rowData[t],d=r.rowData[t];return me(a,d,o,i)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?g(g({},e),{rowMeta:g(g({},e.rowMeta),{children:pe(e.rowMeta.children,n,r)})}):e}))},Ce=function(e){var n=e.headers,r=e.tableRows,o=t(null),i=o[0],a=o[1],l=d((function(){var e={};return n.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[n]),c=t(l),s=c[0],u=c[1],h=d((function(){if(!i)return r;var e=function(e,n,r){return{sortedData:we(n,r,e),newSortConfig:r}}(n,r,i).sortedData;return e}),[r,i,n]);return{hiddenColumns:s,setHiddenColumns:u,setSort:a,sort:i,sortedRows:h,updateSort:function(e,r){var t=function(e){for(var n=0,o=e;n<o.length;n++){var i=o[n];if(i.accessor===r)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},o=t(n);o&&a((function(e){return e&&e.key.accessor===r?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},Ie=function(r){var t=r.checked,o=void 0!==t&&t,i=r.children,a=r.onChange;return e("label",g({className:"st-checkbox-label"},{children:[n("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),n("span",g({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&n("span",{className:"st-checkbox-checkmark"})})),i]}))},xe=function(e,n,r,t){void 0===t&&(t=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!t.has(a.accessor)&&(t.add(a.accessor),a.children&&a.children.length>0)){var d=a.children.some((function(e){return e.accessor===n})),l=!1;if(!d)for(var c=0,s=a.children;c<s.length;c++){var u=s[c];if(xe([u],n,r,t),!1===r[u.accessor]){l=!0;break}}(d||l)&&(r[a.accessor]=!1)}}},be=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},Re=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(Re(e.children,n),be(e.children,n)&&(n[e.accessor]=!0))}))},ye=function(o){var i=o.allHeaders,a=o.depth,d=void 0===a?0:a,l=o.header,c=o.hiddenColumns,s=o.setHiddenColumns,u=t(!0),h=u[0],f=u[1],v=U(),m=v.expandIcon,w=v.collapseIcon,p=v.headersRef,C=v.setMainBodyWidth,I=v.setPinnedLeftWidth,x=v.setPinnedRightWidth,b="".concat(16*d,"px"),R=l.children&&l.children.length>0,y=c[l.accessor]||R&&l.children&&be(l.children,c);return e(r,{children:[e("div",g({className:"st-header-checkbox-item",style:{paddingLeft:b}},{children:[n("div",g({className:"st-header-icon-container"},{children:R?n("div",g({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),f(!h)}},{children:h?w:m})):null})),n(Ie,g({checked:y,onChange:function(e){var n=g({},c);(n[l.accessor]=e,e)?Re(i,n):(xe(i,l.accessor,n),R&&l.children&&l.children.length>0&&l.children.every((function(e){return!0===c[e.accessor]}))&&l.children[0]&&(n[l.children[0].accessor]=!1,xe(i,l.children[0].accessor,n)));s(n),p.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,r=e.setMainBodyWidth,t=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,d=0;n.forEach((function(e){if(!e.hide){var n=ne(e).reduce((function(e,n){return e+re(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:d+=n}}));var l=ee(i),c=ee(a);t(l),o(c),r(d)}({headers:p.current,setMainBodyWidth:C,setPinnedLeftWidth:I,setPinnedRightWidth:x})}},{children:l.label}))]})),R&&h&&l.children&&n("div",g({className:"st-nested-headers"},{children:l.children.map((function(e,r){return n(ye,{allHeaders:i,depth:d+1,header:e,hiddenColumns:c,setHiddenColumns:s},"".concat(e.accessor,"-").concat(r))}))}))]})},Me=function(e){var r=e.headers,t=e.open,o=e.position,i=e.setHiddenColumns,a=e.hiddenColumns,d="left"===o?"left":"";return n("div",g({className:"st-column-editor-popout ".concat(t?"open":""," ").concat(d),onClick:function(e){return e.stopPropagation()}},{children:n("div",g({className:"st-column-editor-popout-content"},{children:r.map((function(e,t){return n(ye,{header:e,hiddenColumns:a,setHiddenColumns:i,allHeaders:r},"".concat(e.accessor,"-").concat(t))}))}))}))},Ee=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,d=r.headers,l=r.hiddenColumns,c=r.position,s=void 0===c?"right":c,u=r.setHiddenColumns,h=t(a),f=h[0],v=h[1];return i?e("div",g({className:"st-column-editor ".concat(f?"open":""," ").concat(s),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[n("div",g({className:"st-column-editor-text"},{children:o})),n(Me,{headers:d,open:f,position:s,setHiddenColumns:u,hiddenColumns:l})]})):null},We=function(e){var r=t(!1),o=r[0],i=r[1];return a((function(){i(!0)}),[]),o?n(Se,g({},e)):null},Se=function(r){var l=r.allowAnimations,c=void 0!==l&&l,s=r.cellUpdateFlash,h=void 0!==s&&s,v=r.collapseIcon,m=void 0===v?n(y,{className:"st-sort-icon"}):v,w=r.columnEditorPosition,p=void 0===w?"right":w,M=r.columnEditorText,E=void 0===M?"Columns":M,W=r.columnReordering,S=void 0!==W&&W,H=r.columnResizing,k=void 0!==H&&H,N=r.defaultHeaders,L=r.editColumns,B=void 0!==L&&L,T=r.editColumnsInitOpen,P=void 0!==T&&T,O=r.expandIcon,F=void 0===O?n(b,{className:"st-sort-icon"}):O,A=r.height,z=r.hideFooter,U=void 0!==z&&z,J=r.nextIcon,V=void 0===J?n(b,{className:"st-next-prev-icon"}):J,K=r.onCellEdit,X=r.onColumnOrderChange,q=r.onGridReady,G=r.onNextPage,Y=r.prevIcon,$=void 0===Y?n(x,{className:"st-next-prev-icon"}):Y,_=r.rowHeight,Q=void 0===_?40:_,Z=r.rows,ee=r.rowsPerPage,ne=void 0===ee?10:ee,re=r.selectableCells,te=void 0!==re&&re,oe=r.selectableColumns,ie=void 0!==oe&&oe,ae=r.shouldPaginate,de=void 0!==ae&&ae,le=r.sortDownIcon,ce=void 0===le?n(y,{className:"st-sort-icon"}):le,se=r.sortUpIcon,ue=void 0===se?n(R,{className:"st-sort-icon"}):se,he=r.tableRef,ge=r.theme,me=void 0===ge?"light":ge,we=o(null),pe=o(N),Ie=o(null),xe=o(null),be=o(null),Re=o(null),ye=o(null),Me=t(1),We=Me[0],Se=Me[1],De=t(!1),He=De[0],ke=De[1],Ne=t(0),Le=Ne[0],Be=Ne[1],Te=t(0),Pe=Te[0],Oe=Te[1],Fe=t(0),Ae=Fe[0],ze=Fe[1],je=t(0),Ue=je[0],Je=je[1],Ve=t(0),Ke=Ve[0],Xe=Ve[1],qe=Ce({headers:pe.current,tableRows:Z}),Ge=qe.sort,Ye=qe.sortedRows,$e=qe.hiddenColumns,_e=qe.setHiddenColumns,Qe=qe.updateSort;a((function(){null==q||q()}),[q]);var Ze=d((function(){if(!de)return Ye;var e=(We-1)*ne,n=e+ne;return Ye.slice(e,n)}),[We,ne,de,Ye]),en=t(Ze),nn=en[0],rn=en[1];a((function(){rn(Ze)}),[Ze]);var tn=d((function(){var e;if(!A)return window.innerHeight-Q;var n=document.querySelector(".simple-table-root"),r=0;if(A.endsWith("px"))r=parseInt(A,10);else if(A.endsWith("vh")){var t=parseInt(A,10);r=window.innerHeight*t/100}else if(A.endsWith("%")){var o=parseInt(A,10);r=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else r=window.innerHeight;return Math.max(0,r-Q)}),[A,Q]),on=d((function(){return function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,d=[],l=0,c=Math.max(0,i-a*n),s=i+r+a*n,u=function(e,n){for(var r,t=0,o=e;t<o.length;t++){var i=o[t],h=l*a;if(h>=s)break;h+a>c&&d.push({row:i,depth:n,position:l,isLastGroupRow:Boolean(null===(r=i.rowMeta.children)||void 0===r?void 0:r.length)&&n>1}),l+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(t,0),d}({bufferRowCount:5,contentHeight:tn,flattenedRows:nn,rowHeight:Q,scrollTop:Ue})}),[tn,Q,nn,Ue]),an=f((function(e){return e+1}),0)[1],dn=function(e){var n=e.selectableCells,r=e.headers,l=e.visibleRows,c=t(new Set),s=c[0],u=c[1],h=t(new Set),f=h[0],v=h[1],g=t(null),m=g[0],w=g[1],p=t(null),I=p[0],x=p[1],b=o(!1),R=o(null),y=i((function(){var e=Array.from(s).reduce((function(e,n){var t=n.split("-").map(Number),o=t[0],i=t[1];return e[o]||(e[o]=[]),e[o][i]=l[o].row.rowData[r[i].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");s.size>0&&navigator.clipboard.writeText(n)}),[r,s,l]),M=i((function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),o=Math.max(e.rowIndex,n.rowIndex),i=Math.min(e.colIndex,n.colIndex),a=Math.max(e.colIndex,n.colIndex),d=t;d<=o;d++)for(var c=i;c<=a;c++)if(d>=0&&d<l.length){var s=l[d].row.rowMeta.rowId;r.add(C({colIndex:c,rowIndex:d,rowId:s}))}v(new Set),w(null),u(r)}),[l,v,w,u]),E=i((function(e){if(e.rowIndex>=0&&e.rowIndex<l.length&&e.colIndex>=0&&e.colIndex<r.length){var n=C(e);v(new Set),w(null),u(new Set([n])),x(e)}}),[r.length,l.length,v,w,u,x]),W=i((function(e,n){void 0===n&&(n=!1),u(new Set),x(null),v((function(r){var t=new Set(n?r:[]);return e.forEach((function(e){return t.add(e)})),t})),e.length>0&&w(e[e.length-1])}),[u,x,v,w]);a((function(){var e=function(e){if(n&&I){var t=I.rowIndex,o=I.colIndex,i=I.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(l[t].row.rowMeta.rowId!==i){var a=l.findIndex((function(e){return e.row.rowMeta.rowId===i}));if(-1===a)return;t=a}if("ArrowUp"===e.key){if(e.preventDefault(),t>0){var d={rowIndex:t-1,colIndex:o,rowId:l[t-1].row.rowMeta.rowId};E(d)}}else"ArrowDown"===e.key?(e.preventDefault(),t<l.length-1&&(d={rowIndex:t+1,colIndex:o,rowId:l[t+1].row.rowMeta.rowId},E(d))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),o>0&&(d={rowIndex:t,colIndex:o-1,rowId:l[t].row.rowMeta.rowId},E(d))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),o<r.length-1&&(d={rowIndex:t,colIndex:o+1,rowId:l[t].row.rowMeta.rowId},E(d))):"Escape"===e.key&&(u(new Set),v(new Set),w(null),R.current=null,x(null))}else y()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[y,r.length,I,M,E,n,l]);var S=i((function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId,o=C({colIndex:n,rowIndex:r,rowId:t}),i=s.has(o),a=f.has(n);return i||a}),[s,f]),D=i((function(e){var n,r,t,o,i,a,d=e.colIndex,c=e.rowIndex,s=e.rowId,u=[],h=null===(t=null===(r=null===(n=l[c-1])||void 0===n?void 0:n.row)||void 0===r?void 0:r.rowMeta)||void 0===t?void 0:t.rowId,v={colIndex:d,rowIndex:c+1,rowId:null===(a=null===(i=null===(o=l[c+1])||void 0===o?void 0:o.row)||void 0===i?void 0:i.rowMeta)||void 0===a?void 0:a.rowId},g={colIndex:d-1,rowIndex:c,rowId:s},m={colIndex:d+1,rowIndex:c,rowId:s};return(!S({colIndex:d,rowIndex:c-1,rowId:h})||f.has(d)&&0===c)&&u.push("st-selected-top-border"),(!S(v)||f.has(d)&&c===l.length-1)&&u.push("st-selected-bottom-border"),S(g)||u.push("st-selected-left-border"),S(m)||u.push("st-selected-right-border"),u.join(" ")}),[S,l,f]),H=d((function(){return I?function(e){var n=e.rowIndex,r=e.colIndex,t=e.rowId;return n===I.rowIndex&&r===I.colIndex&&t===I.rowId}:function(){return!1}}),[I]);return{getBorderClass:D,handleMouseDown:function(e){var r=e.colIndex,t=e.rowIndex,o=e.rowId;if(n){b.current=!0,R.current={rowIndex:t,colIndex:r,rowId:o},v(new Set),w(null);var i=C({colIndex:r,rowIndex:t,rowId:o});u(new Set([i])),x({rowIndex:t,colIndex:r,rowId:o})}},handleMouseOver:function(e){var r=e.colIndex,t=e.rowIndex;if(e.rowId,n&&b.current&&R.current){for(var o=new Set,i=Math.min(R.current.rowIndex,t),a=Math.max(R.current.rowIndex,t),d=Math.min(R.current.colIndex,r),c=Math.max(R.current.colIndex,r),s=i;s<=a;s++)for(var h=d;h<=c;h++)if(s>=0&&s<l.length){var f=l[s].row.rowMeta.rowId;o.add(C({colIndex:h,rowIndex:s,rowId:f}))}u(o)}},handleMouseUp:function(){b.current=!1},isInitialFocusedCell:H,isSelected:S,lastSelectedColumnIndex:m,selectColumns:W,selectedCells:s,selectedColumns:f,setInitialFocusedCell:x,setSelectedCells:u,setSelectedColumns:v}}({selectableCells:te,headers:pe.current,visibleRows:on}),ln=dn.getBorderClass,cn=dn.handleMouseDown,sn=dn.handleMouseOver,un=dn.handleMouseUp,hn=dn.isInitialFocusedCell,fn=dn.isSelected,vn=dn.selectColumns,gn=dn.setInitialFocusedCell,mn=dn.setSelectedCells,wn=dn.setSelectedColumns,pn=i((function(e,n){Qe(e,n)}),[Qe]),Cn=i((function(e){pe.current=e,an()}),[]);a((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||ie&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(mn(new Set),ie&&wn(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[ie,mn,wn]),u((function(){if(ye.current){var e=ye.current.offsetWidth-ye.current.clientWidth;Xe(e)}}),[]),u((function(){var e=function(){if(an(),ye.current){var e=ye.current.offsetWidth-ye.current.clientWidth;Xe(e)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]);var In=o(new Map);return a((function(){he&&(he.current={updateData:function(e){var n,r,t,o,i=e.accessor,a=e.rowIndex,d=e.newValue,l=null===(r=null===(n=null==Z?void 0:Z[a])||void 0===n?void 0:n.rowMeta)||void 0===r?void 0:r.rowId;if(void 0!==l){var c=D({rowId:l,accessor:i}),s=In.current.get(c);s&&s.updateContent(d),void 0!==(null===(o=null===(t=null==Z?void 0:Z[a])||void 0===t?void 0:t.rowData)||void 0===o?void 0:o[i])&&(Z[a].rowData[i]=d)}}})}),[he,Z]),n(j,g({value:{allowAnimations:c,cellRegistry:In.current,cellUpdateFlash:h,collapseIcon:m,columnReordering:S,columnResizing:k,draggedHeaderRef:we,editColumns:B,expandIcon:F,forceUpdate:an,getBorderClass:ln,handleMouseDown:cn,handleMouseOver:sn,headersRef:pe,hiddenColumns:$e,hoveredHeaderRef:Ie,isInitialFocusedCell:hn,isSelected:fn,mainBodyRef:xe,onCellEdit:K,onColumnOrderChange:X,onSort:pn,onTableHeaderDragEnd:Cn,pinnedLeftRef:be,pinnedRightRef:Re,rowHeight:Q,scrollbarWidth:Ke,selectColumns:vn,selectableColumns:ie,setInitialFocusedCell:gn,setIsWidthDragging:ke,setMainBodyWidth:Be,setPinnedLeftWidth:Oe,setPinnedRightWidth:ze,setSelectedCells:mn,setSelectedColumns:wn,shouldPaginate:de,sortDownIcon:ce,sortUpIcon:ue,tableBodyContainerRef:ye}},{children:e("div",g({className:"simple-table-root st-wrapper theme-".concat(me),style:A?{height:A}:{}},{children:[e("div",g({className:"st-wrapper-container"},{children:[e("div",g({className:"st-content-wrapper",onMouseUp:un,onMouseLeave:un},{children:[n(fe,{flattenedRows:nn,isWidthDragging:He,pinnedLeftWidth:Pe,pinnedRightWidth:Ae,setFlattenedRows:rn,setScrollTop:Je,sort:Ge,visibleRows:on}),n(Ee,{columnEditorText:E,editColumns:B,editColumnsInitOpen:P,headers:pe.current,hiddenColumns:$e,position:p,setHiddenColumns:_e})]})),n(ve,{mainBodyRef:xe,mainBodyWidth:Le,pinnedLeftWidth:Pe,pinnedRightWidth:Ae,setMainBodyWidth:Be,tableBodyContainerRef:ye})]})),n(I,{currentPage:We,hideFooter:U,nextIcon:V,onPageChange:Se,onNextPage:G,prevIcon:$,shouldPaginate:de,totalPages:Math.ceil(Z.length/ne)})]}))}))};export{We as SimpleTable};
2
2
  //# sourceMappingURL=index.es.js.map
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=function(){return t=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},t.apply(this,arguments)};function r(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function d(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,d)}c((r=r.apply(e,n||[])).next())}))}function o(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=d(0),a.throw=d(1),a.return=d(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function d(d){return function(c){return function(d){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,d[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return i.label++,{value:d[1],done:!1};case 5:i.label++,r=d[1],d=[0];continue;case 7:d=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==d[0]&&2!==d[0])){i=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){i.label=d[1];break}if(6===d[0]&&i.label<o[1]){i.label=o[1],o=d;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(d);break}o[2]&&i.ops.pop(),i.trys.pop();continue}d=n.call(e,i)}catch(e){d=[6,e],r=0}finally{t=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([d,c])}}}function i(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var a=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},d=function(i){var a=i.currentPage,d=i.hideFooter,c=i.nextIcon,s=i.onPageChange,l=i.onNextPage,u=i.prevIcon,h=i.shouldPaginate,f=i.totalPages,v=n.useState(!0),g=v[0],m=v[1],w=!(a>1),p=!(a<f)&&!l||!g&&a===f;return d||!h?null:e.jsxs("div",t({className:"st-footer"},{children:[e.jsx("button",t({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=a-1;e>=1&&s(e)},disabled:w},{children:u})),e.jsx("button",t({className:"st-next-prev-btn ".concat(p?"disabled":""),onClick:function(){return r(void 0,void 0,void 0,(function(){var e,n;return o(this,(function(t){switch(t.label){case 0:return e=a===f,n=a+1,l&&e?[4,l(a)]:[3,2];case 1:if(!t.sent())return m(!1),[2];t.label=2;case 2:return(n<=f||l)&&s(n),[2]}}))}))},disabled:p},{children:c})),Array.from({length:f},(function(n,r){return e.jsx("button",t({onClick:function(){var e;(e=r+1)>=1&&e<=f&&s(e)},className:"st-page-btn ".concat(a===r+1?"active":"")},{children:r+1}),r)}))]}))},c=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},s=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},l=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},u=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},h=function(e){return e.position*(e.rowHeight+1)-1},f=function(e){return e.position*(e.rowHeight+1)},v=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},g=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},m=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},w=function(n){var r=n.value,o=n.onBlur,i=n.onChange;return e.jsxs("select",t({value:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[e.jsx("option",t({value:"true"},{children:"True"})),e.jsx("option",t({value:"false"},{children:"False"}))]}))},p=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},x=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},C=function(n){var t=n.onChange,r=n.setIsEditing,o=n.value,i=function(e){null==t||t(e)},a=function(){r(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(p,{defaultValue:o,onBlur:a,onChange:i}):"boolean"==typeof o?e.jsx(w,{onBlur:a,onChange:i,value:o}):"number"==typeof o?e.jsx(x,{defaultValue:o,onBlur:a,onChange:i}):null})},I=0,R=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===I||o-I>=r)&&(I=o,n(t))}},b=Date.now(),y={screenX:0,screenY:0},M=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return i(i([],t,!0),[r],!1);if(o.children&&o.children.length>0){var a=M(o.children,n,i(i([],t,!0),[r],!1));if(a)return a}}return null};var E=function(e){var t,r,o=e.draggedHeaderRef,i=e.headersRef,a=e.hoveredHeaderRef,d=e.onColumnOrderChange,c=e.onTableHeaderDragEnd,s=(t=i.current,r=n.useRef(t),n.useEffect((function(){JSON.stringify(r.current)!==JSON.stringify(t)&&(r.current=t)}),[t]),r.current);return{handleDragStart:function(e){o.current=e,b=Date.now()},handleDragOver:function(e){var n,t,r=e.event,d=e.hoveredHeader;if(r.preventDefault(),i.current){var l=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,h=r.screenY,f=Math.sqrt(Math.pow(u-y.screenX,2)+Math.pow(h-y.screenY,2));a.current=d;var v=i.current,g=M(v,(null===(n=o.current)||void 0===n?void 0:n.accessor)||""),m=M(v,d.accessor);if(g&&m){var w=g.length,p=m.length,x=m;if(w!==p){var C=p-w;C>0&&(x=m.slice(0,-C))}var I=function(e,n,t){var r=JSON.parse(JSON.stringify(e)),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var d=i(r,n);return a(r,n,i(r,t)),a(r,t,d),{newHeaders:r,emergencyBreak:o}}(v,g,x),R=I.newHeaders,E=I.emergencyBreak;if(!(l||d.accessor===(null===(t=o.current)||void 0===t?void 0:t.accessor)||null===o.current||f<10||0===g.length||0===x.length||JSON.stringify(R)===JSON.stringify(i.current)||E)){var S=Date.now();JSON.stringify(R)===JSON.stringify(s)&&(S-b<1500||f<40)||(b=S,y={screenX:u,screenY:h},c(R))}}}},handleDragEnd:function(){o.current=null,a.current=null,null==d||d(i.current)}}},S=n.createContext(void 0),j=function(n){var r=n.children,o=n.value;return e.jsx(S.Provider,t({value:o},{children:r}))},W=function(){var e=n.useContext(S);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},k=n.forwardRef((function(r,o){var i,a,d=r.borderClass,c=r.colIndex,s=r.header,l=r.isHighlighted,u=r.isInitialFocused,h=r.onExpandRowClick,f=r.rowIndex,g=r.visibleRow,w=W(),p=w.cellRegistry,x=w.cellUpdateFlash,I=w.collapseIcon,b=w.draggedHeaderRef,y=w.expandIcon,M=w.handleMouseDown,S=w.handleMouseOver,j=w.headersRef,k=w.hoveredHeaderRef,D=w.onCellEdit,H=w.onTableHeaderDragEnd,L=g.depth,N=g.row,B=n.useState(N.rowData[s.accessor]),T=B[0],P=B[1],O=n.useState(!1),F=O[0],A=O[1],z=n.useState(!1),U=z[0],J=z[1],V=n.useRef(null),q=E({draggedHeaderRef:b,headersRef:j,hoveredHeaderRef:k,onTableHeaderDragEnd:H}).handleDragOver,K=R(),X="cell-".concat(f,"-").concat(c),G=m({rowId:N.rowMeta.rowId,accessor:s.accessor});n.useEffect((function(){if(p){var e="".concat(N.rowMeta.rowId,"-").concat(s.accessor);return p.set(e,{updateContent:function(e){T!==e?(P(e),x&&(J(!0),V.current&&clearTimeout(V.current),V.current=setTimeout((function(){J(!1)}),800))):P(e)}}),function(){p.delete(e),V.current&&clearTimeout(V.current)}}}),[p,x,N.rowMeta.rowId,s.accessor,T]),n.useEffect((function(){if(U){var e=setTimeout((function(){J(!1)}),850);return function(){return clearTimeout(e)}}}),[U]),n.useEffect((function(){P(N.rowData[s.accessor])}),[N.rowData,s.accessor]);var Y=Boolean(null===(a=null===(i=N.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),_=Boolean(null==s?void 0:s.isEditable),$="st-cell ".concat(L>0&&s.expandable?"st-cell-depth-".concat(L):""," ").concat(l?u?"st-cell-selected-first ".concat(d):"st-cell-selected ".concat(d):""," ").concat(_?"clickable":""," ").concat(U?"st-cell-updating":""),Q=n.useCallback((function(e){P(e),null==D||D({accessor:s.accessor,newValue:e,row:N})}),[s.accessor,D,N]);return F?e.jsx("div",t({className:"st-cell-editing",id:v({accessor:s.accessor,rowIndex:f+1})},{children:e.jsx(C,{onChange:Q,setIsEditing:A,value:T})})):e.jsxs("div",t({className:$,id:X,onDoubleClick:function(){return s.isEditable&&A(!0)},onMouseDown:function(){return M({rowIndex:f,colIndex:c,rowId:N.rowMeta.rowId})},onMouseOver:function(){return S({rowIndex:f,colIndex:c,rowId:N.rowMeta.rowId})},onDragOver:function(e){return K({callback:q,callbackProps:{event:e,hoveredHeader:s},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!s.isEditable||F||(e.preventDefault(),A(!0))},ref:o,"data-row-index":f,"data-col-index":c,"data-row-id":N.rowMeta.rowId,"data-accessor":s.accessor},{children:[s.expandable&&Y?N.rowMeta.isExpanded?e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return h(N.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:I})):e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return h(N.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):null,e.jsx("span",t({className:"st-cell-content ".concat("right"===s.align?"right-aligned":"center"===s.align?"center-aligned":"")},{children:s.cellRenderer?s.cellRenderer({accessor:s.accessor,colIndex:c,row:N}):T}))]}),G)})),D=function(n){var r=n.children,o=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children"]);return W().allowAnimations?e.jsx(H,t({},o,{children:r})):e.jsx(e.Fragment,{children:r})},H=function(t){var r=t.children,o=t.isBody,i=t.pauseAnimation,a=t.rowIndex,d=n.useRef(!1),c=W(),s=c.draggedHeaderRef,l=c.headersRef,u=c.mainBodyRef,h=c.shouldPaginate,f=n.useState({}),g=f[0],m=f[1],w=n.useRef({}),p=l.current;return n.useLayoutEffect((function(){if(p){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(v({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),d=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=d}}})),o}({currentHeaders:p,draggedHeaderRef:s,rowIndex:a});JSON.stringify(e)!==JSON.stringify(g)&&(w.current=g,m(e))}}),[g,p,s,o,a]),n.useLayoutEffect((function(){var e=u.current,n=function(){d.current=!0},t=function(){d.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[s,u]),n.useEffect((function(){i||d.current||Object.keys(w.current).length&&p&&p.forEach((function(e){var n=document.getElementById(v({accessor:e.accessor,rowIndex:a}));if(n){var t=w.current[e.accessor],r=g[e.accessor];if(t&&r){var o=t.left-r.left,i=h?0:t.top-r.top,d=Math.abs(o),c=Math.abs(i);(d>10||c>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[g,p,o,i,w,a,h]),e.jsx(e.Fragment,{children:r})},L=function(n){var r=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,d=n.onExpandRowClick,c=n.pinned,s=n.rowIndex,l=n.rowIndices,u=n.visibleRow,h=o.filter((function(e){return g({hiddenColumns:i,header:e,pinned:c})}));return e.jsx(D,t({isBody:!0,pauseAnimation:a,rowIndex:s+1},{children:h.map((function(n){return e.jsx(N,{columnIndices:r,header:n,headers:o,hiddenColumns:i,onExpandRowClick:d,pinned:c,rowIndex:s,rowIndices:l,visibleRow:u},v({accessor:n.accessor,rowIndex:s+1}))}))}))},N=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.hiddenColumns,d=t.onExpandRowClick,c=t.pinned,s=t.rowIndex,l=t.rowIndices,u=t.visibleRow,h=r[o.accessor],f=W(),m=f.getBorderClass,w=f.isSelected,p=f.isInitialFocusedCell;if(o.children){var x=o.children.filter((function(e){return g({hiddenColumns:a,header:e,pinned:c})}));return e.jsx(n.Fragment,{children:x.map((function(n){return e.jsx(N,{columnIndices:r,header:n,headers:i,hiddenColumns:a,onExpandRowClick:d,pinned:c,rowIndex:s,rowIndices:l,visibleRow:u},v({accessor:n.accessor,rowIndex:s+1}))}))})}var C={rowIndex:s,colIndex:h,rowId:u.row.rowMeta.rowId},I=m(C),R=w(C),b=p(C);return e.jsx(k,{borderClass:I,colIndex:h,header:o,isHighlighted:R,isInitialFocused:b,onExpandRowClick:d,rowIndex:s,visibleRow:u},v({accessor:o.accessor,rowIndex:s+1}))},B=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,d=n.index,c=n.isWidthDragging,s=n.onExpandRowClick,l=n.pinned,u=n.rowHeight,h=n.rowIndices,v=n.visibleRow,g=v.position,m=g%2==0;return e.jsx("div",t({className:"st-row ".concat(m?"even":"odd"),style:{gridTemplateColumns:o,top:f({position:g,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(L,{columnIndices:r,headers:i,hiddenColumns:a,isWidthDragging:c,onExpandRowClick:s,pinned:l,rowIndex:d,rowIndices:h,visibleRow:v},d)}))},T=function(n){var r=n.displayStrongBorder,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",t({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:h({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},P=function(r){var o=r.columnIndices,i=r.headers,a=r.hiddenColumns,d=r.isWidthDragging,c=r.onExpandRowClick,s=r.pinned,l=r.ref,u=r.rowHeight,h=r.rowIndices,f=r.templateColumns,v=r.totalHeight,g=r.visibleRows,m=r.width,w=s?"st-body-pinned-".concat(s):"st-body-main";return e.jsx("div",t({className:w,ref:l,style:t({position:"relative",height:"".concat(v,"px"),width:m},!s&&{flexGrow:1})},{children:g.map((function(t,r){var l,v,m=g[r-1],w=Boolean((null==m?void 0:m.depth)!==(null==t?void 0:t.depth)&&(null===(v=null===(l=null==t?void 0:t.row.rowMeta)||void 0===l?void 0:l.children)||void 0===v?void 0:v.length)&&0===t.depth);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(T,{displayStrongBorder:w,position:t.position,rowHeight:u,templateColumns:f}),e.jsx(B,{columnIndices:o,gridTemplateColumns:f,headers:i,hiddenColumns:a,index:r,isWidthDragging:d,onExpandRowClick:c,pinned:s,rowHeight:u,rowIndices:h,visibleRow:t})]},t.position)}))}))};function O(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,d=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return g({hiddenColumns:t,header:e})})).forEach((function(e,n){d(e,0===n)}))};return r.forEach((function(e,n){d(e,0===n)})),n.current.filter((function(e){return!e.pinned&&g({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;d(e,t)})),o.forEach((function(e){d(e,!1)})),i}var F=function(r){var o=r.flattenedRows,i=r.headerContainerRef,a=r.isWidthDragging,d=r.mainTemplateColumns,c=r.pinnedLeftColumns,s=r.pinnedLeftTemplateColumns,l=r.pinnedLeftWidth,u=r.pinnedRightColumns,h=r.pinnedRightTemplateColumns,f=r.pinnedRightWidth,v=r.setFlattenedRows,g=r.setScrollTop,m=r.visibleRows,w=W(),p=w.headersRef,x=w.hiddenColumns,C=w.mainBodyRef,I=w.rowHeight,R=w.scrollbarWidth,b=w.tableBodyContainerRef;!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],d=i[1];n.useEffect((function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[t,a,o]),n.useEffect((function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[t,r])}({headerContainerRef:i,mainSectionRef:b,scrollbarWidth:R});var y,M,E=n.useRef(null),S=(y=0,(M=function(e){e.forEach((function(e){y+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&M(e.rowMeta.children)}))})(o),y)*(I+1)-1,j=n.useMemo((function(){return O({headersRef:p,hiddenColumns:x,pinnedLeftColumns:c,pinnedRightColumns:u})}),[p,x,c,u]),k=n.useMemo((function(){var e={};return m.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[m]),D=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};v((function(e){return e.map(n)}))},H={headerContainerRef:i,headers:p.current,hiddenColumns:x,isWidthDragging:a,rowHeight:I,visibleRows:m,columnIndices:j,rowIndices:k};return e.jsxs("div",t({className:"st-body-container",ref:b,onScroll:function(e){var n=e.currentTarget.scrollTop;E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame((function(){g(n)}))}},{children:[c.length>0&&e.jsx(P,t({},H,{onExpandRowClick:D,pinned:"left",templateColumns:s,totalHeight:S,width:l})),e.jsx(P,t({},H,{ref:C,onExpandRowClick:D,templateColumns:d,totalHeight:S})),u.length>0&&e.jsx(P,t({},H,{onExpandRowClick:D,pinned:"right",templateColumns:h,totalHeight:S,width:f}))]}))},A=function(e,t){n.useEffect((function(){if(e.current){var n=e.current,r=function(){var e,r=null==n?void 0:n.scrollLeft;void 0!==r&&(null===(e=t.current)||void 0===e||e.scrollTo(r,0))};return n.addEventListener("scroll",r),function(){null==n||n.removeEventListener("scroll",r)}}}),[e,t])},z=function(e){return void 0===e&&(e=0),e?e+1:0},U=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return U(e)})):[e]},J=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(v({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},V=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(v({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){V(e)}))},q=function(e){return"number"==typeof e.minWidth?e.minWidth:40},K=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,d=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:U(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=J(e))})))})),n.pinned?z(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(d):"right"===n.pinned?a(d):n.pinned||o(d)},X=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,d=e.setIsWidthDragging,c=e.setMainBodyWidth,s=e.setPinnedLeftWidth,l=e.setPinnedRightWidth,u=e.startWidth;d(!0),n.preventDefault();var h=n.clientX;if(i&&!i.hide){var f=q(i),v=r-o>1,g=v?U(i):[i],m=function(e){var n="right"===i.pinned?h-e.clientX:e.clientX-h;if(v&&g.length>1)G({delta:n,header:i,headersRef:a,leafHeaders:g,minWidth:f,setMainBodyWidth:c,setPinnedLeftWidth:s,setPinnedRightWidth:l,startWidth:u});else{var r=Math.max(u+n,f);i.width=r,K({header:i,headers:a.current,newWidth:r,setMainBodyWidth:c,setPinnedLeftWidth:s,setPinnedRightWidth:l})}a.current.forEach((function(e){V(e)})),t()},w=function(){document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",w),d(!1)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",w)}},G=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,d=e.setPinnedLeftWidth,c=e.setPinnedRightWidth,s=e.startWidth,l=o.reduce((function(e,n){return Math.min(e,q(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(s+n,l);K({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:d,setPinnedRightWidth:c});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},Y=n.forwardRef((function(r,o){var a,d,c=r.colIndex,s=r.forceHeadersUpdate,l=r.gridColumnEnd,u=r.gridColumnStart,h=r.gridRowEnd,f=r.gridRowStart,g=r.header,m=r.reverse,w=r.sort,p=W(),x=p.columnReordering,C=p.columnResizing,I=p.draggedHeaderRef,b=p.forceUpdate,y=p.headersRef,M=p.hoveredHeaderRef,S=p.onColumnOrderChange,j=p.onSort,k=p.onTableHeaderDragEnd,D=p.rowHeight,H=p.selectColumns,L=p.selectableColumns,N=p.setInitialFocusedCell,B=p.setIsWidthDragging,T=p.setMainBodyWidth,P=p.setPinnedLeftWidth,O=p.setPinnedRightWidth,F=p.setSelectedCells,A=p.setSelectedColumns,z=p.sortDownIcon,U=p.sortUpIcon,J=Boolean(null==g?void 0:g.isSortable),V="st-header-cell ".concat(g.accessor===(null===(a=M.current)||void 0===a?void 0:a.accessor)?"st-hovered":""," ").concat((null===(d=I.current)||void 0===d?void 0:d.accessor)===g.accessor?"st-dragging":""," ").concat(J?"clickable":""," ").concat(x&&!J?"columnReordering":""," ").concat("right"===(null==g?void 0:g.align)?"right-aligned":"center"===(null==g?void 0:g.align)?"center-aligned":""," ").concat(g.children?"parent":""),q=E({draggedHeaderRef:I,headersRef:y,hoveredHeaderRef:M,onColumnOrderChange:S,onTableHeaderDragEnd:k}),K=q.handleDragStart,G=q.handleDragEnd,Y=q.handleDragOver,_=R(),$=function(e){var n=e.event,t=e.header;if(L){var r=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var d=a[i];o=r(d,o)}return o};return r(e,n),t}(t,c);return n.shiftKey&&H?A((function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort((function(e,n){return e-n})),o=t[0],a=Math.abs(n-o);t.forEach((function(e){var t=Math.abs(n-e);t<a&&(a=t,o=e)}));var d,c,s,l,u=i(i([],(d=o,c=n,s=Math.min(d,c),l=Math.max(d,c),Array.from({length:l-s+1},(function(e,n){return s+n}))),!0),r,!0);return new Set(i(i([],Array.from(e),!0),u,!0))})):H&&H(r),F(new Set),void N(null)}t.isSortable&&j(c,t.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!g)return null;var Q=C&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;_({callback:X,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:l,gridColumnStart:u,header:g,headersRef:y,setIsWidthDragging:B,setMainBodyWidth:T,setPinnedLeftWidth:P,setPinnedRightWidth:O,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),Z=w&&w.key.accessor===g.accessor&&e.jsxs("div",t({className:"st-sort-icon-container",onClick:function(e){return $({event:e,header:g})}},{children:["ascending"===w.direction&&U&&U,"descending"===w.direction&&z&&z]}));return e.jsxs("div",t({className:V,id:v({accessor:g.accessor,rowIndex:0}),onDragOver:function(e){_({callback:Y,callbackProps:{event:e,hoveredHeader:g},limit:50})},ref:o,style:t(t({gridRowStart:f,gridRowEnd:h,gridColumnStart:u,gridColumnEnd:l},l-u>1?{}:{width:g.width}),h-f>1?{}:{height:D})},{children:[m&&Q,e.jsxs("div",t({className:"st-header-label ".concat("right"===g.align?"right-aligned":"center"===g.align?"center-aligned":""),draggable:x&&!g.disableReorder,onClick:function(e){return $({event:e,header:g})},onDragEnd:function(e){e.preventDefault(),G(),s()},onDragStart:function(e){x&&g&&function(e){K(e)}(g)}},{children:["right"===g.align&&Z,null==g?void 0:g.label,"right"!==g.align&&Z]})),!m&&Q]}))})),_=function(r){var o=r.columnIndices,i=r.gridTemplateColumns,a=r.handleScroll,d=r.headersRef,c=r.hiddenColumns,s=r.maxDepth,l=r.pinned,u=r.sectionRef,h=r.sort,f=n.useReducer((function(e){return e+1}),0)[1],v=n.useMemo((function(){var e=[],n=1,t=function(r,i,a){var d,u;if(void 0===a&&(a=!1),!g({hiddenColumns:c,header:r,pinned:l}))return 0;a||n++;var h=null!==(u=null===(d=r.children)||void 0===d?void 0:d.filter((function(e){return g({hiddenColumns:c,header:e,pinned:l})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,m=i,w=h>0?i+1:s+1;if(e.push({header:r,gridColumnStart:f,gridColumnEnd:v,gridRowStart:m,gridRowEnd:w,colIndex:o[r.accessor]}),r.children){var p=!0;r.children.forEach((function(e){g({hiddenColumns:c,header:e,pinned:l})&&(t(e,i+1,p),p=!1)}))}return v-f},r=d.current.filter((function(e){return g({hiddenColumns:c,header:e,pinned:l})})),i=!0;return r.forEach((function(e){t(e,1,i),i=!1})),e}),[d,c,s,l,o]);return e.jsx("div",t({className:"st-header-".concat(l?"pinned-".concat(l):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(D,t({rowIndex:0},{children:v.map((function(t){return e.jsx(Y,{colIndex:t.colIndex,forceHeadersUpdate:f,gridColumnEnd:t.gridColumnEnd,gridColumnStart:t.gridColumnStart,gridRowEnd:t.gridRowEnd,gridRowStart:t.gridRowStart,header:t.header,ref:n.createRef(),reverse:"right"===l,sort:h},t.header.accessor)}))}))}))},$=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map($)):1},Q=function(r){var o=r.centerHeaderRef,i=r.headerContainerRef,a=r.headersRef,d=r.hiddenColumns,c=r.mainTemplateColumns,s=r.pinnedLeftColumns,l=r.pinnedLeftTemplateColumns,u=r.pinnedRightColumns,h=r.pinnedRightTemplateColumns,f=r.sort,v=W(),m=v.mainBodyRef,w=v.pinnedLeftRef,p=v.pinnedRightRef,x=v.setPinnedLeftWidth,C=v.setPinnedRightWidth;A(m,o);var I=n.useMemo((function(){return O({headersRef:a,hiddenColumns:d,pinnedLeftColumns:s,pinnedRightColumns:u})}),[a,d,s,u]),R=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(g({hiddenColumns:d,header:e})){var t=$(e);n=Math.max(n,t)}})),{maxDepth:n}}),[a,d]).maxDepth;return n.useLayoutEffect((function(){var e,n;x(z(null===(e=w.current)||void 0===e?void 0:e.clientWidth)),C(z(null===(n=p.current)||void 0===n?void 0:n.clientWidth))}),[w,p,x,C]),e.jsxs("div",t({className:"st-header-container",ref:i},{children:[s.length>0&&e.jsx(_,{columnIndices:I,gridTemplateColumns:l,handleScroll:void 0,headersRef:a,hiddenColumns:d,maxDepth:R,pinned:"left",sectionRef:w,sort:f}),e.jsx(_,{columnIndices:I,gridTemplateColumns:c,handleScroll:function(e){var n,t,r=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==r&&(null===(t=m.current)||void 0===t||t.scrollTo(r,0))},headersRef:a,hiddenColumns:d,maxDepth:R,sectionRef:o,sort:f}),u.length>0&&e.jsx(_,{columnIndices:I,gridTemplateColumns:h,handleScroll:void 0,headersRef:a,hiddenColumns:d,maxDepth:R,pinned:"right",sectionRef:p,sort:f})]}))},Z=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)})).join(" "))},ee=function(r){var o=r.flattenedRows,i=r.isWidthDragging,a=r.pinnedLeftWidth,d=r.pinnedRightWidth,c=r.setFlattenedRows,s=r.setScrollTop,l=r.sort,u=r.visibleRows,h=W(),f=h.editColumns,v=h.headersRef,g=h.hiddenColumns,m=n.useRef(null),w=n.useRef(null),p=v.current.filter((function(e){return!e.pinned})),x=v.current.filter((function(e){return"left"===e.pinned})),C=v.current.filter((function(e){return"right"===e.pinned})),I=n.useMemo((function(){return Z({headers:x,hiddenColumns:g})}),[x,g]),R=n.useMemo((function(){return Z({headers:p,hiddenColumns:g})}),[p,g]),b=n.useMemo((function(){return Z({headers:C,hiddenColumns:g})}),[C,g]),y={centerHeaderRef:w,headerContainerRef:m,headersRef:v,hiddenColumns:g,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightTemplateColumns:b,sort:l},M={flattenedRows:o,headerContainerRef:m,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftTemplateColumns:I,pinnedLeftWidth:a,pinnedRightColumns:C,pinnedRightTemplateColumns:b,pinnedRightWidth:d,setFlattenedRows:c,setScrollTop:s,visibleRows:u};return e.jsxs("div",t({className:"st-content",style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Q,t({},y)),e.jsx(F,t({},M))]}))},ne=function(r){var o,i,a=r.mainBodyWidth,d=r.mainBodyRef,c=r.pinnedLeftWidth,s=r.pinnedRightWidth,l=r.setMainBodyWidth,u=r.tableBodyContainerRef,h=W().editColumns,f=n.useState(!1),v=f[0],g=f[1],m=n.useRef(null),w=u.current&&u.current.scrollHeight>u.current.clientHeight,p=h?28:0,x=(h?s+1:s)+(u.current&&w?u.current.offsetWidth-u.current.clientWidth:0);return A(d,m),n.useEffect((function(){!function(){if(d.current){var e=d.current.scrollWidth;l(e)}}()}),[d,l]),n.useEffect((function(){setTimeout((function(){!function(){if(d.current){var e=d.current.clientWidth;g(a>e)}}()}),1)}),[d,a,l]),v?e.jsxs("div",t({className:"st-horizontal-scrollbar-container"},{children:[c>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:c,height:null===(o=m.current)||void 0===o?void 0:o.offsetHeight}}),a>0&&e.jsx("div",t({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&d.current&&d.current.scrollTo({left:n,behavior:"auto"})},ref:m,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})})),s>0&&e.jsx(e.Fragment,{children:e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:x,height:null===(i=m.current)||void 0===i?void 0:i.offsetHeight}})}),p>0&&e.jsx("div",{style:{width:p-1.5,height:"100%",flexShrink:0}})]})):null},te={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return te.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?te.string(e,n,t):"number"==typeof e&&"number"==typeof n?te.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?te.boolean(e,n,t):te.string(String(e),String(n),t)}},re=function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return te.number(i,a,r)}return"date"===t?te.date(String(e),String(n),r):"boolean"===t?te.boolean(Boolean(e),Boolean(n),r):"enum"===t?te.enum(String(e),String(n),r):te.string(String(e),String(n),r)},oe=function(e,n,r){var o,a=(null===(o=n.key)||void 0===o?void 0:o.type)||"string",d=n.direction,c=new Map,s=new Map,l="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(c.size)).toString();l=r,s.set(l,e),c.has(l)||c.set(l,[])}else if(l){var o=c.get(l)||[];o.push(e),c.set(l,o)}else{var i="default";c.has(i)||c.set(i,[]),null===(t=c.get(i))||void 0===t||t.push(e)}}));var u=[];return c.forEach((function(e,o){if(s.has(o)){var c=s.get(o);c.rowMeta.children&&c.rowMeta.children.length>0&&(c.rowMeta.children=ie(c.rowMeta.children,n,r)),u.push(c)}var l=i([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],i=t.rowData[r];return re(o,i,a,d)}));u.push.apply(u,l.map((function(e){var o=t({},e);if(o.rowMeta.children&&o.rowMeta.children.length>0){var i=ie(o.rowMeta.children,n,r);o.rowMeta=t(t({},o.rowMeta),{children:i})}return o})))})),u},ie=function(e,n,r){var o=r.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",d=n.direction;return i([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],i=t.rowData[r];return re(o,i,a,d)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?t(t({},e),{rowMeta:t(t({},e.rowMeta),{children:ie(e.rowMeta.children,n,r)})}):e}))},ae=function(e){var t=e.headers,r=e.tableRows,o=n.useState(null),i=o[0],a=o[1],d=n.useMemo((function(){var e={};return t.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[t]),c=n.useState(d),s=c[0],l=c[1],u=n.useMemo((function(){if(!i)return r;var e=function(e,n,t){return{sortedData:oe(n,t,e),newSortConfig:t}}(t,r,i).sortedData;return e}),[r,i,t]);return{hiddenColumns:s,setHiddenColumns:l,setSort:a,sort:i,sortedRows:u,updateSort:function(e,n){var r=function(e){for(var t=0,o=e;t<o.length;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(t);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},de=function(n){var r=n.checked,o=void 0!==r&&r,i=n.children,a=n.onChange;return e.jsxs("label",t({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e.jsx("span",t({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},ce=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var d=a.children.some((function(e){return e.accessor===n})),c=!1;if(!d)for(var s=0,l=a.children;s<l.length;s++){var u=l[s];if(ce([u],n,t,r),!1===t[u.accessor]){c=!0;break}}(d||c)&&(t[a.accessor]=!1)}}},se=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},le=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(le(e.children,n),se(e.children,n)&&(n[e.accessor]=!0))}))},ue=function(r){var o=r.allHeaders,i=r.depth,a=void 0===i?0:i,d=r.header,c=r.hiddenColumns,s=r.setHiddenColumns,l=n.useState(!0),u=l[0],h=l[1],f=W(),v=f.expandIcon,g=f.collapseIcon,m=f.headersRef,w=f.setMainBodyWidth,p=f.setPinnedLeftWidth,x=f.setPinnedRightWidth,C="".concat(16*a,"px"),I=d.children&&d.children.length>0,R=c[d.accessor]||I&&d.children&&se(d.children,c);return e.jsxs(e.Fragment,{children:[e.jsxs("div",t({className:"st-header-checkbox-item",style:{paddingLeft:C}},{children:[e.jsx("div",t({className:"st-header-icon-container"},{children:I?e.jsx("div",t({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),h(!u)}},{children:u?g:v})):null})),e.jsx(de,t({checked:R,onChange:function(e){var n=t({},c);(n[d.accessor]=e,e)?le(o,n):(ce(o,d.accessor,n),I&&d.children&&d.children.length>0&&d.children.every((function(e){return!0===c[e.accessor]}))&&d.children[0]&&(n[d.children[0].accessor]=!1,ce(o,d.children[0].accessor,n)));s(n),m.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,d=0;n.forEach((function(e){if(!e.hide){var n=U(e).reduce((function(e,n){return e+J(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:d+=n}}));var c=z(i),s=z(a);r(c),o(s),t(d)}({headers:m.current,setMainBodyWidth:w,setPinnedLeftWidth:p,setPinnedRightWidth:x})}},{children:d.label}))]})),I&&u&&d.children&&e.jsx("div",t({className:"st-nested-headers"},{children:d.children.map((function(n,t){return e.jsx(ue,{allHeaders:o,depth:a+1,header:n,hiddenColumns:c,setHiddenColumns:s},"".concat(n.accessor,"-").concat(t))}))}))]})},he=function(n){var r=n.headers,o=n.open,i=n.position,a=n.setHiddenColumns,d=n.hiddenColumns,c="left"===i?"left":"";return e.jsx("div",t({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(c),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",t({className:"st-column-editor-popout-content"},{children:r.map((function(n,t){return e.jsx(ue,{header:n,hiddenColumns:d,setHiddenColumns:a,allHeaders:r},"".concat(n.accessor,"-").concat(t))}))}))}))},fe=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,d=r.headers,c=r.hiddenColumns,s=r.position,l=void 0===s?"right":s,u=r.setHiddenColumns,h=n.useState(a),f=h[0],v=h[1];return i?e.jsxs("div",t({className:"st-column-editor ".concat(f?"open":""," ").concat(l),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e.jsx("div",t({className:"st-column-editor-text"},{children:o})),e.jsx(he,{headers:d,open:f,position:l,setHiddenColumns:u,hiddenColumns:c})]})):null},ve=function(r){var o=r.allowAnimations,i=void 0!==o&&o,h=r.cellUpdateFlash,f=void 0!==h&&h,v=r.collapseIcon,g=void 0===v?e.jsx(u,{className:"st-sort-icon"}):v,w=r.columnEditorPosition,p=void 0===w?"right":w,x=r.columnEditorText,C=void 0===x?"Columns":x,I=r.columnReordering,R=void 0!==I&&I,b=r.columnResizing,y=void 0!==b&&b,M=r.defaultHeaders,E=r.editColumns,S=void 0!==E&&E,W=r.editColumnsInitOpen,k=void 0!==W&&W,D=r.expandIcon,H=void 0===D?e.jsx(s,{className:"st-sort-icon"}):D,L=r.height,N=r.hideFooter,B=void 0!==N&&N,T=r.nextIcon,P=void 0===T?e.jsx(s,{className:"st-next-prev-icon"}):T,O=r.onCellEdit,F=r.onColumnOrderChange,A=r.onGridReady,z=r.onNextPage,U=r.prevIcon,J=void 0===U?e.jsx(c,{className:"st-next-prev-icon"}):U,V=r.rowHeight,q=void 0===V?40:V,K=r.rows,X=r.rowsPerPage,G=void 0===X?10:X,Y=r.selectableCells,_=void 0!==Y&&Y,$=r.selectableColumns,Q=void 0!==$&&$,Z=r.shouldPaginate,te=void 0!==Z&&Z,re=r.sortDownIcon,oe=void 0===re?e.jsx(u,{className:"st-sort-icon"}):re,ie=r.sortUpIcon,de=void 0===ie?e.jsx(l,{className:"st-sort-icon"}):ie,ce=r.tableRef,se=r.theme,le=void 0===se?"light":se,ue=n.useRef(null),he=n.useRef(M),ve=n.useRef(null),ge=n.useRef(null),me=n.useRef(null),we=n.useRef(null),pe=n.useRef(null),xe=n.useState(1),Ce=xe[0],Ie=xe[1],Re=n.useState(!1),be=Re[0],ye=Re[1],Me=n.useState(0),Ee=Me[0],Se=Me[1],je=n.useState(0),We=je[0],ke=je[1],De=n.useState(0),He=De[0],Le=De[1],Ne=n.useState(0),Be=Ne[0],Te=Ne[1],Pe=n.useState(0),Oe=Pe[0],Fe=Pe[1],Ae=ae({headers:he.current,tableRows:K}),ze=Ae.sort,Ue=Ae.sortedRows,Je=Ae.hiddenColumns,Ve=Ae.setHiddenColumns,qe=Ae.updateSort;n.useEffect((function(){null==A||A()}),[A]);var Ke=n.useMemo((function(){if(!te)return Ue;var e=(Ce-1)*G,n=e+G;return Ue.slice(e,n)}),[Ce,G,te,Ue]),Xe=n.useState(Ke),Ge=Xe[0],Ye=Xe[1];n.useEffect((function(){Ye(Ke)}),[Ke]);var _e=n.useMemo((function(){var e;if(!L)return window.innerHeight-q;var n=document.querySelector(".simple-table-root"),t=0;if(L.endsWith("px"))t=parseInt(L,10);else if(L.endsWith("vh")){var r=parseInt(L,10);t=window.innerHeight*r/100}else if(L.endsWith("%")){var o=parseInt(L,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-q)}),[L,q]),$e=n.useMemo((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,d=[],c=0,s=Math.max(0,i-a*n),l=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=c*a;if(h>=l)break;h+a>s&&d.push({row:i,depth:n,position:c,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),c+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),d}({bufferRowCount:5,contentHeight:_e,flattenedRows:Ge,rowHeight:q,scrollTop:Be})}),[_e,q,Ge,Be]),Qe=n.useReducer((function(e){return e+1}),0)[1],Ze=function(e){var t=e.selectableCells,r=e.headers,o=e.visibleRows,i=n.useState(new Set),d=i[0],c=i[1],s=n.useState(new Set),l=s[0],u=s[1],h=n.useState(null),f=h[0],v=h[1],g=n.useState(null),m=g[0],w=g[1],p=n.useRef(!1),x=n.useRef(null),C=n.useCallback((function(){var e=Array.from(d).reduce((function(e,n){var t=n.split("-").map(Number),i=t[0],a=t[1];return e[i]||(e[i]=[]),e[i][a]=o[i].row.rowData[r[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");d.size>0&&navigator.clipboard.writeText(n)}),[r,d,o]),I=n.useCallback((function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),d=Math.min(e.colIndex,n.colIndex),s=Math.max(e.colIndex,n.colIndex),l=r;l<=i;l++)for(var h=d;h<=s;h++)if(l>=0&&l<o.length){var f=o[l].row.rowMeta.rowId;t.add(a({colIndex:h,rowIndex:l,rowId:f}))}u(new Set),v(null),c(t)}),[o,u,v,c]),R=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<r.length){var n=a(e);u(new Set),v(null),c(new Set([n])),w(e)}}),[r.length,o.length,u,v,c,w]),b=n.useCallback((function(e,n){void 0===n&&(n=!1),c(new Set),w(null),u((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&v(e[e.length-1])}),[c,w,u,v]);n.useEffect((function(){var e=function(e){if(t&&m){var n=m.rowIndex,i=m.colIndex,a=m.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var d=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===d)return;n=d}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var s={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};R(s)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(s={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},R(s))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(s={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},R(s))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<r.length-1&&(s={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},R(s))):"Escape"===e.key&&(c(new Set),u(new Set),v(null),x.current=null,w(null))}else C()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[C,r.length,m,I,R,t,o]);var y=n.useCallback((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=a({colIndex:n,rowIndex:t,rowId:r}),i=d.has(o),c=l.has(n);return i||c}),[d,l]),M=n.useCallback((function(e){var n,t,r,i,a,d,c=e.colIndex,s=e.rowIndex,u=e.rowId,h=[],f=null===(r=null===(t=null===(n=o[s-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===r?void 0:r.rowId,v={colIndex:c,rowIndex:s+1,rowId:null===(d=null===(a=null===(i=o[s+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===d?void 0:d.rowId},g={colIndex:c-1,rowIndex:s,rowId:u},m={colIndex:c+1,rowIndex:s,rowId:u};return(!y({colIndex:c,rowIndex:s-1,rowId:f})||l.has(c)&&0===s)&&h.push("st-selected-top-border"),(!y(v)||l.has(c)&&s===o.length-1)&&h.push("st-selected-bottom-border"),y(g)||h.push("st-selected-left-border"),y(m)||h.push("st-selected-right-border"),h.join(" ")}),[y,o,l]),E=n.useMemo((function(){return m?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===m.rowIndex&&t===m.colIndex&&r===m.rowId}:function(){return!1}}),[m]);return{getBorderClass:M,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){p.current=!0,x.current={rowIndex:r,colIndex:n,rowId:o},u(new Set),v(null);var i=a({colIndex:n,rowIndex:r,rowId:o});c(new Set([i])),w({rowIndex:r,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&p.current&&x.current){for(var i=new Set,d=Math.min(x.current.rowIndex,r),s=Math.max(x.current.rowIndex,r),l=Math.min(x.current.colIndex,n),u=Math.max(x.current.colIndex,n),h=d;h<=s;h++)for(var f=l;f<=u;f++)if(h>=0&&h<o.length){var v=o[h].row.rowMeta.rowId;i.add(a({colIndex:f,rowIndex:h,rowId:v}))}c(i)}},handleMouseUp:function(){p.current=!1},isInitialFocusedCell:E,isSelected:y,lastSelectedColumnIndex:f,selectColumns:b,selectedCells:d,selectedColumns:l,setInitialFocusedCell:w,setSelectedCells:c,setSelectedColumns:u}}({selectableCells:_,headers:he.current,visibleRows:$e}),en=Ze.getBorderClass,nn=Ze.handleMouseDown,tn=Ze.handleMouseOver,rn=Ze.handleMouseUp,on=Ze.isInitialFocusedCell,an=Ze.isSelected,dn=Ze.selectColumns,cn=Ze.setInitialFocusedCell,sn=Ze.setSelectedCells,ln=Ze.setSelectedColumns,un=n.useCallback((function(e,n){qe(e,n)}),[qe]),hn=n.useCallback((function(e){he.current=e,Qe()}),[]);n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Q&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(sn(new Set),Q&&ln(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Q,sn,ln]),n.useLayoutEffect((function(){if(pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth;Fe(e)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Qe(),pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth;Fe(e)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]);var fn=n.useRef(new Map);return n.useEffect((function(){ce&&(ce.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,d=e.newValue,c=null===(t=null===(n=null==K?void 0:K[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==c){var s=m({rowId:c,accessor:i}),l=fn.current.get(s);l&&l.updateContent(d),void 0!==(null===(o=null===(r=null==K?void 0:K[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(K[a].rowData[i]=d)}}})}),[ce,K]),e.jsx(j,t({value:{allowAnimations:i,cellRegistry:fn.current,cellUpdateFlash:f,collapseIcon:g,columnReordering:R,columnResizing:y,draggedHeaderRef:ue,editColumns:S,expandIcon:H,forceUpdate:Qe,getBorderClass:en,handleMouseDown:nn,handleMouseOver:tn,headersRef:he,hiddenColumns:Je,hoveredHeaderRef:ve,isInitialFocusedCell:on,isSelected:an,mainBodyRef:ge,onCellEdit:O,onColumnOrderChange:F,onSort:un,onTableHeaderDragEnd:hn,pinnedLeftRef:me,pinnedRightRef:we,rowHeight:q,scrollbarWidth:Oe,selectColumns:dn,selectableColumns:Q,setInitialFocusedCell:cn,setIsWidthDragging:ye,setMainBodyWidth:Se,setPinnedLeftWidth:ke,setPinnedRightWidth:Le,setSelectedCells:sn,setSelectedColumns:ln,shouldPaginate:te,sortDownIcon:oe,sortUpIcon:de,tableBodyContainerRef:pe}},{children:e.jsxs("div",t({className:"simple-table-root st-wrapper theme-".concat(le),style:L?{height:L}:{}},{children:[e.jsxs("div",t({className:"st-wrapper-container"},{children:[e.jsxs("div",t({className:"st-content-wrapper",onMouseUp:rn,onMouseLeave:rn},{children:[e.jsx(ee,{flattenedRows:Ge,isWidthDragging:be,pinnedLeftWidth:We,pinnedRightWidth:He,setFlattenedRows:Ye,setScrollTop:Te,sort:ze,visibleRows:$e}),e.jsx(fe,{columnEditorText:C,editColumns:S,editColumnsInitOpen:k,headers:he.current,hiddenColumns:Je,position:p,setHiddenColumns:Ve})]})),e.jsx(ne,{mainBodyRef:ge,mainBodyWidth:Ee,pinnedLeftWidth:We,pinnedRightWidth:He,setMainBodyWidth:Se,tableBodyContainerRef:pe})]})),e.jsx(d,{currentPage:Ce,hideFooter:B,nextIcon:P,onPageChange:Ie,onNextPage:z,prevIcon:J,shouldPaginate:te,totalPages:Math.ceil(K.length/G)})]}))}))};exports.SimpleTable=function(r){var o=n.useState(!1),i=o[0],a=o[1];return n.useEffect((function(){a(!0)}),[]),i?e.jsx(ve,t({},r)):null};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=function(){return t=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},t.apply(this,arguments)};function r(e,n,t,r){return new(t||(t=Promise))((function(o,i){function a(e){try{s(r.next(e))}catch(e){i(e)}}function d(e){try{s(r.throw(e))}catch(e){i(e)}}function s(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(a,d)}s((r=r.apply(e,n||[])).next())}))}function o(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=d(0),a.throw=d(1),a.return=d(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function d(d){return function(s){return function(d){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,d[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return i.label++,{value:d[1],done:!1};case 5:i.label++,r=d[1],d=[0];continue;case 7:d=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==d[0]&&2!==d[0])){i=0;continue}if(3===d[0]&&(!o||d[1]>o[0]&&d[1]<o[3])){i.label=d[1];break}if(6===d[0]&&i.label<o[1]){i.label=o[1],o=d;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(d);break}o[2]&&i.ops.pop(),i.trys.pop();continue}d=n.call(e,i)}catch(e){d=[6,e],r=0}finally{t=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([d,s])}}}function i(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var a=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},d=function(i){var a=i.currentPage,d=i.hideFooter,s=i.nextIcon,c=i.onPageChange,l=i.onNextPage,u=i.prevIcon,h=i.shouldPaginate,f=i.totalPages,v=n.useState(!0),g=v[0],m=v[1],w=!(a>1),p=!(a<f)&&!l||!g&&a===f;if(d||!h)return null;var x=function(){if(f<=15)return Array.from({length:f},(function(e,n){return n+1}));var e,n,t=[],r=15;if(a<=Math.ceil(7.5))e=1,n=14;else if(a>=f-Math.floor(7.5))e=Math.max(1,f-r+1),n=f;else{var o=Math.floor(7);e=a-o,n=a+(r-o-1)}for(var i=e;i<=n;i++)t.push(i);return n<f-1&&(t.push(-1),t.push(f)),t}();return e.jsxs("div",t({className:"st-footer"},{children:[e.jsx("button",t({className:"st-next-prev-btn ".concat(w?"disabled":""),onClick:function(){var e=a-1;e>=1&&c(e)},disabled:w},{children:u})),e.jsx("button",t({className:"st-next-prev-btn ".concat(p?"disabled":""),onClick:function(){return r(void 0,void 0,void 0,(function(){var e,n;return o(this,(function(t){switch(t.label){case 0:return e=a===f,n=a+1,l&&e?[4,l(a)]:[3,2];case 1:if(!t.sent())return m(!1),[2];t.label=2;case 2:return(n<=f||l)&&c(n),[2]}}))}))},disabled:p},{children:s})),x.map((function(n,r){return n<0?e.jsx("span",t({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e.jsx("button",t({onClick:function(){return function(e){e>=1&&e<=f&&c(e)}(n)},className:"st-page-btn ".concat(a===n?"active":"")},{children:n}),"page-".concat(n))}))]}))},s=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},c=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},l=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},u=function(n){var r=n.className;return e.jsx("svg",t({className:r,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 7.59L10 12.17l4.59-4.58L16 9l-6 6-6-6z"})}))},h=function(e){return e.position*(e.rowHeight+1)-1},f=function(e){return e.position*(e.rowHeight+1)},v=function(e){var n=e.accessor,t=e.rowIndex;return"cell-".concat(n,"-").concat(t)},g=function(e){var n=e.hiddenColumns,t=e.header,r=e.pinned;return n[t.accessor]?null:!r&&!t.pinned||t.pinned===r||null},m=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},w=function(n){var r=n.value,o=n.onBlur,i=n.onChange;return e.jsxs("select",t({value:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;i("true"===n)}},{children:[e.jsx("option",t({value:"true"},{children:"True"})),e.jsx("option",t({value:"false"},{children:"False"}))]}))},p=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){var n=e.target.value;i(n)}})},x=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:r.toString(),onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)}})},C=function(n){var t=n.onChange,r=n.setIsEditing,o=n.value,i=function(e){null==t||t(e)},a=function(){r(!1)};return e.jsx(e.Fragment,{children:"string"==typeof o||null==o?e.jsx(p,{defaultValue:o,onBlur:a,onChange:i}):"boolean"==typeof o?e.jsx(w,{onBlur:a,onChange:i,value:o}):"number"==typeof o?e.jsx(x,{defaultValue:o,onBlur:a,onChange:i}):null})},I=0,R=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===I||o-I>=r)&&(I=o,n(t))}},b=Date.now(),y={screenX:0,screenY:0},M=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return i(i([],t,!0),[r],!1);if(o.children&&o.children.length>0){var a=M(o.children,n,i(i([],t,!0),[r],!1));if(a)return a}}return null};var E=function(e){var t,r,o=e.draggedHeaderRef,i=e.headersRef,a=e.hoveredHeaderRef,d=e.onColumnOrderChange,s=e.onTableHeaderDragEnd,c=(t=i.current,r=n.useRef(t),n.useEffect((function(){JSON.stringify(r.current)!==JSON.stringify(t)&&(r.current=t)}),[t]),r.current);return{handleDragStart:function(e){o.current=e,b=Date.now()},handleDragOver:function(e){var n,t,r=e.event,d=e.hoveredHeader;if(r.preventDefault(),i.current){var l=r.currentTarget.getAnimations().some((function(e){return"running"===e.playState})),u=r.screenX,h=r.screenY,f=Math.sqrt(Math.pow(u-y.screenX,2)+Math.pow(h-y.screenY,2));a.current=d;var v=i.current,g=M(v,(null===(n=o.current)||void 0===n?void 0:n.accessor)||""),m=M(v,d.accessor);if(g&&m){var w=g.length,p=m.length,x=m;if(w!==p){var C=p-w;C>0&&(x=m.slice(0,-C))}var I=function(e,n,t){var r=JSON.parse(JSON.stringify(e)),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var d=i(r,n);return a(r,n,i(r,t)),a(r,t,d),{newHeaders:r,emergencyBreak:o}}(v,g,x),R=I.newHeaders,E=I.emergencyBreak;if(!(l||d.accessor===(null===(t=o.current)||void 0===t?void 0:t.accessor)||null===o.current||f<10||0===g.length||0===x.length||JSON.stringify(R)===JSON.stringify(i.current)||E)){var S=Date.now();JSON.stringify(R)===JSON.stringify(c)&&(S-b<1500||f<40)||(b=S,y={screenX:u,screenY:h},s(R))}}}},handleDragEnd:function(){o.current=null,a.current=null,null==d||d(i.current)}}},S=n.createContext(void 0),j=function(n){var r=n.children,o=n.value;return e.jsx(S.Provider,t({value:o},{children:r}))},W=function(){var e=n.useContext(S);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},k=n.forwardRef((function(r,o){var i,a,d=r.borderClass,s=r.colIndex,c=r.header,l=r.isHighlighted,u=r.isInitialFocused,h=r.onExpandRowClick,f=r.rowIndex,g=r.visibleRow,w=W(),p=w.cellRegistry,x=w.cellUpdateFlash,I=w.collapseIcon,b=w.draggedHeaderRef,y=w.expandIcon,M=w.handleMouseDown,S=w.handleMouseOver,j=w.headersRef,k=w.hoveredHeaderRef,D=w.onCellEdit,H=w.onTableHeaderDragEnd,L=g.depth,N=g.row,B=n.useState(N.rowData[c.accessor]),T=B[0],P=B[1],O=n.useState(!1),F=O[0],A=O[1],z=n.useState(!1),U=z[0],J=z[1],V=n.useRef(null),q=E({draggedHeaderRef:b,headersRef:j,hoveredHeaderRef:k,onTableHeaderDragEnd:H}).handleDragOver,K=R(),X="cell-".concat(f,"-").concat(s),G=m({rowId:N.rowMeta.rowId,accessor:c.accessor});n.useEffect((function(){if(p){var e="".concat(N.rowMeta.rowId,"-").concat(c.accessor);return p.set(e,{updateContent:function(e){T!==e?(P(e),x&&(J(!0),V.current&&clearTimeout(V.current),V.current=setTimeout((function(){J(!1)}),800))):P(e)}}),function(){p.delete(e),V.current&&clearTimeout(V.current)}}}),[p,x,N.rowMeta.rowId,c.accessor,T]),n.useEffect((function(){if(U){var e=setTimeout((function(){J(!1)}),850);return function(){return clearTimeout(e)}}}),[U]),n.useEffect((function(){P(N.rowData[c.accessor])}),[N.rowData,c.accessor]);var Y=Boolean(null===(a=null===(i=N.rowMeta)||void 0===i?void 0:i.children)||void 0===a?void 0:a.length),_=Boolean(null==c?void 0:c.isEditable),$="st-cell ".concat(L>0&&c.expandable?"st-cell-depth-".concat(L):""," ").concat(l?u?"st-cell-selected-first ".concat(d):"st-cell-selected ".concat(d):""," ").concat(_?"clickable":""," ").concat(U?"st-cell-updating":""),Q=n.useCallback((function(e){P(e),null==D||D({accessor:c.accessor,newValue:e,row:N})}),[c.accessor,D,N]);return F?e.jsx("div",t({className:"st-cell-editing",id:v({accessor:c.accessor,rowIndex:f+1})},{children:e.jsx(C,{onChange:Q,setIsEditing:A,value:T})})):e.jsxs("div",t({className:$,id:X,onDoubleClick:function(){return c.isEditable&&A(!0)},onMouseDown:function(){return M({rowIndex:f,colIndex:s,rowId:N.rowMeta.rowId})},onMouseOver:function(){return S({rowIndex:f,colIndex:s,rowId:N.rowMeta.rowId})},onDragOver:function(e){return K({callback:q,callbackProps:{event:e,hoveredHeader:c},limit:50})},onKeyDown:function(e){"F2"!==e.key&&"Enter"!==e.key||!c.isEditable||F||(e.preventDefault(),A(!0))},ref:o,"data-row-index":f,"data-col-index":s,"data-row-id":N.rowMeta.rowId,"data-accessor":c.accessor},{children:[c.expandable&&Y?N.rowMeta.isExpanded?e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return h(N.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:I})):e.jsx("div",t({className:"st-sort-icon-container",onClick:function(){return h(N.rowMeta.rowId)},onMouseDown:function(e){e.stopPropagation()}},{children:y})):null,e.jsx("span",t({className:"st-cell-content ".concat("right"===c.align?"right-aligned":"center"===c.align?"center-aligned":"")},{children:c.cellRenderer?c.cellRenderer({accessor:c.accessor,colIndex:s,row:N}):T}))]}),G)})),D=function(n){var r=n.children,o=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children"]);return W().allowAnimations?e.jsx(H,t({},o,{children:r})):e.jsx(e.Fragment,{children:r})},H=function(t){var r=t.children,o=t.isBody,i=t.pauseAnimation,a=t.rowIndex,d=n.useRef(!1),s=W(),c=s.draggedHeaderRef,l=s.headersRef,u=s.mainBodyRef,h=s.shouldPaginate,f=n.useState({}),g=f[0],m=f[1],w=n.useRef({}),p=l.current;return n.useLayoutEffect((function(){if(p){var e=function(e){var n=e.currentHeaders,t=e.draggedHeaderRef,r=e.rowIndex,o={};return n.forEach((function(e){var n;if(e){var i=document.getElementById(v({accessor:e.accessor,rowIndex:r}));if(i){var a=i.getAnimations().some((function(e){return"running"===e.playState})),d=i.getBoundingClientRect();a&&(null===(n=null==t?void 0:t.current)||void 0===n?void 0:n.accessor)!==e.accessor?o[e.accessor]=!1:o[e.accessor]=d}}})),o}({currentHeaders:p,draggedHeaderRef:c,rowIndex:a});JSON.stringify(e)!==JSON.stringify(g)&&(w.current=g,m(e))}}),[g,p,c,o,a]),n.useLayoutEffect((function(){var e=u.current,n=function(){d.current=!0},t=function(){d.current=!1};return null==e||e.addEventListener("scroll",n),null==e||e.addEventListener("scrollend",t),function(){null==e||e.removeEventListener("scroll",n),null==e||e.removeEventListener("scrollend",t)}}),[c,u]),n.useEffect((function(){i||d.current||Object.keys(w.current).length&&p&&p.forEach((function(e){var n=document.getElementById(v({accessor:e.accessor,rowIndex:a}));if(n){var t=w.current[e.accessor],r=g[e.accessor];if(t&&r){var o=t.left-r.left,i=h?0:t.top-r.top,d=Math.abs(o),s=Math.abs(i);(d>10||s>10)&&requestAnimationFrame((function(){n.style.transform="translate(".concat(o,"px, ").concat(i,"px)"),n.style.transition="transform 0s",requestAnimationFrame((function(){n.style.transform="",n.style.transition="transform ".concat(400,"ms ease-out")}))}))}}}))}),[g,p,o,i,w,a,h]),e.jsx(e.Fragment,{children:r})},L=function(n){var r=n.columnIndices,o=n.headers,i=n.hiddenColumns,a=n.isWidthDragging,d=n.onExpandRowClick,s=n.pinned,c=n.rowIndex,l=n.rowIndices,u=n.visibleRow,h=o.filter((function(e){return g({hiddenColumns:i,header:e,pinned:s})}));return e.jsx(D,t({isBody:!0,pauseAnimation:a,rowIndex:c+1},{children:h.map((function(n){return e.jsx(N,{columnIndices:r,header:n,headers:o,hiddenColumns:i,onExpandRowClick:d,pinned:s,rowIndex:c,rowIndices:l,visibleRow:u},v({accessor:n.accessor,rowIndex:c+1}))}))}))},N=function(t){var r=t.columnIndices,o=t.header,i=t.headers,a=t.hiddenColumns,d=t.onExpandRowClick,s=t.pinned,c=t.rowIndex,l=t.rowIndices,u=t.visibleRow,h=r[o.accessor],f=W(),m=f.getBorderClass,w=f.isSelected,p=f.isInitialFocusedCell;if(o.children){var x=o.children.filter((function(e){return g({hiddenColumns:a,header:e,pinned:s})}));return e.jsx(n.Fragment,{children:x.map((function(n){return e.jsx(N,{columnIndices:r,header:n,headers:i,hiddenColumns:a,onExpandRowClick:d,pinned:s,rowIndex:c,rowIndices:l,visibleRow:u},v({accessor:n.accessor,rowIndex:c+1}))}))})}var C={rowIndex:c,colIndex:h,rowId:u.row.rowMeta.rowId},I=m(C),R=w(C),b=p(C);return e.jsx(k,{borderClass:I,colIndex:h,header:o,isHighlighted:R,isInitialFocused:b,onExpandRowClick:d,rowIndex:c,visibleRow:u},v({accessor:o.accessor,rowIndex:c+1}))},B=function(n){var r=n.columnIndices,o=n.gridTemplateColumns,i=n.headers,a=n.hiddenColumns,d=n.index,s=n.isWidthDragging,c=n.onExpandRowClick,l=n.pinned,u=n.rowHeight,h=n.rowIndices,v=n.visibleRow,g=v.position,m=g%2==0;return e.jsx("div",t({className:"st-row ".concat(m?"even":"odd"),style:{gridTemplateColumns:o,top:f({position:g,rowHeight:u}),height:"".concat(u,"px")}},{children:e.jsx(L,{columnIndices:r,headers:i,hiddenColumns:a,isWidthDragging:s,onExpandRowClick:c,pinned:l,rowIndex:d,rowIndices:h,visibleRow:v},d)}))},T=function(n){var r=n.displayStrongBorder,o=n.position,i=n.rowHeight,a=n.templateColumns;return e.jsx("div",t({className:"st-row-separator ".concat(r?"st-last-group-row":""),style:{display:"grid",gridTemplateColumns:a,position:"absolute",top:h({position:o,rowHeight:i}),minWidth:"100%"}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},P=function(r){var o=r.columnIndices,i=r.headers,a=r.hiddenColumns,d=r.isWidthDragging,s=r.onExpandRowClick,c=r.pinned,l=r.ref,u=r.rowHeight,h=r.rowIndices,f=r.templateColumns,v=r.totalHeight,g=r.visibleRows,m=r.width,w=c?"st-body-pinned-".concat(c):"st-body-main";return e.jsx("div",t({className:w,ref:l,style:t({position:"relative",height:"".concat(v,"px"),width:m},!c&&{flexGrow:1})},{children:g.map((function(t,r){var l,v,m=g[r-1],w=Boolean((null==m?void 0:m.depth)!==(null==t?void 0:t.depth)&&(null===(v=null===(l=null==t?void 0:t.row.rowMeta)||void 0===l?void 0:l.children)||void 0===v?void 0:v.length)&&0===t.depth);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(T,{displayStrongBorder:w,position:t.position,rowHeight:u,templateColumns:f}),e.jsx(B,{columnIndices:o,gridTemplateColumns:f,headers:i,hiddenColumns:a,index:r,isWidthDragging:d,onExpandRowClick:s,pinned:c,rowHeight:u,rowIndices:h,visibleRow:t})]},t.position)}))}))};function O(e){var n=e.headersRef,t=e.hiddenColumns,r=e.pinnedLeftColumns,o=e.pinnedRightColumns,i={},a=0,d=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter((function(e){return g({hiddenColumns:t,header:e})})).forEach((function(e,n){d(e,0===n)}))};return r.forEach((function(e,n){d(e,0===n)})),n.current.filter((function(e){return!e.pinned&&g({hiddenColumns:t,header:e})})).forEach((function(e,n){var t=0===n&&0===r.length;d(e,t)})),o.forEach((function(e){d(e,!1)})),i}var F=function(r){var o=r.flattenedRows,i=r.headerContainerRef,a=r.isWidthDragging,d=r.mainTemplateColumns,s=r.pinnedLeftColumns,c=r.pinnedLeftTemplateColumns,l=r.pinnedLeftWidth,u=r.pinnedRightColumns,h=r.pinnedRightTemplateColumns,f=r.pinnedRightWidth,v=r.setFlattenedRows,g=r.setScrollTop,m=r.visibleRows,w=W(),p=w.headersRef,x=w.hiddenColumns,C=w.mainBodyRef,I=w.rowHeight,R=w.scrollbarWidth,b=w.tableBodyContainerRef;!function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],d=i[1];n.useEffect((function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}}),[t,a,o]),n.useEffect((function(){var e=null==t?void 0:t.current,n=null==r?void 0:r.current;if(n&&e){var o=function(){if(n){var e=n.scrollHeight>n.clientHeight;d(e)}};o();var i=new ResizeObserver((function(){o()}));return i.observe(n),function(){n&&i.unobserve(n)}}}),[t,r])}({headerContainerRef:i,mainSectionRef:b,scrollbarWidth:R});var y,M,E=n.useRef(null),S=(y=0,(M=function(e){e.forEach((function(e){y+=1,e.rowMeta.isExpanded&&e.rowMeta.children&&M(e.rowMeta.children)}))})(o),y)*(I+1)-1,j=n.useMemo((function(){return O({headersRef:p,hiddenColumns:x,pinnedLeftColumns:s,pinnedRightColumns:u})}),[p,x,s,u]),k=n.useMemo((function(){var e={};return m.forEach((function(n,t){var r=String(n.row.rowMeta.rowId);e[r]=t})),e}),[m]),D=function(e){var n=function(r){return r.rowMeta.rowId===e&&r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{isExpanded:!r.rowMeta.isExpanded})}):r.rowMeta.children?t(t({},r),{rowMeta:t(t({},r.rowMeta),{children:r.rowMeta.children.map(n)})}):r};v((function(e){return e.map(n)}))},H={headerContainerRef:i,headers:p.current,hiddenColumns:x,isWidthDragging:a,rowHeight:I,visibleRows:m,columnIndices:j,rowIndices:k};return e.jsxs("div",t({className:"st-body-container",ref:b,onScroll:function(e){var n=e.currentTarget.scrollTop;E.current&&cancelAnimationFrame(E.current),E.current=requestAnimationFrame((function(){g(n)}))}},{children:[s.length>0&&e.jsx(P,t({},H,{onExpandRowClick:D,pinned:"left",templateColumns:c,totalHeight:S,width:l})),e.jsx(P,t({},H,{ref:C,onExpandRowClick:D,templateColumns:d,totalHeight:S})),u.length>0&&e.jsx(P,t({},H,{onExpandRowClick:D,pinned:"right",templateColumns:h,totalHeight:S,width:f}))]}))},A=function(e,t){n.useEffect((function(){if(e.current){var n=e.current,r=function(){var e,r=null==n?void 0:n.scrollLeft;void 0!==r&&(null===(e=t.current)||void 0===e||e.scrollTo(r,0))};return n.addEventListener("scroll",r),function(){null==n||n.removeEventListener("scroll",r)}}}),[e,t])},z=function(e){return void 0===e&&(e=0),e?e+1:0},U=function(e){return e.hide?[]:e.children&&0!==e.children.length?e.children.flatMap((function(e){return U(e)})):[e]},J=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(v({accessor:e.accessor,rowIndex:0}));return(null==n?void 0:n.offsetWidth)||150},V=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(v({accessor:e.accessor,rowIndex:0})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.forEach((function(e){V(e)}))},q=function(e){return"number"==typeof e.minWidth?e.minWidth:40},K=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=e.setMainBodyWidth,i=e.setPinnedLeftWidth,a=e.setPinnedRightWidth,d=function(e){var n=e.header,t=e.headers,r=e.newWidth,o=n.pinned,i=0;return t.forEach((function(e){e.hide||e.pinned!==o||(e.accessor===n.accessor?i+=r:U(e).forEach((function(e){e.hide||(e.accessor===n.accessor?i+=r:i+=J(e))})))})),n.pinned?z(i):i}({header:n,headers:t,newWidth:r});"left"===n.pinned?i(d):"right"===n.pinned?a(d):n.pinned||o(d)},X=function(e){var n=e.event,t=e.forceUpdate,r=e.gridColumnEnd,o=e.gridColumnStart,i=e.header,a=e.headersRef,d=e.setIsWidthDragging,s=e.setMainBodyWidth,c=e.setPinnedLeftWidth,l=e.setPinnedRightWidth,u=e.startWidth;d(!0),n.preventDefault();var h=n.clientX;if(i&&!i.hide){var f=q(i),v=r-o>1,g=v?U(i):[i],m=function(e){var n="right"===i.pinned?h-e.clientX:e.clientX-h;if(v&&g.length>1)G({delta:n,header:i,headersRef:a,leafHeaders:g,minWidth:f,setMainBodyWidth:s,setPinnedLeftWidth:c,setPinnedRightWidth:l,startWidth:u});else{var r=Math.max(u+n,f);i.width=r,K({header:i,headers:a.current,newWidth:r,setMainBodyWidth:s,setPinnedLeftWidth:c,setPinnedRightWidth:l})}a.current.forEach((function(e){V(e)})),t()},w=function(){document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",w),d(!1)};document.addEventListener("mousemove",m),document.addEventListener("mouseup",w)}},G=function(e){var n=e.delta,t=e.header,r=e.headersRef,o=e.leafHeaders,i=e.minWidth,a=e.setMainBodyWidth,d=e.setPinnedLeftWidth,s=e.setPinnedRightWidth,c=e.startWidth,l=o.reduce((function(e,n){return Math.min(e,q(n))}),40),u=o.reduce((function(e,n){return e+("number"==typeof n.width?n.width:150)}),0),h=Math.max(c+n,l);K({header:t,headers:r.current,newWidth:h,setMainBodyWidth:a,setPinnedLeftWidth:d,setPinnedRightWidth:s});var f=h-u;o.forEach((function(e){var n="number"==typeof e.width?e.width:150,t=f*(n/u),r=Math.max(n+t,i);e.width=r}))},Y=n.forwardRef((function(r,o){var a,d,s=r.colIndex,c=r.forceHeadersUpdate,l=r.gridColumnEnd,u=r.gridColumnStart,h=r.gridRowEnd,f=r.gridRowStart,g=r.header,m=r.reverse,w=r.sort,p=W(),x=p.columnReordering,C=p.columnResizing,I=p.draggedHeaderRef,b=p.forceUpdate,y=p.headersRef,M=p.hoveredHeaderRef,S=p.onColumnOrderChange,j=p.onSort,k=p.onTableHeaderDragEnd,D=p.rowHeight,H=p.selectColumns,L=p.selectableColumns,N=p.setInitialFocusedCell,B=p.setIsWidthDragging,T=p.setMainBodyWidth,P=p.setPinnedLeftWidth,O=p.setPinnedRightWidth,F=p.setSelectedCells,A=p.setSelectedColumns,z=p.sortDownIcon,U=p.sortUpIcon,J=Boolean(null==g?void 0:g.isSortable),V="st-header-cell ".concat(g.accessor===(null===(a=M.current)||void 0===a?void 0:a.accessor)?"st-hovered":""," ").concat((null===(d=I.current)||void 0===d?void 0:d.accessor)===g.accessor?"st-dragging":""," ").concat(J?"clickable":""," ").concat(x&&!J?"columnReordering":""," ").concat("right"===(null==g?void 0:g.align)?"right-aligned":"center"===(null==g?void 0:g.align)?"center-aligned":""," ").concat(g.children?"parent":""),q=E({draggedHeaderRef:I,headersRef:y,hoveredHeaderRef:M,onColumnOrderChange:S,onTableHeaderDragEnd:k}),K=q.handleDragStart,G=q.handleDragEnd,Y=q.handleDragOver,_=R(),$=function(e){var n=e.event,t=e.header;if(L){var r=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var d=a[i];o=r(d,o)}return o};return r(e,n),t}(t,s);return n.shiftKey&&H?A((function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort((function(e,n){return e-n})),o=t[0],a=Math.abs(n-o);t.forEach((function(e){var t=Math.abs(n-e);t<a&&(a=t,o=e)}));var d,s,c,l,u=i(i([],(d=o,s=n,c=Math.min(d,s),l=Math.max(d,s),Array.from({length:l-c+1},(function(e,n){return c+n}))),!0),r,!0);return new Set(i(i([],Array.from(e),!0),u,!0))})):H&&H(r),F(new Set),void N(null)}t.isSortable&&j(s,t.accessor)};if(n.useEffect((function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}}),[]),!g)return null;var Q=C&&e.jsx("div",{className:"st-header-resize-handle",onMouseDown:function(e){var n;_({callback:X,callbackProps:{event:e.nativeEvent,forceUpdate:b,gridColumnEnd:l,gridColumnStart:u,header:g,headersRef:y,setIsWidthDragging:B,setMainBodyWidth:T,setPinnedLeftWidth:P,setPinnedRightWidth:O,startWidth:"object"==typeof o&&null!==o&&"current"in o?null===(n=o.current)||void 0===n?void 0:n.offsetWidth:void 0},limit:10})}}),Z=w&&w.key.accessor===g.accessor&&e.jsxs("div",t({className:"st-sort-icon-container",onClick:function(e){return $({event:e,header:g})}},{children:["ascending"===w.direction&&U&&U,"descending"===w.direction&&z&&z]}));return e.jsxs("div",t({className:V,id:v({accessor:g.accessor,rowIndex:0}),onDragOver:function(e){_({callback:Y,callbackProps:{event:e,hoveredHeader:g},limit:50})},ref:o,style:t(t({gridRowStart:f,gridRowEnd:h,gridColumnStart:u,gridColumnEnd:l},l-u>1?{}:{width:g.width}),h-f>1?{}:{height:D})},{children:[m&&Q,e.jsxs("div",t({className:"st-header-label ".concat("right"===g.align?"right-aligned":"center"===g.align?"center-aligned":""),draggable:x&&!g.disableReorder,onClick:function(e){return $({event:e,header:g})},onDragEnd:function(e){e.preventDefault(),G(),c()},onDragStart:function(e){x&&g&&function(e){K(e)}(g)}},{children:["right"===g.align&&Z,null==g?void 0:g.label,"right"!==g.align&&Z]})),!m&&Q]}))})),_=function(r){var o=r.columnIndices,i=r.gridTemplateColumns,a=r.handleScroll,d=r.headersRef,s=r.hiddenColumns,c=r.maxDepth,l=r.pinned,u=r.sectionRef,h=r.sort,f=n.useReducer((function(e){return e+1}),0)[1],v=n.useMemo((function(){var e=[],n=1,t=function(r,i,a){var d,u;if(void 0===a&&(a=!1),!g({hiddenColumns:s,header:r,pinned:l}))return 0;a||n++;var h=null!==(u=null===(d=r.children)||void 0===d?void 0:d.filter((function(e){return g({hiddenColumns:s,header:e,pinned:l})})).length)&&void 0!==u?u:0,f=n,v=h>0?f+h:f+1,m=i,w=h>0?i+1:c+1;if(e.push({header:r,gridColumnStart:f,gridColumnEnd:v,gridRowStart:m,gridRowEnd:w,colIndex:o[r.accessor]}),r.children){var p=!0;r.children.forEach((function(e){g({hiddenColumns:s,header:e,pinned:l})&&(t(e,i+1,p),p=!1)}))}return v-f},r=d.current.filter((function(e){return g({hiddenColumns:s,header:e,pinned:l})})),i=!0;return r.forEach((function(e){t(e,1,i),i=!1})),e}),[d,s,c,l,o]);return e.jsx("div",t({className:"st-header-".concat(l?"pinned-".concat(l):"main")},a&&{onScroll:a},{ref:u,style:{gridTemplateColumns:i,display:"grid",position:"relative"}},{children:e.jsx(D,t({rowIndex:0},{children:v.map((function(t){return e.jsx(Y,{colIndex:t.colIndex,forceHeadersUpdate:f,gridColumnEnd:t.gridColumnEnd,gridColumnStart:t.gridColumnStart,gridRowEnd:t.gridRowEnd,gridRowStart:t.gridRowStart,header:t.header,ref:n.createRef(),reverse:"right"===l,sort:h},t.header.accessor)}))}))}))},$=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map($)):1},Q=function(r){var o=r.centerHeaderRef,i=r.headerContainerRef,a=r.headersRef,d=r.hiddenColumns,s=r.mainTemplateColumns,c=r.pinnedLeftColumns,l=r.pinnedLeftTemplateColumns,u=r.pinnedRightColumns,h=r.pinnedRightTemplateColumns,f=r.sort,v=W(),m=v.mainBodyRef,w=v.pinnedLeftRef,p=v.pinnedRightRef,x=v.setPinnedLeftWidth,C=v.setPinnedRightWidth;A(m,o);var I=n.useMemo((function(){return O({headersRef:a,hiddenColumns:d,pinnedLeftColumns:c,pinnedRightColumns:u})}),[a,d,c,u]),R=n.useMemo((function(){var e=a.current,n=0;return e.forEach((function(e){if(g({hiddenColumns:d,header:e})){var t=$(e);n=Math.max(n,t)}})),{maxDepth:n}}),[a,d]).maxDepth;return n.useLayoutEffect((function(){var e,n;x(z(null===(e=w.current)||void 0===e?void 0:e.clientWidth)),C(z(null===(n=p.current)||void 0===n?void 0:n.clientWidth))}),[w,p,x,C]),e.jsxs("div",t({className:"st-header-container",ref:i},{children:[c.length>0&&e.jsx(_,{columnIndices:I,gridTemplateColumns:l,handleScroll:void 0,headersRef:a,hiddenColumns:d,maxDepth:R,pinned:"left",sectionRef:w,sort:f}),e.jsx(_,{columnIndices:I,gridTemplateColumns:s,handleScroll:function(e){var n,t,r=null===(n=o.current)||void 0===n?void 0:n.scrollLeft;void 0!==r&&(null===(t=m.current)||void 0===t||t.scrollTo(r,0))},headersRef:a,hiddenColumns:d,maxDepth:R,sectionRef:o,sort:f}),u.length>0&&e.jsx(_,{columnIndices:I,gridTemplateColumns:h,handleScroll:void 0,headersRef:a,hiddenColumns:d,maxDepth:R,pinned:"right",sectionRef:p,sort:f})]}))},Z=function(e){var n=e.headers,t=e.hiddenColumns,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach((function(e){!0!==t[e.accessor]&&(e.children?r({headers:e.children,flattenedHeaders:o}):o.push(e))})),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map((function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)})).join(" "))},ee=function(r){var o=r.flattenedRows,i=r.isWidthDragging,a=r.pinnedLeftWidth,d=r.pinnedRightWidth,s=r.setFlattenedRows,c=r.setScrollTop,l=r.sort,u=r.visibleRows,h=W(),f=h.editColumns,v=h.headersRef,g=h.hiddenColumns,m=n.useRef(null),w=n.useRef(null),p=v.current.filter((function(e){return!e.pinned})),x=v.current.filter((function(e){return"left"===e.pinned})),C=v.current.filter((function(e){return"right"===e.pinned})),I=n.useMemo((function(){return Z({headers:x,hiddenColumns:g})}),[x,g]),R=n.useMemo((function(){return Z({headers:p,hiddenColumns:g})}),[p,g]),b=n.useMemo((function(){return Z({headers:C,hiddenColumns:g})}),[C,g]),y={centerHeaderRef:w,headerContainerRef:m,headersRef:v,hiddenColumns:g,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftTemplateColumns:I,pinnedRightColumns:C,pinnedRightTemplateColumns:b,sort:l},M={flattenedRows:o,headerContainerRef:m,isWidthDragging:i,mainTemplateColumns:R,pinnedLeftColumns:x,pinnedLeftTemplateColumns:I,pinnedLeftWidth:a,pinnedRightColumns:C,pinnedRightTemplateColumns:b,pinnedRightWidth:d,setFlattenedRows:s,setScrollTop:c,visibleRows:u};return e.jsxs("div",t({className:"st-content",style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(Q,t({},y)),e.jsx(F,t({},M))]}))},ne=function(r){var o,i,a=r.mainBodyWidth,d=r.mainBodyRef,s=r.pinnedLeftWidth,c=r.pinnedRightWidth,l=r.setMainBodyWidth,u=r.tableBodyContainerRef,h=W().editColumns,f=n.useState(!1),v=f[0],g=f[1],m=n.useRef(null),w=u.current&&u.current.scrollHeight>u.current.clientHeight,p=h?28:0,x=(h?c+1:c)+(u.current&&w?u.current.offsetWidth-u.current.clientWidth:0);return A(d,m),n.useEffect((function(){!function(){if(d.current){var e=d.current.scrollWidth;l(e)}}()}),[d,l]),n.useEffect((function(){setTimeout((function(){!function(){if(d.current){var e=d.current.clientWidth;g(a>e)}}()}),1)}),[d,a,l]),v?e.jsxs("div",t({className:"st-horizontal-scrollbar-container"},{children:[s>0&&e.jsx("div",{className:"st-horizontal-scrollbar-left",style:{flexShrink:0,width:s,height:null===(o=m.current)||void 0===o?void 0:o.offsetHeight}}),a>0&&e.jsx("div",t({className:"st-horizontal-scrollbar-middle",onScroll:function(e){var n=e.target.scrollLeft;void 0!==n&&d.current&&d.current.scrollTo({left:n,behavior:"auto"})},ref:m,style:{flexGrow:1}},{children:e.jsx("div",{style:{width:a,height:".3px"}})})),c>0&&e.jsx(e.Fragment,{children:e.jsx("div",{className:"st-horizontal-scrollbar-right",style:{flexShrink:0,minWidth:x,height:null===(i=m.current)||void 0===i?void 0:i.offsetHeight}})}),p>0&&e.jsx("div",{style:{width:p-1.5,height:"100%",flexShrink:0}})]})):null},te={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return te.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?te.string(e,n,t):"number"==typeof e&&"number"==typeof n?te.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?te.boolean(e,n,t):te.string(String(e),String(n),t)}},re=function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return te.number(i,a,r)}return"date"===t?te.date(String(e),String(n),r):"boolean"===t?te.boolean(Boolean(e),Boolean(n),r):"enum"===t?te.enum(String(e),String(n),r):te.string(String(e),String(n),r)},oe=function(e,n,r){var o,a=(null===(o=n.key)||void 0===o?void 0:o.type)||"string",d=n.direction,s=new Map,c=new Map,l="";e.forEach((function(e){var t;if(e.rowData&&!0===e.rowMeta.isExpanded&&!0===n.key.expandable){var r=(e.rowData.sector||"group_".concat(s.size)).toString();l=r,c.set(l,e),s.has(l)||s.set(l,[])}else if(l){var o=s.get(l)||[];o.push(e),s.set(l,o)}else{var i="default";s.has(i)||s.set(i,[]),null===(t=s.get(i))||void 0===t||t.push(e)}}));var u=[];return s.forEach((function(e,o){if(c.has(o)){var s=c.get(o);s.rowMeta.children&&s.rowMeta.children.length>0&&(s.rowMeta.children=ie(s.rowMeta.children,n,r)),u.push(s)}var l=i([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],i=t.rowData[r];return re(o,i,a,d)}));u.push.apply(u,l.map((function(e){var o=t({},e);if(o.rowMeta.children&&o.rowMeta.children.length>0){var i=ie(o.rowMeta.children,n,r);o.rowMeta=t(t({},o.rowMeta),{children:i})}return o})))})),u},ie=function(e,n,r){var o=r.find((function(e){return e.accessor===n.key.accessor})),a=(null==o?void 0:o.type)||"string",d=n.direction;return i([],e,!0).sort((function(e,t){if(!(null==e?void 0:e.rowData)||!(null==t?void 0:t.rowData))return 0;var r=n.key.accessor,o=e.rowData[r],i=t.rowData[r];return re(o,i,a,d)})).map((function(e){return e.rowMeta.children&&e.rowMeta.children.length>0?t(t({},e),{rowMeta:t(t({},e.rowMeta),{children:ie(e.rowMeta.children,n,r)})}):e}))},ae=function(e){var t=e.headers,r=e.tableRows,o=n.useState(null),i=o[0],a=o[1],d=n.useMemo((function(){var e={};return t.forEach((function(n){!0===n.hide&&(e[n.accessor]=!0)})),e}),[t]),s=n.useState(d),c=s[0],l=s[1],u=n.useMemo((function(){if(!i)return r;var e=function(e,n,t){return{sortedData:oe(n,t,e),newSortConfig:t}}(t,r,i).sortedData;return e}),[r,i,t]);return{hiddenColumns:c,setHiddenColumns:l,setSort:a,sort:i,sortedRows:u,updateSort:function(e,n){var r=function(e){for(var t=0,o=e;t<o.length;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children);if(a)return a}}},o=r(t);o&&a((function(e){return e&&e.key.accessor===n?"ascending"===e.direction?{key:o,direction:"descending"}:null:{key:o,direction:"ascending"}}))}}},de=function(n){var r=n.checked,o=void 0!==r&&r,i=n.children,a=n.onChange;return e.jsxs("label",t({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e.jsx("span",t({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e.jsx("span",{className:"st-checkbox-checkmark"})})),i]}))},se=function(e,n,t,r){void 0===r&&(r=new Set);for(var o=0,i=e;o<i.length;o++){var a=i[o];if(!r.has(a.accessor)&&(r.add(a.accessor),a.children&&a.children.length>0)){var d=a.children.some((function(e){return e.accessor===n})),s=!1;if(!d)for(var c=0,l=a.children;c<l.length;c++){var u=l[c];if(se([u],n,t,r),!1===t[u.accessor]){s=!0;break}}(d||s)&&(t[a.accessor]=!1)}}},ce=function(e,n){return e.every((function(e){return!0===n[e.accessor]}))},le=function(e,n){e.forEach((function(e){e.children&&e.children.length>0&&(le(e.children,n),ce(e.children,n)&&(n[e.accessor]=!0))}))},ue=function(r){var o=r.allHeaders,i=r.depth,a=void 0===i?0:i,d=r.header,s=r.hiddenColumns,c=r.setHiddenColumns,l=n.useState(!0),u=l[0],h=l[1],f=W(),v=f.expandIcon,g=f.collapseIcon,m=f.headersRef,w=f.setMainBodyWidth,p=f.setPinnedLeftWidth,x=f.setPinnedRightWidth,C="".concat(16*a,"px"),I=d.children&&d.children.length>0,R=s[d.accessor]||I&&d.children&&ce(d.children,s);return e.jsxs(e.Fragment,{children:[e.jsxs("div",t({className:"st-header-checkbox-item",style:{paddingLeft:C}},{children:[e.jsx("div",t({className:"st-header-icon-container"},{children:I?e.jsx("div",t({className:"st-collapsible-header-icon",onClick:function(e){e.stopPropagation(),h(!u)}},{children:u?g:v})):null})),e.jsx(de,t({checked:R,onChange:function(e){var n=t({},s);(n[d.accessor]=e,e)?le(o,n):(se(o,d.accessor,n),I&&d.children&&d.children.length>0&&d.children.every((function(e){return!0===s[e.accessor]}))&&d.children[0]&&(n[d.children[0].accessor]=!1,se(o,d.children[0].accessor,n)));c(n),m.current.forEach((function(e){e.hide=!0===n[e.accessor]})),function(e){var n=e.headers,t=e.setMainBodyWidth,r=e.setPinnedLeftWidth,o=e.setPinnedRightWidth,i=0,a=0,d=0;n.forEach((function(e){if(!e.hide){var n=U(e).reduce((function(e,n){return e+J(n)}),0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:d+=n}}));var s=z(i),c=z(a);r(s),o(c),t(d)}({headers:m.current,setMainBodyWidth:w,setPinnedLeftWidth:p,setPinnedRightWidth:x})}},{children:d.label}))]})),I&&u&&d.children&&e.jsx("div",t({className:"st-nested-headers"},{children:d.children.map((function(n,t){return e.jsx(ue,{allHeaders:o,depth:a+1,header:n,hiddenColumns:s,setHiddenColumns:c},"".concat(n.accessor,"-").concat(t))}))}))]})},he=function(n){var r=n.headers,o=n.open,i=n.position,a=n.setHiddenColumns,d=n.hiddenColumns,s="left"===i?"left":"";return e.jsx("div",t({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(s),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",t({className:"st-column-editor-popout-content"},{children:r.map((function(n,t){return e.jsx(ue,{header:n,hiddenColumns:d,setHiddenColumns:a,allHeaders:r},"".concat(n.accessor,"-").concat(t))}))}))}))},fe=function(r){var o=r.columnEditorText,i=r.editColumns,a=r.editColumnsInitOpen,d=r.headers,s=r.hiddenColumns,c=r.position,l=void 0===c?"right":c,u=r.setHiddenColumns,h=n.useState(a),f=h[0],v=h[1];return i?e.jsxs("div",t({className:"st-column-editor ".concat(f?"open":""," ").concat(l),onClick:function(){return function(e){v(e)}(!f)},style:{width:28}},{children:[e.jsx("div",t({className:"st-column-editor-text"},{children:o})),e.jsx(he,{headers:d,open:f,position:l,setHiddenColumns:u,hiddenColumns:s})]})):null},ve=function(r){var o=r.allowAnimations,i=void 0!==o&&o,h=r.cellUpdateFlash,f=void 0!==h&&h,v=r.collapseIcon,g=void 0===v?e.jsx(u,{className:"st-sort-icon"}):v,w=r.columnEditorPosition,p=void 0===w?"right":w,x=r.columnEditorText,C=void 0===x?"Columns":x,I=r.columnReordering,R=void 0!==I&&I,b=r.columnResizing,y=void 0!==b&&b,M=r.defaultHeaders,E=r.editColumns,S=void 0!==E&&E,W=r.editColumnsInitOpen,k=void 0!==W&&W,D=r.expandIcon,H=void 0===D?e.jsx(c,{className:"st-sort-icon"}):D,L=r.height,N=r.hideFooter,B=void 0!==N&&N,T=r.nextIcon,P=void 0===T?e.jsx(c,{className:"st-next-prev-icon"}):T,O=r.onCellEdit,F=r.onColumnOrderChange,A=r.onGridReady,z=r.onNextPage,U=r.prevIcon,J=void 0===U?e.jsx(s,{className:"st-next-prev-icon"}):U,V=r.rowHeight,q=void 0===V?40:V,K=r.rows,X=r.rowsPerPage,G=void 0===X?10:X,Y=r.selectableCells,_=void 0!==Y&&Y,$=r.selectableColumns,Q=void 0!==$&&$,Z=r.shouldPaginate,te=void 0!==Z&&Z,re=r.sortDownIcon,oe=void 0===re?e.jsx(u,{className:"st-sort-icon"}):re,ie=r.sortUpIcon,de=void 0===ie?e.jsx(l,{className:"st-sort-icon"}):ie,se=r.tableRef,ce=r.theme,le=void 0===ce?"light":ce,ue=n.useRef(null),he=n.useRef(M),ve=n.useRef(null),ge=n.useRef(null),me=n.useRef(null),we=n.useRef(null),pe=n.useRef(null),xe=n.useState(1),Ce=xe[0],Ie=xe[1],Re=n.useState(!1),be=Re[0],ye=Re[1],Me=n.useState(0),Ee=Me[0],Se=Me[1],je=n.useState(0),We=je[0],ke=je[1],De=n.useState(0),He=De[0],Le=De[1],Ne=n.useState(0),Be=Ne[0],Te=Ne[1],Pe=n.useState(0),Oe=Pe[0],Fe=Pe[1],Ae=ae({headers:he.current,tableRows:K}),ze=Ae.sort,Ue=Ae.sortedRows,Je=Ae.hiddenColumns,Ve=Ae.setHiddenColumns,qe=Ae.updateSort;n.useEffect((function(){null==A||A()}),[A]);var Ke=n.useMemo((function(){if(!te)return Ue;var e=(Ce-1)*G,n=e+G;return Ue.slice(e,n)}),[Ce,G,te,Ue]),Xe=n.useState(Ke),Ge=Xe[0],Ye=Xe[1];n.useEffect((function(){Ye(Ke)}),[Ke]);var _e=n.useMemo((function(){var e;if(!L)return window.innerHeight-q;var n=document.querySelector(".simple-table-root"),t=0;if(L.endsWith("px"))t=parseInt(L,10);else if(L.endsWith("vh")){var r=parseInt(L,10);t=window.innerHeight*r/100}else if(L.endsWith("%")){var o=parseInt(L,10);t=((null===(e=null==n?void 0:n.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*o/100}else t=window.innerHeight;return Math.max(0,t-q)}),[L,q]),$e=n.useMemo((function(){return function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.flattenedRows,o=e.rowHeight,i=e.scrollTop,a=o+1,d=[],s=0,c=Math.max(0,i-a*n),l=i+t+a*n,u=function(e,n){for(var t,r=0,o=e;r<o.length;r++){var i=o[r],h=s*a;if(h>=l)break;h+a>c&&d.push({row:i,depth:n,position:s,isLastGroupRow:Boolean(null===(t=i.rowMeta.children)||void 0===t?void 0:t.length)&&n>1}),s+=1,i.rowMeta.isExpanded&&i.rowMeta.children&&u(i.rowMeta.children,n+1)}};return u(r,0),d}({bufferRowCount:5,contentHeight:_e,flattenedRows:Ge,rowHeight:q,scrollTop:Be})}),[_e,q,Ge,Be]),Qe=n.useReducer((function(e){return e+1}),0)[1],Ze=function(e){var t=e.selectableCells,r=e.headers,o=e.visibleRows,i=n.useState(new Set),d=i[0],s=i[1],c=n.useState(new Set),l=c[0],u=c[1],h=n.useState(null),f=h[0],v=h[1],g=n.useState(null),m=g[0],w=g[1],p=n.useRef(!1),x=n.useRef(null),C=n.useCallback((function(){var e=Array.from(d).reduce((function(e,n){var t=n.split("-").map(Number),i=t[0],a=t[1];return e[i]||(e[i]=[]),e[i][a]=o[i].row.rowData[r[a].accessor],e}),{}),n=Object.values(e).map((function(e){return Object.values(e).join("\t")})).join("\n");d.size>0&&navigator.clipboard.writeText(n)}),[r,d,o]),I=n.useCallback((function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),d=Math.min(e.colIndex,n.colIndex),c=Math.max(e.colIndex,n.colIndex),l=r;l<=i;l++)for(var h=d;h<=c;h++)if(l>=0&&l<o.length){var f=o[l].row.rowMeta.rowId;t.add(a({colIndex:h,rowIndex:l,rowId:f}))}u(new Set),v(null),s(t)}),[o,u,v,s]),R=n.useCallback((function(e){if(e.rowIndex>=0&&e.rowIndex<o.length&&e.colIndex>=0&&e.colIndex<r.length){var n=a(e);u(new Set),v(null),s(new Set([n])),w(e)}}),[r.length,o.length,u,v,s,w]),b=n.useCallback((function(e,n){void 0===n&&(n=!1),s(new Set),w(null),u((function(t){var r=new Set(n?t:[]);return e.forEach((function(e){return r.add(e)})),r})),e.length>0&&v(e[e.length-1])}),[s,w,u,v]);n.useEffect((function(){var e=function(e){if(t&&m){var n=m.rowIndex,i=m.colIndex,a=m.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if(o[n].row.rowMeta.rowId!==a){var d=o.findIndex((function(e){return e.row.rowMeta.rowId===a}));if(-1===d)return;n=d}if("ArrowUp"===e.key){if(e.preventDefault(),n>0){var c={rowIndex:n-1,colIndex:i,rowId:o[n-1].row.rowMeta.rowId};R(c)}}else"ArrowDown"===e.key?(e.preventDefault(),n<o.length-1&&(c={rowIndex:n+1,colIndex:i,rowId:o[n+1].row.rowMeta.rowId},R(c))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c={rowIndex:n,colIndex:i-1,rowId:o[n].row.rowMeta.rowId},R(c))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<r.length-1&&(c={rowIndex:n,colIndex:i+1,rowId:o[n].row.rowMeta.rowId},R(c))):"Escape"===e.key&&(s(new Set),u(new Set),v(null),x.current=null,w(null))}else C()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}}),[C,r.length,m,I,R,t,o]);var y=n.useCallback((function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=a({colIndex:n,rowIndex:t,rowId:r}),i=d.has(o),s=l.has(n);return i||s}),[d,l]),M=n.useCallback((function(e){var n,t,r,i,a,d,s=e.colIndex,c=e.rowIndex,u=e.rowId,h=[],f=null===(r=null===(t=null===(n=o[c-1])||void 0===n?void 0:n.row)||void 0===t?void 0:t.rowMeta)||void 0===r?void 0:r.rowId,v={colIndex:s,rowIndex:c+1,rowId:null===(d=null===(a=null===(i=o[c+1])||void 0===i?void 0:i.row)||void 0===a?void 0:a.rowMeta)||void 0===d?void 0:d.rowId},g={colIndex:s-1,rowIndex:c,rowId:u},m={colIndex:s+1,rowIndex:c,rowId:u};return(!y({colIndex:s,rowIndex:c-1,rowId:f})||l.has(s)&&0===c)&&h.push("st-selected-top-border"),(!y(v)||l.has(s)&&c===o.length-1)&&h.push("st-selected-bottom-border"),y(g)||h.push("st-selected-left-border"),y(m)||h.push("st-selected-right-border"),h.join(" ")}),[y,o,l]),E=n.useMemo((function(){return m?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===m.rowIndex&&t===m.colIndex&&r===m.rowId}:function(){return!1}}),[m]);return{getBorderClass:M,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){p.current=!0,x.current={rowIndex:r,colIndex:n,rowId:o},u(new Set),v(null);var i=a({colIndex:n,rowIndex:r,rowId:o});s(new Set([i])),w({rowIndex:r,colIndex:n,rowId:o})}},handleMouseOver:function(e){var n=e.colIndex,r=e.rowIndex;if(e.rowId,t&&p.current&&x.current){for(var i=new Set,d=Math.min(x.current.rowIndex,r),c=Math.max(x.current.rowIndex,r),l=Math.min(x.current.colIndex,n),u=Math.max(x.current.colIndex,n),h=d;h<=c;h++)for(var f=l;f<=u;f++)if(h>=0&&h<o.length){var v=o[h].row.rowMeta.rowId;i.add(a({colIndex:f,rowIndex:h,rowId:v}))}s(i)}},handleMouseUp:function(){p.current=!1},isInitialFocusedCell:E,isSelected:y,lastSelectedColumnIndex:f,selectColumns:b,selectedCells:d,selectedColumns:l,setInitialFocusedCell:w,setSelectedCells:s,setSelectedColumns:u}}({selectableCells:_,headers:he.current,visibleRows:$e}),en=Ze.getBorderClass,nn=Ze.handleMouseDown,tn=Ze.handleMouseOver,rn=Ze.handleMouseUp,on=Ze.isInitialFocusedCell,an=Ze.isSelected,dn=Ze.selectColumns,sn=Ze.setInitialFocusedCell,cn=Ze.setSelectedCells,ln=Ze.setSelectedColumns,un=n.useCallback((function(e,n){qe(e,n)}),[qe]),hn=n.useCallback((function(e){he.current=e,Qe()}),[]);n.useEffect((function(){var e=function(e){var n=e.target;n.closest(".st-cell")||Q&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label"))||(cn(new Set),Q&&ln(new Set))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[Q,cn,ln]),n.useLayoutEffect((function(){if(pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth;Fe(e)}}),[]),n.useLayoutEffect((function(){var e=function(){if(Qe(),pe.current){var e=pe.current.offsetWidth-pe.current.clientWidth;Fe(e)}};return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}),[]);var fn=n.useRef(new Map);return n.useEffect((function(){se&&(se.current={updateData:function(e){var n,t,r,o,i=e.accessor,a=e.rowIndex,d=e.newValue,s=null===(t=null===(n=null==K?void 0:K[a])||void 0===n?void 0:n.rowMeta)||void 0===t?void 0:t.rowId;if(void 0!==s){var c=m({rowId:s,accessor:i}),l=fn.current.get(c);l&&l.updateContent(d),void 0!==(null===(o=null===(r=null==K?void 0:K[a])||void 0===r?void 0:r.rowData)||void 0===o?void 0:o[i])&&(K[a].rowData[i]=d)}}})}),[se,K]),e.jsx(j,t({value:{allowAnimations:i,cellRegistry:fn.current,cellUpdateFlash:f,collapseIcon:g,columnReordering:R,columnResizing:y,draggedHeaderRef:ue,editColumns:S,expandIcon:H,forceUpdate:Qe,getBorderClass:en,handleMouseDown:nn,handleMouseOver:tn,headersRef:he,hiddenColumns:Je,hoveredHeaderRef:ve,isInitialFocusedCell:on,isSelected:an,mainBodyRef:ge,onCellEdit:O,onColumnOrderChange:F,onSort:un,onTableHeaderDragEnd:hn,pinnedLeftRef:me,pinnedRightRef:we,rowHeight:q,scrollbarWidth:Oe,selectColumns:dn,selectableColumns:Q,setInitialFocusedCell:sn,setIsWidthDragging:ye,setMainBodyWidth:Se,setPinnedLeftWidth:ke,setPinnedRightWidth:Le,setSelectedCells:cn,setSelectedColumns:ln,shouldPaginate:te,sortDownIcon:oe,sortUpIcon:de,tableBodyContainerRef:pe}},{children:e.jsxs("div",t({className:"simple-table-root st-wrapper theme-".concat(le),style:L?{height:L}:{}},{children:[e.jsxs("div",t({className:"st-wrapper-container"},{children:[e.jsxs("div",t({className:"st-content-wrapper",onMouseUp:rn,onMouseLeave:rn},{children:[e.jsx(ee,{flattenedRows:Ge,isWidthDragging:be,pinnedLeftWidth:We,pinnedRightWidth:He,setFlattenedRows:Ye,setScrollTop:Te,sort:ze,visibleRows:$e}),e.jsx(fe,{columnEditorText:C,editColumns:S,editColumnsInitOpen:k,headers:he.current,hiddenColumns:Je,position:p,setHiddenColumns:Ve})]})),e.jsx(ne,{mainBodyRef:ge,mainBodyWidth:Ee,pinnedLeftWidth:We,pinnedRightWidth:He,setMainBodyWidth:Se,tableBodyContainerRef:pe})]})),e.jsx(d,{currentPage:Ce,hideFooter:B,nextIcon:P,onPageChange:Ie,onNextPage:z,prevIcon:J,shouldPaginate:te,totalPages:Math.ceil(K.length/G)})]}))}))};exports.SimpleTable=function(r){var o=n.useState(!1),i=o[0],a=o[1];return n.useEffect((function(){a(!0)}),[]),i?e.jsx(ve,t({},r)):null};
2
2
  //# sourceMappingURL=index.js.map
package/dist/styles.css CHANGED
@@ -1 +1 @@
1
- @import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");.simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-resize-handle-margin-right:2px;--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519}.theme-light{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-family:"Inter",sans-serif;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-slate-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-slate-50);--st-header-background-color:var(--st-slate-100);--st-header-label-color:var(--st-slate-900);--st-dragging-background-color:var(--st-slate-200);--st-selected-cell-background-color:var(--st-blue-100);--st-selected-first-cell-background-color:var(--st-blue-50);--st-footer-background-color:var(--st-slate-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-slate-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-slate-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-color:var(--st-blue-500);--st-editable-cell-focus-border-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-slate-100);--st-button-active-background-color:var(--st-blue-600);--st-cell-flash-color:var(--st-slate-200)}.theme-dark{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-family:"Inter",sans-serif;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-gray-900);--st-scrollbar-thumb-color:var(--st-gray-600);--st-border-color:var(--st-gray-700);--st-odd-row-background-color:var(--st-gray-800);--st-even-row-background-color:var(--st-gray-900);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(--st-gray-100);--st-dragging-background-color:var(--st-gray-600);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-gray-900);--st-cell-color:var(--st-gray-100);--st-cell-odd-row-color:var(--st-gray-200);--st-edit-cell-shadow:0 1px 3px 0 #ffffff1a;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-gray-500);--st-separator-border-color:var(--st-gray-600);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-color:var(--st-blue-400);--st-editable-cell-focus-border-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-500);--st-checkbox-checked-border-color:var(--st-blue-500);--st-column-editor-background-color:var(--st-gray-800);--st-column-editor-popout-background-color:var(--st-gray-800);--st-button-hover-background-color:var(--st-gray-700);--st-button-active-background-color:var(--st-blue-500);--st-cell-flash-color:var(--st-gray-600)}.theme-neutral{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-family:"Inter",sans-serif;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-neutral-100);--st-scrollbar-thumb-color:var(--st-neutral-400);--st-border-color:var(--st-neutral-300);--st-odd-row-background-color:var(--st-neutral-50);--st-even-row-background-color:var(--st-neutral-100);--st-header-background-color:var(--st-neutral-200);--st-header-label-color:var(--st-neutral-900);--st-dragging-background-color:var(--st-neutral-300);--st-selected-cell-background-color:var(--st-neutral-400);--st-selected-first-cell-background-color:var(--st-neutral-300);--st-footer-background-color:var(--st-neutral-50);--st-cell-color:var(--st-neutral-900);--st-cell-odd-row-color:var(--st-neutral-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-neutral-900);--st-selected-first-cell-color:var(--st-neutral-900);--st-resize-handle-color:var(--st-neutral-400);--st-separator-border-color:var(--st-neutral-200);--st-last-group-row-separator-border-color:var(--st-neutral-400);--st-selected-border-color:var(--st-neutral-600);--st-editable-cell-focus-border-color:var(--st-neutral-500);--st-checkbox-checked-background-color:var(--st-neutral-600);--st-checkbox-checked-border-color:var(--st-neutral-600);--st-column-editor-background-color:var(--st-neutral-50);--st-column-editor-popout-background-color:var(--st-neutral-50);--st-button-hover-background-color:var(--st-neutral-200);--st-button-active-background-color:var(--st-neutral-600);--st-cell-flash-color:var(--st-neutral-400)}.theme-sky{--st-border-radius:4px;--st-border-width:1px;--st-cell-padding:8px;--st-font-family:"Inter",sans-serif;--st-font-size:0.875rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-blue-50);--st-scrollbar-thumb-color:var(--st-blue-300);--st-border-color:var(--st-blue-300);--st-odd-row-background-color:var(--st-blue-50);--st-even-row-background-color:var(--st-blue-100);--st-header-background-color:var(--st-blue-200);--st-header-label-color:var(--st-blue-900);--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-blue-300);--st-footer-background-color:var(--st-blue-50);--st-cell-color:var(--st-blue-900);--st-cell-odd-row-color:var(--st-blue-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-blue-900);--st-selected-first-cell-color:var(--st-blue-900);--st-resize-handle-color:var(--st-blue-400);--st-separator-border-color:var(--st-blue-200);--st-last-group-row-separator-border-color:var(--st-blue-400);--st-selected-border-color:var(--st-blue-600);--st-editable-cell-focus-border-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-blue-50);--st-column-editor-popout-background-color:var(--st-blue-50);--st-button-hover-background-color:var(--st-blue-200);--st-button-active-background-color:var(--st-blue-600);--st-cell-flash-color:var(--st-blue-300)}.theme-funky{--st-border-radius:8px;--st-border-width:1px;--st-cell-padding:12px;--st-font-family:"Inter",sans-serif;--st-font-size:0.95rem;--st-font-weight-normal:400;--st-font-weight-bold:600;--st-transition-duration:0.25s;--st-transition-ease:cubic-bezier(0.4,0,0.2,1);--st-opacity-disabled:0.6;--st-spacing-small:6px;--st-spacing-medium:10px;--st-scrollbar-bg-color:var(--st-stone-100);--st-scrollbar-thumb-color:var(--st-violet-500);--st-border-color:var(--st-stone-200);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-violet-600);--st-header-label-color:var(--st-white);--st-dragging-background-color:var(--st-violet-50);--st-selected-cell-background-color:var(--st-violet-50);--st-selected-first-cell-background-color:var(--st-violet-100);--st-footer-background-color:var(--st-stone-100);--st-cell-color:var(--st-stone-700);--st-cell-odd-row-color:var(--st-stone-700);--st-edit-cell-shadow:0 4px 6px -1px #7c3aed1a,0 2px 4px -1px #7c3aed0f;--st-selected-cell-color:var(--st-violet-800);--st-selected-first-cell-color:var(--st-violet-800);--st-resize-handle-color:var(--st-violet-400);--st-separator-border-color:var(--st-stone-200);--st-last-group-row-separator-border-color:var(--st-stone-300);--st-selected-border-color:var(--st-violet-500);--st-editable-cell-focus-border-color:var(--st-violet-500);--st-checkbox-checked-background-color:var(--st-violet-500);--st-checkbox-checked-border-color:var(--st-violet-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-violet-50);--st-button-active-background-color:var(--st-violet-600);--st-cell-flash-color:var(--st-violet-200)}.simple-table-root,.st-body-container,.st-body-main,.st-body-pinned-left,.st-body-pinned-right,.st-cell,.st-column-editor,.st-column-editor-popout,.st-content,.st-footer,.st-header-cell,.st-header-container,.st-horizontal-scrollbar-container,.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-middle,.st-horizontal-scrollbar-right,.st-wrapper,.st-wrapper-container{-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:sans-serif;font-family:var(--st-font-family,sans-serif)}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-content-wrapper,.st-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-content-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-content,.st-header-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container{background-color:var(--st-header-background-color)}.st-header-container.st-header-scroll-padding:after{-ms-flex-negative:0;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:default-width;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{border-bottom:var(--st-border-width) solid var(--st-border-color);display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;scrollbar-width:none}.st-header-main::-webkit-scrollbar{display:none}.st-body-container{background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;width:100%}.st-body-main,.st-body-pinned-left,.st-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content}.st-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-body-main{overflow:auto;scrollbar-width:none}.st-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-row{display:grid;min-width:100%;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:background .2s ease;transition:background .2s ease}.st-row.even{background-color:var(--st-even-row-background-color)}.st-row.odd{background-color:var(--st-odd-row-background-color);color:var(--st-cell-odd-row-color)}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-top:var(--st-border-width) solid #0000;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.parent{border-bottom:var(--st-border-width) solid var(--st-border-color)}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:-webkit-grab;cursor:grab}.st-cell,.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--st-slate-800);display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-small);overflow:hidden}.st-cell.right-aligned,.st-header-cell.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-label.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-header-label.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-header-label.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell-content,.st-header-label{-webkit-box-flex:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;height:100%;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-header-label{color:var(--st-header-label-color);padding-right:var(--st-cell-padding)}.st-cell-content{color:var(--st-cell-color);padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell-content.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color);color:var(--st-selected-cell-color)}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border:var(--st-border-width) solid var(--st-selected-border-color);color:var(--st-selected-first-cell-color)}.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-scrollbar-bg-color);border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:12px;width:100%}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{height:100%}.st-horizontal-scrollbar-middle{min-height:11px;overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-next-prev-btn{-webkit-box-pack:center;-ms-flex-pack:center;fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);color:#fff}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow-color);box-shadow:var(--st-edit-cell-shadow-color);-webkit-box-sizing:border-box;box-sizing:border-box;font-size:var(--st-font-size);height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--st-editable-cell-focus-border-color)}.st-column-editor{-ms-flex-negative:0;background:var(--st-footer-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;-webkit-transition:width var(--st-transition-duration) var(--st-transition-ease);transition:width var(--st-transition-duration) var(--st-transition-ease);width:0;z-index:1}.st-column-editor-popout-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-left:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.st-header-checkbox-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.st-header-checkbox-item,.st-header-icon-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-icon-container{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:24px}.st-collapsible-header-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer}.st-collapsible-header-icon,.st-nested-headers{display:-webkit-box;display:-ms-flexbox;display:flex}.st-nested-headers{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium)}.st-column-editor-popout.open{min-width:200px;width:auto}.st-column-editor-popout.left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.st-column-editor-popout.open.left{-webkit-transform:translateX(0);transform:translateX(0)}.st-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.st-checkbox-input{display:none}.st-checkbox-custom{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:6px}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.st-group-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);height:40px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{gap:var(--st-spacing-medium)}.st-group-header-content,.st-group-toggle-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-group-toggle-icon{-webkit-box-pack:center;-ms-flex-pack:center;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.st-group-header.collapsed .st-group-toggle-icon,.st-group-header.expanded .st-group-toggle-icon{-webkit-transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease),-webkit-transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@-webkit-keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}@keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}.st-cell-updating{-webkit-animation:cell-flash .6s ease-in-out;animation:cell-flash .6s ease-in-out}
1
+ @import url("https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700&display=swap");@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap");.simple-table-root{--st-after-width:11.01px;--st-resize-handle-width:2px;--st-resize-handle-margin-right:2px;--st-border-width:1px;--st-transition-duration:0.2s;--st-transition-ease:ease;--st-opacity-disabled:0.5;--st-white:#fff;--st-black:#000;--st-slate-50:#f8fafc;--st-slate-100:#f1f5f9;--st-slate-200:#e2e8f0;--st-slate-300:#cbd5e1;--st-slate-400:#94a3b8;--st-slate-500:#64748b;--st-slate-600:#475569;--st-slate-700:#334155;--st-slate-800:#1e293b;--st-slate-900:#0f172a;--st-slate-950:#020617;--st-gray-50:#f9fafb;--st-gray-100:#f3f4f6;--st-gray-200:#e5e7eb;--st-gray-300:#d1d5db;--st-gray-400:#9ca3af;--st-gray-500:#6b7280;--st-gray-600:#4b5563;--st-gray-700:#374151;--st-gray-800:#1f2937;--st-gray-900:#111827;--st-gray-950:#030712;--st-zinc-50:#fafafa;--st-zinc-100:#f4f4f5;--st-zinc-200:#e4e4e7;--st-zinc-300:#d4d4d8;--st-zinc-400:#a1a1aa;--st-zinc-500:#71717a;--st-zinc-600:#52525b;--st-zinc-700:#3f3f46;--st-zinc-800:#27272a;--st-zinc-900:#18181b;--st-zinc-950:#09090b;--st-neutral-50:#fafafa;--st-neutral-100:#f5f5f5;--st-neutral-200:#e5e5e5;--st-neutral-300:#d4d4d4;--st-neutral-400:#a3a3a3;--st-neutral-500:#737373;--st-neutral-600:#525252;--st-neutral-700:#404040;--st-neutral-800:#262626;--st-neutral-900:#171717;--st-neutral-950:#0a0a0a;--st-stone-50:#fafaf9;--st-stone-100:#f5f5f4;--st-stone-200:#e7e5e4;--st-stone-300:#d6d3d1;--st-stone-400:#a8a29e;--st-stone-500:#78716c;--st-stone-600:#57534e;--st-stone-700:#44403c;--st-stone-800:#292524;--st-stone-900:#1c1917;--st-stone-950:#0c0a09;--st-red-50:#fef2f2;--st-red-100:#fee2e2;--st-red-200:#fecaca;--st-red-300:#fca5a5;--st-red-400:#f87171;--st-red-500:#ef4444;--st-red-600:#dc2626;--st-red-700:#b91c1c;--st-red-800:#991b1b;--st-red-900:#7f1d1d;--st-red-950:#450a0a;--st-orange-50:#fff7ed;--st-orange-100:#ffedd5;--st-orange-200:#fed7aa;--st-orange-300:#fdba74;--st-orange-400:#fb923c;--st-orange-500:#f97316;--st-orange-600:#ea580c;--st-orange-700:#c2410c;--st-orange-800:#9a3412;--st-orange-900:#7c2d12;--st-orange-950:#431407;--st-amber-50:#fffbeb;--st-amber-100:#fef3c7;--st-amber-200:#fde68a;--st-amber-300:#fcd34d;--st-amber-400:#fbbf24;--st-amber-500:#f59e0b;--st-amber-600:#d97706;--st-amber-700:#b45309;--st-amber-800:#92400e;--st-amber-900:#78350f;--st-amber-950:#451a03;--st-yellow-50:#fefce8;--st-yellow-100:#fef9c3;--st-yellow-200:#fef08a;--st-yellow-300:#fde047;--st-yellow-400:#facc15;--st-yellow-500:#eab308;--st-yellow-600:#ca8a04;--st-yellow-700:#a16207;--st-yellow-800:#854d0e;--st-yellow-900:#713f12;--st-yellow-950:#422006;--st-lime-50:#f7fee7;--st-lime-100:#ecfccb;--st-lime-200:#d9f99d;--st-lime-300:#bef264;--st-lime-400:#a3e635;--st-lime-500:#84cc16;--st-lime-600:#65a30d;--st-lime-700:#4d7c0f;--st-lime-800:#3f6212;--st-lime-900:#365314;--st-lime-950:#1a2e05;--st-green-50:#f0fdf4;--st-green-100:#dcfce7;--st-green-200:#bbf7d0;--st-green-300:#86efac;--st-green-400:#4ade80;--st-green-500:#22c55e;--st-green-600:#16a34a;--st-green-700:#15803d;--st-green-800:#166534;--st-green-900:#14532d;--st-green-950:#052e16;--st-emerald-50:#ecfdf5;--st-emerald-100:#d1fae5;--st-emerald-200:#a7f3d0;--st-emerald-300:#6ee7b7;--st-emerald-400:#34d399;--st-emerald-500:#10b981;--st-emerald-600:#059669;--st-emerald-700:#047857;--st-emerald-800:#065f46;--st-emerald-900:#064e3b;--st-emerald-950:#022c22;--st-teal-50:#f0fdfa;--st-teal-100:#ccfbf1;--st-teal-200:#99f6e4;--st-teal-300:#5eead4;--st-teal-400:#2dd4bf;--st-teal-500:#14b8a6;--st-teal-600:#0d9488;--st-teal-700:#0f766e;--st-teal-800:#115e59;--st-teal-900:#134e4a;--st-teal-950:#042f2e;--st-cyan-50:#ecfeff;--st-cyan-100:#cffafe;--st-cyan-200:#a5f3fc;--st-cyan-300:#67e8f9;--st-cyan-400:#22d3ee;--st-cyan-500:#06b6d4;--st-cyan-600:#0891b2;--st-cyan-700:#0e7490;--st-cyan-800:#155e75;--st-cyan-900:#164e63;--st-cyan-950:#083344;--st-sky-50:#f0f9ff;--st-sky-100:#e0f2fe;--st-sky-200:#bae6fd;--st-sky-300:#7dd3fc;--st-sky-400:#38bdf8;--st-sky-500:#0ea5e9;--st-sky-600:#0284c7;--st-sky-700:#0369a1;--st-sky-800:#075985;--st-sky-900:#0c4a6e;--st-sky-950:#082f49;--st-blue-50:#eff6ff;--st-blue-100:#dbeafe;--st-blue-200:#bfdbfe;--st-blue-300:#93c5fd;--st-blue-400:#60a5fa;--st-blue-500:#3b82f6;--st-blue-600:#2563eb;--st-blue-700:#1d4ed8;--st-blue-800:#1e40af;--st-blue-900:#1e3a8a;--st-blue-950:#172554;--st-indigo-50:#eef2ff;--st-indigo-100:#e0e7ff;--st-indigo-200:#c7d2fe;--st-indigo-300:#a5b4fc;--st-indigo-400:#818cf8;--st-indigo-500:#6366f1;--st-indigo-600:#4f46e5;--st-indigo-700:#4338ca;--st-indigo-800:#3730a3;--st-indigo-900:#312e81;--st-indigo-950:#1e1b4b;--st-violet-50:#f5f3ff;--st-violet-100:#ede9fe;--st-violet-200:#ddd6fe;--st-violet-300:#c4b5fd;--st-violet-400:#a78bfa;--st-violet-500:#8b5cf6;--st-violet-600:#7c3aed;--st-violet-700:#6d28d9;--st-violet-800:#5b21b6;--st-violet-900:#4c1d95;--st-violet-950:#2e1065;--st-purple-50:#faf5ff;--st-purple-100:#f3e8ff;--st-purple-200:#e9d5ff;--st-purple-300:#d8b4fe;--st-purple-400:#c084fc;--st-purple-500:#a855f7;--st-purple-600:#9333ea;--st-purple-700:#7e22ce;--st-purple-800:#6b21a8;--st-purple-900:#581c87;--st-purple-950:#3b0764;--st-fuchsia-50:#fdf4ff;--st-fuchsia-100:#fae8ff;--st-fuchsia-200:#f5d0fe;--st-fuchsia-300:#f0abfc;--st-fuchsia-400:#e879f9;--st-fuchsia-500:#d946ef;--st-fuchsia-600:#c026d3;--st-fuchsia-700:#a21caf;--st-fuchsia-800:#86198f;--st-fuchsia-900:#701a75;--st-fuchsia-950:#4a044e;--st-pink-50:#fdf2f8;--st-pink-100:#fce7f3;--st-pink-200:#fbcfe8;--st-pink-300:#f9a8d4;--st-pink-400:#f472b6;--st-pink-500:#ec4899;--st-pink-600:#db2777;--st-pink-700:#be185d;--st-pink-800:#9d174d;--st-pink-900:#831843;--st-pink-950:#500724;--st-rose-50:#fff1f2;--st-rose-100:#ffe4e6;--st-rose-200:#fecdd3;--st-rose-300:#fda4af;--st-rose-400:#fb7185;--st-rose-500:#f43f5e;--st-rose-600:#e11d48;--st-rose-700:#be123c;--st-rose-800:#9f1239;--st-rose-900:#881337;--st-rose-950:#4c0519}.theme-light{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-slate-50);--st-scrollbar-thumb-color:var(--st-slate-300);--st-border-color:var(--st-slate-300);--st-odd-row-background-color:var(--st-white);--st-even-row-background-color:var(--st-slate-50);--st-header-background-color:var(--st-slate-100);--st-header-label-color:var(--st-slate-900);--st-dragging-background-color:var(--st-slate-200);--st-selected-cell-background-color:var(--st-blue-100);--st-selected-first-cell-background-color:var(--st-blue-50);--st-footer-background-color:var(--st-slate-50);--st-cell-color:var(--st-slate-900);--st-cell-odd-row-color:var(--st-slate-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-slate-900);--st-selected-first-cell-color:var(--st-slate-900);--st-resize-handle-color:var(--st-slate-400);--st-separator-border-color:var(--st-slate-200);--st-last-group-row-separator-border-color:var(--st-slate-400);--st-selected-border-color:var(--st-blue-500);--st-editable-cell-focus-border-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-slate-100);--st-button-active-background-color:var(--st-blue-600);--st-cell-flash-color:var(--st-slate-200)}.theme-dark{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-gray-900);--st-scrollbar-thumb-color:var(--st-gray-600);--st-border-color:var(--st-gray-700);--st-odd-row-background-color:var(--st-gray-800);--st-even-row-background-color:var(--st-gray-900);--st-header-background-color:var(--st-gray-800);--st-header-label-color:var(--st-gray-100);--st-dragging-background-color:var(--st-gray-600);--st-selected-cell-background-color:var(--st-blue-900);--st-selected-first-cell-background-color:var(--st-blue-800);--st-footer-background-color:var(--st-gray-900);--st-cell-color:var(--st-gray-100);--st-cell-odd-row-color:var(--st-gray-200);--st-edit-cell-shadow:0 1px 3px 0 #ffffff1a;--st-selected-cell-color:var(--st-white);--st-selected-first-cell-color:var(--st-white);--st-resize-handle-color:var(--st-gray-500);--st-separator-border-color:var(--st-gray-600);--st-last-group-row-separator-border-color:var(--st-gray-500);--st-selected-border-color:var(--st-blue-400);--st-editable-cell-focus-border-color:var(--st-blue-400);--st-checkbox-checked-background-color:var(--st-blue-500);--st-checkbox-checked-border-color:var(--st-blue-500);--st-column-editor-background-color:var(--st-gray-800);--st-column-editor-popout-background-color:var(--st-gray-800);--st-button-hover-background-color:var(--st-gray-700);--st-button-active-background-color:var(--st-blue-500);--st-cell-flash-color:var(--st-gray-600)}.theme-neutral{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-neutral-100);--st-scrollbar-thumb-color:var(--st-neutral-400);--st-border-color:var(--st-neutral-300);--st-odd-row-background-color:var(--st-neutral-50);--st-even-row-background-color:var(--st-neutral-100);--st-header-background-color:var(--st-neutral-200);--st-header-label-color:var(--st-neutral-900);--st-dragging-background-color:var(--st-neutral-300);--st-selected-cell-background-color:var(--st-neutral-400);--st-selected-first-cell-background-color:var(--st-neutral-300);--st-footer-background-color:var(--st-neutral-50);--st-cell-color:var(--st-neutral-900);--st-cell-odd-row-color:var(--st-neutral-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-neutral-900);--st-selected-first-cell-color:var(--st-neutral-900);--st-resize-handle-color:var(--st-neutral-400);--st-separator-border-color:var(--st-neutral-200);--st-last-group-row-separator-border-color:var(--st-neutral-400);--st-selected-border-color:var(--st-neutral-600);--st-editable-cell-focus-border-color:var(--st-neutral-500);--st-checkbox-checked-background-color:var(--st-neutral-600);--st-checkbox-checked-border-color:var(--st-neutral-600);--st-column-editor-background-color:var(--st-neutral-50);--st-column-editor-popout-background-color:var(--st-neutral-50);--st-button-hover-background-color:var(--st-neutral-200);--st-button-active-background-color:var(--st-neutral-600);--st-cell-flash-color:var(--st-neutral-400)}.theme-sky{--st-border-radius:4px;--st-cell-padding:8px;--st-spacing-small:4px;--st-spacing-medium:8px;--st-scrollbar-bg-color:var(--st-blue-50);--st-scrollbar-thumb-color:var(--st-blue-300);--st-border-color:var(--st-blue-300);--st-odd-row-background-color:var(--st-blue-50);--st-even-row-background-color:var(--st-blue-100);--st-header-background-color:var(--st-blue-200);--st-header-label-color:var(--st-blue-900);--st-dragging-background-color:var(--st-blue-300);--st-selected-cell-background-color:var(--st-blue-400);--st-selected-first-cell-background-color:var(--st-blue-300);--st-footer-background-color:var(--st-blue-50);--st-cell-color:var(--st-blue-900);--st-cell-odd-row-color:var(--st-blue-800);--st-edit-cell-shadow:0 1px 2px 0 #0000000d;--st-selected-cell-color:var(--st-blue-900);--st-selected-first-cell-color:var(--st-blue-900);--st-resize-handle-color:var(--st-blue-400);--st-separator-border-color:var(--st-blue-200);--st-last-group-row-separator-border-color:var(--st-blue-400);--st-selected-border-color:var(--st-blue-600);--st-editable-cell-focus-border-color:var(--st-blue-500);--st-checkbox-checked-background-color:var(--st-blue-600);--st-checkbox-checked-border-color:var(--st-blue-600);--st-column-editor-background-color:var(--st-blue-50);--st-column-editor-popout-background-color:var(--st-blue-50);--st-button-hover-background-color:var(--st-blue-200);--st-button-active-background-color:var(--st-blue-600);--st-cell-flash-color:var(--st-blue-300)}.theme-funky{--st-border-radius:8px;--st-cell-padding:12px;--st-spacing-small:6px;--st-spacing-medium:10px;--st-scrollbar-bg-color:var(--st-stone-100);--st-scrollbar-thumb-color:var(--st-violet-500);--st-border-color:var(--st-stone-200);--st-odd-row-background-color:var(--st-amber-50);--st-even-row-background-color:var(--st-amber-100);--st-header-background-color:var(--st-violet-600);--st-header-label-color:var(--st-white);--st-dragging-background-color:var(--st-violet-50);--st-selected-cell-background-color:var(--st-violet-50);--st-selected-first-cell-background-color:var(--st-violet-100);--st-footer-background-color:var(--st-stone-100);--st-cell-color:var(--st-stone-700);--st-cell-odd-row-color:var(--st-stone-700);--st-edit-cell-shadow:0 4px 6px -1px #7c3aed1a,0 2px 4px -1px #7c3aed0f;--st-selected-cell-color:var(--st-violet-800);--st-selected-first-cell-color:var(--st-violet-800);--st-resize-handle-color:var(--st-violet-400);--st-separator-border-color:var(--st-stone-200);--st-last-group-row-separator-border-color:var(--st-stone-300);--st-selected-border-color:var(--st-violet-500);--st-editable-cell-focus-border-color:var(--st-violet-500);--st-checkbox-checked-background-color:var(--st-violet-500);--st-checkbox-checked-border-color:var(--st-violet-600);--st-column-editor-background-color:var(--st-white);--st-column-editor-popout-background-color:var(--st-white);--st-button-hover-background-color:var(--st-violet-50);--st-button-active-background-color:var(--st-violet-600);--st-cell-flash-color:var(--st-violet-200)}.simple-table-root,.st-body-container,.st-body-main,.st-body-pinned-left,.st-body-pinned-right,.st-cell,.st-column-editor,.st-column-editor-popout,.st-content,.st-footer,.st-header-cell,.st-header-container,.st-horizontal-scrollbar-container,.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-middle,.st-horizontal-scrollbar-right,.st-wrapper,.st-wrapper-container{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:inherit;scrollbar-color:var(--st-scrollbar-thumb-color) var(--st-scrollbar-bg-color);scrollbar-width:thin}.simple-table-root{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.st-wrapper{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);max-height:100dvh;overflow:hidden;position:relative}.st-wrapper-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;height:100%}.st-content-wrapper,.st-wrapper-container{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;width:100%}.st-content-wrapper{-webkit-box-flex:1;-ms-flex:1;flex:1;min-height:0}.st-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.st-content,.st-header-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-container{background-color:var(--st-header-background-color)}.st-header-container.st-header-scroll-padding:after{-ms-flex-negative:0;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);content:"";display:block;flex-shrink:0;width:default-width;width:var(--st-after-width,default-width)}.st-header-main,.st-header-pinned-left,.st-header-pinned-right{border-bottom:var(--st-border-width) solid var(--st-border-color);display:grid}.st-header-pinned-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-header-pinned-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-header-main{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;overflow:auto;scrollbar-width:none}.st-header-main::-webkit-scrollbar{display:none}.st-body-container{background-color:var(--st-even-row-background-color);display:-webkit-box;display:-ms-flexbox;display:flex;height:-webkit-max-content;height:-moz-max-content;height:max-content;overflow:auto;width:100%}.st-body-main,.st-body-pinned-left,.st-body-pinned-right{display:grid;height:-webkit-max-content;height:-moz-max-content;height:max-content}.st-body-pinned-left{-ms-flex-negative:0;border-right:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-body-main{overflow:auto;scrollbar-width:none}.st-body-pinned-right{-ms-flex-negative:0;border-left:var(--st-border-width) solid var(--st-border-color);flex-shrink:0}.st-row{display:grid;min-width:100%;position:absolute;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:background .2s ease;transition:background .2s ease}.st-row.even{background-color:var(--st-even-row-background-color)}.st-row.odd{background-color:var(--st-odd-row-background-color)}.st-row.odd .st-cell-content{color:var(--st-cell-odd-row-color)}.st-row.even .st-cell-content{color:var(--st-cell-color)}.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-top:var(--st-border-width) solid #0000;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);gap:var(--st-spacing-small);position:sticky;top:0;z-index:1}.st-header-cell.parent{border-bottom:var(--st-border-width) solid var(--st-border-color)}.st-header-cell.clickable{cursor:pointer}.st-header-cell.draggable{cursor:-webkit-grab;cursor:grab}.st-cell,.st-header-cell{-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:var(--st-slate-800);display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-small);overflow:hidden}.st-cell.right-aligned,.st-header-cell.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell.right-aligned>.st-cell-content,.st-header-cell.right-aligned>.st-header-label{text-align:right}.st-cell.center-aligned,.st-header-cell.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell.center-aligned{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell.center-aligned>.st-cell-content,.st-header-cell.center-aligned>.st-header-label{text-align:center}.st-cell.clickable{cursor:pointer}.st-cell,.st-cell-editing,.st-header-cell{height:100%;width:100%}.st-cell-editing{position:relative}.st-header-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-label.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-header-label.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-header-label.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell-content,.st-header-label{-webkit-box-flex:1;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;height:100%;overflow:hidden;padding-left:var(--st-cell-padding);text-align:left;text-overflow:ellipsis;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:100%}.st-header-label{color:var(--st-header-label-color);padding-right:var(--st-cell-padding)}.st-cell-content{padding-right:calc(var(--st-cell-padding) + var(--st-spacing-small) + var(--st-resize-handle-width) + var(--st-resize-handle-margin-right))}.st-cell-content.right-aligned{-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end;text-align:right}.st-cell-content.left-aligned{-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;text-align:left}.st-cell-content.center-aligned{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;text-align:center}.st-cell{border:var(--st-border-width) solid #0000;position:relative}.st-cell-depth-1{padding-left:calc(var(--st-cell-padding)*4)}.st-cell-depth-2{padding-left:calc(var(--st-cell-padding)*8)}.st-cell-depth-3{padding-left:calc(var(--st-cell-padding)*12)}.st-cell-depth-4{padding-left:calc(var(--st-cell-padding)*16)}.st-cell-depth-5{padding-left:calc(var(--st-cell-padding)*20)}.st-cell-depth-6{padding-left:calc(var(--st-cell-padding)*24)}.st-cell-depth-7{padding-left:calc(var(--st-cell-padding)*28)}.st-sort-icon-container{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;margin-left:4px}.st-sort-icon{fill:var(--st-slate-500)}.st-header-resize-handle{background-color:var(--st-resize-handle-color);cursor:col-resize;height:calc(100% - 20px);margin-right:var(--st-resize-handle-margin-right);right:0;top:0;width:var(--st-resize-handle-width)}.st-row-separator{background-color:var(--st-separator-border-color);grid-column:1/-1;height:1px}.st-row-separator.st-last-group-row{background-color:var(--st-last-group-row-separator-border-color)}.st-dragging{background-color:var(--st-dragging-background-color)}.st-cell-selected{background-color:var(--st-selected-cell-background-color)}.st-cell-selected .st-cell-content{color:var(--st-selected-cell-color)!important}.st-cell-selected-first{background-color:var(--st-selected-first-cell-background-color)!important;border:var(--st-border-width) solid var(--st-selected-border-color)}.st-cell-selected-first .st-cell-content{color:var(--st-selected-first-cell-color)!important}.st-selected-top-border{border-top:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-bottom-border{border-bottom:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-left-border{border-left:var(--st-border-width) solid var(--st-selected-border-color)}.st-selected-right-border{border-right:var(--st-border-width) solid var(--st-selected-border-color)}.st-horizontal-scrollbar-container{-ms-flex-negative:0;-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-scrollbar-bg-color);border-top:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;flex-shrink:0;height:12px;width:100%}.st-horizontal-scrollbar-left{border-right:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-right{border-left:var(--st-border-width) solid var(--st-border-color)}.st-horizontal-scrollbar-left,.st-horizontal-scrollbar-right{height:100%}.st-horizontal-scrollbar-middle{min-height:11px;overflow:auto}.st-horizontal-scrollbar-middle>div{height:1px}.st-footer{-ms-flex-negative:0;background-color:var(--st-footer-background-color);border-top:var(--st-border-width) solid var(--st-border-color);flex-shrink:0;padding:var(--st-spacing-medium)}.st-footer,.st-next-prev-btn{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-next-prev-btn{-webkit-box-pack:center;-ms-flex-pack:center;fill:var(--st-slate-600);background-color:initial;border:none;border-radius:var(--st-border-radius);cursor:pointer;justify-content:center;padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.disabled>.st-next-prev-icon{fill:var(--st-slate-400);cursor:not-allowed}.st-next-prev-btn:not(.disabled):hover{background-color:var(--st-slate-100)}.st-page-btn{background-color:initial;border:none;border-radius:var(--st-border-radius);color:var(--st-slate-600);cursor:pointer;margin-left:var(--st-spacing-small);padding:var(--st-spacing-small);-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease)}.st-page-btn:hover{background-color:var(--st-button-hover-background-color)}.st-page-btn.active{background-color:var(--st-button-active-background-color);color:#fff}.st-page-ellipsis{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;color:var(--st-cell-color);display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;font-weight:700;justify-content:center;margin:0 var(--st-spacing-small);padding:var(--st-spacing-small)}.editable-cell-input{border:var(--st-border-width) solid var(--st-border-color);border-radius:var(--st-border-radius);-webkit-box-shadow:var(--st-edit-cell-shadow-color);box-shadow:var(--st-edit-cell-shadow-color);-webkit-box-sizing:border-box;box-sizing:border-box;font-size:.875rem;height:100%;left:0;outline:none;padding:var(--st-cell-padding);position:absolute;top:0;width:100%;z-index:1}.editable-cell-input:focus{border:var(--st-border-width) solid var(--st-editable-cell-focus-border-color)}.st-column-editor{-ms-flex-negative:0;background:var(--st-column-editor-background-color);border-left:var(--st-border-width) solid var(--st-border-color);color:var(--st-slate-500);cursor:pointer;flex-shrink:0;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-column-editor-text{padding:var(--st-spacing-medium) var(--st-spacing-small);-webkit-writing-mode:vertical-rl;-ms-writing-mode:tb-rl;writing-mode:vertical-rl;z-index:2}.st-column-editor.open,.st-column-editor.open .st-column-editor-text{background-color:var(--st-column-editor-background-color)}.st-column-editor-popout{background-color:var(--st-column-editor-popout-background-color);height:100%;overflow:hidden;position:absolute;right:calc(100% + 1px);top:0;-webkit-transition:width var(--st-transition-duration) var(--st-transition-ease);transition:width var(--st-transition-duration) var(--st-transition-ease);width:0;z-index:1}.st-column-editor-popout-content{-webkit-box-orient:vertical;-webkit-box-direction:normal;border-left:var(--st-border-width) solid var(--st-border-color);display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium);height:100%;overflow:auto;padding:var(--st-spacing-medium) var(--st-spacing-small)}.st-header-checkbox-item{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.st-header-checkbox-item,.st-header-icon-container{display:-webkit-box;display:-ms-flexbox;display:flex}.st-header-icon-container{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;width:24px}.st-collapsible-header-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer}.st-collapsible-header-icon,.st-nested-headers{display:-webkit-box;display:-ms-flexbox;display:flex}.st-nested-headers{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;gap:var(--st-spacing-medium)}.st-column-editor-popout.open{min-width:200px;width:auto}.st-column-editor-popout.left{-webkit-transform:translateX(-100%);transform:translateX(-100%)}.st-column-editor-popout.open.left{-webkit-transform:translateX(0);transform:translateX(0)}.st-checkbox-label{-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;gap:var(--st-spacing-medium);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.st-checkbox-input{display:none}.st-checkbox-custom{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:center;-ms-flex-pack:center;align-items:center;background-color:#fff;border:var(--st-border-width) solid var(--st-slate-300);border-radius:var(--st-border-radius);display:-webkit-box;display:-ms-flexbox;display:flex;height:24px;justify-content:center;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease),border-color var(--st-transition-duration) var(--st-transition-ease);width:24px}.st-checkbox-custom.st-checked{background-color:var(--st-checkbox-checked-background-color);border-color:var(--st-checkbox-checked-border-color)}.st-checkbox-checkmark{border:solid #fff;border-width:0 2px 2px 0;height:11px;-webkit-transform:rotate(45deg);transform:rotate(45deg);width:6px}@-webkit-keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-left{0%{-webkit-transform:translateX(-100%);transform:translateX(-100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@-webkit-keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes slide-in-right{0%{-webkit-transform:translateX(100%);transform:translateX(100%)}to{-webkit-transform:translateX(0);transform:translateX(0)}}.st-group-header{-webkit-box-align:center;-ms-flex-align:center;align-items:center;background-color:var(--st-header-background-color);border-bottom:var(--st-border-width) solid var(--st-border-color);color:var(--st-cell-color);cursor:pointer;display:-webkit-box;display:-ms-flexbox;display:flex;font-weight:var(--st-font-weight-bold);height:40px;-webkit-transition:background-color var(--st-transition-duration) var(--st-transition-ease);transition:background-color var(--st-transition-duration) var(--st-transition-ease);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.st-group-header:hover{background-color:var(--st-button-hover-background-color)}.st-group-header-content{gap:var(--st-spacing-medium)}.st-group-header-content,.st-group-toggle-icon{-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex}.st-group-toggle-icon{-webkit-box-pack:center;-ms-flex-pack:center;font-size:.8em;height:16px;justify-content:center;width:16px}.st-group-name{font-weight:var(--st-font-weight-bold)}.st-group-count{color:var(--st-cell-odd-row-color);font-size:.9em}.st-group-header.expanded .st-group-toggle-icon{-webkit-transform:rotate(0deg);transform:rotate(0deg)}.st-group-header.collapsed .st-group-toggle-icon,.st-group-header.expanded .st-group-toggle-icon{-webkit-transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:-webkit-transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease);transition:transform var(--st-transition-duration) var(--st-transition-ease),-webkit-transform var(--st-transition-duration) var(--st-transition-ease)}.st-group-header.collapsed .st-group-toggle-icon{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@-webkit-keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}@keyframes cell-flash{0%{background-color:initial}50%{background-color:var(--st-cell-flash-color)}to{background-color:initial}}.st-cell-updating{-webkit-animation:cell-flash .6s ease-in-out;animation:cell-flash .6s ease-in-out}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "simple-table-core",
3
- "version": "0.7.84",
3
+ "version": "0.7.86",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.es.js",
6
6
  "types": "dist/index.d.ts",