simple-table-core 2.3.6 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animate-214a398f.js → Animate-dd2d7dba.js} +2 -2
- package/dist/Animate-dd2d7dba.js.map +1 -0
- package/dist/{DatePicker-dfb9eb77.js → DatePicker-ff43c8c5.js} +2 -2
- package/dist/DatePicker-ff43c8c5.js.map +1 -0
- package/dist/cjs/{Animate-46525d11.js → Animate-6e64a840.js} +2 -2
- package/dist/cjs/Animate-6e64a840.js.map +1 -0
- package/dist/cjs/{DatePicker-0a687b78.js → DatePicker-33966702.js} +2 -2
- package/dist/cjs/DatePicker-33966702.js.map +1 -0
- package/dist/cjs/consts/general-consts.d.ts +1 -1
- package/dist/cjs/index-c9ed7287.js +2 -0
- package/dist/cjs/index-c9ed7287.js.map +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/consts/general-consts.d.ts +1 -1
- package/dist/index-ed8fb153.js +2 -0
- package/dist/index-ed8fb153.js.map +1 -0
- package/dist/index.es.js +1 -1
- package/package.json +1 -1
- package/dist/Animate-214a398f.js.map +0 -1
- package/dist/DatePicker-dfb9eb77.js.map +0 -1
- package/dist/cjs/Animate-46525d11.js.map +0 -1
- package/dist/cjs/DatePicker-0a687b78.js.map +0 -1
- package/dist/cjs/index-b9be7b34.js +0 -2
- package/dist/cjs/index-b9be7b34.js.map +0 -1
- package/dist/index-375d4274.js +0 -2
- package/dist/index-375d4274.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{_ as n,u as i,a as t,c as
|
|
2
|
-
//# sourceMappingURL=Animate-
|
|
1
|
+
import{_ as n,u as i,a as t,c as e,b as o,A as a,d as r,f as l,R as d}from"./index-ed8fb153.js";import{jsx as u}from"react/jsx-runtime";import{useRef as f,useMemo as s,useLayoutEffect as v}from"react";var m=function(m){var p=m.children,h=m.id,M=m.parentRef,c=m.tableRow,Y=n(m,["children","id","parentRef","tableRow"]),C=i(),g=C.allowAnimations,b=C.isResizing,x=C.isScrolling,R=C.rowHeight,j=f(null),A=f(null),B=t(x),w=t(b),_=s(function(){return e(R)},[R]);return v(function(){var n,i,t,e;if(g&&j.current&&!b){var u=j.current.getBoundingClientRect(),f=A.current;if(!x)if(!B||x)if(!w||b){if(A.current=u,f){var s=u.x-f.x,v=u.y-f.y;if((Math.abs(s)>=50||Math.abs(v)>5)&&(Math.abs(s)>5||Math.abs(v)>5)){var m=o(o({},a.ROW_REORDER),{onComplete:function(){j.current&&(j.current.style.zIndex="",j.current.style.position="",j.current.style.top="")}}),p=null===(n=null==M?void 0:M.current)||void 0===n?void 0:n.scrollTop,h=null===(i=null==M?void 0:M.current)||void 0===i?void 0:i.clientHeight,Y=null===(t=null==M?void 0:M.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==p&&void 0!==h&&void 0!==Y){var C=_*(R+d),k=p-C,q=p+h+C,y=f.y>k&&q>f.y,z=u.y>k&&q>u.y,D=p>u.y,E=null!==(e=null==c?void 0:c.position)&&void 0!==e?e:0,F=.6*R,G=function(n,i,t){return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,Math.min(Math.abs(n-i),Math.abs(n-t))))))};if(y&&!z&&u.y>p+h){var H=G(u.y,p,p+h);return void r({element:j.current,options:{startY:f.y,endY:p+h+H+E%15*F*2.5+E%7*.4*R,finalY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}})}if(y&&!z&&D)return H=G(u.y,p,p+h),void r({element:j.current,options:{startY:f.y,endY:p-H-E%15*F*2.5-E%7*.4*R,finalY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}});if(!y&&z&&f.y>p+h)return H=G(f.y,p,p+h),void r({element:j.current,options:{startY:p+h+H+E%10*F*1,endY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}});if(!y&&z&&p>f.y)return H=G(f.y,p,p+h),void r({element:j.current,options:{startY:p-H-E%10*F*1,endY:u.y,duration:m.duration,easing:m.easing,onComplete:m.onComplete}})}l({element:j.current,fromBounds:f,toBounds:u,finalConfig:m})}}}else A.current=u;else A.current=u}},[g,_,b,x,M,B,w,R,null==c?void 0:c.position,c]),u("div",o({ref:j,"data-animate-id":h,id:h+""},Y,{children:p}))};m.displayName="Animate";export{m as Animate,m as default};
|
|
2
|
+
//# sourceMappingURL=Animate-dd2d7dba.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animate-dd2d7dba.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{u as e,b as n}from"./index-
|
|
2
|
-
//# sourceMappingURL=DatePicker-
|
|
1
|
+
import{u as e,b as n}from"./index-ed8fb153.js";import{jsxs as t,Fragment as a,jsx as r}from"react/jsx-runtime";import{useState as c}from"react";var i=function(i){var d,o,s=i.onChange,l=i.onClose,u=i.value,f=e(),h=f.nextIcon,m=f.prevIcon,v=c(u||new Date),k=v[0],p=v[1],w=c("days"),y=w[0],D=w[1],N=function(e,n){return new Date(e,n+1,0).getDate()};return t("div",n({className:"st-datepicker"},{children:[t("div",n({className:"st-datepicker-header"},{children:["days"===y&&t(a,{children:[r("button",n({onClick:function(){p(new Date(k.getFullYear(),k.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:m})),t("div",n({className:"st-datepicker-header-label",onClick:function(){return D("months")}},{children:[(o=k,o.toLocaleString("default",{month:"long"}))," ",k.getFullYear()]})),r("button",n({onClick:function(){p(new Date(k.getFullYear(),k.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:h}))]}),"months"===y&&r("div",n({className:"st-datepicker-header-label",onClick:function(){return D("years")}},{children:k.getFullYear()})),"years"===y&&r("div",n({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),t("div",n({className:"st-datepicker-grid st-datepicker-".concat(y,"-grid")},{children:["days"===y&&function(){var e=[],t=k.getFullYear(),a=k.getMonth(),c=N(t,a),i=function(e,n){return new Date(e,n,1).getDay()}(t,a),d=N(t,a-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,a){e.push(r("div",n({className:"st-datepicker-weekday"},{children:t}),"header-".concat(a)))});for(var o=function(t){var a=d-i+t+1;e.push(r("div",n({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(k.getFullYear(),k.getMonth()-1,e,12,0,0);p(n),s(n),null==l||l()}(a)}},{children:a}),"prev-".concat(a)))},f=0;i>f;f++)o(f);for(var h=function(c){var i=c===(new Date).getDate()&&a===(new Date).getMonth()&&t===(new Date).getFullYear(),d=new Date(u),o=c===d.getDate()&&a===d.getMonth()&&t===d.getFullYear();e.push(r("div",n({className:"st-datepicker-day ".concat(i?"today":""," ").concat(o?"selected":""),onClick:function(){return function(e){var n=k.getFullYear(),t=k.getMonth(),a=new Date(n,t,e,12,0,0);p(a),s(a),null==l||l()}(c)}},{children:c}),"day-".concat(c)))},m=1;c>=m;m++)h(m);var v=35-(i+c),w=function(t){e.push(r("div",n({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(k.getFullYear(),k.getMonth()+1,e,12,0,0);p(n),s(n),null==l||l()}(t)}},{children:t}),"next-".concat(t)))};for(m=1;v>=m;m++)w(m);return e}(),"months"===y&&(d=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(e,t){var a=t===k.getMonth();d.push(r("div",n({className:"st-datepicker-month ".concat(a?"selected":""),onClick:function(){return function(e){p(new Date(k.getFullYear(),e,1)),D("days")}(t)}},{children:e}),"month-".concat(t)))}),d),"years"===y&&function(){for(var e=[],t=k.getFullYear(),a=t-6,c=function(a){e.push(r("div",n({className:"st-datepicker-year ".concat(a===t?"selected":""),onClick:function(){return function(e){p(new Date(e,k.getMonth(),1)),D("months")}(a)}},{children:a}),"year-".concat(a)))},i=a;a+12>i;i++)c(i);return e}()]})),r("div",n({className:"st-datepicker-footer"},{children:r("button",n({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);p(n),s(n),null==l||l()}},{children:"Today"}))}))]}))};export{i as default};
|
|
2
|
+
//# sourceMappingURL=DatePicker-ff43c8c5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker-ff43c8c5.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=require("./index-
|
|
2
|
-
//# sourceMappingURL=Animate-
|
|
1
|
+
"use strict";var n=require("./index-c9ed7287.js"),e=require("react/jsx-runtime"),i=require("react"),t=function(t){var o=t.children,r=t.id,a=t.parentRef,l=t.tableRow,d=n.__rest(t,["children","id","parentRef","tableRow"]),u=n.useTableContext(),v=u.allowAnimations,f=u.isResizing,s=u.isScrolling,m=u.rowHeight,h=i.useRef(null),p=i.useRef(null),c=n.usePrevious(s),M=n.usePrevious(f),Y=i.useMemo(function(){return n.calculateBufferRowCount(m)},[m]);return i.useLayoutEffect(function(){var e,i,t,o;if(v&&h.current&&!f){var r=h.current.getBoundingClientRect(),d=p.current;if(!s)if(!c||s)if(!M||f){if(p.current=r,d){var u=r.x-d.x,C=r.y-d.y;if((Math.abs(u)>=50||Math.abs(C)>5)&&(Math.abs(u)>5||Math.abs(C)>5)){var g=n.__assign(n.__assign({},n.ANIMATION_CONFIGS.ROW_REORDER),{onComplete:function(){h.current&&(h.current.style.zIndex="",h.current.style.position="",h.current.style.top="")}}),x=null===(e=null==a?void 0:a.current)||void 0===e?void 0:e.scrollTop,q=null===(i=null==a?void 0:a.current)||void 0===i?void 0:i.clientHeight,j=null===(t=null==a?void 0:a.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==x&&void 0!==q&&void 0!==j){var B=Y*(m+n.ROW_SEPARATOR_WIDTH),R=x-B,b=x+q+B,w=d.y>R&&b>d.y,A=r.y>R&&b>r.y,k=x>r.y,y=null!==(o=null==l?void 0:l.position)&&void 0!==o?o:0,z=.6*m,D=function(n,e,i){return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,Math.min(Math.abs(n-e),Math.abs(n-i))))))};if(w&&!A&&r.y>x+q){var E=D(r.y,x,x+q);return void n.animateWithCustomCoordinates({element:h.current,options:{startY:d.y,endY:x+q+E+y%15*z*2.5+y%7*.4*m,finalY:r.y,duration:g.duration,easing:g.easing,onComplete:g.onComplete}})}if(w&&!A&&k)return E=D(r.y,x,x+q),void n.animateWithCustomCoordinates({element:h.current,options:{startY:d.y,endY:x-E-y%15*z*2.5-y%7*.4*m,finalY:r.y,duration:g.duration,easing:g.easing,onComplete:g.onComplete}});if(!w&&A&&d.y>x+q)return E=D(d.y,x,x+q),void n.animateWithCustomCoordinates({element:h.current,options:{startY:x+q+E+y%10*z*1,endY:r.y,duration:g.duration,easing:g.easing,onComplete:g.onComplete}});if(!w&&A&&x>d.y)return E=D(d.y,x,x+q),void n.animateWithCustomCoordinates({element:h.current,options:{startY:x-E-y%10*z*1,endY:r.y,duration:g.duration,easing:g.easing,onComplete:g.onComplete}})}n.flipElement({element:h.current,fromBounds:d,toBounds:r,finalConfig:g})}}}else p.current=r;else p.current=r}},[v,Y,f,s,a,c,M,m,null==l?void 0:l.position,l]),e.jsx("div",n.__assign({ref:h,"data-animate-id":r,id:r+""},d,{children:o}))};t.displayName="Animate",exports.Animate=t,exports.default=t;
|
|
2
|
+
//# sourceMappingURL=Animate-6e64a840.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Animate-6e64a840.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("./index-
|
|
2
|
-
//# sourceMappingURL=DatePicker-
|
|
1
|
+
"use strict";var e=require("./index-c9ed7287.js"),n=require("react/jsx-runtime"),t=require("react");exports.default=function(a){var r,c,i=a.onChange,d=a.onClose,s=a.value,l=e.useTableContext(),o=l.nextIcon,u=l.prevIcon,h=t.useState(s||new Date),f=h[0],v=h[1],k=t.useState("days"),m=k[0],p=k[1],w=function(e,n){return new Date(e,n+1,0).getDate()};return n.jsxs("div",e.__assign({className:"st-datepicker"},{children:[n.jsxs("div",e.__assign({className:"st-datepicker-header"},{children:["days"===m&&n.jsxs(n.Fragment,{children:[n.jsx("button",e.__assign({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:u})),n.jsxs("div",e.__assign({className:"st-datepicker-header-label",onClick:function(){return p("months")}},{children:[(c=f,c.toLocaleString("default",{month:"long"}))," ",f.getFullYear()]})),n.jsx("button",e.__assign({onClick:function(){v(new Date(f.getFullYear(),f.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:o}))]}),"months"===m&&n.jsx("div",e.__assign({className:"st-datepicker-header-label",onClick:function(){return p("years")}},{children:f.getFullYear()})),"years"===m&&n.jsx("div",e.__assign({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),n.jsxs("div",e.__assign({className:"st-datepicker-grid st-datepicker-".concat(m,"-grid")},{children:["days"===m&&function(){var t=[],a=f.getFullYear(),r=f.getMonth(),c=w(a,r),l=function(e,n){return new Date(e,n,1).getDay()}(a,r),o=w(a,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(a,r){t.push(n.jsx("div",e.__assign({className:"st-datepicker-weekday"},{children:a}),"header-".concat(r)))});for(var u=function(a){var r=o-l+a+1;t.push(n.jsx("div",e.__assign({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()-1,e,12,0,0);v(n),i(n),null==d||d()}(r)}},{children:r}),"prev-".concat(r)))},h=0;l>h;h++)u(h);for(var k=function(c){var l=c===(new Date).getDate()&&r===(new Date).getMonth()&&a===(new Date).getFullYear(),o=new Date(s),u=c===o.getDate()&&r===o.getMonth()&&a===o.getFullYear();t.push(n.jsx("div",e.__assign({className:"st-datepicker-day ".concat(l?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=f.getFullYear(),t=f.getMonth(),a=new Date(n,t,e,12,0,0);v(a),i(a),null==d||d()}(c)}},{children:c}),"day-".concat(c)))},m=1;c>=m;m++)k(m);var p=35-(l+c),y=function(a){t.push(n.jsx("div",e.__assign({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(f.getFullYear(),f.getMonth()+1,e,12,0,0);v(n),i(n),null==d||d()}(a)}},{children:a}),"next-".concat(a)))};for(m=1;p>=m;m++)y(m);return t}(),"months"===m&&(r=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(t,a){var c=a===f.getMonth();r.push(n.jsx("div",e.__assign({className:"st-datepicker-month ".concat(c?"selected":""),onClick:function(){return function(e){v(new Date(f.getFullYear(),e,1)),p("days")}(a)}},{children:t}),"month-".concat(a)))}),r),"years"===m&&function(){for(var t=[],a=f.getFullYear(),r=a-6,c=function(r){t.push(n.jsx("div",e.__assign({className:"st-datepicker-year ".concat(r===a?"selected":""),onClick:function(){return function(e){v(new Date(e,f.getMonth(),1)),p("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;r+12>i;i++)c(i);return t}()]})),n.jsx("div",e.__assign({className:"st-datepicker-footer"},{children:n.jsx("button",e.__assign({className:"st-datepicker-today-btn",onClick:function(){var e=new Date,n=new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);v(n),i(n),null==d||d()}},{children:"Today"}))}))]}))};
|
|
2
|
+
//# sourceMappingURL=DatePicker-33966702.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePicker-33966702.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -6,7 +6,7 @@ export declare const DEFAULT_BORDER_WIDTH = 1;
|
|
|
6
6
|
export declare const VIRTUALIZATION_THRESHOLD = 20;
|
|
7
7
|
export declare const OVERSCAN_PIXELS = 800;
|
|
8
8
|
export declare const calculateBufferRowCount: (rowHeight: number) => number;
|
|
9
|
-
export declare const COLUMN_EDIT_WIDTH =
|
|
9
|
+
export declare const COLUMN_EDIT_WIDTH = 29.5;
|
|
10
10
|
export declare const TABLE_HEADER_CELL_WIDTH_DEFAULT = 150;
|
|
11
11
|
export declare const PINNED_BORDER_WIDTH = 1;
|
|
12
12
|
export declare const MAX_PINNED_WIDTH_PERCENT = 0.8;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),n=require("react");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=t(n);function o(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>n.indexOf(r)&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);r.length>o;o++)0>n.indexOf(r[o])&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function i(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,u)}l((r=r.apply(e,n||[])).next())})}function a(e,n){var t,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=u(0),a.throw=u(1),a.return=u(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&o[3]>u[1])){i.label=u[1];break}if(6===u[0]&&o[1]>i.label){i.label=o[1],o=u;break}if(o&&o[2]>i.label){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(e,i)}catch(e){u=[6,e],r=0}finally{t=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}function u(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;i>o;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}exports.__assign=function(){return exports.__assign=Object.assign||function(e){for(var n,t=1,r=arguments.length;r>t;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},exports.__assign.apply(this,arguments)},"function"==typeof SuppressedError&&SuppressedError;var l=function(e){return Math.ceil(800/(e+1))},s=29.5,c=30,d=function(e){return 480>e?.3:768>e?.4:.8},f="parentExpanded",v=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;a.length>i;i++)o=r(a[i],o);return o};return r(e,n),t},p=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,p(e.children)),n})},h=function(e){return void 0===e&&(e=0),e?e+1:0},w=function(e){var n=e.accessor;return"".concat(e.rowId,"-").concat(n)},m=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||n.excludeFromRender||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&function(e,n,t){var r=function(e,n){for(var t=0,r=p(e);r.length>t;t++){var o=r[t];if(o.children&&o.children.length>0&&o.children.some(function(e){return e.accessor===n}))return o}return null}(n,e.accessor);if(r){var o=t.has(r.accessor),i=e.showWhen||f;return o?"parentExpanded"===i:"parentCollapsed"===i}return!1}(n,r,o))||null},g=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||f;return"parentCollapsed"===n||"always"===n}).flatMap(function(e){return x(e,n)}):e.children.filter(function(e){var n=e.showWhen||f;return"parentExpanded"===n||"always"===n}).flatMap(function(e){return x(e,n)}):[e]},b=function(e){if(e.hide)return 0;if("number"==typeof e.width)return e.width;if("string"==typeof e.width&&e.width.endsWith("px"))return parseFloat(e.width);var n=document.getElementById(w({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},y=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(w({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){y(e)})},I=function(e){return"number"==typeof e.minWidth?e.minWidth:40},C=function(e,n){var t=[];return e.forEach(function(e){e.hide||t.push.apply(t,x(e,n))}),t},R=function(e){var n=e.customTheme;return Math.min(e.headerHeight+n.rowSeparatorWidth+e.childRowCount*(e.rowHeight+n.rowSeparatorWidth)+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth,n.nestedGridMaxHeight+n.nestedGridPaddingTop+n.nestedGridPaddingBottom+n.nestedGridBorderWidth)},S=function(e){var n=e.match(/^(.+?)\[(\d+)\]$/);return n?{key:n[1],index:parseInt(n[2],10)}:{key:e,index:null}},M=function(e,n){var t=n+"";return t.includes(".")||t.includes("[")?t.split(".").reduce(function(e,n){if(null!=e){var t=S(n),r=t.index,o=e[t.key];return null!==r&&Array.isArray(o)&&(o=o[r]),o}},e):e[n]},N=function(e,n,t){var r=n+"";if(r.includes(".")||r.includes("[")){for(var o=r.split("."),i=e,a=0;o.length-1>a;a++){var u=S(o[a]),l=u.key,s=u.index;if(null==i[l]){var c=S(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=S(o[o.length-1]),f=d.key,v=d.index;if(null!==v){for(Array.isArray(i[f])||(i[f]=[]);v>=i[f].length;)i[f].push(null);i[f][v]=t}else i[f]=t}else e[n]=t},H=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},E=function(e){var n=e.getRowId,t=u([],e.rowPath,!0);if(n){var r=n({row:e.row,depth:e.depth,index:e.index,rowPath:e.rowPath,rowIndexPath:e.rowIndexPath,groupingKey:e.groupingKey});t.push(r)}return t},T=function(e){return e.join("-")},k=function(e,n){var t=e[n];return H(t)?t:[]},P=function(e,n,t,r,o){var i=e+"",a=r.has(i)&&r.get(i)===n,u=o.has(i)&&o.get(i)===n;return t.has(n)?!u:a},A=function(e){var n=e.depth,t=e.expandedDepths,r=e.expandedRows,o=e.collapsedRows,i=e.rowGrouping,a=void 0===i?[]:i,l=e.getRowId,s=e.displayPositionOffset,c=void 0===s?0:s,d=e.rowStateMap,f=e.hasLoadingRenderer,v=void 0!==f&&f,p=e.hasErrorRenderer,h=void 0!==p&&p,w=e.hasEmptyRenderer,m=void 0!==w&&w,g=e.headers,x=void 0===g?[]:g,b=e.rowHeight,y=e.headerHeight,I=e.customTheme,C=[],S=function(e,n,i,s,f,p,w){void 0===i&&(i=0),void 0===s&&(s=c),void 0===f&&(f=[]),void 0===p&&(p=[]),void 0===w&&(w=[]);var g=i,M=s;return e.forEach(function(i,s){var c,N,H=a[n],A=u(u([],f,!0),[s],!1),D=u(u([],p,!0),[s],!1),F=E({row:i,getRowId:l,depth:n,index:s,rowPath:A,rowIndexPath:D,groupingKey:H}),O=C.length,L={row:i,depth:n,displayPosition:M,groupingKey:H,position:g,isLastGroupRow:0===n&&s===e.length-1,rowId:F,rowPath:A,rowIndexPath:D,absoluteRowIndex:g,parentIndices:w.length>0?u([],w,!0):void 0};C.push(L),g++,M++;var W=T(F);if(P(W,n,t,r,o)&&a.length>n){var B=null==d?void 0:d.get(W),q=k(i,H),G=x.find(function(e){return e.expandable&&e.nestedTable});if((null==G?void 0:G.nestedTable)&&q.length>0){var V=(null===(c=G.nestedTable.customTheme)||void 0===c?void 0:c.rowHeight)||b,z=(null===(N=G.nestedTable.customTheme)||void 0===N?void 0:N.headerHeight)||y,K=R({childRowCount:q.length,rowHeight:V,headerHeight:z,customTheme:I}),j=u(u([],A,!0),[H],!1);C.push({row:{},depth:n+1,displayPosition:M,groupingKey:H,position:g,isLastGroupRow:!1,rowId:j,rowPath:j,rowIndexPath:D,nestedTable:{parentRow:i,expandableHeader:G,childAccessor:H,calculatedHeight:K},absoluteRowIndex:g}),g++,M++}else if(B&&(B.loading||B.error||B.isEmpty)){if(B.loading&&v||B.error&&h||B.isEmpty&&m){var U=u(u([],A,!0),[H],!1);C.push({row:{},depth:n+1,displayPosition:M,groupingKey:H,position:g,isLastGroupRow:!1,rowId:U,rowPath:U,rowIndexPath:D,stateIndicator:{parentRowId:W,state:B},absoluteRowIndex:g,parentIndices:u(u([],w,!0),[O],!1)}),g++,M++}else if(B.loading&&!v){var _=u(u([],A,!0),[H,"loading-skeleton"],!1);C.push({row:{},depth:n+1,displayPosition:M,groupingKey:H,position:g,isLastGroupRow:!1,rowId:_,rowPath:_,rowIndexPath:D,isLoadingSkeleton:!0,absoluteRowIndex:g,parentIndices:u(u([],w,!0),[O],!1)}),g++,M++}}else if(q.length>0){var J=u(u([],A,!0),[H],!1),Y=u([],D,!0);g=S(q,n+1,g,M,J,Y,u(u([],w,!0),[O],!1))}}}),g};return S(e.rows,void 0===n?0:n,0,c,[],[],[]),C},D=function(e,n){var t=n.rowTopPositions;if(0===t.length)return 0;if(0>=e)return 0;if(e>=n.totalHeight)return t.length-1;for(var r=0,o=t.length-1;o>r;){var i=Math.floor((r+o+1)/2);t[i]>e?o=i-1:r=i}return r},F=function(e,n){if(!n||0===n.length)return 0;for(var t=0,r=0,o=n.length;o>r;){var i=Math.floor((r+o)/2);e>n[i][0]?r=i+1:o=i}for(var a=0;r>a;a++)t+=n[a][1];return t},O=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.scrollTop,o=e.tableRows,i=e.scrollDirection,a=void 0===i?"none":i,u=e.heightMap,l=e.rowHeight+1;if(!u){var s=n*l,c=s,d=s;"down"===a?(c=Math.max(l,.1*s),d=.9*s):"up"===a&&(c=.9*s,d=Math.max(l,.1*s));var f=r+t+d,v=Math.max(0,Math.floor(Math.max(0,r-c)/l)),p=Math.min(o.length,Math.ceil(f/l)),h=r+t,w=Math.max(0,Math.ceil(r/l)),m=Math.min(o.length,Math.floor(h/l)),g=r+t,x=Math.max(0,Math.floor(r/l)),b=Math.min(o.length,Math.ceil(g/l));return{rendered:{startIndex:v,endIndex:p,rows:o.slice(v,p)},fullyVisible:{startIndex:w,endIndex:m,rows:o.slice(w,m)},partiallyVisible:{startIndex:x,endIndex:b,rows:o.slice(x,b)}}}var y=u.rowTopPositions,I=n*l,C=I,R=I;"down"===a?(C=Math.max(l,.1*I),R=.9*I):"up"===a&&(C=.9*I,R=Math.max(l,.1*I));var S=r+t+R,M=D(Math.max(0,r-C),u),N=D(S,u)+1;N=Math.min(o.length,N);var H=r,E=r+t,T=D(H,u);H>y[T]&&(T=Math.min(T+1,o.length));var k=D(E,u);k=Math.min(o.length,k);var P=r+t,A=D(r,u),F=D(P,u)+1;return F=Math.min(o.length,F),{rendered:{startIndex:M,endIndex:N,rows:o.slice(M,N)},fullyVisible:{startIndex:T,endIndex:k,rows:o.slice(T,k)},partiallyVisible:{startIndex:A,endIndex:F,rows:o.slice(A,F)}}},L=function(e){var n=e.position;return n*(e.rowHeight+e.customTheme.rowSeparatorWidth)+F(n,e.heightOffsets)},W=function(e,n){var t,r,o=e.position,i=n[o+1];return null!==(r=null===(t=null==i?void 0:i.parentIndices)||void 0===t?void 0:t.includes(o))&&void 0!==r&&r},B=function(e){var n=e.allTableRows,t=e.renderedRows,r=e.fullyVisibleRows,o=e.partiallyVisibleRows,i=e.partiallyVisibleRowIndex,a=e.recursionDepth,u=e.stickyParents,l=e.rowGrouping,s=o[i];if(!s||a>10)return{stickyParents:u,regularRows:t};var c=0;if(s.parentIndices&&s.parentIndices.length>0){for(var d=function(e){var t=n[e];if(t){var o=r.some(function(e){return e.position===t.position});if(s.rowIndexPath&&s.rowIndexPath.length>0){var i=n[s.parentIndices[s.parentIndices.length-1]],a=i.row[l[i.depth]];if(u.length>=(Array.isArray(a)?a:[]).length-s.rowIndexPath[s.rowIndexPath.length-1])return"break"}o||u.some(function(e){return T(e.rowId)===T(t.rowId)})||(u.push(t),c++)}},f=0,v=s.parentIndices;v.length>f&&"break"!==d(v[f]);f++);if(u.length>0){W(s,n)&&(u.push(s),c++);var p=o[i+=c];p&&(s=p)}}else if(W(s,n))return u.push(s),i++,B({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l});return W(s,n)?B({allTableRows:n,renderedRows:t,fullyVisibleRows:r,partiallyVisibleRows:o,partiallyVisibleRowIndex:i,recursionDepth:a+1,stickyParents:u,rowGrouping:l}):{stickyParents:u,regularRows:t}},q=function(e,n,t){var r=e.getBoundingClientRect(),o=n.getBoundingClientRect(),i=10;if(o.top+i>r.top?n.scrollTop-=o.top-r.top+i:r.bottom>o.bottom-i&&(n.scrollTop+=r.bottom-o.bottom+i),t){var a=t.getBoundingClientRect();a.left+i>r.left?t.scrollLeft-=a.left-r.left+i:r.right>a.right-i&&(t.scrollLeft+=r.right-a.right+i)}},G=function(e,n,t,r){var o=document.querySelector(".st-body-container"),i=document.querySelector(".st-body-main");if(o){var a=n+t.rowSeparatorWidth,u=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));if(u&&r){var l=function(e,n,t,r){var o=O({bufferRowCount:0,contentHeight:n.clientHeight,rowHeight:t,scrollTop:n.scrollTop,tableRows:r,scrollDirection:"none"}).fullyVisible;return e>=o.startIndex&&o.endIndex>e}(e.rowIndex,o,n,r);if(l)return void q(u,o,i)}if(!u)return o.scrollTop=Math.max(0,e.rowIndex*a-o.clientHeight/3),void setTimeout(function(){var n=document.querySelector('.st-cell[data-row-index="'.concat(e.rowIndex,'"][data-col-index="').concat(e.colIndex,'"][data-row-id="').concat(e.rowId,'"]'));n&&q(n,o,i)},100);q(u,o,i)}},V=function(e){var n=e.colIndex,t=e.rowId;return"".concat(e.rowIndex,"-").concat(n,"-").concat(t)},z=n.createContext(void 0),K=function(n){return e.jsx(z.Provider,exports.__assign({value:n.value},{children:n.children}))},j=function(){var e=n.useContext(z);if(void 0===e)throw Error("useTableContext must be used within a TableProvider");return e},U=function(t){var r=t.currentPage,o=t.footerRenderer,u=t.hideFooter,l=t.onPageChange,s=t.onNextPage,c=t.onUserPageChange,d=t.rowsPerPage,f=t.shouldPaginate,v=t.totalPages,p=t.totalRows,h=j(),w=h.nextIcon,m=h.prevIcon,g=n.useState(!0),x=g[0],b=g[1],y=r>1,I=v>r,C=r===v,R=Math.min((r-1)*d+1,p),S=Math.min(r*d,p),M=!y,N=!I&&!s||!x&&C,H=function(){return i(void 0,void 0,void 0,function(){var e;return a(this,function(n){switch(n.label){case 0:return 1>(e=r-1)?[3,2]:(l(e),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(t){switch(t.label){case 0:return e=r===v,n=r+1,s&&e?[4,s(r)]:[3,2];case 1:if(!t.sent())return b(!1),[2];t.label=2;case 2:return n>v&&!s?[3,4]:(l(n),c?[4,c(n)]:[3,4]);case 3:t.sent(),t.label=4;case 4:return[2]}})})},T=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:r,totalPages:v,rowsPerPage:d,totalRows:p,startRow:R,endRow:S,onPageChange:T,onNextPage:E,onPrevPage:H,hasNextPage:!N,hasPrevPage:!M,nextIcon:w,prevIcon:m})});var k=function(){if(15>=v)return Array.from({length:v},function(e,n){return n+1});var e,n,t=[];r>8?v-7>r?(e=r-7,n=r+7):(e=Math.max(1,v-15+1),n=v):(e=1,n=14),e>2?(t.push(1),t.push(-1)):2===e&&t.push(1);for(var o=e;n>=o;o++)t.push(o);return v-1>n?(t.push(-2),t.push(v)):n===v-1&&t.push(v),t}();return e.jsxs("div",exports.__assign({className:"st-footer"},{children:[e.jsx("div",exports.__assign({className:"st-footer-info"},{children:e.jsxs("span",exports.__assign({className:"st-footer-results-text"},{children:["Showing ",R," to ",S," of ",p.toLocaleString()," results"]}))})),e.jsxs("div",exports.__assign({className:"st-footer-pagination"},{children:[k.map(function(n,t){return 0>n?e.jsx("span",exports.__assign({className:"st-page-ellipsis"},{children:"..."}),t):e.jsx("button",exports.__assign({onClick:function(){return T(n)},className:"st-page-btn ".concat(r===n?"active":""),"aria-label":"Go to page ".concat(n),"aria-current":r===n?"page":void 0},{children:n}),t)}),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(M?"disabled":""),onClick:H,disabled:M,"aria-label":"Go to previous page"},{children:m})),e.jsx("button",exports.__assign({className:"st-next-prev-btn ".concat(N?"disabled":""),onClick:E,disabled:N,"aria-label":"Go to next page"},{children:w}))]}))]}))},_=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},J=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},Y=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"})}))},X=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:n.className,style:exports.__assign({height:"10px"},n.style)},{children:e.jsx("path",{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"})}))},$=function(n){return e.jsx("svg",exports.__assign({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:n.className,style:{height:"1em"}},{children:e.jsx("path",{d:"M22 334.5c-3.8 8.8-2 19 4.6 26l116 144c4.5 4.8 10.8 7.5 17.4 7.5s12.9-2.7 17.4-7.5l116-144c6.6-7 8.4-17.2 4.6-26s-12.5-14.5-22-14.5l-72 0 0-288c0-17.7-14.3-32-32-32L148 0C130.3 0 116 14.3 116 32l0 288-72 0c-9.6 0-18.2 5.7-22 14.5z"})}))},Z=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"})}))},Q=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"})}))},ee=function(e){var t=e.headerContainerRef,r=e.mainSectionRef,o=e.scrollbarWidth,i=n.useState(!1),a=i[0],u=i[1];return n.useEffect(function(){var e=null==t?void 0:t.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(o,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[t,a,o]),n.useEffect(function(){var e=null==r?void 0:r.current;if(e&&(null==t?void 0:t.current)){var n=function(){e&&u(e.scrollHeight>e.clientHeight)};n();var o=new ResizeObserver(function(){n()});return o.observe(e),function(){e&&o.unobserve(e)}}},[t,r]),{isMainSectionScrollable:a}},ne=function(t){var r=t.children,o=t.onClose,i=t.open,a=t.overflow,u=void 0===a?"auto":a,l=t.setOpen,s=t.width,c=t.containerRef,d=t.positioning,f=void 0===d?"fixed":d,v=j().mainBodyRef,p=n.useRef(null),h=n.useRef(null),w=n.useState("bottom-left"),m=w[0],g=w[1],x=n.useState({}),b=x[0],y=x[1],I=n.useState(!1),C=I[0],R=I[1];return n.useEffect(function(){i&&p.current?(R(!1),!h.current&&p.current.parentElement&&(h.current=p.current.parentElement),requestAnimationFrame(function(){if(p.current&&h.current){var e,n=p.current,t=h.current.getBoundingClientRect(),r=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-t.bottom,a=t.top-e.top,u="bottom",l={};(r>i&&a>=r||r>i&&a>i)&&(u="top");var d="left";o>e.right-t.right+t.width&&(d="right"),"fixed"===f?("bottom"===u?l.top=t.bottom+4:l.bottom=window.innerHeight-t.top+4,"left"===d?l.left=t.left:l.right=window.innerWidth-t.right):("bottom"===u?l.top=t.height+4:l.bottom=t.height+4,"left"===d?l.left=0:l.right=0),g("".concat(u,"-").concat(d)),y(l),R(!0)}})):i||R(!1)},[i,s,c,v,f]),n.useEffect(function(){var e=function(e){i&&p.current&&p.current&&!p.current.contains(e.target)&&(l(!1),null==o||o())};return i&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[i,o,l]),n.useEffect(function(){var e=function(e){if(p.current&&!p.current.contains(e.target)){var n=p.current.parentElement;n&&!n.contains(e.target)&&(l(!1),null==o||o())}},n=function(n){"Enter"===n.key&&e(n)};return i&&(document.addEventListener("mousedown",e,!0),document.addEventListener("keydown",n,!0)),function(){document.removeEventListener("mousedown",e,!0),document.removeEventListener("keydown",n,!0)}},[o,i,l]),n.useEffect(function(){var e=function(e){"Escape"===e.key&&i&&(l(!1),null==o||o())};return i&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[o,i,l]),i?e.jsx("div",exports.__assign({ref:p,className:"st-dropdown-content st-dropdown-".concat(m),onClick:function(e){return e.stopPropagation()},onMouseDown:function(e){return e.stopPropagation()},onTouchStart:function(e){return e.stopPropagation()},style:exports.__assign(exports.__assign({position:f,width:s?"".concat(s,"px"):"auto",visibility:C?"visible":"hidden"},b),{overflow:u})},{children:r})):null},te=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,u=void 0!==a&&a,l=n.className,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&&r&&r()},role:"option","aria-selected":i,"aria-disabled":u},{children:t}))},re=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=n.useState(t.value),l=u[0],s=u[1],c=function(e){s(e),o(e),a(!1),r()};return e.jsxs(ne,exports.__assign({open:i,onClose:function(){r()},setOpen:a,width:120},{children:[e.jsx(te,exports.__assign({isSelected:!0===l,onClick:function(){return c(!0)}},{children:"True"})),e.jsx(te,exports.__assign({isSelected:!1===l,onClick:function(){return c(!1)}},{children:"False"}))]}))},oe=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=r?r:"",onBlur:o,onChange:function(e){i(e.target.value)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},ie=function(t){var r=t.defaultValue,o=t.onBlur,i=t.onChange,a=n.useRef(null);return e.jsx("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:""+r,onBlur:o,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&i(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||o()},onMouseDown:function(e){e.stopPropagation()}})},ae=n.lazy(function(){return Promise.resolve().then(function(){return require("./Animate-6e64a840.js")})}),ue=n.lazy(function(){return Promise.resolve().then(function(){return require("./DatePicker-33966702.js")})}),le=n.lazy(function(){return Promise.resolve().then(function(){return Yn})}),se=n.lazy(function(){return Promise.resolve().then(function(){return $n})}),ce=function(t){var r=o(t,["parentRef","tableRow"]);return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({},r))},{children:e.jsx(ae,exports.__assign({},t))}))},de=function(t){return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",exports.__assign({style:{padding:"20px",textAlign:"center"}},{children:"Loading..."}))},{children:e.jsx(ue,exports.__assign({},t))}))},fe=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(le,exports.__assign({},t))}))},ve=function(t){var r=t.width,o=t.height;return e.jsx(n.Suspense,exports.__assign({fallback:e.jsx("div",{style:{width:void 0===r?100:r,height:void 0===o?30:o,background:"#f3f4f6"}})},{children:e.jsx(se,exports.__assign({},t))}))},pe=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number);return new Date(n[0],n[1]-1,n[2],12,0,0)}var t=new Date(e);return isNaN(t.getTime())?new Date:new Date(t.getFullYear(),t.getMonth(),t.getDate(),12,0,0)},he=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},we=function(e){if(!e)return new Date;if("string"==typeof e)return pe(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:he(n)}return e instanceof Date?he(e):new Date},me=function(e){return e?pe(""+e):new Date},ge=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.setOpen,u=t.value;n.useEffect(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){r()};return e.jsx(ne,exports.__assign({open:i,onClose:l,setOpen:a,overflow:"hidden",width:240},{children:e.jsx(de,{value:me(u),onChange:function(e){var n=e.toISOString().split("T")[0];o(n),a(!1),r()},onClose:l})}))},xe=function(t){var r=t.onBlur,o=t.onChange,i=t.open,a=t.options,u=t.setOpen,l=n.useState(t.value||""),s=l[0],c=l[1];return e.jsx(ne,exports.__assign({open:i,onClose:function(){r()},setOpen:u,width:150},{children:e.jsx("div",exports.__assign({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e.jsx(te,exports.__assign({isSelected:s===n.value,onClick:function(){return c(e=n.value),o(e),u(!1),void r();var e}},{children:n.label}),n.value)})}))}))},be=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,u=void 0===a?"string":a,l=n.value,s=function(){i(!1)};return"boolean"===u&&"boolean"==typeof l?e.jsx(re,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:l}):"date"===u?e.jsx(ge,{onBlur:s,onChange:o,open:!0,setOpen:i,value:l}):"enum"===u?e.jsx(xe,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof l?l:""}):"number"===u&&"number"==typeof l?e.jsx(ie,{defaultValue:l,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}}):e.jsx(oe,{defaultValue:null==l?"":l+"",onBlur:s,onChange:o})},ye=0,Ie=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();0!==ye&&r>o-ye||(ye=o,n(t))}},Ce=function(e){var t=n.useRef(e);return n.useEffect(function(){JSON.stringify(t.current)!==JSON.stringify(e)&&(t.current=e)},[e]),t.current},Re=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(Re);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=Re(e[t]));return n},Se=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},Me=Date.now(),Ne={screenX:0,screenY:0},He=function(e,n,t){void 0===t&&(t=[]);for(var r=0;e.length>r;r++){var o=e[r];if(o.accessor===n)return u(u([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=He(o.children,n,u(u([],t,!0),[r],!1));if(i)return i}}return null},Ee=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};var Te=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=j().setHeaders,l=Ce(t);return{handleDragStart:function(e){n.current=e,Me=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var u=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,c=o.screenY,d=Math.sqrt(Math.pow(s-Ne.screenX,2)+Math.pow(c-Ne.screenY,2));r.current=a;var f,v,p,h=n.current,w=!1;if(Ee(h)!==Ee(a))f=(R=function(e,n,t){var r,o,i=Re(e),a=!1;try{var u=Ee(t),l=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===l||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var c=i.splice(l,1)[0],d=(r=u,o=exports.__assign({},c),"left"===r?o.pinned="left":"right"===r?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}}(t,h,a)).newHeaders,w=R.emergencyBreak;else{var m=t,g=He(m,h.accessor),x=He(m,a.accessor);if(!g||!x)return;var b=g.length,y=x.length,I=x;if(b!==y){var C=y-b;C>0&&(I=x.slice(0,-C))}if((v=g).length!==(p=I).length||1!==v.length&&!v.slice(0,-1).every(function(e,n){return e===p[n]}))return;var R=function(e,n,t){var r=Re(e),o=!1;function i(e,n){for(var t=e,r=0;n.length-1>r;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;n.length-1>i;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var u=i(r,n);return a(r,n,i(r,t)),a(r,t,u),{newHeaders:r,emergencyBreak:o}}(m,g,I);f=R.newHeaders,w=R.emergencyBreak}if(!(u||a.accessor===h.accessor||10>d||JSON.stringify(f)===JSON.stringify(t)||w)){var S=Date.now();JSON.stringify(f)===JSON.stringify(l)&&(1500>S-Me||40>d)||(Me=S,Ne={screenX:s,screenY:c},i(f))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return u([],e,!0)}),null==o||o(t)},10)}}},ke=function(n){var t=n.checked,r=void 0!==t&&t,o=n.children,i=n.onChange;return e.jsxs("label",exports.__assign({className:"st-checkbox-label"},{children:[e.jsx("input",{checked:r,className:"st-checkbox-input",onChange:function(){i&&i(!r)},onKeyDown:function(e){" "===e.key&&e.stopPropagation()},type:"checkbox","aria-label":n.ariaLabel,"aria-checked":r}),e.jsx("span",exports.__assign({className:"st-checkbox-custom ".concat(r?"st-checked":""),"aria-hidden":"true"},{children:r&&e.jsx(X,{className:"st-checkbox-checkmark"})})),o]}))},Pe=function(n){var t,r=n.content,o=n.header;return o.valueFormatter?o.valueFormatter({accessor:o.accessor,colIndex:n.colIndex,row:n.row,rowIndex:n.rowIndex,value:r}):"lineAreaChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(fe,exports.__assign({data:t},o.chartOptions)):null:"barChart"===o.type&&Array.isArray(r)?(t=r.filter(function(e){return"number"==typeof e})).length>0?e.jsx(ve,exports.__assign({data:t},o.chartOptions)):null:"boolean"==typeof r?r?"True":"False":Array.isArray(r)?0===r.length?"[]":r.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", "):"date"===o.type&&null!==r&&("string"==typeof r||"number"==typeof r||"object"==typeof r&&r instanceof Date)?we(r).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):r},Ae=r.default.memo(function(t){var r=t.borderClass,o=t.colIndex,i=t.displayRowNumber,a=t.header,u=t.isHighlighted,l=t.isInitialFocused,s=t.nestedIndex,c=t.parentHeader,d=t.rowIndex,f=t.tableRow,v=j(),p=v.canExpandRowGroup,h=v.cellRegistry,m=v.cellUpdateFlash,x=v.collapsedRows,b=v.columnBorders,y=v.draggedHeaderRef,I=v.enableRowSelection,C=v.expandedDepths,R=v.expandedRows,S=v.expandIcon,E=v.handleMouseDown,k=v.handleMouseOver,A=v.handleRowSelect,D=v.headers,F=v.hoveredHeaderRef,O=v.isCopyFlashing,L=v.isLoading,W=v.isRowSelected,B=v.isWarningFlashing,q=v.onCellEdit,G=v.onCellClick,V=v.onRowGroupExpand,z=v.onTableHeaderDragEnd,K=v.rowButtons,U=v.rowGrouping,_=v.setCollapsedRows,J=v.setExpandedRows,Y=v.setRowStateMap,X=v.rowsWithSelectedCells,$=v.selectedColumns,Z=v.tableBodyContainerRef,Q=v.theme,ee=v.useOddColumnBackground,ne=f.depth,te=f.row,re=f.rowPath,oe=f.rowIndexPath,ie=f.absoluteRowIndex,ae=f.rowId,ue=n.useState(M(te,a.accessor)),le=ue[0],se=ue[1],de=n.useState(!1),fe=de[0],ve=de[1],pe=n.useState(!1),he=pe[0],we=pe[1],me=n.useState(!1),ge=me[0],xe=me[1],ye=n.useRef(null),Ce=T(ae),Re=U&&U[ne],Se=!!Re&&function(e,n){return!!n&&H(e[n])}(te,Re),Me=U&&U.length>ne,Ne=!p||p(te),He=!!a.nestedTable,Ee=P(Ce,ne,C,R,x),Ae=O({rowIndex:d,colIndex:o,rowId:Ce}),De=B({rowIndex:d,colIndex:o,rowId:Ce}),Fe=n.useMemo(function(){var e,n,t;if(!b)return!1;var r=D.filter(function(e){return"left"===e.pinned}),o=D.filter(function(e){return!e.pinned}),i=D.filter(function(e){return"right"===e.pinned});return"left"===a.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===a.accessor:"right"===a.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===a.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===a.accessor},[b,D,a.accessor,a.pinned]),Oe=Te({draggedHeaderRef:y,headers:D,hoveredHeaderRef:F,onTableHeaderDragEnd:z}).handleDragOver,Le=Ie(),We=w({accessor:a.accessor,rowId:Ce}),Be=g({rowId:Ce,accessor:a.accessor}),qe=a.isSelectionColumn&&I;n.useEffect(function(){if(h){var e="".concat(Ce,"-").concat(a.accessor);return h.set(e,{updateContent:function(e){le!==e?(se(e),m&&(we(!0),ye.current&&clearTimeout(ye.current),ye.current=setTimeout(function(){we(!1)},800))):se(e)}}),function(){h.delete(e),ye.current&&clearTimeout(ye.current)}}},[h,m,Ce,a.accessor,le]),n.useEffect(function(){if(he){var e=setTimeout(function(){we(!1)},850);return function(){return clearTimeout(e)}}},[he]),n.useEffect(function(){se(M(te,a.accessor))},[te,a.accessor]);var Ge="boolean"===a.type||"date"===a.type||"enum"===a.type,Ve=!!(null==a?void 0:a.isEditable),ze=$.has(o),Ke=u&&!ze,je=n.useMemo(function(){return!!qe&&X.has(Ce+"")},[qe,X,Ce]),Ue=null==c?void 0:c.singleRowChildren,_e="st-cell ".concat(ne>0&&a.expandable?"st-cell-depth-".concat(ne):""," ").concat(Ke?l?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(ze?l?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ve?"clickable":""," ").concat(he?l?"st-cell-updating-first":"st-cell-updating":""," ").concat(Ae?l?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(De?l?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(ee?s%2==0?"even-column":"odd-column":""," ").concat(qe?"st-selection-cell":""," ").concat(je?"st-selection-has-highlighted-cell":""," ").concat(Fe?"st-last-column":""," ").concat(Ue?"st-sub-cell":""," ").concat(ge?"hovered":""),Je=n.useCallback(function(e){null==e&&(e="number"===a.type?0:"boolean"!==a.type&&""),se(e),N(te,a.accessor,e),null==q||q({accessor:a.accessor,newValue:e,row:te,rowIndex:d})},[a.accessor,a.type,q,te,d]),Ye=n.useCallback(function(e){e.stopPropagation();var n=P(Ce,ne,C,R,x),t=Ce+"";if(n?(_(function(e){var n=new Map(e);return n.set(t,ne),n}),J(function(e){var n=new Map(e);return n.delete(t),n})):(J(function(e){var n=new Map(e);return n.set(t,ne),n}),_(function(e){var n=new Map(e);return n.delete(t),n})),n&&Y(function(e){var n=new Map(e);return n.delete(Ce),n}),V){var r=a.pinned;V({depth:ne,event:e,groupingKey:Re,groupingKeys:U||[],isExpanded:!n,row:te,rowIndexPath:oe||[],rowIdPath:re,setEmpty:function(e,n){Y(function(t){var o=new Map(t),i=o.get(Ce)||{};return o.set(Ce,exports.__assign(exports.__assign({},i),{isEmpty:e,emptyMessage:n,loading:!1,error:null,triggerSection:r})),o})},setError:function(e){Y(function(n){var t=new Map(n),o=t.get(Ce)||{};return t.set(Ce,exports.__assign(exports.__assign({},o),{error:e,loading:!1,isEmpty:!1,triggerSection:r})),t})},setLoading:function(e){e?Y(function(e){var n=new Map(e),t=n.get(Ce)||{};return n.set(Ce,exports.__assign(exports.__assign({},t),{loading:!0,error:null,isEmpty:!1,triggerSection:r})),n}):setTimeout(function(){Y(function(e){var n=new Map(e),t=n.get(Ce)||{};return n.set(Ce,exports.__assign(exports.__assign({},t),{loading:!1,error:null,isEmpty:!1,triggerSection:r})),n})},0)}})}},[x,Re,ne,C,R,a.pinned,V,te,U,Ce,oe,re,_,J,Y]);return L||f.isLoadingSkeleton?e.jsx("div",exports.__assign({className:_e},{children:e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:e.jsx("div",{className:"st-loading-skeleton"})}))})):!fe||Ge||qe?e.jsxs(ce,exports.__assign({className:_e,"data-accessor":a.accessor,"data-col-index":o,"data-row-id":Ce,"data-row-index":d,"aria-colindex":o+1,id:We,onClick:function(){G&&!qe&&G({accessor:a.accessor,colIndex:o,row:te,rowIndex:d,value:le})},onDoubleClick:function(){return a.isEditable&&!qe&&ve(!0)},onDragOver:function(e){qe||Le({callback:Oe,callbackProps:{event:e,hoveredHeader:a},limit:50})},onKeyDown:function(e){fe||qe||"F2"!==e.key&&"Enter"!==e.key||!a.isEditable||fe||(e.preventDefault(),ve(!0))},onMouseDown:function(){fe||qe||E({rowIndex:d,colIndex:o,rowId:Ce})},onMouseEnter:function(){xe(!0)},onMouseLeave:function(){xe(!1)},onMouseOver:function(){fe||qe||k({rowIndex:d,colIndex:o,rowId:Ce})},parentRef:Z,tableRow:f},{children:[a.expandable&&Me?e.jsx("div",exports.__assign({className:"st-icon-container st-expand-icon-container ".concat(Ne&&(Se||V||He)?Ee?"expanded":"collapsed":"placeholder"),onClick:Ne&&(Se||V||He)?function(e){return Ye(e)}:void 0,role:Ne&&(Se||V||He)?"button":"presentation",tabIndex:Ne&&(Se||V||He)?0:-1,"aria-label":Ne&&(Se||V||He)?"".concat(Ee?"Collapse":"Expand"," row group"):void 0,"aria-expanded":Ne&&(Se||V||He)?Ee:void 0,"aria-hidden":!(Ne&&(Se||V||He)),onKeyDown:Ne&&(Se||V||He)?function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),Ye(e))}:void 0},{children:S})):null,e.jsx("span",exports.__assign({className:"st-cell-content ".concat("right"===a.align?"right-aligned":"center"===a.align?"center-aligned":"left-aligned")},{children:L||f.isLoadingSkeleton?e.jsx("div",{className:"st-loading-skeleton"}):e.jsx(e.Fragment,{children:qe?e.jsxs("div",exports.__assign({className:"st-selection-cell-content"},{children:[e.jsx("div",exports.__assign({className:"st-selection-control"},{children:ge||W&&W(Ce+"")?e.jsx(ke,{checked:!!W&&W(Ce+""),onChange:function(e){A&&A(Ce+"",e)},ariaLabel:"Select row ".concat(i+1)}):e.jsx("span",exports.__assign({className:"st-row-number"},{children:i+1}))})),function(){if(!K||!qe||0===K.length)return null;if(!(ge||W&&W(Ce+"")))return null;var n={row:te,rowIndex:i};return e.jsx("div",exports.__assign({className:"st-row-buttons",role:"group","aria-label":"Actions for row ".concat(i+1)},{children:K.map(function(t,r){return e.jsx("span",exports.__assign({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):a.cellRenderer?function(){var e;return a.cellRenderer({accessor:a.accessor,colIndex:o,row:te,rowIndex:ie,rowPath:re,theme:Q,value:le,formattedValue:null===(e=null==a?void 0:a.valueFormatter)||void 0===e?void 0:e.call(a,{accessor:a.accessor,colIndex:o,row:te,rowIndex:d,value:le})})}():Pe({content:le,header:a,colIndex:o,row:te,rowIndex:d})})})),!L&&!f.isLoadingSkeleton&&fe&&Ge&&!qe&&e.jsx(be,{enumOptions:a.enumOptions,onChange:Je,setIsEditing:ve,type:a.type,value:le})]}),Be):e.jsx("div",exports.__assign({className:"st-cell-editing",id:w({accessor:a.accessor,rowId:Ce}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e.jsx(be,{enumOptions:a.enumOptions,onChange:Je,setIsEditing:ve,type:a.type,value:le})}))},function(e,n){if(e.rowIndex!==n.rowIndex||e.colIndex!==n.colIndex||e.isHighlighted!==n.isHighlighted||e.isInitialFocused!==n.isInitialFocused||e.borderClass!==n.borderClass)return!1;if(e.tableRow!==n.tableRow){if(e.tableRow.row!==n.tableRow.row)return!1;if(e.tableRow.position!==n.tableRow.position||e.tableRow.displayPosition!==n.tableRow.displayPosition)return!1}return(e.header===n.header||e.header.accessor===n.header.accessor&&e.header.isEditable===n.header.isEditable&&e.header.type===n.header.type&&e.header.cellRenderer===n.header.cellRenderer&&e.header.valueFormatter===n.header.valueFormatter)&&e.parentHeader===n.parentHeader&&e.displayRowNumber===n.displayRowNumber&&e.nestedIndex===n.nestedIndex}),De=function(t){var r=t.columnIndices,o=t.displayRowNumber,i=t.header,a=t.headers,u=t.nestedIndex,l=t.parentHeader,s=t.pinned,c=t.rowIndex,d=t.rowIndices,f=t.tableRow,v=r[i.accessor],p=j(),h=p.getBorderClass,g=p.isSelected,x=p.isInitialFocusedCell,b=p.collapsedHeaders,y=T(f.rowId);if(i.children&&i.children.length>0){var I=i.children.filter(function(e){return m({header:e,pinned:s,headers:a,collapsedHeaders:b})});if(i.singleRowChildren){var C={rowIndex:c,colIndex:v,rowId:y},R=h(C),S=g(C),M=x(C),N=w({accessor:i.accessor,rowId:y});return e.jsxs(n.Fragment,{children:[e.jsx(Ae,{borderClass:R,colIndex:v,displayRowNumber:o,header:i,isHighlighted:S,isInitialFocused:M,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},N),I.map(function(n){var t=w({accessor:n.accessor,rowId:y});return e.jsx(De,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},t)})]})}return e.jsx(n.Fragment,{children:I.map(function(n){var t=w({accessor:n.accessor,rowId:y});return e.jsx(De,{columnIndices:r,displayRowNumber:o,header:n,headers:a,nestedIndex:u,parentHeader:i,pinned:s,rowIndex:c,rowIndices:d,tableRow:f},t)})})}var H={rowIndex:c,colIndex:v,rowId:y},E=h(H),k=g(H),P=x(H),A=w({accessor:i.accessor,rowId:y});return e.jsx(Ae,{borderClass:E,colIndex:v,displayRowNumber:o,header:i,isHighlighted:k,isInitialFocused:P,nestedIndex:u,parentHeader:l,rowIndex:c,tableRow:f},A)},Fe=r.default.memo(function(n){var t=n.columnIndexStart,r=n.columnIndices,o=n.headers,i=n.pinned,a=n.rowIndex,u=n.displayRowNumber,l=n.rowIndices,s=n.tableRow,c=j().collapsedHeaders,d=o.filter(function(e){return m({header:e,pinned:i,headers:o,collapsedHeaders:c})});return e.jsx(e.Fragment,{children:d.map(function(n,c){var d=T(s.rowId),f=w({accessor:n.accessor,rowId:d});return e.jsx(De,{columnIndices:r,displayRowNumber:u,header:n,headers:o,nestedIndex:c+(null!=t?t:0),pinned:i,rowIndex:a,rowIndices:l,tableRow:s},f)})})},function(e,n){return e.rowIndex===n.rowIndex&&e.displayRowNumber===n.displayRowNumber&&e.columnIndexStart===n.columnIndexStart&&(e.tableRow===n.tableRow||e.tableRow.row===n.tableRow.row)&&e.pinned===n.pinned&&e.headers===n.headers&&e.columnIndices===n.columnIndices&&e.rowIndices===n.rowIndices}),Oe=function(n){var t=n.rowState,r=n.loadingStateRenderer,o=n.errorStateRenderer,i=n.emptyStateRenderer,a=null;return t.loading&&r?a=r:t.error&&o?a=o:t.isEmpty&&i&&(a=i),a?e.jsx("div",exports.__assign({className:"st-cell st-state-row-cell",style:{gridColumn:"1 / -1",padding:0}},{children:a})):null},Le=function(n){var t=n.calculatedHeight,r=n.childAccessor,o=n.depth,i=n.expandableHeader,a=n.index,u=n.parentRow,l=n.position,s=j(),c=s.theme,d=s.rowGrouping,f=s.rowHeight,v=s.heightOffsets,p=s.customTheme,h=s.loadingStateRenderer,w=s.errorStateRenderer,m=s.emptyStateRenderer,g=s.expandIcon,x=s.filterIcon,b=s.sortUpIcon,y=s.sortDownIcon,I=s.nextIcon,C=s.prevIcon,R=s.headerCollapseIcon,S=s.headerExpandIcon,N=i.nestedTable;if(!N)return null;var H=M(u,r),E=Array.isArray(H)?H:[],T=d&&d[o+1]?null==d?void 0:d.slice(o+1):void 0,k=t-p.nestedGridPaddingTop-p.nestedGridPaddingBottom,P=N.customTheme?exports.__assign(exports.__assign({},p),N.customTheme):p;return e.jsx("div",exports.__assign({className:"st-row st-nested-grid-row","data-index":a,style:{transform:"translate3d(0, ".concat(L({position:l,rowHeight:f,heightOffsets:v,customTheme:p}),"px, 0)"),height:"".concat(t,"px"),paddingTop:"".concat(p.nestedGridPaddingTop,"px"),paddingBottom:"".concat(p.nestedGridPaddingBottom,"px")}},{children:e.jsx(Un,exports.__assign({},N,{rows:E,theme:c,customTheme:P,height:"".concat(k,"px"),rowGrouping:T,loadingStateRenderer:h,errorStateRenderer:w,emptyStateRenderer:m,expandIcon:g,filterIcon:x,sortUpIcon:b,sortDownIcon:y,nextIcon:I,prevIcon:C,headerCollapseIcon:R,headerExpandIcon:S}))}))},We=r.default.memo(function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,u=n.pinned,l=n.rowHeight,s=n.rowIndices,c=n.setHoveredIndex,d=n.tableRow,f=n.isSticky,v=void 0!==f&&f,p=n.stickyIndex,h=void 0===p?0:p,w=n.stickyOffset,m=void 0===w?0:w,g=n.stickyZIndex,x=j(),b=x.customTheme,y=x.emptyStateRenderer,I=x.errorStateRenderer,C=x.heightOffsets,R=x.isAnimating,S=x.isRowSelected,M=x.loadingStateRenderer,N=x.maxHeaderDepth,H=x.rows,E=x.useHoverRowBackground,k=x.useOddEvenRowBackground,P=d.position,A=d.displayPosition,D=d.stateIndicator,F=d.nestedTable;if(F)return u?e.jsx("div",{className:"st-row st-nested-grid-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(F.calculatedHeight,"px")}}):e.jsx(Le,{calculatedHeight:F.calculatedHeight,childAccessor:F.childAccessor,depth:d.depth-1,expandableHeader:F.expandableHeader,index:a,parentRow:F.parentRow,position:P});if(D){if(D.state.triggerSection===u){if(!(D.state.loading&&M||D.state.error&&I||D.state.isEmpty&&y))return e.jsx("div",{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}});var O=H.find(function(e,n){return T([n])===D.parentRowId});return e.jsx("div",exports.__assign({className:"st-row st-state-row","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}},{children:e.jsx(Oe,{parentRow:O||{},rowState:D.state,gridTemplateColumns:o,loadingStateRenderer:M,errorStateRenderer:I,emptyStateRenderer:y})}))}return e.jsx("div",{className:"st-row st-state-row-spacer","data-index":a,style:{gridTemplateColumns:o,transform:"translate3d(0, ".concat(L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),"px, 0)"),height:"".concat(l,"px")}})}var W=P%2==0,B=T(d.rowId),q=!!S&&S(B),G=v?{gridTemplateColumns:o,transform:"translateY(".concat(h*(l+1)+m,"px)"),height:"".concat(l,"px"),position:"absolute",top:0,left:0,right:0,zIndex:g}:{gridTemplateColumns:o,top:L({position:P,rowHeight:l,heightOffsets:C,customTheme:b}),height:"".concat(l,"px")};return e.jsx("div",exports.__assign({className:"st-row ".concat(v?"st-sticky-parent":""," ").concat(k?W?"even":"odd":""," ").concat(q?"selected":""),"data-index":a,"aria-rowindex":P+N+1,onMouseEnter:function(){!R&&E&&c(a)},style:G},{children:e.jsx(Fe,{columnIndexStart:r,columnIndices:t,displayRowNumber:A,headers:i,pinned:u,rowIndex:P,rowIndices:s,tableRow:d},B)}))},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}),Be=function(t){var r=t.displayStrongBorder,o=t.position,i=t.rowHeight,a=t.templateColumns,u=t.isSticky,l=void 0!==u&&u,s=j(),c=s.heightOffsets,d=s.customTheme,f=n.useRef(null),v=l?o:function(e){var n=e.position,t=e.customTheme;return n*(e.rowHeight+t.rowSeparatorWidth)-t.rowSeparatorWidth+F(n,e.heightOffsets)}({position:o,rowHeight:i,heightOffsets:c,customTheme:d}),p=l?{position:"absolute",top:0,left:0,right:0,transform:"translateY(".concat(v,"px)")}:{transform:"translate3d(0, ".concat(v,"px, 0)")};return e.jsx("div",exports.__assign({className:"st-row-separator ".concat(r?"st-last-group-row":""),onMouseDown:function(e){var n=e.currentTarget,t=n.style.pointerEvents;n.style.pointerEvents="none";var r=document.elementFromPoint(e.clientX,e.clientY);if(n.style.pointerEvents=t,r){var o=r.closest(".st-cell");if(o instanceof HTMLElement){f.current=o;var i=o.getBoundingClientRect(),a=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:i.top+i.height/2});o.dispatchEvent(a)}}},onMouseUp:function(e){if(f.current){var n=f.current.getBoundingClientRect(),t=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0,clientX:e.clientX,clientY:n.top+n.height/2});f.current.dispatchEvent(t),f.current=null}},style:exports.__assign({gridTemplateColumns:a},p)},{children:e.jsx("div",{style:{gridColumn:"1 / -1"}})}))},qe=n.createContext(void 0),Ge=function(e){var t=e.childRef,r=e.children,o=e.group,i=void 0===o?"default":o,a=function(){var e=n.useContext(qe);if(!e)throw Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),u=a.registerPane,l=a.unregisterPane;return n.useEffect(function(){var e=[i];return t.current&&u(t.current,e),function(){t.current&&l(t.current,e)}},[t,u,l,i]),n.cloneElement(r,{ref:function(e){t.current=e}})},Ve=n.forwardRef(function(t,r){var o=t.columnIndexStart,i=t.columnIndices,a=t.headers,u=t.pinned,l=t.rowHeight,s=t.rowIndices,c=t.setHoveredIndex,d=t.templateColumns,f=t.totalHeight,v=t.width,p=t.regularRows,h=u?"st-body-pinned-".concat(u):"st-body-main",w=n.useRef(null);return n.useImperativeHandle(r,function(){return w.current},[]),n.useMemo(function(){return Se(a,u)},[a,u])?e.jsx(Ge,exports.__assign({childRef:w,group:u?"pinned-".concat(u):"default"},{children:e.jsx("div",exports.__assign({className:h,ref:w,style:exports.__assign({position:"relative",height:"".concat(f,"px"),width:v},!u&&{flexGrow:1})},{children:p.map(function(t,r){var f=t.stateIndicator?"state-".concat(t.stateIndicator.parentRowId,"-").concat(t.position):T(t.rowId);return e.jsxs(n.Fragment,{children:[0!==r&&e.jsx(Be,{displayStrongBorder:t.isLastGroupRow,position:t.position,rowHeight:l,templateColumns:d}),e.jsx(We,{columnIndexStart:o,columnIndices:i,gridTemplateColumns:d,headers:a,index:r,pinned:u,rowHeight:l,rowIndices:s,setHoveredIndex:c,tableRow:t})]},f)})}))})):null});function ze(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=u(u(u([],t,!0),n,!0),r,!0),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 m({header:e,headers:l,collapsedHeaders:o})}).forEach(function(n,t){s(n,!e.singleRowChildren&&0===t)})};return t.forEach(function(e,n){s(e,0===n)}),n.filter(function(e){return!e.pinned&&m({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){s(e,0===n&&0===t.length)}),r.forEach(function(e){s(e,!1)}),i}Ve.displayName="TableSection";var Ke=function(t){var r=t.calculatedHeaderHeight,o=t.stickyParents,i=t.mainTemplateColumns,a=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,l=t.pinnedLeftWidth,c=t.pinnedRightColumns,d=t.pinnedRightTemplateColumns,f=t.pinnedRightWidth,v=t.setHoveredIndex,p=t.rowIndices,h=t.scrollbarWidth,w=t.scrollTop,m=t.heightMap,g=t.partiallyVisibleRows,x=j(),b=x.collapsedHeaders,y=x.customTheme,I=x.editColumns,C=x.headers,R=x.rowHeight,S=n.useMemo(function(){var e,n;if(0===o.length)return{treeTransitionOffset:0,offsetStartIndex:-1};var t,r=g[0];if((null==r?void 0:r.parentIndices)&&r.parentIndices.length>0)for(var i=function(e){var n=r.parentIndices[e];if(o.some(function(e){return e.position===n}))return t=n,"break"},a=r.parentIndices.length-1;a>=0&&"break"!==i(a);a--);var u=void 0!==t?o.findIndex(function(e){return e.position===t}):-1,l=-1,s=function(e){var n=o[e],t=o[e+1];return t?t.depth===n.depth?(l=e,"break"):n.depth>t.depth?(l=o.findIndex(function(e){return e.depth===n.depth}),"break"):void 0:"break"};for(a=0;o.length>a&&"break"!==s(a);a++);if(-1===l)return{treeTransitionOffset:0,offsetStartIndex:u};var c=null===(e=o[l])||void 0===e?void 0:e.position;if(void 0===c)return{treeTransitionOffset:0,offsetStartIndex:u};for(var d=0,f=0,v=g;v.length>f&&(null===(n=v[f].parentIndices)||void 0===n?void 0:n.includes(c));f++)d++;if(0===d)return{treeTransitionOffset:0,offsetStartIndex:u};var p=g[0];return{treeTransitionOffset:-((l+1-d)*R+Math.max(0,w-(m?m.rowTopPositions[p.position]:p.position*(R+y.rowSeparatorWidth)))),offsetStartIndex:u}},[y,m,g,R,w,o]),M=S.treeTransitionOffset,N=S.offsetStartIndex,H=n.useMemo(function(){return ze({headers:C,pinnedLeftColumns:a,pinnedRightColumns:c,collapsedHeaders:b})},[C,a,c,b]),E=o.length>0?o.length*(R+1)+M:0;if(0===o.length)return null;var k=function(t,r,i,a,u){return void 0===u&&(u=0),e.jsx("div",exports.__assign({className:i?"st-sticky-section-".concat(i):"st-sticky-section-main",style:{position:"relative",height:"".concat(E,"px"),width:i?"".concat(a,"px"):void 0,flexGrow:i?0:1,flexShrink:i?0:void 0}},{children:o.map(function(a,l){var s=a.stateIndicator?"sticky-state-".concat(a.stateIndicator.parentRowId,"-").concat(a.position):"sticky-".concat(T(a.rowId)),c=-1!==N&&l>=N,d=c?M:0,f=(l+1)*(R+1)-1+d;return e.jsxs(n.Fragment,{children:[e.jsx(We,{columnIndexStart:u,columnIndices:H,gridTemplateColumns:t,headers:r,index:a.position,pinned:i,rowHeight:R,rowIndices:p,setHoveredIndex:v,tableRow:a,isSticky:!0,stickyIndex:l,stickyOffset:d,stickyZIndex:c?l:o.length-l}),e.jsx(Be,{displayStrongBorder:!1,position:f,rowHeight:R,templateColumns:t,isSticky:!0})]},s)})}))},P=C.filter(function(e){return!e.pinned}),A="calc(100% - ".concat(h,"px - ").concat(I?"".concat(s,"px"):"0px",")");return e.jsxs("div",exports.__assign({className:"st-sticky-top",style:{height:"".concat(E,"px"),width:A,top:"".concat(r,"px")}},{children:[a.length>0&&k(u,a,"left",l,0),k(i,P,void 0,void 0,a.length),c.length>0&&k(d,c,"right",f,a.length+P.length)]}))},je=function(t){var r=t.calculatedHeaderHeight,o=t.mainTemplateColumns,i=t.pinnedLeftColumns,a=t.pinnedLeftTemplateColumns,u=t.pinnedLeftWidth,l=t.pinnedRightColumns,s=t.pinnedRightTemplateColumns,c=t.pinnedRightWidth,d=t.rowsToRender,f=t.setScrollTop,v=t.setScrollDirection,p=t.shouldShowEmptyState,h=t.tableRows,w=t.stickyParents,m=t.regularRows,g=t.partiallyVisibleRows,x=t.heightMap,b=j(),y=b.collapsedHeaders,I=b.headerContainerRef,C=b.headers,R=b.heightOffsets,S=b.isAnimating,M=b.mainBodyRef,N=b.onLoadMore,H=b.rowHeight,E=b.scrollbarWidth,k=b.setIsScrolling,P=b.shouldPaginate,A=b.tableBodyContainerRef,D=b.tableEmptyStateRenderer,F=b.customTheme,O=n.useState(!1),L=O[0],W=O[1],B=n.useState(0),q=B[0],G=B[1],V=n.useRef(new Set),z=n.useCallback(function(e){if(document.querySelectorAll(".st-row.hovered").forEach(function(e){e.classList.remove("hovered")}),V.current.clear(),null!==e&&A.current){var n=A.current;n.querySelectorAll('.st-row[data-index="'.concat(e,'"]:not(.st-nested-grid-row)')).forEach(function(e){var t=e;t.closest(".st-body-container")===n&&(t.classList.add("hovered"),V.current.add(t))})}},[A]);n.useEffect(function(){S&&z(null)},[S,z]),ee({headerContainerRef:I,mainSectionRef:A,scrollbarWidth:E}),n.useEffect(function(){return function(){U.current&&clearTimeout(U.current)}},[]);var K=n.useRef(null),U=n.useRef(null),_=n.useRef(0),J=function(e){return e.length}(h),Y=n.useMemo(function(){return function(e,n,t,r){return e*(n+r.rowSeparatorWidth)-r.rowSeparatorWidth+((null==t?void 0:t.reduce(function(e,n){return e+n[1]},0))||0)}(J,H,R,F)},[J,H,R,F]),X=n.useMemo(function(){return ze({headers:C,pinnedLeftColumns:i,pinnedRightColumns:l,collapsedHeaders:y})},[C,i,l,y]),$=n.useMemo(function(){var e={};return d.forEach(function(n,t){var r=T(n.rowId);e[r]=t}),e},[d]),Z=n.useCallback(function(e,n){!N||P||L||200>=e.scrollHeight-(n+e.clientHeight)&&n>_.current&&(W(!0),N(),setTimeout(function(){W(!1)},1e3))},[N,P,L]),Q={columnIndices:X,headerContainerRef:I,headers:C,rowHeight:H,rowIndices:$,rowsToRender:d,setHoveredIndex:z,regularRows:m};return e.jsxs(e.Fragment,{children:[!p&&e.jsx(Ke,{calculatedHeaderHeight:r,heightMap:x,mainTemplateColumns:o,partiallyVisibleRows:g,pinnedLeftColumns:i,pinnedLeftTemplateColumns:a,pinnedLeftWidth:u,pinnedRightColumns:l,pinnedRightTemplateColumns:s,pinnedRightWidth:c,rowIndices:$,scrollTop:q,scrollbarWidth:E,setHoveredIndex:z,stickyParents:w}),e.jsx("div",exports.__assign({className:"st-body-container",onMouseLeave:function(){return z(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;k(!0),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){k(!1)},150),K.current&&cancelAnimationFrame(K.current),K.current=requestAnimationFrame(function(){var e=_.current,r=t>e?"down":e>t?"up":"none";f(t),v(r),G(t),Z(n,t),_.current=t})},ref:A},{children:p?e.jsx("div",exports.__assign({className:"st-empty-state-wrapper"},{children:D})):e.jsxs(e.Fragment,{children:[e.jsx(Ve,exports.__assign({},Q,{pinned:"left",templateColumns:a,totalHeight:Y,width:u})),e.jsx(Ve,exports.__assign({},Q,{columnIndexStart:i.length,ref:M,templateColumns:o,totalHeight:Y})),e.jsx(Ve,exports.__assign({},Q,{columnIndexStart:i.length+o.length,pinned:"right",templateColumns:s,totalHeight:Y,width:c}))]})}))]})},Ue=function(e){var n=e.event,t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.tableBodyContainerRef,l=e.startWidth,s=e.collapsedHeaders,c=e.autoExpandColumns,f=void 0!==c&&c,v=e.reverse,p=void 0!==v&&v;n.preventDefault();var h="clientX"in n?n.clientX:n.touches[0].clientX,w="touches"in n;if(t&&!t.hide){i(!0);var m,g=I(t);if(t.children&&t.children.length>0){var R=x(t,s);m=R.length>0?R:[t]}else m=[t];var S=new Map,M=0;if(f){var N=r.filter(function(e){return e.pinned===t.pinned});if(C(N,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 H=a.current.clientWidth,E=Je({headers:r,containerWidth:H,collapsedHeaders:s}),T=E.leftWidth,k=E.rightWidth;M="left"===t.pinned?T:"right"===t.pinned?k:Math.max(0,H-T-k)}}var P=function(e){var n="right"===t.pinned?h-e:e-h;if(f){var i=r.filter(function(e){return e.pinned===t.pinned});Xe({delta:n,startWidth:l,resizedHeader:m.length>0?m[0]:t,sectionHeaders:i,reverse:p,collapsedHeaders:s,initialWidthsMap:S,sectionWidth:M,isParentResize:m.length>1,childrenToResize:m})}else{var a=function(e){var n=e.header,t=e.headers,r=e.collapsedHeaders,o=document.querySelector(".st-body-container");if(!o||0===o.clientWidth)return 1e3;var i=o.clientWidth,a=d(window.innerWidth);if(!n.pinned)return 1/0;var u=i*a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+x(n,r).reduce(function(e,n){return e+b(n)},0)},0),l=I(n);return l>u?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),l):u}({header:t,headers:r,collapsedHeaders:s});m.length>1?_e({delta:n,leafHeaders:m,minWidth:g,startWidth:l,maxWidth:a}):m[0].width=Math.max(Math.min(l+n,a),g),r.forEach(function(e){y(e)})}var c=u([],r,!0);o(c)};if(w){var A=function(e){P(e.touches[0].clientX)},D=function(){document.removeEventListener("touchmove",A),document.removeEventListener("touchend",D),i(!1)};document.addEventListener("touchmove",A),document.addEventListener("touchend",D)}else{var F=function(e){P(e.clientX)},O=function(){document.removeEventListener("mousemove",F),document.removeEventListener("mouseup",O),i(!1)};document.addEventListener("mousemove",F),document.addEventListener("mouseup",O)}}},_e=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,I(n))},40),u=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),l=Math.max(Math.min(o+n,i),a)-u;t.forEach(function(e){var n="number"==typeof e.width?e.width:150;e.width=Math.max(n+l*(n/u),r)})},Je=function(e){var n=e.containerWidth,t=e.maxPinnedWidthPercent,r=void 0===t?.8:t,o=e.collapsedHeaders,i=0,a=0,u=0;e.headers.forEach(function(e){if(!e.hide){var n=x(e,o).reduce(function(e,n){return e+b(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*r;i>c&&(i=c),a>c&&(a=c)}return{leftWidth:h(i),rightWidth:h(a),mainWidth:u,leftContentWidth:l,rightContentWidth:s}},Ye=function(e){var n=e.columnsToShrink,t=e.totalCompensation,r=e.initialWidthsMap;if(0>t){var o=Math.abs(t),i=n.reduce(function(e,n){return e+(r.get(n.accessor)||100)},0);if(0===i)return;n.forEach(function(e,t){var a=r.get(e.accessor)||100,u=o*(a/i);if(t===n.length-1){var l=n.slice(0,t).reduce(function(e,n){var t=r.get(n.accessor)||100;return e+(("number"==typeof n.width?n.width:100)-t)},0);u=o-l}e.width=a+u})}else for(var a=t,u=function(){var e=n.map(function(e){var n=r.get(e.accessor)||100;return{column:e,headroom:Math.max(0,n-30),initialWidth:n,minWidth:30}}),t=e.filter(function(e){return e.headroom>0});if(t.length>0){var o=t.reduce(function(e,n){return e+n.headroom},0),i=0,u=a;t.forEach(function(e,n){var r=u*(e.headroom/o);r=Math.min(r,e.headroom),n===t.length-1&&(r=Math.min(u-i,e.headroom)),e.column.width=e.initialWidth-r,i+=r}),a-=i}else{var l=e.filter(function(e){return e.minWidth>c});if(0>=l.length)return"break";var s=a,d=s/l.length,f=0;l.forEach(function(e,n){var t=e.minWidth-c,r=Math.min(d,t);n===l.length-1&&(r=Math.min(s-f,t));var o=e.initialWidth-r;e.column.width=o,e.column.minWidth=Math.max(o,c),f+=r}),a-=f}};a>.5&&"break"!==u(););},Xe=function(e){var n=e.delta,t=e.startWidth,r=e.resizedHeader,o=e.sectionHeaders,i=e.reverse,a=e.collapsedHeaders,u=e.initialWidthsMap,l=e.sectionWidth,s=e.isParentResize,d=e.childrenToResize,f=void 0===d?[]:d;if(void 0!==s&&s&&f.length>1){var v=C(o,a),p=v.findIndex(function(e){return e.accessor===f[0].accessor}),h=v.findIndex(function(e){return e.accessor===f[f.length-1].accessor});if(-1===p||-1===h)return;var w,m=h===v.length-1;w=0===p?v.slice(h+1):m||i?v.slice(0,p):v.slice(h+1);var g=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){var x=n,b=!1;if(g+n>l){b=!0;var y=w.reduce(function(e,n){var t=u.get(n.accessor)||100;return e+Math.max(0,t-c)},0);x=Math.min(n,y)}var I=(R=t+x)/(S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0));f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*I,30)}),b&&x>0&&w.length>0&&Ye({columnsToShrink:w,totalCompensation:x,initialWidthsMap:u})}else{var R,S=f.reduce(function(e,n){return e+(u.get(n.accessor)||100)},0),M=(R=Math.max(t+n,c*f.length))/S;f.forEach(function(e){var n=u.get(e.accessor)||100;e.width=Math.max(n*M,30)}),(D=t-R)>0&&w.length>0&&Ye({columnsToShrink:w,totalCompensation:-D,initialWidthsMap:u})}}else{var N=C(o,a),H=N.findIndex(function(e){return e.accessor===r.accessor});if(-1!==H){var E,T=H===N.length-1;if(0!==(E=0===H?N.slice(H+1):T||i?N.slice(0,H):N.slice(H+1)).length){var k=Array.from(u.values()).reduce(function(e,n){return e+n},0);if(n>0){if(l>=k+n)return void(r.width=t+n);y=E.reduce(function(e,n){var t=u.get(n.accessor)||100;return e+Math.max(0,t-c)},0);var P=Math.min(n,y);r.width=t+P,P>0&&Ye({columnsToShrink:E,totalCompensation:P,initialWidthsMap:u})}else{var A=Math.max(t+n,30),D=t-A;r.width=A,D>0&&Ye({columnsToShrink:E,totalCompensation:-D,initialWidthsMap:u})}}else r.width=Math.max(t+n,30)}}},$e={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"},Ze=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"]}},Qe=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},en=function(e){return["between","notBetween","in","notIn"].includes(e)},nn=function(e){return["isEmpty","isNotEmpty"].includes(e)},tn=function(n){return e.jsx("div",exports.__assign({className:"st-filter-container"},{children:n.children}))},rn=function(t){var r=t.value,o=t.onChange,i=t.options,a=t.placeholder,u=void 0===a?"Select...":a,l=t.className,s=void 0===l?"":l,c=t.disabled,d=void 0!==c&&c,f=n.useState(!1),v=f[0],p=f[1],h=n.useState(-1),w=h[0],m=h[1],g=n.useRef(null),x=i.find(function(e){return e.value===r});n.useEffect(function(){var e=function(e){if(v)switch(e.key){case"ArrowDown":e.preventDefault(),m(function(e){return i.length-1>e?e+1:0});break;case"ArrowUp":e.preventDefault(),m(function(e){return e>0?e-1:i.length-1});break;case"Enter":e.preventDefault(),0>w||(o(i[w].value),p(!1),m(-1));break;case"Escape":e.preventDefault(),p(!1),m(-1)}};if(v)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[v,w,i,o]);var b=function(e){o(e),p(!1),m(-1)};return e.jsxs("div",exports.__assign({ref:g,className:"st-custom-select ".concat(s," ").concat(d?"st-custom-select-disabled":""," ").concat(v?"st-custom-select-open":"").trim()},{children:[e.jsxs("button",exports.__assign({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!d)if(p(!v),v)m(-1);else{var e=i.findIndex(function(e){return e.value===r});m(0>e?0:e)}},disabled:d,"aria-haspopup":"listbox","aria-expanded":v,"aria-labelledby":"select-label"},{children:[e.jsx("span",exports.__assign({className:"st-custom-select-value"},{children:x?x.label:u})),e.jsx(Q,{})]})),e.jsx(ne,exports.__assign({open:v,setOpen:p,onClose:function(){p(!1),m(-1)},positioning:"absolute",overflow:"auto"},{children:e.jsx("div",exports.__assign({className:"st-custom-select-options",role:"listbox"},{children:i.map(function(n,t){return e.jsx("div",exports.__assign({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===w?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return b(n.value)},tabIndex:0,onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),b(n.value))}},{children:n.label}),t)})}))}))]}))},on=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:$e[e]}});return e.jsx("div",exports.__assign({className:"st-filter-section"},{children:e.jsx(rn,{value:t,onChange:function(e){r(e)},options:o})}))},an=function(n){var t=n.type,r=n.onChange,o=n.autoFocus,i=n.className,a=n.onEnterPress;return e.jsx("input",{type:void 0===t?"text":t,value:n.value,onChange:function(e){return r(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&a&&a()},placeholder:n.placeholder,autoFocus:void 0!==o&&o,className:"st-filter-input ".concat(void 0===i?"":i).trim()})},un=function(n){var t=n.children,r=n.className;return e.jsx("div",exports.__assign({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},ln=function(n){var t=n.onClear,r=n.canApply,o=n.showClear;return e.jsxs("div",exports.__assign({className:"st-filter-actions"},{children:[e.jsx("button",exports.__assign({onClick:n.onApply,disabled:!r,className:"st-filter-button st-filter-button-apply ".concat(r?"":"st-filter-button-disabled"),tabIndex:0},{children:"Apply"})),o&&t&&e.jsx("button",exports.__assign({onClick:t,className:"st-filter-button st-filter-button-clear",tabIndex:0},{children:"Clear"}))]}))},sn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"contains"),l=u[0],s=u[1],c=n.useState(((null==o?void 0:o.value)||"")+""),d=c[0],f=c[1],v=Ze("string");n.useEffect(function(){o?(s(o.operator),f((o.value||"")+"")):(s("contains"),f(""))},[o]);var p=function(){var e=exports.__assign({accessor:r.accessor,operator:l},Qe(l)&&{value:d});i(e)},h=nn(l)||d.trim();return e.jsxs(tn,{children:[e.jsx(on,{value:l,onChange:s,operators:v}),Qe(l)&&e.jsx(un,{children:e.jsx(an,{type:"text",value:d,onChange:f,placeholder:"Filter...",autoFocus:!0,onEnterPress:p})}),e.jsx(ln,{onApply:p,onClear:a,canApply:!!h,showClear:!!o})]})},cn=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState(((null==a?void 0:a.value)||"")+""),v=f[0],p=f[1],h=n.useState(((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])||"")+""),w=h[0],m=h[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],y=Ze("number");n.useEffect(function(){var e,n;a?(d(a.operator),p((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),p(""),m(""),b(""))},[a]);var I=function(){var e={accessor:i.accessor,operator:c};Qe(c)?e.value=parseFloat(v):en(c)&&(e.values=[parseFloat(""+w),parseFloat(""+x)]),u(e)};return e.jsxs(tn,{children:[e.jsx(on,{value:c,onChange:d,operators:y}),Qe(c)&&e.jsx(un,{children:e.jsx(an,{type:"number",value:v,onChange:p,placeholder:"Enter number...",autoFocus:!0,onEnterPress:I})}),en(c)&&e.jsxs(un,{children:[e.jsx(an,{type:"number",value:w,onChange:m,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:I}),e.jsx(an,{type:"number",value:x,onChange:b,placeholder:"To...",onEnterPress:I})]}),e.jsx(ln,{onApply:I,onClear:l,canApply:!!nn(c)||(Qe(c)?""!==v.trim():!!en(c)&&""!==(w+"").trim()&&""!==(x+"").trim()),showClear:!!a})]})},dn=function(n){var t=n.className;return e.jsx(rn,{value:n.value,onChange:n.onChange,options:n.options,className:void 0===t?"":t,placeholder:n.placeholder})},fn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,u=n.useState((null==o?void 0:o.operator)||"equals"),l=u[0],s=u[1],c=n.useState(void 0!==(null==o?void 0:o.value)?o.value+"":"true"),d=c[0],f=c[1],v=Ze("boolean");n.useEffect(function(){o?(s(o.operator),f(void 0!==o.value?o.value+"":"true")):(s("equals"),f("true"))},[o]);var p=nn(l)||""!==d;return e.jsxs(tn,{children:[e.jsx(on,{value:l,onChange:s,operators:v}),Qe(l)&&e.jsx(un,{children:e.jsx(dn,{value:d,onChange:f,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e.jsx(ln,{onApply:function(){var e={accessor:r.accessor,operator:l};Qe(l)&&(e.value="true"===d),i(e)},onClear:a,canApply:p,showClear:!!o})]})},vn=function(t){var r,o,i=t.header,a=t.currentFilter,u=t.onApplyFilter,l=t.onClearFilter,s=n.useState((null==a?void 0:a.operator)||"equals"),c=s[0],d=s[1],f=n.useState((null==a?void 0:a.value)?a.value+"":""),v=f[0],p=f[1],h=n.useState((null===(r=null==a?void 0:a.values)||void 0===r?void 0:r[0])?a.values[0]+"":""),w=h[0],m=h[1],g=n.useState(((null===(o=null==a?void 0:a.values)||void 0===o?void 0:o[1])||"")+""),x=g[0],b=g[1],y=Ze("date");n.useEffect(function(){var e,n;a?(d(a.operator),p((a.value||"")+""),m(((null===(e=a.values)||void 0===e?void 0:e[0])||"")+""),b(((null===(n=a.values)||void 0===n?void 0:n[1])||"")+"")):(d("equals"),p(""),m(""),b(""))},[a]);var I=function(t){var r=t.value,o=t.onChange,i=t.placeholder,a=t.autoFocus,u=t.className,l=n.useState(!1),s=l[0],c=l[1],d=n.useState(""),f=d[0],v=d[1],p=n.useRef(null);n.useEffect(function(){if(r){var e=we(r);isNaN(e.getTime())||v(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else v("")},[r]),n.useEffect(function(){a&&p.current&&p.current.focus()},[a]);var h=r?we(r):new Date;return e.jsxs("div",exports.__assign({className:"st-date-input-container",style:{position:"relative"}},{children:[e.jsx("input",{ref:p,type:"text",value:f,placeholder:i,onClick:function(){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(ne,exports.__assign({open:s,setOpen:c,onClose:function(){c(!1)},positioning:"absolute",overflow:"hidden",width:240},{children:e.jsx(de,{value:h,onChange:function(e){var n=e.toISOString().split("T")[0];o(n),c(!1)},onClose:function(){return c(!1)}})}))]}))};return e.jsxs(tn,{children:[e.jsx(on,{value:c,onChange:d,operators:y}),Qe(c)&&e.jsx(un,{children:e.jsx(I,{value:v,onChange:p,placeholder:"Select date...",autoFocus:!0})}),en(c)&&e.jsxs(un,{children:[e.jsx(I,{value:w,onChange:m,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e.jsx(I,{value:x,onChange:b,placeholder:"To date..."})]}),e.jsx(ln,{onApply:function(){var e={accessor:i.accessor,operator:c};Qe(c)?e.value=v:en(c)&&(e.values=[w,x]),u(e)},onClear:l,canApply:!!nn(c)||(Qe(c)?""!==v.trim():!!en(c)&&""!==w.trim()&&""!==x.trim()),showClear:!!a})]})},pn=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter,l=n.useMemo(function(){return r.enumOptions||[]},[r.enumOptions]),s=n.useMemo(function(){return l.map(function(e){return e.value})},[l]),c=n.useState((null==o?void 0:o.values)?o.values.map(String):s),d=c[0],f=c[1],v=n.useState(""),p=v[0],h=v[1],w=n.useMemo(function(){if(!p)return l;var e=p.toLowerCase();return l.filter(function(n){return n.label.toLowerCase().includes(e)})},[l,p]);n.useEffect(function(){f(o?o.values?o.values.map(String):[]:s)},[o,s]);var m=l.length>10;return e.jsxs(tn,{children:[e.jsx(un,{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(ke,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(an,{type:"text",value:p,onChange:h,placeholder:"Search..."})})),w.map(function(n,t){return e.jsx(ke,exports.__assign({checked:d.includes(n.value),onChange:function(){return e=n.value,void f(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):u(u([],n,!0),[e],!1)});var e}},{children:e.jsx("span",exports.__assign({className:"st-enum-option-label"},{children:n.label}))}),t)}),p&&0===w.length&&e.jsx("div",exports.__assign({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e.jsx(ln,{onApply:function(){d.length!==s.length?i({accessor:r.accessor,operator:"in",values:d}):a()},onClear:a,canApply:0!==d.length&&d.length!==s.length,showClear:!!o})]})},hn=function(n){var t=n.header,r=n.currentFilter,o=n.onApplyFilter,i=n.onClearFilter;return e.jsx(e.Fragment,{children:function(){switch(t.type){case"number":return e.jsx(cn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"boolean":return e.jsx(fn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"date":return e.jsx(vn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});case"enum":return e.jsx(pn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i});default:return e.jsx(sn,{header:t,currentFilter:r,onApplyFilter:o,onClearFilter:i})}}()})},wn=function(t){var r=t.content,o=t.children,i=t.delay,a=void 0===i?500:i,u=n.useState(!1),l=u[0],s=u[1],c=n.useState({top:0,left:0}),d=c[0],f=c[1],v=n.useRef(null),p=n.useRef(null);if(n.useEffect(function(){return function(){v.current&&clearTimeout(v.current)}},[]),!r||!n.isValidElement(o))return e.jsx(e.Fragment,{children:o});var h=n.cloneElement(o,{ref:p,onMouseEnter:function(){v.current=setTimeout(function(){if(p.current&&r.trim()){var e=p.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,t=e.bottom+8;8>n?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),t+40>window.innerHeight-8&&(t=e.top-40-8),f({top:t,left:n}),s(!0)}}},a)},onMouseLeave:function(){v.current&&(clearTimeout(v.current),v.current=null),s(!1)}});return e.jsxs(e.Fragment,{children:[h,l&&e.jsx("div",exports.__assign({className:"st-tooltip",style:{position:"fixed",top:"".concat(d.top,"px"),left:"".concat(d.left,"px"),zIndex:1e4}},{children:r}))]})},mn=function(t){var r,o,i=t.colIndex,a=t.gridColumnEnd,l=t.gridColumnStart,s=t.gridRowEnd,c=t.gridRowStart,d=t.header,p=t.parentHeader,h=t.reverse,m=t.sort,g=n.useState(!1),x=g[0],b=g[1],y=n.useState(!1),I=y[0],C=y[1],R=n.useState(d.label||""),S=R[0],M=R[1],N=j(),H=N.activeHeaderDropdown,E=N.areAllRowsSelected,T=N.autoExpandColumns,k=N.collapsedHeaders,P=N.columnBorders,A=N.columnReordering,D=N.columnResizing,F=N.columnsWithSelectedCells,O=N.draggedHeaderRef,L=N.enableHeaderEditing,W=N.filterIcon,B=N.handleApplyFilter,q=N.handleClearFilter,G=N.handleSelectAll,V=N.headerCollapseIcon,z=N.headerDropdown,K=N.headerExpandIcon,U=N.headerRegistry,_=N.headers,J=N.hoveredHeaderRef,Y=N.onColumnOrderChange,X=N.onColumnSelect,$=N.onHeaderEdit,Z=N.onSort,Q=N.onTableHeaderDragEnd,ee=N.headerHeight,te=N.selectColumns,re=N.selectableColumns,ie=N.selectedColumns,ae=N.setActiveHeaderDropdown,ue=N.setCollapsedHeaders,le=N.setHeaders,se=N.setInitialFocusedCell,de=N.setIsResizing,fe=N.setSelectedCells,ve=N.setSelectedColumns,pe=N.sortDownIcon,he=N.sortUpIcon,we=N.tableBodyContainerRef,me=!!(null==d?void 0:d.isSortable),ge=!!(null==d?void 0:d.filterable),xe=N.filters[d.accessor],be=(null==H?void 0:H.accessor)===d.accessor,ye=d.isSelectionColumn&&N.enableRowSelection,Ce=function(e){var n;return!(!(null===(n=e.children)||void 0===n?void 0:n.length)||!e.collapsible)}(d),Re=k.has(d.accessor),Se=function(e){var t=e.isOpen,r=e.estimatedHeight,o=void 0===r?200:r,i=e.estimatedWidth,a=void 0===i?250:i,u=e.margin,l=void 0===u?4:u,s=n.useRef(null),c=n.useState({}),d=c[0],f=c[1];return n.useEffect(function(){if(t&&s.current){var e=function(){if(s.current){var e=s.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=window.innerWidth-e.right,r="bottom",i={};o>n&&e.top>=o&&(r="top");var u="left";a>t+e.width&&(u="right"),"bottom"===r?i.top=e.bottom+l:i.bottom=window.innerHeight-e.top+l,"left"===u?i.left=e.left:i.right=window.innerWidth-e.right,f(i)}};requestAnimationFrame(e);var n=function(){return requestAnimationFrame(e)},r=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",n),window.addEventListener("scroll",r,!0),function(){window.removeEventListener("resize",n),window.removeEventListener("scroll",r,!0)}}f({})},[t,o,a,l]),{triggerRef:s,position:d}}({isOpen:be,estimatedHeight:200,estimatedWidth:250,margin:4}),Me=Se.triggerRef,Ne=Se.position,He=n.useMemo(function(){var e,n,t;if(!P)return!1;var r=_.filter(function(e){return"left"===e.pinned}),o=_.filter(function(e){return!e.pinned}),i=_.filter(function(e){return"right"===e.pinned});return"left"===d.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===d.accessor:"right"===d.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===d.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===d.accessor},[P,_,d.accessor,d.pinned]),Ee=n.useMemo(function(){return!(!re||ye)&&v(d,i).some(function(e){return ie.has(e)})},[re,ye,d,i,ie]),Pe=n.useMemo(function(){return!ye&&v(d,i).some(function(e){return F.has(e)})},[ye,d,i,F]),Ae=n.useMemo(function(){return!(!d.children||0===d.children.length)&&(!Re||d.children.some(function(e){var n=e.showWhen||f;return"parentCollapsed"===n||"always"===n}))},[d.children,Re]),De=null==p?void 0:p.singleRowChildren,Fe=Ae&&!d.singleRowChildren,Oe="st-header-cell ".concat(d.accessor===(null===(r=J.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(o=O.current)||void 0===o?void 0:o.accessor)===d.accessor?"st-dragging":""," ").concat(me?"clickable":""," ").concat(A&&!me?"columnReordering":""," ").concat(Fe?"parent":""," ").concat(De?"st-sub-header":""," ").concat(He?"st-last-column":""," ").concat(L&&!ye?"st-header-editable":""," ").concat(Ee?"st-header-selected":""," ").concat(Pe&&!Ee?"st-header-has-highlighted-cell":""),Le=Te({draggedHeaderRef:O,headers:_,hoveredHeaderRef:J,onColumnOrderChange:Y,onTableHeaderDragEnd:Q}),We=Le.handleDragStart,Be=Le.handleDragEnd,qe=Le.handleDragOver,Ge=Ie();n.useEffect(function(){if(U&&!d.isSelectionColumn){var e=d.accessor+"";return U.set(e,{setEditing:function(e){C(e)}}),function(){U.delete(e)}}},[U,d.accessor,d.isSelectionColumn]),n.useEffect(function(){M(d.label||"")},[d.label]);var Ve=function(e){b(!x)},ze=n.useCallback(function(e){M(e);var n=_.map(function(n){return n.accessor===d.accessor?exports.__assign(exports.__assign({},n),{label:e}):n});le(n),$&&$(d,e)},[_,le,$,d]),Ke=n.useCallback(function(){ae&&ae(null)},[ae]),je=n.useCallback(function(e){e.stopPropagation(),ue(function(e){var n=new Set(e);return Re?n.delete(d.accessor):n.add(d.accessor),n})},[ue,Re,d.accessor]),_e=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(re){var r=v(t,i),o=r.some(function(e){return ie.has(e)});if(L&&o&&!n.shiftKey)return z&&be&&Ke(),void C(!0);n.shiftKey&&te?ve(function(e){if(0===e.size)return new Set(r);var n=r[0],t=Array.from(e).sort(function(e,n){return e-n}),o=t[0],i=Math.abs(n-o);t.forEach(function(e){var t=Math.abs(n-e);i>t&&(i=t,o=e)});var a,l,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),r,!0);return new Set(u(u([],Array.from(e),!0),c,!0))}):te&&te(r),fe(new Set),se(null)}X&&X(t),!re&&t.isSortable&&Z(t.accessor)}};if(n.useEffect(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!d)return null;var Je=D&&!ye&&e.jsx("div",exports.__assign({className:"st-header-resize-handle-container",role:"separator","aria-label":"Resize ".concat(d.label," column"),"aria-orientation":"vertical",onMouseDown:function(e){var n,t=null===(n=document.getElementById(w({accessor:d.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Ue,callbackProps:{event:e.nativeEvent,header:d,headers:_,setHeaders:le,setIsResizing:de,tableBodyContainerRef:we,startWidth:t,collapsedHeaders:k,autoExpandColumns:T,reverse:h},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(w({accessor:d.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Ue,callbackProps:{event:e,header:d,headers:_,setHeaders:le,setIsResizing:de,tableBodyContainerRef:we,startWidth:t,collapsedHeaders:k,autoExpandColumns:T,reverse:h},limit:10})}},{children:e.jsx("div",{className:"st-header-resize-handle"})})),Ye=m&&m.key.accessor===d.accessor&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:function(e){return _e({event:e,header:d})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||Z(d.accessor)},tabIndex:0,role:"button","aria-label":"Sort ".concat(d.label," ").concat("asc"===m.direction?"descending":"ascending")},{children:["asc"===m.direction&&he&&he,"desc"===m.direction&&pe&&pe]})),Xe=ge&&W&&e.jsxs("div",exports.__assign({className:"st-icon-container",onClick:Ve,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(),Ve()))},tabIndex:0,role:"button","aria-label":"Filter ".concat(d.label),"aria-expanded":x,"aria-haspopup":"dialog"},{children:[n.cloneElement(W,{style:{fill:xe?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e.jsx(ne,exports.__assign({open:x,overflow:"visible",setOpen:b,onClose:function(){return b(!1)}},{children:e.jsx(hn,{header:d,currentFilter:xe,onApplyFilter:function(e){B(e),b(!1)},onClearFilter:function(){q(d.accessor),b(!1)}})}))]})),$e=Ce&&!ye&&e.jsx("div",exports.__assign({className:"st-icon-container st-collapse-icon-container",onClick:function(e){return je(e)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),je(e))},tabIndex:0,role:"button","aria-label":"".concat(Re?"Expand":"Collapse"," ").concat(d.label," column"),"aria-expanded":!Re},{children:Re?V:K})),Ze=e.jsx(wn,exports.__assign({content:d.tooltip||""},{children:e.jsx("span",exports.__assign({className:"st-header-label-text ".concat("right"===d.align?"right-aligned":"center"===d.align?"center-aligned":"left-aligned")},{children:ye?e.jsx(ke,{checked:!!E&&E(),onChange:function(e){G&&G(e)},ariaLabel:"Select all rows"}):I?e.jsx(oe,{defaultValue:S,onBlur:function(){return C(!1)},onChange:ze}):S||(null==d?void 0:d.label)}))})),Qe="header-desc-".concat(d.accessor),en=function(e,n){var t=[];return e.type&&"other"!==e.type&&t.push("".concat(e.type," column")),e.isSortable&&t.push("sortable"),n&&t.push("filterable"),e.tooltip&&t.push(e.tooltip),t.join(", ")}(d,ge);return e.jsxs(ce,exports.__assign({className:Oe,id:w({accessor:d.accessor,rowId:"header"}),"aria-sort":function(){if(d.isSortable)return(null==m?void 0:m.key.accessor)===d.accessor?"asc"===m.direction?"ascending":"descending":"none"}(),"aria-colindex":i+1,"aria-describedby":en?Qe:void 0,onDragOver:function(e){ye||Ge({callback:qe,callbackProps:{event:e,hoveredHeader:d},limit:50})},style:exports.__assign({gridRowStart:c,gridRowEnd:s,gridColumnStart:l,gridColumnEnd:a},s-c>1?{}:{height:ee})},{children:[h&&Je,!d.headerRenderer&&"right"===d.align&&$e,!d.headerRenderer&&"right"===d.align&&Xe,!d.headerRenderer&&"right"===d.align&&Ye,e.jsx("div",exports.__assign({ref:Me,className:"st-header-label",draggable:A&&!d.disableReorder&&!ye,onClick:function(e){ye||_e({event:e,header:d})},onDoubleClick:function(e){ye||function(e){var n=e.header;n.isSelectionColumn||re&&n.isSortable&&Z(n.accessor)}({event:e,header:d})},onDragEnd:ye?void 0:function(e){e.preventDefault(),Be()},onDragStart:ye?void 0:function(e){A&&d&&function(e){We(e)}(d)}},{children:d.headerRenderer?d.headerRenderer({accessor:d.accessor,colIndex:i,header:d,components:{sortIcon:Ye||void 0,filterIcon:Xe||void 0,collapseIcon:$e||void 0,labelContent:Ze}}):Ze})),!d.headerRenderer&&"right"!==d.align&&Ye,!d.headerRenderer&&"right"!==d.align&&Xe,!d.headerRenderer&&"right"!==d.align&&$e,!h&&Je,z&&!ye&&e.jsx("div",exports.__assign({className:"st-header-dropdown-container"},{children:z({accessor:d.accessor,colIndex:i,header:d,isOpen:be,onClose:Ke,position:Ne})})),en&&e.jsx("span",exports.__assign({id:Qe,className:"st-sr-only"},{children:en}))]}))},gn=function(t){var r=t.columnIndices,o=t.gridTemplateColumns,i=t.handleScroll,a=t.headers,u=t.maxDepth,l=t.pinned,s=t.sectionRef,c=t.sort,d=t.width,f=j().collapsedHeaders,v=n.useMemo(function(){var e=[],n=1,t=function(o,i,s,c){var d,v;if(void 0===s&&(s=!1),!m({header:o,pinned:l,headers:a,collapsedHeaders:f}))return 0;s||n++;var p,h,w=null!==(v=null===(d=o.children)||void 0===d?void 0:d.filter(function(e){return m({header:e,pinned:l,headers:a,collapsedHeaders:f})}).length)&&void 0!==v?v:0,g=n;if(o.singleRowChildren&&w>0?(p=g+1,h=u+1):w>0?(p=g+w,h=i+1):(p=g+1,h=u+1),e.push({header:o,gridColumnStart:g,gridColumnEnd:p,gridRowStart:i,gridRowEnd:h,colIndex:r[o.accessor],parentHeader:c}),o.children&&o.children.length>0){var x=o.singleRowChildren?i:i+1,b=!o.singleRowChildren;o.children.forEach(function(e){m({header:e,pinned:l,headers:a,collapsedHeaders:f})&&(t(e,x,b,o),b=!1)})}return p-g},o=a.filter(function(e){return m({header:e,pinned:l,headers:a,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[a,u,l,r,f]);return e.jsx(Ge,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(mn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,parentHeader:n.parentHeader,reverse:"right"===l,sort:c},n.header.accessor)})})}))}))},xn=function(t){var r=t.centerHeaderRef,o=t.headers,i=t.mainTemplateColumns,a=t.pinnedLeftColumns,u=t.pinnedLeftTemplateColumns,l=t.pinnedRightColumns,s=t.pinnedRightTemplateColumns,c=t.sort,d=t.pinnedLeftWidth,f=t.pinnedRightWidth,v=j(),p=v.headerContainerRef,h=v.pinnedLeftRef,w=v.pinnedRightRef,m=v.collapsedHeaders,g=v.tableRows,x=v.maxHeaderDepth,b=n.useMemo(function(){return ze({headers:o,pinnedLeftColumns:a,pinnedRightColumns:l,collapsedHeaders:m})},[o,a,l,m]),y=n.useMemo(function(){return Object.keys(b).length},[b]);return e.jsxs("div",exports.__assign({className:"st-header-container",ref:p,"aria-rowcount":g.length+x,"aria-colcount":y},{children:[Se(o,"left")&&e.jsx(gn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:x,pinned:"left",sectionRef:h,sort:c,width:d}),e.jsx(gn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:x,sectionRef:r,sort:c}),Se(o,"right")&&e.jsx(gn,{columnIndices:b,gridTemplateColumns:s,handleScroll:void 0,headers:o,maxDepth:x,pinned:"right",sectionRef:w,sort:c,width:f})]}))},bn=function(e){var n=e.collapsedHeaders,t=e.autoExpandColumns,r=function(e){var t=e.flattenedHeaders;return e.headers.forEach(function(e){if(!e.hide&&!e.excludeFromRender)if(e.children&&e.children.length>0)if(n&&n.has(e.accessor)){var o=e.children.filter(function(e){var n=e.showWhen||f;return"parentCollapsed"===n||"always"===n});e.singleRowChildren&&t.push(e),o.length>0?r({headers:o,flattenedHeaders:t}):e.singleRowChildren||t.push(e)}else{var i=e.children.filter(function(e){var n=e.showWhen||f;return"parentExpanded"===n||"always"===n});e.singleRowChildren&&t.push(e),r({headers:i,flattenedHeaders:t})}else t.push(e)}),t},o=r({headers:e.headers,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e,n){var t=e.minWidth,r=e.width;return"number"==typeof r&&(r="".concat(r,"px")),t&&"number"==typeof t&&(t="".concat(t,"px")),void 0===t||n?r:"string"==typeof r&&r.endsWith("fr")?"minmax(".concat(t,", ").concat(r,")"):"max(".concat(t,", ").concat(r,")")}(e,t)}).join(" "))},yn=function(t){var r=t.calculatedHeaderHeight,o=t.hideHeader,i=t.pinnedLeftWidth,a=t.pinnedRightWidth,u=t.setScrollTop,l=t.setScrollDirection,s=t.shouldShowEmptyState,c=t.sort,d=t.tableRows,f=t.rowsToRender,v=t.stickyParents,p=t.regularRows,h=t.partiallyVisibleRows,w=t.heightMap,m=j(),g=m.columnResizing,x=m.editColumns,b=m.headers,y=m.collapsedHeaders,I=m.autoExpandColumns,C=n.useRef(null),R=b.filter(function(e){return!e.pinned}),S=b.filter(function(e){return"left"===e.pinned}),M=b.filter(function(e){return"right"===e.pinned}),N=n.useMemo(function(){return bn({headers:S,collapsedHeaders:y,autoExpandColumns:I})},[S,y,I]),H=n.useMemo(function(){return bn({headers:R,collapsedHeaders:y,autoExpandColumns:I})},[R,y,I]),E=n.useMemo(function(){return bn({headers:M,collapsedHeaders:y,autoExpandColumns:I})},[M,y,I]),T={centerHeaderRef:C,headers:b,mainTemplateColumns:H,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedRightColumns:M,pinnedRightTemplateColumns:E,sort:c,pinnedLeftWidth:i,pinnedRightWidth:a},k={calculatedHeaderHeight:r,mainTemplateColumns:H,pinnedLeftColumns:S,pinnedLeftTemplateColumns:N,pinnedLeftWidth:i,pinnedRightColumns:M,pinnedRightTemplateColumns:E,pinnedRightWidth:a,rowsToRender:f,stickyParents:v,regularRows:p,partiallyVisibleRows:h,heightMap:w,setScrollDirection:l,setScrollTop:u,shouldShowEmptyState:s,tableRows:d};return e.jsxs("div",exports.__assign({className:"st-content ".concat(g?"st-resizeable":"st-not-resizeable"),style:{width:x?"calc(100% - 29.5px)":"100%"}},{children:[!o&&e.jsx(xn,exports.__assign({},T)),e.jsx(je,exports.__assign({},k))]}))},In=function(t){var r=t.mainBodyWidth,o=t.mainBodyRef,i=t.pinnedLeftWidth,a=t.pinnedRightWidth,u=t.pinnedLeftContentWidth,l=t.pinnedRightContentWidth,c=t.tableBodyContainerRef,d=j().editColumns,f=n.useState(!1),v=f[0],p=f[1],h=n.useRef(null),w=n.useRef(null),m=n.useRef(null),g=d?s:0,x=(d?a+1:a)+(c.current&&c.current&&c.current.scrollHeight>c.current.clientHeight?c.current.offsetWidth-c.current.clientWidth:0);return n.useEffect(function(){setTimeout(function(){o.current&&p(o.current.scrollWidth-o.current.clientWidth>1)},1)},[o,r]),v?e.jsxs("div",exports.__assign({className:"st-horizontal-scrollbar-container"},{children:[i>0&&e.jsx(Ge,exports.__assign({childRef:w,group:"pinned-left"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-left",ref:w,style:{width:i}},{children:e.jsx("div",{style:{width:u}})}))})),r>0&&e.jsx(Ge,exports.__assign({childRef:h},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-middle",ref:h},{children:e.jsx("div",{style:{width:r}})}))})),a>0&&e.jsx(Ge,exports.__assign({childRef:m,group:"pinned-right"},{children:e.jsx("div",exports.__assign({className:"st-horizontal-scrollbar-right",ref:m,style:{width:x}},{children:e.jsx("div",{style:{width:l}})}))})),g>0&&e.jsx("div",{style:{width:g-1.5,height:"100%",flexShrink:0}})]})):null},Cn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"asc"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"asc"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"asc"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"asc"===t?i:-i},enum:function(e,n,t){return Cn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"asc"===t?-1:1:null==n?"asc"===t?1:-1:"string"==typeof e&&"string"==typeof n?Cn.string(e,n,t):"number"==typeof e&&"number"==typeof n?Cn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?Cn.boolean(e,n,t):Cn.string(e+"",n+"",t)}},Rn=function(e){return function(e){var n=e.rows,t=e.sortColumn,r=function(e,n){for(var t=0,o=e;o.length>t;t++){var i=o[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=r(i.children,n);if(a)return a}}},o=r(e.headers,t.key.accessor),i=(null==o?void 0:o.type)||"string",a=t.direction,l=t.key.accessor;return u([],n,!0).sort(function(e,t){var r,u;if(null==o?void 0:o.valueGetter){var s=n.indexOf(e),c=n.indexOf(t);r=o.valueGetter({accessor:l,row:e,rowIndex:s}),u=o.valueGetter({accessor:l,row:t,rowIndex:c})}else r=M(e,l),u=M(t,l);return(null==o?void 0:o.comparator)?o.comparator({rowA:e,rowB:t,valueA:r,valueB:u,direction:a}):function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"asc"===r?-1:1;if(null==n||""===n)return"asc"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=e+"";if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return Cn.number(i,a,r)}return"date"===t?Cn.date(e+"",n+"",r):"boolean"===t?Cn.boolean(!!e,!!n,r):"enum"===t?Cn.enum(e+"",n+"",r):Cn.string(e+"",n+"",r)}(r,u,i,a)})}({rows:e.rows,sortColumn:e.sortColumn,headers:e.headers})},Sn=function(e){return n.useMemo(function(){var n=p(e),t=new Map;return n.forEach(function(e){t.set(e.accessor,e)}),t},[e])},Mn=function(e){var n=e.tableRows,t=e.sortColumn,r=e.rowGrouping,o=e.headers;return e.externalSortHandling?n:t?r&&r.length>0?(0,e.sortNestedRows)({groupingKeys:r,headers:o,rows:n,sortColumn:t}):Rn({headers:o,rows:n,sortColumn:t}):n},Nn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;o.length>r;r++){var i=o[r];if(!t.has(i.accessor)&&(t.add(i.accessor),i.children&&i.children.length>0)){var a=i.children.some(function(e){return e.accessor===n}),u=!1;if(!a)for(var l=0,s=i.children;s.length>l;l++){var c=s[l];if(Nn([c],n,t),!1===c.hide){u=!0;break}}(a||u)&&(i.hide=!1)}}},Hn=function(e){return e.every(function(e){return e.hide})},En=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(En(e.children),Hn(e.children)&&(e.hide=!0))})},Tn=function(t){var r=t.allHeaders,o=t.depth,i=void 0===o?0:o,a=t.doesAnyHeaderHaveChildren,l=t.header,s=t.isCheckedOverride,c=n.useState(!0),d=c[0],f=c[1],v=j(),p=v.expandIcon,h=v.headers,w=v.setHeaders,m=v.onColumnVisibilityChange,g=a?"".concat(16*i,"px"):"8px",x=l.children&&l.children.length>0,b=null!=s?s:!(l.hide||x&&l.children&&Hn(l.children));return e.jsxs(e.Fragment,{children:[e.jsxs("div",exports.__assign({className:"st-header-checkbox-item",style:{paddingLeft:g}},{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:p})):null})),e.jsx(ke,exports.__assign({checked:b,onChange:function(e){l.hide=!e,e?(Nn(r,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,Nn(r,l.children[0].accessor))):En(r);var n=u([],h,!0);if(w(n),m){var t=function(e){var n={},t=function(e){n[e.accessor]=!e.hide,e.children&&e.children.length>0&&e.children.forEach(t)};return e.forEach(t),n}(n);m(t)}}},{children:l.label}))]})),x&&d&&l.children&&e.jsx("div",exports.__assign({className:"st-nested-headers"},{children:l.children.map(function(n,t){return e.jsx(Tn,{allHeaders:r,depth:i+1,doesAnyHeaderHaveChildren:a,header:n,isCheckedOverride:!!b&&void 0},"".concat(n.accessor,"-").concat(t))})}))]})},kn=function(t){var r=t.headers,o=t.open,i="left"===t.position?"left":"",a=n.useMemo(function(){return r.some(function(e){return e.children&&e.children.length>0})},[r]);return e.jsx("div",exports.__assign({className:"st-column-editor-popout ".concat(o?"open":""," ").concat(i),onClick:function(e){return e.stopPropagation()}},{children:e.jsx("div",exports.__assign({className:"st-column-editor-popout-content"},{children:r.map(function(n,t){return n.isSelectionColumn||n.excludeFromRender?null:e.jsx(Tn,{doesAnyHeaderHaveChildren:a,header:n,allHeaders:r},"".concat(n.accessor,"-").concat(t))})}))}))},Pn=function(n){var t=n.columnEditorText,r=n.headers,o=n.open,i=n.position,a=void 0===i?"right":i,u=n.setOpen;return n.editColumns?e.jsxs("div",exports.__assign({className:"st-column-editor ".concat(o?"open":""," ").concat(a),onClick:function(){u(!o)},style:{width:s}},{children:[e.jsx("div",exports.__assign({className:"st-column-editor-text"},{children:t})),e.jsx(kn,{headers:r,open:o,position:a})]})):null},An=function(t){var o=t.children,i=n.useRef({}),a=n.useCallback(function(e,n){return!!i.current[n]&&i.current[n].find(function(n){return n===e})},[]),u=n.useCallback(function(e,n){e.scrollWidth-e.clientWidth>0&&(n.scrollLeft=e.scrollLeft)},[]),l=n.useCallback(function(e){e.onscroll=null},[]),s=n.useCallback(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=i.current[n])||void 0===t||t.forEach(function(n){e!==n&&(l(n),u(e,n),window.requestAnimationFrame(function(){var e=Object.keys(i.current).filter(function(e){return i.current[e].includes(n)});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 t=i.current[n].indexOf(e);-1!==t&&i.current[n].splice(t,1)}})},[a,l]);return e.jsx(qe.Provider,exports.__assign({value:{registerPane:c,unregisterPane:d}},{children:r.default.Children.only(o)}))},Dn=function(e){var n=e.tableRows,t=e.filterState;return e.externalFilterHandling?n:t&&0!==Object.keys(t).length?n.filter(function(e){return Object.values(t).every(function(n){try{return function(e,n){var t=n.operator,r=n.value,o=n.values;if(null==e)return"isEmpty"===t;if("isEmpty"===t)return!e||""===(e+"").trim();if("isNotEmpty"===t)return e&&""!==(e+"").trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=(e+"").toLowerCase(),a=r?(r+"").toLowerCase():"";switch(t){case"equals":return i===a;case"notEquals":return i!==a;case"contains":return i.includes(a);case"notContains":return!i.includes(a);case"startsWith":return i.startsWith(a);case"endsWith":return i.endsWith(a)}}if("number"==typeof e||!isNaN(+e)){var u=+e,l=+r;switch(t){case"equals":return u===l;case"notEquals":return u!==l;case"greaterThan":return u>l;case"lessThan":return l>u;case"greaterThanOrEqual":return u>=l;case"lessThanOrEqual":return l>=u;case"between":if(o&&2===o.length){var 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=we(e),v=we((r||"")+""),p=he(f),h=he(v);switch(t){case"equals":return p.getTime()===h.getTime();case"notEquals":return p.getTime()!==h.getTime();case"before":return h>p;case"after":return p>h;case"between":if(o&&2===o.length){var w=o.map(function(e){return he(we((e||"")+""))}),m=w[1];return p>=w[0]&&m>=p}return!1;case"notBetween":if(o&&2===o.length){var g=o.map(function(e){return he(we((e||"")+""))});return m=g[1],g[0]>p||p>m}return!0}}if("boolean"==typeof e&&"equals"===t)return e===!!r;if(Array.isArray(e)){var x=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):e+""}).join(", ");e=x}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var b=o.includes(e+"");return"in"===t?b:!b}return!1}var y=(e+"").toLowerCase(),I=r?(r+"").toLowerCase():"";switch(t){case"equals":return y===I;case"notEquals":return y!==I;default:return!0}}(M(e,n.accessor),n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):n},Fn=function(e){var n,t=document.querySelector(".simple-table-root");if("string"==typeof e){if(e.endsWith("px"))return parseInt(e,10);if(e.endsWith("vh"))return window.innerHeight*parseInt(e,10)/100;if(e.endsWith("%")){var r=null===(n=null==t?void 0:t.parentElement)||void 0===n?void 0:n.clientHeight;return!r||50>r?0:r*parseInt(e,10)/100}return window.innerHeight}return e},On=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;if(r&&t&&H(t))i(t);else{var a=M(e,n);null!=a&&o.push(a)}})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,u=t.parseValue?o.map(t.parseValue).filter(function(e){return!isNaN(e)}):o.map(function(e){return"number"==typeof e?e:"string"==typeof e?parseFloat(e):NaN}).filter(function(e){return!isNaN(e)});if(0===u.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=u.reduce(function(e,n){return e+n},0);break;case"average":a=u.reduce(function(e,n){return e+n},0)/u.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,u);break;case"max":a=Math.max.apply(Math,u);break;default:return}return t.formatResult?t.formatResult(a):a}},Ln=function(e){if(null==e)return"";var n=e+"";if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},Wn=function(e){return function(){for(var n=[],t=0;arguments.length>t;t++)n[t]=arguments[t];return new Promise(function(t){e.apply(void 0,n),setTimeout(function(){return t()},0)})}},Bn=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},qn={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}},Gn=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")},Vn=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.style.transition="transform ".concat(n.duration,"ms ").concat(n.easing),n.delay&&(e.style.transitionDelay="".concat(n.delay,"ms")),e.style.transform="translate3d(0, 0, 0)";var o=function(){Gn(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},zn=function(e){var t=e.rows,r=e.rowGrouping,o=void 0===r?[]:r,i=e.getRowId,a=e.expandedRows,l=e.collapsedRows,s=e.expandedDepths,c=e.rowStateMap,d=e.hasLoadingRenderer,f=e.hasErrorRenderer,v=e.hasEmptyRenderer,p=e.headers,h=e.rowHeight,w=e.headerHeight,m=e.customTheme;return n.useMemo(function(){if(!o||0===o.length){var e=t.map(function(e,n){var t=[n],r=[n];return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,rowId:E({row:e,getRowId:i,depth:0,index:n,rowPath:t,rowIndexPath:r,groupingKey:void 0}),rowPath:t,rowIndexPath:r,absoluteRowIndex:n,isLastGroupRow:!0}});return{flattenedRows:e,heightOffsets:[],paginatableRows:e,parentEndPositions:t.map(function(e,n){return n+1})}}var n=[],r=[],g=[],x=[],b=0,y=function(e,t,I,C,S){void 0===I&&(I=[]),void 0===C&&(C=[]),void 0===S&&(S=[]),e.forEach(function(e,M){var N,H,A=o[t],D=n.length,F=u(u([],I,!0),[M],!1),O=u(u([],C,!0),[M],!1),L=E({row:e,getRowId:i,depth:t,index:M,rowPath:F,rowIndexPath:O,groupingKey:A}),W=n.length,B={row:e,depth:t,displayPosition:b,groupingKey:A,position:D,isLastGroupRow:0===t,rowId:L,rowPath:F,rowIndexPath:O,absoluteRowIndex:D,parentIndices:S.length>0?u([],S,!0):void 0};n.push(B),r.push(B),b++;var q=T(L);if(P(q,t,s,a,l)&&o.length>t){var G=null==c?void 0:c.get(q),V=k(e,A),z=p.find(function(e){return e.expandable&&e.nestedTable});if((null==z?void 0:z.nestedTable)&&V.length>0){var K=n.length,j=(null===(N=z.nestedTable.customTheme)||void 0===N?void 0:N.rowHeight)||h,U=(null===(H=z.nestedTable.customTheme)||void 0===H?void 0:H.headerHeight)||w,_=R({childRowCount:V.length,rowHeight:j,headerHeight:U,customTheme:m});g.push([K,_-h]);var J=u(u([],F,!0),[A],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:A,position:K,isLastGroupRow:!1,rowId:J,rowPath:J,rowIndexPath:O,nestedTable:{parentRow:e,expandableHeader:z,childAccessor:A,calculatedHeight:_},absoluteRowIndex:K})}else if(G&&(G.loading||G.error||G.isEmpty)){if(G.loading&&d||G.error&&f||G.isEmpty&&v){var Y=n.length,X=u(u([],F,!0),[A],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:A,position:Y,isLastGroupRow:!1,rowId:X,rowPath:X,rowIndexPath:O,stateIndicator:{parentRowId:q,state:G},absoluteRowIndex:Y,parentIndices:u(u([],S,!0),[W],!1)})}else if(G.loading&&!d){var $=n.length,Z=u(u([],F,!0),[A,"loading-skeleton"],!1);n.push({row:{},depth:t+1,displayPosition:b-1,groupingKey:A,position:$,isLastGroupRow:!1,rowId:Z,rowPath:Z,rowIndexPath:O,isLoadingSkeleton:!0,absoluteRowIndex:$,parentIndices:u(u([],S,!0),[W],!1)})}}else if(V.length>0){var Q=u(u([],F,!0),[A],!1),ee=u([],O,!0);y(V,t+1,Q,ee,u(u([],S,!0),[W],!1))}}0===t&&x.push(n.length)})};return y(t,0,[],[],[]),{flattenedRows:n,heightOffsets:g,paginatableRows:r,parentEndPositions:x}},[t,o,i,a,l,s,c,d,f,v,p,h,w,m])},Kn=function(){return e.jsx("div",exports.__assign({className:"st-empty-state"},{children:"No rows to display"}))},jn={rowHeight:32,headerHeight:32,footerHeight:49,rowSeparatorWidth:1,borderWidth:1,pinnedBorderWidth:1,nestedGridBorderWidth:2,nestedGridPaddingTop:8,nestedGridPaddingBottom:8,nestedGridPaddingLeft:8,nestedGridPaddingRight:8,nestedGridMaxHeight:400,selectionColumnWidth:42},Un=function(t){var r=n.useState(!1),o=r[0],i=r[1];return n.useEffect(function(){i(!0)},[]),o?e.jsx(_n,exports.__assign({},t)):null},_n=function(t){var r=t.allowAnimations,o=void 0!==r&&r,s=t.autoExpandColumns,c=void 0!==s&&s,f=t.canExpandRowGroup,v=t.cellUpdateFlash,h=void 0!==v&&v,w=t.className,m=t.columnBorders,b=void 0!==m&&m,y=t.columnEditorPosition,I=void 0===y?"right":y,C=t.columnEditorText,R=void 0===C?"Columns":C,S=t.columnReordering,k=void 0!==S&&S,P=t.columnResizing,D=void 0!==P&&P,F=t.copyHeadersToClipboard,L=void 0!==F&&F,W=t.customTheme,q=t.defaultHeaders,z=t.editColumns,j=void 0!==z&&z,X=t.editColumnsInitOpen,Q=void 0!==X&&X,ne=t.emptyStateRenderer,te=t.enableHeaderEditing,re=void 0!==te&&te,oe=t.enableRowSelection,ie=void 0!==oe&&oe,ae=t.enableStickyParents,ue=void 0!==ae&&ae,le=t.errorStateRenderer,se=t.expandAll,ce=void 0===se||se,de=t.expandIcon,fe=void 0===de?e.jsx(J,{className:"st-expand-icon"}):de,ve=t.externalFilterHandling,pe=void 0!==ve&&ve,he=t.externalSortHandling,we=void 0!==he&&he,me=t.filterIcon,ge=void 0===me?e.jsx(Z,{className:"st-header-icon"}):me,xe=t.footerRenderer,be=t.headerCollapseIcon,ye=void 0===be?e.jsx(J,{className:"st-header-icon"}):be,Ie=t.headerDropdown,Re=t.headerExpandIcon,Se=void 0===Re?e.jsx(_,{className:"st-header-icon"}):Re,Me=t.height,Ne=t.hideFooter,He=void 0!==Ne&&Ne,Ee=t.hideHeader,Te=void 0!==Ee&&Ee,ke=t.includeHeadersInCSVExport,Pe=void 0===ke||ke,Ae=t.initialSortColumn,De=t.initialSortDirection,Fe=void 0===De?"asc":De,Oe=t.isLoading,Le=void 0!==Oe&&Oe,We=t.loadingStateRenderer,Be=t.maxHeight,qe=t.nextIcon,Ge=void 0===qe?e.jsx(J,{className:"st-next-prev-icon"}):qe,Ve=t.onCellClick,ze=t.onCellEdit,Ke=t.onColumnOrderChange,je=t.onColumnSelect,Ue=t.onColumnVisibilityChange,_e=t.onFilterChange,Ye=t.onGridReady,Xe=t.onHeaderEdit,$e=t.onLoadMore,Ze=t.onNextPage,Qe=t.onPageChange,en=t.onRowGroupExpand,nn=t.onRowSelectionChange,tn=t.onSortChange,rn=t.prevIcon,on=void 0===rn?e.jsx(_,{className:"st-next-prev-icon"}):rn,an=t.rowButtons,un=t.rowGrouping,ln=t.getRowId,sn=t.rows,cn=t.rowsPerPage,dn=void 0===cn?10:cn,fn=t.selectableCells,vn=void 0!==fn&&fn,pn=t.selectableColumns,hn=void 0!==pn&&pn,wn=t.serverSidePagination,mn=void 0!==wn&&wn,gn=t.shouldPaginate,xn=void 0!==gn&&gn,bn=t.sortDownIcon,Cn=void 0===bn?e.jsx($,{className:"st-header-icon"}):bn,Nn=t.sortUpIcon,Hn=void 0===Nn?e.jsx(Y,{className:"st-header-icon"}):Nn,En=t.tableEmptyStateRenderer,Tn=void 0===En?e.jsx(Kn,{}):En,kn=t.tableRef,Bn=t.theme,Gn=void 0===Bn?"light":Bn,Vn=t.totalRowCount,Un=t.useHoverRowBackground,_n=void 0===Un||Un,Jn=t.useOddColumnBackground,Yn=void 0!==Jn&&Jn,Xn=t.useOddEvenRowBackground,$n=void 0!==Xn&&Xn,Zn=n.useMemo(function(){return exports.__assign(exports.__assign({},jn),W)},[W]),Qn=Zn.rowHeight,et=Zn.headerHeight,nt=Zn.footerHeight,tt=Zn.selectionColumnWidth;Yn&&($n=!1),b&&(_n=!1);var rt=n.useRef(null),ot=n.useRef(null),it=n.useRef(null),at=n.useRef(null),ut=n.useRef(null),lt=n.useRef(null),st=n.useRef(null),ct=n.useReducer(function(e){return e+1},0)[1],dt=n.useState(new Map),ft=dt[0],vt=dt[1],pt=n.useState(sn),ht=pt[0],wt=pt[1],mt=n.useState(Le),gt=mt[0],xt=mt[1],bt=n.useRef(Le),yt=n.useRef(new Map);n.useEffect(function(){wt(sn);var e=new Map;sn.forEach(function(n,t){var r=E({row:n,getRowId:ln,depth:0,index:t,rowPath:[t],rowIndexPath:[t]}),o=T(r);e.set(o,t)}),yt.current=e},[sn,ln]),n.useEffect(function(){var e=bt.current,n=Le;n&&!e?xt(!0):!n&&e&&setTimeout(function(){xt(!1)},0),bt.current=Le},[Le]);var It,Ct,Rt,St,Mt,Nt,Ht,Et,Tt,kt,Pt=function(e){var t=e.tableBodyContainerRef,r=n.useState(0),o=r[0],i=r[1];return n.useLayoutEffect(function(){t.current&&i(t.current.offsetWidth-t.current.clientWidth)},[t]),{setScrollbarWidth:i,scrollbarWidth:o,tableBodyContainerRef:t}}({tableBodyContainerRef:lt}),At=Pt.scrollbarWidth,Dt=Pt.setScrollbarWidth,Ft=ee({headerContainerRef:st,mainSectionRef:lt,scrollbarWidth:At}).isMainSectionScrollable,Ot=n.useMemo(function(){if(gt&&0===ht.length){var e=xn?dn:10;return Ft&&(e+=1),Array.from({length:e},function(e,n){return{}})}return ht},[gt,ht,dn,Ft,xn]),Lt=n.useState(1),Wt=Lt[0],Bt=Lt[1],qt=n.useState(q),Gt=qt[0],Vt=qt[1],zt=n.useState(!1),Kt=zt[0],jt=zt[1],Ut=n.useState(!1),_t=Ut[0],Jt=Ut[1],Yt=n.useState(null),Xt=Yt[0],$t=Yt[1],Zt=n.useState(Q),Qt=Zt[0],er=Zt[1],nr=n.useCallback(function(){var e=new Set,n=function(t){t.forEach(function(t){t.collapseDefault&&t.collapsible&&e.add(t.accessor),t.children&&n(t.children)})};return n(q),e},[q]),tr=n.useState(nr),rr=tr[0],or=tr[1];n.useEffect(function(){Vt(q)},[q]);var ir=n.useMemo(function(){var e,n=u([],Gt,!0);return ie&&!(null===(e=null==Gt?void 0:Gt[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=u([{accessor:"__row_selection__",label:"",width:tt,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0)),n},[ie,Gt,tt]),ar=n.useState(0),ur=ar[0],lr=ar[1],sr=n.useState("none"),cr=sr[0],dr=sr[1],fr=function(e,t){var r=n.useState(function(){return function(e,n){if(!n||0===n.length)return new Set;if(e){var t=Array.from({length:n.length},function(e,n){return n});return new Set(t)}return new Set}(e,t)}),o=r[0],i=r[1];return n.useEffect(function(){i(t&&0!==t.length?function(e){var n=t.length,r=Array.from(e).filter(function(e){return n>e});return new Set(r)}:new Set)},[t]),{expandedDepths:o,setExpandedDepths:i}}(ce,un),vr=fr.expandedDepths,pr=fr.setExpandedDepths,hr=n.useState(new Map),wr=hr[0],mr=hr[1],gr=n.useState(new Map),xr=gr[0],br=gr[1],yr=function(){var e=n.useState(""),t=e[0],r=e[1],o=n.useRef(null);return n.useEffect(function(){return t&&(o.current&&clearTimeout(o.current),o.current=setTimeout(function(){r("")},1e3)),function(){o.current&&clearTimeout(o.current)}},[t]),{announcement:t,announce:function(e){r(e)}}}(),Ir=yr.announcement,Cr=yr.announce,Rr=function(e){var t=e.effectiveHeaders,r=e.headerHeight,o=e.rowHeight,i=e.tableBodyContainerRef,a=n.useState(0),u=a[0],l=a[1],s=n.useCallback(function(e){var n,t;return e.singleRowChildren&&(null===(n=e.children)||void 0===n?void 0:n.length)?1:(null===(t=e.children)||void 0===t?void 0:t.length)?1+Math.max.apply(Math,e.children.map(s)):1},[]),c=n.useMemo(function(){var e=0;return t.forEach(function(n){var t=s(n);e=Math.max(e,t)}),e},[t,s]),d=n.useMemo(function(){var e=1;if("undefined"!=typeof window){var n=document.documentElement,t=getComputedStyle(n).getPropertyValue("--st-border-width").trim();if(t){var i=parseFloat(t);isNaN(i)||(e=i)}}return c*(null!=r?r:o)+e},[c,r,o]);return n.useLayoutEffect(function(){var e=function(){i.current&&l(i.current.clientWidth)};e();var n=null;return i.current&&(n=new ResizeObserver(e)).observe(i.current),function(){n&&n.disconnect()}},[i]),{containerWidth:u,calculatedHeaderHeight:d,maxHeaderDepth:c}}({effectiveHeaders:ir,headerHeight:et,rowHeight:Qn,tableBodyContainerRef:lt}),Sr=Rr.containerWidth,Mr=Rr.calculatedHeaderHeight,Nr=Rr.maxHeaderDepth,Hr=n.useRef(0),Er=n.useRef(0),Tr=n.useMemo(function(){var e=d(window.innerWidth),n=Je({headers:ir,containerWidth:Sr,maxPinnedWidthPercent:e,collapsedHeaders:rr});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[ir,Sr,rr]),kr=Tr.mainBodyWidth,Pr=Tr.pinnedLeftWidth,Ar=Tr.pinnedRightWidth,Dr=Tr.pinnedLeftContentWidth,Fr=Tr.pinnedRightContentWidth;n.useEffect(function(){if(c&&0!==Sr&&!Kt){var e,n=function(e){var t=[];return e.forEach(function(e){e.hide||(e.children&&e.children.length>0?t.push.apply(t,n(e.children)):t.push(e))}),t};if((e=it.current?it.current.clientWidth:Math.max(0,Sr-Pr-Ar))>0){var t=Gt.filter(function(e){return!e.pinned});n(t).length===Er.current&&10>Math.abs(e-Hr.current)||Vt(function(t){var r=t.filter(function(e){return!e.pinned}),o=n(r),i=o.reduce(function(e,n){return e+("number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150)},0);if(0===i)return t;var a=e/i;if(.01>Math.abs(a-1))return t;Hr.current=e,Er.current=o.length;var u=new Map,l=0;o.forEach(function(n,t){if(!n.pinned){var r,i="number"==typeof n.width?n.width:"string"==typeof n.width&&n.width.endsWith("px")?parseFloat(n.width):150;t===o.length-1?r=e-l:l+=r=Math.round(i*a),u.set(n.accessor,r)}});var s=function(e){var n;if(e.hide)return e;var t=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:t});var r=u.get(e.accessor);if(void 0!==r)return exports.__assign(exports.__assign({},e),{width:r,children:t});var o="number"==typeof e.width?e.width:"string"==typeof e.width&&e.width.endsWith("px")?parseFloat(e.width):150;return exports.__assign(exports.__assign({},e),{width:Math.round(o*a),children:t})}return exports.__assign(exports.__assign({},e),{children:t})};return t.map(s)})}}},[c,Sr,Kt,Gt,Pr,Ar]);var Or=function(e){var t=e.rows,r=e.headers,o=e.rowGrouping;return n.useMemo(function(){if(!o||0===o.length)return t;var e=function(e){return p(e).filter(function(e){return e.aggregation})}(r);if(0===e.length)return t;var n=JSON.parse(JSON.stringify(t)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var r=o[t],a=o[t+1],u=n[r];if(u&&H(u)){var l=i(u,t+1),s=exports.__assign({},n);return s[r]=l,e.forEach(function(e){var n=On(l,e.accessor,e.aggregation,a);void 0!==n&&N(s,e.accessor,n)}),s}return n})};return i(n)},[t,r,o])}({rows:Ot,headers:Gt,rowGrouping:un}),Lr=function(e){var t=e.rows,r=e.headers,o=e.externalFilterHandling,i=e.onFilterChange,a=e.announce,u=n.useState({}),l=u[0],s=u[1],c=Sn(r),d=n.useMemo(function(){return Dn({externalFilterHandling:o,tableRows:t,filterState:l})},[t,l,o]),f=n.useCallback(function(e){var n,t=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));if(s(t),null==i||i(t),a){var r=c.get(e.accessor);r&&a("Filter applied to ".concat(r.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 t=c.get(e);t&&a("Filter removed from ".concat(t.label))}},[l,i,a,c]),p=n.useCallback(function(){s({}),null==i||i({}),a&&a("All filters cleared")},[i,a]),h=n.useCallback(function(e){var n,r=exports.__assign(exports.__assign({},l),((n={})[e.accessor]=e,n));return Dn({externalFilterHandling:o,tableRows:t,filterState:r})},[l,t,o]);return{filteredRows:d,updateFilter:f,clearFilter:v,clearAllFilters:p,filters:l,computeFilteredRowsPreview:h}}({rows:Or,headers:ir,externalFilterHandling:pe,onFilterChange:_e,announce:Cr}),Wr=Lr.filters,Br=Lr.updateFilter,qr=Lr.clearFilter,Gr=Lr.clearAllFilters,Vr=Lr.computeFilteredRowsPreview,zr=function(e){var t=e.headers,r=e.tableRows,o=e.externalSortHandling,i=e.onSortChange,a=e.rowGrouping,u=e.initialSortColumn,l=e.initialSortDirection,s=e.announce,c=Sn(t),d=n.useCallback(function(){if(!u)return null;var e=c.get(u);return e?{key:e,direction:l||"asc"}:null},[c,u,l]),f=n.useState(d),v=f[0],p=f[1],h=n.useCallback(function(e){var n=e.groupingKeys,t=e.headers,r=e.sortColumn,o=Rn({headers:t,rows:e.rows,sortColumn:r});return n&&0!==n.length?o.map(function(e){var o,i=n[0],a=e[i];if(H(a)){var u=h({rows:a,sortColumn:r,headers:t,groupingKeys:n.slice(1)});return exports.__assign(exports.__assign({},e),((o={})[i]=u,o))}return e}):o},[]),w=n.useMemo(function(){return Mn({externalSortHandling:o,tableRows:r,sortColumn:v,rowGrouping:a,headers:t,sortNestedRows:h})},[r,v,t,o,a,h]),m=n.useCallback(function(e){if(!e)return p(null),void(null==i||i(null));var n=e.accessor,t=e.direction,r=c.get(n);if(r){var o=null;if(t)o={key:r,direction:t};else{var a=r.sortingOrder||["asc","desc",null],u=-1;v&&v.key.accessor===n&&(u=a.indexOf(v.direction));var l=a[(u+1)%a.length];o=null===l?null:{key:r,direction:l}}if(p(o),null==i||i(o),s)if(o){var d="asc"===o.direction?"ascending":"descending";s("Sorted by ".concat(r.label,", ").concat(d))}else s("Sort removed from ".concat(r.label))}},[v,c,i,s]),g=n.useCallback(function(e){var n=function(t){for(var r=0,o=t;o.length>r;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=n(i.children);if(a)return a}}},i=n(t);if(!i)return r;var u=i.sortingOrder||["asc","desc",null],l=-1;v&&v.key.accessor===e&&(l=u.indexOf(v.direction));var s=u[(l+1)%u.length];return Mn({externalSortHandling:o,tableRows:r,sortColumn:null===s?null:{key:i,direction:s},rowGrouping:a,headers:t,sortNestedRows:h})},[v,t,r,o,a,h]);return{sort:v,sortedRows:w,updateSort:m,computeSortedRowsPreview:g}}({headers:Gt,tableRows:Lr.filteredRows,externalSortHandling:we,onSortChange:tn,rowGrouping:un,initialSortColumn:Ae,initialSortDirection:Fe,announce:Cr}),Kr=zr.sort,jr=zr.updateSort,Ur=zr.computeSortedRowsPreview,_r=zn({rows:zr.sortedRows,rowGrouping:un,getRowId:ln,expandedRows:wr,collapsedRows:xr,expandedDepths:vr,rowStateMap:ft,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!ne,headers:ir,rowHeight:Qn,headerHeight:et,customTheme:Zn}),Jr=_r.flattenedRows,Yr=_r.heightOffsets,Xr=_r.paginatableRows,$r=_r.parentEndPositions,Zr=function(e){var t=e.tableRows,r=e.onRowSelectionChange,o=e.enableRowSelection,i=void 0!==o&&o,a=n.useState(new Set),u=a[0],l=a[1],s=n.useCallback(function(e){return!!i&&function(e,n){return n.has(e)}(e,u)},[u,i]),c=n.useCallback(function(){return!!i&&function(e,n){return 0!==e.length&&e.filter(function(e){return e&&e.rowId}).every(function(e){return n.has(T(e.rowId))})}(t,u)},[t,u,i]),d=n.useMemo(function(){return i?function(e){return e.size}(u):0},[u,i]),f=n.useMemo(function(){return i?function(e,n){return e.filter(function(e){return!(!e||!e.rowId)&&n.has(T(e.rowId))}).map(function(e){return e.row})}(t,u):[]},[t,u,i]),v=n.useCallback(function(e,n){if(i){var o=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(l(o),r){var a=t.find(function(n){return T(n.rowId)===e});a&&r({row:a.row,isSelected:n,selectedRows:o})}}},[u,t,r,i]),p=n.useCallback(function(e){var n;i&&(e?(n=function(e){return new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return T(e.rowId)}))}(t),r&&t.forEach(function(e){return r({row:e.row,isSelected:!0,selectedRows:n})})):(n=new Set,r&&u.forEach(function(e){var o=t.find(function(n){return T(n.rowId)===e});o&&r({row:o.row,isSelected:!1,selectedRows:n})})),l(n))},[t,r,u,i]),h=n.useCallback(function(e){if(i){var n=s(e);v(e,!n)}},[s,v,i]),w=n.useCallback(function(){if(i){if(r){var e=new Set;u.forEach(function(n){var o=t.find(function(e){return T(e.rowId)===n});o&&r({row:o.row,isSelected:!1,selectedRows:e})})}l(new Set)}},[u,t,r,i]);return{selectedRows:u,setSelectedRows:l,isRowSelected:s,areAllRowsSelected:c,selectedRowCount:d,selectedRowsData:f,handleRowSelect:v,handleSelectAll:p,handleToggleRow:h,clearSelection:w}}({tableRows:Jr,onRowSelectionChange:nn,enableRowSelection:ie});It=Zr.selectedRows,Ct=Zr.setSelectedRows,Rt=Zr.isRowSelected,St=Zr.areAllRowsSelected,Mt=Zr.selectedRowCount,Nt=Zr.selectedRowsData,Ht=Zr.handleRowSelect,Et=Zr.handleSelectAll,Tt=Zr.handleToggleRow,kt=Zr.clearSelection;var Qr=zn({rows:Or,rowGrouping:un,getRowId:ln,expandedRows:wr,collapsedRows:xr,expandedDepths:vr,rowStateMap:ft,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!ne,headers:ir,rowHeight:Qn,headerHeight:et,customTheme:Zn}).flattenedRows,eo=n.useCallback(function(e){var n=Vr(e);return un&&0!==un.length?A({rows:n,rowGrouping:un,getRowId:ln,expandedRows:wr,collapsedRows:xr,expandedDepths:vr,rowStateMap:ft,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!ne,headers:ir,rowHeight:Qn,headerHeight:et,customTheme:Zn}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowId:[n],rowPath:[n],absoluteRowIndex:n}})},[Vr,un,ln,wr,xr,vr,ft,We,le,ne,ir,Qn,et,Zn]),no=n.useCallback(function(e){var n=Ur(e);return un&&0!==un.length?A({rows:n,rowGrouping:un,getRowId:ln,expandedRows:wr,collapsedRows:xr,expandedDepths:vr,rowStateMap:ft,hasLoadingRenderer:!!We,hasErrorRenderer:!!le,hasEmptyRenderer:!!ne,headers:ir,rowHeight:Qn,headerHeight:et,customTheme:Zn}):n.map(function(e,n){return{row:e,depth:0,displayPosition:n,groupingKey:void 0,position:n,isLastGroupRow:!1,rowId:[n],rowPath:[n],absoluteRowIndex:n}})},[Ur,un,ln,wr,xr,vr,ft,We,le,ne,ir,Qn,et,Zn]),to=function(e){var t=e.height,r=e.maxHeight,o=e.rowHeight,i=e.totalRowCount,a=e.headerHeight,u=e.footerHeight;return n.useMemo(function(){if(r){var e=Fn(r);if(0===e)return;var n=a||o;if(e>=n+i*o+(u||0)||20>i)return;return Math.max(0,e-n)}if(t){var l=Fn(t);if(0!==l)return Math.max(0,l-o)}},[t,r,o,i,a,u])}({height:Me,maxHeight:Be,rowHeight:Qn,shouldPaginate:xn,rowsPerPage:dn,totalRowCount:null!=Vn?Vn:Xr.length,headerHeight:Mr,footerHeight:xn&&!He?nt:void 0}),ro=function(e){var t=e.allowAnimations,r=e.computeFilteredRowsPreview,o=e.computeSortedRowsPreview,i=e.contentHeight,a=e.currentPage,s=e.customTheme,c=e.enableStickyParents,d=e.flattenedRows,f=e.heightOffsets,v=e.originalFlattenedRows,p=e.parentEndPositions,h=e.rowHeight,w=e.rowsPerPage,m=e.scrollDirection,g=void 0===m?"none":m,x=e.scrollTop,b=e.serverSidePagination,y=e.shouldPaginate,I=e.rowGrouping,C=n.useState(!1),R=C[0],S=C[1],M=n.useState([]),N=M[0],H=M[1],E=n.useRef([]),k=n.useRef([]),P=n.useMemo(function(){return l(h)},[h]),A=n.useRef(new Map),D=n.useRef(null),F=n.useCallback(function(e,n){if(!y||b)return e.map(function(e,n){return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:n})});var t=(a-1)*w,r=a*w,o=0===t?0:n[t-1];return e.slice(o,r>n.length?e.length:n[r-1]).map(function(e,n){var t=e.nestedTable?e.absoluteRowIndex:y&&!b?o+n:n;return exports.__assign(exports.__assign({},e),{position:n,absoluteRowIndex:t})})},[a,w,b,y]);n.useMemo(function(){if(0===A.current.size&&v.length>0){var e=new Map;v.forEach(function(n,t){var r=T(n.rowId);e.set(r,t)}),A.current=e}},[v]);var L=n.useMemo(function(){return F(d,p)},[d,p,F]),W=n.useMemo(function(){if(!f||0===f.length||!y||b)return f;var e=new Map;return L.forEach(function(n){n.nestedTable&&e.set(n.absoluteRowIndex,n.position)}),f.filter(function(n){return e.has(n[0])}).map(function(n){var t=n[1];return[e.get(n[0]),t]})},[f,L,y,b]),q=n.useMemo(function(){if(W&&0!==W.length)return function(e,n,t,r){var o=n+r.rowSeparatorWidth,i=Array(e),a=new Map;t&&t.forEach(function(e){a.set(e[0],e[1])});for(var u=0,l=0;e>l;l++){i[l]=u,u+=o;var s=a.get(l);void 0!==s&&(u+=s)}return{rowTopPositions:i,totalHeight:u-r.rowSeparatorWidth}}(L.length,h,W,s)},[L.length,h,W,s]),G=n.useMemo(function(){return void 0===i?L:O({bufferRowCount:P,contentHeight:i,tableRows:L,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:q}).rendered.rows},[L,i,h,x,g,P,q]),V=n.useMemo(function(){if(!c||void 0===i)return{stickyParents:[],regularRows:G,partiallyVisibleRows:[]};var e=O({bufferRowCount:P,contentHeight:i,tableRows:L,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:q}),n=I?function(e,n,t,r,o){return B({allTableRows:e,renderedRows:n,fullyVisibleRows:t,partiallyVisibleRows:r,partiallyVisibleRowIndex:0,recursionDepth:0,stickyParents:[],rowGrouping:o})}(L,e.rendered.rows,e.fullyVisible.rows,e.partiallyVisible.rows,I):{stickyParents:[],regularRows:e.rendered.rows,partiallyVisibleRows:[]};return exports.__assign(exports.__assign({},n),{partiallyVisibleRows:e.partiallyVisible.rows})},[P,i,L,c,q,I,h,g,x,G]),z=V.stickyParents,K=V.regularRows,j=V.partiallyVisibleRows,U=n.useCallback(function(e,n){var t=new Set(e.filter(function(e){return e&&e.rowId}).map(function(e){return T(e.rowId)})),r=new Set(n.filter(function(e){return e&&e.rowId}).map(function(e){return T(e.rowId)}));return{staying:n.filter(function(e){var n=T(e.rowId);return t.has(n)}),entering:n.filter(function(e){var n=T(e.rowId);return!t.has(n)}),leaving:e.filter(function(e){var n=T(e.rowId);return!r.has(n)})}},[]),_=n.useMemo(function(){if(0===E.current.length)return!1;var e=L.filter(function(e){return e&&e.rowId}).map(function(e){return T(e.rowId)}),n=E.current.filter(function(e){return e&&e.rowId}).map(function(e){return T(e.rowId)});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[L]);n.useLayoutEffect(function(){if(!R){var e=function(){N.length>0&&H([])};if(!t||y)return e(),E.current=L,void(k.current=G);if(0===E.current.length)return e(),E.current=L,void(k.current=G);if(!_)return e(),E.current=L,void(k.current=G);D.current={tableRows:L,visibleRows:G},S(!0)}},[t,L,N.length,_,R,y,G]),n.useLayoutEffect(function(){if(R&&D.current&&N.length>0){var e=setTimeout(function(){var e=D.current;S(!1),H([]),E.current=e.tableRows,k.current=e.visibleRows,D.current=null},qn.ROW_REORDER.duration+100);return function(){return clearTimeout(e)}}},[R,N.length]);var J=n.useMemo(function(){if(!t||y)return G;if(N.length>0){var e=new Map,n=new Map;return L.forEach(function(t){var r=T(t.rowId);e.set(r,t.position),n.set(r,t.displayPosition)}),N.map(function(t){var r=T(t.rowId),o=e.get(r),i=n.get(r);return void 0!==o&&void 0!==i?exports.__assign(exports.__assign({},t),{position:o,displayPosition:i}):t})}return G},[G,N,L,t,y]),Y=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=r(e),o=F(n,[]),a=O({bufferRowCount:P,contentHeight:i,tableRows:o,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:q}),l=U(G,a.rendered.rows).entering.map(function(e){var n=T(e.rowId)+"";return L.find(function(e){return T(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&H(u(u([],G,!0),l,!0))}},[t,y,r,F,i,h,x,g,U,L,G,P,q]),X=n.useCallback(function(e){if(t&&!y&&void 0!==i){var n=o(e),r=F(n,[]),a=O({bufferRowCount:P,contentHeight:i,tableRows:r,rowHeight:h,scrollTop:x,scrollDirection:g,heightMap:q}),l=U(G,a.rendered.rows).entering.map(function(e){var n=T(e.rowId)+"";return L.find(function(e){return T(e.rowId)+""===n})||e}).filter(Boolean);l.length>0&&H(u(u([],G,!0),l,!0))}},[t,y,o,F,i,h,x,g,U,L,G,P,q]);return{currentTableRows:L,currentVisibleRows:G,isAnimating:R,prepareForFilterChange:Y,prepareForSortChange:X,rowsToRender:J,stickyParents:z,regularRows:K,partiallyVisibleRows:j,paginatedHeightOffsets:W,heightMap:q}}({allowAnimations:o,computeFilteredRowsPreview:eo,computeSortedRowsPreview:no,contentHeight:to,currentPage:Wt,customTheme:Zn,enableStickyParents:ue,flattenedRows:Jr,heightOffsets:Yr,originalFlattenedRows:Qr,paginatableRows:Xr,parentEndPositions:$r,rowGrouping:un,rowHeight:Qn,rowsPerPage:dn,scrollDirection:cr,scrollTop:ur,serverSidePagination:mn,shouldPaginate:xn}),oo=ro.currentTableRows,io=ro.rowsToRender,ao=ro.prepareForFilterChange,uo=ro.prepareForSortChange,lo=ro.isAnimating,so=ro.stickyParents,co=ro.regularRows,fo=ro.partiallyVisibleRows,vo=ro.paginatedHeightOffsets,po=ro.heightMap,ho=n.useRef(new Map),wo=n.useRef(new Map),mo=function(e){var t=e.selectableCells,r=e.headers,o=e.tableRows,u=e.onCellEdit,l=e.cellRegistry,s=e.collapsedHeaders,c=e.rowHeight,d=e.enableRowSelection,f=void 0!==d&&d,v=e.copyHeadersToClipboard,p=void 0!==v&&v,h=e.customTheme,w=n.useState(new Set),m=w[0],g=w[1],b=n.useState(new Set),y=b[0],I=b[1],C=n.useState(null),R=C[0],S=C[1],H=n.useState(null),E=H[0],k=H[1],P=n.useState(new Set),A=P[0],D=P[1],F=n.useState(new Set),O=F[0],L=F[1],W=n.useState(!1),B=W[0],q=W[1],z=n.useRef(!1),K=n.useRef(null),j=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),y.forEach(function(n){e.add(n)}),e},[m,y]),U=n.useMemo(function(){var e=new Set;return m.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),y.size>0&&o.forEach(function(n){var t=T(n.rowId);e.add(t)}),e},[m,y,o]),_=n.useMemo(function(){return r.flatMap(function(e){return x(e,s)})},[r,s]),J=n.useCallback(function(){if(0!==m.size){var e=function(e,n,t,r){void 0===r&&(r=!1);var o=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),i=new Map,a=new Map;o.forEach(function(e,n){i.set(n,e.accessor),a.set(n,e)});var u=Array.from(e).reduce(function(e,n){var r,o=n.split("-").map(Number),u=o[0],l=o[1];e[u]||(e[u]=[]);var s=i.get(l),c=a.get(l);if(s&&(null===(r=t[u])||void 0===r?void 0:r.row)){var d=t[u].row,f=M(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;r&&Array.from(e).forEach(function(e){var n=e.split("-").map(Number);l.add(n[1])});var s="";r&&l.size>0&&(s=Array.from(l).sort(function(e,n){return e-n}).map(function(e){var n,t=a.get(e);return null!==(n=null==t?void 0:t.label)&&void 0!==n?n:""}).join("\t"));var c=Object.values(u).map(function(e){return Object.values(e).join("\t")}).join("\n");return r&&s?"".concat(s,"\n").concat(c):c}(m,_,o,p);navigator.clipboard.writeText(e),D(new Set(m)),setTimeout(function(){return D(new Set)},800)}},[m,_,o,p]),Y=n.useCallback(function(){return i(void 0,void 0,void 0,function(){var e,n,t,r,i;return a(this,function(a){switch(a.label){case 0:if(!E)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=a.sent())?(n=function(e,n,t,r,o,i){var a=new Set,u=new Set,l=e.split("\n").filter(function(e){return e.length>0});if(0===l.length)return{updatedCells:a,warningCells:u};var s=t.filter(function(e){return!e.hide&&!e.excludeFromRender}),c=n.rowIndex,d=n.colIndex;return l.forEach(function(e,n){e.split("\t").forEach(function(e,t){var l=c+n,f=d+t;if(r.length>l&&s.length>f){var v=r[l],p=s[f],h=T(v.rowId);if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=+e;isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var g=new Date(e);isNaN(g.getTime())||(w=g)}else"lineAreaChart"!==p.type&&"barChart"!==p.type||(w=e.split(",").map(function(e){var n=+e.trim();return isNaN(n)?0:n}));if(N(v.row,p.accessor,w),i){var x="".concat(h,"-").concat(p.accessor),b=i.get(x);b&&b.updateContent(w)}null==o||o({accessor:p.accessor,newValue:w,row:v.row,rowIndex:l});var y="".concat(l,"-").concat(f,"-").concat(h);a.add(y)}else{var I="".concat(l,"-").concat(f,"-").concat(h);u.add(I)}}})}),{updatedCells:a,warningCells:u}}(e,E,_,o,u,l),r=n.warningCells,(t=n.updatedCells).size>0&&(D(t),setTimeout(function(){return D(new Set)},800)),r.size>0&&(L(r),setTimeout(function(){return L(new Set)},800)),[3,4]):[2];case 3:return i=a.sent(),console.warn("Failed to paste from clipboard:",i),[3,4];case 4:return[2]}})})},[E,_,o,u,l]),X=n.useCallback(function(){if(0!==m.size){var e=function(e,n,t,r,o){var i=new Set,a=new Set,u=n.filter(function(e){return!e.hide&&!e.excludeFromRender}),l=new Map;return u.forEach(function(e,n){l.set(n,e.accessor)}),Array.from(e).forEach(function(e){var n=e.split("-").map(Number),l=n[0],s=n[1];if(t.length>l&&u.length>s){var c=t[l],d=u[s],f=T(c.rowId);if(null==d?void 0:d.isEditable){var v;if(v="string"===d.type?"":"number"===d.type?null:"boolean"!==d.type&&("date"===d.type?null:"lineAreaChart"===d.type||"barChart"===d.type||Array.isArray(M(c.row,d.accessor))?[]:""),N(c.row,d.accessor,v),o){var p="".concat(f,"-").concat(d.accessor),h=o.get(p);h&&h.updateContent(v)}null==r||r({accessor:d.accessor,newValue:v,row:c.row,rowIndex:l}),i.add(e)}else a.add(e)}}),{deletedCells:i,warningCells:a}}(m,_,o,u,l),n=e.deletedCells,t=e.warningCells;n.size>0&&(D(n),setTimeout(function(){return D(new Set)},800)),t.size>0&&(L(t),setTimeout(function(){return L(new Set)},800))}},[m,_,o,u,l]),$=n.useCallback(function(e,n){for(var t=new Set,r=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),u=Math.max(e.colIndex,n.colIndex),l=r;i>=l;l++)for(var s=a;u>=s;s++)if(l>=0&&o.length>l){if(f&&0===s)continue;var d=T(o[l].rowId);t.add(V({colIndex:s,rowIndex:l,rowId:d}))}I(new Set),S(null),g(t),k(n),setTimeout(function(){return G(n,c,h)},0)},[o,c,f,h]),Z=n.useCallback(function(e){if(e.rowIndex>=0&&o.length>e.rowIndex&&e.colIndex>=0&&(f?_.length:_.length-1)>=e.colIndex){var n=V(e);I(new Set),S(null),g(new Set([n])),k(e),setTimeout(function(){return G(e,c,h)},0)}},[_.length,o.length,c,f,h]),Q=n.useCallback(function(e,n){void 0===n&&(n=!1),g(new Set),k(null),I(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&S(e[e.length-1])},[]);!function(e){var t=e.copyToClipboard,r=e.deleteSelectedCells,o=e.enableRowSelection,i=void 0!==o&&o,a=e.initialFocusedCell,u=e.leafHeaders,l=e.pasteFromClipboard,s=e.selectCellRange,c=e.selectSingleCell,d=e.selectableCells,f=e.selectedCells,v=e.setLastSelectedColumnIndex,p=e.setSelectedCells,h=e.setSelectedColumns,w=e.startCell,m=e.tableRows;n.useEffect(function(){var e=function(e){if(d&&a&&0!==f.size){var s=document.activeElement;if(!(s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement||"true"===(null==s?void 0:s.getAttribute("contenteditable")))){var c=a.rowIndex,R=a.colIndex,S=a.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void l();if((e.ctrlKey||e.metaKey)&&"a"===e.key){e.preventDefault();for(var M=new Set,N=0;m.length>N;N++)for(var H=0;u.length>H;H++){var E=i?H+1:H,k=T(m[N].rowId);M.add("".concat(N,"-").concat(E,"-").concat(k))}return p(M),h(new Set),void v(null)}if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void r();var P=m[c];if((P?T(P.rowId):null)!==S){var A=m.findIndex(function(e){return T(e.rowId)===S});if(-1===A)return;c=A}var D=function(e,n,t){var r=e,o=n;return"up"===t?r=0:"down"===t?r=m.length-1:"left"===t?o=i?1:0:"right"===t&&(o=i?u.length:u.length-1),{rowIndex:r,colIndex:o}};"ArrowUp"===e.key?(e.preventDefault(),n(e,c,R,D)):"ArrowDown"===e.key?(e.preventDefault(),o(e,c,R,D)):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),g(e,c,R,D)):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),x(e,c,R,D)):"Home"===e.key?(e.preventDefault(),b(e,c)):"End"===e.key?(e.preventDefault(),y(e,c)):"PageUp"===e.key?(e.preventDefault(),I(e,c,R)):"PageDown"===e.key?(e.preventDefault(),C(e,c,R)):"Escape"===e.key&&(p(new Set),h(new Set),v(null),w.current=null)}else t()}}},n=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a);var o=n-1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),o>=0){var i=T(m[o].rowId);s(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else n>0&&(o=n-1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"up").rowIndex),i=T(m[o].rowId),c({rowIndex:o,colIndex:t,rowId:i}),w.current=null)},o=function(e,n,t,r){if(e.shiftKey){w.current||(w.current=a);var o=n+1;if((e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),m.length>o){var i=T(m[o].rowId);s(w.current,{rowIndex:o,colIndex:t,rowId:i})}}else m.length-1>n&&(o=n+1,(e.ctrlKey||e.metaKey)&&(o=r(n,t,"down").rowIndex),i=T(m[o].rowId),c({rowIndex:o,colIndex:t,rowId:i}),w.current=null)},g=function(e,n,t,r){if(e.shiftKey&&"ArrowLeft"===e.key){w.current||(w.current=a);var o=t-1;if(e.ctrlKey||e.metaKey)o=r(n,t,"left").colIndex;else if(i&&0===o)return;if(o>=0){var u=T(m[n].rowId);s(w.current,{rowIndex:n,colIndex:o,rowId:u})}}else if(t>0){if(o=t-1,(e.ctrlKey||e.metaKey)&&"ArrowLeft"===e.key)o=r(n,t,"left").colIndex;else if(i&&0===o)return;0>o||(u=T(m[n].rowId),c({rowIndex:n,colIndex:o,rowId:u}),w.current=null)}},x=function(e,n,t,r){var o=i?u.length:u.length-1;if(e.shiftKey&&"ArrowRight"===e.key){w.current||(w.current=a);var l=t+1;if((e.ctrlKey||e.metaKey)&&(l=r(n,t,"right").colIndex),o>=l){var d=T(m[n].rowId);s(w.current,{rowIndex:n,colIndex:l,rowId:d})}}else o>t&&(l=t+1,(e.ctrlKey||e.metaKey)&&"ArrowRight"===e.key&&(l=r(n,t,"right").colIndex),l>o||(d=T(m[n].rowId),c({rowIndex:n,colIndex:l,rowId:d}),w.current=null))},b=function(e,n,t){if(e.shiftKey){w.current||(w.current=a);var r=n,o=i?1:0;(e.ctrlKey||e.metaKey)&&(r=0);var u=T(m[r].rowId);s(w.current,{rowIndex:r,colIndex:o,rowId:u})}else r=n,o=i?1:0,(e.ctrlKey||e.metaKey)&&(r=0),u=T(m[r].rowId),c({rowIndex:r,colIndex:o,rowId:u}),w.current=null},y=function(e,n,t){if(e.shiftKey){w.current||(w.current=a);var r=n,o=i?u.length:u.length-1;(e.ctrlKey||e.metaKey)&&(r=m.length-1);var l=T(m[r].rowId);s(w.current,{rowIndex:r,colIndex:o,rowId:l})}else r=n,o=i?u.length:u.length-1,(e.ctrlKey||e.metaKey)&&(r=m.length-1),l=T(m[r].rowId),c({rowIndex:r,colIndex:o,rowId:l}),w.current=null},I=function(e,n,t){var r=Math.max(0,n-10);if(e.shiftKey){w.current||(w.current=a);var o=T(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=T(m[r].rowId),c({rowIndex:r,colIndex:t,rowId:o}),w.current=null},C=function(e,n,t){var r=Math.min(m.length-1,n+10);if(e.shiftKey){w.current||(w.current=a);var o=T(m[r].rowId);s(w.current,{rowIndex:r,colIndex:t,rowId:o})}else o=T(m[r].rowId),c({rowIndex:r,colIndex:t,rowId:o}),w.current=null};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[d,a,m,u,c,s,f,p,h,v,t,l,r,w,i])}({selectableCells:t,initialFocusedCell:E,tableRows:o,leafHeaders:_,selectSingleCell:Z,selectCellRange:$,selectedCells:m,setSelectedCells:g,setSelectedColumns:I,setLastSelectedColumnIndex:S,copyToClipboard:J,pasteFromClipboard:Y,deleteSelectedCells:X,startCell:K,enableRowSelection:f});var ee=n.useCallback(function(e,n){var t=new Set,r=new Map;o.forEach(function(e,n){var t=T(e.rowId);r.set(t,n)});for(var i=r.get(e.rowId+""),a=r.get(n.rowId+""),u=void 0!==i?i:e.rowIndex,l=void 0!==a?a:n.rowIndex,s=Math.min(u,l),c=Math.max(u,l),d=Math.min(e.colIndex,n.colIndex),v=Math.max(e.colIndex,n.colIndex),p=s;c>=p;p++)for(var h=d;v>=h;h++)if(p>=0&&o.length>p){if(f&&0===h)continue;var w=T(o[p].rowId);t.add(V({colIndex:h,rowIndex:p,rowId:w}))}g(t)},[o,f]),ne=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(!t)return null;var r=t.getBoundingClientRect(),o=Array.from(document.querySelectorAll(".st-cell[data-row-index][data-col-index]:not(.st-selection-cell)"));if(0===o.length)return null;var i=Math.max(r.left,Math.min(r.right,e)),a=Math.max(r.top,Math.min(r.bottom,n)),u=null,l=1/0;if(o.forEach(function(e){if(e instanceof HTMLElement){var n=e,t=n.getBoundingClientRect(),r=t.top+t.height/2,o=Math.sqrt(Math.pow(t.left+t.width/2-i,2)+Math.pow(r-a,2));l>o&&(l=o,u=n)}}),null!==u){var 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},[]),te=n.useCallback(function(e,n){var t=document.elementFromPoint(e,n);if(!t)return null;var r=t.closest(".st-cell");if(r instanceof HTMLElement){var o=parseInt(r.getAttribute("data-row-index")||"-1",10),i=parseInt(r.getAttribute("data-col-index")||"-1",10),a=r.getAttribute("data-row-id");if(o>=0&&i>=0&&null!==a)return{rowIndex:o,colIndex:i,rowId:a}}return ne(e,n)},[ne]),re=n.useCallback(function(e,n){var t=document.querySelector(".st-body-container");if(t){var r=t.getBoundingClientRect();r.top+50>n?t.scrollTop-=10*Math.min(3,1+Math.max(0,r.top-n)/100):n>r.bottom-50&&(t.scrollTop+=10*Math.min(3,1+Math.max(0,n-r.bottom)/100));var o=document.querySelector(".st-body-main");o&&(r.left+50>e?o.scrollLeft-=10*Math.min(3,1+Math.max(0,r.left-e)/100):e>r.right-50&&(o.scrollLeft+=10*Math.min(3,1+Math.max(0,e-r.right)/100)))}},[]),oe=n.useCallback(function(e){var n=e.colIndex,t=V({colIndex:n,rowIndex:e.rowIndex,rowId:e.rowId}),r=m.has(t),o=y.has(n);return r||o},[m,y]),ie=n.useCallback(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId;if(B)return"";var i=[],a=o[t-1],u=a?T(a.rowId):null,l=o[t+1],s=l?T(l.rowId):null,c=null!==u?{colIndex:n,rowIndex:t-1,rowId:u}:null,d=null!==s?{colIndex:n,rowIndex:t+1,rowId:s}:null,f={colIndex:n-1,rowIndex:t,rowId:r},v={colIndex:n+1,rowIndex:t,rowId:r};return(!c||!oe(c)||y.has(n)&&0===t)&&i.push("st-selected-top-border"),(!d||!oe(d)||y.has(n)&&t===o.length-1)&&i.push("st-selected-bottom-border"),oe(f)||i.push("st-selected-left-border"),oe(v)||i.push("st-selected-right-border"),i.join(" ")},[B,oe,o,y]),ae=n.useMemo(function(){return E?function(e){return e.rowIndex===E.rowIndex&&e.colIndex===E.colIndex&&e.rowId===E.rowId}:function(){return!1}},[E]),ue=n.useCallback(function(e){var n=V({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return A.has(n)},[A]),le=n.useCallback(function(e){var n=V({colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId});return O.has(n)},[O]);return{getBorderClass:ie,handleMouseDown:function(e){var n=e.colIndex,r=e.rowIndex,o=e.rowId;if(t){z.current=!0,q(!0),K.current={rowIndex:r,colIndex:n,rowId:o},setTimeout(function(){I(new Set),S(null);var e=V({colIndex:n,rowIndex:r,rowId:o});g(new Set([e])),k({rowIndex:r,colIndex:n,rowId:o})},0);var i=null,a=null,u=null,l=0,s=function(){if(z.current&&K.current){if(null!==i&&null!==a){re(i,a);var e=Date.now();if(e-l>=16){var n=te(i,a);n&&ee(K.current,n),l=e}}u=requestAnimationFrame(s)}else null!==u&&(cancelAnimationFrame(u),u=null)},c=function(e){z.current&&K.current&&(i=e.clientX,a=e.clientY)},d=function(){z.current=!1,q(!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){t&&z.current&&K.current&&ee(K.current,{colIndex:e.colIndex,rowIndex:e.rowIndex,rowId:e.rowId})},isCopyFlashing:ue,isWarningFlashing:le,isInitialFocusedCell:ae,isSelected:oe,lastSelectedColumnIndex:R,pasteFromClipboard:Y,selectColumns:Q,selectedCells:m,selectedColumns:y,setInitialFocusedCell:k,setSelectedCells:g,setSelectedColumns:I,deleteSelectedCells:X,columnsWithSelectedCells:j,rowsWithSelectedCells:U,startCell:K}}({selectableCells:vn,headers:Gt,tableRows:oo,onCellEdit:ze,cellRegistry:ho.current,collapsedHeaders:rr,rowHeight:Qn,enableRowSelection:ie,copyHeadersToClipboard:L,customTheme:Zn}),go=mo.getBorderClass,xo=mo.handleMouseDown,bo=mo.handleMouseOver,yo=mo.isCopyFlashing,Io=mo.isInitialFocusedCell,Co=mo.isSelected,Ro=mo.isWarningFlashing,So=mo.selectColumns,Mo=mo.selectedCells,No=mo.selectedColumns,Ho=mo.setInitialFocusedCell,Eo=mo.setSelectedCells,To=mo.setSelectedColumns,ko=mo.columnsWithSelectedCells,Po=mo.rowsWithSelectedCells,Ao=mo.startCell,Do=n.useCallback(function(e){uo(e),setTimeout(function(){jr({accessor:e})},0)},[uo,jr]),Fo=n.useCallback(function(e){Vt(e)},[]);!function(e){var t=e.selectableColumns,r=e.selectedCells,o=e.selectedColumns,i=e.setSelectedCells,a=e.setSelectedColumns,u=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown,s=e.startCell;n.useEffect(function(){var e=function(e){var n=e.target;n.closest(".editable-cell-input")&&n.closest(".st-header-cell")||(u&&l&&(n.closest(".st-header-cell")||n.closest(".dropdown-content")||l(null)),n.closest(".st-cell")||t&&(n.classList.contains("st-header-cell")||n.classList.contains("st-header-label")||n.classList.contains("st-header-label-text"))||(r.size>0&&i(new Set),o.size>0&&a(new Set),s&&(s.current=null)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[t,r,o,i,a,u,l,s])}({selectableColumns:hn,selectedCells:Mo,selectedColumns:No,setSelectedCells:Eo,setSelectedColumns:To,activeHeaderDropdown:Xt,setActiveHeaderDropdown:$t,startCell:Ao}),function(e){var t=e.forceUpdate,r=e.tableBodyContainerRef,o=e.setScrollbarWidth;n.useLayoutEffect(function(){var e=function(){t(),r.current&&o(r.current.offsetWidth-r.current.clientWidth)};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[t,r,o])}({forceUpdate:ct,tableBodyContainerRef:lt,setScrollbarWidth:Dt}),function(e){var t=e.onGridReady;n.useEffect(function(){null==t||t()},[t])}({onGridReady:Ye}),function(e){var t=e.cellRegistryRef,r=e.clearAllFilters,o=e.clearFilter,l=e.currentPage,s=e.editColumns,c=e.expandedDepths,d=e.filters,f=e.flattenedRows,v=e.headerRegistryRef,p=e.headers,h=e.includeHeadersInCSVExport,w=e.onColumnVisibilityChange,m=e.onPageChange,x=e.paginatableRows,b=e.rowGrouping,y=e.rows,I=e.rowsPerPage,C=e.setCollapsedRows,R=e.setColumnEditorOpen,S=e.setCurrentPage,H=e.setExpandedDepths,E=e.setExpandedRows,k=e.setHeaders,P=e.sort,A=e.tableRef,D=e.totalRowCount,F=e.updateFilter,O=e.updateSort,L=e.visibleRows;n.useEffect(function(){A&&(A.current={updateData:function(e){var n=e.accessor,r=e.rowIndex,o=e.newValue,i=null==y?void 0:y[r];if(i){var a=T([r]),u=g({rowId:a,accessor:n}),l=t.current.get(u);l&&l.updateContent(o),void 0!==M(i,n)&&N(i,n,o)}},setHeaderRename:function(e){var n=v.current.get(e.accessor+"");n&&n.setEditing(!0)},getVisibleRows:function(){return L},getAllRows:function(){return f},getHeaders:function(){return p},exportToCSV:function(e){!function(e,n,t,r){void 0===r&&(r=!0);var o=function(e,n,t){void 0===t&&(t=!0);var r=function(e){var n=[],t=function(e){for(var r=0,o=e;o.length>r;r++){var i=o[r];i.hide||i.isSelectionColumn||i.excludeFromCsv||(i.children&&i.children.length>0?(i.singleRowChildren&&n.push(i),t(i.children)):n.push(i))}};return t(e),n}(n),o=r.map(function(e){return Ln(e.label)}).join(","),i=e.map(function(e,n){var t=e.row;return r.map(function(e,r){var o=M(t,e.accessor);if(e.exportValueGetter){var i=e.valueFormatter?e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}):void 0,a=e.exportValueGetter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o,formattedValue:i});return Ln(a)}return!1!==e.useFormattedValueForCSV&&e.valueFormatter?(i=e.valueFormatter({accessor:e.accessor,colIndex:r,row:t,rowIndex:n,value:o}),Ln(i)):Ln(o)}).join(",")});return(t?u([o],i,!0):i).join("\n")}(e,n,r);!function(e,n){void 0===n&&(n="table-export.csv");var t=new Blob([e],{type:"text/csv;charset=utf-8;"}),r=document.createElement("a"),o=URL.createObjectURL(t);r.setAttribute("href",o),r.setAttribute("download",n),r.style.visibility="hidden",document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(o)}(o,t)}(f,p,(void 0===e?{}:e).filename,h)},getSortState:function(){return P},applySortState:Wn(O),getFilterState:function(){return d},applyFilter:Wn(F),clearFilter:Wn(o),clearAllFilters:Wn(r),getCurrentPage:function(){return l},getTotalPages:function(){return Math.ceil((null!=D?D:x.length)/I)},setPage:function(e){return i(void 0,void 0,void 0,function(){var n;return a(this,function(t){switch(t.label){case 0:return n=Math.ceil((null!=D?D:x.length)/I),1>e||e>n?[3,2]:(S(e),m?[4,m(e)]:[3,2]);case 1:t.sent(),t.label=2;case 2:return[2]}})})},expandAll:function(){var e=Array.from({length:(null==b?void 0:b.length)||0},function(e,n){return n});H(new Set(e)),E(new Map),C(new Map)},collapseAll:function(){H(new Set),E(new Map),C(new Map)},expandDepth:function(e){H(function(n){for(var t=new Set(n),r=0;e>=r;r++)t.add(r);return t}),E(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),C(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},collapseDepth:function(e){H(function(n){var t=new Set(n);return t.delete(e),t}),E(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),C(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},toggleDepth:function(e){H(function(n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}),E(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t}),C(function(n){var t=new Map(n);return Array.from(t.entries()).forEach(function(n){n[1]===e&&t.delete(n[0])}),t})},setExpandedDepths:function(e){H(e)},getExpandedDepths:function(){return c},getGroupingProperty:function(e){return null==b?void 0:b[e]},getGroupingDepth:function(e){var n;return null!==(n=null==b?void 0:b.indexOf(e))&&void 0!==n?n:-1},toggleColumnEditor:function(e){s&&R(void 0!==e?e:function(e){return!e})},applyColumnVisibility:Wn(function(e){var n=function(t){return t.map(function(t){var r=t.accessor+"",o=r in e;return exports.__assign(exports.__assign({},t),{hide:o?!e[r]:t.hide,children:t.children?n(t.children):t.children})})};k(function(e){return n(e)}),w&&w(e)})})},[t,r,o,l,s,c,d,f,v,p,h,w,m,x,b,e.rowIndexMap,y,I,e.serverSidePagination,C,R,S,H,E,k,e.setRows,e.shouldPaginate,P,A,D,F,O,L])}({cellRegistryRef:ho,clearAllFilters:Gr,clearFilter:qr,currentPage:Wt,editColumns:j,expandedDepths:vr,filters:Wr,flattenedRows:Jr,headerRegistryRef:wo,headers:ir,includeHeadersInCSVExport:Pe,onColumnVisibilityChange:Ue,onPageChange:Qe,paginatableRows:Xr,rowGrouping:un,rowIndexMap:yt,rows:Ot,rowsPerPage:dn,serverSidePagination:mn,setCollapsedRows:br,setColumnEditorOpen:er,setCurrentPage:Bt,setExpandedDepths:pr,setExpandedRows:mr,setHeaders:Vt,setRows:wt,shouldPaginate:xn,sort:Kr,tableRef:kn,totalRowCount:Vn,updateFilter:Br,updateSort:jr,visibleRows:io}),function(e){var t=e.filters,r=e.onFilterChange;n.useEffect(function(){null==r||r(t)},[t,r])}({filters:Wr,onFilterChange:_e}),function(e){var t=e.sort,r=e.onSortChange,o=Ce(t);n.useEffect(function(){!t||(null==o?void 0:o.key.accessor)===t.key.accessor&&(null==o?void 0:o.direction)===t.direction?!t&&o&&(null==r||r(null)):null==r||r(t)},[t,o,r])}({sort:Kr,onSortChange:tn});var Oo=n.useCallback(function(e){ao(e),setTimeout(function(){Br(e)},0)},[ao,Br]),Lo=!gt&&0===oo.length;return e.jsx(K,exports.__assign({value:{activeHeaderDropdown:Xt,allowAnimations:o,areAllRowsSelected:St,autoExpandColumns:c,canExpandRowGroup:f,cellRegistry:ho.current,cellUpdateFlash:h,clearSelection:kt,collapsedHeaders:rr,columnBorders:b,columnReordering:k,columnResizing:D,columnsWithSelectedCells:ko,copyHeadersToClipboard:L,draggedHeaderRef:rt,editColumns:j,emptyStateRenderer:ne,enableHeaderEditing:re,enableRowSelection:ie,errorStateRenderer:le,expandedDepths:vr,expandIcon:fe,filterIcon:ge,filters:Wr,forceUpdate:ct,getBorderClass:go,handleApplyFilter:Oo,handleClearAllFilters:Gr,handleClearFilter:qr,handleMouseDown:xo,handleMouseOver:bo,handleRowSelect:Ht,handleSelectAll:Et,handleToggleRow:Tt,headerCollapseIcon:ye,headerContainerRef:st,headerDropdown:Ie,headerExpandIcon:Se,headerHeight:et,headerRegistry:wo.current,headers:ir,heightOffsets:vo,hoveredHeaderRef:ot,includeHeadersInCSVExport:Pe,isAnimating:lo,isCopyFlashing:yo,isInitialFocusedCell:Io,isLoading:gt,isResizing:Kt,isRowSelected:Rt,isScrolling:_t,isSelected:Co,isWarningFlashing:Ro,loadingStateRenderer:We,mainBodyRef:it,maxHeaderDepth:Nr,nextIcon:Ge,onCellClick:Ve,onCellEdit:ze,onColumnOrderChange:Ke,onColumnSelect:je,onColumnVisibilityChange:Ue,onHeaderEdit:Xe,onLoadMore:$e,onRowGroupExpand:en,onSort:Do,onTableHeaderDragEnd:Fo,pinnedLeftRef:at,pinnedRightRef:ut,prevIcon:on,rowButtons:an,rowGrouping:un,rowHeight:Qn,rowStateMap:ft,rows:ht,rowsWithSelectedCells:Po,scrollbarWidth:At,selectColumns:So,selectableColumns:hn,selectedColumns:No,selectedRowCount:Mt,selectedRows:It,selectedRowsData:Nt,setActiveHeaderDropdown:$t,setCollapsedHeaders:or,setHeaders:Vt,setInitialFocusedCell:Ho,setIsResizing:jt,setIsScrolling:Jt,setRowStateMap:vt,setSelectedCells:Eo,setSelectedColumns:To,setSelectedRows:Ct,setExpandedDepths:pr,setExpandedRows:mr,setCollapsedRows:br,shouldPaginate:xn,sortDownIcon:Cn,sortUpIcon:Hn,tableBodyContainerRef:lt,tableEmptyStateRenderer:Tn,tableRows:oo,theme:Gn,customTheme:Zn,expandedRows:wr,collapsedRows:xr,useHoverRowBackground:_n,useOddColumnBackground:Yn,useOddEvenRowBackground:$n}},{children:e.jsxs("div",exports.__assign({className:"simple-table-root st-wrapper theme-".concat(Gn," ").concat(null!=w?w:""," ").concat(b?"st-column-borders":""),style:Be?{maxHeight:Be,height:void 0===to?"auto":Be}:Me?{height:Me}:{}},{children:[e.jsx(An,{children:e.jsxs("div",exports.__assign({className:"st-wrapper-container"},{children:[e.jsxs("div",exports.__assign({className:"st-content-wrapper"},{children:[e.jsx(yn,{calculatedHeaderHeight:Mr,hideHeader:Te,pinnedLeftWidth:Pr,pinnedRightWidth:Ar,setScrollTop:lr,setScrollDirection:dr,shouldShowEmptyState:Lo,sort:Kr,tableRows:oo,rowsToRender:io,stickyParents:so,regularRows:co,partiallyVisibleRows:fo,heightMap:po}),e.jsx(Pn,{columnEditorText:R,editColumns:j,headers:Gt,open:Qt,position:I,setOpen:er})]})),!Lo&&e.jsx(In,{mainBodyRef:it,mainBodyWidth:kr,pinnedLeftWidth:Pr,pinnedRightWidth:Ar,pinnedLeftContentWidth:Dr,pinnedRightContentWidth:Fr,tableBodyContainerRef:lt}),!Lo&&e.jsx(U,{currentPage:Wt,footerRenderer:xe,hideFooter:He,onPageChange:Bt,onNextPage:Ze,onUserPageChange:Qe,rowsPerPage:dn,shouldPaginate:xn,totalPages:Math.ceil((null!=Vn?Vn:Xr.length)/dn),totalRows:null!=Vn?Vn:Xr.length})]}))}),e.jsx("div",exports.__assign({"aria-live":"polite","aria-atomic":"true",className:"st-sr-only"},{children:Ir}))]}))}))},Jn=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.fillColor,s=n.fillOpacity,c=void 0===s?.2:s,d=n.strokeWidth,f=void 0===d?2:d,v=n.className,p=void 0===v?"":v,h=n.min,w=n.max;if(!t||0===t.length)return null;var m=void 0!==h?h:Math.min.apply(Math,t),g=(void 0!==w?w:Math.max.apply(Math,t))-m||1,x=a,b=t.map(function(e,n){return{x:n/(t.length-1)*100,y:x-(e-m)/g*x}}).map(function(e,n){return"".concat(0===n?"M":"L"," ").concat(e.x,",").concat(e.y)}).join(" "),y="\n ".concat(b,"\n L ").concat(100,",").concat(x,"\n L 0,").concat(x,"\n Z\n ");return e.jsxs("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(x),preserveAspectRatio:"none",className:"st-line-area-chart ".concat(p),style:{display:"block"}},{children:[e.jsx("path",{d:y,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"})]}))},Yn=Object.freeze({__proto__:null,default:Jn}),Xn=function(n){var t=n.data,r=n.width,o=void 0===r?"100%":r,i=n.height,a=void 0===i?30:i,u=n.color,l=n.gap,s=void 0===l?2:l,c=n.className,d=void 0===c?"":c,f=n.min,v=n.max;if(!t||0===t.length)return null;var p=void 0!==f?f:Math.min.apply(Math,t),h=void 0!==v?v:Math.max.apply(Math,t),w=h-p||1,m=a,g=(100-s*(t.length-1))/t.length,x=0>p,b=x?m*(h/w):m;return e.jsx("svg",exports.__assign({width:o,height:a,viewBox:"0 0 100 ".concat(m),preserveAspectRatio:"none",className:"st-bar-chart ".concat(d),style:{display:"block"}},{children:t.map(function(n,t){var r=t*(g+s),o=(n-p)/w*m,i=m-o,a=o;return x&&(0>n?(a=Math.abs(n)/w*m,i=b):i=b-(a=n/w*m)),e.jsx("rect",{x:r,y:i,width:g,height:a,fill:u||"var(--st-chart-color)",rx:1},t)})}))},$n=Object.freeze({__proto__:null,default:Xn});exports.ANIMATION_CONFIGS=qn,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=_,exports.AngleRightIcon=J,exports.AngleUpIcon=function(n){return e.jsx("svg",exports.__assign({className:n.className,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e.jsx("path",{d:"M5.41 11.41L10 6.83l4.59 4.58L16 10l-6-6-6 6z"})}))},exports.AscIcon=Y,exports.BarChart=Xn,exports.CheckIcon=X,exports.DEFAULT_CUSTOM_THEME=jn,exports.DefaultEmptyState=Kn,exports.DescIcon=$,exports.FilterIcon=Z,exports.LineAreaChart=Jn,exports.ROW_SEPARATOR_WIDTH=1,exports.SelectIcon=Q,exports.SimpleTable=Un,exports.__rest=o,exports.animateWithCustomCoordinates=function(e){var n=e.element,t=e.options;return i(void 0,void 0,void 0,function(){var e,r,o,i,u,l,s,c,d,f,v,p,h,w,m,g;return a(this,function(a){return e=t.startY,r=t.endY,o=t.finalY,u=void 0===(i=t.duration)?300:i,s=void 0===(l=t.easing)?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,d=void 0===(c=t.delay)?0:c,f=t.onComplete,p=void 0===(v=t.respectReducedMotion)||v,Bn()&&p?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),f&&f(),[2]):(h=n.getBoundingClientRect(),m=e-(w=h.top),g=r-w,[2,new Promise(function(e){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),n.style.transform="translate3d(0, ".concat(m,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.style.transition="transform ".concat(u,"ms ").concat(s),d&&(n.style.transitionDelay="".concat(d,"ms")),n.style.transform="translate3d(0, ".concat(g,"px, 0)");var t=function(){n.style.transition="",n.style.transitionDelay="",n.style.transform="",n.style.willChange="",n.style.backfaceVisibility="",n.classList.remove("st-animating"),void 0!==o&&(n.style.top="".concat(o,"px")),n.removeEventListener("transitionend",t),f&&f(),e()};n.addEventListener("transitionend",t),setTimeout(t,u+(d||0)+50)})])})})},exports.calculateBufferRowCount=l,exports.flipElement=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return i(void 0,void 0,void 0,function(){var e,i;return a(this,function(a){switch(a.label){case 0:return e=function(e,n){return{x:("x"in e?e.x:e.left)-n.x,y:("y"in e?e.y:e.top)-n.y}}(r,o),0===e.x&&0===e.y||Bn()&&!1!==t.respectReducedMotion?[2]:(u=t,l=Math.abs(e.x)>Math.abs(e.y)?"column":"row",void 0===u&&(u={}),i=Bn()?exports.__assign(exports.__assign({},qn.REDUCED_MOTION),u):"column"===l?exports.__assign(exports.__assign({},qn.COLUMN_REORDER),u):exports.__assign(exports.__assign({},qn.ROW_REORDER),u),Gn(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,Vn(n,i,t)]);case 1:return a.sent(),[2]}var u,l})})},exports.rowIdToString=T,exports.usePrevious=Ce,exports.useTableContext=j;
|
|
2
|
+
//# sourceMappingURL=index-c9ed7287.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-c9ed7287.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./index-c9ed7287.js");require("react/jsx-runtime"),require("react"),exports.AngleDownIcon=e.AngleDownIcon,exports.AngleLeftIcon=e.AngleLeftIcon,exports.AngleRightIcon=e.AngleRightIcon,exports.AngleUpIcon=e.AngleUpIcon,exports.AscIcon=e.AscIcon,exports.BarChart=e.BarChart,exports.CheckIcon=e.CheckIcon,exports.DEFAULT_CUSTOM_THEME=e.DEFAULT_CUSTOM_THEME,exports.DefaultEmptyState=e.DefaultEmptyState,exports.DescIcon=e.DescIcon,exports.FilterIcon=e.FilterIcon,exports.LineAreaChart=e.LineAreaChart,exports.SelectIcon=e.SelectIcon,exports.SimpleTable=e.SimpleTable,exports.rowIdToString=e.rowIdToString;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@ export declare const DEFAULT_BORDER_WIDTH = 1;
|
|
|
6
6
|
export declare const VIRTUALIZATION_THRESHOLD = 20;
|
|
7
7
|
export declare const OVERSCAN_PIXELS = 800;
|
|
8
8
|
export declare const calculateBufferRowCount: (rowHeight: number) => number;
|
|
9
|
-
export declare const COLUMN_EDIT_WIDTH =
|
|
9
|
+
export declare const COLUMN_EDIT_WIDTH = 29.5;
|
|
10
10
|
export declare const TABLE_HEADER_CELL_WIDTH_DEFAULT = 150;
|
|
11
11
|
export declare const PINNED_BORDER_WIDTH = 1;
|
|
12
12
|
export declare const MAX_PINNED_WIDTH_PERCENT = 0.8;
|