simple-table-core 2.1.9 → 2.2.0

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 (51) hide show
  1. package/dist/{Animate-2d4d1e23.js → Animate-eba636cf.js} +2 -2
  2. package/dist/Animate-eba636cf.js.map +1 -0
  3. package/dist/{DatePicker-46df397c.js → DatePicker-6d2d5608.js} +2 -2
  4. package/dist/DatePicker-6d2d5608.js.map +1 -0
  5. package/dist/cjs/{Animate-2ccc551b.js → Animate-878a7aea.js} +2 -2
  6. package/dist/cjs/Animate-878a7aea.js.map +1 -0
  7. package/dist/cjs/{DatePicker-822f2965.js → DatePicker-e468a75e.js} +2 -2
  8. package/dist/cjs/DatePicker-e468a75e.js.map +1 -0
  9. package/dist/cjs/components/simple-table/SimpleTable.d.ts +0 -1
  10. package/dist/cjs/context/TableContext.d.ts +0 -1
  11. package/dist/cjs/hooks/useFlattenedRows.d.ts +1 -2
  12. package/dist/cjs/hooks/useKeyboardNavigation.d.ts +1 -3
  13. package/dist/cjs/hooks/useRowSelection.d.ts +4 -6
  14. package/dist/cjs/hooks/useSelection.d.ts +1 -2
  15. package/dist/cjs/hooks/useTableAPI.d.ts +1 -2
  16. package/dist/cjs/hooks/useTableRowProcessing.d.ts +1 -2
  17. package/dist/cjs/index-0bd94a48.js +2 -0
  18. package/dist/cjs/index-0bd94a48.js.map +1 -0
  19. package/dist/cjs/index.js +1 -1
  20. package/dist/cjs/types/CellClickProps.d.ts +0 -2
  21. package/dist/cjs/types/OnRowGroupExpandProps.d.ts +0 -1
  22. package/dist/cjs/types/RowButton.d.ts +0 -1
  23. package/dist/cjs/utils/cellClipboardUtils.d.ts +2 -3
  24. package/dist/cjs/utils/rowSelectionUtils.d.ts +8 -7
  25. package/dist/cjs/utils/rowUtils.d.ts +10 -18
  26. package/dist/components/simple-table/SimpleTable.d.ts +0 -1
  27. package/dist/context/TableContext.d.ts +0 -1
  28. package/dist/hooks/useFlattenedRows.d.ts +1 -2
  29. package/dist/hooks/useKeyboardNavigation.d.ts +1 -3
  30. package/dist/hooks/useRowSelection.d.ts +4 -6
  31. package/dist/hooks/useSelection.d.ts +1 -2
  32. package/dist/hooks/useTableAPI.d.ts +1 -2
  33. package/dist/hooks/useTableRowProcessing.d.ts +1 -2
  34. package/dist/index-84d0a21e.js +2 -0
  35. package/dist/index-84d0a21e.js.map +1 -0
  36. package/dist/index.es.js +1 -1
  37. package/dist/types/CellClickProps.d.ts +0 -2
  38. package/dist/types/OnRowGroupExpandProps.d.ts +0 -1
  39. package/dist/types/RowButton.d.ts +0 -1
  40. package/dist/utils/cellClipboardUtils.d.ts +2 -3
  41. package/dist/utils/rowSelectionUtils.d.ts +8 -7
  42. package/dist/utils/rowUtils.d.ts +10 -18
  43. package/package.json +1 -1
  44. package/dist/Animate-2d4d1e23.js.map +0 -1
  45. package/dist/DatePicker-46df397c.js.map +0 -1
  46. package/dist/cjs/Animate-2ccc551b.js.map +0 -1
  47. package/dist/cjs/DatePicker-822f2965.js.map +0 -1
  48. package/dist/cjs/index-1258c9e1.js +0 -2
  49. package/dist/cjs/index-1258c9e1.js.map +0 -1
  50. package/dist/index-9b26781f.js +0 -2
  51. package/dist/index-9b26781f.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("react/jsx-runtime"),n=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n);function o(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);r.length>o;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function i(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,u)}l((r=r.apply(e,n||[])).next())})}function a(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=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(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=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++,r=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],r=0}finally{t=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,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;i>o;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;r>t;t++)for(var o in n=arguments[t])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))},c=30,s=function(e){return 480>e?.3:768>e?.4:.8},d="parentExpanded",f=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;a.length>i;i++)o=r(a[i],o);return o};return r(e,n),t},v=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,v(e.children)),n})},p=function(e){return void 0===e&&(e=0),e?e+1:0},h=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},w=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||n.excludeFromRender||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&function(e,n,t){var r=function(e,n){for(var t=0,r=v(e);r.length>t;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);if(r){var o=t.has(r.accessor),i=e.showWhen||d;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,r,o))||null},m=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},x=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||d;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return x(e,n)}):e.children.filter(function(e){var n=e.showWhen||d;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return x(e,n)}):[e]},g=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(h({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},b=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(h({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){b(e)})},y=function(e){return"number"==typeof e.minWidth?e.minWidth:40},C=function(e,n){var t=[];return e.forEach(function(e){e.hide||t.push.apply(t,x(e,n))}),t},I=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 t=n+"";return t.includes(".")||t.includes("[")?t.split(".").reduce(function(e,n){if(null!=e){var t=I(n),r=t.index,o=e[t.key];return null!==r&&Array.isArray(o)&&(o=o[r]),o}},e):e[n]},S=function(e,n,t){var r=n+"";if(r.includes(".")||r.includes("[")){for(var o=r.split("."),i=e,a=0;o.length-1>a;a++){var u=I(o[a]),l=u.key,c=u.index;if(null==i[l]){var s=I(o[a+1]);i[l]=null!==s.index?[]:{}}if(i=i[l],null!==c){if(!Array.isArray(i))throw Error("Expected array at ".concat(o.slice(0,a+1).join("."),", but found ").concat(typeof i));for(;c>=i.length;)i.push(null);null==i[c]&&(i[c]={}),i=i[c]}}var d=I(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]=t}else i[f]=t}else e[n]=t},M=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},N=function(e){return e.join("-")},E=function(e,n){var t=e[n];return M(t)?t:[]},H=function(e,n,t,r,o){var i=e+"",a=r.has(i)&&r.get(i)===n,u=o.has(i)&&o.get(i)===n;return t.has(n)?!u:a},k=function(e){var n=e.depth,t=e.expandedDepths,r=e.expandedRows,o=e.collapsedRows,i=e.rowGrouping,a=void 0===i?[]:i,l=e.displayPositionOffset,c=void 0===l?0:l,s=e.rowStateMap,d=e.hasLoadingRenderer,f=void 0!==d&&d,v=e.hasErrorRenderer,p=void 0!==v&&v,h=e.hasEmptyRenderer,w=void 0!==h&&h,m=[],x=function(e,n,i,l,d){void 0===i&&(i=0),void 0===l&&(l=c),void 0===d&&(d=[]);var v=i,h=l;return e.forEach(function(i,l){var c=a[n],g=u(u([],d,!0),[l],!1),b=N(g);if(m.push({row:i,depth:n,displayPosition:h,groupingKey:c,position:v,isLastGroupRow:0===n&&l===e.length-1,rowPath:g,absoluteRowIndex:v}),v++,h++,H(b,n,t,r,o)&&a.length>n){var y=null==s?void 0:s.get(b),C=E(i,c);if(y&&(y.loading||y.error||y.isEmpty))y.loading&&f||y.error&&p||y.isEmpty&&w?(m.push({row:{},depth:n+1,displayPosition:h,groupingKey:c,position:v,isLastGroupRow:!1,rowPath:u(u([],g,!0),[c],!1),stateIndicator:{parentRowId:b,state:y},absoluteRowIndex:v}),v++,h++):y.loading&&!f&&(m.push({row:{},depth:n+1,displayPosition:h,groupingKey:c,position:v,isLastGroupRow:!1,rowPath:u(u([],g,!0),[c,"loading-skeleton"],!1),isLoadingSkeleton:!0,absoluteRowIndex:v}),v++,h++);else if(C.length>0){var I=u(u([],g,!0),[c],!1);v=x(C,n+1,v,h,I)}}}),v};return x(e.rows,void 0===n?0:n,0,c),m},T=function(e){var n=e.contentHeight,t=e.scrollTop,r=e.tableRows,o=e.scrollDirection,i=void 0===o?"none":o,a=e.rowHeight+1,u=e.bufferRowCount*a,l=u,c=u;"down"===i?(l=Math.max(a,.1*u),c=.9*u):"up"===i&&(l=.9*u,c=Math.max(a,.1*u));var s=t+n+c,d=Math.max(0,Math.floor(Math.max(0,t-l)/a)),f=Math.min(r.length,Math.ceil(s/a)),v=t+n,p=Math.max(0,Math.ceil(t/a)),h=Math.min(r.length,Math.floor(v/a)),w=t+n,m=Math.max(0,Math.floor(t/a)),x=Math.min(r.length,Math.ceil(w/a));return{rendered:{startIndex:d,endIndex:f,rows:r.slice(d,f)},fullyVisible:{startIndex:p,endIndex:h,rows:r.slice(p,h)},partiallyVisible:{startIndex:m,endIndex:x,rows:r.slice(m,x)}}},A=function(e){return T({bufferRowCount:e.bufferRowCount,contentHeight:e.contentHeight,rowHeight:e.rowHeight,scrollTop:e.scrollTop,tableRows:e.tableRows,scrollDirection:e.scrollDirection}).rendered.rows},D=function(e){return e.position*(e.rowHeight+1)-1},F=function(e){return e.position*(e.rowHeight+1)},P=function(e,n,t){var r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>r.top?n.scrollTop-=o.top-r.top+i:r.bottom>o.bottom-i&&(n.scrollTop+=r.bottom-o.bottom+i),t){var a=t.getBoundingClientRect();a.left+i>r.left?t.scrollLeft-=a.left-r.left+i:r.right>a.right-i&&(t.scrollLeft+=r.right-a.right+i)}},L=function(e,n,t){var r=document.querySelector(".st-body-container"),o=document.querySelector(".st-body-main");if(r){var i=n+1,a=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));if(a&&t){var u=function(e,n,t,r){var o=T({bufferRowCount:0,contentHeight:n.clientHeight,rowHeight:t,scrollTop:n.scrollTop,tableRows:r,scrollDirection:"none"}).fullyVisible;return e>=o.startIndex&&o.endIndex>e}(e.rowIndex,r,n,t);if(u)return void P(a,r,o)}if(!a)return r.scrollTop=Math.max(0,e.rowIndex*i-r.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&&P(n,r,o)},100);P(a,r,o)}},O=function(e){var n=e.colIndex,t=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(t)},W=n.createContext(void 0),B=function(n){return e.jsx(W.Provider,exports.__assign({value:n.value},{children:n.children}))},q=function(){var e=n.useContext(W);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},z=function(t){var r=t.currentPage,o=t.footerRenderer,u=t.hideFooter,l=t.onPageChange,c=t.onNextPage,s=t.onUserPageChange,d=t.rowsPerPage,f=t.shouldPaginate,v=t.totalPages,p=t.totalRows,h=q(),w=h.nextIcon,m=h.prevIcon,x=n.useState(!0),g=x[0],b=x[1],y=r>1,C=v>r,I=r===v,R=Math.min((r-1)*d+1,p),S=Math.min(r*d,p),M=!y,N=!C&&!c||!g&&I,E=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=r-1)?[3,2]:(l(e),s?[4,s(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},H=function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(t){switch(t.label){case 0:return e=r===v,n=r+1,c&&e?[4,c(r)]:[3,2];case 1:if(!t.sent())return b(!1),[2];t.label=2;case 2:return n>v&&!c?[3,4]:(l(n),s?[4,s(n)]:[3,4]);case 3:t.sent(),t.label=4;case 4:return[2]}})})},k=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),s?[4,s(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:r,totalPages:v,rowsPerPage:d,totalRows:p,startRow:R,endRow:S,onPageChange:k,onNextPage:H,onPrevPage:E,hasNextPage:!N,hasPrevPage:!M,nextIcon:w,prevIcon:m})});var T=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,t=[];r>8?v-7>r?(e=r-7,n=r+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14);for(var o=e;n>=o;o++)t.push(o);return v-1>n&&(t.push(-1),t.push(v)),t}();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 ",R," to ",S," of ",p.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[T.map(function(n,t){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),t):e.jsx("button",exports.__assign({onClick:function(){return k(n)},className:"st-page-btn ".concat(r===n?"active":""),"aria-label":"Go to page ".concat(n),"aria-current":r===n?"page":void 0},{children:n}),t)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(M?"disabled":""),onClick:E,disabled:M,"aria-label":"Go to previous page"},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(N?"disabled":""),onClick:H,disabled:N,"aria-label":"Go to next page"},{children:w}))]}))]}))},G=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"})}))},j=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"})}))},K=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"})}))},V=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"})}))},_=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"})}))},U=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"})}))},J=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"})}))},X=function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[t,a,o]),n.useEffect(function(){var e=null==r?void 0:r.current;if(e&&(null==t?void 0:t.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)}}},[t,r]),{isMainSectionScrollable:a}},Y=function(t){var r=t.children,o=t.onClose,i=t.open,a=t.overflow,u=void 0===a?"auto":a,l=t.setOpen,c=t.width,s=t.containerRef,d=t.positioning,f=void 0===d?"fixed":d,v=q().mainBodyRef,p=n.useRef(null),h=n.useRef(null),w=n.useState("bottom-left"),m=w[0],x=w[1],g=n.useState({}),b=g[0],y=g[1],C=n.useState(!1),I=C[0],R=C[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,t=h.current.getBoundingClientRect(),r=n.offsetHeight,o=c||n.offsetWidth,i=(e=(null==s?void 0:s.current)?s.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-t.bottom,a=t.top-e.top,u="bottom",l={};(r>i&&a>=r||r>i&&a>i)&&(u="top");var d="left";o>e.right-t.right+t.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===d?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===u?l.top=t.height+4:l.bottom=t.height+4,"left"===d?l.left=0:l.right=0),x("".concat(u,"-").concat(d)),y(l),R(!0)}})):i||R(!1)},[i,c,s,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:c?"".concat(c,"px"):"auto",visibility:I?"visible":"hidden"},b),{overflow:u})},{children:r})):null},$=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,c=void 0===l?"":l;return e.jsx("div",exports.__assign({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(u?"disabled":""," ").concat(c),onClick:function(){!u&&r&&r()},role:"option","aria-selected":i,"aria-disabled":u},{children:t}))},Z=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=n.useState(t.value),l=u[0],c=u[1],s=function(e){c(e),o(e),a(!1),r()};return e.jsxs(Y,exports.__assign({open:i,onClose:function(){r()},setOpen:a,width:120},{children:[e.jsx($,exports.__assign({isSelected:!0===l,onClick:function(){return s(!0)}},{children:"True"})),e.jsx($,exports.__assign({isSelected:!1===l,onClick:function(){return s(!1)}},{children:"False"}))]}))},Q=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},ee=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+r,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()}})},ne=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-878a7aea.js")})}),te=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-e468a75e.js")})}),re=n.lazy(function(){return Promise.resolve().then(function(){return qn})}),oe=n.lazy(function(){return Promise.resolve().then(function(){return Gn})}),ie=function(t){var r=o(t,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},r))},{children:e.jsx(ne,exports.__assign({},t))}))},ae=function(t){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(te,exports.__assign({},t))}))},ue=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(re,exports.__assign({},t))}))},le=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(oe,exports.__assign({},t))}))},ce=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 t=new Date(e);return isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate(),12,0,0)},se=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},de=function(e){if(!e)return new Date;if("string"==typeof e)return ce(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:se(n)}return e instanceof Date?se(e):new Date},fe=function(e){return e?ce(""+e):new Date},ve=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=t.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(){r()};return e.jsx(Y,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(ae,{value:fe(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),r()},onClose:l})}))},pe=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.options,u=t.setOpen,l=n.useState(t.value||""),c=l[0],s=l[1];return e.jsx(Y,exports.__assign({open:i,onClose:function(){r()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx($,exports.__assign({isSelected:c===n.value,onClick:function(){return s(e=n.value),o(e),u(!1),void r();var e}},{children:n.label}),n.value)})}))}))},he=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,c=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(Z,{onBlur:c,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(ve,{onBlur:c,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(pe,{onBlur:c,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(ee,{defaultValue:l,onBlur:c,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(Q,{defaultValue:null==l?"":l+"",onBlur:c,onChange:o})},we=0,me=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();0!==we&&r>o-we||(we=o,n(t))}},xe=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},ge=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ge);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=ge(e[t]));return n},be=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},ye=Date.now(),Ce={screenX:0,screenY:0},Ie=function(e,n,t){void 0===t&&(t=[]);for(var r=0;e.length>r;r++){var o=e[r];if(o.accessor===n)return u(u([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=Ie(o.children,n,u(u([],t,!0),[r],!1));if(i)return i}}return null},Re=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};var Se=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=q().setHeaders,l=xe(t);return{handleDragStart:function(e){n.current=e,ye=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),c=o.screenX,s=o.screenY,d=Math.sqrt(Math.pow(c-Ce.screenX,2)+Math.pow(s-Ce.screenY,2));r.current=a;var f,v=n.current,p=!1;if(Re(v)!==Re(a))f=(C=function(e,n,t){var r,o,i=ge(e),a=!1;try{var u=Re(t),l=i.findIndex(function(e){return e.accessor===n.accessor}),c=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===l||-1===c)return{newHeaders:i,emergencyBreak:a=!0};var s=i.splice(l,1)[0],d=(r=u,o=exports.__assign({},s),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o);i.splice(c,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}(t,v,a)).newHeaders,p=C.emergencyBreak;else{var h=t,w=Ie(h,v.accessor),m=Ie(h,a.accessor);if(!w||!m)return;var x=w.length,g=m.length,b=m;if(x!==g){var y=g-x;y>0&&(b=m.slice(0,-y))}var C=function(e,n,t){var r=ge(e),o=!1;function i(e,n){for(var t=e,r=0;n.length-1>r;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;n.length-1>i;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var u=i(r,n);return a(r,n,i(r,t)),a(r,t,u),{newHeaders:r,emergencyBreak:o}}(h,w,b);f=C.newHeaders,p=C.emergencyBreak}if(!(u||a.accessor===v.accessor||10>d||JSON.stringify(f)===JSON.stringify(t)||p)){var I=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>I-ye||40>d)||(ye=I,Ce={screenX:c,screenY:s},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(t)},10)}}},Me=function(n){var t=n.checked,r=void 0!==t&&t,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){i&&i(!r)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":n.ariaLabel,"aria-checked":r}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(r?"st-checked":""),"aria-hidden":"true"},{children:r&&e.jsx(V,{className:"st-checkbox-checkmark"})})),o]}))},Ne=function(n){var t,r=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:r}):"lineAreaChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(ue,exports.__assign({data:t},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(le,exports.__assign({data:t},o.chartOptions)):null:"boolean"==typeof r?r?"True":"False":Array.isArray(r)?0===r.length?"[]":r.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==r&&("string"==typeof r||"number"==typeof r||"object"==typeof r&&r instanceof Date)?de(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):r},Ee=r.default.memo(function(t){var r=t.borderClass,o=t.colIndex,i=t.displayRowNumber,a=t.header,u=t.isHighlighted,l=t.isInitialFocused,c=t.nestedIndex,s=t.parentHeader,d=t.rowIndex,f=t.tableRow,v=q(),p=v.canExpandRowGroup,w=v.cellRegistry,x=v.cellUpdateFlash,g=v.collapsedRows,b=v.columnBorders,y=v.draggedHeaderRef,C=v.enableRowSelection,I=v.expandedDepths,E=v.expandedRows,k=v.expandIcon,T=v.handleMouseDown,A=v.handleMouseOver,D=v.handleRowSelect,F=v.headers,P=v.hoveredHeaderRef,L=v.isCopyFlashing,O=v.isLoading,W=v.isRowSelected,B=v.isWarningFlashing,z=v.onCellEdit,G=v.onCellClick,j=v.onRowGroupExpand,K=v.onTableHeaderDragEnd,V=v.rowButtons,_=v.rowGrouping,U=v.setCollapsedRows,J=v.setExpandedRows,X=v.setRowStateMap,Y=v.rowsWithSelectedCells,$=v.selectedColumns,Z=v.tableBodyContainerRef,Q=v.theme,ee=v.useOddColumnBackground,ne=f.depth,te=f.row,re=f.rowPath,oe=f.absoluteRowIndex,ae=n.useState(R(te,a.accessor)),ue=ae[0],le=ae[1],ce=n.useState(!1),se=ce[0],de=ce[1],fe=n.useState(!1),ve=fe[0],pe=fe[1],we=n.useState(!1),xe=we[0],ge=we[1],be=n.useRef(null),ye=N(re||[oe]),Ce=_&&_[ne],Ie=!!Ce&&function(e,n){return!!n&&M(e[n])}(te,Ce),Re=_&&_.length>ne,Ee=!p||p(te),He=H(ye,ne,I,E,g),ke=L({rowIndex:d,colIndex:o,rowId:ye}),Te=B({rowIndex:d,colIndex:o,rowId:ye}),Ae=n.useMemo(function(){var e,n,t;if(!b)return!1;var r=F.filter(function(e){return"left"===e.pinned}),o=F.filter(function(e){return!e.pinned}),i=F.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.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===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[b,F,a.accessor,a.pinned]),De=Se({draggedHeaderRef:y,headers:F,hoveredHeaderRef:P,onTableHeaderDragEnd:K}).handleDragOver,Fe=me(),Pe=h({accessor:a.accessor,rowId:ye}),Le=m({rowId:ye,accessor:a.accessor}),Oe=a.isSelectionColumn&&C;n.useEffect(function(){if(w){var e="".concat(ye,"-").concat(a.accessor);return w.set(e,{updateContent:function(e){ue!==e?(le(e),x&&(pe(!0),be.current&&clearTimeout(be.current),be.current=setTimeout(function(){pe(!1)},800))):le(e)}}),function(){w.delete(e),be.current&&clearTimeout(be.current)}}},[w,x,ye,a.accessor,ue]),n.useEffect(function(){if(ve){var e=setTimeout(function(){pe(!1)},850);return function(){return clearTimeout(e)}}},[ve]),n.useEffect(function(){le(R(te,a.accessor))},[te,a.accessor]);var We="boolean"===a.type||"date"===a.type||"enum"===a.type,Be=!!(null==a?void 0:a.isEditable),qe=$.has(o),ze=u&&!qe,Ge=n.useMemo(function(){return!!Oe&&Y.has(ye+"")},[Oe,Y,ye]),je=null==s?void 0:s.singleRowChildren,Ke="st-cell ".concat(ne>0&&a.expandable?"st-cell-depth-".concat(ne):""," ").concat(ze?l?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(qe?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Be?"clickable":""," ").concat(ve?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?c%2==0?"even-column":"odd-column":""," ").concat(Oe?"st-selection-cell":""," ").concat(Ge?"st-selection-has-highlighted-cell":""," ").concat(Ae?"st-last-column":""," ").concat(je?"st-sub-cell":""," ").concat(xe?"hovered":""),Ve=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),le(e),S(te,a.accessor,e),null==z||z({accessor:a.accessor,newValue:e,row:te,rowIndex:d})},[a.accessor,a.type,z,te,d]),_e=n.useCallback(function(e){e.stopPropagation();var n=H(ye,ne,I,E,g),t=ye+"";if(n?(U(function(e){var n=new Map(e);return n.set(t,ne),n}),J(function(e){var n=new Map(e);return n.delete(t),n})):(J(function(e){var n=new Map(e);return n.set(t,ne),n}),U(function(e){var n=new Map(e);return n.delete(t),n})),n&&X(function(e){var n=new Map(e);return n.delete(ye),n}),j){var r=a.pinned;j({depth:ne,event:e,groupingKey:Ce,groupingKeys:_||[],isExpanded:!n,row:te,rowIndexPath:re||[],setEmpty:function(e,n){X(function(t){var o=new Map(t),i=o.get(ye)||{};return o.set(ye,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:r})),o})},setError:function(e){X(function(n){var t=new Map(n),o=t.get(ye)||{};return t.set(ye,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:r})),t})},setLoading:function(e){X(function(n){var t=new Map(n),o=t.get(ye)||{};return t.set(ye,exports.__assign(exports.__assign({},o),{loading:e,error:null,isEmpty:!1,triggerSection:r})),t})}})}},[g,Ce,ne,I,E,a.pinned,j,te,_,ye,re,U,J,X]);return O||f.isLoadingSkeleton?e.jsx("div",exports.__assign({className:Ke},{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"})}))})):!se||We||Oe?e.jsxs(ie,exports.__assign({className:Ke,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":ye,"data-row-index":d,"aria-colindex":o+1,id:Pe,onClick:function(){G&&!Oe&&G({accessor:a.accessor,colIndex:o,row:te,rowIndex:d,value:ue})},onDoubleClick:function(){return a.isEditable&&!Oe&&de(!0)},onDragOver:function(e){Oe||Fe({callback:De,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){se||Oe||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||se||(e.preventDefault(),de(!0))},onMouseDown:function(){se||Oe||T({rowIndex:d,colIndex:o,rowId:ye})},onMouseEnter:function(){ge(!0)},onMouseLeave:function(){ge(!1)},onMouseOver:function(){se||Oe||A({rowIndex:d,colIndex:o,rowId:ye})},parentRef:Z,tableRow:f},{children:[a.expandable&&Re?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(Ee&&(Ie||j)?He?"expanded":"collapsed":"placeholder"),onClick:Ee&&(Ie||j)?function(e){return _e(e)}:void 0,role:Ee&&(Ie||j)?"button":"presentation",tabIndex:Ee&&(Ie||j)?0:-1,"aria-label":Ee&&(Ie||j)?"".concat(He?"Collapse":"Expand"," row group"):void 0,"aria-expanded":Ee&&(Ie||j)?He:void 0,"aria-hidden":!(Ee&&(Ie||j)),onKeyDown:Ee&&(Ie||j)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),_e(e))}:void 0},{children:k})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:O||f.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:Oe?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:xe||W&&W(ye+"")?e.jsx(Me,{checked:!!W&&W(ye+""),onChange:function(e){D&&D(ye+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!V||!Oe||0===V.length)return null;if(!(xe||W&&W(ye+"")))return null;var n={row:te,rowIndex:i};return e.jsx("div",exports.__assign({className:"st-row-buttons",role:"group","aria-label":"Actions for row ".concat(i+1)},{children:V.map(function(t,r){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?function(){var e;return a.cellRenderer({accessor:a.accessor,colIndex:o,row:te,rowIndex:oe,rowPath:re,theme:Q,value:ue,formattedValue:null===(e=null==a?void 0:a.valueFormatter)||void 0===e?void 0:e.call(a,{accessor:a.accessor,colIndex:o,row:te,rowIndex:d,value:ue})})}():Ne({content:ue,header:a,colIndex:o,row:te,rowIndex:d})})})),!O&&!f.isLoadingSkeleton&&se&&We&&!Oe&&e.jsx(he,{enumOptions:a.enumOptions,onChange:Ve,setIsEditing:de,type:a.type,value:ue})]}),Le):e.jsx("div",exports.__assign({className:"st-cell-editing",id:h({accessor:a.accessor,rowId:ye}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(he,{enumOptions:a.enumOptions,onChange:Ve,setIsEditing:de,type:a.type,value:ue})}))},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}),He=function(t){var r=t.columnIndices,o=t.displayRowNumber,i=t.header,a=t.headers,u=t.nestedIndex,l=t.parentHeader,c=t.pinned,s=t.rowIndex,d=t.rowIndices,f=t.tableRow,v=r[i.accessor],p=q(),m=p.getBorderClass,x=p.isSelected,g=p.isInitialFocusedCell,b=p.collapsedHeaders,y=N(f.rowPath||[f.position]);if(i.children&&i.children.length>0){var C=i.children.filter(function(e){return w({header:e,pinned:c,headers:a,collapsedHeaders:b})});if(i.singleRowChildren){var I={rowIndex:s,colIndex:v,rowId:y},R=m(I),S=x(I),M=g(I),E=h({accessor:i.accessor,rowId:y});return e.jsxs(n.Fragment,{children:[e.jsx(Ee,{borderClass:R,colIndex:v,displayRowNumber:o,header:i,isHighlighted:S,isInitialFocused:M,nestedIndex:u,parentHeader:l,rowIndex:s,tableRow:f},E),C.map(function(n){var t=h({accessor:n.accessor,rowId:y});return e.jsx(He,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:c,rowIndex:s,rowIndices:d,tableRow:f},t)})]})}return e.jsx(n.Fragment,{children:C.map(function(n){var t=h({accessor:n.accessor,rowId:y});return e.jsx(He,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:c,rowIndex:s,rowIndices:d,tableRow:f},t)})})}var H={rowIndex:s,colIndex:v,rowId:y},k=m(H),T=x(H),A=g(H),D=h({accessor:i.accessor,rowId:y});return e.jsx(Ee,{borderClass:k,colIndex:v,displayRowNumber:o,header:i,isHighlighted:T,isInitialFocused:A,nestedIndex:u,parentHeader:l,rowIndex:s,tableRow:f},D)},ke=r.default.memo(function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,c=n.tableRow,s=q().collapsedHeaders,d=o.filter(function(e){return w({header:e,pinned:i,headers:o,collapsedHeaders:s})});return e.jsx(e.Fragment,{children:d.map(function(n,s){var d=N(c.rowPath||[c.position]),f=h({accessor:n.accessor,rowId:d});return e.jsx(He,{columnIndices:r,displayRowNumber:u,header:n,headers:o,nestedIndex:s+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:c},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}),Te=function(n){var t=n.rowState,r=n.loadingStateRenderer,o=n.errorStateRenderer,i=n.emptyStateRenderer,a=null;return t.loading&&r?a=r:t.error&&o?a=o:t.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},Ae=r.default.memo(function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,u=n.pinned,l=n.rowHeight,c=n.rowIndices,s=n.setHoveredIndex,d=n.tableRow,f=q(),v=f.useHoverRowBackground,p=f.isAnimating,h=f.isRowSelected,w=f.useOddEvenRowBackground,m=f.rows,x=f.loadingStateRenderer,g=f.errorStateRenderer,b=f.emptyStateRenderer,y=f.maxHeaderDepth,C=d.position,I=d.displayPosition,R=d.stateIndicator;if(R){if(R.state.triggerSection===u){if(!(R.state.loading&&x||R.state.error&&g||R.state.isEmpty&&b))return e.jsx("div",{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(F({position:C,rowHeight:l}),"px, 0)"),height:"".concat(l,"px")}});var S=m.find(function(e,n){return N([n])===R.parentRowId});return e.jsx("div",exports.__assign({className:"st-row st-state-row","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(F({position:C,rowHeight:l}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(Te,{parentRow:S||{},rowState:R.state,gridTemplateColumns:o,loadingStateRenderer:x,errorStateRenderer:g,emptyStateRenderer:b})}))}return e.jsx("div",{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(F({position:C,rowHeight:l}),"px, 0)"),height:"".concat(l,"px")}})}var M=C%2==0,E=N(d.rowPath||[d.position]),H=!!h&&h(E+"");return e.jsx("div",exports.__assign({className:"st-row ".concat(w?M?"even":"odd":""," ").concat(H?"selected":""),"data-index":a,"aria-rowindex":C+y+1,onMouseEnter:function(){!p&&v&&s(a)},style:{gridTemplateColumns:o,top:F({position:C,rowHeight:l}),height:"".concat(l,"px")}},{children:e.jsx(ke,{columnIndexStart:r,columnIndices:t,displayRowNumber:I,headers:i,pinned:u,rowIndex:C,rowIndices:c,tableRow:d},E)}))},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}),De=function(t){var r=t.displayStrongBorder,o=t.position,i=t.rowHeight,a=t.templateColumns,u=n.useRef(null);return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){var n=e.currentTarget,t=n.style.pointerEvents;n.style.pointerEvents="none";var r=document.elementFromPoint(e.clientX,e.clientY);if(n.style.pointerEvents=t,r){var o=r.closest(".st-cell");if(o instanceof HTMLElement){u.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(u.current){var n=u.current.getBoundingClientRect(),t=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});u.current.dispatchEvent(t),u.current=null}},style:{gridTemplateColumns:a,transform:"translate3d(0, ".concat(D({position:o,rowHeight:i}),"px, 0)")}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},Fe=n.createContext(void 0),Pe=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(Fe);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 t.current&&u(t.current,e),function(){t.current&&l(t.current,e)}},[t,u,l,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},Le=n.forwardRef(function(t,r){var o=t.columnIndexStart,i=t.columnIndices,a=t.headers,u=t.pinned,l=t.rowHeight,c=t.rowIndices,s=t.setHoveredIndex,d=t.templateColumns,f=t.totalHeight,v=t.rowsToRender,p=t.width,h=u?"st-body-pinned-".concat(u):"st-body-main",w=n.useRef(null);return n.useImperativeHandle(r,function(){return w.current},[]),n.useMemo(function(){return be(a,u)},[a,u])?e.jsx(Pe,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:p},!u&&{flexGrow:1})},{children:v.map(function(t,r){var f=t.stateIndicator?"state-".concat(t.stateIndicator.parentRowId,"-").concat(t.position):N(t.rowPath||[t.position]);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(De,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:l,templateColumns:d}),e.jsx(Ae,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:r,pinned:u,rowHeight:l,rowIndices:c,setHoveredIndex:s,tableRow:t})]},f)})}))})):null});function Oe(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],t,!0),n,!0),r,!0),c=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return w({header:e,headers:l,collapsedHeaders:o})}).forEach(function(n,t){c(n,!e.singleRowChildren&&0===t)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&w({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n&&0===t.length)}),r.forEach(function(e){c(e,!1)}),i}Le.displayName="TableSection";var We=function(t){var r=t.mainTemplateColumns,o=t.pinnedLeftColumns,i=t.pinnedLeftTemplateColumns,a=t.pinnedLeftWidth,u=t.pinnedRightColumns,l=t.pinnedRightTemplateColumns,c=t.pinnedRightWidth,s=t.rowsToRender,d=t.setScrollTop,f=t.setScrollDirection,v=t.shouldShowEmptyState,p=t.tableRows,h=q(),w=h.collapsedHeaders,m=h.headerContainerRef,x=h.headers,g=h.isAnimating,b=h.mainBodyRef,y=h.onLoadMore,C=h.rowHeight,I=h.scrollbarWidth,R=h.setIsScrolling,S=h.shouldPaginate,M=h.tableBodyContainerRef,E=h.tableEmptyStateRenderer,H=n.useState(!1),k=H[0],T=H[1],A=n.useRef(new Set),D=n.useCallback(function(e){A.current.forEach(function(e){return e.classList.remove("hovered")}),A.current.clear(),null!==e&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),A.current.add(e)})},[]);n.useEffect(function(){g&&D(null)},[g,D]),X({headerContainerRef:m,mainSectionRef:M,scrollbarWidth:I}),n.useEffect(function(){return function(){P.current&&clearTimeout(P.current)}},[]);var F=n.useRef(null),P=n.useRef(null),L=n.useRef(0),O=function(e){return e.length}(p),W=O*(C+1)-1,B=n.useMemo(function(){return Oe({headers:x,pinnedLeftColumns:o,pinnedRightColumns:u,collapsedHeaders:w})},[x,o,u,w]),z=n.useMemo(function(){var e={};return s.forEach(function(n,t){var r=N(n.rowPath||[n.position])+"";e[r]=t}),e},[s]),G=n.useCallback(function(e,n){!y||S||k||200>=e.scrollHeight-(n+e.clientHeight)&&n>L.current&&(T(!0),y(),setTimeout(function(){T(!1)},1e3))},[y,S,k]),j={columnIndices:B,headerContainerRef:m,headers:x,rowHeight:C,rowIndices:z,rowsToRender:s,setHoveredIndex:D};return e.jsx("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return D(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;R(!0),P.current&&clearTimeout(P.current),P.current=setTimeout(function(){R(!1)},150),F.current&&cancelAnimationFrame(F.current),F.current=requestAnimationFrame(function(){var e=L.current,r=t>e?"down":e>t?"up":"none";d(t),f(r),G(n,t),L.current=t})},ref:M},{children:v?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:E})):e.jsxs(e.Fragment,{children:[e.jsx(Le,exports.__assign({},j,{pinned:"left",templateColumns:i,totalHeight:W,width:a})),e.jsx(Le,exports.__assign({},j,{columnIndexStart:o.length,ref:b,templateColumns:r,totalHeight:W})),e.jsx(Le,exports.__assign({},j,{columnIndexStart:o.length+r.length,pinned:"right",templateColumns:l,totalHeight:W,width:c}))]})}))},Be=function(e){var n=e.event,t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.tableBodyContainerRef,l=e.startWidth,c=e.collapsedHeaders,d=e.autoExpandColumns,f=void 0!==d&&d,v=e.reverse,p=void 0!==v&&v;n.preventDefault();var h="clientX"in n?n.clientX:n.touches[0].clientX,w="touches"in n;if(t&&!t.hide){i(!0);var m,I=y(t);if(t.children&&t.children.length>0){var R=x(t,c);m=R.length>0?R:[t]}else m=[t];var S=new Map,M=0;if(f){var N=r.filter(function(e){return e.pinned===t.pinned});if(C(N,c).forEach(function(e){var n="number"==typeof e.width?e.width:"string"==typeof e.width&&e.width.endsWith("px")?parseFloat(e.width):100;S.set(e.accessor,n)}),a.current){var E=a.current.clientWidth,H=ze({headers:r,containerWidth:E,collapsedHeaders:c}),k=H.leftWidth,T=H.rightWidth;M="left"===t.pinned?k:"right"===t.pinned?T:Math.max(0,E-k-T)}}var A=function(e){var n="right"===t.pinned?h-e:e-h;if(f){var i=r.filter(function(e){return e.pinned===t.pinned});je({delta:n,startWidth:l,resizedHeader:m.length>0?m[0]:t,sectionHeaders:i,reverse:p,collapsedHeaders:c,initialWidthsMap:S,sectionWidth:M,isParentResize:m.length>1,childrenToResize:m})}else{var a=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=s(window.innerWidth);if(!n.pinned)return 1/0;var u=i*a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+x(n,r).reduce(function(e,n){return e+g(n)},0)},0),l=y(n);return l>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):u}({header:t,headers:r,collapsedHeaders:c});m.length>1?qe({delta:n,leafHeaders:m,minWidth:I,startWidth:l,maxWidth:a}):m[0].width=Math.max(Math.min(l+n,a),I),r.forEach(function(e){b(e)})}var d=u([],r,!0);o(d)};if(w){var D=function(e){A(e.touches[0].clientX)},F=function(){document.removeEventListener("touchmove",D),document.removeEventListener("touchend",F),i(!1)};document.addEventListener("touchmove",D),document.addEventListener("touchend",F)}else{var P=function(e){A(e.clientX)},L=function(){document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",L),i(!1)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",L)}}},qe=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,y(n))},40),u=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;t.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),r)})},ze=function(e){var n=e.containerWidth,t=e.maxPinnedWidthPercent,r=void 0===t?.8:t,o=e.collapsedHeaders,i=0,a=0,u=0;e.headers.forEach(function(e){if(!e.hide){var n=x(e,o).reduce(function(e,n){return e+g(n)},0);"left"===e.pinned?i+=n:"right"===e.pinned?a+=n:u+=n}});var l=i,c=a;if(n&&n>0){var s=n*r;i>s&&(i=s),a>s&&(a=s)}return{leftWidth:p(i),rightWidth:p(a),mainWidth:u,leftContentWidth:l,rightContentWidth:c}},Ge=function(e){var n=e.columnsToShrink,t=e.totalCompensation,r=e.initialWidthsMap;if(0>t){var o=Math.abs(t),i=n.reduce(function(e,n){return e+(r.get(n.accessor)||100)},0);if(0===i)return;n.forEach(function(e,t){var a=r.get(e.accessor)||100,u=o*(a/i);if(t===n.length-1){var l=n.slice(0,t).reduce(function(e,n){var t=r.get(n.accessor)||100;return e+(("number"==typeof n.width?n.width:100)-t)},0);u=o-l}e.width=a+u})}else for(var a=t,u=function(){var e=n.map(function(e){var n=r.get(e.accessor)||100;return{column:e,headroom:Math.max(0,n-30),initialWidth:n,minWidth:30}}),t=e.filter(function(e){return e.headroom>0});if(t.length>0){var o=t.reduce(function(e,n){return e+n.headroom},0),i=0,u=a;t.forEach(function(e,n){var r=u*(e.headroom/o);r=Math.min(r,e.headroom),n===t.length-1&&(r=Math.min(u-i,e.headroom)),e.column.width=e.initialWidth-r,i+=r}),a-=i}else{var l=e.filter(function(e){return e.minWidth>c});if(0>=l.length)return"break";var s=a,d=s/l.length,f=0;l.forEach(function(e,n){var t=e.minWidth-c,r=Math.min(d,t);n===l.length-1&&(r=Math.min(s-f,t));var o=e.initialWidth-r;e.column.width=o,e.column.minWidth=Math.max(o,c),f+=r}),a-=f}};a>.5&&"break"!==u(););},je=function(e){var n=e.delta,t=e.startWidth,r=e.resizedHeader,o=e.sectionHeaders,i=e.reverse,a=e.collapsedHeaders,u=e.initialWidthsMap,l=e.sectionWidth,s=e.isParentResize,d=e.childrenToResize,f=void 0===d?[]:d;if(void 0!==s&&s&&f.length>1){var v=C(o,a),p=v.findIndex(function(e){return e.accessor===f[0].accessor}),h=v.findIndex(function(e){return e.accessor===f[f.length-1].accessor});if(-1===p||-1===h)return;var w,m=h===v.length-1;w=0===p?v.slice(h+1):m||i?v.slice(0,p):v.slice(h+1);var x=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){var g=n,b=!1;if(x+n>l){b=!0;var y=w.reduce(function(e,n){var t=u.get(n.accessor)||100;return e+Math.max(0,t-c)},0);g=Math.min(n,y)}var I=(R=t+g)/(S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0));f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*I,30)}),b&&g>0&&w.length>0&&Ge({columnsToShrink:w,totalCompensation:g,initialWidthsMap:u})}else{var R,S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0),M=(R=Math.max(t+n,c*f.length))/S;f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*M,30)}),(F=t-R)>0&&w.length>0&&Ge({columnsToShrink:w,totalCompensation:-F,initialWidthsMap:u})}}else{var N=C(o,a),E=N.findIndex(function(e){return e.accessor===r.accessor});if(-1!==E){var H,k=E===N.length-1;if(0!==(H=0===E?N.slice(E+1):k||i?N.slice(0,E):N.slice(E+1)).length){var T=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){if(l>=T+n)return void(r.width=t+n);y=H.reduce(function(e,n){var t=u.get(n.accessor)||100;return e+Math.max(0,t-c)},0);var A=Math.min(n,y);r.width=t+A,A>0&&Ge({columnsToShrink:H,totalCompensation:A,initialWidthsMap:u})}else{var D=Math.max(t+n,30),F=t-D;r.width=D,F>0&&Ge({columnsToShrink:H,totalCompensation:-F,initialWidthsMap:u})}}else r.width=Math.max(t+n,30)}}},Ke={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"},Ve=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"]}},_e=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ue=function(e){return["between","notBetween","in","notIn"].includes(e)},Je=function(e){return["isEmpty","isNotEmpty"].includes(e)},Xe=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},Ye=function(t){var r=t.value,o=t.onChange,i=t.options,a=t.placeholder,u=void 0===a?"Select...":a,l=t.className,c=void 0===l?"":l,s=t.disabled,d=void 0!==s&&s,f=n.useState(!1),v=f[0],p=f[1],h=n.useState(-1),w=h[0],m=h[1],x=n.useRef(null),g=i.find(function(e){return e.value===r});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:x,className:"st-custom-select ".concat(c," ").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===r});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:g?g.label:u})),e.jsx(J,{})]})),e.jsx(Y,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,t){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return b(n.value)},tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(n.value))}},{children:n.label}),t)})}))}))]}))},$e=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:Ke[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(Ye,{value:t,onChange:function(e){r(e)},options:o})}))},Ze=function(n){var t=n.type,r=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===t?"text":t,value:n.value,onChange:function(e){return r(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()})},Qe=function(n){var t=n.children,r=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},en=function(n){var t=n.onClear,r=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:!r,className:"st-filter-button st-filter-button-apply ".concat(r?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&t&&e.jsx("button",exports.__assign({onClick:t,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},nn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],c=u[1],s=n.useState(((null==o?void 0:o.value)||"")+""),d=s[0],f=s[1],v=Ve("string");n.useEffect(function(){o?(c(o.operator),f((o.value||"")+"")):(c("contains"),f(""))},[o]);var p=function(){var e=exports.__assign({accessor:r.accessor,operator:l},_e(l)&&{value:d});i(e)},h=Je(l)||d.trim();return e.jsxs(Xe,{children:[e.jsx($e,{value:l,onChange:c,operators:v}),_e(l)&&e.jsx(Qe,{children:e.jsx(Ze,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(en,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},tn=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),s=c[0],d=c[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],p=f[1],h=n.useState(((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")+""),w=h[0],m=h[1],x=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),g=x[0],b=x[1],y=Ve("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 C=function(){var e={accessor:i.accessor,operator:s};_e(s)?e.value=parseFloat(v):Ue(s)&&(e.values=[parseFloat(""+w),parseFloat(""+g)]),u(e)};return e.jsxs(Xe,{children:[e.jsx($e,{value:s,onChange:d,operators:y}),_e(s)&&e.jsx(Qe,{children:e.jsx(Ze,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:C})}),Ue(s)&&e.jsxs(Qe,{children:[e.jsx(Ze,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:C}),e.jsx(Ze,{type:"number",value:g,onChange:b,placeholder:"To...",onEnterPress:C})]}),e.jsx(en,{onApply:C,onClear:l,canApply:!!Je(s)||(_e(s)?""!==v.trim():!!Ue(s)&&""!==(w+"").trim()&&""!==(g+"").trim()),showClear:!!a})]})},rn=function(n){var t=n.className;return e.jsx(Ye,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===t?"":t,placeholder:n.placeholder})},on=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],c=u[1],s=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=s[0],f=s[1],v=Ve("boolean");n.useEffect(function(){o?(c(o.operator),f(void 0!==o.value?o.value+"":"true")):(c("equals"),f("true"))},[o]);var p=Je(l)||""!==d;return e.jsxs(Xe,{children:[e.jsx($e,{value:l,onChange:c,operators:v}),_e(l)&&e.jsx(Qe,{children:e.jsx(rn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(en,{onApply:function(){var e={accessor:r.accessor,operator:l};_e(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},an=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,c=n.useState((null==a?void 0:a.operator)||"equals"),s=c[0],d=c[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],p=f[1],h=n.useState((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])?a.values[0]+"":""),w=h[0],m=h[1],x=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),g=x[0],b=x[1],y=Ve("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 C=function(t){var r=t.value,o=t.onChange,i=t.placeholder,a=t.autoFocus,u=t.className,l=n.useState(!1),c=l[0],s=l[1],d=n.useState(""),f=d[0],v=d[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=de(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){a&&p.current&&p.current.focus()},[a]);var h=r?de(r):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(){s(!c)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),s(!c)):"Escape"===e.key&&s(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e.jsx(Y,exports.__assign({open:c,setOpen:s,onClose:function(){s(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(ae,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),s(!1)},onClose:function(){return s(!1)}})}))]}))};return e.jsxs(Xe,{children:[e.jsx($e,{value:s,onChange:d,operators:y}),_e(s)&&e.jsx(Qe,{children:e.jsx(C,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),Ue(s)&&e.jsxs(Qe,{children:[e.jsx(C,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(C,{value:g,onChange:b,placeholder:"To date..."})]}),e.jsx(en,{onApply:function(){var e={accessor:i.accessor,operator:s};_e(s)?e.value=v:Ue(s)&&(e.values=[w,g]),u(e)},onClear:l,canApply:!!Je(s)||(_e(s)?""!==v.trim():!!Ue(s)&&""!==w.trim()&&""!==g.trim()),showClear:!!a})]})},un=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,l=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),c=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),s=n.useState((null==o?void 0:o.values)?o.values.map(String):c),d=s[0],f=s[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):[]:c)},[o,c]);var m=l.length>10;return e.jsxs(Xe,{children:[e.jsx(Qe,{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(Me,exports.__assign({checked:d.length===c.length,onChange:function(e){f(e?c:[])}},{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(Ze,{type:"text",value:p,onChange:h,placeholder:"Search..."})})),w.map(function(n,t){return e.jsx(Me,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}))}),t)}),p&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(en,{onApply:function(){d.length!==c.length?i({accessor:r.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==c.length,showClear:!!o})]})},ln=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(tn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(on,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(an,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(un,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(nn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},cn=function(t){var r=t.content,o=t.children,i=t.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],c=u[1],s=n.useState({top:0,left:0}),d=s[0],f=s[1],v=n.useRef(null),p=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!r||!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&&r.trim()){var e=p.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,t=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),t+40>window.innerHeight-8&&(t=e.top-40-8),f({top:t,left:n}),c(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),c(!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:r}))]})},sn=function(t){var r,o,i=t.colIndex,a=t.gridColumnEnd,l=t.gridColumnStart,c=t.gridRowEnd,s=t.gridRowStart,v=t.header,p=t.parentHeader,w=t.reverse,m=t.sort,x=n.useState(!1),g=x[0],b=x[1],y=n.useState(!1),C=y[0],I=y[1],R=n.useState(v.label||""),S=R[0],M=R[1],N=q(),E=N.activeHeaderDropdown,H=N.areAllRowsSelected,k=N.autoExpandColumns,T=N.collapsedHeaders,A=N.columnBorders,D=N.columnReordering,F=N.columnResizing,P=N.columnsWithSelectedCells,L=N.draggedHeaderRef,O=N.enableHeaderEditing,W=N.filterIcon,B=N.handleApplyFilter,z=N.handleClearFilter,G=N.handleSelectAll,j=N.headerCollapseIcon,K=N.headerDropdown,V=N.headerExpandIcon,_=N.headerRegistry,U=N.headers,J=N.hoveredHeaderRef,X=N.onColumnOrderChange,$=N.onColumnSelect,Z=N.onHeaderEdit,ee=N.onSort,ne=N.onTableHeaderDragEnd,te=N.headerHeight,re=N.selectColumns,oe=N.selectableColumns,ae=N.selectedColumns,ue=N.setActiveHeaderDropdown,le=N.setCollapsedHeaders,ce=N.setHeaders,se=N.setInitialFocusedCell,de=N.setIsResizing,fe=N.setSelectedCells,ve=N.setSelectedColumns,pe=N.sortDownIcon,he=N.sortUpIcon,we=N.tableBodyContainerRef,xe=!!(null==v?void 0:v.isSortable),ge=!!(null==v?void 0:v.filterable),be=N.filters[v.accessor],ye=(null==E?void 0:E.accessor)===v.accessor,Ce=v.isSelectionColumn&&N.enableRowSelection,Ie=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(v),Re=T.has(v.accessor),Ne=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,c=n.useRef(null),s=n.useState({}),d=s[0],f=s[1];return n.useEffect(function(){if(t&&c.current){var e=function(){if(c.current){var e=c.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=window.innerWidth-e.right,r="bottom",i={};o>n&&e.top>=o&&(r="top");var u="left";a>t+e.width&&(u="right"),"bottom"===r?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)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:c,position:d}}({isOpen:ye,estimatedHeight:200,estimatedWidth:250,margin:4}),Ee=Ne.triggerRef,He=Ne.position,ke=n.useMemo(function(){var e,n,t;if(!A)return!1;var r=U.filter(function(e){return"left"===e.pinned}),o=U.filter(function(e){return!e.pinned}),i=U.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===v.accessor:"right"===v.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===v.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===v.accessor},[A,U,v.accessor,v.pinned]),Te=n.useMemo(function(){return!(!oe||Ce)&&f(v,i).some(function(e){return ae.has(e)})},[oe,Ce,v,i,ae]),Ae=n.useMemo(function(){return!Ce&&f(v,i).some(function(e){return P.has(e)})},[Ce,v,i,P]),De=n.useMemo(function(){return!(!v.children||0===v.children.length)&&(!Re||v.children.some(function(e){var n=e.showWhen||d;return"parentCollapsed"===n||"always"===n}))},[v.children,Re]),Fe=null==p?void 0:p.singleRowChildren,Pe=De&&!v.singleRowChildren,Le="st-header-cell ".concat(v.accessor===(null===(r=J.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(o=L.current)||void 0===o?void 0:o.accessor)===v.accessor?"st-dragging":""," ").concat(xe?"clickable":""," ").concat(D&&!xe?"columnReordering":""," ").concat(Pe?"parent":""," ").concat(Fe?"st-sub-header":""," ").concat(ke?"st-last-column":""," ").concat(O&&!Ce?"st-header-editable":""," ").concat(Te?"st-header-selected":""," ").concat(Ae&&!Te?"st-header-has-highlighted-cell":""),Oe=Se({draggedHeaderRef:L,headers:U,hoveredHeaderRef:J,onColumnOrderChange:X,onTableHeaderDragEnd:ne}),We=Oe.handleDragStart,qe=Oe.handleDragEnd,ze=Oe.handleDragOver,Ge=me();n.useEffect(function(){if(_&&!v.isSelectionColumn){var e=v.accessor+"";return _.set(e,{setEditing:function(e){I(e)}}),function(){_.delete(e)}}},[_,v.accessor,v.isSelectionColumn]),n.useEffect(function(){M(v.label||"")},[v.label]);var je=function(e){b(!g)},Ke=n.useCallback(function(e){M(e);var n=U.map(function(n){return n.accessor===v.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});ce(n),Z&&Z(v,e)},[U,ce,Z,v]),Ve=n.useCallback(function(){ue&&ue(null)},[ue]),_e=n.useCallback(function(e){e.stopPropagation(),le(function(e){var n=new Set(e);return Re?n.delete(v.accessor):n.add(v.accessor),n})},[le,Re,v.accessor]),Ue=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(oe){var r=f(t,i),o=r.some(function(e){return ae.has(e)});if(O&&o&&!n.shiftKey)return K&&ye&&Ve(),void I(!0);n.shiftKey&&re?ve(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);i>t&&(i=t,o=e)});var a,l,c,s=u(u([],(c=Math.min(a=o,l=n),Array.from({length:Math.max(a,l)-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(u(u([],Array.from(e),!0),s,!0))}):re&&re(r),fe(new Set),se(null)}$&&$(t),!oe&&t.isSortable&&ee(t.accessor)}};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!v)return null;var Je=F&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",role:"separator","aria-label":"Resize ".concat(v.label," column"),"aria-orientation":"vertical",onMouseDown:function(e){var n,t=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Be,callbackProps:{event:e.nativeEvent,header:v,headers:U,setHeaders:ce,setIsResizing:de,tableBodyContainerRef:we,startWidth:t,collapsedHeaders:T,autoExpandColumns:k,reverse:w},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(h({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Be,callbackProps:{event:e,header:v,headers:U,setHeaders:ce,setIsResizing:de,tableBodyContainerRef:we,startWidth:t,collapsedHeaders:T,autoExpandColumns:k,reverse:w},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Xe=m&&m.key.accessor===v.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return Ue({event:e,header:v})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||ee(v.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(v.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&he&&he,"desc"===m.direction&&pe&&pe]})),Ye=ge&&W&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:je,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(),je()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(v.label),"aria-expanded":g,"aria-haspopup":"dialog"},{children:[n.cloneElement(W,{style:{fill:be?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(Y,exports.__assign({open:g,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(ln,{header:v,currentFilter:be,onApplyFilter:function(e){B(e),b(!1)},onClearFilter:function(){z(v.accessor),b(!1)}})}))]})),$e=Ie&&!Ce&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return _e(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),_e(e))},tabIndex:0,role:"button","aria-label":"".concat(Re?"Expand":"Collapse"," ").concat(v.label," column"),"aria-expanded":!Re},{children:Re?j:V})),Ze=e.jsx(cn,exports.__assign({content:v.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===v.align?"right-aligned":"center"===v.align?"center-aligned":"left-aligned")},{children:Ce?e.jsx(Me,{checked:!!H&&H(),onChange:function(e){G&&G(e)},ariaLabel:"Select all rows"}):C?e.jsx(Q,{defaultValue:S,onBlur:function(){return I(!1)},onChange:Ke}):S||(null==v?void 0:v.label)}))})),Qe="header-desc-".concat(v.accessor),en=function(e,n){var t=[];return e.type&&"other"!==e.type&&t.push("".concat(e.type," column")),e.isSortable&&t.push("sortable"),n&&t.push("filterable"),e.tooltip&&t.push(e.tooltip),t.join(", ")}(v,ge);return e.jsxs(ie,exports.__assign({className:Le,id:h({accessor:v.accessor,rowId:"header"}),"aria-sort":function(){if(v.isSortable)return(null==m?void 0:m.key.accessor)===v.accessor?"asc"===m.direction?"ascending":"descending":"none"}(),"aria-colindex":i+1,"aria-describedby":en?Qe:void 0,onDragOver:function(e){Ce||Ge({callback:ze,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:exports.__assign({gridRowStart:s,gridRowEnd:c,gridColumnStart:l,gridColumnEnd:a},c-s>1?{}:{height:te})},{children:[w&&Je,!v.headerRenderer&&"right"===v.align&&$e,!v.headerRenderer&&"right"===v.align&&Ye,!v.headerRenderer&&"right"===v.align&&Xe,e.jsx("div",exports.__assign({ref:Ee,className:"st-header-label",draggable:D&&!v.disableReorder&&!Ce,onClick:function(e){Ce||Ue({event:e,header:v})},onDoubleClick:function(e){Ce||function(e){var n=e.header;n.isSelectionColumn||oe&&n.isSortable&&ee(n.accessor)}({event:e,header:v})},onDragEnd:Ce?void 0:function(e){e.preventDefault(),qe()},onDragStart:Ce?void 0:function(e){D&&v&&function(e){We(e)}(v)}},{children:v.headerRenderer?v.headerRenderer({accessor:v.accessor,colIndex:i,header:v,components:{sortIcon:Xe||void 0,filterIcon:Ye||void 0,collapseIcon:$e||void 0,labelContent:Ze}}):Ze})),!v.headerRenderer&&"right"!==v.align&&Xe,!v.headerRenderer&&"right"!==v.align&&Ye,!v.headerRenderer&&"right"!==v.align&&$e,!w&&Je,K&&!Ce&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:K({accessor:v.accessor,colIndex:i,header:v,isOpen:ye,onClose:Ve,position:He})})),en&&e.jsx("span",exports.__assign({id:Qe,className:"st-sr-only"},{children:en}))]}))},dn=function(t){var r=t.columnIndices,o=t.gridTemplateColumns,i=t.handleScroll,a=t.headers,u=t.maxDepth,l=t.pinned,c=t.sectionRef,s=t.sort,d=t.width,f=q().collapsedHeaders,v=n.useMemo(function(){var e=[],n=1,t=function(o,i,c,s){var d,v;if(void 0===c&&(c=!1),!w({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;c||n++;var p,h,m=null!==(v=null===(d=o.children)||void 0===d?void 0:d.filter(function(e){return w({header:e,pinned:l,headers:a,collapsedHeaders:f})}).length)&&void 0!==v?v:0,x=n;if(o.singleRowChildren&&m>0?(p=x+1,h=u+1):m>0?(p=x+m,h=i+1):(p=x+1,h=u+1),e.push({header:o,gridColumnStart:x,gridColumnEnd:p,gridRowStart:i,gridRowEnd:h,colIndex:r[o.accessor],parentHeader:s}),o.children&&o.children.length>0){var g=o.singleRowChildren?i:i+1,b=!o.singleRowChildren;o.children.forEach(function(e){w({header:e,pinned:l,headers:a,collapsedHeaders:f})&&(t(e,g,b,o),b=!1)})}return p-x},o=a.filter(function(e){return w({header:e,pinned:l,headers:a,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[a,u,l,r,f]);return e.jsx(Pe,exports.__assign({childRef:c,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:c,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(sn,{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:s},n.header.accessor)})})}))}))},fn=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,a=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,l=t.pinnedRightColumns,c=t.pinnedRightTemplateColumns,s=t.sort,d=t.pinnedLeftWidth,f=t.pinnedRightWidth,v=q(),p=v.headerContainerRef,h=v.pinnedLeftRef,w=v.pinnedRightRef,m=v.collapsedHeaders,x=v.tableRows,g=v.maxHeaderDepth,b=n.useMemo(function(){return Oe({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":x.length+g,"aria-colcount":y},{children:[be(o,"left")&&e.jsx(dn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:g,pinned:"left",sectionRef:h,sort:s,width:d}),e.jsx(dn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:g,sectionRef:r,sort:s}),be(o,"right")&&e.jsx(dn,{columnIndices:b,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:g,pinned:"right",sectionRef:w,sort:s,width:f})]}))},vn=function(e){var n=e.collapsedHeaders,t=e.autoExpandColumns,r=function(e){var t=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||d;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&t.push(e),o.length>0?r({headers:o,flattenedHeaders:t}):e.singleRowChildren||t.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||d;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&t.push(e),r({headers:i,flattenedHeaders:t})}else t.push(e)}),t},o=r({headers:e.headers,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e,n){var t=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),t&&"number"==typeof t&&(t="".concat(t,"px")),void 0===t||n?r:"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(t,", ").concat(r,")"):"max(".concat(t,", ").concat(r,")")}(e,t)}).join(" "))},pn=function(t){var r=t.hideHeader,o=t.pinnedLeftWidth,i=t.pinnedRightWidth,a=t.setScrollTop,u=t.setScrollDirection,l=t.shouldShowEmptyState,c=t.sort,s=t.tableRows,d=t.rowsToRender,f=q(),v=f.columnResizing,p=f.editColumns,h=f.headers,w=f.collapsedHeaders,m=f.autoExpandColumns,x=n.useRef(null),g=h.filter(function(e){return!e.pinned}),b=h.filter(function(e){return"left"===e.pinned}),y=h.filter(function(e){return"right"===e.pinned}),C=n.useMemo(function(){return vn({headers:b,collapsedHeaders:w,autoExpandColumns:m})},[b,w,m]),I=n.useMemo(function(){return vn({headers:g,collapsedHeaders:w,autoExpandColumns:m})},[g,w,m]),R=n.useMemo(function(){return vn({headers:y,collapsedHeaders:w,autoExpandColumns:m})},[y,w,m]),S={centerHeaderRef:x,headers:h,mainTemplateColumns:I,pinnedLeftColumns:b,pinnedLeftTemplateColumns:C,pinnedRightColumns:y,pinnedRightTemplateColumns:R,sort:c,pinnedLeftWidth:o,pinnedRightWidth:i},M={tableRows:s,mainTemplateColumns:I,pinnedLeftColumns:b,pinnedLeftTemplateColumns:C,pinnedLeftWidth:o,pinnedRightColumns:y,pinnedRightTemplateColumns:R,pinnedRightWidth:i,setScrollTop:a,setScrollDirection:u,shouldShowEmptyState:l,rowsToRender:d};return e.jsxs("div",exports.__assign({className:"st-content ".concat(v?"st-resizeable":"st-not-resizeable"),style:{width:p?"calc(100% - 27.5px)":"100%"}},{children:[!r&&e.jsx(fn,exports.__assign({},S)),e.jsx(We,exports.__assign({},M))]}))},hn=function(t){var r=t.mainBodyWidth,o=t.mainBodyRef,i=t.pinnedLeftWidth,a=t.pinnedRightWidth,u=t.pinnedLeftContentWidth,l=t.pinnedRightContentWidth,c=t.tableBodyContainerRef,s=q().editColumns,d=n.useState(!1),f=d[0],v=d[1],p=n.useRef(null),h=n.useRef(null),w=n.useRef(null),m=s?28:0,x=(s?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&&v(o.current.scrollWidth-o.current.clientWidth>1)},1)},[o,r]),f?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(Pe,exports.__assign({childRef:h,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:h,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),r>0&&e.jsx(Pe,exports.__assign({childRef:p},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:p},{children:e.jsx("div",{style:{width:r}})}))})),a>0&&e.jsx(Pe,exports.__assign({childRef:w,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:w,style:{width:x}},{children:e.jsx("div",{style:{width:l}})}))})),m>0&&e.jsx("div",{style:{width:m-1.5,height:"100%",flexShrink:0}})]})):null},wn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"asc"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"asc"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"asc"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"asc"===t?i:-i},enum:function(e,n,t){return wn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"asc"===t?-1:1:null==n?"asc"===t?1:-1:"string"==typeof e&&"string"==typeof n?wn.string(e,n,t):"number"==typeof e&&"number"==typeof n?wn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?wn.boolean(e,n,t):wn.string(e+"",n+"",t)}},mn=function(e){return function(e){var n=e.rows,t=e.sortColumn,r=function(e,n){for(var t=0,o=e;o.length>t;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children,n);if(a)return a}}},o=r(e.headers,t.key.accessor),i=(null==o?void 0:o.type)||"string",a=t.direction,l=t.key.accessor;return u([],n,!0).sort(function(e,t){var r,u;if(null==o?void 0:o.valueGetter){var c=n.indexOf(e),s=n.indexOf(t);r=o.valueGetter({accessor:l,row:e,rowIndex:c}),u=o.valueGetter({accessor:l,row:t,rowIndex:s})}else r=R(e,l),u=R(t,l);return(null==o?void 0:o.comparator)?o.comparator({rowA:e,rowB:t,valueA:r,valueB:u,direction:a}):function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"asc"===r?-1:1;if(null==n||""===n)return"asc"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=e+"";if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return wn.number(i,a,r)}return"date"===t?wn.date(e+"",n+"",r):"boolean"===t?wn.boolean(!!e,!!n,r):"enum"===t?wn.enum(e+"",n+"",r):wn.string(e+"",n+"",r)}(r,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},xn=function(e){return n.useMemo(function(){var n=v(e),t=new Map;return n.forEach(function(e){t.set(e.accessor,e)}),t},[e])},gn=function(e){var n=e.tableRows,t=e.sortColumn,r=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:t?r&&r.length>0?(0,e.sortNestedRows)({groupingKeys:r,headers:o,rows:n,sortColumn:t}):mn({headers:o,rows:n,sortColumn:t}):n},bn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;o.length>r;r++){var i=o[r];if(!t.has(i.accessor)&&(t.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,c=i.children;c.length>l;l++){var s=c[l];if(bn([s],n,t),!1===s.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},yn=function(e){return e.every(function(e){return e.hide})},Cn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Cn(e.children),yn(e.children)&&(e.hide=!0))})},In=function(t){var r=t.allHeaders,o=t.depth,i=void 0===o?0:o,a=t.doesAnyHeaderHaveChildren,l=t.header,c=t.isCheckedOverride,s=n.useState(!0),d=s[0],f=s[1],v=q(),p=v.expandIcon,h=v.headers,w=v.setHeaders,m=v.onColumnVisibilityChange,x=a?"".concat(16*i,"px"):"8px",g=l.children&&l.children.length>0,b=null!=c?c:l.hide||g&&l.children&&yn(l.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:x}},{children:[a&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:g?e.jsx("div",exports.__assign({className:"st-collapsible-header-icon st-expand-icon-container ".concat(d?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!d)}},{children:p})):null})),e.jsx(Me,exports.__assign({checked:b,onChange:function(e){l.hide=e,e?Cn(r):(bn(r,l.accessor),g&&l.children&&l.children.length>0&&l.children.every(function(e){return!0===e.hide})&&l.children[0]&&(l.children[0].hide=!1,bn(r,l.children[0].accessor)));var n=u([],h,!0);if(w(n),m){var t=function(e){var n={},t=function(e){n[e.accessor]=!e.hide,e.children&&e.children.length>0&&e.children.forEach(t)};return e.forEach(t),n}(n);m(t)}}},{children:l.label}))]})),g&&d&&l.children&&e.jsx("div",exports.__assign({className:"st-nested-headers"},{children:l.children.map(function(n,t){return e.jsx(In,{allHeaders:r,depth:i+1,doesAnyHeaderHaveChildren:a,header:n,isCheckedOverride:!!b||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},Rn=function(t){var r=t.headers,o=t.open,i="left"===t.position?"left":"",a=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",exports.__assign({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn||n.excludeFromRender?null:e.jsx(In,{doesAnyHeaderHaveChildren:a,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},Sn=function(t){var r=t.columnEditorText,o=t.editColumns,i=t.headers,a=t.position,u=void 0===a?"right":a,l=n.useState(t.editColumnsInitOpen),c=l[0],s=l[1];return o?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(c?"open":""," ").concat(u),onClick:function(){return function(e){s(e)}(!c)},style:{width:28}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:r})),e.jsx(Rn,{headers:i,open:c,position:u})]})):null},Mn=function(t){var o=t.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},[]),c=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=i.current[n])||void 0===t||t.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)});c(n,e)}))})})})}},[l,u]),s=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))}),c(e,n)},[a,u,c]),d=n.useCallback(function(e,n){n.forEach(function(n){if(a(e,n)){l(e);var t=i.current[n].indexOf(e);-1!==t&&i.current[n].splice(t,1)}})},[a,l]);return e.jsx(Fe.Provider,exports.__assign({value:{registerPane:s,unregisterPane:d}},{children:r.default.Children.only(o)}))},Nn=function(e){var n=e.tableRows,t=e.filterState;return e.externalFilterHandling?n:t&&0!==Object.keys(t).length?n.filter(function(e){return Object.values(t).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===(e+"").trim();if("isNotEmpty"===t)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=(e+"").toLowerCase(),a=r?(r+"").toLowerCase():"";switch(t){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=+r;switch(t){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 c=o.map(Number),s=c[1];return u>=c[0]&&s>=u}return!1;case"notBetween":if(o&&2===o.length){var d=o.map(Number);return s=d[1],d[0]>u||u>s}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=de(e),v=de((r||"")+""),p=se(f),h=se(v);switch(t){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 se(de((e||"")+""))}),m=w[1];return p>=w[0]&&m>=p}return!1;case"notBetween":if(o&&2===o.length){var x=o.map(function(e){return se(de((e||"")+""))});return m=x[1],x[0]>p||p>m}return!0}}if("boolean"==typeof e&&"equals"===t)return e===!!r;if(Array.isArray(e)){var g=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", ");e=g}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===t?b:!b}return!1}var y=(e+"").toLowerCase(),C=r?(r+"").toLowerCase():"";switch(t){case"equals":return y===C;case"notEquals":return y!==C;default:return!0}}(R(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},En=function(e){var n,t=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 r=null===(n=null==t?void 0:t.parentElement)||void 0===n?void 0:n.clientHeight;return!r||50>r?0:r*parseInt(e,10)/100}return window.innerHeight}return e},Hn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;if(r&&t&&M(t))i(t);else{var a=R(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,u=t.parseValue?o.map(t.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"===t.type?o.length:void 0;switch(t.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 t.formatResult?t.formatResult(a):a}},kn=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},Tn=function(e){return function(){for(var n=[],t=0;arguments.length>t;t++)n[t]=arguments[t];return new Promise(function(t){e.apply(void 0,n),setTimeout(function(){return t()},0)})}},An=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},Dn={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}},Fn=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")},Pn=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){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(){Fn(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Ln=function(e){var t=e.rows,r=e.rowGrouping,o=void 0===r?[]:r,i=e.expandedRows,a=e.collapsedRows,l=e.expandedDepths,c=e.rowStateMap,s=e.hasLoadingRenderer,d=e.hasErrorRenderer,f=e.hasEmptyRenderer;return n.useMemo(function(){if(!o||0===o.length)return t.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,rowPath:[n],absoluteRowIndex:n}});var e=[],n=function(t,r,v){void 0===v&&(v=[]),t.forEach(function(t,p){var h=o[r],w=e.length,m=u(u([],v,!0),[p],!1),x=N(m);if(e.push({row:t,depth:r,displayPosition:w,groupingKey:h,position:w,isLastGroupRow:0===r,rowPath:m,absoluteRowIndex:w}),H(x,r,l,i,a)&&o.length>r){var g=null==c?void 0:c.get(x),b=E(t,h);if(g&&(g.loading||g.error||g.isEmpty)){if(g.loading&&s||g.error&&d||g.isEmpty&&f){var y=e.length;e.push({row:{},depth:r+1,displayPosition:y,groupingKey:h,position:y,isLastGroupRow:!1,rowPath:u(u([],m,!0),[h],!1),stateIndicator:{parentRowId:x,state:g},absoluteRowIndex:y})}else if(g.loading&&!s){var C=e.length;e.push({row:{},depth:r+1,displayPosition:C,groupingKey:h,position:C,isLastGroupRow:!1,rowPath:u(u([],m,!0),[h,"loading-skeleton"],!1),isLoadingSkeleton:!0,absoluteRowIndex:C})}}else if(b.length>0){var I=u(u([],m,!0),[h],!1);n(b,r+1,I)}}})};return n(t,0),e},[t,o,i,a,l,c,s,d,f])},On=function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},Wn=function(t){var r=t.allowAnimations,o=void 0!==r&&r,c=t.autoExpandColumns,d=void 0!==c&&c,f=t.canExpandRowGroup,p=t.cellUpdateFlash,h=void 0!==p&&p,w=t.className,g=t.columnBorders,b=void 0!==g&&g,y=t.columnEditorPosition,C=void 0===y?"right":y,I=t.columnEditorText,E=void 0===I?"Columns":I,H=t.columnReordering,T=void 0!==H&&H,D=t.columnResizing,F=void 0!==D&&D,P=t.copyHeadersToClipboard,W=void 0!==P&&P,q=t.defaultHeaders,V=t.editColumns,J=void 0!==V&&V,Y=t.editColumnsInitOpen,$=void 0!==Y&&Y,Z=t.emptyStateRenderer,Q=t.enableHeaderEditing,ee=void 0!==Q&&Q,ne=t.enableRowSelection,te=void 0!==ne&&ne,re=t.errorStateRenderer,oe=t.expandAll,ie=void 0===oe||oe,ae=t.expandIcon,ue=void 0===ae?e.jsx(j,{className:"st-expand-icon"}):ae,le=t.externalFilterHandling,ce=void 0!==le&&le,se=t.externalSortHandling,de=void 0!==se&&se,fe=t.filterIcon,ve=void 0===fe?e.jsx(U,{className:"st-header-icon"}):fe,pe=t.footerHeight,he=void 0===pe?49:pe,we=t.footerRenderer,me=t.headerCollapseIcon,ge=void 0===me?e.jsx(j,{className:"st-header-icon"}):me,be=t.headerDropdown,ye=t.headerExpandIcon,Ce=void 0===ye?e.jsx(G,{className:"st-header-icon"}):ye,Ie=t.headerHeight,Re=t.height,Se=t.hideFooter,Me=void 0!==Se&&Se,Ne=t.hideHeader,Ee=void 0!==Ne&&Ne,He=t.includeHeadersInCSVExport,ke=void 0===He||He,Te=t.initialSortColumn,Ae=t.initialSortDirection,De=void 0===Ae?"asc":Ae,Fe=t.isLoading,Pe=void 0!==Fe&&Fe,Le=t.loadingStateRenderer,Oe=t.maxHeight,We=t.nextIcon,Be=void 0===We?e.jsx(j,{className:"st-next-prev-icon"}):We,qe=t.onCellClick,Ge=t.onCellEdit,je=t.onColumnOrderChange,Ke=t.onColumnSelect,Ve=t.onColumnVisibilityChange,_e=t.onFilterChange,Ue=t.onGridReady,Je=t.onHeaderEdit,Xe=t.onLoadMore,Ye=t.onNextPage,$e=t.onPageChange,Ze=t.onRowGroupExpand,Qe=t.onRowSelectionChange,en=t.onSortChange,nn=t.prevIcon,tn=void 0===nn?e.jsx(G,{className:"st-next-prev-icon"}):nn,rn=t.rowButtons,on=t.rowGrouping,an=t.rowHeight,un=void 0===an?32:an,ln=t.rows,cn=t.rowsPerPage,sn=void 0===cn?10:cn,dn=t.selectableCells,fn=void 0!==dn&&dn,vn=t.selectableColumns,wn=void 0!==vn&&vn,bn=t.selectionColumnWidth,yn=void 0===bn?42:bn,Cn=t.serverSidePagination,In=void 0!==Cn&&Cn,Rn=t.shouldPaginate,An=void 0!==Rn&&Rn,Fn=t.sortDownIcon,Pn=void 0===Fn?e.jsx(_,{className:"st-header-icon"}):Fn,Wn=t.sortUpIcon,Bn=void 0===Wn?e.jsx(K,{className:"st-header-icon"}):Wn,qn=t.tableEmptyStateRenderer,zn=void 0===qn?e.jsx(On,{}):qn,Gn=t.tableRef,jn=t.theme,Kn=void 0===jn?"light":jn,Vn=t.totalRowCount,_n=t.useHoverRowBackground,Un=void 0===_n||_n,Jn=t.useOddColumnBackground,Xn=void 0!==Jn&&Jn,Yn=t.useOddEvenRowBackground,$n=void 0!==Yn&&Yn;Xn&&($n=!1),b&&(Un=!1);var Zn=n.useRef(null),Qn=n.useRef(null),et=n.useRef(null),nt=n.useRef(null),tt=n.useRef(null),rt=n.useRef(null),ot=n.useRef(null),it=n.useReducer(function(e){return e+1},0)[1],at=n.useState(new Map),ut=at[0],lt=at[1],ct=n.useState(ln),st=ct[0],dt=ct[1],ft=n.useRef(new Map);n.useEffect(function(){dt(ln);var e=new Map;ln.forEach(function(n,t){var r=N([t]);e.set(r,t)}),ft.current=e},[ln]);var vt,pt,ht,wt,mt,xt,gt,bt,yt,Ct,It=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){t.current&&i(t.current.offsetWidth-t.current.clientWidth)},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:rt}),Rt=It.scrollbarWidth,St=It.setScrollbarWidth,Mt=X({headerContainerRef:ot,mainSectionRef:rt,scrollbarWidth:Rt}).isMainSectionScrollable,Nt=n.useMemo(function(){if(Pe&&0===st.length){var e=An?sn:10;return Mt&&(e+=1),Array.from({length:e},function(e,n){return{}})}return st},[Pe,st,sn,Mt,An]),Et=n.useState(1),Ht=Et[0],kt=Et[1],Tt=n.useState(q),At=Tt[0],Dt=Tt[1],Ft=n.useState(!1),Pt=Ft[0],Lt=Ft[1],Ot=n.useState(!1),Wt=Ot[0],Bt=Ot[1],qt=n.useState(null),zt=qt[0],Gt=qt[1],jt=n.useCallback(function(){var e=new Set,n=function(t){t.forEach(function(t){t.collapseDefault&&t.collapsible&&e.add(t.accessor),t.children&&n(t.children)})};return n(q),e},[q]),Kt=n.useState(jt),Vt=Kt[0],_t=Kt[1];n.useEffect(function(){Dt(q)},[q]);var Ut=n.useMemo(function(){var e,n=u([],At,!0);return te&&!(null===(e=null==At?void 0:At[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,At,yn]),Jt=n.useState(0),Xt=Jt[0],Yt=Jt[1],$t=n.useState("none"),Zt=$t[0],Qt=$t[1],er=function(e,t){var r=n.useState(function(){return function(e,n){if(!n||0===n.length)return new Set;if(e){var t=Array.from({length:n.length},function(e,n){return n});return new Set(t)}return new Set}(e,t)}),o=r[0],i=r[1];return n.useEffect(function(){i(t&&0!==t.length?function(e){var n=t.length,r=Array.from(e).filter(function(e){return n>e});return new Set(r)}:new Set)},[t]),{expandedDepths:o,setExpandedDepths:i}}(ie,on),nr=er.expandedDepths,tr=er.setExpandedDepths,rr=n.useState(new Map),or=rr[0],ir=rr[1],ar=n.useState(new Map),ur=ar[0],lr=ar[1],cr=function(){var e=n.useState(""),t=e[0],r=e[1],o=n.useRef(null);return n.useEffect(function(){return t&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){r("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[t]),{announcement:t,announce:function(e){r(e)}}}(),sr=cr.announcement,dr=cr.announce,fr=function(e){var t=e.effectiveHeaders,r=e.headerHeight,o=e.rowHeight,i=e.tableBodyContainerRef,a=n.useState(0),u=a[0],l=a[1],c=n.useCallback(function(e){var n,t;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(t=e.children)||void 0===t?void 0:t.length)?1+Math.max.apply(Math,e.children.map(c)):1},[]),s=n.useMemo(function(){var e=0;return t.forEach(function(n){var t=c(n);e=Math.max(e,t)}),e},[t,c]),d=n.useMemo(function(){var e=1;if("undefined"!=typeof window){var n=document.documentElement,t=getComputedStyle(n).getPropertyValue("--st-border-width").trim();if(t){var i=parseFloat(t);isNaN(i)||(e=i)}}return s*(null!=r?r:o)+e},[s,r,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:s}}({effectiveHeaders:Ut,headerHeight:Ie,rowHeight:un,tableBodyContainerRef:rt}),vr=fr.containerWidth,pr=fr.calculatedHeaderHeight,hr=fr.maxHeaderDepth,wr=n.useRef(0),mr=n.useRef(0),xr=n.useMemo(function(){var e=s(window.innerWidth),n=ze({headers:Ut,containerWidth:vr,maxPinnedWidthPercent:e,collapsedHeaders:Vt});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[Ut,vr,Vt]),gr=xr.mainBodyWidth,br=xr.pinnedLeftWidth,yr=xr.pinnedRightWidth,Cr=xr.pinnedLeftContentWidth,Ir=xr.pinnedRightContentWidth;n.useEffect(function(){if(d&&0!==vr&&!Pt){var e,n=function(e){var t=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?t.push.apply(t,n(e.children)):t.push(e))}),t};if((e=et.current?et.current.clientWidth:Math.max(0,vr-br-yr))>0){var t=At.filter(function(e){return!e.pinned});n(t).length===mr.current&&10>Math.abs(e-wr.current)||Dt(function(t){var r=t.filter(function(e){return!e.pinned}),o=n(r),i=o.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===i)return t;var a=e/i;if(.01>Math.abs(a-1))return t;wr.current=e,mr.current=o.length;var u=new Map,l=0;o.forEach(function(n,t){if(!n.pinned){var r,i="number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150;t===o.length-1?r=e-l:l+=r=Math.round(i*a),u.set(n.accessor,r)}});var c=function(e){var n;if(e.hide)return e;var t=null===(n=e.children)||void 0===n?void 0:n.map(c);if(!e.children||0===e.children.length){if(e.pinned)return exports.__assign(exports.__assign({},e),{children:t});var r=u.get(e.accessor);if(void 0!==r)return exports.__assign(exports.__assign({},e),{width:r,children:t});var o="number"==typeof e.width?e.width:"string"==typeof e.width&&e.width.endsWith("px")?parseFloat(e.width):150;return exports.__assign(exports.__assign({},e),{width:Math.round(o*a),children:t})}return exports.__assign(exports.__assign({},e),{children:t})};return t.map(c)})}}},[d,vr,Pt,At,br,yr]);var Rr=function(e){var t=e.rows,r=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return t;var e=function(e){return v(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=o[t],a=o[t+1],u=n[r];if(u&&M(u)){var l=i(u,t+1),c=exports.__assign({},n);return c[r]=l,e.forEach(function(e){var n=Hn(l,e.accessor,e.aggregation,a);void 0!==n&&S(c,e.accessor,n)}),c}return n})};return i(n)},[t,r,o])}({rows:Nt,headers:At,rowGrouping:on}),Sr=function(e){var t=e.rows,r=e.headers,o=e.externalFilterHandling,i=e.onFilterChange,a=e.announce,u=n.useState({}),l=u[0],c=u[1],s=xn(r),d=n.useMemo(function(){return Nn({externalFilterHandling:o,tableRows:t,filterState:l})},[t,l,o]),f=n.useCallback(function(e){var n,t=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));if(c(t),null==i||i(t),a){var r=s.get(e.accessor);r&&a("Filter applied to ".concat(r.label))}},[l,i,a,s]),v=n.useCallback(function(e){var n=exports.__assign({},l);if(delete n[e],c(n),null==i||i(n),a){var t=s.get(e);t&&a("Filter removed from ".concat(t.label))}},[l,i,a,s]),p=n.useCallback(function(){c({}),null==i||i({}),a&&a("All filters cleared")},[i,a]),h=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));return Nn({externalFilterHandling:o,tableRows:t,filterState:r})},[l,t,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Rr,headers:Ut,externalFilterHandling:ce,onFilterChange:_e,announce:dr}),Mr=Sr.filters,Nr=Sr.updateFilter,Er=Sr.clearFilter,Hr=Sr.clearAllFilters,kr=Sr.computeFilteredRowsPreview,Tr=function(e){var t=e.headers,r=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=e.initialSortColumn,l=e.initialSortDirection,c=e.announce,s=xn(t),d=n.useCallback(function(){if(!u)return null;var e=s.get(u);return e?{key:e,direction:l||"asc"}:null},[s,u,l]),f=n.useState(d),v=f[0],p=f[1],h=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.sortColumn,o=mn({headers:t,rows:e.rows,sortColumn:r});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:r,headers:t,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),w=n.useMemo(function(){return gn({externalSortHandling:o,tableRows:r,sortColumn:v,rowGrouping:a,headers:t,sortNestedRows:h})},[r,v,t,o,a,h]),m=n.useCallback(function(e){if(!e)return p(null),void(null==i||i(null));var n=e.accessor,t=e.direction,r=s.get(n);if(r){var o=null;if(t?o={key:r,direction:t}:v&&v.key.accessor===n?"asc"===v.direction&&(o={key:r,direction:"desc"}):o={key:r,direction:"asc"},p(o),null==i||i(o),c)if(o){var a="asc"===o.direction?"ascending":"descending";c("Sorted by ".concat(r.label,", ").concat(a))}else c("Sort removed from ".concat(r.label))}},[v,s,i,c]),x=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;o.length>r;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(t);if(!i)return r;var u=null;return v&&v.key.accessor===e?"asc"===v.direction&&(u={key:i,direction:"desc"}):u={key:i,direction:"asc"},gn({externalSortHandling:o,tableRows:r,sortColumn:u,rowGrouping:a,headers:t,sortNestedRows:h})},[v,t,r,o,a,h]);return{sort:v,sortedRows:w,updateSort:m,computeSortedRowsPreview:x}}({headers:At,tableRows:Sr.filteredRows,externalSortHandling:de,onSortChange:en,rowGrouping:on,initialSortColumn:Te,initialSortDirection:De,announce:dr}),Ar=Tr.sort,Dr=Tr.updateSort,Fr=Tr.computeSortedRowsPreview,Pr=Ln({rows:Tr.sortedRows,rowGrouping:on,expandedRows:or,collapsedRows:ur,expandedDepths:nr,rowStateMap:ut,hasLoadingRenderer:!!Le,hasErrorRenderer:!!re,hasEmptyRenderer:!!Z}),Lr=function(e){var t=e.tableRows,r=e.onRowSelectionChange,o=e.enableRowSelection,i=void 0!==o&&o,a=n.useState(new Set),u=a[0],l=a[1],c=n.useCallback(function(e){return!!i&&function(e,n){return n.has(e)}(e,u)},[u,i]),s=n.useCallback(function(){return!!i&&function(e,n){return 0!==e.length&&e.every(function(e){return n.has(N(e.rowPath||[e.position])+"")})}(t,u)},[t,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 n.has(N(e.rowPath||[e.position])+"")}).map(function(e){return e.row})}(t,u):[]},[t,u,i]),v=n.useCallback(function(e,n){if(i){var o=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(l(o),r){var a=t.find(function(n){return N(n.rowPath||[n.position])+""===e});a&&r({row:a.row,isSelected:n,selectedRows:o})}}},[u,t,r,i]),p=n.useCallback(function(e){var n;i&&(e?(n=function(e){return new Set(e.map(function(e){return N(e.rowPath||[e.position])+""}))}(t),r&&t.forEach(function(e){return r({row:e.row,isSelected:!0,selectedRows:n})})):(n=new Set,r&&u.forEach(function(e){var o=t.find(function(n){return N(n.rowPath||[n.position])+""===e});o&&r({row:o.row,isSelected:!1,selectedRows:n})})),l(n))},[t,r,u,i]),h=n.useCallback(function(e){if(i){var n=c(e);v(e,!n)}},[c,v,i]),w=n.useCallback(function(){if(i){if(r){var e=new Set;u.forEach(function(n){var o=t.find(function(e){return N(e.rowPath||[e.position])+""===n});o&&r({row:o.row,isSelected:!1,selectedRows:e})})}l(new Set)}},[u,t,r,i]);return{selectedRows:u,setSelectedRows:l,isRowSelected:c,areAllRowsSelected:s,selectedRowCount:d,selectedRowsData:f,handleRowSelect:v,handleSelectAll:p,handleToggleRow:h,clearSelection:w}}({tableRows:Pr,onRowSelectionChange:Qe,enableRowSelection:te});vt=Lr.selectedRows,pt=Lr.setSelectedRows,ht=Lr.isRowSelected,wt=Lr.areAllRowsSelected,mt=Lr.selectedRowCount,xt=Lr.selectedRowsData,gt=Lr.handleRowSelect,bt=Lr.handleSelectAll,yt=Lr.handleToggleRow,Ct=Lr.clearSelection;var Or=Ln({rows:Rr,rowGrouping:on,expandedRows:or,collapsedRows:ur,expandedDepths:nr,rowStateMap:ut,hasLoadingRenderer:!!Le,hasErrorRenderer:!!re,hasEmptyRenderer:!!Z}),Wr=n.useCallback(function(e){var n=kr(e);return on&&0!==on.length?k({rows:n,rowGrouping:on,expandedRows:or,collapsedRows:ur,expandedDepths:nr,rowStateMap:ut,hasLoadingRenderer:!!Le,hasErrorRenderer:!!re,hasEmptyRenderer:!!Z}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowPath:[n],absoluteRowIndex:n}})},[kr,on,or,ur,nr,ut,Le,re,Z]),Br=n.useCallback(function(e){var n=Fr(e);return on&&0!==on.length?k({rows:n,rowGrouping:on,expandedRows:or,collapsedRows:ur,expandedDepths:nr,rowStateMap:ut,hasLoadingRenderer:!!Le,hasErrorRenderer:!!re,hasEmptyRenderer:!!Z}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowPath:[n],absoluteRowIndex:n}})},[Fr,on,or,ur,nr,ut,Le,re,Z]),qr=function(e){var t=e.height,r=e.maxHeight,o=e.rowHeight,i=e.shouldPaginate,a=e.rowsPerPage,u=e.totalRowCount,l=e.headerHeight,c=e.footerHeight;return n.useMemo(function(){if(r){var e=En(r);if(0===e)return;var n=l||o;if(e>=n+u*o+(c||0)||20>u)return;return Math.max(0,e-n)}if(!t&&i&&a)return o*(a+1);if(t){var s=En(t);if(0!==s)return Math.max(0,s-o)}},[t,r,o,i,a,u,l,c])}({height:Re,maxHeight:Oe,rowHeight:un,shouldPaginate:An,rowsPerPage:sn,totalRowCount:null!=Vn?Vn:Pr.length,headerHeight:pr,footerHeight:An&&!Me?he:void 0}),zr=function(e){var t=e.allowAnimations,r=e.flattenedRows,o=e.originalFlattenedRows,i=e.currentPage,a=e.rowsPerPage,c=e.shouldPaginate,s=e.serverSidePagination,d=e.contentHeight,f=e.rowHeight,v=e.scrollTop,p=e.scrollDirection,h=void 0===p?"none":p,w=e.computeFilteredRowsPreview,m=e.computeSortedRowsPreview,x=n.useState(!1),g=x[0],b=x[1],y=n.useState([]),C=y[0],I=y[1],R=n.useRef([]),S=n.useRef([]),M=n.useMemo(function(){return l(f)},[f]),E=n.useRef(new Map),H=n.useRef(null),k=n.useCallback(function(e){var n=(i-1)*a;return(c&&!s?e.slice(n,i*a):e).map(function(e,t){return exports.__assign(exports.__assign({},e),{position:t,displayPosition:t,absoluteRowIndex:c&&!s?n+t:t})})},[i,a,s,c]);n.useMemo(function(){if(0===E.current.size&&o.length>0){var e=new Map;o.forEach(function(n,t){var r=N(n.rowPath||[n.position])+"";e.set(r,t)}),E.current=e}},[o]);var T=n.useMemo(function(){return k(r)},[r,k]),D=n.useMemo(function(){return void 0===d?T:A({bufferRowCount:M,contentHeight:d,tableRows:T,rowHeight:f,scrollTop:v,scrollDirection:h})},[T,d,f,v,h,M]),F=n.useCallback(function(e,n){var t=new Set(e.map(function(e){return N(e.rowPath||[e.position])+""})),r=new Set(n.map(function(e){return N(e.rowPath||[e.position])+""}));return{staying:n.filter(function(e){var n=N(e.rowPath||[e.position])+"";return t.has(n)}),entering:n.filter(function(e){var n=N(e.rowPath||[e.position])+"";return!t.has(n)}),leaving:e.filter(function(e){var n=N(e.rowPath||[e.position])+"";return!r.has(n)})}},[]),P=n.useMemo(function(){if(0===R.current.length)return!1;var e=T.map(function(e){return N(e.rowPath||[e.position])+""}),n=R.current.map(function(e){return N(e.rowPath||[e.position])+""});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[T]);n.useLayoutEffect(function(){if(!g){var e=function(){C.length>0&&I([])};if(!t||c)return e(),R.current=T,void(S.current=D);if(0===R.current.length)return e(),R.current=T,void(S.current=D);if(!P)return e(),R.current=T,void(S.current=D);H.current={tableRows:T,visibleRows:D},b(!0)}},[t,T,C.length,P,g,c,D]),n.useLayoutEffect(function(){if(g&&H.current&&C.length>0){var e=setTimeout(function(){var e=H.current;b(!1),I([]),R.current=e.tableRows,S.current=e.visibleRows,H.current=null},Dn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[g,C.length]);var L=n.useMemo(function(){if(!t||c)return D;if(C.length>0){var e=new Map,n=new Map;return T.forEach(function(t){var r=N(t.rowPath||[t.position])+"";e.set(r,t.position),n.set(r,t.displayPosition)}),C.map(function(t){var r=N(t.rowPath||[t.position])+"",o=e.get(r),i=n.get(r);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},t),{position:o,displayPosition:i}):t})}return D},[D,C,T,t,c]),O=n.useCallback(function(e){if(t&&!c&&void 0!==d){var n=w(e),r=k(n),o=A({bufferRowCount:M,contentHeight:d,tableRows:r,rowHeight:f,scrollTop:v,scrollDirection:h}),i=F(D,o).entering.map(function(e){var n=N(e.rowPath||[e.position])+"";return T.find(function(e){return N(e.rowPath||[e.position])+""===n})||e}).filter(Boolean);i.length>0&&I(u(u([],D,!0),i,!0))}},[t,c,w,k,d,f,v,h,F,T,D,M]),W=n.useCallback(function(e){if(t&&!c&&void 0!==d){var n=m(e),r=k(n),o=A({bufferRowCount:M,contentHeight:d,tableRows:r,rowHeight:f,scrollTop:v,scrollDirection:h}),i=F(D,o).entering.map(function(e){var n=N(e.rowPath||[e.position])+"";return T.find(function(e){return N(e.rowPath||[e.position])+""===n})||e}).filter(Boolean);i.length>0&&I(u(u([],D,!0),i,!0))}},[t,c,m,k,d,f,v,h,F,T,D,M]);return{currentTableRows:T,currentVisibleRows:D,isAnimating:g,prepareForFilterChange:O,prepareForSortChange:W,rowsToRender:L}}({allowAnimations:o,flattenedRows:Pr,originalFlattenedRows:Or,currentPage:Ht,rowsPerPage:sn,shouldPaginate:An,serverSidePagination:In,contentHeight:qr,rowHeight:un,scrollTop:Xt,scrollDirection:Zt,computeFilteredRowsPreview:Wr,computeSortedRowsPreview:Br}),Gr=zr.currentTableRows,jr=zr.rowsToRender,Kr=zr.prepareForFilterChange,Vr=zr.prepareForSortChange,_r=zr.isAnimating,Ur=n.useRef(new Map),Jr=n.useRef(new Map),Xr=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,u=e.onCellEdit,l=e.cellRegistry,c=e.collapsedHeaders,s=e.rowHeight,d=e.enableRowSelection,f=void 0!==d&&d,v=e.copyHeadersToClipboard,p=void 0!==v&&v,h=n.useState(new Set),w=h[0],m=h[1],g=n.useState(new Set),b=g[0],y=g[1],C=n.useState(null),I=C[0],M=C[1],E=n.useState(null),H=E[0],k=E[1],T=n.useState(new Set),A=T[0],D=T[1],F=n.useState(new Set),P=F[0],W=F[1],B=n.useState(!1),q=B[0],z=B[1],G=n.useRef(!1),j=n.useRef(null),K=n.useMemo(function(){var e=new Set;return w.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),b.forEach(function(n){e.add(n)}),e},[w,b]),V=n.useMemo(function(){var e=new Set;return w.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),b.size>0&&o.forEach(function(n){var t=N(n.rowPath||[n.position]);e.add(t+"")}),e},[w,b,o]),_=n.useMemo(function(){return r.flatMap(function(e){return x(e,c)})},[r,c]),U=n.useCallback(function(){if(0!==w.size){var e=function(e,n,t,r){void 0===r&&(r=!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 r,o=n.split("-").map(Number),u=o[0],l=o[1];e[u]||(e[u]=[]);var c=i.get(l),s=a.get(l);if(c&&(null===(r=t[u])||void 0===r?void 0:r.row)){var d=t[u].row,f=R(d,c);if(!1!==(null==s?void 0:s.useFormattedValueForClipboard)&&(null==s?void 0:s.valueFormatter)){var v=s.valueFormatter({accessor:c,colIndex:l,row:d,rowIndex:u,value:f});e[u][l]=v}else e[u][l]=!s||"lineAreaChart"!==s.type&&"barChart"!==s.type?f:Array.isArray(f)?f.join(", "):""}else e[u][l]="";return e},{}),l=new Set;r&&Array.from(e).forEach(function(e){var n=e.split("-").map(Number);l.add(n[1])});var c="";r&&l.size>0&&(c=Array.from(l).sort(function(e,n){return e-n}).map(function(e){var n,t=a.get(e);return null!==(n=null==t?void 0:t.label)&&void 0!==n?n:""}).join("\t"));var s=Object.values(u).map(function(e){return Object.values(e).join("\t")}).join("\n");return r&&c?"".concat(c,"\n").concat(s):s}(w,_,o,p);navigator.clipboard.writeText(e),D(new Set(w)),setTimeout(function(){return D(new Set)},800)}},[w,_,o,p]),J=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i;return a(this,function(a){switch(a.label){case 0:if(!H)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,t,r,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 c=t.filter(function(e){return!e.hide&&!e.excludeFromRender}),s=n.rowIndex,d=n.colIndex;return l.forEach(function(e,n){e.split("\t").forEach(function(e,t){var l=s+n,f=d+t;if(r.length>l&&c.length>f){var v=r[l],p=c[f],h=N(v.rowPath||[v.position]);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 x=new Date(e);isNaN(x.getTime())||(w=x)}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 g="".concat(h,"-").concat(p.accessor),b=i.get(g);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 C="".concat(l,"-").concat(f,"-").concat(h);u.add(C)}}})}),{updatedCells:a,warningCells:u}}(e,H,_,o,u,l),r=n.warningCells,(t=n.updatedCells).size>0&&(D(t),setTimeout(function(){return D(new Set)},800)),r.size>0&&(W(r),setTimeout(function(){return W(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]}})})},[H,_,o,u,l]),X=n.useCallback(function(){if(0!==w.size){var e=function(e,n,t,r,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],c=n[1];if(t.length>l&&u.length>c){var s=t[l],d=u[c],f=N(s.rowPath||[s.position]);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(s.row,d.accessor))?[]:""),S(s.row,d.accessor,v),o){var p="".concat(f,"-").concat(d.accessor),h=o.get(p);h&&h.updateContent(v)}null==r||r({accessor:d.accessor,newValue:v,row:s.row,rowIndex:l}),i.add(e)}else a.add(e)}}),{deletedCells:i,warningCells:a}}(w,_,o,u,l),n=e.deletedCells,t=e.warningCells;n.size>0&&(D(n),setTimeout(function(){return D(new Set)},800)),t.size>0&&(W(t),setTimeout(function(){return W(new Set)},800))}},[w,_,o,u,l]),Y=n.useCallback(function(e,n){for(var t=new Set,r=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=r;i>=l;l++)for(var c=a;u>=c;c++)if(l>=0&&o.length>l){if(f&&0===c)continue;var d=o[l],v=N(d.rowPath||[d.position]);t.add(O({colIndex:c,rowIndex:l,rowId:v}))}y(new Set),M(null),m(t),k(n),setTimeout(function(){return L(n,s)},0)},[o,s,f]),$=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?_.length:_.length-1)>=e.colIndex){var n=O(e);y(new Set),M(null),m(new Set([n])),k(e),setTimeout(function(){return L(e,s)},0)}},[_.length,o.length,s,f]),Z=n.useCallback(function(e,n){void 0===n&&(n=!1),m(new Set),k(null),y(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&M(e[e.length-1])},[]);!function(e){var t=e.copyToClipboard,r=e.deleteSelectedCells,o=e.enableRowSelection,i=void 0!==o&&o,a=e.initialFocusedCell,u=e.leafHeaders,l=e.pasteFromClipboard,c=e.selectCellRange,s=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 c=document.activeElement;if(!(c instanceof HTMLInputElement||c instanceof HTMLTextAreaElement||c instanceof HTMLSelectElement||"true"===(null==c?void 0:c.getAttribute("contenteditable")))){var s=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,E=0;m.length>E;E++)for(var H=0;u.length>H;H++){var k=i?H+1:H,T=m[E],A=N(T.rowPath||[T.position]);M.add("".concat(E,"-").concat(k,"-").concat(A))}return p(M),h(new Set),void v(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void r();var D=m[s];if((D?N(D.rowPath||[D.position]):null)!==S){var F=m.findIndex(function(e){return N(e.rowPath||[e.position])===S});if(-1===F)return;s=F}var P=function(e,n,t){var r=e,o=n;return"up"===t?r=0:"down"===t?r=m.length-1:"left"===t?o=i?1:0:"right"===t&&(o=i?u.length:u.length-1),{rowIndex:r,colIndex:o}};"ArrowUp"===e.key?(e.preventDefault(),n(e,s,R,P)):"ArrowDown"===e.key?(e.preventDefault(),o(e,s,R,P)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),x(e,s,R,P)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),g(e,s,R,P)):"Home"===e.key?(e.preventDefault(),b(e,s)):"End"===e.key?(e.preventDefault(),y(e,s)):"PageUp"===e.key?(e.preventDefault(),C(e,s,R)):"PageDown"===e.key?(e.preventDefault(),I(e,s,R)):"Escape"===e.key&&(p(new Set),h(new Set),v(null),w.current=null)}else t()}}},n=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a);var o=n-1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),o>=0){var i=N((u=m[o]).rowPath||[u.position]);c(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else if(n>0){var u;o=n-1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),i=N((u=m[o]).rowPath||[u.position]),s({rowIndex:o,colIndex:t,rowId:i}),w.current=null}},o=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a);var o=n+1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),m.length>o){var i=N((u=m[o]).rowPath||[u.position]);c(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else if(m.length-1>n){var u;o=n+1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),i=N((u=m[o]).rowPath||[u.position]),s({rowIndex:o,colIndex:t,rowId:i}),w.current=null}},x=function(e,n,t,r){if(e.shiftKey&&"ArrowLeft"===e.key){w.current||(w.current=a);var o=t-1;if(e.ctrlKey||e.metaKey)o=r(n,t,"left").colIndex;else if(i&&0===o)return;if(o>=0){var u=N((l=m[n]).rowPath||[l.position]);c(w.current,{rowIndex:n,colIndex:o,rowId:u})}}else if(t>0){if(o=t-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)o=r(n,t,"left").colIndex;else if(i&&0===o)return;var l;0>o||(u=N((l=m[n]).rowPath||[l.position]),s({rowIndex:n,colIndex:o,rowId:u}),w.current=null)}},g=function(e,n,t,r){var o=i?u.length:u.length-1;if(e.shiftKey&&"ArrowRight"===e.key){w.current||(w.current=a);var l=t+1;if((e.ctrlKey||e.metaKey)&&(l=r(n,t,"right").colIndex),o>=l){var d=N((f=m[n]).rowPath||[f.position]);c(w.current,{rowIndex:n,colIndex:l,rowId:d})}}else if(o>t){var f;l=t+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(l=r(n,t,"right").colIndex),l>o||(d=N((f=m[n]).rowPath||[f.position]),s({rowIndex:n,colIndex:l,rowId:d}),w.current=null)}},b=function(e,n,t){if(e.shiftKey){w.current||(w.current=a);var r=n,o=i?1:0;(e.ctrlKey||e.metaKey)&&(r=0);var u=N((l=m[r]).rowPath||[l.position]);c(w.current,{rowIndex:r,colIndex:o,rowId:u})}else{var l;r=n,o=i?1:0,(e.ctrlKey||e.metaKey)&&(r=0),u=N((l=m[r]).rowPath||[l.position]),s({rowIndex:r,colIndex:o,rowId:u}),w.current=null}},y=function(e,n,t){if(e.shiftKey){w.current||(w.current=a);var r=n,o=i?u.length:u.length-1;(e.ctrlKey||e.metaKey)&&(r=m.length-1);var l=N((d=m[r]).rowPath||[d.position]);c(w.current,{rowIndex:r,colIndex:o,rowId:l})}else{var d;r=n,o=i?u.length:u.length-1,(e.ctrlKey||e.metaKey)&&(r=m.length-1),l=N((d=m[r]).rowPath||[d.position]),s({rowIndex:r,colIndex:o,rowId:l}),w.current=null}},C=function(e,n,t){var r=Math.max(0,n-10);if(e.shiftKey){w.current||(w.current=a);var o=N((i=m[r]).rowPath||[i.position]);c(w.current,{rowIndex:r,colIndex:t,rowId:o})}else{var i;o=N((i=m[r]).rowPath||[i.position]),s({rowIndex:r,colIndex:t,rowId:o}),w.current=null}},I=function(e,n,t){var r=Math.min(m.length-1,n+10);if(e.shiftKey){w.current||(w.current=a);var o=N((i=m[r]).rowPath||[i.position]);c(w.current,{rowIndex:r,colIndex:t,rowId:o})}else{var i;o=N((i=m[r]).rowPath||[i.position]),s({rowIndex:r,colIndex:t,rowId:o}),w.current=null}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[d,a,m,u,s,c,f,p,h,v,t,l,r,w,i])}({selectableCells:t,initialFocusedCell:H,tableRows:o,leafHeaders:_,selectSingleCell:$,selectCellRange:Y,selectedCells:w,setSelectedCells:m,setSelectedColumns:y,setLastSelectedColumnIndex:M,copyToClipboard:U,pasteFromClipboard:J,deleteSelectedCells:X,startCell:j,enableRowSelection:f});var Q=n.useCallback(function(e,n){var t=new Set,r=new Map;o.forEach(function(e,n){var t=N(e.rowPath||[e.position]);r.set(t+"",n)});for(var i=r.get(e.rowId+""),a=r.get(n.rowId+""),u=void 0!==i?i:e.rowIndex,l=void 0!==a?a:n.rowIndex,c=Math.min(u,l),s=Math.max(u,l),d=Math.min(e.colIndex,n.colIndex),v=Math.max(e.colIndex,n.colIndex),p=c;s>=p;p++)for(var h=d;v>=h;h++)if(p>=0&&o.length>p){if(f&&0===h)continue;var w=o[p],x=N(w.rowPath||[w.position]);t.add(O({colIndex:h,rowIndex:p,rowId:x}))}m(t)},[o,f]),ee=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(!t)return null;var r=t.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(r.left,Math.min(r.right,e)),a=Math.max(r.top,Math.min(r.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,t=n.getBoundingClientRect(),r=t.top+t.height/2,o=Math.sqrt(Math.pow(t.left+t.width/2-i,2)+Math.pow(r-a,2));l>o&&(l=o,u=n)}}),null!==u){var c=u,s=parseInt(c.getAttribute("data-row-index")||"-1",10),d=parseInt(c.getAttribute("data-col-index")||"-1",10),f=c.getAttribute("data-row-id");if(s>=0&&d>=0&&null!==f)return{rowIndex:s,colIndex:d,rowId:f}}return null},[]),ne=n.useCallback(function(e,n){var t=document.elementFromPoint(e,n);if(!t)return null;var r=t.closest(".st-cell");if(r instanceof HTMLElement){var o=parseInt(r.getAttribute("data-row-index")||"-1",10),i=parseInt(r.getAttribute("data-col-index")||"-1",10),a=r.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return ee(e,n)},[ee]),te=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(t){var r=t.getBoundingClientRect();r.top+50>n?t.scrollTop-=10*Math.min(3,1+Math.max(0,r.top-n)/100):n>r.bottom-50&&(t.scrollTop+=10*Math.min(3,1+Math.max(0,n-r.bottom)/100));var o=document.querySelector(".st-body-main");o&&(r.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,r.left-e)/100):e>r.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-r.right)/100)))}},[]),re=n.useCallback(function(e){var n=e.colIndex,t=O({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),r=w.has(t),o=b.has(n);return r||o},[w,b]),oe=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId;if(q)return"";var i=[],a=o[t-1],u=a?N(a.rowPath||[a.position]):null,l=o[t+1],c=l?N(l.rowPath||[l.position]):null,s=null!==u?{colIndex:n,rowIndex:t-1,rowId:u}:null,d=null!==c?{colIndex:n,rowIndex:t+1,rowId:c}:null,f={colIndex:n-1,rowIndex:t,rowId:r},v={colIndex:n+1,rowIndex:t,rowId:r};return(!s||!re(s)||b.has(n)&&0===t)&&i.push("st-selected-top-border"),(!d||!re(d)||b.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),re(f)||i.push("st-selected-left-border"),re(v)||i.push("st-selected-right-border"),i.join(" ")},[q,re,o,b]),ie=n.useMemo(function(){return H?function(e){return e.rowIndex===H.rowIndex&&e.colIndex===H.colIndex&&e.rowId===H.rowId}:function(){return!1}},[H]),ae=n.useCallback(function(e){var n=O({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return A.has(n)},[A]),ue=n.useCallback(function(e){var n=O({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return P.has(n)},[P]);return{getBorderClass:oe,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){G.current=!0,z(!0),j.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){y(new Set),M(null);var e=O({colIndex:n,rowIndex:r,rowId:o});m(new Set([e])),k({rowIndex:r,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,c=function(){if(G.current&&j.current){if(null!==i&&null!==a){te(i,a);var e=Date.now();if(e-l>=16){var n=ne(i,a);n&&Q(j.current,n),l=e}}u=requestAnimationFrame(c)}else null!==u&&(cancelAnimationFrame(u),u=null)},s=function(e){G.current&&j.current&&(i=e.clientX,a=e.clientY)},d=function(){G.current=!1,z(!1),null!==u&&(cancelAnimationFrame(u),u=null),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",d)};document.addEventListener("mousemove",s),document.addEventListener("mouseup",d),u=requestAnimationFrame(c)}},handleMouseOver:function(e){t&&G.current&&j.current&&Q(j.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ae,isWarningFlashing:ue,isInitialFocusedCell:ie,isSelected:re,lastSelectedColumnIndex:I,pasteFromClipboard:J,selectColumns:Z,selectedCells:w,selectedColumns:b,setInitialFocusedCell:k,setSelectedCells:m,setSelectedColumns:y,deleteSelectedCells:X,columnsWithSelectedCells:K,rowsWithSelectedCells:V,startCell:j}}({selectableCells:fn,headers:At,tableRows:Gr,onCellEdit:Ge,cellRegistry:Ur.current,collapsedHeaders:Vt,rowHeight:un,enableRowSelection:te,copyHeadersToClipboard:W}),Yr=Xr.getBorderClass,$r=Xr.handleMouseDown,Zr=Xr.handleMouseOver,Qr=Xr.isCopyFlashing,eo=Xr.isInitialFocusedCell,no=Xr.isSelected,to=Xr.isWarningFlashing,ro=Xr.selectColumns,oo=Xr.selectedCells,io=Xr.selectedColumns,ao=Xr.setInitialFocusedCell,uo=Xr.setSelectedCells,lo=Xr.setSelectedColumns,co=Xr.columnsWithSelectedCells,so=Xr.rowsWithSelectedCells,fo=Xr.startCell,vo=n.useCallback(function(e){Vr(e),setTimeout(function(){Dr({accessor:e})},0)},[Vr,Dr]),po=n.useCallback(function(e){Dt(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown,c=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")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set),c&&(c.current=null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,u,l,c])}({selectableColumns:wn,selectedCells:oo,selectedColumns:io,setSelectedCells:uo,setSelectedColumns:lo,activeHeaderDropdown:zt,setActiveHeaderDropdown:Gt,startCell:fo}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){t(),r.current&&o(r.current.offsetWidth-r.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:it,tableBodyContainerRef:rt,setScrollbarWidth:St}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:Ue}),function(e){var t=e.cellRegistryRef,r=e.clearAllFilters,o=e.clearFilter,i=e.currentPage,a=e.expandedDepths,l=e.filters,c=e.flattenedRows,s=e.headerRegistryRef,d=e.headers,f=e.includeHeadersInCSVExport,v=e.rowGrouping,p=e.rows,h=e.setCollapsedRows,w=e.setCurrentPage,x=e.setExpandedDepths,g=e.setExpandedRows,b=e.sort,y=e.tableRef,C=e.updateFilter,I=e.updateSort,M=e.visibleRows;n.useEffect(function(){y&&(y.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==p?void 0:p[r];if(i){var a=N([r]),u=m({rowId:a,accessor:n}),l=t.current.get(u);l&&l.updateContent(o),void 0!==R(i,n)&&S(i,n,o)}},setHeaderRename:function(e){var n=s.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return M},getAllRows:function(){return c},getHeaders:function(){return d},exportToCSV:function(e){!function(e,n,t,r){void 0===r&&(r=!0);var o=function(e,n,t){void 0===t&&(t=!0);var r=function(e){var n=[],t=function(e){for(var r=0,o=e;o.length>r;r++){var i=o[r];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?(i.singleRowChildren&&n.push(i),t(i.children)):n.push(i))}};return t(e),n}(n),o=r.map(function(e){return kn(e.label)}).join(","),i=e.map(function(e,n){var t=e.row;return r.map(function(e,r){var o=R(t,e.accessor);if(e.exportValueGetter){var i=e.valueFormatter?e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}):void 0,a=e.exportValueGetter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o,formattedValue:i});return kn(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}),kn(i)):kn(o)}).join(",")});return(t?u([o],i,!0):i).join("\n")}(e,n,r);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(o,t)}(c,d,(void 0===e?{}:e).filename,f)},getSortState:function(){return b},applySortState:Tn(I),getFilterState:function(){return l},applyFilter:Tn(C),clearFilter:Tn(o),clearAllFilters:Tn(r),getCurrentPage:function(){return i},setPage:function(e){return w(e)},expandAll:function(){var e=Array.from({length:(null==v?void 0:v.length)||0},function(e,n){return n});x(new Set(e)),g(new Map),h(new Map)},collapseAll:function(){x(new Set),g(new Map),h(new Map)},expandDepth:function(e){x(function(n){for(var t=new Set(n),r=0;e>=r;r++)t.add(r);return t}),g(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),h(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},collapseDepth:function(e){x(function(n){var t=new Set(n);return t.delete(e),t}),g(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),h(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},toggleDepth:function(e){x(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),g(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),h(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},setExpandedDepths:function(e){x(e)},getExpandedDepths:function(){return a},getGroupingProperty:function(e){return null==v?void 0:v[e]},getGroupingDepth:function(e){var n;return null!==(n=null==v?void 0:v.indexOf(e))&&void 0!==n?n:-1}})},[t,r,o,i,a,l,c,s,d,f,v,e.rowIndexMap,p,e.rowsPerPage,e.serverSidePagination,h,w,x,g,e.setRows,e.shouldPaginate,b,y,C,I,M])}({cellRegistryRef:Ur,clearAllFilters:Hr,clearFilter:Er,currentPage:Ht,expandedDepths:nr,filters:Mr,flattenedRows:Pr,headerRegistryRef:Jr,headers:Ut,includeHeadersInCSVExport:ke,rowGrouping:on,rowIndexMap:ft,rows:Nt,rowsPerPage:sn,serverSidePagination:In,setCollapsedRows:lr,setCurrentPage:kt,setExpandedDepths:tr,setExpandedRows:ir,setRows:dt,shouldPaginate:An,sort:Ar,tableRef:Gn,updateFilter:Nr,updateSort:Dr,visibleRows:jr}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:Mr,onFilterChange:_e}),function(e){var t=e.sort,r=e.onSortChange,o=xe(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:Ar,onSortChange:en});var ho=n.useCallback(function(e){Kr(e),setTimeout(function(){Nr(e)},0)},[Kr,Nr]),wo=!Pe&&0===Gr.length;return e.jsx(B,exports.__assign({value:{activeHeaderDropdown:zt,allowAnimations:o,areAllRowsSelected:wt,autoExpandColumns:d,canExpandRowGroup:f,cellRegistry:Ur.current,cellUpdateFlash:h,clearSelection:Ct,collapsedHeaders:Vt,columnBorders:b,columnReordering:T,columnResizing:F,columnsWithSelectedCells:co,copyHeadersToClipboard:W,draggedHeaderRef:Zn,editColumns:J,emptyStateRenderer:Z,enableHeaderEditing:ee,enableRowSelection:te,errorStateRenderer:re,expandedDepths:nr,expandIcon:ue,filterIcon:ve,filters:Mr,forceUpdate:it,getBorderClass:Yr,handleApplyFilter:ho,handleClearAllFilters:Hr,handleClearFilter:Er,handleMouseDown:$r,handleMouseOver:Zr,handleRowSelect:gt,handleSelectAll:bt,handleToggleRow:yt,headerCollapseIcon:ge,headerContainerRef:ot,headerDropdown:be,headerExpandIcon:Ce,headerHeight:null!=Ie?Ie:un,headerRegistry:Jr.current,headers:Ut,hoveredHeaderRef:Qn,includeHeadersInCSVExport:ke,isAnimating:_r,isCopyFlashing:Qr,isInitialFocusedCell:eo,isLoading:Pe,isResizing:Pt,isRowSelected:ht,isScrolling:Wt,isSelected:no,isWarningFlashing:to,loadingStateRenderer:Le,mainBodyRef:et,maxHeaderDepth:hr,nextIcon:Be,onCellClick:qe,onCellEdit:Ge,onColumnOrderChange:je,onColumnSelect:Ke,onColumnVisibilityChange:Ve,onHeaderEdit:Je,onLoadMore:Xe,onRowGroupExpand:Ze,onSort:vo,onTableHeaderDragEnd:po,pinnedLeftRef:nt,pinnedRightRef:tt,prevIcon:tn,rowButtons:rn,rowGrouping:on,rowHeight:un,rowStateMap:ut,rows:st,rowsWithSelectedCells:so,scrollbarWidth:Rt,selectColumns:ro,selectableColumns:wn,selectedColumns:io,selectedRowCount:mt,selectedRows:vt,selectedRowsData:xt,setActiveHeaderDropdown:Gt,setCollapsedHeaders:_t,setHeaders:Dt,setInitialFocusedCell:ao,setIsResizing:Lt,setIsScrolling:Bt,setRowStateMap:lt,setSelectedCells:uo,setSelectedColumns:lo,setSelectedRows:pt,setExpandedDepths:tr,setExpandedRows:ir,setCollapsedRows:lr,shouldPaginate:An,sortDownIcon:Pn,sortUpIcon:Bn,tableBodyContainerRef:rt,tableEmptyStateRenderer:zn,tableRows:Gr,theme:Kn,expandedRows:or,collapsedRows:ur,useHoverRowBackground:Un,useOddColumnBackground:Xn,useOddEvenRowBackground:$n}},{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(Kn," ").concat(null!=w?w:""," ").concat(b?"st-column-borders":""),style:Oe?{maxHeight:Oe,height:void 0===qr?"auto":Oe}:Re?{height:Re}:{}},{children:[e.jsx(Mn,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(pn,{hideHeader:Ee,pinnedLeftWidth:br,pinnedRightWidth:yr,setScrollTop:Yt,setScrollDirection:Qt,shouldShowEmptyState:wo,sort:Ar,tableRows:Gr,rowsToRender:jr}),e.jsx(Sn,{columnEditorText:E,editColumns:J,editColumnsInitOpen:$,headers:At,position:C})]})),!wo&&e.jsx(hn,{mainBodyRef:et,mainBodyWidth:gr,pinnedLeftWidth:br,pinnedRightWidth:yr,pinnedLeftContentWidth:Cr,pinnedRightContentWidth:Ir,tableBodyContainerRef:rt}),!wo&&e.jsx(z,{currentPage:Ht,footerRenderer:we,hideFooter:Me,onPageChange:kt,onNextPage:Ye,onUserPageChange:$e,rowsPerPage:sn,shouldPaginate:An,totalPages:Math.ceil((null!=Vn?Vn:Pr.length)/sn),totalRows:null!=Vn?Vn:Pr.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:sr}))]}))}))},Bn=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,c=n.fillOpacity,s=void 0===c?.2:c,d=n.strokeWidth,f=void 0===d?2:d,v=n.className,p=void 0===v?"":v,h=n.min,w=n.max;if(!t||0===t.length)return null;var m=void 0!==h?h:Math.min.apply(Math,t),x=(void 0!==w?w:Math.max.apply(Math,t))-m||1,g=a,b=t.map(function(e,n){return{x:n/(t.length-1)*100,y:g-(e-m)/x*g}}).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(g,"\n L 0,").concat(g,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(g),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(p),style:{display:"block"}},{children:[e.jsx("path",{d:y,fill:l||"var(--st-chart-fill-color)",fillOpacity:s,stroke:"none",vectorEffect:"non-scaling-stroke"}),e.jsx("path",{d:b,fill:"none",stroke:u||"var(--st-chart-color)",strokeWidth:f,strokeLinecap:"round",strokeLinejoin:"round",vectorEffect:"non-scaling-stroke"})]}))},qn=Object.freeze({__proto__:null,default:Bn}),zn=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,c=void 0===l?2:l,s=n.className,d=void 0===s?"":s,f=n.min,v=n.max;if(!t||0===t.length)return null;var p=void 0!==f?f:Math.min.apply(Math,t),h=void 0!==v?v:Math.max.apply(Math,t),w=h-p||1,m=a,x=(100-c*(t.length-1))/t.length,g=0>p,b=g?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"}},{children:t.map(function(n,t){var r=t*(x+c),o=(n-p)/w*m,i=m-o,a=o;return g&&(0>n?(a=Math.abs(n)/w*m,i=b):i=b-(a=n/w*m)),e.jsx("rect",{x:r,y:i,width:x,height:a,fill:u||"var(--st-chart-color)",rx:1},t)})}))},Gn=Object.freeze({__proto__:null,default:zn});exports.ANIMATION_CONFIGS=Dn,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=G,exports.AngleRightIcon=j,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=K,exports.BarChart=zn,exports.CheckIcon=V,exports.DefaultEmptyState=On,exports.DescIcon=_,exports.FilterIcon=U,exports.LineAreaChart=Bn,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=J,exports.SimpleTable=function(t){var r=n.useState(!1),o=r[0],i=r[1];return n.useEffect(function(){i(!0)},[]),o?e.jsx(Wn,exports.__assign({},t)):null},exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,u,l,c,s,d,f,v,p,h,w,m,x;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,u=void 0===(i=t.duration)?300:i,c=void 0===(l=t.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(s=t.delay)?0:s,f=t.onComplete,p=void 0===(v=t.respectReducedMotion)||v,An()&&p?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(h=n.getBoundingClientRect(),m=e-(w=h.top),x=r-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(c),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(x,"px, 0)");var t=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",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,t=e.finalConfig,r=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}}(r,o),0===e.x&&0===e.y||An()&&!1!==t.respectReducedMotion?[2]:(u=t,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=An()?exports.__assign(exports.__assign({},Dn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},Dn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},Dn.ROW_REORDER),u),Fn(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,Pn(n,i,t)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=xe,exports.useTableContext=q;
2
+ //# sourceMappingURL=index-0bd94a48.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-0bd94a48.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-1258c9e1.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.DefaultEmptyState=e.DefaultEmptyState,exports.DescIcon=e.DescIcon,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-0bd94a48.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.DefaultEmptyState=e.DefaultEmptyState,exports.DescIcon=e.DescIcon,exports.FilterIcon=e.FilterIcon,exports.LineAreaChart=e.LineAreaChart,exports.SelectIcon=e.SelectIcon,exports.SimpleTable=e.SimpleTable;
2
2
  //# sourceMappingURL=index.js.map
@@ -1,12 +1,10 @@
1
1
  import CellValue from "./CellValue";
2
2
  import { Accessor } from "./HeaderObject";
3
3
  import Row from "./Row";
4
- import { RowId } from "./RowId";
5
4
  type CellClickProps = {
6
5
  accessor: Accessor;
7
6
  colIndex: number;
8
7
  row: Row;
9
- rowId: RowId;
10
8
  rowIndex: number;
11
9
  value: CellValue;
12
10
  };
@@ -5,7 +5,6 @@ interface OnRowGroupExpandProps {
5
5
  row: Row;
6
6
  depth: number;
7
7
  event: MouseEvent | KeyboardEvent;
8
- rowId: string | number;
9
8
  groupingKey?: string;
10
9
  isExpanded: boolean;
11
10
  rowIndexPath: (string | number)[];
@@ -3,6 +3,5 @@ import Row from "./Row";
3
3
  export interface RowButtonProps {
4
4
  row: Row;
5
5
  rowIndex: number;
6
- rowId: string | number;
7
6
  }
8
7
  export type RowButton = (props: RowButtonProps) => ReactNode;
@@ -1,7 +1,6 @@
1
1
  import Cell from "../types/Cell";
2
2
  import HeaderObject from "../types/HeaderObject";
3
3
  import type TableRowType from "../types/TableRow";
4
- import { Accessor } from "../types/HeaderObject";
5
4
  interface CellRegistryEntry {
6
5
  updateContent: (newValue: any) => void;
7
6
  }
@@ -12,14 +11,14 @@ export declare const copySelectedCellsToClipboard: (selectedCells: Set<string>,
12
11
  /**
13
12
  * Pastes clipboard data into cells starting from the initial focused cell
14
13
  */
15
- export declare const pasteClipboardDataToCells: (clipboardText: string, initialFocusedCell: Cell, leafHeaders: HeaderObject[], tableRows: TableRowType[], rowIdAccessor: Accessor, onCellEdit?: ((props: any) => void) | undefined, cellRegistry?: Map<string, CellRegistryEntry>) => {
14
+ export declare const pasteClipboardDataToCells: (clipboardText: string, initialFocusedCell: Cell, leafHeaders: HeaderObject[], tableRows: TableRowType[], onCellEdit?: ((props: any) => void) | undefined, cellRegistry?: Map<string, CellRegistryEntry>) => {
16
15
  updatedCells: Set<string>;
17
16
  warningCells: Set<string>;
18
17
  };
19
18
  /**
20
19
  * Deletes content from selected cells (sets them to appropriate empty values)
21
20
  */
22
- export declare const deleteSelectedCellsContent: (selectedCells: Set<string>, leafHeaders: HeaderObject[], tableRows: TableRowType[], rowIdAccessor: Accessor, onCellEdit?: ((props: any) => void) | undefined, cellRegistry?: Map<string, CellRegistryEntry>) => {
21
+ export declare const deleteSelectedCellsContent: (selectedCells: Set<string>, leafHeaders: HeaderObject[], tableRows: TableRowType[], onCellEdit?: ((props: any) => void) | undefined, cellRegistry?: Map<string, CellRegistryEntry>) => {
23
22
  deletedCells: Set<string>;
24
23
  warningCells: Set<string>;
25
24
  };
@@ -1,9 +1,10 @@
1
1
  import Row from "../types/Row";
2
- import HeaderObject, { Accessor } from "../types/HeaderObject";
2
+ import TableRow from "../types/TableRow";
3
+ import HeaderObject from "../types/HeaderObject";
3
4
  /**
4
- * Get the set of selected row IDs from an array of rows
5
+ * Get the set of selected row IDs from an array of table rows
5
6
  */
6
- export declare const getSelectedRowIds: (rows: Row[], rowIdAccessor: Accessor) => string[];
7
+ export declare const getSelectedRowIds: (tableRows: TableRow[]) => string[];
7
8
  /**
8
9
  * Check if a specific row is selected
9
10
  */
@@ -11,7 +12,7 @@ export declare const isRowSelected: (rowId: string, selectedRows: Set<string>) =
11
12
  /**
12
13
  * Check if all rows are selected
13
14
  */
14
- export declare const areAllRowsSelected: (rows: Row[], rowIdAccessor: Accessor, selectedRows: Set<string>) => boolean;
15
+ export declare const areAllRowsSelected: (tableRows: TableRow[], selectedRows: Set<string>) => boolean;
15
16
  /**
16
17
  * Toggle selection of a single row
17
18
  */
@@ -19,15 +20,15 @@ export declare const toggleRowSelection: (rowId: string, selectedRows: Set<strin
19
20
  /**
20
21
  * Select all rows
21
22
  */
22
- export declare const selectAllRows: (rows: Row[], rowIdAccessor: Accessor) => Set<string>;
23
+ export declare const selectAllRows: (tableRows: TableRow[]) => Set<string>;
23
24
  /**
24
25
  * Deselect all rows
25
26
  */
26
27
  export declare const deselectAllRows: () => Set<string>;
27
28
  /**
28
- * Get the selected rows from the rows array
29
+ * Get the selected rows from the table rows array
29
30
  */
30
- export declare const getSelectedRows: (rows: Row[], rowIdAccessor: Accessor, selectedRows: Set<string>) => Row[];
31
+ export declare const getSelectedRows: (tableRows: TableRow[], selectedRows: Set<string>) => Row[];
31
32
  /**
32
33
  * Get the count of selected rows
33
34
  */
@@ -25,26 +25,19 @@ export declare const setNestedValue: (obj: Row, path: Accessor, value: CellValue
25
25
  */
26
26
  export declare const isRowArray: (data: any) => data is Row[];
27
27
  /**
28
- * Get the row ID from a row using the specified accessor.
29
- * For nested/grouped rows, uses the full row path to ensure uniqueness.
30
- * This prevents ID collisions when the same ID appears at different nesting levels.
28
+ * Get the row ID from its position path in the data structure.
29
+ * Uses the row's index-based path to create a unique, stable identifier.
31
30
  *
32
31
  * Examples:
33
- * - Company at index 0 (depth 0): "0"
34
- * - Division with id=1 under company 0 (depth 1): "0-divisions-0"
35
- * - Division with id=1 under company 1 (depth 1): "1-divisions-0"
36
- * - Team with id=1 under company 0, division 0 (depth 2): "0-divisions-0-teams-0"
32
+ * - Root row at index 0: "0"
33
+ * - Root row at index 1: "1"
34
+ * - Nested row under parent 0, divisions array, index 2: "0-divisions-2"
35
+ * - Deeply nested: "0-divisions-1-teams-3"
37
36
  *
38
- * @param row - The row object
39
- * @param rowIdAccessor - The accessor to get the base row ID (used as fallback for root level)
40
- * @param rowPath - Optional path to this row in nested structure (e.g., [1, 'divisions', 0])
41
- * @returns A unique row ID that accounts for nesting
37
+ * @param rowPath - Path to this row in nested structure (e.g., [0], [1, 'divisions', 2])
38
+ * @returns A unique row ID based on position
42
39
  */
43
- export declare const getRowId: ({ row, rowIdAccessor, rowPath, }: {
44
- row: Row;
45
- rowIdAccessor: Accessor;
46
- rowPath?: (string | number)[] | undefined;
47
- }) => RowId;
40
+ export declare const getRowId: (rowPath: (string | number)[]) => RowId;
48
41
  /**
49
42
  * Get nested rows from a row based on the grouping path
50
43
  */
@@ -68,13 +61,12 @@ export declare const isRowExpanded: (rowId: string | number, depth: number, expa
68
61
  * Now calculates ALL properties including position and isLastGroupRow
69
62
  * Also injects special state rows for loading/error/empty states (only if renderers are available)
70
63
  */
71
- export declare const flattenRowsWithGrouping: ({ depth, expandedDepths, expandedRows, collapsedRows, rowGrouping, rowIdAccessor, rows, displayPositionOffset, rowStateMap, hasLoadingRenderer, hasErrorRenderer, hasEmptyRenderer, }: {
64
+ export declare const flattenRowsWithGrouping: ({ depth, expandedDepths, expandedRows, collapsedRows, rowGrouping, rows, displayPositionOffset, rowStateMap, hasLoadingRenderer, hasErrorRenderer, hasEmptyRenderer, }: {
72
65
  depth?: number | undefined;
73
66
  expandedDepths: Set<number>;
74
67
  expandedRows: Map<string, number>;
75
68
  collapsedRows: Map<string, number>;
76
69
  rowGrouping?: string[] | undefined;
77
- rowIdAccessor: Accessor;
78
70
  rows: Row[];
79
71
  displayPositionOffset?: number | undefined;
80
72
  rowStateMap?: Map<string | number, RowState> | undefined;
@@ -75,7 +75,6 @@ interface SimpleTableProps {
75
75
  rowButtons?: RowButton[];
76
76
  rowGrouping?: Accessor[];
77
77
  rowHeight?: number;
78
- rowIdAccessor: Accessor;
79
78
  rows: Row[];
80
79
  rowsPerPage?: number;
81
80
  selectableCells?: boolean;
@@ -95,7 +95,6 @@ interface TableContextType {
95
95
  rowGrouping?: Accessor[];
96
96
  rowHeight: number;
97
97
  headerHeight: number;
98
- rowIdAccessor: Accessor;
99
98
  scrollbarWidth: number;
100
99
  selectColumns?: (columnIndices: number[], isShiftKey?: boolean) => void;
101
100
  selectableColumns: boolean;
@@ -5,7 +5,6 @@ import TableRow from "../types/TableRow";
5
5
  interface UseFlattenedRowsProps {
6
6
  rows: Row[];
7
7
  rowGrouping?: Accessor[];
8
- rowIdAccessor: Accessor;
9
8
  expandedRows: Map<string, number>;
10
9
  collapsedRows: Map<string, number>;
11
10
  expandedDepths: Set<number>;
@@ -20,5 +19,5 @@ interface UseFlattenedRowsProps {
20
19
  * can all operate on the flat structure, fixing issues where rowsPerPage
21
20
  * didn't account for nested children.
22
21
  */
23
- declare const useFlattenedRows: ({ rows, rowGrouping, rowIdAccessor, expandedRows, collapsedRows, expandedDepths, rowStateMap, hasLoadingRenderer, hasErrorRenderer, hasEmptyRenderer, }: UseFlattenedRowsProps) => TableRow[];
22
+ declare const useFlattenedRows: ({ rows, rowGrouping, expandedRows, collapsedRows, expandedDepths, rowStateMap, hasLoadingRenderer, hasErrorRenderer, hasEmptyRenderer, }: UseFlattenedRowsProps) => TableRow[];
24
23
  export default useFlattenedRows;
@@ -2,13 +2,11 @@
2
2
  import Cell from "../types/Cell";
3
3
  import HeaderObject from "../types/HeaderObject";
4
4
  import type TableRowType from "../types/TableRow";
5
- import { Accessor } from "../types/HeaderObject";
6
5
  interface UseKeyboardNavigationProps {
7
6
  selectableCells: boolean;
8
7
  initialFocusedCell: Cell | null;
9
8
  tableRows: TableRowType[];
10
9
  leafHeaders: HeaderObject[];
11
- rowIdAccessor: Accessor;
12
10
  selectSingleCell: (cell: Cell) => void;
13
11
  selectCellRange: (startCell: Cell, endCell: Cell) => void;
14
12
  setSelectedCells: (cells: Set<string>) => void;
@@ -24,5 +22,5 @@ interface UseKeyboardNavigationProps {
24
22
  /**
25
23
  * Hook that handles keyboard navigation for cell selection
26
24
  */
27
- export declare const useKeyboardNavigation: ({ copyToClipboard, deleteSelectedCells, enableRowSelection, initialFocusedCell, leafHeaders, pasteFromClipboard, rowIdAccessor, selectCellRange, selectSingleCell, selectableCells, selectedCells, setLastSelectedColumnIndex, setSelectedCells, setSelectedColumns, startCell, tableRows, }: UseKeyboardNavigationProps) => void;
25
+ export declare const useKeyboardNavigation: ({ copyToClipboard, deleteSelectedCells, enableRowSelection, initialFocusedCell, leafHeaders, pasteFromClipboard, selectCellRange, selectSingleCell, selectableCells, selectedCells, setLastSelectedColumnIndex, setSelectedCells, setSelectedColumns, startCell, tableRows, }: UseKeyboardNavigationProps) => void;
28
26
  export {};