simple-table-core 2.0.9 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/Animate-03f6141c.js +2 -0
  2. package/dist/Animate-03f6141c.js.map +1 -0
  3. package/dist/{DatePicker-a5286365.js → DatePicker-c5b35b68.js} +2 -2
  4. package/dist/DatePicker-c5b35b68.js.map +1 -0
  5. package/dist/cjs/Animate-9504aada.js +2 -0
  6. package/dist/cjs/Animate-9504aada.js.map +1 -0
  7. package/dist/cjs/{DatePicker-e100c74e.js → DatePicker-40f2b4f2.js} +2 -2
  8. package/dist/cjs/DatePicker-40f2b4f2.js.map +1 -0
  9. package/dist/cjs/components/dropdown/Dropdown.d.ts +1 -1
  10. package/dist/cjs/context/TableContext.d.ts +6 -3
  11. package/dist/cjs/hooks/useExpandedDepths.d.ts +14 -0
  12. package/dist/cjs/hooks/useFlattenedRows.d.ts +4 -3
  13. package/dist/cjs/hooks/useTableAPI.d.ts +6 -1
  14. package/dist/cjs/index-8f1995cd.js +2 -0
  15. package/dist/cjs/index-8f1995cd.js.map +1 -0
  16. package/dist/cjs/index.js +1 -1
  17. package/dist/cjs/styles.css +1 -1
  18. package/dist/cjs/types/TableRefType.d.ts +18 -0
  19. package/dist/cjs/utils/rowUtils.d.ts +10 -7
  20. package/dist/components/dropdown/Dropdown.d.ts +1 -1
  21. package/dist/context/TableContext.d.ts +6 -3
  22. package/dist/hooks/useExpandedDepths.d.ts +14 -0
  23. package/dist/hooks/useFlattenedRows.d.ts +4 -3
  24. package/dist/hooks/useTableAPI.d.ts +6 -1
  25. package/dist/index-db378522.js +2 -0
  26. package/dist/index-db378522.js.map +1 -0
  27. package/dist/index.es.js +1 -1
  28. package/dist/styles.css +1 -1
  29. package/dist/types/TableRefType.d.ts +18 -0
  30. package/dist/utils/rowUtils.d.ts +10 -7
  31. package/package.json +1 -1
  32. package/src/styles/base.css +1 -3
  33. package/dist/Animate-ee0959c3.js +0 -2
  34. package/dist/Animate-ee0959c3.js.map +0 -1
  35. package/dist/DatePicker-a5286365.js.map +0 -1
  36. package/dist/cjs/Animate-1274da77.js +0 -2
  37. package/dist/cjs/Animate-1274da77.js.map +0 -1
  38. package/dist/cjs/DatePicker-e100c74e.js.map +0 -1
  39. package/dist/cjs/index-b187ee56.js +0 -2
  40. package/dist/cjs/index-b187ee56.js.map +0 -1
  41. package/dist/index-afc8ec6d.js +0 -2
  42. package/dist/index-afc8ec6d.js.map +0 -1
