simple-table-core 2.5.1 → 2.5.6

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.
Files changed (48) hide show
  1. package/dist/{Animate-32f9714e.js → Animate-d62896bf.js} +2 -2
  2. package/dist/Animate-d62896bf.js.map +1 -0
  3. package/dist/{DatePicker-bec3f874.js → DatePicker-629ca593.js} +2 -2
  4. package/dist/DatePicker-629ca593.js.map +1 -0
  5. package/dist/cjs/{Animate-e560c8e0.js → Animate-4eaff4a4.js} +2 -2
  6. package/dist/cjs/Animate-4eaff4a4.js.map +1 -0
  7. package/dist/cjs/{DatePicker-5dcafd59.js → DatePicker-447a7ab5.js} +2 -2
  8. package/dist/cjs/DatePicker-447a7ab5.js.map +1 -0
  9. package/dist/cjs/components/simple-table/table-column-editor/TableColumnEditor.d.ts +3 -6
  10. package/dist/cjs/components/simple-table/table-column-editor/TableColumnEditorPopout.d.ts +3 -2
  11. package/dist/cjs/context/TableContext.d.ts +3 -0
  12. package/dist/cjs/hooks/useDropdownPosition.d.ts +4 -5
  13. package/dist/cjs/hooks/useTableAPI.d.ts +2 -1
  14. package/dist/cjs/index-7cf6c550.js +2 -0
  15. package/dist/cjs/index-7cf6c550.js.map +1 -0
  16. package/dist/cjs/index.d.ts +2 -2
  17. package/dist/cjs/index.js +1 -1
  18. package/dist/cjs/styles.css +1 -1
  19. package/dist/cjs/types/ColumnEditorConfig.d.ts +37 -1
  20. package/dist/cjs/types/ColumnEditorRowRendererProps.d.ts +1 -1
  21. package/dist/cjs/types/HeaderObject.d.ts +0 -2
  22. package/dist/cjs/types/TableRefType.d.ts +2 -0
  23. package/dist/cjs/types/TableRowProps.d.ts +1 -1
  24. package/dist/components/simple-table/table-column-editor/TableColumnEditor.d.ts +3 -6
  25. package/dist/components/simple-table/table-column-editor/TableColumnEditorPopout.d.ts +3 -2
  26. package/dist/context/TableContext.d.ts +3 -0
  27. package/dist/hooks/useDropdownPosition.d.ts +4 -5
  28. package/dist/hooks/useTableAPI.d.ts +2 -1
  29. package/dist/index-9c30fe58.js +2 -0
  30. package/dist/index-9c30fe58.js.map +1 -0
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.es.js +1 -1
  33. package/dist/styles.css +1 -1
  34. package/dist/types/ColumnEditorConfig.d.ts +37 -1
  35. package/dist/types/ColumnEditorRowRendererProps.d.ts +1 -1
  36. package/dist/types/HeaderObject.d.ts +0 -2
  37. package/dist/types/TableRefType.d.ts +2 -0
  38. package/dist/types/TableRowProps.d.ts +1 -1
  39. package/package.json +1 -1
  40. package/src/styles/base.css +3 -2
  41. package/dist/Animate-32f9714e.js.map +0 -1
  42. package/dist/DatePicker-bec3f874.js.map +0 -1
  43. package/dist/cjs/Animate-e560c8e0.js.map +0 -1
  44. package/dist/cjs/DatePicker-5dcafd59.js.map +0 -1
  45. package/dist/cjs/index-822400eb.js +0 -2
  46. package/dist/cjs/index-822400eb.js.map +0 -1
  47. package/dist/index-37ad9116.js +0 -2
  48. package/dist/index-37ad9116.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),n=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(n);function o(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>n.indexOf(t)&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);t.length>o;o++)0>n.indexOf(t[o])&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function i(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 u(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,u)}l((t=t.apply(e,n||[])).next())})}function a(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=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&u[0]?t.return:u[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,u[1])).done)return o;switch(t=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,t=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&o[3]>u[1])){i.label=u[1];break}if(6===u[0]&&o[1]>i.label){i.label=o[1],o=u;break}if(o&&o[2]>i.label){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(e,i)}catch(e){u=[6,e],t=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}function u(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;i>o;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))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;t>r;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},s=29.5,c=["lineAreaChart","barChart"],d=40,f=function(e,n,r){return n&&r?480>e?.25:768>e?.3:.4:function(e){return 480>e?.4:768>e?.5:.6}(e)},v="parentExpanded",p=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;a.length>i;i++)o=t(a[i],o);return o};return t(e,n),r},h=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,h(e.children)),n})},w=function(e){return void 0===e&&(e=0),e?e+1:0},m=function(e,n){for(var r=0,t=h(e);t.length>r;r++){var o=t[r];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null},g=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},x=function(e){var n=e.header,r=e.headers,t=e.collapsedHeaders;return n.hide||n.excludeFromRender||e.rootPinned!==e.pinned?null:!(r&&t&&function(e,n,r){var t=m(n,e.accessor);if(t){var o=r.has(t.accessor),i=e.showWhen||v;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,r,t))||null},b=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},y=function(e){var n=e.customTheme;return Math.min(e.headerHeight+n.rowSeparatorWidth+e.childRowCount*(e.rowHeight+n.rowSeparatorWidth)+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth,n.nestedGridMaxHeight+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth)},I=function(e){var n=e.calculatedHeight,r=e.customHeight,t=e.customTheme;return r?("string"==typeof r?parseFloat(r):r)+t.nestedGridPaddingTop+t.nestedGridPaddingBottom:n},C=function(e){var n=e.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},R=function(e,n){var r=n+"";return r.includes(".")||r.includes("[")?r.split(".").reduce(function(e,n){if(null!=e){var r=C(n),t=r.index,o=e[r.key];return null!==t&&Array.isArray(o)&&(o=o[t]),o}},e):e[n]},S=function(e,n,r){var t=n+"";if(t.includes(".")||t.includes("[")){for(var o=t.split("."),i=e,a=0;o.length-1>a;a++){var u=C(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=C(o[a+1]);i[l]=null!==c.index?[]:{}}if(i=i[l],null!==s){if(!Array.isArray(i))throw Error("Expected array at ".concat(o.slice(0,a+1).join("."),", but found ").concat(typeof i));for(;s>=i.length;)i.push(null);null==i[s]&&(i[s]={}),i=i[s]}}var d=C(o[o.length-1]),f=d.key,v=d.index;if(null!==v){for(Array.isArray(i[f])||(i[f]=[]);v>=i[f].length;)i[f].push(null);i[f][v]=r}else i[f]=r}else e[n]=r},M=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},N=function(e){var n=e.getRowId,r=u([],e.rowPath,!0);if(n){var t=n({row:e.row,depth:e.depth,index:e.index,rowPath:e.rowPath,rowIndexPath:e.rowIndexPath,groupingKey:e.groupingKey});r.push(t)}return r},H=function(e){return e.join("-")},E=function(e,n){var r=e[n];return M(r)?r:[]},k=function(e,n,r,t,o){var i=e+"",a=t.has(i)&&t.get(i)===n,u=o.has(i)&&o.get(i)===n;return r.has(n)?!u:a},T=function(e){var n=e.depth,r=e.expandedDepths,t=e.expandedRows,o=e.collapsedRows,i=e.rowGrouping,a=void 0===i?[]:i,l=e.getRowId,s=e.displayPositionOffset,c=void 0===s?0:s,d=e.rowStateMap,f=e.hasLoadingRenderer,v=void 0!==f&&f,p=e.hasErrorRenderer,h=void 0!==p&&p,w=e.hasEmptyRenderer,m=void 0!==w&&w,g=e.headers,x=void 0===g?[]:g,b=e.rowHeight,C=e.headerHeight,R=e.customTheme,S=[],M=function(e,n,i,s,f,p,w){void 0===i&&(i=0),void 0===s&&(s=c),void 0===f&&(f=[]),void 0===p&&(p=[]),void 0===w&&(w=[]);var g=i,T=s;return e.forEach(function(i,s){var c,P,A=a[n],D=u(u([],f,!0),[s],!1),F=u(u([],p,!0),[s],!1),O=N({row:i,getRowId:l,depth:n,index:s,rowPath:D,rowIndexPath:F,groupingKey:A}),L=S.length,W={row:i,depth:n,displayPosition:T,groupingKey:A,position:g,isLastGroupRow:0===n&&s===e.length-1,rowId:O,rowPath:D,rowIndexPath:F,absoluteRowIndex:g,parentIndices:w.length>0?u([],w,!0):void 0};S.push(W),g++,T++;var B=H(O);if(k(B,n,r,t,o)&&a.length>n){var z=null==d?void 0:d.get(B),q=E(i,A),G=x.find(function(e){return e.expandable&&e.nestedTable});if((null==G?void 0:G.nestedTable)&&q.length>0){var V=(null===(c=G.nestedTable.customTheme)||void 0===c?void 0:c.rowHeight)||b,j=(null===(P=G.nestedTable.customTheme)||void 0===P?void 0:P.headerHeight)||C,K=y({childRowCount:q.length,rowHeight:V,headerHeight:j,customTheme:R}),U=I({calculatedHeight:K,customHeight:G.nestedTable.height,customTheme:R}),_=u(u([],D,!0),[A],!1);S.push({row:{},depth:n+1,displayPosition:T,groupingKey:A,position:g,isLastGroupRow:!1,rowId:_,rowPath:_,rowIndexPath:F,nestedTable:{parentRow:i,expandableHeader:G,childAccessor:A,calculatedHeight:U},absoluteRowIndex:g}),g++,T++}else if(z&&(z.loading||z.error||z.isEmpty)){if(z.loading&&v||z.error&&h||z.isEmpty&&m){var J=u(u([],D,!0),[A],!1);S.push({row:{},depth:n+1,displayPosition:T,groupingKey:A,position:g,isLastGroupRow:!1,rowId:J,rowPath:J,rowIndexPath:F,stateIndicator:{parentRowId:B,parentRow:i,state:z},absoluteRowIndex:g,parentIndices:u(u([],w,!0),[L],!1)}),g++,T++}else if(z.loading&&!v){var Y=u(u([],D,!0),[A,"loading-skeleton"],!1);S.push({row:{},depth:n+1,displayPosition:T,groupingKey:A,position:g,isLastGroupRow:!1,rowId:Y,rowPath:Y,rowIndexPath:F,isLoadingSkeleton:!0,absoluteRowIndex:g,parentIndices:u(u([],w,!0),[L],!1)}),g++,T++}}else if(q.length>0){var X=u(u([],D,!0),[A],!1),$=u([],F,!0);g=M(q,n+1,g,T,X,$,u(u([],w,!0),[L],!1))}}}),g};return M(e.rows,void 0===n?0:n,0,c,[],[],[]),S},P=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return P(e,n)}):e.children.filter(function(e){var n=e.showWhen||v;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return P(e,n)}):[e]},A=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(g({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},D=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(g({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){D(e)})},F=function(e){return"number"==typeof e.minWidth?e.minWidth:d},O=function(e,n){var r=[];return e.forEach(function(e){e.hide||r.push.apply(r,P(e,n))}),r},L=function(e,n){var r=n.rowTopPositions;if(0===r.length)return 0;if(0>=e)return 0;if(e>=n.totalHeight)return r.length-1;for(var t=0,o=r.length-1;o>t;){var i=Math.floor((t+o+1)/2);r[i]>e?o=i-1:t=i}return t},W=function(e,n){if(!n||0===n.length)return 0;for(var r=0,t=0,o=n.length;o>t;){var i=Math.floor((t+o)/2);e>n[i][0]?t=i+1:o=i}for(var a=0;t>a;a++)r+=n[a][1];return r},B=function(e){var n=e.bufferRowCount,r=e.contentHeight,t=e.scrollTop,o=e.tableRows,i=e.scrollDirection,a=void 0===i?"none":i,u=e.heightMap,l=e.rowHeight+1;if(!u){var s=n*l,c=s,d=s;"down"===a?(c=Math.max(l,.1*s),d=.9*s):"up"===a&&(c=.9*s,d=Math.max(l,.1*s));var f=t+r+d,v=Math.max(0,Math.floor(Math.max(0,t-c)/l)),p=Math.min(o.length,Math.ceil(f/l)),h=t+r,w=Math.max(0,Math.ceil(t/l)),m=Math.min(o.length,Math.floor(h/l)),g=t+r,x=Math.max(0,Math.floor(t/l)),b=Math.min(o.length,Math.ceil(g/l));return{rendered:{startIndex:v,endIndex:p,rows:o.slice(v,p)},fullyVisible:{startIndex:w,endIndex:m,rows:o.slice(w,m)},partiallyVisible:{startIndex:x,endIndex:b,rows:o.slice(x,b)}}}var y=u.rowTopPositions,I=n*l,C=I,R=I;"down"===a?(C=Math.max(l,.1*I),R=.9*I):"up"===a&&(C=.9*I,R=Math.max(l,.1*I));var S=t+r+R,M=L(Math.max(0,t-C),u),N=L(S,u)+1;N=Math.min(o.length,N);var H=t,E=t+r,k=L(H,u);H>y[k]&&(k=Math.min(k+1,o.length));var T=L(E,u);T=Math.min(o.length,T);var P=t+r,A=L(t,u),D=L(P,u)+1;return D=Math.min(o.length,D),{rendered:{startIndex:M,endIndex:N,rows:o.slice(M,N)},fullyVisible:{startIndex:k,endIndex:T,rows:o.slice(k,T)},partiallyVisible:{startIndex:A,endIndex:D,rows:o.slice(A,D)}}},z=function(e){var n=e.position;return n*(e.rowHeight+e.customTheme.rowSeparatorWidth)+W(n,e.heightOffsets)},q=function(e,n){var r,t,o=e.position,i=n[o+1];return null!==(t=null===(r=null==i?void 0:i.parentIndices)||void 0===r?void 0:r.includes(o))&&void 0!==t&&t},G=function(e){var n=e.allTableRows,r=e.renderedRows,t=e.fullyVisibleRows,o=e.partiallyVisibleRows,i=e.partiallyVisibleRowIndex,a=e.recursionDepth,u=e.stickyParents,l=e.rowGrouping,s=o[i];if(!s||a>10)return{stickyParents:u,regularRows:r};var c=0;if(s.parentIndices&&s.parentIndices.length>0){for(var d=function(e){var r=n[e];if(r){var o=t.some(function(e){return e.position===r.position});if(s.rowIndexPath&&s.rowIndexPath.length>0){var i=n[s.parentIndices[s.parentIndices.length-1]],a=i.row[l[i.depth]];if(u.length>=(Array.isArray(a)?a:[]).length-s.rowIndexPath[s.rowIndexPath.length-1])return"break"}o||u.some(function(e){return H(e.rowId)===H(r.rowId)})||(u.push(r),c++)}},f=0,v=s.parentIndices;v.length>f&&"break"!==d(v[f]);f++);if(u.length>0){q(s,n)&&(u.push(s),c++);var p=o[i+=c];p&&(s=p)}}else if(q(s,n))return u.push(s),i++,G({allTableRows:n,renderedRows:r,fullyVisibleRows:t,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l});return q(s,n)?G({allTableRows:n,renderedRows:r,fullyVisibleRows:t,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l}):{stickyParents:u,regularRows:r}},V=function(e,n,r){var t=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>t.top?n.scrollTop-=o.top-t.top+i:t.bottom>o.bottom-i&&(n.scrollTop+=t.bottom-o.bottom+i),r){var a=r.getBoundingClientRect();a.left+i>t.left?r.scrollLeft-=a.left-t.left+i:t.right>a.right-i&&(r.scrollLeft+=t.right-a.right+i)}},j=function(e,n,r,t){var o=document.querySelector(".st-body-container"),i=document.querySelector(".st-body-main");if(o){var a=n+r.rowSeparatorWidth,u=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));if(u&&t){var l=function(e,n,r,t){var o=B({bufferRowCount:0,contentHeight:n.clientHeight,rowHeight:r,scrollTop:n.scrollTop,tableRows:t,scrollDirection:"none"}).fullyVisible;return e>=o.startIndex&&o.endIndex>e}(e.rowIndex,o,n,t);if(l)return void V(u,o,i)}if(!u)return o.scrollTop=Math.max(0,e.rowIndex*a-o.clientHeight/3),void setTimeout(function(){var n=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));n&&V(n,o,i)},100);V(u,o,i)}},K=function(e){var n=e.colIndex,r=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(r)},U=n.createContext(void 0),_=function(n){return e.jsx(U.Provider,exports.__assign({value:n.value},{children:n.children}))},J=function(){var e=n.useContext(U);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},Y=function(r){var t=r.currentPage,o=r.footerRenderer,u=r.hideFooter,l=r.onPageChange,s=r.onNextPage,c=r.onUserPageChange,d=r.rowsPerPage,f=r.shouldPaginate,v=r.totalPages,p=r.totalRows,h=J().icons,w=n.useState(!0),m=w[0],g=w[1],x=t>1,b=v>t,y=t===v,I=Math.min((t-1)*d+1,p),C=Math.min(t*d,p),R=!x,S=!b&&!s||!m&&y,M=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=t-1)?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},N=function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(r){switch(r.label){case 0:return e=t===v,n=t+1,s&&e?[4,s(t)]:[3,2];case 1:if(!r.sent())return g(!1),[2];r.label=2;case 2:return n>v&&!s?[3,4]:(l(n),c?[4,c(n)]:[3,4]);case 3:r.sent(),r.label=4;case 4:return[2]}})})},H=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return 1>e||e>v?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})};if(u||!f)return null;if(o)return e.jsx(e.Fragment,{children:o({currentPage:t,totalPages:v,rowsPerPage:d,totalRows:p,startRow:I,endRow:C,onPageChange:H,onNextPage:N,onPrevPage:M,hasNextPage:!S,hasPrevPage:!R,nextIcon:h.next,prevIcon:h.prev})});var E=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,r=[];t>8?v-7>t?(e=t-7,n=t+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14),e>2?(r.push(1),r.push(-1)):2===e&&r.push(1);for(var o=e;n>=o;o++)r.push(o);return v-1>n?(r.push(-2),r.push(v)):n===v-1&&r.push(v),r}();return e.jsxs("div",exports.__assign({className:"st-footer"},{children:[e.jsx("div",exports.__assign({className:"st-footer-info"},{children:e.jsxs("span",exports.__assign({className:"st-footer-results-text"},{children:["Showing ",I," to ",C," of ",p.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[E.map(function(n,r){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),r):e.jsx("button",exports.__assign({onClick:function(){return H(n)},className:"st-page-btn ".concat(t===n?"active":""),"aria-label":"Go to page ".concat(n),"aria-current":t===n?"page":void 0},{children:n}),r)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(R?"disabled":""),onClick:M,disabled:R,"aria-label":"Go to previous page"},{children:h.prev})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(S?"disabled":""),onClick:N,disabled:S,"aria-label":"Go to next page"},{children:h.next}))]}))]}))},X=function(n){return e.jsx("svg",exports.__assign({className:n.className,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"})}))},$=function(n){return e.jsx("svg",exports.__assign({className:n.className,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"})}))},Q=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,style:{height:"1em"}},{children:e.jsx("path",{d:"M298 177.5c3.8-8.8 2-19-4.6-26l-116-144C172.9 2.7 166.6 0 160 0s-12.9 2.7-17.4 7.5l-116 144c-6.6 7-8.4 17.2-4.6 26S34.4 192 44 192l72 0 0 288c0 17.7 14.3 32 32 32l24 0c17.7 0 32-14.3 32-32l0-288 72 0c9.6 0 18.2-5.7 22-14.5z"})}))},Z=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:n.className,style:exports.__assign({height:"10px"},n.style)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},ee=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},ne=function(n){return e.jsxs("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 10",className:n.className,style:exports.__assign({height:"10px",width:"16px"},n.style)},{children:[e.jsx("circle",{cx:"3",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"8",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"13",cy:"3",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"3",cy:"7",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"8",cy:"7",r:"1.5",fill:"currentColor"}),e.jsx("circle",{cx:"13",cy:"7",r:"1.5",fill:"currentColor"})]}))},re=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:n.className,style:exports.__assign({height:"1em"},n.style)},{children:e.jsx("path",{d:"M3.9 54.9C10.5 40.9 24.5 32 40 32l432 0c15.5 0 29.5 8.9 36.1 22.9s4.6 30.5-5.2 42.5L320 320.9 320 448c0 12.1-6.8 23.2-17.7 28.6s-23.8 4.3-33.5-3l-64-48c-8.1-6-12.8-15.5-12.8-25.6l0-79.1L9 97.3C-.7 85.4-2.8 68.8 3.9 54.9z"})}))},te=function(){return e.jsx("svg",exports.__assign({className:"st-custom-select-arrow",width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},oe=function(e){var r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==r?void 0:r.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")}},[r,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current;if(e&&(null==r?void 0:r.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=new ResizeObserver(function(){n()});return o.observe(e),function(){e&&o.unobserve(e)}}},[r,t]),{isMainSectionScrollable:a}},ie=function(r){var t=r.children,o=r.onClose,i=r.open,a=r.overflow,u=void 0===a?"auto":a,l=r.setOpen,s=r.width,c=r.containerRef,d=r.positioning,f=void 0===d?"fixed":d,v=J().mainBodyRef,p=n.useRef(null),h=n.useRef(null),w=n.useState("bottom-left"),m=w[0],g=w[1],x=n.useState({}),b=x[0],y=x[1],I=n.useState(!1),C=I[0],R=I[1];return n.useEffect(function(){i&&p.current?(R(!1),!h.current&&p.current.parentElement&&(h.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&h.current){var e,n=p.current,r=h.current.getBoundingClientRect(),t=n.offsetHeight,o=s||n.offsetWidth,i=(e=(null==c?void 0:c.current)?c.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-r.bottom,a=r.top-e.top,u="bottom",l={};(t>i&&a>=t||t>i&&a>i)&&(u="top");var d="left";o>e.right-r.right+r.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=r.bottom+4:l.bottom=window.innerHeight-r.top+4,"left"===d?l.left=r.left:l.right=window.innerWidth-r.right):("bottom"===u?l.top=r.height+4:l.bottom=r.height+4,"left"===d?l.left=0:l.right=0),g("".concat(u,"-").concat(d)),y(l),R(!0)}})):i||R(!1)},[i,s,c,v,f]),n.useEffect(function(){var e=function(e){i&&p.current&&p.current&&!p.current.contains(e.target)&&(l(!1),null==o||o())};return i&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[i,o,l]),n.useEffect(function(){var e=function(e){if(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.contains(e.target)&&(l(!1),null==o||o())}},n=function(n){"Enter"===n.key&&e(n)};return i&&(document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",n,!0)),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",n,!0)}},[o,i,l]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&i&&(l(!1),null==o||o())};return i&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[o,i,l]),i?e.jsx("div",exports.__assign({ref:p,className:"st-dropdown-content st-dropdown-".concat(m),onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()},onTouchStart:function(e){return e.stopPropagation()},style:exports.__assign(exports.__assign({position:f,width:s?"".concat(s,"px"):"auto",visibility:C?"visible":"hidden"},b),{overflow:u})},{children:t})):null},ae=function(n){var r=n.children,t=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,s=void 0===l?"":l;return e.jsx("div",exports.__assign({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(u?"disabled":""," ").concat(s),onClick:function(){!u&&t&&t()},role:"option","aria-selected":i,"aria-disabled":u},{children:r}))},ue=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=n.useState(r.value),l=u[0],s=u[1],c=function(e){s(e),o(e),a(!1),t()};return e.jsxs(ie,exports.__assign({open:i,onClose:function(){t()},setOpen:a,width:120},{children:[e.jsx(ae,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx(ae,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},le=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},se=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+t,onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},ce=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-4eaff4a4.js")})}),de=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-447a7ab5.js")})}),fe=n.lazy(function(){return Promise.resolve().then(function(){return dr})}),ve=n.lazy(function(){return Promise.resolve().then(function(){return vr})}),pe=function(r){var t=o(r,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},t))},{children:e.jsx(ce,exports.__assign({},r))}))},he=function(r){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(de,exports.__assign({},r))}))},we=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(fe,exports.__assign({},r))}))},me=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(ve,exports.__assign({},r))}))},ge=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number);return new Date(n[0],n[1]-1,n[2],12,0,0)}var r=new Date(e);return isNaN(r.getTime())?new Date:new Date(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0)},xe=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},be=function(e){if(!e)return new Date;if("string"==typeof e)return ge(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:xe(n)}return e instanceof Date?xe(e):new Date},ye=function(e){return e?ge(""+e):new Date},Ie=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=r.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e.jsx(ie,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(he,{value:ye(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),t()},onClose:l})}))},Ce=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.options,u=r.setOpen,l=n.useState(r.value||""),s=l[0],c=l[1];return e.jsx(ie,exports.__assign({open:i,onClose:function(){t()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx(ae,exports.__assign({isSelected:s===n.value,onClick:function(){return c(e=n.value),o(e),u(!1),void t();var e}},{children:n.label}),n.value)})}))}))},Re=function(n){var r=n.enumOptions,t=void 0===r?[]:r,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,s=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(ue,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(Ie,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(Ce,{onBlur:s,onChange:o,open:!0,options:t,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(se,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(le,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},Se=0,Me=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();0!==Se&&t>o-Se||(Se=o,n(r))}},Ne=function(e){var r=n.useRef(e);return n.useEffect(function(){JSON.stringify(r.current)!==JSON.stringify(e)&&(r.current=e)},[e]),r.current},He=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(He);var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=He(e[r]));return n},Ee=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},ke=Date.now(),Te={screenX:0,screenY:0},Pe=function(e,n,r){void 0===r&&(r=[]);for(var t=0;e.length>t;t++){var o=e[t];if(o.accessor===n)return u(u([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=Pe(o.children,n,u(u([],r,!0),[t],!1));if(i)return i}}return null},Ae=function(e,n){for(var r=e,t=0;n.length-1>t;t++)r=r[n[t]].children;return r},De=function(e,n,r){if(1===n.length)return r;for(var t=e,o=0;n.length-2>o;o++)t=t[n[o]].children;return t[n[n.length-2]].children=r,e},Fe=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function Oe(e,n,r){var t=He(e),o=!1;function i(e,n){for(var r=e,t=0;n.length-1>t;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;n.length-1>i;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var u=i(t,n);return a(t,n,i(t,r)),a(t,r,u),{newHeaders:t,emergencyBreak:o}}function Le(e){var n,r,t=e.draggedHeader,o=e.hoveredHeader,i=He(e.headers),a=!1;try{var u=Fe(o),l=i.findIndex(function(e){return e.accessor===t.accessor}),s=i.findIndex(function(e){return e.accessor===o.accessor});if(-1===l||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var c=i.splice(l,1)[0],d=(n=u,r=exports.__assign({},c),"left"===n?r.pinned="left":"right"===n?r.pinned="right":delete r.pinned,r);i.splice(s,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var We=function(e){var n=e.draggedHeaderRef,r=e.headers,t=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=J().setHeaders,l=Ne(r);return{handleDragStart:function(e){n.current=e,ke=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),r&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,c=o.screenY,d=Math.sqrt(Math.pow(s-Te.screenX,2)+Math.pow(c-Te.screenY,2));t.current=a;var f,v,p,h=n.current,w=!1;if(Fe(h)!==Fe(a))f=(b=Le({headers:r,draggedHeader:h,hoveredHeader:a})).newHeaders,w=b.emergencyBreak;else{var m=r,g=Pe(m,h.accessor),x=Pe(m,a.accessor);if(!g||!x)return;var b,y=g.length,I=x.length,C=x;if(y!==I){var R=I-y;R>0&&(C=x.slice(0,-R))}if((v=g).length!==(p=C).length||1!==v.length&&!v.slice(0,-1).every(function(e,n){return e===p[n]}))return;f=(b=Oe(m,g,C)).newHeaders,w=b.emergencyBreak}if(!(u||a.accessor===h.accessor||10>d||JSON.stringify(f)===JSON.stringify(r)||w)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>S-ke||40>d)||(ke=S,Te={screenX:s,screenY:c},i(f))}}},handleDragEnd:function(){n.current=null,t.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(r)},10)}}},Be=function(n){var r=n.checked,t=void 0!==r&&r,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:t,className:"st-checkbox-input",onChange:function(){i&&i(!t)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":n.ariaLabel,"aria-checked":t}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(t?"st-checked":""),"aria-hidden":"true"},{children:t&&e.jsx(Z,{className:"st-checkbox-checkmark"})})),o]}))},ze=function(n){var r,t=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:t}):"lineAreaChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(we,exports.__assign({data:r},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(me,exports.__assign({data:r},o.chartOptions)):null:"boolean"==typeof t?t?"True":"False":Array.isArray(t)?0===t.length?"[]":t.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==t&&("string"==typeof t||"number"==typeof t||"object"==typeof t&&t instanceof Date)?be(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):t},qe=t.default.memo(function(r){var t=r.borderClass,o=r.colIndex,i=r.displayRowNumber,a=r.header,u=r.isHighlighted,l=r.isInitialFocused,s=r.nestedIndex,c=r.parentHeader,d=r.rowIndex,f=r.tableRow,v=J(),p=v.canExpandRowGroup,h=v.cellRegistry,w=v.cellUpdateFlash,m=v.collapsedRows,x=v.columnBorders,y=v.draggedHeaderRef,I=v.enableRowSelection,C=v.expandedDepths,N=v.expandedRows,E=v.handleMouseDown,T=v.handleMouseOver,P=v.handleRowSelect,A=v.headers,D=v.hoveredHeaderRef,F=v.icons,O=v.isCopyFlashing,L=v.isLoading,W=v.isRowSelected,B=v.isWarningFlashing,z=v.onCellEdit,q=v.onCellClick,G=v.onRowGroupExpand,V=v.onTableHeaderDragEnd,j=v.rowButtons,K=v.rowGrouping,U=v.setCollapsedRows,_=v.setExpandedRows,Y=v.setRowStateMap,X=v.rowsWithSelectedCells,$=v.selectedColumns,Q=v.tableBodyContainerRef,Z=v.theme,ee=v.useOddColumnBackground,ne=f.depth,re=f.row,te=f.rowPath,oe=f.rowIndexPath,ie=f.absoluteRowIndex,ae=f.rowId,ue=n.useState(R(re,a.accessor)),le=ue[0],se=ue[1],ce=n.useState(!1),de=ce[0],fe=ce[1],ve=n.useState(!1),he=ve[0],we=ve[1],me=n.useState(!1),ge=me[0],xe=me[1],be=n.useRef(null),ye=H(ae),Ie=K&&K[ne],Ce=!!Ie&&function(e,n){return!!n&&M(e[n])}(re,Ie),Se=K&&K.length>ne,Ne=!p||p(re),He=!!a.nestedTable,Ee=k(ye,ne,C,N,m),ke=O({rowIndex:d,colIndex:o,rowId:ye}),Te=B({rowIndex:d,colIndex:o,rowId:ye}),Pe=n.useMemo(function(){var e,n,r;if(!x)return!1;var t=A.filter(function(e){return"left"===e.pinned}),o=A.filter(function(e){return!e.pinned}),i=A.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===a.accessor},[x,A,a.accessor,a.pinned]),Ae=We({draggedHeaderRef:y,headers:A,hoveredHeaderRef:D,onTableHeaderDragEnd:V}).handleDragOver,De=Me(),Fe=g({accessor:a.accessor,rowId:ye}),Oe=b({rowId:ye,accessor:a.accessor}),Le=a.isSelectionColumn&&I;n.useEffect(function(){if(h){var e="".concat(ye,"-").concat(a.accessor);return h.set(e,{updateContent:function(e){le!==e?(se(e),w&&(we(!0),be.current&&clearTimeout(be.current),be.current=setTimeout(function(){we(!1)},800))):se(e)}}),function(){h.delete(e),be.current&&clearTimeout(be.current)}}},[h,w,ye,a.accessor,le]),n.useEffect(function(){if(he){var e=setTimeout(function(){we(!1)},850);return function(){return clearTimeout(e)}}},[he]),n.useEffect(function(){se(R(re,a.accessor))},[re,a.accessor]);var qe="boolean"===a.type||"date"===a.type||"enum"===a.type,Ge=!!(null==a?void 0:a.isEditable),Ve=$.has(o),je=u&&!Ve,Ke=n.useMemo(function(){return!!Le&&X.has(ye+"")},[Le,X,ye]),Ue=null==c?void 0:c.singleRowChildren,_e="st-cell ".concat(ne>0&&a.expandable?"st-cell-depth-".concat(ne):""," ").concat(je?l?"st-cell-selected-first ".concat(t):"st-cell-selected ".concat(t):""," ").concat(Ve?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ge?"clickable":""," ").concat(he?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(ke?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Te?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(ee?s%2==0?"even-column":"odd-column":""," ").concat(Le?"st-selection-cell":""," ").concat(Ke?"st-selection-has-highlighted-cell":""," ").concat(Pe?"st-last-column":""," ").concat(Ue?"st-sub-cell":""," ").concat(ge?"hovered":""),Je=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),se(e),S(re,a.accessor,e),null==z||z({accessor:a.accessor,newValue:e,row:re,rowIndex:d})},[a.accessor,a.type,z,re,d]),Ye=n.useCallback(function(e){e.stopPropagation();var n=k(ye,ne,C,N,m),r=ye+"";if(n?(U(function(e){var n=new Map(e);return n.set(r,ne),n}),_(function(e){var n=new Map(e);return n.delete(r),n})):(_(function(e){var n=new Map(e);return n.set(r,ne),n}),U(function(e){var n=new Map(e);return n.delete(r),n})),n&&Y(function(e){var n=new Map(e);return n.delete(ye),n}),G){var t=a.pinned;G({depth:ne,event:e,groupingKey:Ie,groupingKeys:K||[],isExpanded:!n,row:re,rowIndexPath:oe||[],rowIdPath:te,setEmpty:function(e,n){Y(function(r){var o=new Map(r),i=o.get(ye)||{};return o.set(ye,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:t})),o})},setError:function(e){Y(function(n){var r=new Map(n),o=r.get(ye)||{};return r.set(ye,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:t})),r})},setLoading:function(e){e?Y(function(e){var n=new Map(e),r=n.get(ye)||{};return n.set(ye,exports.__assign(exports.__assign({},r),{loading:!0,error:null,isEmpty:!1,triggerSection:t})),n}):setTimeout(function(){Y(function(e){var n=new Map(e),r=n.get(ye)||{};return n.set(ye,exports.__assign(exports.__assign({},r),{loading:!1,error:null,isEmpty:!1,triggerSection:t})),n})},0)}})}},[m,Ie,ne,C,N,a.pinned,G,re,K,ye,oe,te,U,_,Y]);return L||f.isLoadingSkeleton?e.jsx("div",exports.__assign({className:_e},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!de||qe||Le?e.jsxs(pe,exports.__assign({className:_e,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ye,"data-row-index":d,role:"gridcell","aria-colindex":o+1,id:Fe,onClick:function(){q&&!Le&&q({accessor:a.accessor,colIndex:o,row:re,rowIndex:d,value:le})},onDoubleClick:function(){return a.isEditable&&!Le&&fe(!0)},onDragOver:function(e){Le||De({callback:Ae,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){de||Le||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||de||(e.preventDefault(),fe(!0))},onMouseDown:function(){de||Le||E({rowIndex:d,colIndex:o,rowId:ye})},onMouseEnter:function(){xe(!0)},onMouseLeave:function(){xe(!1)},onMouseOver:function(){de||Le||T({rowIndex:d,colIndex:o,rowId:ye})},parentRef:Q,tableRow:f},{children:[a.expandable&&Se?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(Ne&&(Ce||G||He)?Ee?"expanded":"collapsed":"placeholder"),onClick:Ne&&(Ce||G||He)?function(e){return Ye(e)}:void 0,role:Ne&&(Ce||G||He)?"button":"presentation",tabIndex:Ne&&(Ce||G||He)?0:-1,"aria-label":Ne&&(Ce||G||He)?"".concat(Ee?"Collapse":"Expand"," row group"):void 0,"aria-expanded":Ne&&(Ce||G||He)?Ee:void 0,"aria-hidden":!(Ne&&(Ce||G||He)),onKeyDown:Ne&&(Ce||G||He)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ye(e))}:void 0},{children:F.expand})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:L||f.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:Le?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:ge||W&&W(ye+"")?e.jsx(Be,{checked:!!W&&W(ye+""),onChange:function(e){P&&P(ye+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!j||!Le||0===j.length)return null;if(!(ge||W&&W(ye+"")))return null;var n={row:re,rowIndex:i};return e.jsx("div",exports.__assign({className:"st-row-buttons",role:"group","aria-label":"Actions for row ".concat(i+1)},{children:j.map(function(r,t){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:r(n)}),t)})}))}()]})):a.cellRenderer?function(){var e;return a.cellRenderer({accessor:a.accessor,colIndex:o,row:re,rowIndex:ie,rowPath:te,theme:Z,value:le,formattedValue:null===(e=null==a?void 0:a.valueFormatter)||void 0===e?void 0:e.call(a,{accessor:a.accessor,colIndex:o,row:re,rowIndex:d,value:le})})}():ze({content:le,header:a,colIndex:o,row:re,rowIndex:d})})})),!L&&!f.isLoadingSkeleton&&de&&qe&&!Le&&e.jsx(Re,{enumOptions:a.enumOptions,onChange:Je,setIsEditing:fe,type:a.type,value:le})]}),Oe):e.jsx("div",exports.__assign({className:"st-cell-editing",id:g({accessor:a.accessor,rowId:ye}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(Re,{enumOptions:a.enumOptions,onChange:Je,setIsEditing:fe,type:a.type,value:le})}))},function(e,n){if(e.rowIndex!==n.rowIndex||e.colIndex!==n.colIndex||e.isHighlighted!==n.isHighlighted||e.isInitialFocused!==n.isInitialFocused||e.borderClass!==n.borderClass)return!1;if(e.tableRow!==n.tableRow){if(e.tableRow.row!==n.tableRow.row)return!1;if(e.tableRow.position!==n.tableRow.position||e.tableRow.displayPosition!==n.tableRow.displayPosition)return!1}return(e.header===n.header||e.header.accessor===n.header.accessor&&e.header.isEditable===n.header.isEditable&&e.header.type===n.header.type&&e.header.cellRenderer===n.header.cellRenderer&&e.header.valueFormatter===n.header.valueFormatter)&&e.parentHeader===n.parentHeader&&e.displayRowNumber===n.displayRowNumber&&e.nestedIndex===n.nestedIndex}),Ge=function(r){var t=r.columnIndices,o=r.displayRowNumber,i=r.header,a=r.headers,u=r.nestedIndex,l=r.parentHeader,s=r.pinned,c=r.rootPinned,d=r.rowIndex,f=r.rowIndices,v=r.tableRow,p=t[i.accessor],h=J(),w=h.getBorderClass,m=h.isSelected,b=h.isInitialFocusedCell,y=h.collapsedHeaders,I=H(v.rowId);if(i.children&&i.children.length>0){var C=i.children.filter(function(e){return x({header:e,pinned:s,headers:a,collapsedHeaders:y,rootPinned:c})});if(i.singleRowChildren){var R={rowIndex:d,colIndex:p,rowId:I},S=w(R),M=m(R),N=b(R),E=g({accessor:i.accessor,rowId:I});return e.jsxs(n.Fragment,{children:[e.jsx(qe,{borderClass:S,colIndex:p,displayRowNumber:o,header:i,isHighlighted:M,isInitialFocused:N,nestedIndex:u,parentHeader:l,rowIndex:d,tableRow:v},E),C.map(function(n){var r=g({accessor:n.accessor,rowId:I});return e.jsx(Ge,{columnIndices:t,displayRowNumber:o,rootPinned:c,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:d,rowIndices:f,tableRow:v},r)})]})}return e.jsx(n.Fragment,{children:C.map(function(n){var r=g({accessor:n.accessor,rowId:I});return e.jsx(Ge,{columnIndices:t,displayRowNumber:o,rootPinned:c,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:d,rowIndices:f,tableRow:v},r)})})}var k={rowIndex:d,colIndex:p,rowId:I},T=w(k),P=m(k),A=b(k),D=g({accessor:i.accessor,rowId:I});return e.jsx(qe,{borderClass:T,colIndex:p,displayRowNumber:o,header:i,isHighlighted:P,isInitialFocused:A,nestedIndex:u,parentHeader:l,rowIndex:d,tableRow:v},D)},Ve=t.default.memo(function(n){var r=n.columnIndexStart,t=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,s=n.tableRow,c=J().collapsedHeaders,d=o.filter(function(e){return x({header:e,pinned:i,headers:o,collapsedHeaders:c,rootPinned:e.pinned})});return e.jsx(e.Fragment,{children:d.map(function(n,c){var d=H(s.rowId),f=g({accessor:n.accessor,rowId:d});return e.jsx(Ge,{columnIndices:t,displayRowNumber:u,rootPinned:n.pinned,header:n,headers:o,nestedIndex:c+(null!=r?r:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:s},f)})})},function(e,n){return e.rowIndex===n.rowIndex&&e.displayRowNumber===n.displayRowNumber&&e.columnIndexStart===n.columnIndexStart&&(e.tableRow===n.tableRow||e.tableRow.row===n.tableRow.row)&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.rowIndices===n.rowIndices}),je=function(n){var r=n.rowState,t=n.loadingStateRenderer,o=n.errorStateRenderer,i=n.emptyStateRenderer,a=null;return r.loading&&t?a=t:r.error&&o?a=o:r.isEmpty&&i&&(a=i),a?e.jsx("div",exports.__assign({className:"st-cell st-state-row-cell",style:{gridColumn:"1 / -1",padding:0}},{children:a})):null},Ke=function(n){var r=n.calculatedHeight,t=n.childAccessor,o=n.depth,i=n.expandableHeader,a=n.index,u=n.parentRow,l=n.position,s=J(),c=s.theme,d=s.rowGrouping,f=s.rowHeight,v=s.heightOffsets,p=s.customTheme,h=s.loadingStateRenderer,w=s.errorStateRenderer,m=s.emptyStateRenderer,g=s.icons,x=i.nestedTable;if(!x)return null;var b=R(u,t),y=Array.isArray(b)?b:[],C=d&&d[o+1]?null==d?void 0:d.slice(o+1):void 0,S=x.customTheme?exports.__assign(exports.__assign({},p),x.customTheme):p,M=function(e){var n=e.calculatedHeight,r=e.customHeight,t=e.customTheme;return r?"string"==typeof r?r:"".concat(r,"px"):"".concat(n-t.nestedGridPaddingTop-t.nestedGridPaddingBottom,"px")}({calculatedHeight:r,customHeight:x.height,customTheme:p}),N=I({calculatedHeight:r,customHeight:x.height,customTheme:p});return e.jsx("div",exports.__assign({className:"st-row st-nested-grid-row","data-index":a,style:{transform:"translate3d(0, ".concat(z({position:l,rowHeight:f,heightOffsets:v,customTheme:p}),"px, 0)"),height:"".concat(N,"px"),paddingTop:"".concat(p.nestedGridPaddingTop,"px"),paddingBottom:"".concat(p.nestedGridPaddingBottom,"px")}},{children:e.jsx(lr,exports.__assign({},x,{rows:y,theme:c,customTheme:S,height:M,rowGrouping:C,loadingStateRenderer:h,errorStateRenderer:w,emptyStateRenderer:m,icons:g}))}))},Ue=t.default.memo(function(n){var r=n.columnIndices,t=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,u=n.pinned,l=n.rowHeight,s=n.rowIndices,c=n.setHoveredIndex,d=n.tableRow,f=n.isSticky,v=void 0!==f&&f,p=n.stickyIndex,h=void 0===p?0:p,w=n.stickyOffset,m=void 0===w?0:w,g=n.stickyZIndex,x=J(),b=x.customTheme,y=x.emptyStateRenderer,I=x.errorStateRenderer,C=x.heightOffsets,R=x.isAnimating,S=x.isRowSelected,M=x.loadingStateRenderer,N=x.maxHeaderDepth,E=x.useHoverRowBackground,k=x.useOddEvenRowBackground,T=d.position,P=d.displayPosition,A=d.stateIndicator,D=d.nestedTable;if(D)return u?e.jsx("div",{className:"st-row st-nested-grid-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(z({position:T,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(D.calculatedHeight,"px")}}):e.jsx(Ke,{calculatedHeight:D.calculatedHeight,childAccessor:D.childAccessor,depth:d.depth-1,expandableHeader:D.expandableHeader,index:a,parentRow:D.parentRow,position:T});if(A)return e.jsx("div",A.state.triggerSection===u&&(A.state.loading&&M||A.state.error&&I||A.state.isEmpty&&y)?exports.__assign({className:"st-row st-state-row","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(z({position:T,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(je,{parentRow:A.parentRow,rowState:A.state,gridTemplateColumns:o,loadingStateRenderer:M,errorStateRenderer:I,emptyStateRenderer:y})}):{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(z({position:T,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}});var F=T%2==0,O=H(d.rowId),L=!!S&&S(O),W=v?{gridTemplateColumns:o,transform:"translateY(".concat(h*(l+1)+m,"px)"),height:"".concat(l,"px"),position:"absolute",top:0,left:0,zIndex:g}:{gridTemplateColumns:o,top:z({position:T,rowHeight:l,heightOffsets:C,customTheme:b}),height:"".concat(l,"px")};return e.jsx("div",exports.__assign({className:"st-row ".concat(v?"st-sticky-parent":""," ").concat(k?F?"even":"odd":""," ").concat(L?"selected":""),"data-index":T,role:"row","aria-rowindex":T+N+1,onMouseEnter:function(){!R&&E&&c(T)},style:W},{children:e.jsx(Ve,{columnIndexStart:t,columnIndices:r,displayRowNumber:P,headers:i,pinned:u,rowIndex:T,rowIndices:s,tableRow:d},O)}))},function(e,n){return e.index===n.index&&e.tableRow.position===n.tableRow.position&&e.tableRow.displayPosition===n.tableRow.displayPosition&&e.tableRow.row===n.tableRow.row&&e.tableRow.stateIndicator===n.tableRow.stateIndicator&&e.rowHeight===n.rowHeight&&e.gridTemplateColumns===n.gridTemplateColumns&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.rowIndices===n.rowIndices&&e.columnIndexStart===n.columnIndexStart}),_e=function(r){var t=r.displayStrongBorder,o=r.position,i=r.rowHeight,a=r.templateColumns,u=r.isSticky,l=void 0!==u&&u,s=J(),c=s.heightOffsets,d=s.customTheme,f=n.useRef(null),v=l?o:function(e){var n=e.position,r=e.customTheme;return n*(e.rowHeight+r.rowSeparatorWidth)-r.rowSeparatorWidth+W(n,e.heightOffsets)}({position:o,rowHeight:i,heightOffsets:c,customTheme:d}),p=l?{position:"absolute",top:0,left:0,transform:"translateY(".concat(v,"px)")}:{transform:"translate3d(0, ".concat(v,"px, 0)")};return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){var n=e.currentTarget,r=n.style.pointerEvents;n.style.pointerEvents="none";var t=document.elementFromPoint(e.clientX,e.clientY);if(n.style.pointerEvents=r,t){var o=t.closest(".st-cell");if(o instanceof HTMLElement){f.current=o;var i=o.getBoundingClientRect(),a=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:i.top+i.height/2});o.dispatchEvent(a)}}},onMouseUp:function(e){if(f.current){var n=f.current.getBoundingClientRect(),r=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});f.current.dispatchEvent(r),f.current=null}},style:exports.__assign({gridTemplateColumns:a},p)},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},Je=n.createContext(void 0),Ye=function(e){var r=e.childRef,t=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(Je);if(!e)throw Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),u=a.registerPane,l=a.unregisterPane;return n.useEffect(function(){var e=[i];return r.current&&u(r.current,e),function(){r.current&&l(r.current,e)}},[r,u,l,i]),n.cloneElement(t,{ref:function(e){r.current=e}})},Xe=n.forwardRef(function(r,t){var o=r.columnIndexStart,i=r.columnIndices,a=r.headers,u=r.pinned,l=r.rowHeight,s=r.rowIndices,c=r.setHoveredIndex,d=r.templateColumns,f=r.totalHeight,v=r.width,p=r.regularRows,h=u?"st-body-pinned-".concat(u):"st-body-main",w=n.useRef(null);return n.useImperativeHandle(t,function(){return w.current},[]),n.useMemo(function(){return Ee(a,u)},[a,u])?e.jsx(Ye,exports.__assign({childRef:w,group:u?"pinned-".concat(u):"default"},{children:e.jsx("div",exports.__assign({className:h,ref:w,style:exports.__assign({position:"relative",height:"".concat(f,"px"),width:v},!u&&{flexGrow:1})},{children:p.map(function(r,t){var f=r.stateIndicator?"state-".concat(r.stateIndicator.parentRowId,"-").concat(r.position):H(r.rowId);return e.jsxs(n.Fragment,{children:[0!==t&&e.jsx(_e,{displayStrongBorder:r.isLastGroupRow,position:r.position,rowHeight:l,templateColumns:d}),e.jsx(Ue,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:t,pinned:u,rowHeight:l,rowIndices:s,setHoveredIndex:c,tableRow:r})]},f)})}))})):null});function $e(e){var n=e.headers,r=e.pinnedLeftColumns,t=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],r,!0),n,!0),t,!0),s=function(e,n,r){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return x({header:e,pinned:r,headers:l,collapsedHeaders:o,rootPinned:r})}).forEach(function(n,t){s(n,!e.singleRowChildren&&0===t,r)})};return r.forEach(function(e,n){s(e,0===n,e.pinned)}),n.filter(function(e){return!e.pinned&&x({header:e,pinned:void 0,headers:l,collapsedHeaders:o,rootPinned:e.pinned})}).forEach(function(e,n){s(e,0===n&&0===r.length,e.pinned)}),t.forEach(function(e){s(e,!1,e.pinned)}),i}Xe.displayName="TableSection";var Qe=function(r){var t=r.calculatedHeaderHeight,o=r.stickyParents,i=r.mainTemplateColumns,a=r.pinnedLeftColumns,u=r.pinnedLeftTemplateColumns,l=r.pinnedLeftWidth,c=r.pinnedRightColumns,d=r.pinnedRightTemplateColumns,f=r.pinnedRightWidth,v=r.setHoveredIndex,p=r.rowIndices,h=r.scrollbarWidth,w=r.scrollTop,m=r.heightMap,g=r.partiallyVisibleRows,x=J(),b=x.collapsedHeaders,y=x.customTheme,I=x.editColumns,C=x.headers,R=x.rowHeight,S=n.useRef(null),M=n.useRef(null),N=n.useRef(null),E=n.useMemo(function(){var e,n;if(0===o.length)return{treeTransitionOffset:0,offsetStartIndex:-1};var r,t=g[0];if((null==t?void 0:t.parentIndices)&&t.parentIndices.length>0)for(var i=function(e){var n=t.parentIndices[e];if(o.some(function(e){return e.position===n}))return r=n,"break"},a=t.parentIndices.length-1;a>=0&&"break"!==i(a);a--);var u=void 0!==r?o.findIndex(function(e){return e.position===r}):-1,l=-1,s=function(e){var n=o[e],r=o[e+1];return r?r.depth===n.depth?(l=e,"break"):n.depth>r.depth?(l=o.findIndex(function(e){return e.depth===n.depth}),"break"):void 0:"break"};for(a=0;o.length>a&&"break"!==s(a);a++);if(-1===l)return{treeTransitionOffset:0,offsetStartIndex:u};var c=null===(e=o[l])||void 0===e?void 0:e.position;if(void 0===c)return{treeTransitionOffset:0,offsetStartIndex:u};for(var d=0,f=0,v=g;v.length>f&&(null===(n=v[f].parentIndices)||void 0===n?void 0:n.includes(c));f++)d++;if(0===d)return{treeTransitionOffset:0,offsetStartIndex:u};var p=g[0];return{treeTransitionOffset:-((l+1-d)*R+Math.max(0,w-(m?m.rowTopPositions[p.position]:p.position*(R+y.rowSeparatorWidth)))),offsetStartIndex:u}},[y,m,g,R,w,o]),k=E.treeTransitionOffset,T=E.offsetStartIndex,P=n.useMemo(function(){return $e({headers:C,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:b})},[C,a,c,b]),A=o.length>0?o.length*(R+1)+k:0;if(0===o.length)return null;var D=function(r,t,i,a,u,l){return void 0===u&&(u=0),e.jsx("div",exports.__assign({className:i?"st-sticky-section-".concat(i):"st-sticky-section-main",ref:l,style:{position:"relative",height:"".concat(A,"px"),width:i?"".concat(a,"px"):void 0,flexGrow:i?0:1,flexShrink:i?0:void 0}},{children:o.map(function(a,l){var s=a.stateIndicator?"sticky-state-".concat(a.stateIndicator.parentRowId,"-").concat(a.position):"sticky-".concat(H(a.rowId)),c=-1!==T&&l>=T,d=c?k:0,f=(l+1)*(R+1)-1+d;return e.jsxs(n.Fragment,{children:[e.jsx(Ue,{columnIndexStart:u,columnIndices:P,gridTemplateColumns:r,headers:t,index:a.position,pinned:i,rowHeight:R,rowIndices:p,setHoveredIndex:v,tableRow:a,isSticky:!0,stickyIndex:l,stickyOffset:d,stickyZIndex:c?l:o.length-l}),e.jsx(_e,{displayStrongBorder:!1,position:f,rowHeight:R,templateColumns:r,isSticky:!0})]},s)})}))},F=C.filter(function(e){return!e.pinned}),O="calc(100% - ".concat(h,"px - ").concat(I?"".concat(s,"px"):"0px",")");return e.jsxs("div",exports.__assign({className:"st-sticky-top",style:{height:"".concat(A,"px"),width:O,top:"".concat(t,"px")}},{children:[a.length>0&&e.jsx(Ye,exports.__assign({childRef:S,group:"pinned-left"},{children:D(u,a,"left",l,0,S)})),e.jsx(Ye,exports.__assign({childRef:M,group:"default"},{children:D(i,F,void 0,void 0,a.length,M)})),c.length>0&&e.jsx(Ye,exports.__assign({childRef:N,group:"pinned-right"},{children:D(d,c,"right",f,a.length+F.length,N)}))]}))},Ze=function(r){var t=r.calculatedHeaderHeight,o=r.mainTemplateColumns,i=r.pinnedLeftColumns,a=r.pinnedLeftTemplateColumns,u=r.pinnedLeftWidth,l=r.pinnedRightColumns,s=r.pinnedRightTemplateColumns,c=r.pinnedRightWidth,d=r.rowsToRender,f=r.setScrollTop,v=r.setScrollDirection,p=r.shouldShowEmptyState,h=r.tableRows,w=r.stickyParents,m=r.regularRows,g=r.partiallyVisibleRows,x=r.heightMap,b=J(),y=b.collapsedHeaders,I=b.headerContainerRef,C=b.headers,R=b.heightOffsets,S=b.isAnimating,M=b.mainBodyRef,N=b.onLoadMore,E=b.rowHeight,k=b.scrollbarWidth,T=b.setIsScrolling,P=b.shouldPaginate,A=b.tableBodyContainerRef,D=b.tableEmptyStateRenderer,F=b.customTheme,O=n.useState(!1),L=O[0],W=O[1],B=n.useState(0),z=B[0],q=B[1],G=n.useRef(new Set),V=n.useCallback(function(e){if(document.querySelectorAll(".st-row.hovered").forEach(function(e){e.classList.remove("hovered")}),G.current.clear(),null!==e&&A.current){var n=A.current,r='.st-row[data-index="'.concat(e,'"]:not(.st-nested-grid-row)');n.querySelectorAll(r).forEach(function(e){var r=e;r.closest(".st-body-container")===n&&(r.classList.add("hovered"),G.current.add(r))});var t=n.previousElementSibling;t&&t.classList.contains("st-sticky-top")&&t.querySelectorAll(r).forEach(function(e){var n=e;n.classList.add("hovered"),G.current.add(n)})}},[A]);n.useEffect(function(){S&&V(null)},[S,V]),oe({headerContainerRef:I,mainSectionRef:A,scrollbarWidth:k}),n.useEffect(function(){return function(){K.current&&clearTimeout(K.current)}},[]);var j=n.useRef(null),K=n.useRef(null),U=n.useRef(0),_=function(e){return e.length}(h),Y=n.useMemo(function(){return function(e,n,r,t){return e*(n+t.rowSeparatorWidth)-t.rowSeparatorWidth+((null==r?void 0:r.reduce(function(e,n){return e+n[1]},0))||0)}(_,E,R,F)},[_,E,R,F]),X=n.useMemo(function(){return $e({headers:C,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:y})},[C,i,l,y]),$=n.useMemo(function(){var e={};return d.forEach(function(n,r){var t=H(n.rowId);e[t]=r}),e},[d]),Q=n.useCallback(function(e,n){!N||P||L||200>=e.scrollHeight-(n+e.clientHeight)&&n>U.current&&(W(!0),N(),setTimeout(function(){W(!1)},1e3))},[N,P,L]),Z={columnIndices:X,headerContainerRef:I,headers:C,rowHeight:E,rowIndices:$,rowsToRender:d,setHoveredIndex:V,regularRows:m};return e.jsxs(e.Fragment,{children:[!p&&e.jsx(Qe,{calculatedHeaderHeight:t,heightMap:x,mainTemplateColumns:o,partiallyVisibleRows:g,pinnedLeftColumns:i,pinnedLeftTemplateColumns:a,pinnedLeftWidth:u,pinnedRightColumns:l,pinnedRightTemplateColumns:s,pinnedRightWidth:c,rowIndices:$,scrollTop:z,scrollbarWidth:k,setHoveredIndex:V,stickyParents:w}),e.jsx("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return V(null)},onScroll:function(e){var n=e.currentTarget,r=n.scrollTop;T(!0),K.current&&clearTimeout(K.current),K.current=setTimeout(function(){T(!1)},150),j.current&&cancelAnimationFrame(j.current),j.current=requestAnimationFrame(function(){var e=U.current,t=r>e?"down":e>r?"up":"none";f(r),v(t),q(r),Q(n,r),U.current=r})},ref:A},{children:p?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:D})):e.jsxs(e.Fragment,{children:[e.jsx(Xe,exports.__assign({},Z,{pinned:"left",templateColumns:a,totalHeight:Y,width:u})),e.jsx(Xe,exports.__assign({},Z,{columnIndexStart:i.length,ref:M,templateColumns:o,totalHeight:Y})),e.jsx(Xe,exports.__assign({},Z,{columnIndexStart:i.length+o.length,pinned:"right",templateColumns:s,totalHeight:Y,width:c}))]})}))]})},en=function(e,n){if(e.pinned)return e.pinned;var r=m(n,e.accessor);return r?en(r,n):void 0},nn=function(e){var n=e.autoExpandColumns,r=e.collapsedHeaders,t=e.containerWidth,o=e.event,i=e.header,a=e.headers,l=e.onColumnWidthChange,s=e.reverse,c=void 0!==s&&s,d=e.setHeaders,v=e.setIsResizing,p=e.startWidth;o.preventDefault();var h="clientX"in o?o.clientX:o.touches[0].clientX,w="touches"in o;if(i&&!i.hide){v(!0);var m,g=en(i,a),x=F(i);if(i.children&&i.children.length>0){var b=P(i,r);m=b.length>0?b:[i]}else m=[i];var y=new Map,I=0;if(n){var C=a.filter(function(e){return e.pinned===g});if(O(C,r).forEach(function(e){var n=A(e);y.set(e.accessor,n)}),t>0){var R=tn({headers:a,containerWidth:t,collapsedHeaders:r}),S=R.leftWidth,M=R.rightWidth;I="left"===g?S:"right"===g?M:Math.max(0,t-S-M)}}var N=function(e){var o="right"===g?h-e:e-h;if(n){var l=a.filter(function(e){return e.pinned===g});an({delta:o,startWidth:p,resizedHeader:m.length>0?m[m.length-1]:i,sectionHeaders:l,rootPinned:g,reverse:c,collapsedHeaders:r,initialWidthsMap:y,sectionWidth:I,isParentResize:m.length>1,childrenToResize:m,headers:a,containerWidth:t})}else{var s=function(e){var n=e.header,r=e.headers,t=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth;if(!n.pinned)return 1/0;var a=r.some(function(e){return"left"===e.pinned&&!e.hide}),u=r.some(function(e){return"right"===e.pinned&&!e.hide}),l=i*f(i,a,u)-r.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+P(n,t).reduce(function(e,n){return e+A(n)},0)},0),s=F(n);return s>l?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),s):l}({header:i,headers:a,collapsedHeaders:r});m.length>1?rn({delta:o,leafHeaders:m,minWidth:x,startWidth:p,maxWidth:s}):m[0].width=Math.max(Math.min(p+o,s),x),a.forEach(function(e){D(e)})}var v=u([],a,!0);d(v)};if(w){var H=function(e){N(e.touches[0].clientX)},E=function(){document.removeEventListener("touchmove",H),document.removeEventListener("touchend",E),v(!1),l&&l(u([],a,!0))};document.addEventListener("touchmove",H),document.addEventListener("touchend",E)}else{var k=function(e){N(e.clientX)},T=function(){document.removeEventListener("mousemove",k),document.removeEventListener("mouseup",T),v(!1),l&&l(u([],a,!0))};document.addEventListener("mousemove",k),document.addEventListener("mouseup",T)}}},rn=function(e){var n=e.delta,r=e.leafHeaders,t=e.minWidth,o=e.startWidth,i=e.maxWidth,a=r.reduce(function(e,n){return Math.min(e,F(n))},40),u=r.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;r.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),t)})},tn=function(e){var n=e.containerWidth,r=e.collapsedHeaders,t=0,o=0,i=0;e.headers.forEach(function(e){if(!e.hide){var n=P(e,r).reduce(function(e,n){return e+A(n)},0);"left"===e.pinned?t+=n:"right"===e.pinned?o+=n:i+=n}});var a=t,u=o;if(n&&n>0){var l=n*f(n,t>0,o>0);t>l&&(t=l),o>l&&(o=l)}return{leftWidth:w(t),rightWidth:w(o),mainWidth:i,leftContentWidth:a,rightContentWidth:u}},on=function(e){var n=e.columnsToShrink,r=e.totalCompensation,t=e.initialWidthsMap;if(0>r){var o=Math.abs(r),i=n.reduce(function(e,n){return e+(t.get(n.accessor)||100)},0);if(0===i)return;n.forEach(function(e,r){var a=t.get(e.accessor)||100,u=o*(a/i);if(r===n.length-1){var l=n.slice(0,r).reduce(function(e,n){var r=t.get(n.accessor)||100;return e+(("number"==typeof n.width?n.width:100)-r)},0);u=o-l}e.width=a+u})}else for(var a=r,u=function(){var e=n.map(function(e){var n=t.get(e.accessor)||100;return{column:e,headroom:Math.max(0,n-40),initialWidth:n,minWidth:40}}),r=e.filter(function(e){return e.headroom>0});if(r.length>0){var o=r.reduce(function(e,n){return e+n.headroom},0),i=0,u=a;r.forEach(function(e,n){var t=u*(e.headroom/o);t=Math.min(t,e.headroom),n===r.length-1&&(t=Math.min(u-i,e.headroom)),e.column.width=e.initialWidth-t,i+=t}),a-=i}else{var l=e.filter(function(e){return e.minWidth>d});if(0>=l.length)return"break";var s=a,c=s/l.length,f=0;l.forEach(function(e,n){var r=e.minWidth-d,t=Math.min(c,r);n===l.length-1&&(t=Math.min(s-f,r));var o=e.initialWidth-t;e.column.width=o,e.column.minWidth=Math.max(o,d),f+=t}),a-=f}};a>.5&&"break"!==u(););},an=function(e){var n=e.childrenToResize,r=void 0===n?[]:n,t=e.collapsedHeaders,o=e.delta,i=e.initialWidthsMap,a=e.isParentResize,u=void 0!==a&&a,l=e.resizedHeader,s=e.reverse,c=e.rootPinned,v=e.sectionHeaders,p=e.sectionWidth,h=e.startWidth,w=e.headers,m=e.containerWidth,g=o;if(c&&m>0){var x=function(e,n,r){return e*f(e,n,r)}(m,w.some(function(e){return"left"===e.pinned&&!e.hide}),w.some(function(e){return"right"===e.pinned&&!e.hide})),b=Array.from(i.values()).reduce(function(e,n){return e+n},0);o>0&&b+o>x&&(g=Math.max(0,x-b))}if(o=g,u&&r.length>1){var y=O(v,t),I=y.findIndex(function(e){return e.accessor===r[0].accessor}),C=y.findIndex(function(e){return e.accessor===r[r.length-1].accessor});if(-1===I||-1===C)return;var R,S=0===I,M=C===y.length-1;R="left"===c&&M||"right"===c&&S?[]:S?y.slice(C+1):M||s?y.slice(0,I):y.slice(C+1);var N=Array.from(i.values()).reduce(function(e,n){return e+n},0);if(o>0){var H=o,E=!1;if(R.length>0&&N+o>p){E=!0;var k=R.reduce(function(e,n){var r=i.get(n.accessor)||100;return e+Math.max(0,r-d)},0);H=Math.min(o,k)}var T=(P=h+H)/(A=r.reduce(function(e,n){return e+(i.get(n.accessor)||100)},0));r.forEach(function(e){var n=i.get(e.accessor)||100;e.width=Math.max(n*T,40)}),E&&H>0&&R.length>0&&on({columnsToShrink:R,totalCompensation:H,initialWidthsMap:i})}else{var P,A=r.reduce(function(e,n){return e+(i.get(n.accessor)||100)},0),D=(P=Math.max(h+o,d*r.length))/A;r.forEach(function(e){var n=i.get(e.accessor)||100;e.width=Math.max(n*D,40)}),(j=h-P)>0&&R.length>0&&on({columnsToShrink:R,totalCompensation:-j,initialWidthsMap:i})}}else{var F=O(v,t),L=F.findIndex(function(e){return e.accessor===l.accessor});if(-1!==L){var W,B=0===L,z=L===F.length-1;if(0!==(W="left"===c&&z||"right"===c&&B?[]:B?F.slice(L+1):z||s?F.slice(0,L):F.slice(L+1)).length){var q=Array.from(i.values()).reduce(function(e,n){return e+n},0);if(o>0){if(p>=q+o)return void(l.width=h+o);k=W.reduce(function(e,n){var r=i.get(n.accessor)||100;return e+Math.max(0,r-d)},0);var G=Math.min(o,k);l.width=h+G,G>0&&on({columnsToShrink:W,totalCompensation:G,initialWidthsMap:i})}else{var V=Math.max(h+o,40),j=h-V;l.width=V,j>0&&on({columnsToShrink:W,totalCompensation:-j,initialWidthsMap:i})}}else l.width=Math.max(h+o,40)}}},un={equals:"Equals",notEquals:"Not equals",contains:"Contains",notContains:"Does not contain",startsWith:"Starts with",endsWith:"Ends with",greaterThan:"Greater than",lessThan:"Less than",greaterThanOrEqual:"Greater than or equal",lessThanOrEqual:"Less than or equal",between:"Between",notBetween:"Not between",before:"Before",after:"After",in:"Is one of",notIn:"Is not one of",isEmpty:"Is empty",isNotEmpty:"Is not empty"},ln=function(e){switch(e){case"string":return["equals","notEquals","contains","notContains","startsWith","endsWith","isEmpty","isNotEmpty"];case"number":return["equals","notEquals","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual","between","notBetween","isEmpty","isNotEmpty"];case"boolean":return["equals","isEmpty","isNotEmpty"];case"date":return["equals","notEquals","before","after","between","notBetween","isEmpty","isNotEmpty"];case"enum":return["in","notIn","isEmpty","isNotEmpty"];default:return["equals","notEquals","isEmpty","isNotEmpty"]}},sn=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},cn=function(e){return["between","notBetween","in","notIn"].includes(e)},dn=function(e){return["isEmpty","isNotEmpty"].includes(e)},fn=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},vn=function(r){var t=r.value,o=r.onChange,i=r.options,a=r.placeholder,u=void 0===a?"Select...":a,l=r.className,s=void 0===l?"":l,c=r.disabled,d=void 0!==c&&c,f=n.useState(!1),v=f[0],p=f[1],h=n.useState(-1),w=h[0],m=h[1],g=n.useRef(null),x=i.find(function(e){return e.value===t});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),m(function(e){return i.length-1>e?e+1:0});break;case"ArrowUp":e.preventDefault(),m(function(e){return e>0?e-1:i.length-1});break;case"Enter":e.preventDefault(),0>w||(o(i[w].value),p(!1),m(-1));break;case"Escape":e.preventDefault(),p(!1),m(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,w,i,o]);var b=function(e){o(e),p(!1),m(-1)};return e.jsxs("div",exports.__assign({ref:g,className:"st-custom-select ".concat(s," ").concat(d?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",exports.__assign({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!d)if(p(!v),v)m(-1);else{var e=i.findIndex(function(e){return e.value===t});m(0>e?0:e)}},disabled:d,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",exports.__assign({className:"st-custom-select-value"},{children:x?x.label:u})),e.jsx(te,{})]})),e.jsx(ie,exports.__assign({open:v,setOpen:p,onClose:function(){p(!1),m(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",exports.__assign({className:"st-custom-select-options",role:"listbox"},{children:i.map(function(n,r){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===t?"st-custom-select-option-selected":""," ").concat(r===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===t,onClick:function(){return b(n.value)},tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(n.value))}},{children:n.label}),r)})}))}))]}))},pn=function(n){var r=n.value,t=n.onChange,o=n.operators.map(function(e){return{value:e,label:un[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(vn,{value:r,onChange:function(e){t(e)},options:o})}))},hn=function(n){var r=n.type,t=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===r?"text":r,value:n.value,onChange:function(e){return t(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&a&&a()},placeholder:n.placeholder,autoFocus:void 0!==o&&o,className:"st-filter-input ".concat(void 0===i?"":i).trim()})},wn=function(n){var r=n.children,t=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===t?"":t).trim()},{children:r}))},mn=function(n){var r=n.onClear,t=n.canApply,o=n.showClear;return e.jsxs("div",exports.__assign({className:"st-filter-actions"},{children:[e.jsx("button",exports.__assign({onClick:n.onApply,disabled:!t,className:"st-filter-button st-filter-button-apply ".concat(t?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&r&&e.jsx("button",exports.__assign({onClick:r,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},gn=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],s=u[1],c=n.useState(((null==o?void 0:o.value)||"")+""),d=c[0],f=c[1],v=ln("string");n.useEffect(function(){o?(s(o.operator),f((o.value||"")+"")):(s("contains"),f(""))},[o]);var p=function(){var e=exports.__assign({accessor:t.accessor,operator:l},sn(l)&&{value:d});i(e)},h=dn(l)||d.trim();return e.jsxs(fn,{children:[e.jsx(pn,{value:l,onChange:s,operators:v}),sn(l)&&e.jsx(wn,{children:e.jsx(hn,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(mn,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},xn=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],p=f[1],h=n.useState(((null===(t=null==a?void 0:a.values)||void 0===t?void 0:t[0])||"")+""),w=h[0],m=h[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],y=ln("number");n.useEffect(function(){var e,n;a?(d(a.operator),p((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),p(""),m(""),b(""))},[a]);var I=function(){var e={accessor:i.accessor,operator:c};sn(c)?e.value=parseFloat(v):cn(c)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(fn,{children:[e.jsx(pn,{value:c,onChange:d,operators:y}),sn(c)&&e.jsx(wn,{children:e.jsx(hn,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:I})}),cn(c)&&e.jsxs(wn,{children:[e.jsx(hn,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:I}),e.jsx(hn,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:I})]}),e.jsx(mn,{onApply:I,onClear:l,canApply:!!dn(c)||(sn(c)?""!==v.trim():!!cn(c)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},bn=function(n){var r=n.className;return e.jsx(vn,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===r?"":r,placeholder:n.placeholder})},yn=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],s=u[1],c=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=c[0],f=c[1],v=ln("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var p=dn(l)||""!==d;return e.jsxs(fn,{children:[e.jsx(pn,{value:l,onChange:s,operators:v}),sn(l)&&e.jsx(wn,{children:e.jsx(bn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(mn,{onApply:function(){var e={accessor:t.accessor,operator:l};sn(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},In=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],p=f[1],h=n.useState((null===(t=null==a?void 0:a.values)||void 0===t?void 0:t[0])?a.values[0]+"":""),w=h[0],m=h[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],y=ln("date");n.useEffect(function(){var e,n;a?(d(a.operator),p((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),p(""),m(""),b(""))},[a]);var I=function(r){var t=r.value,o=r.onChange,i=r.placeholder,a=r.autoFocus,u=r.className,l=n.useState(!1),s=l[0],c=l[1],d=n.useState(""),f=d[0],v=d[1],p=n.useRef(null);n.useEffect(function(){if(t){var e=be(t);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[t]),n.useEffect(function(){a&&p.current&&p.current.focus()},[a]);var h=t?be(t):new Date;return e.jsxs("div",exports.__assign({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:f,placeholder:i,onClick:function(){c(!s)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),c(!s)):"Escape"===e.key&&c(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e.jsx(ie,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(he,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(fn,{children:[e.jsx(pn,{value:c,onChange:d,operators:y}),sn(c)&&e.jsx(wn,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),cn(c)&&e.jsxs(wn,{children:[e.jsx(I,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(I,{value:x,onChange:b,placeholder:"To date..."})]}),e.jsx(mn,{onApply:function(){var e={accessor:i.accessor,operator:c};sn(c)?e.value=v:cn(c)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!dn(c)||(sn(c)?""!==v.trim():!!cn(c)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},Cn=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,l=n.useMemo(function(){return t.enumOptions||[]},[t.enumOptions]),s=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),c=n.useState((null==o?void 0:o.values)?o.values.map(String):s),d=c[0],f=c[1],v=n.useState(""),p=v[0],h=v[1],w=n.useMemo(function(){if(!p)return l;var e=p.toLowerCase();return l.filter(function(n){return n.label.toLowerCase().includes(e)})},[l,p]);n.useEffect(function(){f(o?o.values?o.values.map(String):[]:s)},[o,s]);var m=l.length>10;return e.jsxs(fn,{children:[e.jsx(wn,{children:e.jsxs("div",exports.__assign({className:"st-enum-filter-options"},{children:[e.jsx("div",exports.__assign({className:"st-enum-select-all"},{children:e.jsx(Be,exports.__assign({checked:d.length===s.length,onChange:function(e){f(e?s:[])}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),m&&e.jsx("div",exports.__assign({className:"st-enum-search"},{children:e.jsx(hn,{type:"text",value:p,onChange:h,placeholder:"Search..."})})),w.map(function(n,r){return e.jsx(Be,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),r)}),p&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(mn,{onApply:function(){d.length!==s.length?i({accessor:t.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==s.length,showClear:!!o})]})},Rn=function(n){var r=n.header,t=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(r.type){case"number":return e.jsx(xn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(yn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(In,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(Cn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});default:return e.jsx(gn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i})}}()})},Sn=function(r){var t=r.content,o=r.children,i=r.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],s=u[1],c=n.useState({top:0,left:0}),d=c[0],f=c[1],v=n.useRef(null),p=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!t||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var h=n.cloneElement(o,{ref:p,onMouseEnter:function(){v.current=setTimeout(function(){if(p.current&&t.trim()){var e=p.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,r=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),r+40>window.innerHeight-8&&(r=e.top-40-8),f({top:r,left:n}),s(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),s(!1)}});return e.jsxs(e.Fragment,{children:[h,l&&e.jsx("div",exports.__assign({className:"st-tooltip",style:{position:"fixed",top:"".concat(d.top,"px"),left:"".concat(d.left,"px"),zIndex:1e4}},{children:t}))]})},Mn=function(r){var t,o,i=r.colIndex,a=r.gridColumnEnd,l=r.gridColumnStart,s=r.gridRowEnd,d=r.gridRowStart,f=r.header,h=r.parentHeader,w=r.reverse,m=r.sort,x=r.isLastHeader,b=void 0!==x&&x,y=n.useState(!1),I=y[0],C=y[1],S=n.useState(!1),M=S[0],N=S[1],H=n.useState(f.label||""),E=H[0],k=H[1],T=J(),P=T.activeHeaderDropdown,A=T.areAllRowsSelected,D=T.autoExpandColumns,F=T.collapsedHeaders,O=T.columnBorders,L=T.columnReordering,W=T.columnResizing,B=T.containerWidth,z=T.columnsWithSelectedCells,q=T.draggedHeaderRef,G=T.enableHeaderEditing,V=T.handleApplyFilter,j=T.handleClearFilter,K=T.handleSelectAll,U=T.headerDropdown,_=T.headerRegistry,Y=T.icons,X=T.headers,$=T.hoveredHeaderRef,Q=T.onColumnOrderChange,Z=T.onColumnSelect,ee=T.onColumnWidthChange,ne=T.onHeaderEdit,re=T.onSort,te=T.onTableHeaderDragEnd,oe=T.headerHeight,ae=T.rows,ue=T.selectColumns,se=T.selectableColumns,ce=T.selectedColumns,de=T.setActiveHeaderDropdown,fe=T.setCollapsedHeaders,ve=T.setHeaders,he=T.setInitialFocusedCell,we=T.setIsResizing,me=T.setSelectedCells,ge=T.setSelectedColumns,xe=!!(null==f?void 0:f.isSortable),be=!!(null==f?void 0:f.filterable),ye=T.filters[f.accessor],Ie=(null==P?void 0:P.accessor)===f.accessor,Ce=f.isSelectionColumn&&T.enableRowSelection,Re=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(f),Se=F.has(f.accessor),Ne=function(e){var r=e.isOpen,t=e.estimatedHeight,o=void 0===t?200:t,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,s=n.useRef(null),c=n.useState({}),d=c[0],f=c[1];return n.useEffect(function(){if(r&&s.current){var e=function(){if(s.current){var e=s.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,r=window.innerWidth-e.right,t="bottom",i={};o>n&&e.top>=o&&(t="top");var u="left";a>r+e.width&&(u="right"),"bottom"===t?i.top=e.bottom+l:i.bottom=window.innerHeight-e.top+l,"left"===u?i.left=e.left:i.right=window.innerWidth-e.right,f(i)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},t=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",t,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",t,!0)}}f({})},[r,o,a,l]),{triggerRef:s,position:d}}({isOpen:Ie,estimatedHeight:200,estimatedWidth:250,margin:4}),He=Ne.triggerRef,Ee=Ne.position,ke=n.useMemo(function(){var e,n,r;if(!O)return!1;var t=X.filter(function(e){return"left"===e.pinned}),o=X.filter(function(e){return!e.pinned}),i=X.filter(function(e){return"right"===e.pinned});return"left"===f.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===f.accessor:"right"===f.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===f.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===f.accessor},[O,X,f.accessor,f.pinned]),Te=n.useMemo(function(){return!(!se||Ce)&&p(f,i).some(function(e){return ce.has(e)})},[se,Ce,f,i,ce]),Fe=n.useMemo(function(){return!Ce&&p(f,i).some(function(e){return z.has(e)})},[Ce,f,i,z]),Oe=n.useMemo(function(){return!(!f.children||0===f.children.length)&&(!Se||f.children.some(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n}))},[f.children,Se]),Le=null==h?void 0:h.singleRowChildren,ze=Oe&&!f.singleRowChildren,qe="st-header-cell ".concat(f.accessor===(null===(t=$.current)||void 0===t?void 0:t.accessor)?"st-hovered":""," ").concat((null===(o=q.current)||void 0===o?void 0:o.accessor)===f.accessor?"st-dragging":""," ").concat(xe?"clickable":""," ").concat(L&&!xe?"columnReordering":""," ").concat(ze?"parent":""," ").concat(Le?"st-sub-header":""," ").concat(ke?"st-last-column":""," ").concat(G&&!Ce?"st-header-editable":""," ").concat(Te?"st-header-selected":""," ").concat(Fe&&!Te?"st-header-has-highlighted-cell":""," ").concat(b?"st-no-resize":""),Ge=We({draggedHeaderRef:q,headers:X,hoveredHeaderRef:$,onColumnOrderChange:Q,onTableHeaderDragEnd:te}),Ve=Ge.handleDragStart,je=Ge.handleDragEnd,Ke=Ge.handleDragOver,Ue=Me();n.useEffect(function(){if(_&&!f.isSelectionColumn){var e=f.accessor+"";return _.set(e,{setEditing:function(e){N(e)}}),function(){_.delete(e)}}},[_,f.accessor,f.isSelectionColumn]),n.useEffect(function(){k(f.label||"")},[f.label]);var _e=function(e){C(!I)},Je=n.useCallback(function(e){k(e);var n=X.map(function(n){return n.accessor===f.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});ve(n),ne&&ne(f,e)},[X,ve,ne,f]),Ye=n.useCallback(function(){de&&de(null)},[de]),Xe=n.useCallback(function(e){e.stopPropagation(),fe(function(e){var n=new Set(e);return Se?n.delete(f.accessor):n.add(f.accessor),n})},[fe,Se,f.accessor]),$e=function(e){var n=e.event,r=e.header;if(!r.isSelectionColumn){if(se){var t=p(r,i),o=t.some(function(e){return ce.has(e)});if(G&&o&&!n.shiftKey)return U&&Ie&&Ye(),void N(!0);n.shiftKey&&ue?ge(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);i>r&&(i=r,o=e)});var a,l,s,c=u(u([],(s=Math.min(a=o,l=n),Array.from({length:Math.max(a,l)-s+1},function(e,n){return s+n})),!0),t,!0);return new Set(u(u([],Array.from(e),!0),c,!0))}):ue&&ue(t),me(new Set),he(null)}Z&&Z(r),!se&&r.isSortable&&re(r.accessor)}};n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]);var Qe=n.useCallback(function(){var e=function(e,n){var r=n||{},t=r.rows,o=r.header,i=r.maxWidth,a=void 0===i?500:i,u=r.sampleSize,l=void 0===u?50:u,s=document.getElementById(g({accessor:e,rowId:"header"}));if(!s)return 150;var d=window.getComputedStyle(s),f=parseFloat(d.paddingLeft)||0,v=parseFloat(d.paddingRight)||0,p=parseFloat(d.gap)||0,h=f+v,w=s.querySelector(".st-header-label");if(w){var m=w.querySelector(".st-header-label-text");if(m){var x=document.createElement("span");x.style.visibility="hidden",x.style.position="absolute",x.style.whiteSpace="nowrap",x.style.width="auto";var b=window.getComputedStyle(m);x.style.font=b.font,x.style.fontSize=b.fontSize,x.style.fontWeight=b.fontWeight,x.style.fontFamily=b.fontFamily,x.style.letterSpacing=b.letterSpacing,x.style.padding=b.padding,x.textContent=m.textContent,document.body.appendChild(x);var y=x.offsetWidth;document.body.removeChild(x),h+=y}}for(var I=Array.from(s.children),C=1,S=0;I.length>S;S++){var M=I[S];if(!M.classList.contains("st-header-label")&&!M.classList.contains("st-sr-only")){var N=window.getComputedStyle(M);"none"!==N.display&&(h+=(M.offsetWidth||0)+(parseFloat(N.marginLeft)||0)+(parseFloat(N.marginRight)||0),C++)}}p>0&&C>1&&(h+=p*(C-1));var H=0,E=o&&o.type&&c.includes(o.type);if(t&&t.length>0&&!E){var k=Math.min(t.length,l),T=document.createElement("div");T.style.visibility="hidden",T.style.position="absolute",T.style.whiteSpace="nowrap",T.style.width="auto";var P=0,A=0,D=document.querySelector(".st-cell-content");if(D){var F=window.getComputedStyle(D);T.style.font=F.font,T.style.fontSize=F.fontSize,T.style.fontFamily=F.fontFamily,P=parseFloat(F.paddingLeft)||0,A=parseFloat(F.paddingRight)||0}for(document.body.appendChild(T),S=0;k>S;S++){var O,L=t[S],W=O=(null==o?void 0:o.valueGetter)?o.valueGetter({accessor:e,row:L,rowIndex:S}):R(L,e);(null==o?void 0:o.valueFormatter)&&null!=O&&(W=o.valueFormatter({accessor:e,colIndex:0,row:L,rowIndex:S,value:O})),T.textContent=null!=W?W+"":"";var B=T.offsetWidth+P+A;B>H&&(H=B)}document.body.removeChild(T)}var z=Math.max(h,H);return E&&(z=Math.max(z,150)),z>a&&(z=a),z+2}(f.accessor,{rows:ae,header:f,maxWidth:500,sampleSize:50}),n=Pe(X,f.accessor);if(n){var r=Ae(X,n),t=n[n.length-1],o=r.map(function(n,r){return r===t?exports.__assign(exports.__assign({},n),{width:e}):n}),i=De(X,n,o);ve(i),ee&&ee(i)}},[f,X,ae,ve,ee]);if(!f)return null;var Ze=W&&!Ce&&!b&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",role:"separator","aria-label":"Resize ".concat(f.label," column"),"aria-orientation":"vertical",onMouseDown:function(e){var n,r=null===(n=document.getElementById(g({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ue({callback:nn,callbackProps:{autoExpandColumns:D,collapsedHeaders:F,containerWidth:B,event:e.nativeEvent,header:f,headers:X,onColumnWidthChange:ee,reverse:w,setHeaders:ve,setIsResizing:we,startWidth:r},limit:10})},onTouchStart:function(e){var n,r=null===(n=document.getElementById(g({accessor:f.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ue({callback:nn,callbackProps:{autoExpandColumns:D,collapsedHeaders:F,containerWidth:B,event:e,header:f,headers:X,onColumnWidthChange:ee,reverse:w,setHeaders:ve,setIsResizing:we,startWidth:r},limit:10})},onDoubleClick:Qe},{children:e.jsx("div",{className:"st-header-resize-handle"})})),en=m&&m.key.accessor===f.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return $e({event:e,header:f})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||re(f.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(f.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&Y.sortUp&&Y.sortUp,"desc"===m.direction&&Y.sortDown&&Y.sortDown]})),rn=be&&Y.filter&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:_e,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.target===e.currentTarget||e.currentTarget.contains(e.target))&&(e.target.closest(".st-dropdown-content")||(e.preventDefault(),_e()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(f.label),"aria-expanded":I,"aria-haspopup":"dialog"},{children:[n.cloneElement(Y.filter,{style:{fill:ye?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(ie,exports.__assign({open:I,overflow:"visible",setOpen:C,onClose:function(){return C(!1)}},{children:e.jsx(Rn,{header:f,currentFilter:ye,onApplyFilter:function(e){V(e),C(!1)},onClearFilter:function(){j(f.accessor),C(!1)}})}))]})),tn=Re&&!Ce&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return Xe(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Xe(e))},tabIndex:0,role:"button","aria-label":"".concat(Se?"Expand":"Collapse"," ").concat(f.label," column"),"aria-expanded":!Se},{children:Se?Y.headerCollapse:Y.headerExpand})),on=e.jsx(Sn,exports.__assign({content:f.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===f.align?"right-aligned":"center"===f.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(Be,{checked:!!A&&A(),onChange:function(e){K&&K(e)},ariaLabel:"Select all rows"}):M?e.jsx(le,{defaultValue:E,onBlur:function(){return N(!1)},onChange:Je}):E||(null==f?void 0:f.label)}))})),an="header-desc-".concat(f.accessor),un=function(e,n){var r=[];return e.type&&"other"!==e.type&&r.push("".concat(e.type," column")),e.isSortable&&r.push("sortable"),n&&r.push("filterable"),e.tooltip&&r.push(e.tooltip),r.join(", ")}(f,be);return e.jsxs(pe,exports.__assign({className:qe,id:g({accessor:f.accessor,rowId:"header"}),role:"columnheader","aria-sort":function(){if(f.isSortable)return(null==m?void 0:m.key.accessor)===f.accessor?"asc"===m.direction?"ascending":"descending":"none"}(),"aria-colindex":i+1,"aria-describedby":un?an:void 0,onDragOver:function(e){Ce||Ue({callback:Ke,callbackProps:{event:e,hoveredHeader:f},limit:50})},style:exports.__assign({gridRowStart:d,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-d>1?{}:{height:oe})},{children:[w&&Ze,!f.headerRenderer&&"right"===f.align&&tn,!f.headerRenderer&&"right"===f.align&&rn,!f.headerRenderer&&"right"===f.align&&en,e.jsx("div",exports.__assign({ref:He,className:"st-header-label",draggable:L&&!f.disableReorder&&!Ce,onClick:function(e){Ce||$e({event:e,header:f})},onDoubleClick:function(e){Ce||function(e){var n=e.header;n.isSelectionColumn||se&&n.isSortable&&re(n.accessor)}({event:e,header:f})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),je()},onDragStart:Ce?void 0:function(e){L&&f&&function(e){Ve(e)}(f)}},{children:f.headerRenderer?f.headerRenderer({accessor:f.accessor,colIndex:i,header:f,components:{sortIcon:en||void 0,filterIcon:rn||void 0,collapseIcon:tn||void 0,labelContent:on}}):on})),!f.headerRenderer&&"right"!==f.align&&en,!f.headerRenderer&&"right"!==f.align&&rn,!f.headerRenderer&&"right"!==f.align&&tn,!w&&Ze,U&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:U({accessor:f.accessor,colIndex:i,header:f,isOpen:Ie,onClose:Ye,position:Ee})})),un&&e.jsx("span",exports.__assign({id:an,className:"st-sr-only"},{children:un}))]}))},Nn=function(r){var t=r.columnIndices,o=r.gridTemplateColumns,i=r.handleScroll,a=r.headers,u=r.maxDepth,l=r.pinned,s=r.sectionRef,c=r.sort,d=r.width,f=J(),v=f.collapsedHeaders,p=f.autoExpandColumns,h=n.useMemo(function(){var e=function(n,r){return x({header:n,pinned:l,headers:a,collapsedHeaders:v,rootPinned:r})?n.children&&0!==n.children.length?n.children.flatMap(function(n){return e(n,r)}):[n]:[]},n=a.flatMap(function(n){return e(n,n.pinned)});return 0===n.length?-1:t[n[n.length-1].accessor]},[a,l,v,t]),w=n.useMemo(function(){var e=[],n=1,r=function(o,i,s,c,d){var f,p;if(void 0===s&&(s=!1),!x({header:o,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d}))return 0;s||n++;var h,w,m=null!==(p=null===(f=o.children)||void 0===f?void 0:f.filter(function(e){return x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d})}).length)&&void 0!==p?p:0,g=n;if(o.singleRowChildren&&m>0?(h=g+1,w=u+1):m>0?(h=g+m,w=i+1):(h=g+1,w=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:h,gridRowStart:i,gridRowEnd:w,colIndex:t[o.accessor],parentHeader:c}),o.children&&o.children.length>0){var b=o.singleRowChildren?i:i+1,y=!o.singleRowChildren;o.children.forEach(function(e){x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:d})&&(r(e,b,y,o,d),y=!1)})}return h-g},o=a.filter(function(e){return x({header:e,pinned:l,headers:a,collapsedHeaders:v,rootPinned:e.pinned})}),i=!0;return o.forEach(function(e){r(e,1,i,void 0,e.pinned),i=!1}),e},[a,u,l,t,v]);return e.jsx(Ye,exports.__assign({childRef:s,group:l?"pinned-".concat(l):"default"},{children:e.jsx("div",exports.__assign({className:"st-header-".concat(l?"pinned-".concat(l):"main")},i&&{onScroll:i},{ref:s,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:w.map(function(n){return e.jsx(Mn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:c,isLastHeader:p&&!l&&n.colIndex===h},n.header.accessor)})})}))}))},Hn=function(r){var t=r.centerHeaderRef,o=r.headers,i=r.mainTemplateColumns,a=r.pinnedLeftColumns,u=r.pinnedLeftTemplateColumns,l=r.pinnedRightColumns,s=r.pinnedRightTemplateColumns,c=r.sort,d=r.pinnedLeftWidth,f=r.pinnedRightWidth,v=J(),p=v.headerContainerRef,h=v.pinnedLeftRef,w=v.pinnedRightRef,m=v.collapsedHeaders,g=v.tableRows,x=v.maxHeaderDepth,b=n.useMemo(function(){return $e({headers:o,pinnedLeftColumns:a,pinnedRightColumns:l,collapsedHeaders:m})},[o,a,l,m]),y=n.useMemo(function(){return Object.keys(b).length},[b]);return e.jsxs("div",exports.__assign({className:"st-header-container",ref:p,"aria-rowcount":g.length+x,"aria-colcount":y},{children:[Ee(o,"left")&&e.jsx(Nn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:x,pinned:"left",sectionRef:h,sort:c,width:d}),e.jsx(Nn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:x,sectionRef:t,sort:c}),Ee(o,"right")&&e.jsx(Nn,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:x,pinned:"right",sectionRef:w,sort:c,width:f})]}))},En=function(e){var n=e.collapsedHeaders,r=e.autoExpandColumns,t=function(e){var r=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide&&!e.excludeFromRender)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||v;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&r.push(e),o.length>0?t({headers:o,flattenedHeaders:r}):e.singleRowChildren||r.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||v;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&r.push(e),t({headers:i,flattenedHeaders:r})}else r.push(e)}),r},o=t({headers:e.headers,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e,n){var r=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),r&&"number"==typeof r&&(r="".concat(r,"px")),void 0===r||n?t:"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(r,", ").concat(t,")"):"max(".concat(r,", ").concat(t,")")}(e,r)}).join(" "))},kn=function(r){var t=r.calculatedHeaderHeight,o=r.hideHeader,i=r.pinnedLeftWidth,a=r.pinnedRightWidth,u=r.setScrollTop,l=r.setScrollDirection,s=r.shouldShowEmptyState,c=r.sort,d=r.tableRows,f=r.rowsToRender,v=r.stickyParents,p=r.regularRows,h=r.partiallyVisibleRows,w=r.heightMap,m=J(),g=m.columnResizing,x=m.editColumns,b=m.headers,y=m.collapsedHeaders,I=m.autoExpandColumns,C=n.useRef(null),R=b.filter(function(e){return!e.pinned}),S=b.filter(function(e){return"left"===e.pinned}),M=b.filter(function(e){return"right"===e.pinned}),N=n.useMemo(function(){return En({headers:S,collapsedHeaders:y,autoExpandColumns:I})},[S,y,I]),H=n.useMemo(function(){return En({headers:R,collapsedHeaders:y,autoExpandColumns:I})},[R,y,I]),E=n.useMemo(function(){return En({headers:M,collapsedHeaders:y,autoExpandColumns:I})},[M,y,I]),k={centerHeaderRef:C,headers:b,mainTemplateColumns:H,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedRightColumns:M,pinnedRightTemplateColumns:E,sort:c,pinnedLeftWidth:i,pinnedRightWidth:a},T={calculatedHeaderHeight:t,heightMap:w,mainTemplateColumns:H,partiallyVisibleRows:h,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedLeftWidth:i,pinnedRightColumns:M,pinnedRightTemplateColumns:E,pinnedRightWidth:a,regularRows:p,rowsToRender:f,setScrollDirection:l,setScrollTop:u,shouldShowEmptyState:s,stickyParents:v,tableRows:d};return e.jsxs("div",exports.__assign({className:"st-content ".concat(g?"st-resizeable":"st-not-resizeable"),style:{width:x?"calc(100% - 29.5px)":"100%"}},{children:[!o&&e.jsx(Hn,exports.__assign({},k)),e.jsx(Ze,exports.__assign({},T))]}))},Tn=function(r){var t=r.mainBodyWidth,o=r.mainBodyRef,i=r.pinnedLeftWidth,a=r.pinnedRightWidth,u=r.pinnedLeftContentWidth,l=r.pinnedRightContentWidth,c=r.tableBodyContainerRef,d=J().editColumns,f=n.useState(!1),v=f[0],p=f[1],h=n.useRef(null),w=n.useRef(null),m=n.useRef(null),g=d?s:0,x=(d?a+1:a)+(c.current&&c.current&&c.current.scrollHeight>c.current.clientHeight?c.current.offsetWidth-c.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){o.current&&p(o.current.scrollWidth-o.current.clientWidth>1)},1)},[o,t]),v?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(Ye,exports.__assign({childRef:w,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:w,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),t>0&&e.jsx(Ye,exports.__assign({childRef:h},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:h},{children:e.jsx("div",{style:{width:t}})}))})),a>0&&e.jsx(Ye,exports.__assign({childRef:m,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:m,style:{width:x}},{children:e.jsx("div",{style:{width:l}})}))})),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},Pn={string:function(e,n,r){if(e===n)return 0;var t=e.localeCompare(n);return"asc"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"asc"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"asc"===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"asc"===r?i:-i},enum:function(e,n,r){return Pn.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"asc"===r?-1:1:null==n?"asc"===r?1:-1:"string"==typeof e&&"string"==typeof n?Pn.string(e,n,r):"number"==typeof e&&"number"==typeof n?Pn.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?Pn.boolean(e,n,r):Pn.string(e+"",n+"",r)}},An=function(e){return function(e){var n=e.rows,r=e.sortColumn,t=function(e,n){for(var r=0,o=e;o.length>r;r++){var i=o[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=t(i.children,n);if(a)return a}}},o=t(e.headers,r.key.accessor),i=(null==o?void 0:o.type)||"string",a=r.direction,l=r.key.accessor;return u([],n,!0).sort(function(e,r){var t,u;if(null==o?void 0:o.valueGetter){var s=n.indexOf(e),c=n.indexOf(r);t=o.valueGetter({accessor:l,row:e,rowIndex:s}),u=o.valueGetter({accessor:l,row:r,rowIndex:c})}else t=R(e,l),u=R(r,l);return(null==o?void 0:o.comparator)?o.comparator({rowA:e,rowB:r,valueA:t,valueB:u,direction:a}):function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"asc"===t?-1:1;if(null==n||""===n)return"asc"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=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 Pn.number(i,a,t)}return"date"===r?Pn.date(e+"",n+"",t):"boolean"===r?Pn.boolean(!!e,!!n,t):"enum"===r?Pn.enum(e+"",n+"",t):Pn.string(e+"",n+"",t)}(t,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Dn=function(e){return n.useMemo(function(){var n=h(e),r=new Map;return n.forEach(function(e){r.set(e.accessor,e)}),r},[e])},Fn=function(e){var n=e.tableRows,r=e.sortColumn,t=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:r?t&&t.length>0?(0,e.sortNestedRows)({groupingKeys:t,headers:o,rows:n,sortColumn:r}):An({headers:o,rows:n,sortColumn:r}):n},On=function(e,n,r){void 0===r&&(r=new Set);for(var t=0,o=e;o.length>t;t++){var i=o[t];if(!r.has(i.accessor)&&(r.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),u=!1;if(!a)for(var l=0,s=i.children;s.length>l;l++){var c=s[l];if(On([c],n,r),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},Ln=function(e){return e.every(function(e){return e.hide})},Wn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Wn(e.children),Ln(e.children)&&(e.hide=!0))})},Bn=function(n){var r=n.allHeaders,t=n.depth,o=void 0===t?0:t,i=n.doesAnyHeaderHaveChildren,a=n.draggingRow,l=n.expandedHeaders,s=n.flattenedHeaders,c=n.forceExpanded,d=void 0!==c&&c,f=n.header,v=n.hoveredSeparatorIndex,p=n.isCheckedOverride,h=n.rowIndex,w=n.setDraggingRow,m=n.setExpandedHeaders,g=n.setHoveredSeparatorIndex,x=J(),b=x.columnEditorConfig,y=x.headers,I=x.icons,C=x.setHeaders,R=x.onColumnVisibilityChange,S=x.onColumnOrderChange,M="".concat(16*o,"px"),N=f.children&&f.children.length>0,H=null!=p?p:!(f.hide||N&&f.children&&Ln(f.children)),E=l.has(f.accessor),k=d||E,T=function(){if(!d){var e=new Set(l);E?e.delete(f.accessor):e.add(f.accessor),m(e)}},P=function(e){f.hide=!e,e?(On(r,f.accessor),N&&f.children&&f.children.length>0&&f.children.every(function(e){return!0===e.hide})&&f.children[0]&&(f.children[0].hide=!1,On(r,f.children[0].accessor))):Wn(r);var n=u([],y,!0);if(C(n),R){var t=function(e){var n={},r=function(e){n[e.accessor]=!e.hide,e.children&&e.children.length>0&&e.children.forEach(r)};return e.forEach(r),n}(n);R(t)}},A=i&&N&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(k?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),T()}},{children:I.expand}))})),D=e.jsx(Be,{checked:H,onChange:P}),F=e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:I.drag})),O=e.jsx("div",exports.__assign({className:"st-column-label-container"},{children:f.label}));return e.jsxs(e.Fragment,{children:[0===h&&e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:-1===v?1:0}}),e.jsx("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:M},draggable:!0,onDragStart:function(e){e.dataTransfer.effectAllowed="move",void 0!==h&&w(s[h])},onDragEnter:function(e){e.preventDefault()},onDragOver:function(e){if(e.preventDefault(),void 0!==h&&a){var n=e.currentTarget.getBoundingClientRect(),r=function(e){var n,r,t=e.flattenedHeaders,o=e.draggingRow,i=e.hoveredRowIndex,a=e.isTopHalfOfRow,u=t[i];if(u.depth===o.depth)return(null===(n=u.parent)||void 0===n?void 0:n.accessor)!==(null===(r=o.parent)||void 0===r?void 0:r.accessor)?null:a||u.header.children?i-1:i;if(u.depth>o.depth){for(var l=u,s=i,c=function(){var e=l.parent.accessor,n=t.findIndex(function(n){return n.header.accessor===e});if(-1===n)return"break";l=t[n],s=n};l.parent&&l.depth>o.depth&&"break"!==c(););for(var d=s,f=s,v=s+1;t.length>v&&t[v].depth>l.depth;v++)f=v;var p=f-d+1,h=i-d,w=p/2>h;return p%2==1&&h===Math.floor(p/2)&&(w=a),w?s-1:f}return null}({flattenedHeaders:s,draggingRow:a,hoveredRowIndex:h,isTopHalfOfRow:n.top+n.height/2>e.clientY});g(r)}},onDragEnd:function(){var e=function(){w(null),g(null)};if(a&&null!==v){var n=s[v>a.visualIndex?v:v+1];if(n){if(n.depth>a.depth&&n.parent){var r=s.findIndex(function(e){return e.header.accessor===n.parent.accessor});-1!==r&&(n=s[r])}if(a.header.accessor!==n.header.accessor)if(a.indexPath.length!==n.indexPath.length||1!==a.indexPath.length&&!a.indexPath.slice(0,-1).every(function(e,r){return e===n.indexPath[r]}))e();else{var t;if(1===a.indexPath.length)if(Fe(a.header)!==Fe(n.header)){var o=Le({headers:y,draggedHeader:a.header,hoveredHeader:n.header}),i=o.newHeaders;if(o.emergencyBreak)return void e();t=i}else{var u=Oe(y,a.indexPath,n.indexPath);if(i=u.newHeaders,u.emergencyBreak)return void e();t=i}else{var l=Oe(Ae(y,a.indexPath),[a.indexPath[a.indexPath.length-1]],[n.indexPath[n.indexPath.length-1]]);if(i=l.newHeaders,l.emergencyBreak)return void e();t=De(He(y),a.indexPath,i)}null==S||S(t),C(t),e()}else e()}else e()}else e()}},{children:b.rowRenderer?b.rowRenderer({accessor:f.accessor,header:f,components:{expandIcon:A||void 0,checkbox:D,dragIcon:F,labelContent:O}}):e.jsxs(e.Fragment,{children:[i&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:N?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(k?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),T()}},{children:I.expand})):null})),e.jsx(Be,{checked:H,onChange:P}),e.jsx("div",exports.__assign({className:"st-drag-icon-container"},{children:I.drag})),e.jsx("div",exports.__assign({className:"st-column-label-container"},{children:f.label}))]})})),e.jsx("div",{className:"st-column-editor-drag-separator",style:{opacity:v===h?1:0}})]})},zn=function(e,n){var r=n.toLowerCase();return!!e.label.toLowerCase().includes(r)||!(!e.children||0>=e.children.length)&&e.children.some(function(e){return zn(e,n)})},qn=function(r){var t=r.headers,o=r.open,i=r.searchEnabled,a=r.searchPlaceholder,l=r.searchFunction,s=r.customRenderer,c=J().resetColumns,d=n.useState(""),f=d[0],v=d[1],p=n.useState(null),h=p[0],w=p[1],m=n.useState(null),g=m[0],x=m[1],b=n.useState(function(){var e=new Set,n=function(r){r.forEach(function(r){r.children&&r.children.length>0&&(e.add(r.accessor),n(r.children))})};return n(t),e}),y=b[0],I=b[1],C=n.useMemo(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]),R=n.useMemo(function(){return i?function(e,n,r){if(!n.trim())return e;var t=r||zn;return e.filter(function(e){return!e.isSelectionColumn&&!e.excludeFromRender&&t(e,n)})}(t,f,l):t},[t,f,i,l]),S=n.useMemo(function(){var e=[],n=i&&f.trim().length>0,r=function(t){var o=t.depth,i=void 0===o?0:o,a=t.parent,l=void 0===a?null:a,s=t.currentPath,c=void 0===s?[]:s;t.headers.forEach(function(t,o){if(!t.isSelectionColumn&&!t.excludeFromRender){var a=e.length,s=u(u([],c,!0),[o],!1);e.push({header:t,visualIndex:a,depth:i,parent:l,indexPath:s});var d=t.children&&t.children.length>0,f=n||y.has(t.accessor);d&&f&&t.children&&r({headers:t.children,depth:i+1,parent:t,currentPath:s})}})};return r({headers:R,depth:0,parent:null,currentPath:[]}),e},[R,y,i,f]),M=i?e.jsx("div",exports.__assign({className:"st-column-editor-search-wrapper"},{children:e.jsx("div",exports.__assign({className:"st-column-editor-search"},{children:e.jsx("input",{type:"text",value:f,onChange:function(e){return v(e.target.value)},placeholder:a,className:"st-filter-input",onClick:function(e){return e.stopPropagation()}})}))})):null,N=e.jsx("div",exports.__assign({className:"st-column-editor-list"},{children:S.map(function(n){return e.jsx(Bn,{doesAnyHeaderHaveChildren:C,header:n.header,allHeaders:t,depth:n.depth,forceExpanded:i&&f.trim().length>0,rowIndex:n.visualIndex,draggingRow:h,setDraggingRow:w,hoveredSeparatorIndex:g,setHoveredSeparatorIndex:x,expandedHeaders:y,setExpandedHeaders:I,flattenedHeaders:S},"".concat(n.header.accessor,"-").concat(n.visualIndex))})})),H=s?s({searchSection:M,listSection:N,flattenedHeaders:S,searchTerm:f,setSearchTerm:v,searchEnabled:i,searchPlaceholder:a,headers:t,resetColumns:c}):e.jsxs(e.Fragment,{children:[M,N]});return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",exports.__assign({className:"st-column-editor-popout-content"},{children:H}))}))},Gn=function(n){var r=n.columnEditorConfig,t=n.headers,o=n.open,i=n.setOpen,a=r.text,u=r.searchEnabled,l=r.searchPlaceholder,c=r.searchFunction,d=r.customRenderer;return n.editColumns?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(o?"open":""),onClick:function(){i(!o)},style:{width:s}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:a})),e.jsx(qn,{headers:t,open:o,searchEnabled:u,searchPlaceholder:l,searchFunction:c,customRenderer:d})]})):null},Vn=function(r){var o=r.children,i=n.useRef({}),a=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),u=n.useCallback(function(e,n){e.scrollWidth-e.clientWidth>0&&(n.scrollLeft=e.scrollLeft)},[]),l=n.useCallback(function(e){e.onscroll=null},[]),s=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var r;null===(r=i.current[n])||void 0===r||r.forEach(function(n){e!==n&&(l(n),u(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});s(n,e)}))})})})}},[l,u]),c=n.useCallback(function(e,n){n.forEach(function(n){i.current[n]||(i.current[n]=[]),a(e,n)||(i.current[n].length>0&&u(i.current[n][0],e),i.current[n].push(e))}),s(e,n)},[a,u,s]),d=n.useCallback(function(e,n){n.forEach(function(n){if(a(e,n)){l(e);var r=i.current[n].indexOf(e);-1!==r&&i.current[n].splice(r,1)}})},[a,l]);return e.jsx(Je.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:t.default.Children.only(o)}))},jn=function(e){var n=e.tableRows,r=e.filterState;return e.externalFilterHandling?n:r&&0!==Object.keys(r).length?n.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var r=n.operator,t=n.value,o=n.values;if(null==e)return"isEmpty"===r;if("isEmpty"===r)return!e||""===(e+"").trim();if("isNotEmpty"===r)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===r||"notContains"===r||"startsWith"===r||"endsWith"===r){var i=(e+"").toLowerCase(),a=t?(t+"").toLowerCase():"";switch(r){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(+e)){var u=+e,l=+t;switch(r){case"equals":return u===l;case"notEquals":return u!==l;case"greaterThan":return u>l;case"lessThan":return l>u;case"greaterThanOrEqual":return u>=l;case"lessThanOrEqual":return l>=u;case"between":if(o&&2===o.length){var s=o.map(Number),c=s[1];return u>=s[0]&&c>=u}return!1;case"notBetween":if(o&&2===o.length){var d=o.map(Number);return c=d[1],d[0]>u||u>c}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=be(e),v=be((t||"")+""),p=xe(f),h=xe(v);switch(r){case"equals":return p.getTime()===h.getTime();case"notEquals":return p.getTime()!==h.getTime();case"before":return h>p;case"after":return p>h;case"between":if(o&&2===o.length){var w=o.map(function(e){return xe(be((e||"")+""))}),m=w[1];return p>=w[0]&&m>=p}return!1;case"notBetween":if(o&&2===o.length){var g=o.map(function(e){return xe(be((e||"")+""))});return m=g[1],g[0]>p||p>m}return!0}}if("boolean"==typeof e&&"equals"===r)return e===!!t;if(Array.isArray(e)){var x=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", ");e=x}if("in"===r||"notIn"===r){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===r?b:!b}return!1}var y=(e+"").toLowerCase(),I=t?(t+"").toLowerCase():"";switch(r){case"equals":return y===I;case"notEquals":return y!==I;default:return!0}}(R(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},Kn=function(e){var n,r=document.querySelector(".simple-table-root");if("string"==typeof e){if(e.endsWith("px"))return parseInt(e,10);if(e.endsWith("vh"))return window.innerHeight*parseInt(e,10)/100;if(e.endsWith("%")){var t=null===(n=null==r?void 0:r.parentElement)||void 0===n?void 0:n.clientHeight;return!t||50>t?0:t*parseInt(e,10)/100}return window.innerHeight}return e},Un=function(e,n,r,t){var o=[],i=function(e){e.forEach(function(e){var r=t?e[t]:void 0;if(t&&r&&M(r))i(r);else{var a=R(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===r.type&&r.customFn)return r.customFn(o);var a,u=r.parseValue?o.map(r.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===u.length)return"count"===r.type?o.length:void 0;switch(r.type){case"sum":a=u.reduce(function(e,n){return e+n},0);break;case"average":a=u.reduce(function(e,n){return e+n},0)/u.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,u);break;case"max":a=Math.max.apply(Math,u);break;default:return}return r.formatResult?r.formatResult(a):a}},_n=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var r=n.replace(/"/g,'""');return'"'.concat(r,'"')}return n},Jn=function(e){return function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return new Promise(function(r){e.apply(void 0,n),setTimeout(function(){return r()},0)})}},Yn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},Xn={COLUMN_REORDER:{duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ROW_REORDER:{duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},REDUCED_MOTION:{duration:150,easing:"ease-out",delay:0}},$n=function(e){e.style.transition="",e.style.transitionDelay="",e.style.transform="",e.style.top="",e.style.willChange="",e.style.backfaceVisibility="",e.classList.remove("st-animating")},Qn=function(e,n,r,t){return void 0===r&&(r={}),new Promise(function(t){e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){$n(e),e.removeEventListener("transitionend",o),r.onComplete&&r.onComplete(),t()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Zn=function(e){var r=e.rows,t=e.rowGrouping,o=void 0===t?[]:t,i=e.getRowId,a=e.expandedRows,l=e.collapsedRows,s=e.expandedDepths,c=e.rowStateMap,d=e.hasLoadingRenderer,f=e.hasErrorRenderer,v=e.hasEmptyRenderer,p=e.headers,h=e.rowHeight,w=e.headerHeight,m=e.customTheme;return n.useMemo(function(){if(!o||0===o.length){var e=r.map(function(e,n){var r=[n],t=[n];return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,rowId:N({row:e,getRowId:i,depth:0,index:n,rowPath:r,rowIndexPath:t,groupingKey:void 0}),rowPath:r,rowIndexPath:t,absoluteRowIndex:n,isLastGroupRow:!1}});return{flattenedRows:e,heightOffsets:[],paginatableRows:e,parentEndPositions:r.map(function(e,n){return n+1})}}var n=[],t=[],g=[],x=[],b=0,C=function(e,r,R,S,M){void 0===R&&(R=[]),void 0===S&&(S=[]),void 0===M&&(M=[]),e.forEach(function(e,T){var P,A,D=o[r],F=n.length,O=u(u([],R,!0),[T],!1),L=u(u([],S,!0),[T],!1),W=N({row:e,getRowId:i,depth:r,index:T,rowPath:O,rowIndexPath:L,groupingKey:D}),B=n.length,z={row:e,depth:r,displayPosition:b,groupingKey:D,position:F,isLastGroupRow:0===r,rowId:W,rowPath:O,rowIndexPath:L,absoluteRowIndex:F,parentIndices:M.length>0?u([],M,!0):void 0};n.push(z),t.push(z),b++;var q=H(W);if(k(q,r,s,a,l)&&o.length>r){var G=null==c?void 0:c.get(q),V=E(e,D),j=p.find(function(e){return e.expandable&&e.nestedTable});if((null==j?void 0:j.nestedTable)&&V.length>0){var K=n.length,U=(null===(P=j.nestedTable.customTheme)||void 0===P?void 0:P.rowHeight)||h,_=(null===(A=j.nestedTable.customTheme)||void 0===A?void 0:A.headerHeight)||w,J=y({childRowCount:V.length,rowHeight:U,headerHeight:_,customTheme:m}),Y=I({calculatedHeight:J,customHeight:j.nestedTable.height,customTheme:m});g.push([K,Y-h]);var X=u(u([],O,!0),[D],!1);n.push({row:{},depth:r+1,displayPosition:b-1,groupingKey:D,position:K,isLastGroupRow:!1,rowId:X,rowPath:X,rowIndexPath:L,nestedTable:{parentRow:e,expandableHeader:j,childAccessor:D,calculatedHeight:Y},absoluteRowIndex:K})}else if(G&&(G.loading||G.error||G.isEmpty)){if(G.loading&&d||G.error&&f||G.isEmpty&&v){var $=n.length,Q=u(u([],O,!0),[D],!1);n.push({row:{},depth:r+1,displayPosition:b-1,groupingKey:D,position:$,isLastGroupRow:!1,rowId:Q,rowPath:Q,rowIndexPath:L,stateIndicator:{parentRowId:q,parentRow:e,state:G},absoluteRowIndex:$,parentIndices:u(u([],M,!0),[B],!1)})}else if(G.loading&&!d){var Z=n.length,ee=u(u([],O,!0),[D,"loading-skeleton"],!1);n.push({row:{},depth:r+1,displayPosition:b-1,groupingKey:D,position:Z,isLastGroupRow:!1,rowId:ee,rowPath:ee,rowIndexPath:L,isLoadingSkeleton:!0,absoluteRowIndex:Z,parentIndices:u(u([],M,!0),[B],!1)})}}else if(V.length>0){var ne=u(u([],O,!0),[D],!1),re=u([],L,!0);C(V,r+1,ne,re,u(u([],M,!0),[B],!1))}}0===r&&x.push(n.length)})};return C(r,0,[],[],[]),{flattenedRows:n,heightOffsets:g,paginatableRows:t,parentEndPositions:x}},[r,o,i,a,l,s,c,d,f,v,p,h,w,m])},er=function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},nr={rowHeight:32,headerHeight:32,footerHeight:49,rowSeparatorWidth:1,borderWidth:1,pinnedBorderWidth:1,nestedGridBorderWidth:2,nestedGridPaddingTop:8,nestedGridPaddingBottom:8,nestedGridPaddingLeft:8,nestedGridPaddingRight:8,nestedGridMaxHeight:400,selectionColumnWidth:42},rr={text:"Columns",searchEnabled:!0,searchPlaceholder:"Search columns..."},tr=[{propName:"columnEditorText",replacement:"columnEditorConfig.text",message:"Use the columnEditorConfig object instead for better organization of column editor settings."},{propName:"expandIcon",replacement:"icons.expand",message:"Use the icons object instead for better organization of icon settings."},{propName:"filterIcon",replacement:"icons.filter",message:"Use the icons object instead for better organization of icon settings."},{propName:"headerCollapseIcon",replacement:"icons.headerCollapse",message:"Use the icons object instead for better organization of icon settings."},{propName:"headerExpandIcon",replacement:"icons.headerExpand",message:"Use the icons object instead for better organization of icon settings."},{propName:"nextIcon",replacement:"icons.next",message:"Use the icons object instead for better organization of icon settings."},{propName:"prevIcon",replacement:"icons.prev",message:"Use the icons object instead for better organization of icon settings."},{propName:"sortDownIcon",replacement:"icons.sortDown",message:"Use the icons object instead for better organization of icon settings."},{propName:"sortUpIcon",replacement:"icons.sortUp",message:"Use the icons object instead for better organization of icon settings."}],or=function(e,n){var r=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?r.push.apply(r,or(e.children,null!=n?n:e.pinned)):r.push(e))}),r},ir=function(e,n){return n>=e.reduce(function(e,n){return e+F(n)},0)},ar=function(e,n){var r=new Map,t=e.reduce(function(e,n){return e+("number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150)},0);if(0===t)return r;var o=n/t;if(.01>Math.abs(o-1))return r;var i=0;return e.forEach(function(t,a){var u,l="number"==typeof t.width?t.width:"string"==typeof t.width&&t.width.endsWith("px")?parseFloat(t.width):150;a===e.length-1?u=n-i:i+=u=Math.round(l*o),r.set(t.accessor,u)}),r},ur=function(e,n){var r,t=n.containerWidth,o=n.pinnedLeftWidth,i=n.pinnedRightWidth,a=n.mainBodyRef;if(!n.autoExpandColumns||0===t||n.isResizing)return e;r=a.current?a.current.clientWidth:Math.max(0,t-o-i);var u=e.filter(function(e){return"left"===e.pinned}),l=e.filter(function(e){return"right"===e.pinned}),s=e.filter(function(e){return!e.pinned}),c=or(u,"left"),d=or(l,"right"),f=or(s,void 0),v=c.length>0&&ir(c,o),p=d.length>0&&ir(d,i),h=f.length>0&&r>0&&ir(f,r),w=new Map;if(v&&ar(c,o).forEach(function(e,n){return w.set(n,e)}),p&&ar(d,i).forEach(function(e,n){return w.set(n,e)}),h&&ar(f,r).forEach(function(e,n){return w.set(n,e)}),0===w.size)return e;var m=function(e,n){var r;if(e.hide)return e;var t=null!=n?n:e.pinned,o=null===(r=e.children)||void 0===r?void 0:r.map(function(e){return m(e,t)});if(!e.children||0===e.children.length){var i=w.get(e.accessor);return void 0!==i?exports.__assign(exports.__assign({},e),{width:i,children:o}):exports.__assign(exports.__assign({},e),{children:o})}return exports.__assign(exports.__assign({},e),{children:o})};return e.map(function(e){return m(e,e.pinned)})},lr=function(r){var t=n.useState(!1),o=t[0],i=t[1];return n.useEffect(function(){!function(e){"production"!==process.env.NODE_ENV&&tr.forEach(function(n){var r=n.propName,t=n.replacement,o=n.message;if(void 0!==e[r]){var i='SimpleTable: The "'.concat(r,'" prop is deprecated and will be removed in a future version.'),a='Please use "'.concat(t,'" instead.'),u=o?"\n".concat(o):"",l=t.split("."),s=l[0],c=l[1],d="string"==typeof e[r]?JSON.stringify(e[r]):"<YourIcon />";console.error("".concat(i,"\n").concat(a).concat(u,"\n\nExample:\n<SimpleTable\n ").concat(s,"={{\n ").concat(c,": ").concat(d,"\n }}\n/>"))}})}(r)},[]),n.useEffect(function(){i(!0)},[]),o?e.jsx(sr,exports.__assign({},r)):null},sr=function(r){var t=r.allowAnimations,o=void 0!==t&&t,s=r.autoExpandColumns,c=void 0!==s&&s,d=r.canExpandRowGroup,f=r.cellUpdateFlash,v=void 0!==f&&f,p=r.className,w=r.columnBorders,m=void 0!==w&&w,g=r.columnEditorConfig,x=void 0===g?rr:g,y=r.columnEditorText,I=r.columnReordering,C=void 0!==I&&I,E=r.columnResizing,k=void 0!==E&&E,A=r.copyHeadersToClipboard,D=void 0!==A&&A,F=r.customTheme,O=r.defaultHeaders,L=r.editColumns,W=void 0!==L&&L,z=r.editColumnsInitOpen,q=void 0!==z&&z,V=r.emptyStateRenderer,U=r.enableHeaderEditing,J=void 0!==U&&U,Z=r.enableRowSelection,te=void 0!==Z&&Z,ie=r.enableStickyParents,ae=void 0!==ie&&ie,ue=r.errorStateRenderer,le=r.expandAll,se=void 0===le||le,ce=r.expandIcon,de=r.externalFilterHandling,fe=void 0!==de&&de,ve=r.externalSortHandling,pe=void 0!==ve&&ve,he=r.filterIcon,we=r.footerRenderer,me=r.headerCollapseIcon,ge=r.headerDropdown,xe=r.headerExpandIcon,be=r.height,ye=r.hideFooter,Ie=void 0!==ye&&ye,Ce=r.hideHeader,Re=void 0!==Ce&&Ce,Se=r.icons,Me=r.includeHeadersInCSVExport,Ee=void 0===Me||Me,ke=r.initialSortColumn,Te=r.initialSortDirection,Pe=void 0===Te?"asc":Te,Ae=r.isLoading,De=void 0!==Ae&&Ae,Fe=r.loadingStateRenderer,Oe=r.maxHeight,Le=r.nextIcon,We=r.onCellClick,Be=r.onCellEdit,ze=r.onColumnOrderChange,qe=r.onColumnSelect,Ge=r.onColumnVisibilityChange,Ve=r.onColumnWidthChange,je=r.onFilterChange,Ke=r.onGridReady,Ue=r.onHeaderEdit,_e=r.onLoadMore,Je=r.onNextPage,Ye=r.onPageChange,Xe=r.onRowGroupExpand,$e=r.onRowSelectionChange,Qe=r.onSortChange,Ze=r.prevIcon,en=r.quickFilter,nn=r.rowButtons,rn=r.rowGrouping,on=r.getRowId,an=r.rows,un=r.rowsPerPage,ln=void 0===un?10:un,sn=r.selectableCells,cn=void 0!==sn&&sn,dn=r.selectableColumns,fn=void 0!==dn&&dn,vn=r.serverSidePagination,pn=void 0!==vn&&vn,hn=r.shouldPaginate,wn=void 0!==hn&&hn,mn=r.sortDownIcon,gn=r.sortUpIcon,xn=r.tableEmptyStateRenderer,bn=void 0===xn?e.jsx(er,{}):xn,yn=r.tableRef,In=r.theme,Cn=void 0===In?"modern-light":In,Rn=r.totalRowCount,Sn=r.useHoverRowBackground,Mn=void 0===Sn||Sn,Nn=r.useOddColumnBackground,Hn=void 0!==Nn&&Nn,En=r.useOddEvenRowBackground,Pn=void 0!==En&&En,On=n.useMemo(function(){var n,r,t,o,i,a,u,l,s,c,d,f,v,p,h,w,m,g={drag:e.jsx(ne,{className:"st-drag-icon"}),expand:e.jsx($,{className:"st-expand-icon"}),filter:e.jsx(re,{className:"st-header-icon"}),headerCollapse:e.jsx($,{className:"st-header-icon"}),headerExpand:e.jsx(X,{className:"st-header-icon"}),next:e.jsx($,{className:"st-next-prev-icon"}),prev:e.jsx(X,{className:"st-next-prev-icon"}),sortDown:e.jsx(ee,{className:"st-header-icon"}),sortUp:e.jsx(Q,{className:"st-header-icon"})};return{drag:null!==(n=null==Se?void 0:Se.drag)&&void 0!==n?n:g.drag,expand:null!==(t=null!==(r=null==Se?void 0:Se.expand)&&void 0!==r?r:ce)&&void 0!==t?t:g.expand,filter:null!==(i=null!==(o=null==Se?void 0:Se.filter)&&void 0!==o?o:he)&&void 0!==i?i:g.filter,headerCollapse:null!==(u=null!==(a=null==Se?void 0:Se.headerCollapse)&&void 0!==a?a:me)&&void 0!==u?u:g.headerCollapse,headerExpand:null!==(s=null!==(l=null==Se?void 0:Se.headerExpand)&&void 0!==l?l:xe)&&void 0!==s?s:g.headerExpand,next:null!==(d=null!==(c=null==Se?void 0:Se.next)&&void 0!==c?c:Le)&&void 0!==d?d:g.next,prev:null!==(v=null!==(f=null==Se?void 0:Se.prev)&&void 0!==f?f:Ze)&&void 0!==v?v:g.prev,sortDown:null!==(h=null!==(p=null==Se?void 0:Se.sortDown)&&void 0!==p?p:mn)&&void 0!==h?h:g.sortDown,sortUp:null!==(m=null!==(w=null==Se?void 0:Se.sortUp)&&void 0!==w?w:gn)&&void 0!==m?m:g.sortUp}},[Se,ce,he,me,xe,Le,Ze,mn,gn]),Ln=n.useMemo(function(){return exports.__assign(exports.__assign({},nr),F)},[F]),Wn=n.useMemo(function(){var e,n,r,t;return{text:null!==(n=null!==(e=null==x?void 0:x.text)&&void 0!==e?e:y)&&void 0!==n?n:rr.text,searchEnabled:null!==(r=null==x?void 0:x.searchEnabled)&&void 0!==r?r:rr.searchEnabled,searchPlaceholder:null!==(t=null==x?void 0:x.searchPlaceholder)&&void 0!==t?t:rr.searchPlaceholder,searchFunction:null==x?void 0:x.searchFunction,rowRenderer:null==x?void 0:x.rowRenderer,customRenderer:null==x?void 0:x.customRenderer}},[x,y]),Bn=Ln.rowHeight,zn=Ln.headerHeight,qn=Ln.footerHeight,Yn=Ln.selectionColumnWidth;Hn&&(Pn=!1),m&&(Mn=!1);var $n=n.useRef(null),Qn=n.useRef(null),tr=n.useRef(null),or=n.useRef(null),ir=n.useRef(null),ar=n.useRef(null),lr=n.useRef(null),sr=n.useReducer(function(e){return e+1},0)[1],cr=n.useState(new Map),dr=cr[0],fr=cr[1],vr=n.useState(an),pr=vr[0],hr=vr[1],wr=n.useState(De),mr=wr[0],gr=wr[1],xr=n.useRef(De),br=n.useRef(new Map);n.useEffect(function(){hr(an);var e=new Map;an.forEach(function(n,r){var t=N({row:n,getRowId:on,depth:0,index:r,rowPath:[r],rowIndexPath:[r]}),o=H(t);e.set(o,r)}),br.current=e},[an,on]),n.useEffect(function(){var e=xr.current,n=De;n&&!e?gr(!0):!n&&e&&setTimeout(function(){gr(!1)},0),xr.current=De},[De]);var yr,Ir,Cr,Rr,Sr,Mr,Nr,Hr,Er,kr,Tr=function(e){var r=e.tableBodyContainerRef,t=n.useState(0),o=t[0],i=t[1];return n.useLayoutEffect(function(){r.current&&i(r.current.offsetWidth-r.current.clientWidth)},[r]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:r}}({tableBodyContainerRef:ar}),Pr=Tr.scrollbarWidth,Ar=Tr.setScrollbarWidth,Dr=oe({headerContainerRef:lr,mainSectionRef:ar,scrollbarWidth:Pr}).isMainSectionScrollable,Fr=n.useMemo(function(){if(mr&&0===pr.length){var e=wn?ln:10;return Dr&&(e+=1),Array.from({length:e},function(e,n){return{}})}return pr},[mr,pr,ln,Dr,wn]),Or=n.useMemo(function(){return He(O)},[O]),Lr=n.useState(1),Wr=Lr[0],Br=Lr[1],zr=n.useState(Or),qr=zr[0],Gr=zr[1],Vr=n.useState(!1),jr=Vr[0],Kr=Vr[1],Ur=n.useState(!1),_r=Ur[0],Jr=Ur[1],Yr=n.useState(null),Xr=Yr[0],$r=Yr[1],Qr=n.useState(q),Zr=Qr[0],et=Qr[1],nt=n.useCallback(function(){var e=new Set,n=function(r){r.forEach(function(r){r.collapseDefault&&r.collapsible&&e.add(r.accessor),r.children&&n(r.children)})};return n(Or),e},[Or]),rt=n.useState(nt),tt=rt[0],ot=rt[1];n.useEffect(function(){Gr(Or)},[Or]);var it=n.useMemo(function(){var e,n=u([],qr,!0);return te&&!(null===(e=null==qr?void 0:qr[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:Yn,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[te,qr,Yn]),at=n.useState(0),ut=at[0],lt=at[1],st=n.useState("none"),ct=st[0],dt=st[1],ft=function(e,r){var t=n.useState(function(){return function(e,n){if(!n||0===n.length)return new Set;if(e){var r=Array.from({length:n.length},function(e,n){return n});return new Set(r)}return new Set}(e,r)}),o=t[0],i=t[1];return n.useEffect(function(){i(r&&0!==r.length?function(e){var n=r.length,t=Array.from(e).filter(function(e){return n>e});return new Set(t)}:new Set)},[r]),{expandedDepths:o,setExpandedDepths:i}}(se,rn),vt=ft.expandedDepths,pt=ft.setExpandedDepths,ht=n.useState(new Map),wt=ht[0],mt=ht[1],gt=n.useState(new Map),xt=gt[0],bt=gt[1],yt=function(){var e=n.useState(""),r=e[0],t=e[1],o=n.useRef(null);return n.useEffect(function(){return r&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){t("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[r]),{announcement:r,announce:function(e){t(e)}}}(),It=yt.announcement,Ct=yt.announce,Rt=function(e){var r=e.effectiveHeaders,t=e.headerHeight,o=e.rowHeight,i=e.tableBodyContainerRef,a=n.useState(0),u=a[0],l=a[1],s=n.useCallback(function(e){var n,r;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(r=e.children)||void 0===r?void 0:r.length)?1+Math.max.apply(Math,e.children.map(s)):1},[]),c=n.useMemo(function(){var e=0;return r.forEach(function(n){var r=s(n);e=Math.max(e,r)}),e},[r,s]),d=n.useMemo(function(){var e=1;if("undefined"!=typeof window){var n=document.documentElement,r=getComputedStyle(n).getPropertyValue("--st-border-width").trim();if(r){var i=parseFloat(r);isNaN(i)||(e=i)}}return c*(null!=t?t:o)+e},[c,t,o]);return n.useLayoutEffect(function(){var e=function(){i.current&&l(i.current.clientWidth)};e();var n=null;return i.current&&(n=new ResizeObserver(e)).observe(i.current),function(){n&&n.disconnect()}},[i]),{containerWidth:u,calculatedHeaderHeight:d,maxHeaderDepth:c}}({effectiveHeaders:it,headerHeight:zn,rowHeight:Bn,tableBodyContainerRef:ar}),St=Rt.containerWidth,Mt=Rt.calculatedHeaderHeight,Nt=Rt.maxHeaderDepth,Ht=n.useMemo(function(){var e=tn({headers:it,containerWidth:St,collapsedHeaders:tt});return{mainBodyWidth:e.mainWidth,pinnedLeftWidth:e.leftWidth,pinnedRightWidth:e.rightWidth,pinnedLeftContentWidth:e.leftContentWidth,pinnedRightContentWidth:e.rightContentWidth}},[it,St,tt]),Et=Ht.mainBodyWidth,kt=Ht.pinnedLeftWidth,Tt=Ht.pinnedRightWidth,Pt=Ht.pinnedLeftContentWidth,At=Ht.pinnedRightContentWidth,Dt=function(e){var r=e.autoExpandColumns,t=e.containerWidth,o=e.pinnedLeftWidth,i=e.pinnedRightWidth,a=e.mainBodyRef,u=e.isResizing,l=e.setHeaders,s=n.useRef({autoExpandColumns:r,containerWidth:t,pinnedLeftWidth:o,pinnedRightWidth:i,mainBodyRef:a,isResizing:u});s.current={autoExpandColumns:r,containerWidth:t,pinnedLeftWidth:o,pinnedRightWidth:i,mainBodyRef:a,isResizing:u};var c=n.useCallback(function(e){l(function(n){var r="function"==typeof e?e(n):e;return ur(r,s.current)})},[l]),d=n.useRef(u);n.useEffect(function(){d.current&&!u&&r&&l(function(e){return ur(e,s.current)}),d.current=u},[u,r,l]);var f=n.useRef(t);return n.useEffect(function(){Math.abs(t-f.current)>10&&!u&&r&&l(function(e){return ur(e,s.current)}),f.current=t},[t,u,r,l]),c}({autoExpandColumns:c,containerWidth:St,pinnedLeftWidth:kt,pinnedRightWidth:Tt,mainBodyRef:tr,isResizing:jr,setHeaders:Gr}),Ft=function(e){var r=e.rows,t=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return r;var e=function(e){return h(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return r;var n=JSON.parse(JSON.stringify(r)),i=function(n,r){return void 0===r&&(r=0),n.map(function(n){var t=o[r],a=o[r+1],u=n[t];if(u&&M(u)){var l=i(u,r+1),s=exports.__assign({},n);return s[t]=l,e.forEach(function(e){var n=Un(l,e.accessor,e.aggregation,a);void 0!==n&&S(s,e.accessor,n)}),s}return n})};return i(n)},[r,t,o])}({rows:Fr,headers:qr,rowGrouping:rn}),Ot=function(e){var r=e.rows,t=e.headers,o=e.quickFilter;return n.useMemo(function(){if(!o||!o.text||""===o.text.trim())return r;var e=o.text,n=o.columns,i=o.caseSensitive,a=void 0!==i&&i,u=o.mode,l=void 0===u?"simple":u,s=o.useFormattedValue,c=void 0===s||s,d=t.filter(function(e){return!e.hide&&!e.excludeFromRender&&(n&&n.length>0?n.includes(e.accessor):!1!==e.quickFilterable)}),f="smart"===l?function(e){for(var n=[],r=0;e.length>r;){for(;e.length>r&&/\s/.test(e[r]);)r++;if(r>=e.length)break;if("-"!==e[r])if('"'!==e[r]){for(var t=r;e.length>r&&!/[\s:]/.test(e[r]);)r++;var o=e.substring(t,r);if(e.length>r&&":"===e[r]){for(var i=++r;e.length>r&&!/\s/.test(e[r]);)r++;(l=e.substring(i,r))&&n.push({type:"columnSpecific",value:l,column:o})}else o&&n.push({type:"word",value:o})}else{for(var a=++r;e.length>r&&'"'!==e[r];)r++;(l=e.substring(a,r))&&n.push({type:"phrase",value:l}),e.length>r&&'"'===e[r]&&r++}else{for(var u=++r;e.length>r&&!/\s/.test(e[r]);)r++;var l;(l=e.substring(u,r))&&n.push({type:"negation",value:l})}}return n}(e):null;return r.filter(function(n){if("smart"===l&&f){var r=new Set,t=new Map;f.forEach(function(e,n){"columnSpecific"===e.type&&e.column&&(t.has(e.column)||t.set(e.column,[]),t.get(e.column).push(n))});var o=[];d.forEach(function(e){try{var i;if(e.quickFilterGetter)i=e.quickFilterGetter({row:n,accessor:e.accessor});else{var u=R(n,e.accessor);if(c&&e.valueFormatter){var l=e.valueFormatter({accessor:e.accessor,colIndex:0,row:n,rowIndex:0,value:u});i=Array.isArray(l)?l.join(" "):l+""}else i=null==u?"":Array.isArray(u)?u.join(" "):u+""}o.push(i);var s=t.get(e.accessor);s&&s.forEach(function(e){var n=f[e],t=a?i:i.toLowerCase(),o=a?n.value:n.value.toLowerCase();t.includes(o)&&r.add(e)})}catch(n){console.warn("Quick filter error for column ".concat(e.accessor,":"),n)}});var i=a?o.join(" "):o.join(" ").toLowerCase();return f.forEach(function(e,n){if("columnSpecific"!==e.type){var t=a?e.value:e.value.toLowerCase();switch(e.type){case"word":case"phrase":i.includes(t)&&r.add(n);break;case"negation":i.includes(t)||r.add(n)}}}),r.size===f.length}return d.some(function(r){try{var t=void 0;if(r.quickFilterGetter)t=r.quickFilterGetter({row:n,accessor:r.accessor});else{var o=R(n,r.accessor);if(c&&r.valueFormatter){var i=r.valueFormatter({accessor:r.accessor,colIndex:0,row:n,rowIndex:0,value:o});t=Array.isArray(i)?i.join(" "):i+""}else t=null==o?"":Array.isArray(o)?o.join(" "):o+""}return function(e,n,r){if(!n)return!0;var t=r?e:e.toLowerCase(),o=r?n:n.toLowerCase();return t.includes(o)}(t,e,a)}catch(e){return console.warn("Quick filter error for column ".concat(r.accessor,":"),e),!1}})})},[r,t,o])}({rows:Ft,headers:it,quickFilter:en}),Lt=function(e){var r=e.rows,t=e.headers,o=e.externalFilterHandling,i=e.onFilterChange,a=e.announce,u=n.useState({}),l=u[0],s=u[1],c=Dn(t),d=n.useMemo(function(){return jn({externalFilterHandling:o,tableRows:r,filterState:l})},[r,l,o]),f=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));if(s(r),null==i||i(r),a){var t=c.get(e.accessor);t&&a("Filter applied to ".concat(t.label))}},[l,i,a,c]),v=n.useCallback(function(e){var n=exports.__assign({},l);if(delete n[e],s(n),null==i||i(n),a){var r=c.get(e);r&&a("Filter removed from ".concat(r.label))}},[l,i,a,c]),p=n.useCallback(function(){s({}),null==i||i({}),a&&a("All filters cleared")},[i,a]),h=n.useCallback(function(e){var n,t=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));return jn({externalFilterHandling:o,tableRows:r,filterState:t})},[l,r,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Ot,headers:it,externalFilterHandling:fe,onFilterChange:je,announce:Ct}),Wt=Lt.filters,Bt=Lt.updateFilter,zt=Lt.clearFilter,qt=Lt.clearAllFilters,Gt=Lt.computeFilteredRowsPreview,Vt=function(e){var r=e.headers,t=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=e.initialSortColumn,l=e.initialSortDirection,s=e.announce,c=Dn(r),d=n.useCallback(function(){if(!u)return null;var e=c.get(u);return e?{key:e,direction:l||"asc"}:null},[c,u,l]),f=n.useState(d),v=f[0],p=f[1],h=n.useCallback(function(e){var n=e.groupingKeys,r=e.headers,t=e.sortColumn,o=An({headers:r,rows:e.rows,sortColumn:t});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(M(a)){var u=h({rows:a,sortColumn:t,headers:r,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),w=n.useMemo(function(){return Fn({externalSortHandling:o,tableRows:t,sortColumn:v,rowGrouping:a,headers:r,sortNestedRows:h})},[t,v,r,o,a,h]),m=n.useCallback(function(e){if(!e)return p(null),void(null==i||i(null));var n=e.accessor,r=e.direction,t=c.get(n);if(t){var o=null;if(r)o={key:t,direction:r};else{var a=t.sortingOrder||["asc","desc",null],u=-1;v&&v.key.accessor===n&&(u=a.indexOf(v.direction));var l=a[(u+1)%a.length];o=null===l?null:{key:t,direction:l}}if(p(o),null==i||i(o),s)if(o){var d="asc"===o.direction?"ascending":"descending";s("Sorted by ".concat(t.label,", ").concat(d))}else s("Sort removed from ".concat(t.label))}},[v,c,i,s]),g=n.useCallback(function(e){var n=function(r){for(var t=0,o=r;o.length>t;t++){var i=o[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(r);if(!i)return t;var u=i.sortingOrder||["asc","desc",null],l=-1;v&&v.key.accessor===e&&(l=u.indexOf(v.direction));var s=u[(l+1)%u.length];return Fn({externalSortHandling:o,tableRows:t,sortColumn:null===s?null:{key:i,direction:s},rowGrouping:a,headers:r,sortNestedRows:h})},[v,r,t,o,a,h]);return{sort:v,sortedRows:w,updateSort:m,computeSortedRowsPreview:g}}({headers:qr,tableRows:Lt.filteredRows,externalSortHandling:pe,onSortChange:Qe,rowGrouping:rn,initialSortColumn:ke,initialSortDirection:Pe,announce:Ct}),jt=Vt.sort,Kt=Vt.updateSort,Ut=Vt.computeSortedRowsPreview,_t=Zn({rows:Vt.sortedRows,rowGrouping:rn,getRowId:on,expandedRows:wt,collapsedRows:xt,expandedDepths:vt,rowStateMap:dr,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!ue,hasEmptyRenderer:!!V,headers:it,rowHeight:Bn,headerHeight:zn,customTheme:Ln}),Jt=_t.flattenedRows,Yt=_t.heightOffsets,Xt=_t.paginatableRows,$t=_t.parentEndPositions,Qt=function(e){var r=e.tableRows,t=e.onRowSelectionChange,o=e.enableRowSelection,i=void 0!==o&&o,a=n.useState(new Set),u=a[0],l=a[1],s=n.useCallback(function(e){return!!i&&function(e,n){return n.has(e)}(e,u)},[u,i]),c=n.useCallback(function(){return!!i&&function(e,n){return 0!==e.length&&e.filter(function(e){return e&&e.rowId}).every(function(e){return n.has(H(e.rowId))})}(r,u)},[r,u,i]),d=n.useMemo(function(){return i?function(e){return e.size}(u):0},[u,i]),f=n.useMemo(function(){return i?function(e,n){return e.filter(function(e){return!(!e||!e.rowId)&&n.has(H(e.rowId))}).map(function(e){return e.row})}(r,u):[]},[r,u,i]),v=n.useCallback(function(e,n){if(i){var o=function(e,n){var r=new Set(n);return r.has(e)?r.delete(e):r.add(e),r}(e,u);if(l(o),t){var a=r.find(function(n){return H(n.rowId)===e});a&&t({row:a.row,isSelected:n,selectedRows:o})}}},[u,r,t,i]),p=n.useCallback(function(e){var n;i&&(e?(n=function(e){return new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}))}(r),t&&r.forEach(function(e){return t({row:e.row,isSelected:!0,selectedRows:n})})):(n=new Set,t&&u.forEach(function(e){var o=r.find(function(n){return H(n.rowId)===e});o&&t({row:o.row,isSelected:!1,selectedRows:n})})),l(n))},[r,t,u,i]),h=n.useCallback(function(e){if(i){var n=s(e);v(e,!n)}},[s,v,i]),w=n.useCallback(function(){if(i){if(t){var e=new Set;u.forEach(function(n){var o=r.find(function(e){return H(e.rowId)===n});o&&t({row:o.row,isSelected:!1,selectedRows:e})})}l(new Set)}},[u,r,t,i]);return{selectedRows:u,setSelectedRows:l,isRowSelected:s,areAllRowsSelected:c,selectedRowCount:d,selectedRowsData:f,handleRowSelect:v,handleSelectAll:p,handleToggleRow:h,clearSelection:w}}({tableRows:Jt,onRowSelectionChange:$e,enableRowSelection:te});yr=Qt.selectedRows,Ir=Qt.setSelectedRows,Cr=Qt.isRowSelected,Rr=Qt.areAllRowsSelected,Sr=Qt.selectedRowCount,Mr=Qt.selectedRowsData,Nr=Qt.handleRowSelect,Hr=Qt.handleSelectAll,Er=Qt.handleToggleRow,kr=Qt.clearSelection;var Zt=Zn({rows:Ft,rowGrouping:rn,getRowId:on,expandedRows:wt,collapsedRows:xt,expandedDepths:vt,rowStateMap:dr,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!ue,hasEmptyRenderer:!!V,headers:it,rowHeight:Bn,headerHeight:zn,customTheme:Ln}).flattenedRows,eo=n.useCallback(function(e){var n=Gt(e);return rn&&0!==rn.length?T({rows:n,rowGrouping:rn,getRowId:on,expandedRows:wt,collapsedRows:xt,expandedDepths:vt,rowStateMap:dr,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!ue,hasEmptyRenderer:!!V,headers:it,rowHeight:Bn,headerHeight:zn,customTheme:Ln}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowId:[n],rowPath:[n],absoluteRowIndex:n}})},[Gt,rn,on,wt,xt,vt,dr,Fe,ue,V,it,Bn,zn,Ln]),no=n.useCallback(function(e){var n=Ut(e);return rn&&0!==rn.length?T({rows:n,rowGrouping:rn,getRowId:on,expandedRows:wt,collapsedRows:xt,expandedDepths:vt,rowStateMap:dr,hasLoadingRenderer:!!Fe,hasErrorRenderer:!!ue,hasEmptyRenderer:!!V,headers:it,rowHeight:Bn,headerHeight:zn,customTheme:Ln}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowId:[n],rowPath:[n],absoluteRowIndex:n}})},[Ut,rn,on,wt,xt,vt,dr,Fe,ue,V,it,Bn,zn,Ln]),ro=function(e){var r=e.height,t=e.maxHeight,o=e.rowHeight,i=e.totalRowCount,a=e.headerHeight,u=e.footerHeight;return n.useMemo(function(){if(t){var e=Kn(t);if(0===e)return;var n=a||o;if(e>=n+i*o+(u||0)||20>i)return;return Math.max(0,e-n)}if(r){var l=Kn(r);if(0!==l)return Math.max(0,l-o)}},[r,t,o,i,a,u])}({height:be,maxHeight:Oe,rowHeight:Bn,shouldPaginate:wn,rowsPerPage:ln,totalRowCount:null!=Rn?Rn:Xt.length,headerHeight:Mt,footerHeight:wn&&!Ie?qn:void 0}),to=function(e){var r=e.allowAnimations,t=e.computeFilteredRowsPreview,o=e.computeSortedRowsPreview,i=e.contentHeight,a=e.currentPage,s=e.customTheme,c=e.enableStickyParents,d=e.flattenedRows,f=e.heightOffsets,v=e.originalFlattenedRows,p=e.parentEndPositions,h=e.rowHeight,w=e.rowsPerPage,m=e.scrollDirection,g=void 0===m?"none":m,x=e.scrollTop,b=e.serverSidePagination,y=e.shouldPaginate,I=e.rowGrouping,C=n.useState(!1),R=C[0],S=C[1],M=n.useState([]),N=M[0],E=M[1],k=n.useRef([]),T=n.useRef([]),P=n.useMemo(function(){return l(h)},[h]),A=n.useRef(new Map),D=n.useRef(null),F=n.useCallback(function(e,n){if(!y||b)return e.map(function(e,n){return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:n})});var r=(a-1)*w,t=a*w,o=0===r?0:n[r-1];return e.slice(o,t>n.length?e.length:n[t-1]).map(function(e,n){var r=e.nestedTable?e.absoluteRowIndex:y&&!b?o+n:n;return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:r})})},[a,w,b,y]);n.useMemo(function(){if(0===A.current.size&&v.length>0){var e=new Map;v.forEach(function(n,r){var t=H(n.rowId);e.set(t,r)}),A.current=e}},[v]);var O=n.useMemo(function(){return F(d,p)},[d,p,F]),L=n.useMemo(function(){if(!f||0===f.length||!y||b)return f;var e=new Map;return O.forEach(function(n){n.nestedTable&&e.set(n.absoluteRowIndex,n.position)}),f.filter(function(n){return e.has(n[0])}).map(function(n){var r=n[1];return[e.get(n[0]),r]})},[f,O,y,b]),W=n.useMemo(function(){if(L&&0!==L.length)return function(e,n,r,t){var o=n+t.rowSeparatorWidth,i=Array(e),a=new Map;r&&r.forEach(function(e){a.set(e[0],e[1])});for(var u=0,l=0;e>l;l++){i[l]=u,u+=o;var s=a.get(l);void 0!==s&&(u+=s)}return{rowTopPositions:i,totalHeight:u-t.rowSeparatorWidth}}(O.length,h,L,s)},[O.length,h,L,s]),z=n.useMemo(function(){return void 0===i?O:B({bufferRowCount:P,contentHeight:i,tableRows:O,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:W}).rendered.rows},[O,i,h,x,g,P,W]),q=n.useMemo(function(){if(!c||void 0===i)return{stickyParents:[],regularRows:z,partiallyVisibleRows:[]};var e=B({bufferRowCount:P,contentHeight:i,tableRows:O,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:W}),n=I?function(e,n,r,t,o){return G({allTableRows:e,renderedRows:n,fullyVisibleRows:r,partiallyVisibleRows:t,partiallyVisibleRowIndex:0,recursionDepth:0,stickyParents:[],rowGrouping:o})}(O,e.rendered.rows,e.fullyVisible.rows,e.partiallyVisible.rows,I):{stickyParents:[],regularRows:e.rendered.rows,partiallyVisibleRows:[]};return exports.__assign(exports.__assign({},n),{partiallyVisibleRows:e.partiallyVisible.rows})},[P,i,O,c,W,I,h,g,x,z]),V=q.stickyParents,j=q.regularRows,K=q.partiallyVisibleRows,U=n.useCallback(function(e,n){var r=new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)})),t=new Set(n.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}));return{staying:n.filter(function(e){var n=H(e.rowId);return r.has(n)}),entering:n.filter(function(e){var n=H(e.rowId);return!r.has(n)}),leaving:e.filter(function(e){var n=H(e.rowId);return!t.has(n)})}},[]),_=n.useMemo(function(){if(0===k.current.length)return!1;var e=O.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)}),n=k.current.filter(function(e){return e&&e.rowId}).map(function(e){return H(e.rowId)});return e.length!==n.length||!e.every(function(e,r){return e===n[r]})},[O]);n.useLayoutEffect(function(){if(!R){var e=function(){N.length>0&&E([])};if(!r||y)return e(),k.current=O,void(T.current=z);if(0===k.current.length)return e(),k.current=O,void(T.current=z);if(!_)return e(),k.current=O,void(T.current=z);D.current={tableRows:O,visibleRows:z},S(!0)}},[r,O,N.length,_,R,y,z]),n.useLayoutEffect(function(){if(R&&D.current&&N.length>0){var e=setTimeout(function(){var e=D.current;S(!1),E([]),k.current=e.tableRows,T.current=e.visibleRows,D.current=null},Xn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[R,N.length]);var J=n.useMemo(function(){if(!r||y)return z;if(N.length>0){var e=new Map,n=new Map;return O.forEach(function(r){var t=H(r.rowId);e.set(t,r.position),n.set(t,r.displayPosition)}),N.map(function(r){var t=H(r.rowId),o=e.get(t),i=n.get(t);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},r),{position:o,displayPosition:i}):r})}return z},[z,N,O,r,y]),Y=n.useCallback(function(e){if(r&&!y&&void 0!==i){var n=t(e),o=F(n,[]),a=B({bufferRowCount:P,contentHeight:i,tableRows:o,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:W}),l=U(z,a.rendered.rows).entering.map(function(e){var n=H(e.rowId)+"";return O.find(function(e){return H(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],z,!0),l,!0))}},[r,y,t,F,i,h,x,g,U,O,z,P,W]),X=n.useCallback(function(e){if(r&&!y&&void 0!==i){var n=o(e),t=F(n,[]),a=B({bufferRowCount:P,contentHeight:i,tableRows:t,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:W}),l=U(z,a.rendered.rows).entering.map(function(e){var n=H(e.rowId)+"";return O.find(function(e){return H(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&E(u(u([],z,!0),l,!0))}},[r,y,o,F,i,h,x,g,U,O,z,P,W]);return{currentTableRows:O,currentVisibleRows:z,isAnimating:R,prepareForFilterChange:Y,prepareForSortChange:X,rowsToRender:J,stickyParents:V,regularRows:j,partiallyVisibleRows:K,paginatedHeightOffsets:L,heightMap:W}}({allowAnimations:o,computeFilteredRowsPreview:eo,computeSortedRowsPreview:no,contentHeight:ro,currentPage:Wr,customTheme:Ln,enableStickyParents:ae,flattenedRows:Jt,heightOffsets:Yt,originalFlattenedRows:Zt,paginatableRows:Xt,parentEndPositions:$t,rowGrouping:rn,rowHeight:Bn,rowsPerPage:ln,scrollDirection:ct,scrollTop:ut,serverSidePagination:pn,shouldPaginate:wn}),oo=to.currentTableRows,io=to.rowsToRender,ao=to.prepareForFilterChange,uo=to.prepareForSortChange,lo=to.isAnimating,so=to.stickyParents,co=to.regularRows,fo=to.partiallyVisibleRows,vo=to.paginatedHeightOffsets,po=to.heightMap,ho=n.useRef(new Map),wo=n.useRef(new Map),mo=function(e){var r=e.selectableCells,t=e.headers,o=e.tableRows,u=e.onCellEdit,l=e.cellRegistry,s=e.collapsedHeaders,c=e.rowHeight,d=e.enableRowSelection,f=void 0!==d&&d,v=e.copyHeadersToClipboard,p=void 0!==v&&v,h=e.customTheme,w=n.useState(new Set),m=w[0],g=w[1],x=n.useState(new Set),b=x[0],y=x[1],I=n.useState(null),C=I[0],M=I[1],N=n.useState(null),E=N[0],k=N[1],T=n.useState(new Set),A=T[0],D=T[1],F=n.useState(new Set),O=F[0],L=F[1],W=n.useState(!1),B=W[0],z=W[1],q=n.useRef(!1),G=n.useRef(null),V=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var r=n.split("-");if(r.length>=2){var t=parseInt(r[1],10);isNaN(t)||e.add(t)}}),b.forEach(function(n){e.add(n)}),e},[m,b]),U=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var r=n.split("-");if(r.length>=3){var t=r.slice(2).join("-");e.add(t)}}),b.size>0&&o.forEach(function(n){var r=H(n.rowId);e.add(r)}),e},[m,b,o]),_=n.useMemo(function(){return t.flatMap(function(e){return P(e,s)})},[t,s]),J=n.useCallback(function(){if(0!==m.size){var e=function(e,n,r,t){void 0===t&&(t=!1);var o=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),i=new Map,a=new Map;o.forEach(function(e,n){i.set(n,e.accessor),a.set(n,e)});var u=Array.from(e).reduce(function(e,n){var t,o=n.split("-").map(Number),u=o[0],l=o[1];e[u]||(e[u]=[]);var s=i.get(l),c=a.get(l);if(s&&(null===(t=r[u])||void 0===t?void 0:t.row)){var d=r[u].row,f=R(d,s);if(!1!==(null==c?void 0:c.useFormattedValueForClipboard)&&(null==c?void 0:c.valueFormatter)){var v=c.valueFormatter({accessor:s,colIndex:l,row:d,rowIndex:u,value:f});e[u][l]=v}else e[u][l]=!c||"lineAreaChart"!==c.type&&"barChart"!==c.type?f:Array.isArray(f)?f.join(", "):""}else e[u][l]="";return e},{}),l=new Set;t&&Array.from(e).forEach(function(e){var n=e.split("-").map(Number);l.add(n[1])});var s="";t&&l.size>0&&(s=Array.from(l).sort(function(e,n){return e-n}).map(function(e){var n,r=a.get(e);return null!==(n=null==r?void 0:r.label)&&void 0!==n?n:""}).join("\t"));var c=Object.values(u).map(function(e){return Object.values(e).join("\t")}).join("\n");return t&&s?"".concat(s,"\n").concat(c):c}(m,_,o,p);navigator.clipboard.writeText(e),D(new Set(m)),setTimeout(function(){return D(new Set)},800)}},[m,_,o,p]),Y=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,r,t,i;return a(this,function(a){switch(a.label){case 0:if(!E)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?(n=function(e,n,r,t,o,i){var a=new Set,u=new Set,l=e.split("\n").filter(function(e){return e.length>0});if(0===l.length)return{updatedCells:a,warningCells:u};var s=r.filter(function(e){return!e.hide&&!e.excludeFromRender}),c=n.rowIndex,d=n.colIndex;return l.forEach(function(e,n){e.split("\t").forEach(function(e,r){var l=c+n,f=d+r;if(t.length>l&&s.length>f){var v=t[l],p=s[f],h=H(v.rowId);if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=+e;isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var g=new Date(e);isNaN(g.getTime())||(w=g)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(w=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(S(v.row,p.accessor,w),i){var x="".concat(h,"-").concat(p.accessor),b=i.get(x);b&&b.updateContent(w)}null==o||o({accessor:p.accessor,newValue:w,row:v.row,rowIndex:l});var y="".concat(l,"-").concat(f,"-").concat(h);a.add(y)}else{var I="".concat(l,"-").concat(f,"-").concat(h);u.add(I)}}})}),{updatedCells:a,warningCells:u}}(e,E,_,o,u,l),t=n.warningCells,(r=n.updatedCells).size>0&&(D(r),setTimeout(function(){return D(new Set)},800)),t.size>0&&(L(t),setTimeout(function(){return L(new Set)},800)),[3,4]):[2];case 3:return i=a.sent(),console.warn("Failed to paste from clipboard:",i),[3,4];case 4:return[2]}})})},[E,_,o,u,l]),X=n.useCallback(function(){if(0!==m.size){var e=function(e,n,r,t,o){var i=new Set,a=new Set,u=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),l=new Map;return u.forEach(function(e,n){l.set(n,e.accessor)}),Array.from(e).forEach(function(e){var n=e.split("-").map(Number),l=n[0],s=n[1];if(r.length>l&&u.length>s){var c=r[l],d=u[s],f=H(c.rowId);if(null==d?void 0:d.isEditable){var v;if(v="string"===d.type?"":"number"===d.type?null:"boolean"!==d.type&&("date"===d.type?null:"lineAreaChart"===d.type||"barChart"===d.type||Array.isArray(R(c.row,d.accessor))?[]:""),S(c.row,d.accessor,v),o){var p="".concat(f,"-").concat(d.accessor),h=o.get(p);h&&h.updateContent(v)}null==t||t({accessor:d.accessor,newValue:v,row:c.row,rowIndex:l}),i.add(e)}else a.add(e)}}),{deletedCells:i,warningCells:a}}(m,_,o,u,l),n=e.deletedCells,r=e.warningCells;n.size>0&&(D(n),setTimeout(function(){return D(new Set)},800)),r.size>0&&(L(r),setTimeout(function(){return L(new Set)},800))}},[m,_,o,u,l]),$=n.useCallback(function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),u=Math.max(e.colIndex,n.colIndex),l=t;i>=l;l++)for(var s=a;u>=s;s++)if(l>=0&&o.length>l){if(f&&0===s)continue;var d=H(o[l].rowId);r.add(K({colIndex:s,rowIndex:l,rowId:d}))}y(new Set),M(null),g(r),k(n),setTimeout(function(){return j(n,c,h)},0)},[o,c,f,h]),Q=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?_.length:_.length-1)>=e.colIndex){var n=K(e);y(new Set),M(null),g(new Set([n])),k(e),setTimeout(function(){return j(e,c,h)},0)}},[_.length,o.length,c,f,h]),Z=n.useCallback(function(e,n){void 0===n&&(n=!1),g(new Set),k(null),y(function(r){var t=new Set(n?r:[]);return e.forEach(function(e){return t.add(e)}),t}),e.length>0&&M(e[e.length-1])},[]);!function(e){var r=e.copyToClipboard,t=e.deleteSelectedCells,o=e.enableRowSelection,i=void 0!==o&&o,a=e.initialFocusedCell,u=e.leafHeaders,l=e.pasteFromClipboard,s=e.selectCellRange,c=e.selectSingleCell,d=e.selectableCells,f=e.selectedCells,v=e.setLastSelectedColumnIndex,p=e.setSelectedCells,h=e.setSelectedColumns,w=e.startCell,m=e.tableRows;n.useEffect(function(){var e=function(e){if(d&&a&&0!==f.size){var s=document.activeElement;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement||"true"===(null==s?void 0:s.getAttribute("contenteditable")))){var c=a.rowIndex,R=a.colIndex,S=a.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void l();if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();for(var M=new Set,N=0;m.length>N;N++)for(var E=0;u.length>E;E++){var k=i?E+1:E,T=H(m[N].rowId);M.add("".concat(N,"-").concat(k,"-").concat(T))}return p(M),h(new Set),void v(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void t();var P=m[c];if((P?H(P.rowId):null)!==S){var A=m.findIndex(function(e){return H(e.rowId)===S});if(-1===A)return;c=A}var D=function(e,n,r){var t=e,o=n;return"up"===r?t=0:"down"===r?t=m.length-1:"left"===r?o=i?1:0:"right"===r&&(o=i?u.length:u.length-1),{rowIndex:t,colIndex:o}};"ArrowUp"===e.key?(e.preventDefault(),n(e,c,R,D)):"ArrowDown"===e.key?(e.preventDefault(),o(e,c,R,D)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),g(e,c,R,D)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),x(e,c,R,D)):"Home"===e.key?(e.preventDefault(),b(e,c)):"End"===e.key?(e.preventDefault(),y(e,c)):"PageUp"===e.key?(e.preventDefault(),I(e,c,R)):"PageDown"===e.key?(e.preventDefault(),C(e,c,R)):"Escape"===e.key&&(p(new Set),h(new Set),v(null),w.current=null)}else r()}}},n=function(e,n,r,t){if(e.shiftKey){w.current||(w.current=a);var o=n-1;if((e.ctrlKey||e.metaKey)&&(o=t(n,r,"up").rowIndex),o>=0){var i=H(m[o].rowId);s(w.current,{rowIndex:o,colIndex:r,rowId:i})}}else n>0&&(o=n-1,(e.ctrlKey||e.metaKey)&&(o=t(n,r,"up").rowIndex),i=H(m[o].rowId),c({rowIndex:o,colIndex:r,rowId:i}),w.current=null)},o=function(e,n,r,t){if(e.shiftKey){w.current||(w.current=a);var o=n+1;if((e.ctrlKey||e.metaKey)&&(o=t(n,r,"down").rowIndex),m.length>o){var i=H(m[o].rowId);s(w.current,{rowIndex:o,colIndex:r,rowId:i})}}else m.length-1>n&&(o=n+1,(e.ctrlKey||e.metaKey)&&(o=t(n,r,"down").rowIndex),i=H(m[o].rowId),c({rowIndex:o,colIndex:r,rowId:i}),w.current=null)},g=function(e,n,r,t){if(e.shiftKey&&"ArrowLeft"===e.key){w.current||(w.current=a);var o=r-1;if(e.ctrlKey||e.metaKey)o=t(n,r,"left").colIndex;else if(i&&0===o)return;if(o>=0){var u=H(m[n].rowId);s(w.current,{rowIndex:n,colIndex:o,rowId:u})}}else if(r>0){if(o=r-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)o=t(n,r,"left").colIndex;else if(i&&0===o)return;0>o||(u=H(m[n].rowId),c({rowIndex:n,colIndex:o,rowId:u}),w.current=null)}},x=function(e,n,r,t){var o=i?u.length:u.length-1;if(e.shiftKey&&"ArrowRight"===e.key){w.current||(w.current=a);var l=r+1;if((e.ctrlKey||e.metaKey)&&(l=t(n,r,"right").colIndex),o>=l){var d=H(m[n].rowId);s(w.current,{rowIndex:n,colIndex:l,rowId:d})}}else o>r&&(l=r+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(l=t(n,r,"right").colIndex),l>o||(d=H(m[n].rowId),c({rowIndex:n,colIndex:l,rowId:d}),w.current=null))},b=function(e,n,r){if(e.shiftKey){w.current||(w.current=a);var t=n,o=i?1:0;(e.ctrlKey||e.metaKey)&&(t=0);var u=H(m[t].rowId);s(w.current,{rowIndex:t,colIndex:o,rowId:u})}else t=n,o=i?1:0,(e.ctrlKey||e.metaKey)&&(t=0),u=H(m[t].rowId),c({rowIndex:t,colIndex:o,rowId:u}),w.current=null},y=function(e,n,r){if(e.shiftKey){w.current||(w.current=a);var t=n,o=i?u.length:u.length-1;(e.ctrlKey||e.metaKey)&&(t=m.length-1);var l=H(m[t].rowId);s(w.current,{rowIndex:t,colIndex:o,rowId:l})}else t=n,o=i?u.length:u.length-1,(e.ctrlKey||e.metaKey)&&(t=m.length-1),l=H(m[t].rowId),c({rowIndex:t,colIndex:o,rowId:l}),w.current=null},I=function(e,n,r){var t=Math.max(0,n-10);if(e.shiftKey){w.current||(w.current=a);var o=H(m[t].rowId);s(w.current,{rowIndex:t,colIndex:r,rowId:o})}else o=H(m[t].rowId),c({rowIndex:t,colIndex:r,rowId:o}),w.current=null},C=function(e,n,r){var t=Math.min(m.length-1,n+10);if(e.shiftKey){w.current||(w.current=a);var o=H(m[t].rowId);s(w.current,{rowIndex:t,colIndex:r,rowId:o})}else o=H(m[t].rowId),c({rowIndex:t,colIndex:r,rowId:o}),w.current=null};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[d,a,m,u,c,s,f,p,h,v,r,l,t,w,i])}({selectableCells:r,initialFocusedCell:E,tableRows:o,leafHeaders:_,selectSingleCell:Q,selectCellRange:$,selectedCells:m,setSelectedCells:g,setSelectedColumns:y,setLastSelectedColumnIndex:M,copyToClipboard:J,pasteFromClipboard:Y,deleteSelectedCells:X,startCell:G,enableRowSelection:f});var ee=n.useCallback(function(e,n){var r=new Set,t=new Map;o.forEach(function(e,n){var r=H(e.rowId);t.set(r,n)});for(var i=t.get(e.rowId+""),a=t.get(n.rowId+""),u=void 0!==i?i:e.rowIndex,l=void 0!==a?a:n.rowIndex,s=Math.min(u,l),c=Math.max(u,l),d=Math.min(e.colIndex,n.colIndex),v=Math.max(e.colIndex,n.colIndex),p=s;c>=p;p++)for(var h=d;v>=h;h++)if(p>=0&&o.length>p){if(f&&0===h)continue;var w=H(o[p].rowId);r.add(K({colIndex:h,rowIndex:p,rowId:w}))}g(r)},[o,f]),ne=n.useCallback(function(e,n){var r=document.querySelector(".st-body-container");if(!r)return null;var t=r.getBoundingClientRect(),o=Array.from(document.querySelectorAll(".st-cell[data-row-index][data-col-index]:not(.st-selection-cell)"));if(0===o.length)return null;var i=Math.max(t.left,Math.min(t.right,e)),a=Math.max(t.top,Math.min(t.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,r=n.getBoundingClientRect(),t=r.top+r.height/2,o=Math.sqrt(Math.pow(r.left+r.width/2-i,2)+Math.pow(t-a,2));l>o&&(l=o,u=n)}}),null!==u){var s=u,c=parseInt(s.getAttribute("data-row-index")||"-1",10),d=parseInt(s.getAttribute("data-col-index")||"-1",10),f=s.getAttribute("data-row-id");if(c>=0&&d>=0&&null!==f)return{rowIndex:c,colIndex:d,rowId:f}}return null},[]),re=n.useCallback(function(e,n){var r=document.elementFromPoint(e,n);if(!r)return null;var t=r.closest(".st-cell");if(t instanceof HTMLElement){var o=parseInt(t.getAttribute("data-row-index")||"-1",10),i=parseInt(t.getAttribute("data-col-index")||"-1",10),a=t.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return ne(e,n)},[ne]),te=n.useCallback(function(e,n){var r=document.querySelector(".st-body-container");if(r){var t=r.getBoundingClientRect();t.top+50>n?r.scrollTop-=10*Math.min(3,1+Math.max(0,t.top-n)/100):n>t.bottom-50&&(r.scrollTop+=10*Math.min(3,1+Math.max(0,n-t.bottom)/100));var o=document.querySelector(".st-body-main");o&&(t.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,t.left-e)/100):e>t.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-t.right)/100)))}},[]),oe=n.useCallback(function(e){var n=e.colIndex,r=K({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),t=m.has(r),o=b.has(n);return t||o},[m,b]),ie=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId;if(B)return"";var i=[],a=o[r-1],u=a?H(a.rowId):null,l=o[r+1],s=l?H(l.rowId):null,c=null!==u?{colIndex:n,rowIndex:r-1,rowId:u}:null,d=null!==s?{colIndex:n,rowIndex:r+1,rowId:s}:null,f={colIndex:n-1,rowIndex:r,rowId:t},v={colIndex:n+1,rowIndex:r,rowId:t};return(!c||!oe(c)||b.has(n)&&0===r)&&i.push("st-selected-top-border"),(!d||!oe(d)||b.has(n)&&r===o.length-1)&&i.push("st-selected-bottom-border"),oe(f)||i.push("st-selected-left-border"),oe(v)||i.push("st-selected-right-border"),i.join(" ")},[B,oe,o,b]),ae=n.useMemo(function(){return E?function(e){return e.rowIndex===E.rowIndex&&e.colIndex===E.colIndex&&e.rowId===E.rowId}:function(){return!1}},[E]),ue=n.useCallback(function(e){var n=K({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return A.has(n)},[A]),le=n.useCallback(function(e){var n=K({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return O.has(n)},[O]);return{getBorderClass:ie,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){q.current=!0,z(!0),G.current={rowIndex:t,colIndex:n,rowId:o},setTimeout(function(){y(new Set),M(null);var e=K({colIndex:n,rowIndex:t,rowId:o});g(new Set([e])),k({rowIndex:t,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,s=function(){if(q.current&&G.current){if(null!==i&&null!==a){te(i,a);var e=Date.now();if(e-l>=16){var n=re(i,a);n&&ee(G.current,n),l=e}}u=requestAnimationFrame(s)}else null!==u&&(cancelAnimationFrame(u),u=null)},c=function(e){q.current&&G.current&&(i=e.clientX,a=e.clientY)},d=function(){q.current=!1,z(!1),null!==u&&(cancelAnimationFrame(u),u=null),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",d),u=requestAnimationFrame(s)}},handleMouseOver:function(e){r&&q.current&&G.current&&ee(G.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ue,isWarningFlashing:le,isInitialFocusedCell:ae,isSelected:oe,lastSelectedColumnIndex:C,pasteFromClipboard:Y,selectColumns:Z,selectedCells:m,selectedColumns:b,setInitialFocusedCell:k,setSelectedCells:g,setSelectedColumns:y,deleteSelectedCells:X,columnsWithSelectedCells:V,rowsWithSelectedCells:U,startCell:G}}({selectableCells:cn,headers:it,tableRows:oo,onCellEdit:Be,cellRegistry:ho.current,collapsedHeaders:tt,rowHeight:Bn,enableRowSelection:te,copyHeadersToClipboard:D,customTheme:Ln}),go=mo.getBorderClass,xo=mo.handleMouseDown,bo=mo.handleMouseOver,yo=mo.isCopyFlashing,Io=mo.isInitialFocusedCell,Co=mo.isSelected,Ro=mo.isWarningFlashing,So=mo.selectColumns,Mo=mo.selectedCells,No=mo.selectedColumns,Ho=mo.setInitialFocusedCell,Eo=mo.setSelectedCells,ko=mo.setSelectedColumns,To=mo.columnsWithSelectedCells,Po=mo.rowsWithSelectedCells,Ao=mo.startCell,Do=n.useCallback(function(e){uo(e),setTimeout(function(){Kt({accessor:e})},0)},[uo,Kt]),Fo=n.useCallback(function(e){Dt(e)},[Dt]),Oo=n.useCallback(function(){Dt(O)},[O,Dt]);!function(e){var r=e.selectableColumns,t=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown,s=e.startCell;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(u&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||r&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(t.size>0&&i(new Set),o.size>0&&a(new Set),s&&(s.current=null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,t,o,i,a,u,l,s])}({selectableColumns:fn,selectedCells:Mo,selectedColumns:No,setSelectedCells:Eo,setSelectedColumns:ko,activeHeaderDropdown:Xr,setActiveHeaderDropdown:$r,startCell:Ao}),function(e){var r=e.forceUpdate,t=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){r(),t.current&&o(t.current.offsetWidth-t.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[r,t,o])}({forceUpdate:sr,tableBodyContainerRef:ar,setScrollbarWidth:Ar}),function(e){var r=e.onGridReady;n.useEffect(function(){null==r||r()},[r])}({onGridReady:Ke}),function(e){var r=e.cellRegistryRef,t=e.clearAllFilters,o=e.clearFilter,l=e.currentPage,s=e.resetColumns,c=e.editColumns,d=e.expandedDepths,f=e.filters,v=e.flattenedRows,p=e.headerRegistryRef,h=e.headers,w=e.includeHeadersInCSVExport,m=e.onColumnVisibilityChange,g=e.onPageChange,x=e.paginatableRows,y=e.quickFilter,I=e.rowGrouping,C=e.rows,M=e.rowsPerPage,N=e.setCollapsedRows,E=e.setColumnEditorOpen,k=e.setCurrentPage,T=e.setExpandedDepths,P=e.setExpandedRows,A=e.setHeaders,D=e.sort,F=e.tableRef,O=e.totalRowCount,L=e.updateFilter,W=e.updateSort,B=e.visibleRows;n.useEffect(function(){F&&(F.current={updateData:function(e){var n=e.accessor,t=e.rowIndex,o=e.newValue,i=null==C?void 0:C[t];if(i){var a=v.find(function(e){return e.absoluteRowIndex===t});if(a){var u=H(a.rowId),l=b({rowId:u,accessor:n}),s=r.current.get(l);s&&s.updateContent(o)}void 0!==R(i,n)&&S(i,n,o)}},setHeaderRename:function(e){var n=p.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return B},getAllRows:function(){return v},getHeaders:function(){return h},exportToCSV:function(e){!function(e,n,r,t){void 0===t&&(t=!0);var o=function(e,n,r){void 0===r&&(r=!0);var t=function(e){var n=[],r=function(e){for(var t=0,o=e;o.length>t;t++){var i=o[t];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?(i.singleRowChildren&&n.push(i),r(i.children)):n.push(i))}};return r(e),n}(n),o=t.map(function(e){return _n(e.label)}).join(","),i=e.map(function(e,n){var r=e.row;return t.map(function(e,t){var o=R(r,e.accessor);if(e.exportValueGetter){var i=e.valueFormatter?e.valueFormatter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o}):void 0,a=e.exportValueGetter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o,formattedValue:i});return _n(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o}),_n(i)):_n(o)}).join(",")});return(r?u([o],i,!0):i).join("\n")}(e,n,t);!function(e,n){void 0===n&&(n="table-export.csv");var r=new Blob([e],{type:"text/csv;charset=utf-8;"}),t=document.createElement("a"),o=URL.createObjectURL(r);t.setAttribute("href",o),t.setAttribute("download",n),t.style.visibility="hidden",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(o)}(o,r)}(v,h,(void 0===e?{}:e).filename,w)},getSortState:function(){return D},applySortState:Jn(W),getFilterState:function(){return f},applyFilter:Jn(L),clearFilter:Jn(o),clearAllFilters:Jn(t),getCurrentPage:function(){return l},getTotalPages:function(){return Math.ceil((null!=O?O:x.length)/M)},setPage:function(e){return i(void 0,void 0,void 0,function(){var n;return a(this,function(r){switch(r.label){case 0:return n=Math.ceil((null!=O?O:x.length)/M),1>e||e>n?[3,2]:(k(e),g?[4,g(e)]:[3,2]);case 1:r.sent(),r.label=2;case 2:return[2]}})})},expandAll:function(){var e=Array.from({length:(null==I?void 0:I.length)||0},function(e,n){return n});T(new Set(e)),P(new Map),N(new Map)},collapseAll:function(){T(new Set),P(new Map),N(new Map)},expandDepth:function(e){T(function(n){for(var r=new Set(n),t=0;e>=t;t++)r.add(t);return r}),P(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r}),N(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r})},collapseDepth:function(e){T(function(n){var r=new Set(n);return r.delete(e),r}),P(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r}),N(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r})},toggleDepth:function(e){T(function(n){var r=new Set(n);return r.has(e)?r.delete(e):r.add(e),r}),P(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r}),N(function(n){var r=new Map(n);return Array.from(r.entries()).forEach(function(n){n[1]===e&&r.delete(n[0])}),r})},setExpandedDepths:function(e){T(e)},getExpandedDepths:function(){return d},getGroupingProperty:function(e){return null==I?void 0:I[e]},getGroupingDepth:function(e){var n;return null!==(n=null==I?void 0:I.indexOf(e))&&void 0!==n?n:-1},toggleColumnEditor:function(e){c&&E(void 0!==e?e:function(e){return!e})},applyColumnVisibility:Jn(function(e){var n=function(r){return r.map(function(r){var t=r.accessor+"",o=t in e;return exports.__assign(exports.__assign({},r),{hide:o?!e[t]:r.hide,children:r.children?n(r.children):r.children})})};A(function(e){return n(e)}),m&&m(e)}),resetColumns:s,setQuickFilter:function(e){(null==y?void 0:y.onChange)&&y.onChange(e)}})},[r,t,o,l,s,c,d,f,v,p,h,w,m,g,x,y,I,e.rowIndexMap,C,M,e.serverSidePagination,N,E,k,T,P,A,e.setRows,e.shouldPaginate,D,F,O,L,W,B])}({cellRegistryRef:ho,clearAllFilters:qt,clearFilter:zt,currentPage:Wr,resetColumns:Oo,editColumns:W,expandedDepths:vt,filters:Wt,flattenedRows:Jt,headerRegistryRef:wo,headers:it,includeHeadersInCSVExport:Ee,onColumnVisibilityChange:Ge,onPageChange:Ye,paginatableRows:Xt,quickFilter:en,rowGrouping:rn,rowIndexMap:br,rows:Fr,rowsPerPage:ln,serverSidePagination:pn,setCollapsedRows:bt,setColumnEditorOpen:et,setCurrentPage:Br,setExpandedDepths:pt,setExpandedRows:mt,setHeaders:Dt,setRows:hr,shouldPaginate:wn,sort:jt,tableRef:yn,totalRowCount:Rn,updateFilter:Bt,updateSort:Kt,visibleRows:io}),function(e){var r=e.filters,t=e.onFilterChange;n.useEffect(function(){null==t||t(r)},[r,t])}({filters:Wt,onFilterChange:je}),function(e){var r=e.sort,t=e.onSortChange,o=Ne(r);n.useEffect(function(){!r||(null==o?void 0:o.key.accessor)===r.key.accessor&&(null==o?void 0:o.direction)===r.direction?!r&&o&&(null==t||t(null)):null==t||t(r)},[r,o,t])}({sort:jt,onSortChange:Qe});var Lo=n.useCallback(function(e){ao(e),setTimeout(function(){Bt(e)},0)},[ao,Bt]),Wo=!mr&&0===oo.length;return e.jsx(_,exports.__assign({value:{activeHeaderDropdown:Xr,allowAnimations:o,areAllRowsSelected:Rr,autoExpandColumns:c,canExpandRowGroup:d,cellRegistry:ho.current,cellUpdateFlash:v,clearSelection:kr,collapsedHeaders:tt,columnBorders:m,columnEditorConfig:Wn,columnReordering:C,columnResizing:k,containerWidth:St,columnsWithSelectedCells:To,copyHeadersToClipboard:D,draggedHeaderRef:$n,editColumns:W,emptyStateRenderer:V,enableHeaderEditing:J,enableRowSelection:te,errorStateRenderer:ue,expandedDepths:vt,filters:Wt,icons:On,forceUpdate:sr,getBorderClass:go,handleApplyFilter:Lo,handleClearAllFilters:qt,handleClearFilter:zt,handleMouseDown:xo,handleMouseOver:bo,handleRowSelect:Nr,handleSelectAll:Hr,handleToggleRow:Er,headerContainerRef:lr,headerDropdown:ge,headerHeight:zn,headerRegistry:wo.current,headers:it,heightOffsets:vo,hoveredHeaderRef:Qn,includeHeadersInCSVExport:Ee,isAnimating:lo,isCopyFlashing:yo,isInitialFocusedCell:Io,isLoading:mr,isResizing:jr,isRowSelected:Cr,isScrolling:_r,isSelected:Co,isWarningFlashing:Ro,loadingStateRenderer:Fe,mainBodyRef:tr,maxHeaderDepth:Nt,onCellClick:We,onCellEdit:Be,onColumnOrderChange:ze,onColumnSelect:qe,onColumnVisibilityChange:Ge,onColumnWidthChange:Ve,onHeaderEdit:Ue,onLoadMore:_e,onRowGroupExpand:Xe,onSort:Do,onTableHeaderDragEnd:Fo,resetColumns:Oo,pinnedLeftRef:or,pinnedRightRef:ir,rowButtons:nn,rowGrouping:rn,rowHeight:Bn,rowStateMap:dr,rows:pr,rowsWithSelectedCells:Po,scrollbarWidth:Pr,selectColumns:So,selectableColumns:fn,selectedColumns:No,selectedRowCount:Sr,selectedRows:yr,selectedRowsData:Mr,setActiveHeaderDropdown:$r,setCollapsedHeaders:ot,setHeaders:Dt,setInitialFocusedCell:Ho,setIsResizing:Kr,setIsScrolling:Jr,setRowStateMap:fr,setSelectedCells:Eo,setSelectedColumns:ko,setSelectedRows:Ir,setExpandedDepths:pt,setExpandedRows:mt,setCollapsedRows:bt,shouldPaginate:wn,tableBodyContainerRef:ar,tableEmptyStateRenderer:bn,tableRows:oo,theme:Cn,customTheme:Ln,expandedRows:wt,collapsedRows:xt,useHoverRowBackground:Mn,useOddColumnBackground:Hn,useOddEvenRowBackground:Pn}},{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(Cn," ").concat(null!=p?p:""," ").concat(m?"st-column-borders":""),role:"grid",style:Oe?{maxHeight:Oe,height:void 0===ro?"auto":Oe}:be?{height:be}:{}},{children:[e.jsx(Vn,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(kn,{calculatedHeaderHeight:Mt,hideHeader:Re,pinnedLeftWidth:kt,pinnedRightWidth:Tt,setScrollTop:lt,setScrollDirection:dt,shouldShowEmptyState:Wo,sort:jt,tableRows:oo,rowsToRender:io,stickyParents:so,regularRows:co,partiallyVisibleRows:fo,heightMap:po}),e.jsx(Gn,{columnEditorConfig:Wn,editColumns:W,headers:qr,open:Zr,setOpen:et})]})),!Wo&&e.jsx(Tn,{mainBodyRef:tr,mainBodyWidth:Et,pinnedLeftWidth:kt,pinnedRightWidth:Tt,pinnedLeftContentWidth:Pt,pinnedRightContentWidth:At,tableBodyContainerRef:ar}),!Wo&&e.jsx(Y,{currentPage:Wr,footerRenderer:we,hideFooter:Ie,onPageChange:Br,onNextPage:Je,onUserPageChange:Ye,rowsPerPage:ln,shouldPaginate:wn,totalPages:Math.ceil((null!=Rn?Rn:Xt.length)/ln),totalRows:null!=Rn?Rn:Xt.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:It}))]}))}))},cr=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,s=n.fillOpacity,c=void 0===s?.25:s,d=n.strokeWidth,f=void 0===d?1.5:d,v=n.className,p=void 0===v?"":v,h=n.min,w=n.max;if(!r||0===r.length)return null;var m=void 0!==h?h:Math.min.apply(Math,r),g=(void 0!==w?w:Math.max.apply(Math,r))-m||1,x=a,b=r.map(function(e,n){return{x:n/(r.length-1)*100,y:x-(e-m)/g*x}}).map(function(e,n){return"".concat(0===n?"M":"L"," ").concat(e.x,",").concat(e.y)}).join(" "),y="\n ".concat(b,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(p),style:{display:"block"},shapeRendering:"geometricPrecision"},{children:[e.jsx("path",{d:y,fill:l||"var(--st-chart-fill-color)",fillOpacity:c,stroke:"none"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round"})]}))},dr=Object.freeze({__proto__:null,default:cr}),fr=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,s=void 0===l?2:l,c=n.className,d=void 0===c?"":c,f=n.min,v=n.max;if(!r||0===r.length)return null;var p=void 0!==f?f:Math.min.apply(Math,r),h=void 0!==v?v:Math.max.apply(Math,r),w=h-p||1,m=a,g=(100-s*(r.length-1))/r.length,x=0>p,b=x?m*(h/w):m;return e.jsx("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(m),preserveAspectRatio:"none",className:"st-bar-chart ".concat(d),style:{display:"block"},shapeRendering:"crispEdges"},{children:r.map(function(n,r){var t=r*(g+s),o=(n-p)/w*m,i=m-o,a=o;return x&&(0>n?(a=Math.abs(n)/w*m,i=b):i=b-(a=n/w*m)),e.jsx("rect",{x:t,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:.5},r)})}))},vr=Object.freeze({__proto__:null,default:fr});exports.ANIMATION_CONFIGS=Xn,exports.AngleDownIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,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"})}))},exports.AngleLeftIcon=X,exports.AngleRightIcon=$,exports.AngleUpIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,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"})}))},exports.AscIcon=Q,exports.BarChart=fr,exports.CheckIcon=Z,exports.DescIcon=ee,exports.DragIcon=ne,exports.FilterIcon=re,exports.LineAreaChart=cr,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=te,exports.SimpleTable=lr,exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,r=e.options;return i(void 0,void 0,void 0,function(){var e,t,o,i,u,l,s,c,d,f,v,p,h,w,m,g;return a(this,function(a){return e=r.startY,t=r.endY,o=r.finalY,u=void 0===(i=r.duration)?300:i,s=void 0===(l=r.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(c=r.delay)?0:c,f=r.onComplete,p=void 0===(v=r.respectReducedMotion)||v,Yn()&&p?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(h=n.getBoundingClientRect(),m=e-(w=h.top),g=t-w,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.style.transition="transform ".concat(u,"ms ").concat(s),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(g,"px, 0)");var r=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",r),f&&f(),e()};n.addEventListener("transitionend",r),setTimeout(r,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,r=e.finalConfig,t=e.fromBounds,o=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){return{x:("x"in e?e.x:e.left)-n.x,y:("y"in e?e.y:e.top)-n.y}}(t,o),0===e.x&&0===e.y||Yn()&&!1!==r.respectReducedMotion?[2]:(u=r,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=Yn()?exports.__assign(exports.__assign({},Xn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},Xn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},Xn.ROW_REORDER),u),$n(n),function(e,n){e.style.transform="translate3d(".concat(n.x,"px, ").concat(n.y,"px, 0)"),e.style.transition="none",e.style.willChange="transform",e.style.backfaceVisibility="hidden",e.classList.add("st-animating")}(n,e),[4,Qn(n,i,r)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=Ne,exports.useTableContext=J;
2
+ //# sourceMappingURL=index-7cf6c550.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-7cf6c550.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -34,9 +34,9 @@ import { RowButtonProps } from "./types/RowButton";
34
34
  import FooterRendererProps from "./types/FooterRendererProps";
35
35
  import { LoadingStateRenderer, ErrorStateRenderer, EmptyStateRenderer, LoadingStateRendererProps, ErrorStateRendererProps, EmptyStateRendererProps } from "./types/RowStateRendererProps";
36
36
  import { CustomTheme } from "./types/CustomTheme";
37
- import { ColumnEditorConfig, ColumnEditorSearchFunction } from "./types/ColumnEditorConfig";
37
+ import { ColumnEditorConfig, ColumnEditorCustomRenderer, ColumnEditorCustomRendererProps, ColumnEditorSearchFunction } from "./types/ColumnEditorConfig";
38
38
  import { IconsConfig } from "./types/IconsConfig";
39
39
  import { GetRowId, GetRowIdParams } from "./types/GetRowId";
40
40
  export { SimpleTable, LineAreaChart, BarChart };
41
41
  export * from "./icons";
42
- export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorRowRenderer, ColumnEditorRowRendererComponents, ColumnEditorRowRendererProps, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowSelectionChangeProps, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SortColumn, TableCellProps, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
42
+ export type { Accessor, AggregationConfig, AggregationType, BoundingBox, Cell, CellChangeProps, CellClickProps, CellRenderer, CellRendererProps, CellValue, ChartOptions, ColumnEditorConfig, ColumnEditorCustomRenderer, ColumnEditorCustomRendererProps, ColumnEditorRowRenderer, ColumnEditorRowRendererComponents, ColumnEditorRowRendererProps, ColumnEditorSearchFunction, ColumnType, ColumnVisibilityState, Comparator, ComparatorProps, CustomTheme, DragHandlerProps, EmptyStateRenderer, EmptyStateRendererProps, EnumOption, ErrorStateRenderer, ErrorStateRendererProps, ExportToCSVProps, ExportValueGetter, ExportValueProps, FilterCondition, FooterRendererProps, GetRowId, GetRowIdParams, IconsConfig, LoadingStateRenderer, LoadingStateRendererProps, HeaderDropdown, HeaderDropdownProps, HeaderObject, HeaderRenderer, HeaderRendererProps, HeaderRendererComponents, OnRowGroupExpandProps, OnSortProps, QuickFilterConfig, QuickFilterGetter, QuickFilterGetterProps, QuickFilterMode, Row, RowButtonProps, RowSelectionChangeProps, RowState, SetHeaderRenameProps, SharedTableProps, ShowWhen, SortColumn, TableCellProps, TableFilterState, TableHeaderProps, TableRefType, TableRowProps, Theme, UpdateDataProps, ValueFormatter, ValueFormatterProps, ValueGetter, ValueGetterProps, };
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-822400eb.js");require("react/jsx-runtime"),require("react"),exports.AngleDownIcon=e.AngleDownIcon,exports.AngleLeftIcon=e.AngleLeftIcon,exports.AngleRightIcon=e.AngleRightIcon,exports.AngleUpIcon=e.AngleUpIcon,exports.AscIcon=e.AscIcon,exports.BarChart=e.BarChart,exports.CheckIcon=e.CheckIcon,exports.DescIcon=e.DescIcon,exports.DragIcon=e.DragIcon,exports.FilterIcon=e.FilterIcon,exports.LineAreaChart=e.LineAreaChart,exports.SelectIcon=e.SelectIcon,exports.SimpleTable=e.SimpleTable;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-7cf6c550.js");require("react/jsx-runtime"),require("react"),exports.AngleDownIcon=e.AngleDownIcon,exports.AngleLeftIcon=e.AngleLeftIcon,exports.AngleRightIcon=e.AngleRightIcon,exports.AngleUpIcon=e.AngleUpIcon,exports.AscIcon=e.AscIcon,exports.BarChart=e.BarChart,exports.CheckIcon=e.CheckIcon,exports.DescIcon=e.DescIcon,exports.DragIcon=e.DragIcon,exports.FilterIcon=e.FilterIcon,exports.LineAreaChart=e.LineAreaChart,exports.SelectIcon=e.SelectIcon,exports.SimpleTable=e.SimpleTable;
2
2
  //# sourceMappingURL=index.js.map