@@ -1,2 +0,0 @@
1
- "use strict";var e=require("react/jsx-runtime"),n=require("react");function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=r(n);function o(e,n){var r={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&0>n.indexOf(t)&&(r[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(t=Object.getOwnPropertySymbols(e);t.length>o;o++)0>n.indexOf(t[o])&&Object.prototype.propertyIsEnumerable.call(e,t[o])&&(r[t[o]]=e[t[o]])}return r}function i(e,n,r,t){return new(r||(r=Promise))(function(o,i){function a(e){try{l(t.next(e))}catch(e){i(e)}}function u(e){try{l(t.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof r?n:new r(function(e){e(n)})).then(a,u)}l((t=t.apply(e,n||[])).next())})}function a(e,n){var r,t,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(r=1,t&&(o=2&u[0]?t.return:u[0]?t.throw||((o=t.return)&&o.call(t),0):t.next)&&!(o=o.call(t,u[1])).done)return o;switch(t=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,t=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&o[3]>u[1])){i.label=u[1];break}if(6===u[0]&&o[1]>i.label){i.label=o[1],o=u;break}if(o&&o[2]>i.label){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(e,i)}catch(e){u=[6,e],t=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}function u(e,n,r){if(r||2===arguments.length)for(var t,o=0,i=n.length;i>o;o++)!t&&o in n||(t||(t=Array.prototype.slice.call(n,0,o)),t[o]=n[o]);return e.concat(t||Array.prototype.slice.call(n))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,r=1,t=arguments.length;t>r;r++)for(var o in n=arguments[r])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},s=30,c=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 r=[],t=function(e,n){if(!e.children||0===e.children.length)return r.push(n),n+1;for(var o=n,i=0,a=e.children;a.length>i;i++)o=t(a[i],o);return o};return t(e,n),r},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})},h=function(e){return void 0===e&&(e=0),e?e+1:0},p=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},w=function(e){var n=e.header,r=e.pinned,t=e.headers,o=e.collapsedHeaders;return n.hide||n.excludeFromRender||(r||n.pinned)&&n.pinned!==r?null:!(t&&o&&function(e,n,r){var t=function(e,n){for(var r=0,t=v(e);t.length>r;r++){var o=t[r];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);if(t){var o=r.has(t.accessor),i=e.showWhen||d;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,t,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(p({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},b=function(e){var n,r=e.width;"string"==typeof r&&r.includes("fr")&&(e.width=(null===(n=document.getElementById(p({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)})},I=function(e){return"number"==typeof e.minWidth?e.minWidth:40},y=function(e,n){var r=[];return e.forEach(function(e){e.hide||r.push.apply(r,x(e,n))}),r},C=function(e){var n=e.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},R=function(e,n){var r=n+"";return r.includes(".")||r.includes("[")?r.split(".").reduce(function(e,n){if(null!=e){var r=C(n),t=r.index,o=e[r.key];return null!==t&&Array.isArray(o)&&(o=o[t]),o}},e):e[n]},S=function(e,n,r){var t=n+"";if(t.includes(".")||t.includes("[")){for(var o=t.split("."),i=e,a=0;o.length-1>a;a++){var u=C(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=C(o[a+1]);i[l]=null!==c.index?[]:{}}if(i=i[l],null!==s){if(!Array.isArray(i))throw Error("Expected array at ".concat(o.slice(0,a+1).join("."),", but found ").concat(typeof i));for(;s>=i.length;)i.push(null);null==i[s]&&(i[s]={}),i=i[s]}}var d=C(o[o.length-1]),f=d.key,v=d.index;if(null!==v){for(Array.isArray(i[f])||(i[f]=[]);v>=i[f].length;)i[f].push(null);i[f][v]=r}else i[f]=r}else e[n]=r},N=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},M=function(e){var n=e.rowPath,r=e.row[e.rowIdAccessor];return n&&n.length>1?n.join("-"):r},A=function(e,n){var r=e[n];return N(r)?r:[]},E=function(e,n,r){var t=e+"";return n?!r.has(t):r.has(t)},P=function(e){var n=e.depth,r=e.expandAll,t=void 0!==r&&r,o=e.unexpandedRows,i=e.rowGrouping,a=void 0===i?[]:i,l=e.rowIdAccessor,s=e.displayPositionOffset,c=void 0===s?0:s,d=e.rowStateMap,f=e.hasLoadingRenderer,v=void 0!==f&&f,h=e.hasErrorRenderer,p=void 0!==h&&h,w=e.hasEmptyRenderer,m=void 0!==w&&w,x=[],g=function(e,n,r,i,s){void 0===r&&(r=0),void 0===i&&(i=c),void 0===s&&(s=[]);var f=r,h=i;return e.forEach(function(r,i){var c,w=a[n],b=u(u([],s,!0),[i],!1),I=M({row:r,rowIdAccessor:l,rowPath:b});if(x.push({row:r,depth:n,displayPosition:h,groupingKey:w,position:f,isLastGroupRow:0===n&&i===e.length-1,rowPath:b,absoluteRowIndex:f}),f++,h++,E(I,t,o)&&a.length>n){var y=null==d?void 0:d.get(I),C=A(r,w);if(y&&(y.loading||y.error||y.isEmpty))y.loading&&v||y.error&&p||y.isEmpty&&m?(x.push({row:{},depth:n+1,displayPosition:h,groupingKey:w,position:f,isLastGroupRow:!1,rowPath:u(u([],b,!0),[w],!1),stateIndicator:{parentRowId:I,state:y},absoluteRowIndex:f}),f++,h++):y.loading&&!v&&(x.push({row:(c={},c[l]="".concat(I,"-loading-skeleton"),c),depth:n+1,displayPosition:h,groupingKey:w,position:f,isLastGroupRow:!1,rowPath:u(u([],b,!0),[w],!1),isLoadingSkeleton:!0,absoluteRowIndex:f}),f++,h++);else if(C.length>0){var R=u(u([],b,!0),[w],!1);f=g(C,n+1,f,h,R)}}}),f};return g(e.rows,void 0===n?0:n,0,c),x},H=function(e){var n=e.contentHeight,r=e.scrollTop,t=e.tableRows,o=e.scrollDirection,i=void 0===o?"none":o,a=e.rowHeight+1,u=e.bufferRowCount*a,l=u,s=u;"down"===i?(l=Math.max(a,.1*u),s=.9*u):"up"===i&&(l=.9*u,s=Math.max(a,.1*u));var c=r+n+s,d=Math.max(0,Math.floor(Math.max(0,r-l)/a)),f=Math.min(t.length,Math.ceil(c/a)),v=r+n,h=Math.max(0,Math.ceil(r/a)),p=Math.min(t.length,Math.floor(v/a)),w=r+n,m=Math.max(0,Math.floor(r/a)),x=Math.min(t.length,Math.ceil(w/a));return{rendered:{startIndex:d,endIndex:f,rows:t.slice(d,f)},fullyVisible:{startIndex:h,endIndex:p,rows:t.slice(h,p)},partiallyVisible:{startIndex:m,endIndex:x,rows:t.slice(m,x)}}},k=function(e){return H({bufferRowCount:e.bufferRowCount,contentHeight:e.contentHeight,rowHeight:e.rowHeight,scrollTop:e.scrollTop,tableRows:e.tableRows,scrollDirection:e.scrollDirection}).rendered.rows},T=function(e){return e.position*(e.rowHeight+1)-1},F=function(e){return e.position*(e.rowHeight+1)},D=function(e,n,r){var t=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>t.top?n.scrollTop-=o.top-t.top+i:t.bottom>o.bottom-i&&(n.scrollTop+=t.bottom-o.bottom+i),r){var a=r.getBoundingClientRect();a.left+i>t.left?r.scrollLeft-=a.left-t.left+i:t.right>a.right-i&&(r.scrollLeft+=t.right-a.right+i)}},L=function(e,n,r){var t=document.querySelector(".st-body-container"),o=document.querySelector(".st-body-main");if(t){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&&r){var u=function(e,n,r,t){var o=H({bufferRowCount:0,contentHeight:n.clientHeight,rowHeight:r,scrollTop:n.scrollTop,tableRows:t,scrollDirection:"none"}).fullyVisible;return e>=o.startIndex&&o.endIndex>e}(e.rowIndex,t,n,r);if(u)return void D(a,t,o)}if(!a)return t.scrollTop=Math.max(0,e.rowIndex*i-t.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&&D(n,t,o)},100);D(a,t,o)}},O=function(e){var n=e.colIndex,r=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(r)},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(r){var t=r.currentPage,o=r.footerRenderer,u=r.hideFooter,l=r.onPageChange,s=r.onNextPage,c=r.onUserPageChange,d=r.rowsPerPage,f=r.shouldPaginate,v=r.totalPages,h=r.totalRows,p=q(),w=p.nextIcon,m=p.prevIcon,x=n.useState(!0),g=x[0],b=x[1],I=t>1,y=v>t,C=t===v,R=Math.min((t-1)*d+1,h),S=Math.min(t*d,h),N=!I,M=!y&&!s||!g&&C,A=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=t-1)?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})},E=function(){return i(void 0,void 0,void 0,function(){var e,n;return a(this,function(r){switch(r.label){case 0:return e=t===v,n=t+1,s&&e?[4,s(t)]:[3,2];case 1:if(!r.sent())return b(!1),[2];r.label=2;case 2:return n>v&&!s?[3,4]:(l(n),c?[4,c(n)]:[3,4]);case 3:r.sent(),r.label=4;case 4:return[2]}})})},P=function(e){return i(void 0,void 0,void 0,function(){return a(this,function(n){switch(n.label){case 0:return 1>e||e>v?[3,2]:(l(e),c?[4,c(e)]:[3,2]);case 1:n.sent(),n.label=2;case 2:return[2]}})})};if(u||!f)return null;if(o)return e.jsx(e.Fragment,{children:o({currentPage:t,totalPages:v,rowsPerPage:d,totalRows:h,startRow:R,endRow:S,onPageChange:P,onNextPage:E,onPrevPage:A,hasNextPage:!M,hasPrevPage:!N,nextIcon:w,prevIcon:m})});var H=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,r=[];t>8?v-7>t?(e=t-7,n=t+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14);for(var o=e;n>=o;o++)r.push(o);return v-1>n&&(r.push(-1),r.push(v)),r}();return e.jsxs("div",exports.__assign({className:"st-footer"},{children:[e.jsx("div",exports.__assign({className:"st-footer-info"},{children:e.jsxs("span",exports.__assign({className:"st-footer-results-text"},{children:["Showing ",R," to ",S," of ",h.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[H.map(function(n,r){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),r):e.jsx("button",exports.__assign({onClick:function(){return P(n)},className:"st-page-btn ".concat(t===n?"active":""),"aria-label":"Go to page ".concat(n),"aria-current":t===n?"page":void 0},{children:n}),r)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(N?"disabled":""),onClick:A,disabled:N,"aria-label":"Go to previous page"},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(M?"disabled":""),onClick:E,disabled:M,"aria-label":"Go to next page"},{children:w}))]}))]}))},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:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},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:"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"})}))},U=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"})}))},_=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 r=e.headerContainerRef,t=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==r?void 0:r.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[r,a,o]),n.useEffect(function(){var e=null==t?void 0:t.current;if(e&&(null==r?void 0:r.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=new ResizeObserver(function(){n()});return o.observe(e),function(){e&&o.unobserve(e)}}},[r,t]),{isMainSectionScrollable:a}},Y=function(r){var t=r.children,o=r.onClose,i=r.open,a=r.overflow,u=void 0===a?"auto":a,l=r.setOpen,s=r.width,c=r.containerRef,d=r.positioning,f=void 0===d?"fixed":d,v=q().mainBodyRef,h=n.useRef(null),p=n.useRef(null),w=n.useState("bottom-left"),m=w[0],x=w[1],g=n.useState({}),b=g[0],I=g[1],y=n.useState(!1),C=y[0],R=y[1];return n.useEffect(function(){i&&h.current?(R(!1),!p.current&&h.current.parentElement&&(p.current=h.current.parentElement),requestAnimationFrame(function(){if(h.current&&p.current){var e,n=h.current,r=p.current.getBoundingClientRect(),t=n.offsetHeight,o=s||n.offsetWidth,i=(e=(null==c?void 0:c.current)?c.current.getBoundingClientRect():(null==v?void 0:v.current)?v.current.getBoundingClientRect():{top:0,right:window.innerWidth,bottom:window.innerHeight,left:0,width:window.innerWidth,height:window.innerHeight,x:0,y:0,toJSON:function(){}}).bottom-r.bottom,a=r.top-e.top,u="bottom",l={};(t>i&&a>=t||t>i&&a>i)&&(u="top");var d="left";o>e.right-r.right+r.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=r.bottom+4:l.bottom=window.innerHeight-r.top+4,"left"===d?l.left=r.left:l.right=window.innerWidth-r.right):("bottom"===u?l.top=r.height+4:l.bottom=r.height+4,"left"===d?l.left=0:l.right=0),x("".concat(u,"-").concat(d)),I(l),R(!0)}})):i||R(!1)},[i,s,c,v,f]),n.useEffect(function(){var e=function(e){i&&h.current&&h.current&&!h.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(h.current&&!h.current.contains(e.target)){var n=h.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:h,className:"st-dropdown-content st-dropdown-".concat(m),onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()},onTouchStart:function(e){return e.stopPropagation()},style:exports.__assign(exports.__assign({position:f,width:s?"".concat(s,"px"):"auto",visibility:C?"visible":"hidden"},b),{overflow:u})},{children:t})):null},$=function(n){var r=n.children,t=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,s=void 0===l?"":l;return e.jsx("div",exports.__assign({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(u?"disabled":""," ").concat(s),onClick:function(){!u&&t&&t()},role:"option","aria-selected":i,"aria-disabled":u},{children:r}))},Z=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=n.useState(r.value),l=u[0],s=u[1],c=function(e){s(e),o(e),a(!1),t()};return e.jsxs(Y,exports.__assign({open:i,onClose:function(){t()},setOpen:a,width:120},{children:[e.jsx($,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx($,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},Q=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},ee=function(r){var t=r.defaultValue,o=r.onBlur,i=r.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+t,onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},ne=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-1274da77.js")})}),re=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-e100c74e.js")})}),te=n.lazy(function(){return Promise.resolve().then(function(){return qn})}),oe=n.lazy(function(){return Promise.resolve().then(function(){return jn})}),ie=function(r){var t=o(r,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},t))},{children:e.jsx(ne,exports.__assign({},r))}))},ae=function(r){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(re,exports.__assign({},r))}))},ue=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(te,exports.__assign({},r))}))},le=function(r){var t=r.width,o=r.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===t?100:t,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(oe,exports.__assign({},r))}))},se=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number);return new Date(n[0],n[1]-1,n[2],12,0,0)}var r=new Date(e);return isNaN(r.getTime())?new Date:new Date(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0)},ce=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 se(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:ce(n)}return e instanceof Date?ce(e):new Date},fe=function(e){return e?se(""+e):new Date},ve=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.setOpen,u=r.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e.jsx(Y,exports.__assign({open:i,onClose:l,setOpen:a,width:280},{children:e.jsx(ae,{value:fe(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),t()},onClose:l})}))},he=function(r){var t=r.onBlur,o=r.onChange,i=r.open,a=r.options,u=r.setOpen,l=n.useState(r.value||""),s=l[0],c=l[1];return e.jsx(Y,exports.__assign({open:i,onClose:function(){t()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx($,exports.__assign({isSelected:s===n.value,onClick:function(){return c(e=n.value),o(e),u(!1),void t();var e}},{children:n.label}),n.value)})}))}))},pe=function(n){var r=n.enumOptions,t=void 0===r?[]:r,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,s=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(Z,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(ve,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(he,{onBlur:s,onChange:o,open:!0,options:t,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(ee,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(Q,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},we=0,me=function(){return function(e){var n=e.callback,r=e.callbackProps,t=e.limit,o=Date.now();0!==we&&t>o-we||(we=o,n(r))}},xe=function(e){var r=n.useRef(e);return n.useEffect(function(){JSON.stringify(r.current)!==JSON.stringify(e)&&(r.current=e)},[e]),r.current},ge=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(ge);var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=ge(e[r]));return n},be=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},Ie=Date.now(),ye={screenX:0,screenY:0},Ce=function(e,n,r){void 0===r&&(r=[]);for(var t=0;e.length>t;t++){var o=e[t];if(o.accessor===n)return u(u([],r,!0),[t],!1);if(o.children&&o.children.length>0){var i=Ce(o.children,n,u(u([],r,!0),[t],!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,r=e.headers,t=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=q().setHeaders,l=xe(r);return{handleDragStart:function(e){n.current=e,Ie=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),r&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,c=o.screenY,d=Math.sqrt(Math.pow(s-ye.screenX,2)+Math.pow(c-ye.screenY,2));t.current=a;var f,v=n.current,h=!1;if(Re(v)!==Re(a))f=(y=function(e,n,r){var t,o,i=ge(e),a=!1;try{var u=Re(r),l=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===r.accessor});if(-1===l||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var c=i.splice(l,1)[0],d=(t=u,o=exports.__assign({},c),"left"===t?o.pinned="left":"right"===t?o.pinned="right":delete o.pinned,o);i.splice(s,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}(r,v,a)).newHeaders,h=y.emergencyBreak;else{var p=r,w=Ce(p,v.accessor),m=Ce(p,a.accessor);if(!w||!m)return;var x=w.length,g=m.length,b=m;if(x!==g){var I=g-x;I>0&&(b=m.slice(0,-I))}var y=function(e,n,r){var t=ge(e),o=!1;function i(e,n){for(var r=e,t=0;n.length-1>t;t++)r=r[n[t]].children;return r[n[n.length-1]]}function a(e,n,r){for(var t=e,i=0;n.length-1>i;i++){if(!t[n[i]].children){o=!0;break}t=t[n[i]].children}t[n[n.length-1]]=r}var u=i(t,n);return a(t,n,i(t,r)),a(t,r,u),{newHeaders:t,emergencyBreak:o}}(p,w,b);f=y.newHeaders,h=y.emergencyBreak}if(!(u||a.accessor===v.accessor||10>d||JSON.stringify(f)===JSON.stringify(r)||h)){var C=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>C-Ie||40>d)||(Ie=C,ye={screenX:s,screenY:c},i(f))}}},handleDragEnd:function(){n.current=null,t.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(r)},10)}}},Ne=function(n){var r=n.checked,t=void 0!==r&&r,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:t,className:"st-checkbox-input",onChange:function(){i&&i(!t)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":n.ariaLabel,"aria-checked":t}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(t?"st-checked":""),"aria-hidden":"true"},{children:t&&e.jsx(V,{className:"st-checkbox-checkmark"})})),o]}))},Me=function(n){var r,t=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:t}):"lineAreaChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(ue,exports.__assign({data:r},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(t)?(r=t.filter(function(e){return"number"==typeof e})).length>0?e.jsx(le,exports.__assign({data:r},o.chartOptions)):null:"boolean"==typeof t?t?"True":"False":Array.isArray(t)?0===t.length?"[]":t.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==t&&("string"==typeof t||"number"==typeof t||"object"==typeof t&&t instanceof Date)?de(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):t},Ae=t.default.memo(function(r){var t=r.borderClass,o=r.colIndex,i=r.displayRowNumber,a=r.header,u=r.isHighlighted,l=r.isInitialFocused,s=r.nestedIndex,c=r.parentHeader,d=r.rowIndex,f=r.tableRow,v=q(),h=v.canExpandRowGroup,w=v.cellRegistry,x=v.cellUpdateFlash,g=v.columnBorders,b=v.draggedHeaderRef,I=v.enableRowSelection,y=v.expandAll,C=v.expandIcon,A=v.handleMouseDown,P=v.handleMouseOver,H=v.handleRowSelect,k=v.headers,T=v.hoveredHeaderRef,F=v.isCopyFlashing,D=v.isLoading,L=v.isRowSelected,O=v.isWarningFlashing,W=v.onCellEdit,B=v.onCellClick,z=v.onRowGroupExpand,j=v.onTableHeaderDragEnd,G=v.rowButtons,K=v.rowGrouping,V=v.rowIdAccessor,U=v.setRowStateMap,_=v.rowsWithSelectedCells,J=v.selectedColumns,X=v.setUnexpandedRows,Y=v.tableBodyContainerRef,$=v.theme,Z=v.unexpandedRows,Q=v.useOddColumnBackground,ee=f.depth,ne=f.row,re=f.rowPath,te=f.absoluteRowIndex,oe=n.useState(R(ne,a.accessor)),ae=oe[0],ue=oe[1],le=n.useState(!1),se=le[0],ce=le[1],de=n.useState(!1),fe=de[0],ve=de[1],he=n.useState(!1),we=he[0],xe=he[1],ge=n.useRef(null),be=M({row:ne,rowIdAccessor:V,rowPath:re}),Ie=K&&K[ee],ye=!!Ie&&function(e,n){return!!n&&N(e[n])}(ne,Ie),Ce=K&&K.length>ee,Re=!h||h(ne),Ae=E(be,y,Z),Ee=F({rowIndex:d,colIndex:o,rowId:be}),Pe=O({rowIndex:d,colIndex:o,rowId:be}),He=n.useMemo(function(){var e,n,r;if(!g)return!1;var t=k.filter(function(e){return"left"===e.pinned}),o=k.filter(function(e){return!e.pinned}),i=k.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=t[t.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===a.accessor},[g,k,a.accessor,a.pinned]),ke=Se({draggedHeaderRef:b,headers:k,hoveredHeaderRef:T,onTableHeaderDragEnd:j}).handleDragOver,Te=me(),Fe=p({accessor:a.accessor,rowId:be}),De=m({rowId:be,accessor:a.accessor}),Le=a.isSelectionColumn&&I;n.useEffect(function(){if(w){var e="".concat(be,"-").concat(a.accessor);return w.set(e,{updateContent:function(e){ae!==e?(ue(e),x&&(ve(!0),ge.current&&clearTimeout(ge.current),ge.current=setTimeout(function(){ve(!1)},800))):ue(e)}}),function(){w.delete(e),ge.current&&clearTimeout(ge.current)}}},[w,x,be,a.accessor,ae]),n.useEffect(function(){if(fe){var e=setTimeout(function(){ve(!1)},850);return function(){return clearTimeout(e)}}},[fe]),n.useEffect(function(){ue(R(ne,a.accessor))},[ne,a.accessor]);var Oe="boolean"===a.type||"date"===a.type||"enum"===a.type,We=!!(null==a?void 0:a.isEditable),Be=J.has(o),qe=u&&!Be,ze=n.useMemo(function(){return!!Le&&_.has(be+"")},[Le,_,be]),je=null==c?void 0:c.singleRowChildren,Ge="st-cell ".concat(ee>0&&a.expandable?"st-cell-depth-".concat(ee):""," ").concat(qe?l?"st-cell-selected-first ".concat(t):"st-cell-selected ".concat(t):""," ").concat(Be?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(We?"clickable":""," ").concat(fe?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(Ee?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(Pe?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(Q?s%2==0?"even-column":"odd-column":""," ").concat(Le?"st-selection-cell":""," ").concat(ze?"st-selection-has-highlighted-cell":""," ").concat(He?"st-last-column":""," ").concat(je?"st-sub-cell":""," ").concat(we?"hovered":""),Ke=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),ue(e),S(ne,a.accessor,e),null==W||W({accessor:a.accessor,newValue:e,row:ne,rowIndex:d})},[a.accessor,a.type,W,ne,d]),Ve=n.useCallback(function(e){e.stopPropagation();var n=E(be,y,Z),r=be+"";if(X(function(e){var n=new Set(e);return n.has(r)?n.delete(r):n.add(r),n}),n&&U(function(e){var n=new Map(e);return n.delete(be),n}),z){var t=a.pinned;z({depth:ee,event:e,groupingKey:Ie,groupingKeys:K||[],isExpanded:!n,row:ne,rowId:be,rowIndexPath:re||[],setEmpty:function(e,n){U(function(r){var o=new Map(r),i=o.get(be)||{};return o.set(be,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:t})),o})},setError:function(e){U(function(n){var r=new Map(n),o=r.get(be)||{};return r.set(be,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:t})),r})},setLoading:function(e){U(function(n){var r=new Map(n),o=r.get(be)||{};return r.set(be,exports.__assign(exports.__assign({},o),{loading:e,error:null,isEmpty:!1,triggerSection:t})),r})}})}},[Ie,ee,y,a.pinned,z,ne,K,be,re,U,X,Z]);return D||f.isLoadingSkeleton?e.jsx("div",exports.__assign({className:Ge},{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||Oe||Le?e.jsxs(ie,exports.__assign({className:Ge,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":be,"data-row-index":d,"aria-colindex":o+1,id:Fe,onClick:function(){B&&!Le&&B({accessor:a.accessor,colIndex:o,row:ne,rowId:be,rowIndex:d,value:ae})},onDoubleClick:function(){return a.isEditable&&!Le&&ce(!0)},onDragOver:function(e){Le||Te({callback:ke,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){se||Le||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||se||(e.preventDefault(),ce(!0))},onMouseDown:function(){se||Le||A({rowIndex:d,colIndex:o,rowId:be})},onMouseEnter:function(){xe(!0)},onMouseLeave:function(){xe(!1)},onMouseOver:function(){se||Le||P({rowIndex:d,colIndex:o,rowId:be})},parentRef:Y,tableRow:f},{children:[a.expandable&&Ce&&Re&&(ye||z)?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(Ae?"expanded":"collapsed"),onClick:function(e){return Ve(e)},role:"button",tabIndex:0,"aria-label":"".concat(Ae?"Collapse":"Expand"," row group"),"aria-expanded":Ae,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ve(e))}},{children:C})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:D||f.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:Le?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:we||L&&L(be+"")?e.jsx(Ne,{checked:!!L&&L(be+""),onChange:function(e){H&&H(be+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!G||!Le||0===G.length)return null;if(!(we||L&&L(be+"")))return null;var n={row:ne,rowIndex:i,rowId:be};return e.jsx("div",exports.__assign({className:"st-row-buttons",role:"group","aria-label":"Actions for row ".concat(i+1)},{children:G.map(function(r,t){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:r(n)}),t)})}))}()]})):a.cellRenderer?function(){var e;return a.cellRenderer({accessor:a.accessor,colIndex:o,row:ne,rowIndex:te,rowPath:re,theme:$,value:ae,formattedValue:null===(e=null==a?void 0:a.valueFormatter)||void 0===e?void 0:e.call(a,{accessor:a.accessor,colIndex:o,row:ne,rowIndex:d,value:ae})})}():Me({content:ae,header:a,colIndex:o,row:ne,rowIndex:d})})})),!D&&!f.isLoadingSkeleton&&se&&Oe&&!Le&&e.jsx(pe,{enumOptions:a.enumOptions,onChange:Ke,setIsEditing:ce,type:a.type,value:ae})]}),De):e.jsx("div",exports.__assign({className:"st-cell-editing",id:p({accessor:a.accessor,rowId:be}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(pe,{enumOptions:a.enumOptions,onChange:Ke,setIsEditing:ce,type:a.type,value:ae})}))},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}),Ee=function(r){var t=r.columnIndices,o=r.displayRowNumber,i=r.header,a=r.headers,u=r.nestedIndex,l=r.parentHeader,s=r.pinned,c=r.rowIndex,d=r.rowIndices,f=r.tableRow,v=t[i.accessor],h=q(),m=h.getBorderClass,x=h.isSelected,g=h.isInitialFocusedCell,b=h.collapsedHeaders,I=M({row:f.row,rowIdAccessor:h.rowIdAccessor,rowPath:f.rowPath});if(i.children&&i.children.length>0){var y=i.children.filter(function(e){return w({header:e,pinned:s,headers:a,collapsedHeaders:b})});if(i.singleRowChildren){var C={rowIndex:c,colIndex:v,rowId:I},R=m(C),S=x(C),N=g(C),A=p({accessor:i.accessor,rowId:I});return e.jsxs(n.Fragment,{children:[e.jsx(Ae,{borderClass:R,colIndex:v,displayRowNumber:o,header:i,isHighlighted:S,isInitialFocused:N,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},A),y.map(function(n){var r=p({accessor:n.accessor,rowId:I});return e.jsx(Ee,{columnIndices:t,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},r)})]})}return e.jsx(n.Fragment,{children:y.map(function(n){var r=p({accessor:n.accessor,rowId:I});return e.jsx(Ee,{columnIndices:t,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},r)})})}var E={rowIndex:c,colIndex:v,rowId:I},P=m(E),H=x(E),k=g(E),T=p({accessor:i.accessor,rowId:I});return e.jsx(Ae,{borderClass:P,colIndex:v,displayRowNumber:o,header:i,isHighlighted:H,isInitialFocused:k,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},T)},Pe=t.default.memo(function(n){var r=n.columnIndexStart,t=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,s=n.tableRow,c=q(),d=c.rowIdAccessor,f=c.collapsedHeaders,v=o.filter(function(e){return w({header:e,pinned:i,headers:o,collapsedHeaders:f})});return e.jsx(e.Fragment,{children:v.map(function(n,c){var f=M({row:s.row,rowIdAccessor:d,rowPath:s.rowPath}),v=p({accessor:n.accessor,rowId:f});return e.jsx(Ee,{columnIndices:t,displayRowNumber:u,header:n,headers:o,nestedIndex:c+(null!=r?r:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:s},v)})})},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}),He=function(n){var r=n.rowState,t=n.loadingStateRenderer,o=n.errorStateRenderer,i=n.emptyStateRenderer,a=null;return r.loading&&t?a=t:r.error&&o?a=o:r.isEmpty&&i&&(a=i),a?e.jsx("div",exports.__assign({className:"st-cell st-state-row-cell",style:{gridColumn:"1 / -1",padding:0}},{children:a})):null},ke=t.default.memo(function(n){var r=n.columnIndices,t=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,u=n.pinned,l=n.rowHeight,s=n.rowIndices,c=n.setHoveredIndex,d=n.tableRow,f=q(),v=f.useHoverRowBackground,h=f.rowIdAccessor,p=f.isAnimating,w=f.isRowSelected,m=f.useOddEvenRowBackground,x=f.rows,g=f.loadingStateRenderer,b=f.errorStateRenderer,I=f.emptyStateRenderer,y=f.maxHeaderDepth,C=d.position,R=d.displayPosition,S=d.stateIndicator;if(S){if(S.state.triggerSection===u){if(!(S.state.loading&&g||S.state.error&&b||S.state.isEmpty&&I))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 N=x.find(function(e){return M({row:e,rowIdAccessor:h})===S.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(He,{parentRow:N||{},rowState:S.state,gridTemplateColumns:o,loadingStateRenderer:g,errorStateRenderer:b,emptyStateRenderer:I})}))}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 A=C%2==0,E=M({row:d.row,rowIdAccessor:h,rowPath:d.rowPath}),P=!!w&&w(E+"");return e.jsx("div",exports.__assign({className:"st-row ".concat(m?A?"even":"odd":""," ").concat(P?"selected":""),"data-index":a,"aria-rowindex":C+y+1,onMouseEnter:function(){!p&&v&&c(a)},style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(F({position:C,rowHeight:l}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(Pe,{columnIndexStart:t,columnIndices:r,displayRowNumber:R,headers:i,pinned:u,rowIndex:C,rowIndices:s,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}),Te=function(r){var t=r.displayStrongBorder,o=r.position,i=r.rowHeight,a=r.templateColumns,u=n.useRef(null);return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){var n=e.currentTarget,r=n.style.pointerEvents;n.style.pointerEvents="none";var t=document.elementFromPoint(e.clientX,e.clientY);if(n.style.pointerEvents=r,t){var o=t.closest(".st-cell");if(o instanceof HTMLElement){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(),r=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});u.current.dispatchEvent(r),u.current=null}},style:{gridTemplateColumns:a,transform:"translate3d(0, ".concat(T({position:o,rowHeight:i}),"px, 0)")}},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},Fe=n.createContext(void 0),De=function(e){var r=e.childRef,t=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 r.current&&u(r.current,e),function(){r.current&&l(r.current,e)}},[r,u,l,i]),n.cloneElement(t,{ref:function(e){r.current=e}})},Le=n.forwardRef(function(r,t){var o=r.columnIndexStart,i=r.columnIndices,a=r.headers,u=r.pinned,l=r.rowHeight,s=r.rowIndices,c=r.setHoveredIndex,d=r.templateColumns,f=r.totalHeight,v=r.rowsToRender,h=r.width,p=u?"st-body-pinned-".concat(u):"st-body-main",w=q().rowIdAccessor,m=n.useRef(null);return n.useImperativeHandle(t,function(){return m.current},[]),n.useMemo(function(){return be(a,u)},[a,u])?e.jsx(De,exports.__assign({childRef:m,group:u?"pinned-".concat(u):"default"},{children:e.jsx("div",exports.__assign({className:p,ref:m,style:exports.__assign({position:"relative",height:"".concat(f,"px"),width:h},!u&&{flexGrow:1})},{children:v.map(function(r,t){var f=r.stateIndicator?"state-".concat(r.stateIndicator.parentRowId,"-").concat(r.position):M({row:r.row,rowIdAccessor:w,rowPath:r.rowPath});return e.jsxs(n.Fragment,{children:[0!==t&&e.jsx(Te,{displayStrongBorder:r.isLastGroupRow,position:r.position,rowHeight:l,templateColumns:d}),e.jsx(ke,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:t,pinned:u,rowHeight:l,rowIndices:s,setHoveredIndex:c,tableRow:r})]},f)})}))})):null});function Oe(e){var n=e.headers,r=e.pinnedLeftColumns,t=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],r,!0),n,!0),t,!0),s=function(e,n){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,r){s(n,!e.singleRowChildren&&0===r)})};return r.forEach(function(e,n){s(e,0===n)}),n.filter(function(e){return!e.pinned&&w({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){s(e,0===n&&0===r.length)}),t.forEach(function(e){s(e,!1)}),i}Le.displayName="TableSection";var We=function(r){var t=r.mainTemplateColumns,o=r.pinnedLeftColumns,i=r.pinnedLeftTemplateColumns,a=r.pinnedLeftWidth,u=r.pinnedRightColumns,l=r.pinnedRightTemplateColumns,s=r.pinnedRightWidth,c=r.rowsToRender,d=r.setScrollTop,f=r.setScrollDirection,v=r.shouldShowEmptyState,h=r.tableRows,p=q(),w=p.collapsedHeaders,m=p.headerContainerRef,x=p.headers,g=p.isAnimating,b=p.mainBodyRef,I=p.onLoadMore,y=p.rowHeight,C=p.rowIdAccessor,R=p.scrollbarWidth,S=p.setIsScrolling,N=p.shouldPaginate,A=p.tableBodyContainerRef,E=p.tableEmptyStateRenderer,P=n.useState(!1),H=P[0],k=P[1],T=n.useRef(new Set),F=n.useCallback(function(e){T.current.forEach(function(e){return e.classList.remove("hovered")}),T.current.clear(),null!==e&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),T.current.add(e)})},[]);n.useEffect(function(){g&&F(null)},[g,F]),X({headerContainerRef:m,mainSectionRef:A,scrollbarWidth:R}),n.useEffect(function(){return function(){L.current&&clearTimeout(L.current)}},[]);var D=n.useRef(null),L=n.useRef(null),O=n.useRef(0),W=function(e){return e.length}(h),B=W*(y+1)-1,z=n.useMemo(function(){return Oe({headers:x,pinnedLeftColumns:o,pinnedRightColumns:u,collapsedHeaders:w})},[x,o,u,w]),j=n.useMemo(function(){var e={};return c.forEach(function(n,r){var t=M({row:n.row,rowIdAccessor:C,rowPath:n.rowPath})+"";e[t]=r}),e},[c,C]),G=n.useCallback(function(e,n){!I||N||H||200>=e.scrollHeight-(n+e.clientHeight)&&n>O.current&&(k(!0),I(),setTimeout(function(){k(!1)},1e3))},[I,N,H]),K={columnIndices:z,headerContainerRef:m,headers:x,rowHeight:y,rowIndices:j,rowsToRender:c,setHoveredIndex:F};return e.jsx("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return F(null)},onScroll:function(e){var n=e.currentTarget,r=n.scrollTop;S(!0),L.current&&clearTimeout(L.current),L.current=setTimeout(function(){S(!1)},150),D.current&&cancelAnimationFrame(D.current),D.current=requestAnimationFrame(function(){var e=O.current,t=r>e?"down":e>r?"up":"none";d(r),f(t),G(n,r),O.current=r})},ref:A},{children:v?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:E})):e.jsxs(e.Fragment,{children:[e.jsx(Le,exports.__assign({},K,{pinned:"left",templateColumns:i,totalHeight:B,width:a})),e.jsx(Le,exports.__assign({},K,{columnIndexStart:o.length,ref:b,templateColumns:t,totalHeight:B})),e.jsx(Le,exports.__assign({},K,{columnIndexStart:o.length+t.length,pinned:"right",templateColumns:l,totalHeight:B,width:s}))]})}))},Be=function(e){var n=e.event,r=e.header,t=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.tableBodyContainerRef,l=e.startWidth,s=e.collapsedHeaders,d=e.autoExpandColumns,f=void 0!==d&&d,v=e.reverse,h=void 0!==v&&v;n.preventDefault();var p="clientX"in n?n.clientX:n.touches[0].clientX,w="touches"in n;if(r&&!r.hide){i(!0);var m,C=I(r);if(r.children&&r.children.length>0){var R=x(r,s);m=R.length>0?R:[r]}else m=[r];var S=new Map,N=0;if(f){var M=t.filter(function(e){return e.pinned===r.pinned});if(y(M,s).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 A=a.current.clientWidth,E=ze({headers:t,containerWidth:A,collapsedHeaders:s}),P=E.leftWidth,H=E.rightWidth;N="left"===r.pinned?P:"right"===r.pinned?H:Math.max(0,A-P-H)}}var k=function(e){var n="right"===r.pinned?p-e:e-p;if(f){var i=t.filter(function(e){return e.pinned===r.pinned});Ge({delta:n,startWidth:l,resizedHeader:m.length>0?m[0]:r,sectionHeaders:i,reverse:h,collapsedHeaders:s,initialWidthsMap:S,sectionWidth:N,isParentResize:m.length>1,childrenToResize:m})}else{var a=function(e){var n=e.header,r=e.headers,t=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=c(window.innerWidth);if(!n.pinned)return 1/0;var u=i*a-r.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+x(n,t).reduce(function(e,n){return e+g(n)},0)},0),l=I(n);return l>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):u}({header:r,headers:t,collapsedHeaders:s});m.length>1?qe({delta:n,leafHeaders:m,minWidth:C,startWidth:l,maxWidth:a}):m[0].width=Math.max(Math.min(l+n,a),C),t.forEach(function(e){b(e)})}var d=u([],t,!0);o(d)};if(w){var T=function(e){k(e.touches[0].clientX)},F=function(){document.removeEventListener("touchmove",T),document.removeEventListener("touchend",F),i(!1)};document.addEventListener("touchmove",T),document.addEventListener("touchend",F)}else{var D=function(e){k(e.clientX)},L=function(){document.removeEventListener("mousemove",D),document.removeEventListener("mouseup",L),i(!1)};document.addEventListener("mousemove",D),document.addEventListener("mouseup",L)}}},qe=function(e){var n=e.delta,r=e.leafHeaders,t=e.minWidth,o=e.startWidth,i=e.maxWidth,a=r.reduce(function(e,n){return Math.min(e,I(n))},40),u=r.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;r.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),t)})},ze=function(e){var n=e.containerWidth,r=e.maxPinnedWidthPercent,t=void 0===r?.8:r,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,s=a;if(n&&n>0){var c=n*t;i>c&&(i=c),a>c&&(a=c)}return{leftWidth:h(i),rightWidth:h(a),mainWidth:u,leftContentWidth:l,rightContentWidth:s}},je=function(e){var n=e.columnsToShrink,r=e.totalCompensation,t=e.initialWidthsMap;if(0>r){var o=Math.abs(r),i=n.reduce(function(e,n){return e+(t.get(n.accessor)||100)},0);if(0===i)return;n.forEach(function(e,r){var a=t.get(e.accessor)||100,u=o*(a/i);if(r===n.length-1){var l=n.slice(0,r).reduce(function(e,n){var r=t.get(n.accessor)||100;return e+(("number"==typeof n.width?n.width:100)-r)},0);u=o-l}e.width=a+u})}else for(var a=r,u=function(){var e=n.map(function(e){var n=t.get(e.accessor)||100;return{column:e,headroom:Math.max(0,n-30),initialWidth:n,minWidth:30}}),r=e.filter(function(e){return e.headroom>0});if(r.length>0){var o=r.reduce(function(e,n){return e+n.headroom},0),i=0,u=a;r.forEach(function(e,n){var t=u*(e.headroom/o);t=Math.min(t,e.headroom),n===r.length-1&&(t=Math.min(u-i,e.headroom)),e.column.width=e.initialWidth-t,i+=t}),a-=i}else{var l=e.filter(function(e){return e.minWidth>s});if(0>=l.length)return"break";var c=a,d=c/l.length,f=0;l.forEach(function(e,n){var r=e.minWidth-s,t=Math.min(d,r);n===l.length-1&&(t=Math.min(c-f,r));var o=e.initialWidth-t;e.column.width=o,e.column.minWidth=Math.max(o,s),f+=t}),a-=f}};a>.5&&"break"!==u(););},Ge=function(e){var n=e.delta,r=e.startWidth,t=e.resizedHeader,o=e.sectionHeaders,i=e.reverse,a=e.collapsedHeaders,u=e.initialWidthsMap,l=e.sectionWidth,c=e.isParentResize,d=e.childrenToResize,f=void 0===d?[]:d;if(void 0!==c&&c&&f.length>1){var v=y(o,a),h=v.findIndex(function(e){return e.accessor===f[0].accessor}),p=v.findIndex(function(e){return e.accessor===f[f.length-1].accessor});if(-1===h||-1===p)return;var w,m=p===v.length-1;w=0===h?v.slice(p+1):m||i?v.slice(0,h):v.slice(p+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 I=w.reduce(function(e,n){var r=u.get(n.accessor)||100;return e+Math.max(0,r-s)},0);g=Math.min(n,I)}var C=(R=r+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*C,30)}),b&&g>0&&w.length>0&&je({columnsToShrink:w,totalCompensation:g,initialWidthsMap:u})}else{var R,S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0),N=(R=Math.max(r+n,s*f.length))/S;f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*N,30)}),(F=r-R)>0&&w.length>0&&je({columnsToShrink:w,totalCompensation:-F,initialWidthsMap:u})}}else{var M=y(o,a),A=M.findIndex(function(e){return e.accessor===t.accessor});if(-1!==A){var E,P=A===M.length-1;if(0!==(E=0===A?M.slice(A+1):P||i?M.slice(0,A):M.slice(A+1)).length){var H=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){if(l>=H+n)return void(t.width=r+n);I=E.reduce(function(e,n){var r=u.get(n.accessor)||100;return e+Math.max(0,r-s)},0);var k=Math.min(n,I);t.width=r+k,k>0&&je({columnsToShrink:E,totalCompensation:k,initialWidthsMap:u})}else{var T=Math.max(r+n,30),F=r-T;t.width=T,F>0&&je({columnsToShrink:E,totalCompensation:-F,initialWidthsMap:u})}}else t.width=Math.max(r+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"]}},Ue=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},_e=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(r){var t=r.value,o=r.onChange,i=r.options,a=r.placeholder,u=void 0===a?"Select...":a,l=r.className,s=void 0===l?"":l,c=r.disabled,d=void 0!==c&&c,f=n.useState(!1),v=f[0],h=f[1],p=n.useState(-1),w=p[0],m=p[1],x=n.useRef(null),g=i.find(function(e){return e.value===t});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),m(function(e){return i.length-1>e?e+1:0});break;case"ArrowUp":e.preventDefault(),m(function(e){return e>0?e-1:i.length-1});break;case"Enter":e.preventDefault(),0>w||(o(i[w].value),h(!1),m(-1));break;case"Escape":e.preventDefault(),h(!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),h(!1),m(-1)};return e.jsxs("div",exports.__assign({ref:x,className:"st-custom-select ".concat(s," ").concat(d?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",exports.__assign({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!d)if(h(!v),v)m(-1);else{var e=i.findIndex(function(e){return e.value===t});m(0>e?0:e)}},disabled:d,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",exports.__assign({className:"st-custom-select-value"},{children:g?g.label:u})),e.jsx(J,{})]})),e.jsx(Y,exports.__assign({open:v,setOpen:h,onClose:function(){h(!1),m(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",exports.__assign({className:"st-custom-select-options",role:"listbox"},{children:i.map(function(n,r){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===t?"st-custom-select-option-selected":""," ").concat(r===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===t,onClick:function(){return b(n.value)},tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(n.value))}},{children:n.label}),r)})}))}))]}))},$e=function(n){var r=n.value,t=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:r,onChange:function(e){t(e)},options:o})}))},Ze=function(n){var r=n.type,t=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===r?"text":r,value:n.value,onChange:function(e){return t(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&a&&a()},placeholder:n.placeholder,autoFocus:void 0!==o&&o,className:"st-filter-input ".concat(void 0===i?"":i).trim()})},Qe=function(n){var r=n.children,t=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===t?"":t).trim()},{children:r}))},en=function(n){var r=n.onClear,t=n.canApply,o=n.showClear;return e.jsxs("div",exports.__assign({className:"st-filter-actions"},{children:[e.jsx("button",exports.__assign({onClick:n.onApply,disabled:!t,className:"st-filter-button st-filter-button-apply ".concat(t?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&r&&e.jsx("button",exports.__assign({onClick:r,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},nn=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],s=u[1],c=n.useState(((null==o?void 0:o.value)||"")+""),d=c[0],f=c[1],v=Ve("string");n.useEffect(function(){o?(s(o.operator),f((o.value||"")+"")):(s("contains"),f(""))},[o]);var h=function(){var e=exports.__assign({accessor:t.accessor,operator:l},Ue(l)&&{value:d});i(e)},p=Je(l)||d.trim();return e.jsxs(Xe,{children:[e.jsx($e,{value:l,onChange:s,operators:v}),Ue(l)&&e.jsx(Qe,{children:e.jsx(Ze,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:h})}),e.jsx(en,{onApply:h,onClear:a,canApply:!!p,showClear:!!o})]})},rn=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],h=f[1],p=n.useState(((null===(t=null==a?void 0:a.values)||void 0===t?void 0:t[0])||"")+""),w=p[0],m=p[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],I=Ve("number");n.useEffect(function(){var e,n;a?(d(a.operator),h((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"),h(""),m(""),b(""))},[a]);var y=function(){var e={accessor:i.accessor,operator:c};Ue(c)?e.value=parseFloat(v):_e(c)&&(e.values=[parseFloat(""+w),parseFloat(""+g)]),u(e)};return e.jsxs(Xe,{children:[e.jsx($e,{value:c,onChange:d,operators:I}),Ue(c)&&e.jsx(Qe,{children:e.jsx(Ze,{type:"number",value:v,onChange:h,placeholder:"Enter number...",autoFocus:!0,onEnterPress:y})}),_e(c)&&e.jsxs(Qe,{children:[e.jsx(Ze,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:y}),e.jsx(Ze,{type:"number",value:g,onChange:b,placeholder:"To...",onEnterPress:y})]}),e.jsx(en,{onApply:y,onClear:l,canApply:!!Je(c)||(Ue(c)?""!==v.trim():!!_e(c)&&""!==(w+"").trim()&&""!==(g+"").trim()),showClear:!!a})]})},tn=function(n){var r=n.className;return e.jsx(Ye,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===r?"":r,placeholder:n.placeholder})},on=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],s=u[1],c=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=c[0],f=c[1],v=Ve("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var h=Je(l)||""!==d;return e.jsxs(Xe,{children:[e.jsx($e,{value:l,onChange:s,operators:v}),Ue(l)&&e.jsx(Qe,{children:e.jsx(tn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(en,{onApply:function(){var e={accessor:t.accessor,operator:l};Ue(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:h,showClear:!!o})]})},an=function(r){var t,o,i=r.header,a=r.currentFilter,u=r.onApplyFilter,l=r.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],h=f[1],p=n.useState((null===(t=null==a?void 0:a.values)||void 0===t?void 0:t[0])?a.values[0]+"":""),w=p[0],m=p[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],I=Ve("date");n.useEffect(function(){var e,n;a?(d(a.operator),h((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"),h(""),m(""),b(""))},[a]);var y=function(r){var t=r.value,o=r.onChange,i=r.placeholder,a=r.autoFocus,u=r.className,l=n.useState(!1),s=l[0],c=l[1],d=n.useState(""),f=d[0],v=d[1],h=n.useRef(null);n.useEffect(function(){if(t){var e=de(t);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[t]),n.useEffect(function(){a&&h.current&&h.current.focus()},[a]);var p=t?de(t):new Date;return e.jsxs("div",exports.__assign({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:h,type:"text",value:f,placeholder:i,onClick:function(){c(!s)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),c(!s)):"Escape"===e.key&&c(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e.jsx(Y,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"visible"},{children:e.jsx(ae,{value:p,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(Xe,{children:[e.jsx($e,{value:c,onChange:d,operators:I}),Ue(c)&&e.jsx(Qe,{children:e.jsx(y,{value:v,onChange:h,placeholder:"Select date...",autoFocus:!0})}),_e(c)&&e.jsxs(Qe,{children:[e.jsx(y,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(y,{value:g,onChange:b,placeholder:"To date..."})]}),e.jsx(en,{onApply:function(){var e={accessor:i.accessor,operator:c};Ue(c)?e.value=v:_e(c)&&(e.values=[w,g]),u(e)},onClear:l,canApply:!!Je(c)||(Ue(c)?""!==v.trim():!!_e(c)&&""!==w.trim()&&""!==g.trim()),showClear:!!a})]})},un=function(r){var t=r.header,o=r.currentFilter,i=r.onApplyFilter,a=r.onClearFilter,l=n.useMemo(function(){return t.enumOptions||[]},[t.enumOptions]),s=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),c=n.useState((null==o?void 0:o.values)?o.values.map(String):s),d=c[0],f=c[1],v=n.useState(""),h=v[0],p=v[1],w=n.useMemo(function(){if(!h)return l;var e=h.toLowerCase();return l.filter(function(n){return n.label.toLowerCase().includes(e)})},[l,h]);n.useEffect(function(){f(o?o.values?o.values.map(String):[]:s)},[o,s]);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(Ne,exports.__assign({checked:d.length===s.length,onChange:function(e){f(e?s:[])}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),m&&e.jsx("div",exports.__assign({className:"st-enum-search"},{children:e.jsx(Ze,{type:"text",value:h,onChange:p,placeholder:"Search..."})})),w.map(function(n,r){return e.jsx(Ne,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),r)}),h&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(en,{onApply:function(){d.length!==s.length?i({accessor:t.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==s.length,showClear:!!o})]})},ln=function(n){var r=n.header,t=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(r.type){case"number":return e.jsx(rn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(on,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(an,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(un,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i});default:return e.jsx(nn,{header:r,currentFilter:t,onApplyFilter:o,onClearFilter:i})}}()})},sn=function(r){var t=r.content,o=r.children,i=r.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],s=u[1],c=n.useState({top:0,left:0}),d=c[0],f=c[1],v=n.useRef(null),h=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!t||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var p=n.cloneElement(o,{ref:h,onMouseEnter:function(){v.current=setTimeout(function(){if(h.current&&t.trim()){var e=h.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,r=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),r+40>window.innerHeight-8&&(r=e.top-40-8),f({top:r,left:n}),s(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),s(!1)}});return e.jsxs(e.Fragment,{children:[p,l&&e.jsx("div",exports.__assign({className:"st-tooltip",style:{position:"fixed",top:"".concat(d.top,"px"),left:"".concat(d.left,"px"),zIndex:1e4}},{children:t}))]})},cn=function(r){var t,o,i=r.colIndex,a=r.gridColumnEnd,l=r.gridColumnStart,s=r.gridRowEnd,c=r.gridRowStart,v=r.header,h=r.parentHeader,w=r.reverse,m=r.sort,x=n.useState(!1),g=x[0],b=x[1],I=n.useState(!1),y=I[0],C=I[1],R=n.useState(v.label||""),S=R[0],N=R[1],M=q(),A=M.activeHeaderDropdown,E=M.areAllRowsSelected,P=M.autoExpandColumns,H=M.collapsedHeaders,k=M.columnBorders,T=M.columnReordering,F=M.columnResizing,D=M.columnsWithSelectedCells,L=M.draggedHeaderRef,O=M.enableHeaderEditing,W=M.filterIcon,B=M.handleApplyFilter,z=M.handleClearFilter,j=M.handleSelectAll,G=M.headerCollapseIcon,K=M.headerDropdown,V=M.headerExpandIcon,U=M.headerRegistry,_=M.headers,J=M.hoveredHeaderRef,X=M.onColumnOrderChange,$=M.onColumnSelect,Z=M.onHeaderEdit,ee=M.onSort,ne=M.onTableHeaderDragEnd,re=M.headerHeight,te=M.selectColumns,oe=M.selectableColumns,ae=M.selectedColumns,ue=M.setActiveHeaderDropdown,le=M.setCollapsedHeaders,se=M.setHeaders,ce=M.setInitialFocusedCell,de=M.setIsResizing,fe=M.setSelectedCells,ve=M.setSelectedColumns,he=M.sortDownIcon,pe=M.sortUpIcon,we=M.tableBodyContainerRef,xe=!!(null==v?void 0:v.isSortable),ge=!!(null==v?void 0:v.filterable),be=M.filters[v.accessor],Ie=(null==A?void 0:A.accessor)===v.accessor,ye=v.isSelectionColumn&&M.enableRowSelection,Ce=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(v),Re=H.has(v.accessor),Me=function(e){var r=e.isOpen,t=e.estimatedHeight,o=void 0===t?200:t,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,s=n.useRef(null),c=n.useState({}),d=c[0],f=c[1];return n.useEffect(function(){if(r&&s.current){var e=function(){if(s.current){var e=s.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,r=window.innerWidth-e.right,t="bottom",i={};o>n&&e.top>=o&&(t="top");var u="left";a>r+e.width&&(u="right"),"bottom"===t?i.top=e.bottom+l:i.bottom=window.innerHeight-e.top+l,"left"===u?i.left=e.left:i.right=window.innerWidth-e.right,f(i)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},t=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",t,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",t,!0)}}f({})},[r,o,a,l]),{triggerRef:s,position:d}}({isOpen:Ie,estimatedHeight:200,estimatedWidth:250,margin:4}),Ae=Me.triggerRef,Ee=Me.position,Pe=n.useMemo(function(){var e,n,r;if(!k)return!1;var t=_.filter(function(e){return"left"===e.pinned}),o=_.filter(function(e){return!e.pinned}),i=_.filter(function(e){return"right"===e.pinned});return"left"===v.pinned?(null===(e=t[t.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===(r=o[o.length-1])||void 0===r?void 0:r.accessor)===v.accessor},[k,_,v.accessor,v.pinned]),He=n.useMemo(function(){return!(!oe||ye)&&f(v,i).some(function(e){return ae.has(e)})},[oe,ye,v,i,ae]),ke=n.useMemo(function(){return!ye&&f(v,i).some(function(e){return D.has(e)})},[ye,v,i,D]),Te=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==h?void 0:h.singleRowChildren,De=Te&&!v.singleRowChildren,Le="st-header-cell ".concat(v.accessor===(null===(t=J.current)||void 0===t?void 0:t.accessor)?"st-hovered":""," ").concat((null===(o=L.current)||void 0===o?void 0:o.accessor)===v.accessor?"st-dragging":""," ").concat(xe?"clickable":""," ").concat(T&&!xe?"columnReordering":""," ").concat(De?"parent":""," ").concat(Fe?"st-sub-header":""," ").concat(Pe?"st-last-column":""," ").concat(O&&!ye?"st-header-editable":""," ").concat(He?"st-header-selected":""," ").concat(ke&&!He?"st-header-has-highlighted-cell":""),Oe=Se({draggedHeaderRef:L,headers:_,hoveredHeaderRef:J,onColumnOrderChange:X,onTableHeaderDragEnd:ne}),We=Oe.handleDragStart,qe=Oe.handleDragEnd,ze=Oe.handleDragOver,je=me();n.useEffect(function(){if(U&&!v.isSelectionColumn){var e=v.accessor+"";return U.set(e,{setEditing:function(e){C(e)}}),function(){U.delete(e)}}},[U,v.accessor,v.isSelectionColumn]),n.useEffect(function(){N(v.label||"")},[v.label]);var Ge=function(e){b(!g)},Ke=n.useCallback(function(e){N(e);var n=_.map(function(n){return n.accessor===v.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});se(n),Z&&Z(v,e)},[_,se,Z,v]),Ve=n.useCallback(function(){ue&&ue(null)},[ue]),Ue=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]),_e=function(e){var n=e.event,r=e.header;if(!r.isSelectionColumn){if(oe){var t=f(r,i),o=t.some(function(e){return ae.has(e)});if(O&&o&&!n.shiftKey)return K&&Ie&&Ve(),void C(!0);n.shiftKey&&te?ve(function(e){if(0===e.size)return new Set(t);var n=t[0],r=Array.from(e).sort(function(e,n){return e-n}),o=r[0],i=Math.abs(n-o);r.forEach(function(e){var r=Math.abs(n-e);i>r&&(i=r,o=e)});var a,l,s,c=u(u([],(s=Math.min(a=o,l=n),Array.from({length:Math.max(a,l)-s+1},function(e,n){return s+n})),!0),t,!0);return new Set(u(u([],Array.from(e),!0),c,!0))}):te&&te(t),fe(new Set),ce(null)}$&&$(r),!oe&&r.isSortable&&ee(r.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&&!ye&&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,r=null===(n=document.getElementById(p({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;je({callback:Be,callbackProps:{event:e.nativeEvent,header:v,headers:_,setHeaders:se,setIsResizing:de,tableBodyContainerRef:we,startWidth:r,collapsedHeaders:H,autoExpandColumns:P,reverse:w},limit:10})},onTouchStart:function(e){var n,r=null===(n=document.getElementById(p({accessor:v.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;je({callback:Be,callbackProps:{event:e,header:v,headers:_,setHeaders:se,setIsResizing:de,tableBodyContainerRef:we,startWidth:r,collapsedHeaders:H,autoExpandColumns:P,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 _e({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&&pe&&pe,"desc"===m.direction&&he&&he]})),Ye=ge&&W&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:Ge,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(),Ge()))},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=Ce&&!ye&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return Ue(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ue(e))},tabIndex:0,role:"button","aria-label":"".concat(Re?"Expand":"Collapse"," ").concat(v.label," column"),"aria-expanded":!Re},{children:Re?G:V})),Ze=e.jsx(sn,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:ye?e.jsx(Ne,{checked:!!E&&E(),onChange:function(e){j&&j(e)},ariaLabel:"Select all rows"}):y?e.jsx(Q,{defaultValue:S,onBlur:function(){return C(!1)},onChange:Ke}):S||(null==v?void 0:v.label)}))})),Qe="header-desc-".concat(v.accessor),en=function(e,n){var r=[];return e.type&&"other"!==e.type&&r.push("".concat(e.type," column")),e.isSortable&&r.push("sortable"),n&&r.push("filterable"),e.tooltip&&r.push(e.tooltip),r.join(", ")}(v,ge);return e.jsxs(ie,exports.__assign({className:Le,id:p({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){ye||je({callback:ze,callbackProps:{event:e,hoveredHeader:v},limit:50})},style:exports.__assign({gridRowStart:c,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-c>1?{}:{height:re})},{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:Ae,className:"st-header-label",draggable:T&&!v.disableReorder&&!ye,onClick:function(e){ye||_e({event:e,header:v})},onDoubleClick:function(e){ye||function(e){var n=e.header;n.isSelectionColumn||oe&&n.isSortable&&ee(n.accessor)}({event:e,header:v})},onDragEnd:ye?void 0:function(e){e.preventDefault(),qe()},onDragStart:ye?void 0:function(e){T&&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&&!ye&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:K({accessor:v.accessor,colIndex:i,header:v,isOpen:Ie,onClose:Ve,position:Ee})})),en&&e.jsx("span",exports.__assign({id:Qe,className:"st-sr-only"},{children:en}))]}))},dn=function(r){var t=r.columnIndices,o=r.gridTemplateColumns,i=r.handleScroll,a=r.headers,u=r.maxDepth,l=r.pinned,s=r.sectionRef,c=r.sort,d=r.width,f=q().collapsedHeaders,v=n.useMemo(function(){var e=[],n=1,r=function(o,i,s,c){var d,v;if(void 0===s&&(s=!1),!w({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;s||n++;var h,p,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?(h=x+1,p=u+1):m>0?(h=x+m,p=i+1):(h=x+1,p=u+1),e.push({header:o,gridColumnStart:x,gridColumnEnd:h,gridRowStart:i,gridRowEnd:p,colIndex:t[o.accessor],parentHeader:c}),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})&&(r(e,g,b,o),b=!1)})}return h-x},o=a.filter(function(e){return w({header:e,pinned:l,headers:a,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){r(e,1,i),i=!1}),e},[a,u,l,t,f]);return e.jsx(De,exports.__assign({childRef:s,group:l?"pinned-".concat(l):"default"},{children:e.jsx("div",exports.__assign({className:"st-header-".concat(l?"pinned-".concat(l):"main")},i&&{onScroll:i},{ref:s,style:{gridTemplateColumns:o,width:d,position:"relative"}},{children:e.jsx(e.Fragment,{children:v.map(function(n){return e.jsx(cn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:c},n.header.accessor)})})}))}))},fn=function(r){var t=r.centerHeaderRef,o=r.headers,i=r.mainTemplateColumns,a=r.pinnedLeftColumns,u=r.pinnedLeftTemplateColumns,l=r.pinnedRightColumns,s=r.pinnedRightTemplateColumns,c=r.sort,d=r.pinnedLeftWidth,f=r.pinnedRightWidth,v=q(),h=v.headerContainerRef,p=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]),I=n.useMemo(function(){return Object.keys(b).length},[b]);return e.jsxs("div",exports.__assign({className:"st-header-container",ref:h,"aria-rowcount":x.length+g,"aria-colcount":I},{children:[be(o,"left")&&e.jsx(dn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:g,pinned:"left",sectionRef:p,sort:c,width:d}),e.jsx(dn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:g,sectionRef:t,sort:c}),be(o,"right")&&e.jsx(dn,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:g,pinned:"right",sectionRef:w,sort:c,width:f})]}))},vn=function(e){var n=e.collapsedHeaders,r=e.autoExpandColumns,t=function(e){var r=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide&&!e.excludeFromRender)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||d;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&r.push(e),o.length>0?t({headers:o,flattenedHeaders:r}):e.singleRowChildren||r.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||d;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&r.push(e),t({headers:i,flattenedHeaders:r})}else r.push(e)}),r},o=t({headers:e.headers,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e,n){var r=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),r&&"number"==typeof r&&(r="".concat(r,"px")),void 0===r||n?t:"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(r,", ").concat(t,")"):"max(".concat(r,", ").concat(t,")")}(e,r)}).join(" "))},hn=function(r){var t=r.pinnedLeftWidth,o=r.pinnedRightWidth,i=r.setScrollTop,a=r.setScrollDirection,u=r.shouldShowEmptyState,l=r.sort,s=r.tableRows,c=r.rowsToRender,d=q(),f=d.columnResizing,v=d.editColumns,h=d.headers,p=d.collapsedHeaders,w=d.autoExpandColumns,m=n.useRef(null),x=h.filter(function(e){return!e.pinned}),g=h.filter(function(e){return"left"===e.pinned}),b=h.filter(function(e){return"right"===e.pinned}),I=n.useMemo(function(){return vn({headers:g,collapsedHeaders:p,autoExpandColumns:w})},[g,p,w]),y=n.useMemo(function(){return vn({headers:x,collapsedHeaders:p,autoExpandColumns:w})},[x,p,w]),C=n.useMemo(function(){return vn({headers:b,collapsedHeaders:p,autoExpandColumns:w})},[b,p,w]),R={centerHeaderRef:m,headers:h,mainTemplateColumns:y,pinnedLeftColumns:g,pinnedLeftTemplateColumns:I,pinnedRightColumns:b,pinnedRightTemplateColumns:C,sort:l,pinnedLeftWidth:t,pinnedRightWidth:o},S={tableRows:s,mainTemplateColumns:y,pinnedLeftColumns:g,pinnedLeftTemplateColumns:I,pinnedLeftWidth:t,pinnedRightColumns:b,pinnedRightTemplateColumns:C,pinnedRightWidth:o,setScrollTop:i,setScrollDirection:a,shouldShowEmptyState:u,rowsToRender:c};return e.jsxs("div",exports.__assign({className:"st-content ".concat(f?"st-resizeable":"st-not-resizeable"),style:{width:v?"calc(100% - 27.5px)":"100%"}},{children:[e.jsx(fn,exports.__assign({},R)),e.jsx(We,exports.__assign({},S))]}))},pn=function(r){var t=r.mainBodyWidth,o=r.mainBodyRef,i=r.pinnedLeftWidth,a=r.pinnedRightWidth,u=r.pinnedLeftContentWidth,l=r.pinnedRightContentWidth,s=r.tableBodyContainerRef,c=q().editColumns,d=n.useState(!1),f=d[0],v=d[1],h=n.useRef(null),p=n.useRef(null),w=n.useRef(null),m=c?28:0,x=(c?a+1:a)+(s.current&&s.current&&s.current.scrollHeight>s.current.clientHeight?s.current.offsetWidth-s.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){o.current&&v(o.current.scrollWidth-o.current.clientWidth>1)},1)},[o,t]),f?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(De,exports.__assign({childRef:p,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:p,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),t>0&&e.jsx(De,exports.__assign({childRef:h},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:h},{children:e.jsx("div",{style:{width:t}})}))})),a>0&&e.jsx(De,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,r){if(e===n)return 0;var t=e.localeCompare(n);return"asc"===r?t:-t},number:function(e,n,r){if(e===n)return 0;var t=e-n;return"asc"===r?t:-t},boolean:function(e,n,r){if(e===n)return 0;var t=e===n?0:e?-1:1;return"asc"===r?t:-t},date:function(e,n,r){var t=new Date(e),o=new Date(n);if(t.getTime()===o.getTime())return 0;var i=t.getTime()-o.getTime();return"asc"===r?i:-i},enum:function(e,n,r){return wn.string(e,n,r)},default:function(e,n,r){return e===n?0:null==e?"asc"===r?-1:1:null==n?"asc"===r?1:-1:"string"==typeof e&&"string"==typeof n?wn.string(e,n,r):"number"==typeof e&&"number"==typeof n?wn.number(e,n,r):"boolean"==typeof e&&"boolean"==typeof n?wn.boolean(e,n,r):wn.string(e+"",n+"",r)}},mn=function(e){return function(e){var n=e.rows,r=e.sortColumn,t=function(e,n){for(var r=0,o=e;o.length>r;r++){var i=o[r];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=t(i.children,n);if(a)return a}}},o=t(e.headers,r.key.accessor),i=(null==o?void 0:o.type)||"string",a=r.direction,l=r.key.accessor;return u([],n,!0).sort(function(e,r){var t,u;if(null==o?void 0:o.valueGetter){var s=n.indexOf(e),c=n.indexOf(r);t=o.valueGetter({accessor:l,row:e,rowIndex:s}),u=o.valueGetter({accessor:l,row:r,rowIndex:c})}else t=R(e,l),u=R(r,l);return(null==o?void 0:o.comparator)?o.comparator({rowA:e,rowB:r,valueA:t,valueB:u,direction:a}):function(e,n,r,t){if(void 0===r&&(r="string"),null==e||""===e)return"asc"===t?-1:1;if(null==n||""===n)return"asc"===t?1:-1;if("number"===r){var o=function(e){var n;if("number"==typeof e)return e;var r=e+"";if("string"==typeof r){var t=r.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(t){var o=parseFloat(t[1]),i=null===(n=t[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(r)||0},i=o(e),a=o(n);return wn.number(i,a,t)}return"date"===r?wn.date(e+"",n+"",t):"boolean"===r?wn.boolean(!!e,!!n,t):"enum"===r?wn.enum(e+"",n+"",t):wn.string(e+"",n+"",t)}(t,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},xn=function(e){return n.useMemo(function(){var n=v(e),r=new Map;return n.forEach(function(e){r.set(e.accessor,e)}),r},[e])},gn=function(e){var n=e.tableRows,r=e.sortColumn,t=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:r?t&&t.length>0?(0,e.sortNestedRows)({groupingKeys:t,headers:o,rows:n,sortColumn:r}):mn({headers:o,rows:n,sortColumn:r}):n},bn=function(e,n,r){void 0===r&&(r=new Set);for(var t=0,o=e;o.length>t;t++){var i=o[t];if(!r.has(i.accessor)&&(r.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),u=!1;if(!a)for(var l=0,s=i.children;s.length>l;l++){var c=s[l];if(bn([c],n,r),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},In=function(e){return e.every(function(e){return e.hide})},yn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(yn(e.children),In(e.children)&&(e.hide=!0))})},Cn=function(r){var t=r.allHeaders,o=r.depth,i=void 0===o?0:o,a=r.doesAnyHeaderHaveChildren,l=r.header,s=r.isCheckedOverride,c=n.useState(!0),d=c[0],f=c[1],v=q(),h=v.expandIcon,p=v.headers,w=v.setHeaders,m=a?"".concat(16*i,"px"):"8px",x=l.children&&l.children.length>0,g=null!=s?s:l.hide||x&&l.children&&In(l.children);return e.jsxs(e.Fragment,{children:[e.jsxs("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:m}},{children:[a&&e.jsx("div",exports.__assign({className:"st-header-icon-container"},{children:x?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:h})):null})),e.jsx(Ne,exports.__assign({checked:g,onChange:function(e){l.hide=e,e?yn(t):(bn(t,l.accessor),x&&l.children&&l.children.length>0&&l.children.every(function(e){return!0===e.hide})&&l.children[0]&&(l.children[0].hide=!1,bn(t,l.children[0].accessor))),w(u([],p,!0))}},{children:l.label}))]})),x&&d&&l.children&&e.jsx("div",exports.__assign({className:"st-nested-headers"},{children:l.children.map(function(n,r){return e.jsx(Cn,{allHeaders:t,depth:i+1,doesAnyHeaderHaveChildren:a,header:n,isCheckedOverride:!!g||void 0},"".concat(n.accessor,"-").concat(r))})}))]})},Rn=function(r){var t=r.headers,o=r.open,i="left"===r.position?"left":"",a=n.useMemo(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);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:t.map(function(n,r){return n.isSelectionColumn?null:e.jsx(Cn,{doesAnyHeaderHaveChildren:a,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},Sn=function(r){var t=r.columnEditorText,o=r.editColumns,i=r.headers,a=r.position,u=void 0===a?"right":a,l=n.useState(r.editColumnsInitOpen),s=l[0],c=l[1];return o?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(s?"open":""," ").concat(u),onClick:function(){return function(e){c(e)}(!s)},style:{width:28}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:t})),e.jsx(Rn,{headers:i,open:s,position:u})]})):null},Nn=function(r){var o=r.children,i=n.useRef({}),a=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),u=n.useCallback(function(e,n){e.scrollWidth-e.clientWidth>0&&(n.scrollLeft=e.scrollLeft)},[]),l=n.useCallback(function(e){e.onscroll=null},[]),s=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var r;null===(r=i.current[n])||void 0===r||r.forEach(function(n){e!==n&&(l(n),u(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});s(n,e)}))})})})}},[l,u]),c=n.useCallback(function(e,n){n.forEach(function(n){i.current[n]||(i.current[n]=[]),a(e,n)||(i.current[n].length>0&&u(i.current[n][0],e),i.current[n].push(e))}),s(e,n)},[a,u,s]),d=n.useCallback(function(e,n){n.forEach(function(n){if(a(e,n)){l(e);var r=i.current[n].indexOf(e);-1!==r&&i.current[n].splice(r,1)}})},[a,l]);return e.jsx(Fe.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:t.default.Children.only(o)}))},Mn=function(e){var n=e.tableRows,r=e.filterState;return e.externalFilterHandling?n:r&&0!==Object.keys(r).length?n.filter(function(e){return Object.values(r).every(function(n){try{return function(e,n){var r=n.operator,t=n.value,o=n.values;if(null==e)return"isEmpty"===r;if("isEmpty"===r)return!e||""===(e+"").trim();if("isNotEmpty"===r)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===r||"notContains"===r||"startsWith"===r||"endsWith"===r){var i=(e+"").toLowerCase(),a=t?(t+"").toLowerCase():"";switch(r){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(+e)){var u=+e,l=+t;switch(r){case"equals":return u===l;case"notEquals":return u!==l;case"greaterThan":return u>l;case"lessThan":return l>u;case"greaterThanOrEqual":return u>=l;case"lessThanOrEqual":return l>=u;case"between":if(o&&2===o.length){var s=o.map(Number),c=s[1];return u>=s[0]&&c>=u}return!1;case"notBetween":if(o&&2===o.length){var d=o.map(Number);return c=d[1],d[0]>u||u>c}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=de(e),v=de((t||"")+""),h=ce(f),p=ce(v);switch(r){case"equals":return h.getTime()===p.getTime();case"notEquals":return h.getTime()!==p.getTime();case"before":return p>h;case"after":return h>p;case"between":if(o&&2===o.length){var w=o.map(function(e){return ce(de((e||"")+""))}),m=w[1];return h>=w[0]&&m>=h}return!1;case"notBetween":if(o&&2===o.length){var x=o.map(function(e){return ce(de((e||"")+""))});return m=x[1],x[0]>h||h>m}return!0}}if("boolean"==typeof e&&"equals"===r)return e===!!t;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"===r||"notIn"===r){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===r?b:!b}return!1}var I=(e+"").toLowerCase(),y=t?(t+"").toLowerCase():"";switch(r){case"equals":return I===y;case"notEquals":return I!==y;default:return!0}}(R(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},An=function(e){var n,r=document.querySelector(".simple-table-root");if("string"==typeof e){if(e.endsWith("px"))return parseInt(e,10);if(e.endsWith("vh"))return window.innerHeight*parseInt(e,10)/100;if(e.endsWith("%")){var t=null===(n=null==r?void 0:r.parentElement)||void 0===n?void 0:n.clientHeight;return!t||50>t?0:t*parseInt(e,10)/100}return window.innerHeight}return e},En=function(e,n,r,t){var o=[],i=function(e){e.forEach(function(e){var r=t?e[t]:void 0;if(t&&r&&N(r))i(r);else{var a=R(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===r.type&&r.customFn)return r.customFn(o);var a,u=r.parseValue?o.map(r.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===u.length)return"count"===r.type?o.length:void 0;switch(r.type){case"sum":a=u.reduce(function(e,n){return e+n},0);break;case"average":a=u.reduce(function(e,n){return e+n},0)/u.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,u);break;case"max":a=Math.max.apply(Math,u);break;default:return}return r.formatResult?r.formatResult(a):a}},Pn=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var r=n.replace(/"/g,'""');return'"'.concat(r,'"')}return n},Hn=function(e){return function(){for(var n=[],r=0;arguments.length>r;r++)n[r]=arguments[r];return new Promise(function(r){e.apply(void 0,n),setTimeout(function(){return r()},0)})}},kn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},Tn={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")},Dn=function(e,n,r,t){return void 0===r&&(r={}),new Promise(function(t){e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){Fn(e),e.removeEventListener("transitionend",o),r.onComplete&&r.onComplete(),t()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Ln=function(e){var r=e.rows,t=e.rowGrouping,o=void 0===t?[]:t,i=e.rowIdAccessor,a=e.unexpandedRows,l=e.expandAll,s=e.rowStateMap,c=e.hasLoadingRenderer,d=e.hasErrorRenderer,f=e.hasEmptyRenderer;return n.useMemo(function(){if(!o||0===o.length)return r.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,rowPath:[n],absoluteRowIndex:n}});var e=[],n=function(r,t,v){void 0===v&&(v=[]),r.forEach(function(r,h){var p,w=o[t],m=e.length,x=u(u([],v,!0),[h],!1),g=M({row:r,rowIdAccessor:i,rowPath:x});if(e.push({row:r,depth:t,displayPosition:m,groupingKey:w,position:m,isLastGroupRow:0===t,rowPath:x,absoluteRowIndex:m}),E(g,l,a)&&o.length>t){var b=null==s?void 0:s.get(g),I=A(r,w);if(b&&(b.loading||b.error||b.isEmpty)){if(b.loading&&c||b.error&&d||b.isEmpty&&f){var y=e.length;e.push({row:{},depth:t+1,displayPosition:y,groupingKey:w,position:y,isLastGroupRow:!1,rowPath:u(u([],x,!0),[w],!1),stateIndicator:{parentRowId:g,state:b},absoluteRowIndex:y})}else if(b.loading&&!c){var C=e.length;e.push({row:(p={},p[i]="".concat(g,"-loading-skeleton"),p),depth:t+1,displayPosition:C,groupingKey:w,position:C,isLastGroupRow:!1,rowPath:u(u([],x,!0),[w],!1),isLoadingSkeleton:!0,absoluteRowIndex:C})}}else if(I.length>0){var R=u(u([],x,!0),[w],!1);n(I,t+1,R)}}})};return n(r,0),e},[r,o,i,a,l,s,c,d,f])},On=function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},Wn=function(r){var t=r.allowAnimations,o=void 0!==t&&t,s=r.autoExpandColumns,d=void 0!==s&&s,f=r.canExpandRowGroup,h=r.cellUpdateFlash,p=void 0!==h&&h,w=r.className,g=r.columnBorders,b=void 0!==g&&g,I=r.columnEditorPosition,y=void 0===I?"right":I,C=r.columnEditorText,A=void 0===C?"Columns":C,E=r.columnReordering,H=void 0!==E&&E,T=r.columnResizing,F=void 0!==T&&T,D=r.copyHeadersToClipboard,W=void 0!==D&&D,q=r.defaultHeaders,V=r.editColumns,J=void 0!==V&&V,Y=r.editColumnsInitOpen,$=void 0!==Y&&Y,Z=r.enableHeaderEditing,Q=void 0!==Z&&Z,ee=r.enableRowSelection,ne=void 0!==ee&&ee,re=r.expandAll,te=void 0===re||re,oe=r.expandIcon,ie=void 0===oe?e.jsx(G,{className:"st-expand-icon"}):oe,ae=r.externalFilterHandling,ue=void 0!==ae&&ae,le=r.externalSortHandling,se=void 0!==le&&le,ce=r.filterIcon,de=void 0===ce?e.jsx(_,{className:"st-header-icon"}):ce,fe=r.footerHeight,ve=void 0===fe?49:fe,he=r.footerRenderer,pe=r.headerCollapseIcon,we=void 0===pe?e.jsx(G,{className:"st-header-icon"}):pe,me=r.headerExpandIcon,ge=void 0===me?e.jsx(j,{className:"st-header-icon"}):me,be=r.headerDropdown,Ie=r.headerHeight,ye=r.height,Ce=r.maxHeight,Re=r.hideFooter,Se=void 0!==Re&&Re,Ne=r.includeHeadersInCSVExport,Me=void 0===Ne||Ne,Ae=r.initialSortColumn,Ee=r.initialSortDirection,Pe=void 0===Ee?"asc":Ee,He=r.isLoading,ke=void 0!==He&&He,Te=r.loadingStateRenderer,Fe=r.errorStateRenderer,De=r.emptyStateRenderer,Le=r.nextIcon,Oe=void 0===Le?e.jsx(G,{className:"st-next-prev-icon"}):Le,We=r.onCellEdit,Be=r.onCellClick,qe=r.onColumnOrderChange,je=r.onColumnSelect,Ge=r.onFilterChange,Ke=r.onGridReady,Ve=r.onHeaderEdit,Ue=r.onLoadMore,_e=r.onNextPage,Je=r.onPageChange,Xe=r.onRowGroupExpand,Ye=r.onRowSelectionChange,$e=r.onSortChange,Ze=r.prevIcon,Qe=void 0===Ze?e.jsx(j,{className:"st-next-prev-icon"}):Ze,en=r.rowButtons,nn=r.rowGrouping,rn=r.rowHeight,tn=void 0===rn?32:rn,on=r.rowIdAccessor,an=r.rows,un=r.rowsPerPage,ln=void 0===un?10:un,sn=r.selectableCells,cn=void 0!==sn&&sn,dn=r.selectableColumns,fn=void 0!==dn&&dn,vn=r.selectionColumnWidth,wn=void 0===vn?42:vn,bn=r.serverSidePagination,In=void 0!==bn&&bn,yn=r.shouldPaginate,Cn=void 0!==yn&&yn,Rn=r.sortDownIcon,kn=void 0===Rn?e.jsx(U,{className:"st-header-icon"}):Rn,Fn=r.sortUpIcon,Dn=void 0===Fn?e.jsx(K,{className:"st-header-icon"}):Fn,Wn=r.tableEmptyStateRenderer,Bn=void 0===Wn?e.jsx(On,{}):Wn,qn=r.tableRef,zn=r.theme,jn=void 0===zn?"light":zn,Gn=r.totalRowCount,Kn=r.useHoverRowBackground,Vn=void 0===Kn||Kn,Un=r.useOddColumnBackground,_n=void 0!==Un&&Un,Jn=r.useOddEvenRowBackground,Xn=void 0!==Jn&&Jn;_n&&(Xn=!1),b&&(Vn=!1);var Yn=n.useRef(null),$n=n.useRef(null),Zn=n.useRef(null),Qn=n.useRef(null),er=n.useRef(null),nr=n.useRef(null),rr=n.useRef(null),tr=n.useReducer(function(e){return e+1},0)[1],or=n.useState(new Map),ir=or[0],ar=or[1],ur=n.useState(an),lr=ur[0],sr=ur[1],cr=n.useRef(new Map);n.useEffect(function(){sr(an);var e=new Map;an.forEach(function(n,r){var t=M({row:n,rowIdAccessor:on});e.set(t,r)}),cr.current=e},[an,on]);var dr=function(e){var r=e.tableBodyContainerRef,t=n.useState(0),o=t[0],i=t[1];return n.useLayoutEffect(function(){r.current&&i(r.current.offsetWidth-r.current.clientWidth)},[r]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:r}}({tableBodyContainerRef:nr}),fr=dr.scrollbarWidth,vr=dr.setScrollbarWidth,hr=X({headerContainerRef:rr,mainSectionRef:nr,scrollbarWidth:fr}).isMainSectionScrollable,pr=n.useMemo(function(){if(ke&&0===lr.length){var e=Cn?ln:10;hr&&(e+=1);var n=Array.from({length:e},function(e,n){var r;return(r={})[on]="loading-".concat(n),r});return n}return lr},[ke,lr,on,ln,hr,Cn]),wr=n.useState(1),mr=wr[0],xr=wr[1],gr=n.useState(q),br=gr[0],Ir=gr[1],yr=n.useState(!1),Cr=yr[0],Rr=yr[1],Sr=n.useState(!1),Nr=Sr[0],Mr=Sr[1],Ar=n.useState(null),Er=Ar[0],Pr=Ar[1],Hr=n.useCallback(function(){var e=new Set,n=function(r){r.forEach(function(r){r.collapseDefault&&r.collapsible&&e.add(r.accessor),r.children&&n(r.children)})};return n(q),e},[q]),kr=n.useState(Hr),Tr=kr[0],Fr=kr[1];n.useEffect(function(){Ir(q)},[q]);var Dr=function(e){var r=e.rows,t=e.rowIdAccessor,o=e.onRowSelectionChange,i=e.enableRowSelection,a=void 0!==i&&i,u=n.useState(new Set),l=u[0],s=u[1],c=n.useCallback(function(e){return!!a&&function(e,n){return n.has(e)}(e,l)},[l,a]),d=n.useCallback(function(){return!!a&&function(e,n,r){return 0!==e.length&&e.every(function(e){return r.has(e[n]+"")})}(r,t,l)},[r,t,l,a]),f=n.useMemo(function(){return a?function(e){return e.size}(l):0},[l,a]),v=n.useMemo(function(){return a?function(e,n,r){return e.filter(function(e){return r.has(e[n]+"")})}(r,t,l):[]},[r,t,l,a]),h=n.useCallback(function(e,n){if(a){var i=function(e,n){var r=new Set(n);return r.has(e)?r.delete(e):r.add(e),r}(e,l);if(s(i),o){var u=r.find(function(n){return n[t]+""===e});u&&o({row:u,isSelected:n,selectedRows:i})}}},[l,r,t,o,a]),p=n.useCallback(function(e){var n;a&&(e?(n=function(e,n){return new Set(e.map(function(e){return e[n]+""}))}(r,t),o&&r.forEach(function(e){return o({row:e,isSelected:!0,selectedRows:n})})):(n=new Set,o&&l.forEach(function(e){var i=r.find(function(n){return n[t]+""===e});i&&o({row:i,isSelected:!1,selectedRows:n})})),s(n))},[r,t,o,l,a]),w=n.useCallback(function(e){if(a){var n=c(e);h(e,!n)}},[c,h,a]),m=n.useCallback(function(){if(a){if(o){var e=new Set;l.forEach(function(n){var i=r.find(function(e){return e[t]+""===n});i&&o({row:i,isSelected:!1,selectedRows:e})})}s(new Set)}},[l,r,t,o,a]);return{selectedRows:l,setSelectedRows:s,isRowSelected:c,areAllRowsSelected:d,selectedRowCount:f,selectedRowsData:v,handleRowSelect:h,handleSelectAll:p,handleToggleRow:w,clearSelection:m}}({rows:pr,rowIdAccessor:on,onRowSelectionChange:Ye,enableRowSelection:ne}),Lr=Dr.selectedRows,Or=Dr.setSelectedRows,Wr=Dr.isRowSelected,Br=Dr.areAllRowsSelected,qr=Dr.selectedRowCount,zr=Dr.selectedRowsData,jr=Dr.handleRowSelect,Gr=Dr.handleSelectAll,Kr=Dr.handleToggleRow,Vr=Dr.clearSelection,Ur=n.useMemo(function(){var e,n=u([],br,!0);return ne&&!(null===(e=null==br?void 0:br[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:wn,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[ne,br,wn]),_r=n.useState(0),Jr=_r[0],Xr=_r[1],Yr=n.useState("none"),$r=Yr[0],Zr=Yr[1],Qr=n.useState(new Set),et=Qr[0],nt=Qr[1],rt=function(){var e=n.useState(""),r=e[0],t=e[1],o=n.useRef(null);return n.useEffect(function(){return r&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){t("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[r]),{announcement:r,announce:function(e){t(e)}}}(),tt=rt.announcement,ot=rt.announce,it=function(e){var r=e.effectiveHeaders,t=e.headerHeight,o=e.rowHeight,i=e.tableBodyContainerRef,a=n.useState(0),u=a[0],l=a[1],s=n.useCallback(function(e){var n,r;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(r=e.children)||void 0===r?void 0:r.length)?1+Math.max.apply(Math,e.children.map(s)):1},[]),c=n.useMemo(function(){var e=0;return r.forEach(function(n){var r=s(n);e=Math.max(e,r)}),e},[r,s]),d=n.useMemo(function(){var e=1;if("undefined"!=typeof window){var n=document.documentElement,r=getComputedStyle(n).getPropertyValue("--st-border-width").trim();if(r){var i=parseFloat(r);isNaN(i)||(e=i)}}return c*(null!=t?t:o)+e},[c,t,o]);return n.useLayoutEffect(function(){var e=function(){i.current&&l(i.current.clientWidth)};e();var n=null;return i.current&&(n=new ResizeObserver(e)).observe(i.current),function(){n&&n.disconnect()}},[i]),{containerWidth:u,calculatedHeaderHeight:d,maxHeaderDepth:c}}({effectiveHeaders:Ur,headerHeight:Ie,rowHeight:tn,tableBodyContainerRef:nr}),at=it.containerWidth,ut=it.calculatedHeaderHeight,lt=it.maxHeaderDepth,st=n.useRef(0),ct=n.useRef(0),dt=n.useMemo(function(){var e=c(window.innerWidth),n=ze({headers:Ur,containerWidth:at,maxPinnedWidthPercent:e,collapsedHeaders:Tr});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[Ur,at,Tr]),ft=dt.mainBodyWidth,vt=dt.pinnedLeftWidth,ht=dt.pinnedRightWidth,pt=dt.pinnedLeftContentWidth,wt=dt.pinnedRightContentWidth;n.useEffect(function(){if(d&&0!==at&&!Cr){var e,n=function(e){var r=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?r.push.apply(r,n(e.children)):r.push(e))}),r};if((e=Zn.current?Zn.current.clientWidth:Math.max(0,at-vt-ht))>0){var r=br.filter(function(e){return!e.pinned});n(r).length===ct.current&&10>Math.abs(e-st.current)||Ir(function(r){var t=r.filter(function(e){return!e.pinned}),o=n(t),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 r;var a=e/i;if(.01>Math.abs(a-1))return r;st.current=e,ct.current=o.length;var u=new Map,l=0;o.forEach(function(n,r){if(!n.pinned){var t,i="number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150;r===o.length-1?t=e-l:l+=t=Math.round(i*a),u.set(n.accessor,t)}});var s=function(e){var n;if(e.hide)return e;var r=null===(n=e.children)||void 0===n?void 0:n.map(s);if(!e.children||0===e.children.length){if(e.pinned)return exports.__assign(exports.__assign({},e),{children:r});var t=u.get(e.accessor);if(void 0!==t)return exports.__assign(exports.__assign({},e),{width:t,children:r});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:r})}return exports.__assign(exports.__assign({},e),{children:r})};return r.map(s)})}}},[d,at,Cr,br,vt,ht]);var mt=function(e){var r=e.rows,t=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return r;var e=function(e){return v(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return r;var n=JSON.parse(JSON.stringify(r)),i=function(n,r){return void 0===r&&(r=0),n.map(function(n){var t=o[r],a=o[r+1],u=n[t];if(u&&N(u)){var l=i(u,r+1),s=exports.__assign({},n);return s[t]=l,e.forEach(function(e){var n=En(l,e.accessor,e.aggregation,a);void 0!==n&&S(s,e.accessor,n)}),s}return n})};return i(n)},[r,t,o])}({rows:pr,headers:br,rowGrouping:nn}),xt=function(e){var r=e.rows,t=e.headers,o=e.externalFilterHandling,i=e.onFilterChange,a=e.announce,u=n.useState({}),l=u[0],s=u[1],c=xn(t),d=n.useMemo(function(){return Mn({externalFilterHandling:o,tableRows:r,filterState:l})},[r,l,o]),f=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));if(s(r),null==i||i(r),a){var t=c.get(e.accessor);t&&a("Filter applied to ".concat(t.label))}},[l,i,a,c]),v=n.useCallback(function(e){var n=exports.__assign({},l);if(delete n[e],s(n),null==i||i(n),a){var r=c.get(e);r&&a("Filter removed from ".concat(r.label))}},[l,i,a,c]),h=n.useCallback(function(){s({}),null==i||i({}),a&&a("All filters cleared")},[i,a]),p=n.useCallback(function(e){var n,t=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));return Mn({externalFilterHandling:o,tableRows:r,filterState:t})},[l,r,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:h,filters:l,computeFilteredRowsPreview:p}}({rows:mt,headers:Ur,externalFilterHandling:ue,onFilterChange:Ge,announce:ot}),gt=xt.filters,bt=xt.updateFilter,It=xt.clearFilter,yt=xt.clearAllFilters,Ct=xt.computeFilteredRowsPreview,Rt=function(e){var r=e.headers,t=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=e.initialSortColumn,l=e.initialSortDirection,s=e.announce,c=xn(r),d=n.useCallback(function(){if(!u)return null;var e=c.get(u);return e?{key:e,direction:l||"asc"}:null},[c,u,l]),f=n.useState(d),v=f[0],h=f[1],p=n.useCallback(function(e){var n=e.groupingKeys,r=e.headers,t=e.sortColumn,o=mn({headers:r,rows:e.rows,sortColumn:t});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(N(a)){var u=p({rows:a,sortColumn:t,headers:r,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),w=n.useMemo(function(){return gn({externalSortHandling:o,tableRows:t,sortColumn:v,rowGrouping:a,headers:r,sortNestedRows:p})},[t,v,r,o,a,p]),m=n.useCallback(function(e){if(!e)return h(null),void(null==i||i(null));var n=e.accessor,r=e.direction,t=c.get(n);if(t){var o=null;if(r?o={key:t,direction:r}:v&&v.key.accessor===n?"asc"===v.direction&&(o={key:t,direction:"desc"}):o={key:t,direction:"asc"},h(o),null==i||i(o),s)if(o){var a="asc"===o.direction?"ascending":"descending";s("Sorted by ".concat(t.label,", ").concat(a))}else s("Sort removed from ".concat(t.label))}},[v,c,i,s]),x=n.useCallback(function(e){var n=function(r){for(var t=0,o=r;o.length>t;t++){var i=o[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(r);if(!i)return t;var u=null;return v&&v.key.accessor===e?"asc"===v.direction&&(u={key:i,direction:"desc"}):u={key:i,direction:"asc"},gn({externalSortHandling:o,tableRows:t,sortColumn:u,rowGrouping:a,headers:r,sortNestedRows:p})},[v,r,t,o,a,p]);return{sort:v,sortedRows:w,updateSort:m,computeSortedRowsPreview:x}}({headers:br,tableRows:xt.filteredRows,externalSortHandling:se,onSortChange:$e,rowGrouping:nn,initialSortColumn:Ae,initialSortDirection:Pe,announce:ot}),St=Rt.sort,Nt=Rt.updateSort,Mt=Rt.computeSortedRowsPreview,At=Ln({rows:Rt.sortedRows,rowGrouping:nn,rowIdAccessor:on,unexpandedRows:et,expandAll:te,rowStateMap:ir,hasLoadingRenderer:!!Te,hasErrorRenderer:!!Fe,hasEmptyRenderer:!!De}),Et=Ln({rows:mt,rowGrouping:nn,rowIdAccessor:on,unexpandedRows:et,expandAll:te,rowStateMap:ir,hasLoadingRenderer:!!Te,hasErrorRenderer:!!Fe,hasEmptyRenderer:!!De}),Pt=n.useCallback(function(e){var n=Ct(e);return nn&&0!==nn.length?P({rows:n,rowGrouping:nn,rowIdAccessor:on,unexpandedRows:et,expandAll:te,rowStateMap:ir,hasLoadingRenderer:!!Te,hasErrorRenderer:!!Fe,hasEmptyRenderer:!!De}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowPath:[n],absoluteRowIndex:n}})},[Ct,nn,on,et,te,ir,Te,Fe,De]),Ht=n.useCallback(function(e){var n=Mt(e);return nn&&0!==nn.length?P({rows:n,rowGrouping:nn,rowIdAccessor:on,unexpandedRows:et,expandAll:te,rowStateMap:ir,hasLoadingRenderer:!!Te,hasErrorRenderer:!!Fe,hasEmptyRenderer:!!De}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowPath:[n],absoluteRowIndex:n}})},[Mt,nn,on,et,te,ir,Te,Fe,De]),kt=function(e){var r=e.height,t=e.maxHeight,o=e.rowHeight,i=e.shouldPaginate,a=e.rowsPerPage,u=e.totalRowCount,l=e.headerHeight,s=e.footerHeight;return n.useMemo(function(){if(t){var e=An(t);if(0===e)return;var n=l||o;if(e>=n+u*o+(s||0)||20>u)return;return Math.max(0,e-n)}if(!r&&i&&a)return o*(a+1);if(r){var c=An(r);if(0!==c)return Math.max(0,c-o)}},[r,t,o,i,a,u,l,s])}({height:ye,maxHeight:Ce,rowHeight:tn,shouldPaginate:Cn,rowsPerPage:ln,totalRowCount:null!=Gn?Gn:At.length,headerHeight:ut,footerHeight:Cn&&!Se?ve:void 0}),Tt=function(e){var r=e.allowAnimations,t=e.flattenedRows,o=e.originalFlattenedRows,i=e.currentPage,a=e.rowsPerPage,s=e.shouldPaginate,c=e.serverSidePagination,d=e.rowIdAccessor,f=e.contentHeight,v=e.rowHeight,h=e.scrollTop,p=e.scrollDirection,w=void 0===p?"none":p,m=e.computeFilteredRowsPreview,x=e.computeSortedRowsPreview,g=n.useState(!1),b=g[0],I=g[1],y=n.useState([]),C=y[0],R=y[1],S=n.useRef([]),N=n.useRef([]),A=n.useMemo(function(){return l(v)},[v]),E=n.useRef(new Map),P=n.useRef(null),H=n.useCallback(function(e){var n=(i-1)*a;return(s&&!c?e.slice(n,i*a):e).map(function(e,r){return exports.__assign(exports.__assign({},e),{position:r,displayPosition:r,absoluteRowIndex:s&&!c?n+r:r})})},[i,a,c,s]);n.useMemo(function(){if(0===E.current.size&&o.length>0){var e=new Map;o.forEach(function(n,r){var t=M({row:n.row,rowIdAccessor:d,rowPath:n.rowPath})+"";e.set(t,r)}),E.current=e}},[o,d]);var T=n.useMemo(function(){return H(t)},[t,H]),F=n.useMemo(function(){return void 0===f?T:k({bufferRowCount:A,contentHeight:f,tableRows:T,rowHeight:v,scrollTop:h,scrollDirection:w})},[T,f,v,h,w,A]),D=n.useCallback(function(e,n){var r=new Set(e.map(function(e){return M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+""})),t=new Set(n.map(function(e){return M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+""}));return{staying:n.filter(function(e){var n=M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+"";return r.has(n)}),entering:n.filter(function(e){var n=M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+"";return!r.has(n)}),leaving:e.filter(function(e){var n=M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+"";return!t.has(n)})}},[d]),L=n.useMemo(function(){if(0===S.current.length)return!1;var e=T.map(function(e){return M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+""}),n=S.current.map(function(e){return M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+""});return e.length!==n.length||!e.every(function(e,r){return e===n[r]})},[T,d]);n.useLayoutEffect(function(){if(!b){var e=function(){C.length>0&&R([])};if(!r||s)return e(),S.current=T,void(N.current=F);if(0===S.current.length)return e(),S.current=T,void(N.current=F);if(!L)return e(),S.current=T,void(N.current=F);P.current={tableRows:T,visibleRows:F},I(!0)}},[r,T,C.length,L,b,s,F]),n.useLayoutEffect(function(){if(b&&P.current&&C.length>0){var e=setTimeout(function(){var e=P.current;I(!1),R([]),S.current=e.tableRows,N.current=e.visibleRows,P.current=null},Tn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[b,C.length]);var O=n.useMemo(function(){if(!r||s)return F;if(C.length>0){var e=new Map,n=new Map;return T.forEach(function(r){var t=M({row:r.row,rowIdAccessor:d,rowPath:r.rowPath})+"";e.set(t,r.position),n.set(t,r.displayPosition)}),C.map(function(r){var t=M({row:r.row,rowIdAccessor:d,rowPath:r.rowPath})+"",o=e.get(t),i=n.get(t);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},r),{position:o,displayPosition:i}):r})}return F},[F,C,T,r,s,d]),W=n.useCallback(function(e){if(r&&!s&&void 0!==f){var n=m(e),t=H(n),o=k({bufferRowCount:A,contentHeight:f,tableRows:t,rowHeight:v,scrollTop:h,scrollDirection:w}),i=D(F,o).entering.map(function(e){var n=M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+"";return T.find(function(e){return M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+""===n})||e}).filter(Boolean);i.length>0&&R(u(u([],F,!0),i,!0))}},[r,s,m,H,f,v,h,w,D,T,F,d,A]),B=n.useCallback(function(e){if(r&&!s&&void 0!==f){var n=x(e),t=H(n),o=k({bufferRowCount:A,contentHeight:f,tableRows:t,rowHeight:v,scrollTop:h,scrollDirection:w}),i=D(F,o).entering.map(function(e){var n=M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+"";return T.find(function(e){return M({row:e.row,rowIdAccessor:d,rowPath:e.rowPath})+""===n})||e}).filter(Boolean);i.length>0&&R(u(u([],F,!0),i,!0))}},[r,s,x,H,f,v,h,w,D,T,F,d,A]);return{currentTableRows:T,currentVisibleRows:F,isAnimating:b,prepareForFilterChange:W,prepareForSortChange:B,rowsToRender:O}}({allowAnimations:o,flattenedRows:At,originalFlattenedRows:Et,currentPage:mr,rowsPerPage:ln,shouldPaginate:Cn,serverSidePagination:In,rowIdAccessor:on,contentHeight:kt,rowHeight:tn,scrollTop:Jr,scrollDirection:$r,computeFilteredRowsPreview:Pt,computeSortedRowsPreview:Ht}),Ft=Tt.currentTableRows,Dt=Tt.rowsToRender,Lt=Tt.prepareForFilterChange,Ot=Tt.prepareForSortChange,Wt=Tt.isAnimating,Bt=n.useRef(new Map),qt=n.useRef(new Map),zt=function(e){var r=e.selectableCells,t=e.headers,o=e.tableRows,u=e.rowIdAccessor,l=e.onCellEdit,s=e.cellRegistry,c=e.collapsedHeaders,d=e.rowHeight,f=e.enableRowSelection,v=void 0!==f&&f,h=e.copyHeadersToClipboard,p=void 0!==h&&h,w=n.useState(new Set),m=w[0],g=w[1],b=n.useState(new Set),I=b[0],y=b[1],C=n.useState(null),N=C[0],A=C[1],E=n.useState(null),P=E[0],H=E[1],k=n.useState(new Set),T=k[0],F=k[1],D=n.useState(new Set),W=D[0],B=D[1],q=n.useState(!1),z=q[0],j=q[1],G=n.useRef(!1),K=n.useRef(null),V=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var r=n.split("-");if(r.length>=2){var t=parseInt(r[1],10);isNaN(t)||e.add(t)}}),I.forEach(function(n){e.add(n)}),e},[m,I]),U=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var r=n.split("-");if(r.length>=3){var t=r.slice(2).join("-");e.add(t)}}),I.size>0&&o.forEach(function(n){var r=M({row:n.row,rowIdAccessor:u,rowPath:n.rowPath});e.add(r+"")}),e},[m,I,o,u]),_=n.useMemo(function(){return t.flatMap(function(e){return x(e,c)})},[t,c]),J=n.useCallback(function(){if(0!==m.size){var e=function(e,n,r,t){void 0===t&&(t=!1);var o=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),i=new Map,a=new Map;o.forEach(function(e,n){i.set(n,e.accessor),a.set(n,e)});var u=Array.from(e).reduce(function(e,n){var t,o=n.split("-").map(Number),u=o[0],l=o[1];e[u]||(e[u]=[]);var s=i.get(l),c=a.get(l);if(s&&(null===(t=r[u])||void 0===t?void 0:t.row)){var d=r[u].row,f=R(d,s);if(!1!==(null==c?void 0:c.useFormattedValueForClipboard)&&(null==c?void 0:c.valueFormatter)){var v=c.valueFormatter({accessor:s,colIndex:l,row:d,rowIndex:u,value:f});e[u][l]=v}else e[u][l]=!c||"lineAreaChart"!==c.type&&"barChart"!==c.type?f:Array.isArray(f)?f.join(", "):""}else e[u][l]="";return e},{}),l=new Set;t&&Array.from(e).forEach(function(e){var n=e.split("-").map(Number);l.add(n[1])});var s="";t&&l.size>0&&(s=Array.from(l).sort(function(e,n){return e-n}).map(function(e){var n,r=a.get(e);return null!==(n=null==r?void 0:r.label)&&void 0!==n?n:""}).join("\t"));var c=Object.values(u).map(function(e){return Object.values(e).join("\t")}).join("\n");return t&&s?"".concat(s,"\n").concat(c):c}(m,_,o,p);navigator.clipboard.writeText(e),F(new Set(m)),setTimeout(function(){return F(new Set)},800)}},[m,_,o,p]),X=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,r,t,i;return a(this,function(a){switch(a.label){case 0:if(!P)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?(n=function(e,n,r,t,o,i,a){var u=new Set,l=new Set,s=e.split("\n").filter(function(e){return e.length>0});if(0===s.length)return{updatedCells:u,warningCells:l};var c=r.filter(function(e){return!e.hide&&!e.excludeFromRender}),d=n.rowIndex,f=n.colIndex;return s.forEach(function(e,n){e.split("\t").forEach(function(e,r){var s=d+n,v=f+r;if(t.length>s&&c.length>v){var h=t[s],p=c[v],w=M({row:h.row,rowIdAccessor:o,rowPath:h.rowPath});if(null==p?void 0:p.isEditable){var m=e;if("number"===p.type){var x=+e;isNaN(x)||(m=x)}else if("boolean"===p.type)m="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var g=new Date(e);isNaN(g.getTime())||(m=g)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(m=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(S(h.row,p.accessor,m),a){var b="".concat(w,"-").concat(p.accessor),I=a.get(b);I&&I.updateContent(m)}null==i||i({accessor:p.accessor,newValue:m,row:h.row,rowIndex:s});var y="".concat(s,"-").concat(v,"-").concat(w);u.add(y)}else{var C="".concat(s,"-").concat(v,"-").concat(w);l.add(C)}}})}),{updatedCells:u,warningCells:l}}(e,P,_,o,u,l,s),t=n.warningCells,(r=n.updatedCells).size>0&&(F(r),setTimeout(function(){return F(new Set)},800)),t.size>0&&(B(t),setTimeout(function(){return B(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]}})})},[P,_,o,u,l,s]),Y=n.useCallback(function(){if(0!==m.size){var e=function(e,n,r,t,o,i){var a=new Set,u=new Set,l=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),s=new Map;return l.forEach(function(e,n){s.set(n,e.accessor)}),Array.from(e).forEach(function(e){var n=e.split("-").map(Number),s=n[0],c=n[1];if(r.length>s&&l.length>c){var d=r[s],f=l[c],v=M({row:d.row,rowIdAccessor:t,rowPath:d.rowPath});if(null==f?void 0:f.isEditable){var h;if(h="string"===f.type?"":"number"===f.type?null:"boolean"!==f.type&&("date"===f.type?null:"lineAreaChart"===f.type||"barChart"===f.type||Array.isArray(R(d.row,f.accessor))?[]:""),S(d.row,f.accessor,h),i){var p="".concat(v,"-").concat(f.accessor),w=i.get(p);w&&w.updateContent(h)}null==o||o({accessor:f.accessor,newValue:h,row:d.row,rowIndex:s}),a.add(e)}else u.add(e)}}),{deletedCells:a,warningCells:u}}(m,_,o,u,l,s),n=e.deletedCells,r=e.warningCells;n.size>0&&(F(n),setTimeout(function(){return F(new Set)},800)),r.size>0&&(B(r),setTimeout(function(){return B(new Set)},800))}},[m,_,o,u,l,s]),$=n.useCallback(function(e,n){for(var r=new Set,t=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),s=t;i>=s;s++)for(var c=a;l>=c;c++)if(s>=0&&o.length>s){if(v&&0===c)continue;var f=o[s],h=M({row:f.row,rowIdAccessor:u,rowPath:f.rowPath});r.add(O({colIndex:c,rowIndex:s,rowId:h}))}y(new Set),A(null),g(r),H(n),setTimeout(function(){return L(n,d)},0)},[o,u,d,v]),Z=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(v?_.length:_.length-1)>=e.colIndex){var n=O(e);y(new Set),A(null),g(new Set([n])),H(e),setTimeout(function(){return L(e,d)},0)}},[_.length,o.length,d,v]),Q=n.useCallback(function(e,n){void 0===n&&(n=!1),g(new Set),H(null),y(function(r){var t=new Set(n?r:[]);return e.forEach(function(e){return t.add(e)}),t}),e.length>0&&A(e[e.length-1])},[]);!function(e){var r=e.selectableCells,t=e.initialFocusedCell,o=e.tableRows,i=e.leafHeaders,a=e.rowIdAccessor,u=e.selectSingleCell,l=e.selectCellRange,s=e.setSelectedCells,c=e.setSelectedColumns,d=e.setLastSelectedColumnIndex,f=e.copyToClipboard,v=e.pasteFromClipboard,h=e.deleteSelectedCells,p=e.startCell,w=e.enableRowSelection,m=void 0!==w&&w;n.useEffect(function(){var e=function(e){if(r&&t){var u=t.rowIndex,l=t.colIndex,R=t.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void v();if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();for(var S=new Set,N=0;o.length>N;N++)for(var A=0;i.length>A;A++){var E=m?A+1:A,P=o[N],H=M({row:P.row,rowIdAccessor:a,rowPath:P.rowPath});S.add("".concat(N,"-").concat(E,"-").concat(H))}return s(S),c(new Set),void d(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void h();var k=o[u];if((k?M({row:k.row,rowIdAccessor:a,rowPath:k.rowPath}):null)!==R){var T=o.findIndex(function(e){return M({row:e.row,rowIdAccessor:a,rowPath:e.rowPath})===R});if(-1===T)return;u=T}var F=function(e,n,r){var t=e,a=n;return"up"===r?t=0:"down"===r?t=o.length-1:"left"===r?a=m?1:0:"right"===r&&(a=m?i.length:i.length-1),{rowIndex:t,colIndex:a}};"ArrowUp"===e.key?(e.preventDefault(),n(e,u,l,F)):"ArrowDown"===e.key?(e.preventDefault(),w(e,u,l,F)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),x(e,u,l,F)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),g(e,u,l,F)):"Home"===e.key?(e.preventDefault(),b(e,u)):"End"===e.key?(e.preventDefault(),I(e,u)):"PageUp"===e.key?(e.preventDefault(),y(e,u,l)):"PageDown"===e.key?(e.preventDefault(),C(e,u,l)):"Escape"===e.key&&(s(new Set),c(new Set),d(null),p.current=null)}else f()}},n=function(e,n,r,i){if(e.shiftKey){p.current||(p.current=t);var s=n-1;if((e.ctrlKey||e.metaKey)&&(s=i(n,r,"up").rowIndex),s>=0){var c=M({row:(d=o[s]).row,rowIdAccessor:a,rowPath:d.rowPath});l(p.current,{rowIndex:s,colIndex:r,rowId:c})}}else if(n>0){var d;s=n-1,(e.ctrlKey||e.metaKey)&&(s=i(n,r,"up").rowIndex),c=M({row:(d=o[s]).row,rowIdAccessor:a,rowPath:d.rowPath}),u({rowIndex:s,colIndex:r,rowId:c}),p.current=null}},w=function(e,n,r,i){if(e.shiftKey){p.current||(p.current=t);var s=n+1;if((e.ctrlKey||e.metaKey)&&(s=i(n,r,"down").rowIndex),o.length>s){var c=M({row:(d=o[s]).row,rowIdAccessor:a,rowPath:d.rowPath});l(p.current,{rowIndex:s,colIndex:r,rowId:c})}}else if(o.length-1>n){var d;s=n+1,(e.ctrlKey||e.metaKey)&&(s=i(n,r,"down").rowIndex),c=M({row:(d=o[s]).row,rowIdAccessor:a,rowPath:d.rowPath}),u({rowIndex:s,colIndex:r,rowId:c}),p.current=null}},x=function(e,n,r,i){if(e.shiftKey&&"ArrowLeft"===e.key){p.current||(p.current=t);var s=r-1;if(e.ctrlKey||e.metaKey)s=i(n,r,"left").colIndex;else if(m&&0===s)return;if(s>=0){var c=M({row:(d=o[n]).row,rowIdAccessor:a,rowPath:d.rowPath});l(p.current,{rowIndex:n,colIndex:s,rowId:c})}}else if(r>0){if(s=r-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)s=i(n,r,"left").colIndex;else if(m&&0===s)return;var d;0>s||(c=M({row:(d=o[n]).row,rowIdAccessor:a,rowPath:d.rowPath}),u({rowIndex:n,colIndex:s,rowId:c}),p.current=null)}},g=function(e,n,r,s){var c=m?i.length:i.length-1;if(e.shiftKey&&"ArrowRight"===e.key){p.current||(p.current=t);var d=r+1;if((e.ctrlKey||e.metaKey)&&(d=s(n,r,"right").colIndex),c>=d){var f=M({row:(v=o[n]).row,rowIdAccessor:a,rowPath:v.rowPath});l(p.current,{rowIndex:n,colIndex:d,rowId:f})}}else if(c>r){var v;d=r+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(d=s(n,r,"right").colIndex),d>c||(f=M({row:(v=o[n]).row,rowIdAccessor:a,rowPath:v.rowPath}),u({rowIndex:n,colIndex:d,rowId:f}),p.current=null)}},b=function(e,n,r){if(e.shiftKey){p.current||(p.current=t);var i=n,s=m?1:0;(e.ctrlKey||e.metaKey)&&(i=0);var c=M({row:(d=o[i]).row,rowIdAccessor:a,rowPath:d.rowPath});l(p.current,{rowIndex:i,colIndex:s,rowId:c})}else{var d;i=n,s=m?1:0,(e.ctrlKey||e.metaKey)&&(i=0),c=M({row:(d=o[i]).row,rowIdAccessor:a,rowPath:d.rowPath}),u({rowIndex:i,colIndex:s,rowId:c}),p.current=null}},I=function(e,n,r){if(e.shiftKey){p.current||(p.current=t);var s=n,c=m?i.length:i.length-1;(e.ctrlKey||e.metaKey)&&(s=o.length-1);var d=M({row:(f=o[s]).row,rowIdAccessor:a,rowPath:f.rowPath});l(p.current,{rowIndex:s,colIndex:c,rowId:d})}else{var f;s=n,c=m?i.length:i.length-1,(e.ctrlKey||e.metaKey)&&(s=o.length-1),d=M({row:(f=o[s]).row,rowIdAccessor:a,rowPath:f.rowPath}),u({rowIndex:s,colIndex:c,rowId:d}),p.current=null}},y=function(e,n,r){var i=Math.max(0,n-10);if(e.shiftKey){p.current||(p.current=t);var s=M({row:(c=o[i]).row,rowIdAccessor:a,rowPath:c.rowPath});l(p.current,{rowIndex:i,colIndex:r,rowId:s})}else{var c;s=M({row:(c=o[i]).row,rowIdAccessor:a,rowPath:c.rowPath}),u({rowIndex:i,colIndex:r,rowId:s}),p.current=null}},C=function(e,n,r){var i=Math.min(o.length-1,n+10);if(e.shiftKey){p.current||(p.current=t);var s=M({row:(c=o[i]).row,rowIdAccessor:a,rowPath:c.rowPath});l(p.current,{rowIndex:i,colIndex:r,rowId:s})}else{var c;s=M({row:(c=o[i]).row,rowIdAccessor:a,rowPath:c.rowPath}),u({rowIndex:i,colIndex:r,rowId:s}),p.current=null}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,t,o,i,a,u,l,s,c,d,f,v,h,p,m])}({selectableCells:r,initialFocusedCell:P,tableRows:o,leafHeaders:_,rowIdAccessor:u,selectSingleCell:Z,selectCellRange:$,setSelectedCells:g,setSelectedColumns:y,setLastSelectedColumnIndex:A,copyToClipboard:J,pasteFromClipboard:X,deleteSelectedCells:Y,startCell:K,enableRowSelection:v});var ee=n.useCallback(function(e,n){var r=new Set,t=new Map;o.forEach(function(e,n){var r=M({row:e.row,rowIdAccessor:u,rowPath:e.rowPath});t.set(r+"",n)});for(var i=t.get(e.rowId+""),a=t.get(n.rowId+""),l=void 0!==i?i:e.rowIndex,s=void 0!==a?a:n.rowIndex,c=Math.min(l,s),d=Math.max(l,s),f=Math.min(e.colIndex,n.colIndex),h=Math.max(e.colIndex,n.colIndex),p=c;d>=p;p++)for(var w=f;h>=w;w++)if(p>=0&&o.length>p){if(v&&0===w)continue;var m=o[p],x=M({row:m.row,rowIdAccessor:u,rowPath:m.rowPath});r.add(O({colIndex:w,rowIndex:p,rowId:x}))}g(r)},[o,u,v]),ne=n.useCallback(function(e,n){var r=document.querySelector(".st-body-container");if(!r)return null;var t=r.getBoundingClientRect(),o=Array.from(document.querySelectorAll(".st-cell[data-row-index][data-col-index]:not(.st-selection-cell)"));if(0===o.length)return null;var i=Math.max(t.left,Math.min(t.right,e)),a=Math.max(t.top,Math.min(t.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,r=n.getBoundingClientRect(),t=r.top+r.height/2,o=Math.sqrt(Math.pow(r.left+r.width/2-i,2)+Math.pow(t-a,2));l>o&&(l=o,u=n)}}),null!==u){var s=u,c=parseInt(s.getAttribute("data-row-index")||"-1",10),d=parseInt(s.getAttribute("data-col-index")||"-1",10),f=s.getAttribute("data-row-id");if(c>=0&&d>=0&&null!==f)return{rowIndex:c,colIndex:d,rowId:f}}return null},[]),re=n.useCallback(function(e,n){var r=document.elementFromPoint(e,n);if(!r)return null;var t=r.closest(".st-cell");if(t instanceof HTMLElement){var o=parseInt(t.getAttribute("data-row-index")||"-1",10),i=parseInt(t.getAttribute("data-col-index")||"-1",10),a=t.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return ne(e,n)},[ne]),te=n.useCallback(function(e,n){var r=document.querySelector(".st-body-container");if(r){var t=r.getBoundingClientRect();t.top+50>n?r.scrollTop-=10*Math.min(3,1+Math.max(0,t.top-n)/100):n>t.bottom-50&&(r.scrollTop+=10*Math.min(3,1+Math.max(0,n-t.bottom)/100));var o=document.querySelector(".st-body-main");o&&(t.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,t.left-e)/100):e>t.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-t.right)/100)))}},[]),oe=n.useCallback(function(e){var n=e.colIndex,r=O({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),t=m.has(r),o=I.has(n);return t||o},[m,I]),ie=n.useCallback(function(e){var n=e.colIndex,r=e.rowIndex,t=e.rowId;if(z)return"";var i=[],a=o[r-1],l=a?M({row:a.row,rowIdAccessor:u,rowPath:a.rowPath}):null,s=o[r+1],c=s?M({row:s.row,rowIdAccessor:u,rowPath:s.rowPath}):null,d=null!==l?{colIndex:n,rowIndex:r-1,rowId:l}:null,f=null!==c?{colIndex:n,rowIndex:r+1,rowId:c}:null,v={colIndex:n-1,rowIndex:r,rowId:t},h={colIndex:n+1,rowIndex:r,rowId:t};return(!d||!oe(d)||I.has(n)&&0===r)&&i.push("st-selected-top-border"),(!f||!oe(f)||I.has(n)&&r===o.length-1)&&i.push("st-selected-bottom-border"),oe(v)||i.push("st-selected-left-border"),oe(h)||i.push("st-selected-right-border"),i.join(" ")},[z,oe,o,I,u]),ae=n.useMemo(function(){return P?function(e){return e.rowIndex===P.rowIndex&&e.colIndex===P.colIndex&&e.rowId===P.rowId}:function(){return!1}},[P]),ue=n.useCallback(function(e){var n=O({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return T.has(n)},[T]),le=n.useCallback(function(e){var n=O({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return W.has(n)},[W]);return{getBorderClass:ie,handleMouseDown:function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId;if(r){G.current=!0,j(!0),K.current={rowIndex:t,colIndex:n,rowId:o},setTimeout(function(){y(new Set),A(null);var e=O({colIndex:n,rowIndex:t,rowId:o});g(new Set([e])),H({rowIndex:t,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,s=function(){if(G.current&&K.current){if(null!==i&&null!==a){te(i,a);var e=Date.now();if(e-l>=16){var n=re(i,a);n&&ee(K.current,n),l=e}}u=requestAnimationFrame(s)}else null!==u&&(cancelAnimationFrame(u),u=null)},c=function(e){G.current&&K.current&&(i=e.clientX,a=e.clientY)},d=function(){G.current=!1,j(!1),null!==u&&(cancelAnimationFrame(u),u=null),document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",d)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",d),u=requestAnimationFrame(s)}},handleMouseOver:function(e){r&&G.current&&K.current&&ee(K.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ue,isWarningFlashing:le,isInitialFocusedCell:ae,isSelected:oe,lastSelectedColumnIndex:N,pasteFromClipboard:X,selectColumns:Q,selectedCells:m,selectedColumns:I,setInitialFocusedCell:H,setSelectedCells:g,setSelectedColumns:y,deleteSelectedCells:Y,columnsWithSelectedCells:V,rowsWithSelectedCells:U}}({selectableCells:cn,headers:br,tableRows:Ft,rowIdAccessor:on,onCellEdit:We,cellRegistry:Bt.current,collapsedHeaders:Tr,rowHeight:tn,enableRowSelection:ne,copyHeadersToClipboard:W}),jt=zt.getBorderClass,Gt=zt.handleMouseDown,Kt=zt.handleMouseOver,Vt=zt.isCopyFlashing,Ut=zt.isInitialFocusedCell,_t=zt.isSelected,Jt=zt.isWarningFlashing,Xt=zt.selectColumns,Yt=zt.selectedCells,$t=zt.selectedColumns,Zt=zt.setInitialFocusedCell,Qt=zt.setSelectedCells,eo=zt.setSelectedColumns,no=zt.columnsWithSelectedCells,ro=zt.rowsWithSelectedCells,to=n.useCallback(function(e){Ot(e),setTimeout(function(){Nt({accessor:e})},0)},[Ot,Nt]),oo=n.useCallback(function(e){Ir(e)},[]);!function(e){var r=e.selectableColumns,t=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(u&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||r&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(t.size>0&&i(new Set),o.size>0&&a(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,t,o,i,a,u,l])}({selectableColumns:fn,selectedCells:Yt,selectedColumns:$t,setSelectedCells:Qt,setSelectedColumns:eo,activeHeaderDropdown:Er,setActiveHeaderDropdown:Pr}),function(e){var r=e.forceUpdate,t=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){r(),t.current&&o(t.current.offsetWidth-t.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[r,t,o])}({forceUpdate:tr,tableBodyContainerRef:nr,setScrollbarWidth:vr}),function(e){var r=e.onGridReady;n.useEffect(function(){null==r||r()},[r])}({onGridReady:Ke}),function(e){var r=e.cellRegistryRef,t=e.clearAllFilters,o=e.clearFilter,i=e.currentPage,a=e.filters,l=e.flattenedRows,s=e.headerRegistryRef,c=e.headers,d=e.includeHeadersInCSVExport,f=e.rowIdAccessor,v=e.rows,h=e.setCurrentPage,p=e.sort,w=e.tableRef,x=e.updateFilter,g=e.updateSort,b=e.visibleRows;n.useEffect(function(){w&&(w.current={updateData:function(e){var n=e.accessor,t=e.newValue,o=null==v?void 0:v[e.rowIndex];if(o){var i=M({row:o,rowIdAccessor:f}),a=m({rowId:i,accessor:n}),u=r.current.get(a);u&&u.updateContent(t),void 0!==R(o,n)&&S(o,n,t)}},setHeaderRename:function(e){var n=s.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return b},getAllRows:function(){return l},getHeaders:function(){return c},exportToCSV:function(e){!function(e,n,r,t){void 0===t&&(t=!0);var o=function(e,n,r){void 0===r&&(r=!0);var t=function(e){var n=[],r=function(e){for(var t=0,o=e;o.length>t;t++){var i=o[t];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?(i.singleRowChildren&&n.push(i),r(i.children)):n.push(i))}};return r(e),n}(n),o=t.map(function(e){return Pn(e.label)}).join(","),i=e.map(function(e,n){var r=e.row;return t.map(function(e,t){var o=R(r,e.accessor);if(e.exportValueGetter){var i=e.valueFormatter?e.valueFormatter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o}):void 0,a=e.exportValueGetter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o,formattedValue:i});return Pn(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:t,row:r,rowIndex:n,value:o}),Pn(i)):Pn(o)}).join(",")});return(r?u([o],i,!0):i).join("\n")}(e,n,t);!function(e,n){void 0===n&&(n="table-export.csv");var r=new Blob([e],{type:"text/csv;charset=utf-8;"}),t=document.createElement("a"),o=URL.createObjectURL(r);t.setAttribute("href",o),t.setAttribute("download",n),t.style.visibility="hidden",document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(o)}(o,r)}(l,c,(void 0===e?{}:e).filename,d)},getSortState:function(){return p},applySortState:Hn(g),getFilterState:function(){return a},applyFilter:Hn(x),clearFilter:Hn(o),clearAllFilters:Hn(t),getCurrentPage:function(){return i},setPage:function(e){return h(e)}})},[r,t,o,i,a,l,s,c,d,f,e.rowIndexMap,v,e.rowsPerPage,e.serverSidePagination,h,e.setRows,e.shouldPaginate,p,w,x,g,b])}({cellRegistryRef:Bt,clearAllFilters:yt,clearFilter:It,currentPage:mr,filters:gt,flattenedRows:At,headerRegistryRef:qt,headers:Ur,includeHeadersInCSVExport:Me,rowIdAccessor:on,rowIndexMap:cr,rows:pr,rowsPerPage:ln,serverSidePagination:In,setCurrentPage:xr,setRows:sr,shouldPaginate:Cn,sort:St,tableRef:qn,updateFilter:bt,updateSort:Nt,visibleRows:Dt}),function(e){var r=e.filters,t=e.onFilterChange;n.useEffect(function(){null==t||t(r)},[r,t])}({filters:gt,onFilterChange:Ge}),function(e){var r=e.sort,t=e.onSortChange,o=xe(r);n.useEffect(function(){!r||(null==o?void 0:o.key.accessor)===r.key.accessor&&(null==o?void 0:o.direction)===r.direction?!r&&o&&(null==t||t(null)):null==t||t(r)},[r,o,t])}({sort:St,onSortChange:$e});var io=n.useCallback(function(e){Lt(e),setTimeout(function(){bt(e)},0)},[Lt,bt]),ao=!ke&&0===Ft.length;return e.jsx(B,exports.__assign({value:{activeHeaderDropdown:Er,allowAnimations:o,areAllRowsSelected:Br,autoExpandColumns:d,canExpandRowGroup:f,cellRegistry:Bt.current,cellUpdateFlash:p,clearSelection:Vr,collapsedHeaders:Tr,columnBorders:b,columnReordering:H,columnResizing:F,columnsWithSelectedCells:no,copyHeadersToClipboard:W,draggedHeaderRef:Yn,editColumns:J,emptyStateRenderer:De,enableHeaderEditing:Q,enableRowSelection:ne,errorStateRenderer:Fe,expandAll:te,expandIcon:ie,filterIcon:de,filters:gt,forceUpdate:tr,getBorderClass:jt,handleApplyFilter:io,handleClearAllFilters:yt,handleClearFilter:It,handleMouseDown:Gt,handleMouseOver:Kt,handleRowSelect:jr,handleSelectAll:Gr,handleToggleRow:Kr,headerCollapseIcon:we,headerContainerRef:rr,headerDropdown:be,headerExpandIcon:ge,headerHeight:null!=Ie?Ie:tn,headerRegistry:qt.current,headers:Ur,hoveredHeaderRef:$n,includeHeadersInCSVExport:Me,isAnimating:Wt,isCopyFlashing:Vt,isInitialFocusedCell:Ut,isLoading:ke,isResizing:Cr,isRowSelected:Wr,isScrolling:Nr,isSelected:_t,isWarningFlashing:Jt,loadingStateRenderer:Te,mainBodyRef:Zn,maxHeaderDepth:lt,nextIcon:Oe,onCellClick:Be,onCellEdit:We,onColumnOrderChange:qe,onColumnSelect:je,onHeaderEdit:Ve,onLoadMore:Ue,onRowGroupExpand:Xe,onSort:to,onTableHeaderDragEnd:oo,pinnedLeftRef:Qn,pinnedRightRef:er,prevIcon:Qe,rowButtons:en,rowGrouping:nn,rowHeight:tn,rowIdAccessor:on,rowStateMap:ir,rows:lr,rowsWithSelectedCells:ro,scrollbarWidth:fr,selectColumns:Xt,selectableColumns:fn,selectedColumns:$t,selectedRowCount:qr,selectedRows:Lr,selectedRowsData:zr,setActiveHeaderDropdown:Pr,setCollapsedHeaders:Fr,setHeaders:Ir,setInitialFocusedCell:Zt,setIsResizing:Rr,setIsScrolling:Mr,setRowStateMap:ar,setSelectedCells:Qt,setSelectedColumns:eo,setSelectedRows:Or,setUnexpandedRows:nt,shouldPaginate:Cn,sortDownIcon:kn,sortUpIcon:Dn,tableBodyContainerRef:nr,tableEmptyStateRenderer:Bn,tableRows:Ft,theme:jn,unexpandedRows:et,useHoverRowBackground:Vn,useOddColumnBackground:_n,useOddEvenRowBackground:Xn}},{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(jn," ").concat(null!=w?w:""," ").concat(b?"st-column-borders":""),style:Ce?{maxHeight:Ce,height:void 0===kt?"auto":Ce}:ye?{height:ye}:{}},{children:[e.jsx(Nn,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(hn,{pinnedLeftWidth:vt,pinnedRightWidth:ht,setScrollTop:Xr,setScrollDirection:Zr,shouldShowEmptyState:ao,sort:St,tableRows:Ft,rowsToRender:Dt}),e.jsx(Sn,{columnEditorText:A,editColumns:J,editColumnsInitOpen:$,headers:br,position:y})]})),!ao&&e.jsx(pn,{mainBodyRef:Zn,mainBodyWidth:ft,pinnedLeftWidth:vt,pinnedRightWidth:ht,pinnedLeftContentWidth:pt,pinnedRightContentWidth:wt,tableBodyContainerRef:nr}),!ao&&e.jsx(z,{currentPage:mr,footerRenderer:he,hideFooter:Se,onPageChange:xr,onNextPage:_e,onUserPageChange:Je,rowsPerPage:ln,shouldPaginate:Cn,totalPages:Math.ceil((null!=Gn?Gn:At.length)/ln),totalRows:null!=Gn?Gn:At.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:tt}))]}))}))},Bn=function(n){var r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,s=n.fillOpacity,c=void 0===s?.2:s,d=n.strokeWidth,f=void 0===d?2:d,v=n.className,h=void 0===v?"":v,p=n.min,w=n.max;if(!r||0===r.length)return null;var m=void 0!==p?p:Math.min.apply(Math,r),x=(void 0!==w?w:Math.max.apply(Math,r))-m||1,g=a,b=r.map(function(e,n){return{x:n/(r.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(" "),I="\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(h),style:{display:"block"}},{children:[e.jsx("path",{d:I,fill:l||"var(--st-chart-fill-color)",fillOpacity:c,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 r=n.data,t=n.width,o=void 0===t?"100%":t,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,s=void 0===l?2:l,c=n.className,d=void 0===c?"":c,f=n.min,v=n.max;if(!r||0===r.length)return null;var h=void 0!==f?f:Math.min.apply(Math,r),p=void 0!==v?v:Math.max.apply(Math,r),w=p-h||1,m=a,x=(100-s*(r.length-1))/r.length,g=0>h,b=g?m*(p/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:r.map(function(n,r){var t=r*(x+s),o=(n-h)/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:t,y:i,width:x,height:a,fill:u||"var(--st-chart-color)",rx:1},r)})}))},jn=Object.freeze({__proto__:null,default:zn});exports.ANIMATION_CONFIGS=Tn,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=j,exports.AngleRightIcon=G,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=U,exports.FilterIcon=_,exports.LineAreaChart=Bn,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=J,exports.SimpleTable=function(r){var t=n.useState(!1),o=t[0],i=t[1];return n.useEffect(function(){i(!0)},[]),o?e.jsx(Wn,exports.__assign({},r)):null},exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,r=e.options;return i(void 0,void 0,void 0,function(){var e,t,o,i,u,l,s,c,d,f,v,h,p,w,m,x;return a(this,function(a){return e=r.startY,t=r.endY,o=r.finalY,u=void 0===(i=r.duration)?300:i,s=void 0===(l=r.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(c=r.delay)?0:c,f=r.onComplete,h=void 0===(v=r.respectReducedMotion)||v,kn()&&h?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(p=n.getBoundingClientRect(),m=e-(w=p.top),x=t-w,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.style.transition="transform ".concat(u,"ms ").concat(s),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(x,"px, 0)");var r=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",r),f&&f(),e()};n.addEventListener("transitionend",r),setTimeout(r,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,r=e.finalConfig,t=e.fromBounds,o=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){return{x:("x"in e?e.x:e.left)-n.x,y:("y"in e?e.y:e.top)-n.y}}(t,o),0===e.x&&0===e.y||kn()&&!1!==r.respectReducedMotion?[2]:(u=r,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=kn()?exports.__assign(exports.__assign({},Tn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},Tn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},Tn.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,Dn(n,i,r)]);case 1:return a.sent(),[2]}var u,l})})},exports.usePrevious=xe,exports.useTableContext=q;
2
- //# sourceMappingURL=index-b187ee56.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-b187ee56.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}