simple-table-core 1.5.5 → 1.5.7
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.
|
@@ -32,6 +32,7 @@ interface SimpleTableProps {
|
|
|
32
32
|
expandIcon?: ReactNode;
|
|
33
33
|
externalFilterHandling?: boolean;
|
|
34
34
|
externalSortHandling?: boolean;
|
|
35
|
+
filterIcon?: ReactNode;
|
|
35
36
|
footerRenderer?: (props: FooterRendererProps) => ReactNode;
|
|
36
37
|
headerCollapseIcon?: ReactNode;
|
|
37
38
|
headerExpandIcon?: ReactNode;
|
package/dist/index.es.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,useLayoutEffect as d,Fragment as h,cloneElement as f,forwardRef as v,useImperativeHandle as p,isValidElement as g,useReducer as w}from"react";var m=function(){return m=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},m.apply(this,arguments)};function y(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function b(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function C(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var S=function(e){return e<480?.3:e<768?.4:.8},I=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=r(l,o)}return o};return r(e,n),t},x=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,x(e.children)),n})},R=function(e){return void 0===e&&(e=0),e?e+1:0},E=function(e,n,t){var r=function(e,n){for(var t=0,r=x(e);t<r.length;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);return!!r&&(t.has(r.accessor)?"parentExpanded"===e.showWhen:"parentCollapsed"===e.showWhen)},N=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},H=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&E(n,r,o))||null},k=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},A=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}).flatMap(function(e){return A(e,n)}):e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen}).flatMap(function(e){return A(e,n)}):[e]},F=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(N({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},W=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(N({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){W(e)})},T=function(e){return"number"==typeof e.minWidth?e.minWidth:40},D=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},M=function(e){return e.row[e.rowIdAccessor]},L=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=M({row:t,rowIdAccessor:c}),h=l[n],f=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:h,position:r,isLastGroupRow:f}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return D(t)?t:[]}(t,h);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},B=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},O=s(void 0),P=function(n){var t=n.children,r=n.value;return e(O.Provider,m({value:r},{children:t}))},q=function(){var e=u(O);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},z=function(r){var i=r.currentPage,a=r.footerRenderer,l=r.hideFooter,c=r.onPageChange,s=r.onNextPage,u=r.rowsPerPage,d=r.shouldPaginate,h=r.totalPages,f=r.totalRows,v=q(),p=v.nextIcon,g=v.prevIcon,w=o(!0),C=w[0],S=w[1],I=!(i>1),x=!(i<h)&&!s||!C&&i===h,R=function(){var e=i-1;e>=1&&c(e)},E=function(){return y(void 0,void 0,void 0,function(){var e,n;return b(this,function(t){switch(t.label){case 0:return e=i===h,n=i+1,s&&e?[4,s(i)]:[3,2];case 1:if(!t.sent())return S(!1),[2];t.label=2;case 2:return(n<=h||s)&&c(n),[2]}})})};if(l||!d)return null;if(a){var N=Math.min((i-1)*u+1,f),H=Math.min(i*u,f);return e(n,{children:a({currentPage:i,totalPages:h,rowsPerPage:u,totalRows:f,startRow:N,endRow:H,onPageChange:c,onNextPage:E,onPrevPage:R,hasNextPage:!x,hasPrevPage:!I,nextIcon:p,prevIcon:g})})}var k=function(){if(h<=15)return Array.from({length:h},function(e,n){return n+1});var e,n,t=[],r=15;if(i<=Math.ceil(7.5))e=1,n=14;else if(i>=h-Math.floor(7.5))e=Math.max(1,h-r+1),n=h;else{var o=Math.floor(7);e=i-o,n=i+(r-o-1)}for(var a=e;a<=n;a++)t.push(a);return n<h-1&&(t.push(-1),t.push(h)),t}();return t("div",m({className:"st-footer"},{children:[e("button",m({className:"st-next-prev-btn ".concat(I?"disabled":""),onClick:R,disabled:I},{children:g})),e("button",m({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:E,disabled:x},{children:p})),k.map(function(n,t){return n<0?e("span",m({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",m({onClick:function(){return function(e){e>=1&&e<=h&&c(e)}(n)},className:"st-page-btn ".concat(i===n?"active":"")},{children:n}),"page-".concat(n))})]}))},j=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},Y=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},G=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,l=Math.max(0,o-a*n),c=o+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(i.length,Math.ceil(c/a));return i.slice(s,u)},U=function(e){return e.position*(e.rowHeight+1)-1},V=function(e){return e.position*(e.rowHeight+1)},K=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,h=n.containerRef,f=n.positioning,v=void 0===f?"fixed":f,p=q().mainBodyRef,g=i(null),w=i(null),y=o("bottom-left"),b=y[0],C=y[1],S=o({}),I=S[0],x=S[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!w.current&&g.current.parentElement&&(w.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&w.current){var e,n=g.current,t=w.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==h?void 0:h.current)?h.current.getBoundingClientRect():(null==p?void 0:p.current)?p.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,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),x(c),N(!0)}})):a||N(!1)},[a,d,h,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(g.current&&!g.current.contains(e.target)){var n=g.current.parentElement;n&&!n.contains(e.target)&&(u(!1),null==r||r())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",m({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:m(m({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},I),{overflow:s})},{children:t})):null},J=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",m({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},X=function(n){var r=n.onBlur,i=n.onChange,a=n.open,l=n.setOpen,c=n.value,s=o(c),u=s[0],d=s[1],h=function(e){d(e),i(e),l(!1),r()};return t(K,m({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(J,m({isSelected:!0===u,onClick:function(){return h(!0)}},{children:"True"})),e(J,m({isSelected:!1===u,onClick:function(){return h(!1)}},{children:"False"}))]}))},_=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},$=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},Q=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=q(),d=u.nextIcon,h=u.prevIcon,f=o(s||new Date),v=f[0],p=f[1],g=o("days"),w=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return t("div",m({className:"st-datepicker"},{children:[t("div",m({className:"st-datepicker-header"},{children:["days"===w&&t(n,{children:[e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),t("div",m({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===w&&e("div",m({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===w&&e("div",m({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),t("div",m({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",m({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e,12,0,0);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=new Date(s),u=o===a.getDate()&&r===a.getMonth()&&t===a.getFullYear();n.push(e("div",m({className:"st-datepicker-day ".concat(i?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=v.getFullYear(),t=v.getMonth(),r=new Date(n,t,e,12,0,0);p(r),l(r),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var g=35-(i+o),w=function(t){n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e,12,0,0);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=g;f++)w(f);return n}(),"months"===w&&(i=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var r=t===v.getMonth();i.push(e("div",m({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",m({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",m({className:"st-datepicker-footer"},{children:e("button",m({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),l(n),null==c||c()}},{children:"Today"}))}))]}))},Z=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2];return new Date(t,r-1,o,12,0,0)}var i=new Date(e);return isNaN(i.getTime())?new Date:new Date(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0)},ee=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},ne=function(e){if(!e)return new Date;if("string"==typeof e)return Z(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:ee(n)}return e instanceof Date?ee(e):new Date},te=function(e){return e?Z(e.toString()):new Date},re=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;c(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e(K,m({open:o,onClose:l,setOpen:i,width:280},{children:e(Q,{value:te(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},oe=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(K,m({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",m({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(J,m({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},ie=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(X,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(re,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(oe,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e($,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(_,{defaultValue:u,onBlur:s,onChange:o})},ae=0,le=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===ae||o-ae>=r)&&(ae=o,n(t))}},ce=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.current},se=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(se);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=se(e[t]));return n},ue=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},de=Date.now(),he={screenX:0,screenY:0},fe=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return C(C([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=fe(o.children,n,C(C([],t,!0),[r],!1));if(i)return i}}return null},ve=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function pe(e,n,t){var r,o,i=se(e),a=!1;try{var l=ve(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=m({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),h=s;i.splice(h,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var ge=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=q().setHeaders,l=ce(t);return{handleDragStart:function(e){n.current=e,de=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var c=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(s-he.screenX,2)+Math.pow(u-he.screenY,2));r.current=a;var h,f=n.current,v=!1;if(ve(f)!==ve(a)){h=(S=pe(t,f,a)).newHeaders,v=S.emergencyBreak}else{var p=t,g=fe(p,f.accessor),w=fe(p,a.accessor);if(!g||!w)return;var m=g.length,y=w.length,b=w;if(m!==y){var C=y-m;C>0&&(b=w.slice(0,-C))}var S=function(e,n,t){var r=se(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);h=S.newHeaders,v=S.emergencyBreak}if(!(c||a.accessor===f.accessor||d<10||JSON.stringify(h)===JSON.stringify(t)||v)){var I=Date.now();JSON.stringify(h)===JSON.stringify(l)&&(I-de<1500||d<40)||(de=I,he={screenX:s,screenY:u},i(h))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return C([],e,!0)}),null==o||o(t)},10)}}},we=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},me={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ye={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},be={duration:150,easing:"ease-out",delay:0},Ce=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")},Se=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,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(){Ce(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Ie=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return y(void 0,void 0,void 0,function(){var e,i,a;return b(this,function(l){switch(l.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,o),0===e.x&&0===e.y?[2]:we()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),we()?m(m({},be),e):m(m({},"column"===n?me:ye),e)}(t,i?"column":"row"),Ce(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,Se(n,a,t)]);case 1:return l.sent(),[2]}})})},xe=function(e){var n=e.element,t=e.options;return y(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,h,f,v,p,g,w;return b(this,function(m){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,a=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,s=t.delay,u=void 0===s?0:s,d=t.onComplete,h=t.respectReducedMotion,f=void 0===h||h,we()&&f?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),d&&d(),[2]):(v=n.getBoundingClientRect(),p=v.top,g=e-p,w=r-p,[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(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(a,"ms ").concat(c),u&&(n.style.transitionDelay="".concat(u,"ms")),n.style.transform="translate3d(0, ".concat(w,"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),d&&d(),e()};n.addEventListener("transitionend",t),setTimeout(t,a+(u||0)+50)})])})})},Re=function(n){var t=n.children,r=n.id,o=n.parentRef,a=n.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children","id","parentRef","tableRow"]),c=q(),s=c.allowAnimations,u=c.isResizing,h=c.isScrolling,f=c.rowHeight,v=i(null),p=i(null),g=ce(h),w=ce(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=p.current;if(!h)if(!g||h)if(!w||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=m(m({},ye),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.scrollTop,C=null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.clientHeight,S=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==C&&void 0!==S){var I=5*f,x=b-I,R=b+C+I,E=l.y>x&&l.y<R,N=i.y>x&&i.y<R,H=i.y<b,k=i.y>b+C,A=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,F=.6*f,W=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(E&&!N&&k){var T=b+C+W(i.y,b,b+C)+A%15*F*2.5+A%7*(.4*f);return void xe({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&H){T=b-W(i.y,b,b+C)-A%15*F*2.5-A%7*(.4*f);return void xe({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var D=b+C+W(l.y,b,b+C)+A%10*F*1;return void xe({element:v.current,options:{startY:D,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y<b){D=b-W(l.y,b,b+C)-A%10*F*1;return void xe({element:v.current,options:{startY:D,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}Ie({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else p.current=i;else p.current=i}},[s,u,h,o,g,w,f,null==a?void 0:a.position,a]),e("div",m({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};Re.displayName="Animate";var Ee=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:m({height:"10px"},r)},{children:e("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"})}))},Ne=function(n){var r=n.checked,o=void 0!==r&&r,i=n.children,a=n.onChange;return t("label",m({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",m({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(Ee,{className:"st-checkbox-checkmark"})})),i]}))},He=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?ne(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},ke=function(n){var r=n.borderClass,s=n.colIndex,u=n.header,d=n.isHighlighted,h=n.isInitialFocused,f=n.nestedIndex,v=n.rowIndex,p=n.tableRow,g=q(),w=g.cellRegistry,y=g.cellUpdateFlash,b=g.columnBorders,C=g.draggedHeaderRef,S=g.enableRowSelection,I=g.expandIcon,x=g.handleMouseDown,R=g.handleMouseOver,E=g.handleRowSelect,H=g.headers,A=g.hoveredHeaderRef,F=g.isCopyFlashing,W=g.isRowSelected,T=g.isWarningFlashing,L=g.onCellEdit,B=g.onCellClick,O=g.onTableHeaderDragEnd,P=g.rowButtons,z=g.rowGrouping,j=g.rowIdAccessor,Y=g.rowsWithSelectedCells,G=g.selectedColumns,U=g.setUnexpandedRows,V=g.tableBodyContainerRef,K=g.theme,J=g.unexpandedRows,X=g.useOddColumnBackground,_=p.depth,$=p.row,Q=o($[u.accessor]),Z=Q[0],ee=Q[1],ne=o(!1),te=ne[0],re=ne[1],oe=o(!1),ae=oe[0],ce=oe[1],se=o(!1),ue=se[0],de=se[1],he=i(null),fe=M({row:$,rowIdAccessor:j}),ve=z&&z[_],pe=!!ve&&function(e,n){if(!n)return!1;var t=e[n];return D(t)}($,ve),we=!J.has(String(fe)),me=F({rowIndex:v,colIndex:s,rowId:fe}),ye=T({rowIndex:v,colIndex:s,rowId:fe}),be=a(function(){var e,n,t;if(!b)return!1;var r=H.filter(function(e){return"left"===e.pinned}),o=H.filter(function(e){return!e.pinned}),i=H.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[b,H,u.accessor,u.pinned]),Ce=ge({draggedHeaderRef:C,headers:H,hoveredHeaderRef:A,onTableHeaderDragEnd:O}).handleDragOver,Se=le(),Ie=N({accessor:u.accessor,rowId:fe}),xe=k({rowId:fe,accessor:u.accessor}),Ee=u.isSelectionColumn&&S;c(function(){if(w){var e="".concat(fe,"-").concat(u.accessor);return w.set(e,{updateContent:function(e){Z!==e?(ee(e),y&&(ce(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){ce(!1)},800))):ee(e)}}),function(){w.delete(e),he.current&&clearTimeout(he.current)}}},[w,y,fe,u.accessor,Z]),c(function(){if(ae){var e=setTimeout(function(){ce(!1)},850);return function(){return clearTimeout(e)}}},[ae]),c(function(){ee($[u.accessor])},[$,u.accessor]);var ke="boolean"===u.type||"date"===u.type||"enum"===u.type,Ae=Boolean(null==u?void 0:u.isEditable),Fe=G.has(s),We=d&&!Fe,Te=a(function(){return!!Ee&&Y.has(String(fe))},[Ee,Y,fe]),De="st-cell ".concat(_>0&&u.expandable?"st-cell-depth-".concat(_):""," ").concat(We?h?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Fe?h?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ae?"clickable":""," ").concat(ae?h?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?h?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ye?h?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(X?f%2==0?"even-column":"odd-column":""," ").concat(Ee?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(be?"st-last-column":""),Me=l(function(e){null==e&&(e="number"===u.type?0:"boolean"!==u.type&&""),ee(e),$[u.accessor]=e,null==L||L({accessor:u.accessor,newValue:e,row:$,rowIndex:v})},[u.accessor,u.type,L,$,v]),Le=l(function(){U(function(e){var n=new Set(e),t=String(fe);return n.has(t)?n.delete(t):n.add(t),n})},[fe,U]);return!te||ke||Ee?t(Re,m({className:De,"data-accessor":u.accessor,"data-col-index":s,"data-row-id":fe,"data-row-index":v,id:Ie,onClick:function(){B&&!Ee&&B({accessor:u.accessor,colIndex:s,row:$,rowId:fe,rowIndex:v,value:Z})},onDoubleClick:function(){return u.isEditable&&!Ee&&re(!0)},onDragOver:function(e){Ee||Se({callback:Ce,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){te||Ee||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||te||(e.preventDefault(),re(!0))},onMouseDown:function(){te||Ee||x({rowIndex:v,colIndex:s,rowId:fe})},onMouseEnter:function(){de(!0)},onMouseLeave:function(){de(!1)},onMouseOver:function(){te||Ee||R({rowIndex:v,colIndex:s,rowId:fe})},parentRef:V,tableRow:p},{children:[u.expandable&&pe?e("div",m({className:"st-icon-container st-expand-icon-container ".concat(we?"expanded":"collapsed"),onClick:Le},{children:I})):null,e("span",m({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:Ee?t("div",m({className:"st-selection-cell-content"},{children:[e("div",m({className:"st-selection-control"},{children:ue||W&&W(String(fe))?e(Ne,{checked:!!W&&W(String(fe)),onChange:function(e){E&&E(String(fe),e)}}):e("span",m({className:"st-row-number"},{children:v+1}))})),function(){if(!P||!Ee||0===P.length)return null;if(!(ue||W&&W(String(fe))))return null;var n={row:$};return e("div",m({className:"st-row-buttons"},{children:P.map(function(t,r){return e("span",m({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:$,theme:K}):He({content:Z,header:u})})})),te&&ke&&!Ee&&e(ie,{enumOptions:u.enumOptions,onChange:Me,setIsEditing:re,type:u.type,value:Z})]}),xe):e("div",m({className:"st-cell-editing",id:N({accessor:u.accessor,rowId:fe}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(ie,{enumOptions:u.enumOptions,onChange:Me,setIsEditing:re,type:u.type,value:Z})}))},Ae=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,a=t.pinned,l=t.rowIndex,c=t.rowIndices,s=t.tableRow,u=q(),d=u.rowIdAccessor,h=u.collapsedHeaders,f=i.filter(function(e){return H({header:e,pinned:a,headers:i,collapsedHeaders:h})});return e(n,{children:f.map(function(n,t){var u=M({row:s.row,rowIdAccessor:d}),h=N({accessor:n.accessor,rowId:u});return e(Fe,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},h)})})},Fe=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=t[r.accessor],d=q(),f=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,w=d.collapsedHeaders,m=M({row:s.row,rowIdAccessor:g});if(r.children&&r.children.length>0){var y=r.children.filter(function(e){return H({header:e,pinned:a,headers:o,collapsedHeaders:w})});return e(h,{children:y.map(function(n){var r=N({accessor:n.accessor,rowId:m});return e(Fe,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var b={rowIndex:l,colIndex:u,rowId:m},C=f(b),S=v(b),I=p(b),x=N({accessor:r.accessor,rowId:m});return e(ke,{borderClass:C,colIndex:u,header:r,isHighlighted:S,isInitialFocused:I,nestedIndex:i,rowIndex:l,tableRow:s},x)},We=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,l=n.pinned,c=n.rowHeight,s=n.rowIndices,u=n.setHoveredIndex,d=n.tableRow,h=q(),f=h.useHoverRowBackground,v=h.rowIdAccessor,p=h.isAnimating,g=h.isRowSelected,w=h.useOddEvenRowBackground,y=d.position,b=y%2==0,C=M({row:d.row,rowIdAccessor:v}),S=!!g&&g(String(C));return e("div",m({className:"st-row ".concat(w?b?"even":"odd":""," ").concat(S?"selected":""),"data-index":a,onMouseEnter:function(){!p&&f&&u(a)},style:{gridTemplateColumns:o,top:V({position:y,rowHeight:c}),height:"".concat(c,"px")}},{children:e(Ae,{columnIndexStart:r,columnIndices:t,headers:i,pinned:l,rowIndex:y,rowIndices:s,tableRow:d},C)}))},Te=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",m({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var h=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(h)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:U({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},De=s(void 0),Me=function(e){var n=e.childRef,t=e.children,r=e.group,o=void 0===r?"default":r,i=function(){var e=u(De);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),a=i.registerPane,l=i.unregisterPane;return c(function(){var e=[o];return n.current&&a(n.current,e),function(){n.current&&l(n.current,e)}},[n,a,l,o]),f(t,{ref:function(e){n.current=e}})},Le=v(function(n,r){var o=n.columnIndexStart,l=n.columnIndices,c=n.headers,s=n.pinned,u=n.rowHeight,d=n.rowIndices,f=n.setHoveredIndex,v=n.templateColumns,g=n.totalHeight,w=n.rowsToRender,y=n.width,b=s?"st-body-pinned-".concat(s):"st-body-main",C=q().rowIdAccessor,S=i(null);if(p(r,function(){return S.current},[]),!a(function(){return ue(c,s)},[c,s]))return null;var I=s?"pinned-".concat(s):"default";return e(Me,m({childRef:S,group:I},{children:e("div",m({className:b,ref:S,style:m({position:"relative",height:"".concat(g,"px"),width:y},!s&&{flexGrow:1})},{children:w.map(function(n,r){var i=M({row:n.row,rowIdAccessor:C});return t(h,{children:[0!==r&&e(Te,{displayStrongBorder:n.isLastGroupRow,position:n.position,rowHeight:u,templateColumns:v,rowIndex:r-1}),e(We,{columnIndexStart:o,columnIndices:l,gridTemplateColumns:v,headers:c,index:r,pinned:s,rowHeight:u,rowIndices:d,setHoveredIndex:f,tableRow:n},i)]},i)})}))}))});function Be(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=C(C(C([],t,!0),n,!0),r,!0),c=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return H({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&H({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Le.displayName="TableSection";var Oe=function(n){var r=n.mainTemplateColumns,s=n.pinnedLeftColumns,u=n.pinnedLeftTemplateColumns,d=n.pinnedLeftWidth,h=n.pinnedRightColumns,f=n.pinnedRightTemplateColumns,v=n.pinnedRightWidth,p=n.rowsToRender,g=n.setScrollTop,w=n.tableRows,y=q(),b=y.collapsedHeaders,C=y.headerContainerRef,S=y.headers,I=y.isAnimating,x=y.mainBodyRef,R=y.onLoadMore,E=y.rowHeight,N=y.rowIdAccessor,H=y.scrollbarWidth,k=y.setIsScrolling,A=y.shouldPaginate,F=y.tableBodyContainerRef,W=o(!1),T=W[0],D=W[1],L=i(new Set),B=l(function(e){(L.current.forEach(function(e){return e.classList.remove("hovered")}),L.current.clear(),null!==e)&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),L.current.add(e)})},[]);c(function(){I&&B(null)},[I,B]),function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=i[1];c(function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[n,a,r]),c(function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:C,mainSectionRef:F,scrollbarWidth:H}),c(function(){return function(){P.current&&clearTimeout(P.current)}},[]);var O=i(null),P=i(null),z=i(0),j=function(e){return e.length}(w),Y=j*(E+1)-1,G=a(function(){return Be({headers:S,pinnedLeftColumns:s,pinnedRightColumns:h,collapsedHeaders:b})},[S,s,h,b]),U=a(function(){var e={};return p.forEach(function(n,t){var r=String(M({row:n.row,rowIdAccessor:N}));e[r]=t}),e},[p,N]),V=l(function(e,n){if(R&&!A&&!T){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(D(!0),R(),setTimeout(function(){D(!1)},1e3))}},[R,A,T]),K={columnIndices:G,headerContainerRef:C,headers:S,rowHeight:E,rowIndices:U,rowsToRender:p,setHoveredIndex:B};return t("div",m({className:"st-body-container",onMouseLeave:function(){return B(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;k(!0),P.current&&clearTimeout(P.current),P.current=setTimeout(function(){k(!1)},150),O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(function(){g(t),V(n,t),z.current=t})},ref:F},{children:[e(Le,m({},K,{pinned:"left",templateColumns:u,totalHeight:Y,width:d})),e(Le,m({},K,{columnIndexStart:s.length,ref:x,templateColumns:r,totalHeight:Y})),e(Le,m({},K,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:f,totalHeight:Y,width:v}))]}))},Pe=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,s="touches"in n;if(t&&!t.hide){i(!0);var u,d=T(t);if(t.children&&t.children.length>0){var h=A(t,l);u=h.length>0?h:[t]}else u=[t];var f=function(e){var n="right"===t.pinned?c-e:e-c,i=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=i*S(window.innerWidth);if(!n.pinned)return Math.max(.6*i,600);var l=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+A(n,r).reduce(function(e,n){return e+F(n)},0)},0),c=T(n);return l<c?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):l}({header:t,headers:r,collapsedHeaders:l});if(u.length>1)qe({delta:n,leafHeaders:u,minWidth:d,startWidth:a,maxWidth:i});else{var s=Math.max(Math.min(a+n,i),d);u[0].width=s}r.forEach(function(e){W(e)});var h=C([],r,!0);o(h)};if(s){var v=function(e){var n=e.touches[0];f(n.clientX)},p=function(){document.removeEventListener("touchmove",v),document.removeEventListener("touchend",p),i(!1)};document.addEventListener("touchmove",v),document.addEventListener("touchend",p)}else{var g=function(e){f(e.clientX)},w=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",w),i(!1)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",w)}}},qe=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,T(n))},40),l=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),c=Math.max(Math.min(o+n,i),a)-l;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=c*(n/l),o=Math.max(n+t,r);e.width=o})},ze=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:m({height:"1em"},r)},{children:e("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"})}))},je={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"},Ye=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"]}},Ge=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ue=function(e){return["between","notBetween","in","notIn"].includes(e)},Ve=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ke=function(n){var t=n.children;return e("div",m({className:"st-filter-container"},{children:t}))},Je=function(){return e("svg",m({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("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Xe=function(n){var r=n.value,a=n.onChange,l=n.options,s=n.placeholder,u=void 0===s?"Select...":s,d=n.className,h=void 0===d?"":d,f=n.disabled,v=void 0!==f&&f,p=o(!1),g=p[0],w=p[1],y=o(-1),b=y[0],C=y[1],S=i(null),I=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),w(!1),C(-1));break;case"Escape":e.preventDefault(),w(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return t("div",m({ref:S,className:"st-custom-select ".concat(h," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[t("button",m({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(w(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",m({className:"st-custom-select-value"},{children:I?I.label:u})),e(Je,{})]})),e(K,m({open:g,setOpen:w,onClose:function(){w(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",m({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",m({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void C(-1);var e}},{children:n.label}),t)})}))}))]}))},_e=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:je[e]}});return e("div",m({className:"st-filter-section"},{children:e(Xe,{value:t,onChange:function(e){r(e)},options:o})}))},$e=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className,u=void 0===s?"":s,d=n.onEnterPress;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(u).trim()})},Qe=function(n){var t=n.children,r=n.className;return e("div",m({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Ze=function(n){var r=n.onApply,o=n.onClear,i=n.canApply,a=n.showClear;return t("div",m({className:"st-filter-actions"},{children:[e("button",m({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",m({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},en=function(n){var r=n.header,i=n.currentFilter,a=n.onApplyFilter,l=n.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],h=o(String((null==i?void 0:i.value)||"")),f=h[0],v=h[1],p=Ye("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=m({accessor:r.accessor,operator:u},Ge(u)&&{value:f});a(e)},w=Ve(u)||f.trim();return t(Ke,{children:[e(_e,{value:u,onChange:d,operators:p}),Ge(u)&&e(Qe,{children:e($e,{type:"text",value:f,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(Ze,{onApply:g,onClear:l,canApply:!!w,showClear:!!i})]})},nn=function(n){var r,i,a=n.header,l=n.currentFilter,s=n.onApplyFilter,u=n.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),h=d[0],f=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],w=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),m=w[0],y=w[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],S=b[1],I=Ye("number");c(function(){var e,n;l?(f(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),S(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(f("equals"),g(""),y(""),S(""))},[l]);var x=function(){var e={accessor:a.accessor,operator:h};Ge(h)?e.value=parseFloat(p):Ue(h)&&(e.values=[parseFloat(m.toString()),parseFloat(C.toString())]),s(e)};return t(Ke,{children:[e(_e,{value:h,onChange:f,operators:I}),Ge(h)&&e(Qe,{children:e($e,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:x})}),Ue(h)&&t(Qe,{children:[e($e,{type:"number",value:m,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:x}),e($e,{type:"number",value:C,onChange:S,placeholder:"To...",onEnterPress:x})]}),e(Ze,{onApply:x,onClear:u,canApply:!!Ve(h)||(Ge(h)?""!==p.trim():!!Ue(h)&&""!==String(m).trim()&&""!==String(C).trim()),showClear:!!l})]})},tn=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(Xe,{value:t,onChange:r,options:o,className:a,placeholder:l})},rn=function(n){var r=n.header,i=n.currentFilter,a=n.onApplyFilter,l=n.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],h=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),f=h[0],v=h[1],p=Ye("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Ve(u)||""!==f;return t(Ke,{children:[e(_e,{value:u,onChange:d,operators:p}),Ge(u)&&e(Qe,{children:e(tn,{value:f,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Ze,{onApply:function(){var e={accessor:r.accessor,operator:u};Ge(u)&&(e.value="true"===f),a(e)},onClear:l,canApply:g,showClear:!!i})]})},on=function(n){var r,a,l=n.header,s=n.currentFilter,u=n.onApplyFilter,d=n.onClearFilter,h=o((null==s?void 0:s.operator)||"equals"),f=h[0],v=h[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],w=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],S=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),I=S[0],x=S[1],R=Ye("date");c(function(){var e,n;s?(v(s.operator),w(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),C(""),x(""))},[s]);var E=function(n){var r=n.value,a=n.onChange,l=n.placeholder,s=n.autoFocus,u=n.className,d=o(!1),h=d[0],f=d[1],v=o(""),p=v[0],g=v[1],w=i(null);c(function(){if(r){var e=ne(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&w.current&&w.current.focus()},[s]);var y=r?ne(r):new Date;return t("div",m({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:w,type:"text",value:p,placeholder:l,onClick:function(){f(!h)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),f(!h)):"Escape"===e.key&&f(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(K,m({open:h,setOpen:f,onClose:function(){f(!1)},positioning:"absolute",overflow:"visible"},{children:e(Q,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),f(!1)},onClose:function(){return f(!1)}})}))]}))};return t(Ke,{children:[e(_e,{value:f,onChange:v,operators:R}),Ge(f)&&e(Qe,{children:e(E,{value:g,onChange:w,placeholder:"Select date...",autoFocus:!0})}),Ue(f)&&t(Qe,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:I,onChange:x,placeholder:"To date..."})]}),e(Ze,{onApply:function(){var e={accessor:l.accessor,operator:f};Ge(f)?e.value=g:Ue(f)&&(e.values=[b,I]),u(e)},onClear:d,canApply:!!Ve(f)||(Ge(f)?""!==g.trim():!!Ue(f)&&""!==b.trim()&&""!==I.trim()),showClear:!!s})]})},an=function(n){var r=n.header,i=n.currentFilter,l=n.onApplyFilter,s=n.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),h=o((null==i?void 0:i.values)?i.values.map(String):d),f=h[0],v=h[1],p=o(""),g=p[0],w=p[1],y=a(function(){if(!g)return u;var e=g.toLowerCase();return u.filter(function(n){return n.label.toLowerCase().includes(e)})},[u,g]);c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var b=f.length===d.length,S=u.length>10;return t(Ke,{children:[e(Qe,{children:t("div",m({className:"st-enum-filter-options"},{children:[e("div",m({className:"st-enum-select-all"},{children:e(Ne,m({checked:b,onChange:function(e){v(e?d:[])}},{children:e("span",m({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),S&&e("div",m({className:"st-enum-search"},{children:e($e,{type:"text",value:g,onChange:w,placeholder:"Search..."})})),y.map(function(n,t){return e(Ne,m({checked:f.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):C(C([],n,!0),[e],!1)});var e}},{children:e("span",m({className:"st-enum-option-label"},{children:n.label}))}),t)}),g&&0===y.length&&e("div",m({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e(Ze,{onApply:function(){if(f.length!==d.length){var e={accessor:r.accessor,operator:"in",values:f};l(e)}else s()},onClear:s,canApply:0!==f.length&&f.length!==d.length,showClear:!!i})]})},ln=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter;return e(n,{children:function(){switch(r.type){case"number":return e(nn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(rn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(on,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(an,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},cn=function(r){var a=r.content,l=r.children,s=r.delay,u=void 0===s?500:s,d=o(!1),h=d[0],v=d[1],p=o({top:0,left:0}),w=p[0],y=p[1],b=i(null),C=i(null);if(c(function(){return function(){b.current&&clearTimeout(b.current)}},[]),!a||!g(l))return e(n,{children:l});var S=f(l,{ref:C,onMouseEnter:function(){b.current=setTimeout(function(){if(C.current&&a.trim()){var e=C.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,t=e.bottom+8;n<8?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),t+40>window.innerHeight-8&&(t=e.top-40-8),y({top:t,left:n}),v(!0)}}},u)},onMouseLeave:function(){b.current&&(clearTimeout(b.current),b.current=null),v(!1)}});return t(n,{children:[S,h&&e("div",m({className:"st-tooltip",style:{position:"fixed",top:"".concat(w.top,"px"),left:"".concat(w.left,"px"),zIndex:1e4}},{children:a}))]})},sn=function(n){var r,s,u=n.colIndex,d=n.gridColumnEnd,h=n.gridColumnStart,f=n.gridRowEnd,v=n.gridRowStart,p=n.header,g=n.reverse,w=n.sort,y=o(!1),b=y[0],S=y[1],x=o(!1),R=x[0],E=x[1],H=o(p.label||""),k=H[0],A=H[1],F=q(),W=F.activeHeaderDropdown,T=F.areAllRowsSelected,D=F.collapsedHeaders,M=F.columnBorders,L=F.columnReordering,B=F.columnResizing,O=F.columnsWithSelectedCells,P=F.draggedHeaderRef,z=F.enableHeaderEditing,j=F.enableRowSelection,Y=F.filters,G=F.handleApplyFilter,U=F.handleClearFilter,V=F.handleSelectAll,J=F.headerCollapseIcon,X=F.headerDropdown,$=F.headerExpandIcon,Q=F.headerRegistry,Z=F.headers,ee=F.hoveredHeaderRef,ne=F.onColumnOrderChange,te=F.onColumnSelect,re=F.onHeaderEdit,oe=F.onSort,ie=F.onTableHeaderDragEnd,ae=F.headerHeight,ce=F.selectColumns,se=F.selectableColumns,ue=F.selectedColumns,de=F.setActiveHeaderDropdown,he=F.setCollapsedHeaders,fe=F.setHeaders,ve=F.setInitialFocusedCell,pe=F.setIsResizing,we=F.setSelectedCells,me=F.setSelectedColumns,ye=F.sortDownIcon,be=F.sortUpIcon,Ce=Boolean(null==p?void 0:p.isSortable),Se=Boolean(null==p?void 0:p.filterable),Ie=Y[p.accessor],xe=(null==W?void 0:W.accessor)===p.accessor,Ee=p.isSelectionColumn&&j,He=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(p),ke=D.has(p.accessor),Ae=function(e){var n=e.isOpen,t=e.estimatedHeight,r=void 0===t?200:t,a=e.estimatedWidth,l=void 0===a?250:a,s=e.margin,u=void 0===s?4:s,d=i(null),h=o({}),f=h[0],v=h[1];return c(function(){if(n&&d.current){var e=function(){if(d.current){var e=d.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,o=window.innerWidth-e.right,i="bottom",a={};r>n&&r<=t&&(i="top");var c="left";l>o+e.width&&(c="right"),"bottom"===i?a.top=e.bottom+u:a.bottom=window.innerHeight-e.top+u,"left"===c?a.left=e.left:a.right=window.innerWidth-e.right,v(a)}};requestAnimationFrame(e);var t=function(){return requestAnimationFrame(e)},o=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}v({})},[n,r,l,u]),{triggerRef:d,position:f}}({isOpen:xe,estimatedHeight:200,estimatedWidth:250,margin:4}),Fe=Ae.triggerRef,We=Ae.position,Te=a(function(){var e,n,t;if(!M)return!1;var r=Z.filter(function(e){return"left"===e.pinned}),o=Z.filter(function(e){return!e.pinned}),i=Z.filter(function(e){return"right"===e.pinned});return"left"===p.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===p.accessor:"right"===p.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===p.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===p.accessor},[M,Z,p.accessor,p.pinned]),De=a(function(){return!(!se||Ee)&&I(p,u).some(function(e){return ue.has(e)})},[se,Ee,p,u,ue]),Me=a(function(){return!Ee&&I(p,u).some(function(e){return O.has(e)})},[Ee,p,u,O]),Le=a(function(){return!(!p.children||0===p.children.length)&&(!ke||p.children.some(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}))},[p.children,ke]),Be="st-header-cell ".concat(p.accessor===(null===(r=ee.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(s=P.current)||void 0===s?void 0:s.accessor)===p.accessor?"st-dragging":""," ").concat(Ce?"clickable":""," ").concat(L&&!Ce?"columnReordering":""," ").concat(Le?"parent":""," ").concat(Te?"st-last-column":""," ").concat(z&&!Ee?"st-header-editable":""," ").concat(De?"st-header-selected":""," ").concat(Me&&!De?"st-header-has-highlighted-cell":""),Oe=ge({draggedHeaderRef:P,headers:Z,hoveredHeaderRef:ee,onColumnOrderChange:ne,onTableHeaderDragEnd:ie}),qe=Oe.handleDragStart,je=Oe.handleDragEnd,Ye=Oe.handleDragOver,Ge=le();c(function(){if(Q&&!p.isSelectionColumn){var e=String(p.accessor);return Q.set(e,{setEditing:function(e){E(e)}}),function(){Q.delete(e)}}},[Q,p.accessor,p.isSelectionColumn]),c(function(){A(p.label||"")},[p.label]);var Ue=l(function(e){A(e);var n=Z.map(function(n){return n.accessor===p.accessor?m(m({},n),{label:e}):n});fe(n),re&&re(p,e)},[Z,fe,re,p]),Ve=l(function(){de&&de(null)},[de]),Ke=l(function(e){e.stopPropagation(),he(function(e){var n=new Set(e);return ke?n.delete(p.accessor):n.add(p.accessor),n})},[he,ke,p.accessor]),Je=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(se){var r=I(t,u),o=r.some(function(e){return ue.has(e)});if(z&&o&&!n.shiftKey)return X&&xe&&Ve(),void E(!0);n.shiftKey&&ce?me(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);t<i&&(i=t,o=e)});var a,l,c,s,u=C(C([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(C(C([],Array.from(e),!0),u,!0))}):ce&&ce(r),we(new Set),ve(null)}te&&te(t),!se&&t.isSortable&&oe(t.accessor)}};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!p)return null;var Xe=B&&!Ee&&e("div",m({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(N({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Pe,callbackProps:{event:e.nativeEvent,gridColumnEnd:d,gridColumnStart:h,header:p,headers:Z,setHeaders:fe,setIsResizing:pe,startWidth:t,collapsedHeaders:D},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(N({accessor:p.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ge({callback:Pe,callbackProps:{event:e,gridColumnEnd:d,gridColumnStart:h,header:p,headers:Z,setHeaders:fe,setIsResizing:pe,startWidth:t,collapsedHeaders:D},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),_e=w&&w.key.accessor===p.accessor&&t("div",m({className:"st-icon-container",onClick:function(e){return Je({event:e,header:p})}},{children:["ascending"===w.direction&&be&&be,"descending"===w.direction&&ye&&ye]})),$e=Se&&t("div",m({className:"st-icon-container",onClick:function(e){e.stopPropagation(),S(!b)}},{children:[e(ze,{className:"st-header-icon",style:{fill:Ie?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(K,m({open:b,overflow:"visible",setOpen:S,onClose:function(){return S(!1)}},{children:e(ln,{header:p,currentFilter:Ie,onApplyFilter:function(e){G(e),S(!1)},onClearFilter:function(){U(p.accessor),S(!1)}})}))]})),Qe=He&&!Ee&&e("div",m({className:"st-icon-container st-collapse-icon-container",onClick:Ke},{children:ke?J:$}));return t(Re,m({className:Be,id:N({accessor:p.accessor,rowId:"header"}),onDragOver:function(e){Ee||Ge({callback:Ye,callbackProps:{event:e,hoveredHeader:p},limit:50})},style:m({gridRowStart:v,gridRowEnd:f,gridColumnStart:h,gridColumnEnd:d},f-v>1?{}:{height:ae})},{children:[g&&Xe,"right"===p.align&&Qe,"right"===p.align&&$e,"right"===p.align&&_e,e("div",m({ref:Fe,className:"st-header-label",draggable:L&&!p.disableReorder&&!Ee,onClick:function(e){Ee||Je({event:e,header:p})},onDoubleClick:function(e){Ee||function(e){e.event;var n=e.header;n.isSelectionColumn||se&&n.isSortable&&oe(n.accessor)}({event:e,header:p})},onDragEnd:Ee?void 0:function(e){e.preventDefault(),je()},onDragStart:Ee?void 0:function(e){L&&p&&function(e){qe(e)}(p)}},{children:e(cn,m({content:p.tooltip||""},{children:e("span",m({className:"st-header-label-text ".concat("right"===p.align?"right-aligned":"center"===p.align?"center-aligned":"left-aligned")},{children:Ee?e(Ne,{checked:!!T&&T(),onChange:function(e){V&&V(e)}}):R?e(_,{defaultValue:k,onBlur:function(){return E(!1)},onChange:Ue}):p.headerRenderer?p.headerRenderer({accessor:p.accessor,colIndex:u,header:p}):k||(null==p?void 0:p.label)}))}))})),"right"!==p.align&&_e,"right"!==p.align&&$e,"right"!==p.align&&Qe,!g&&Xe,X&&!Ee&&e("div",m({className:"st-header-dropdown-container"},{children:X({accessor:p.accessor,colIndex:u,header:p,isOpen:xe,onClose:Ve,position:We})}))]}))},un=function(t){var r=t.columnIndices,o=t.gridTemplateColumns,i=t.handleScroll,l=t.headers,c=t.maxDepth,s=t.pinned,u=t.sectionRef,d=t.sort,h=t.width,f=q().collapsedHeaders,v=a(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!H({header:o,pinned:s,headers:l,collapsedHeaders:f}))return 0;a||n++;var h=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return H({header:e,pinned:s,headers:l,collapsedHeaders:f})}).length)&&void 0!==d?d:0,v=n,p=h>0?v+h:v+1,g=i,w=h>0?i+1:c+1;if(e.push({header:o,gridColumnStart:v,gridColumnEnd:p,gridRowStart:g,gridRowEnd:w,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var m=!0;o.children.forEach(function(e){H({header:e,pinned:s,headers:l,collapsedHeaders:f})&&(t(e,i+1,m),m=!1)})}return p-v},o=l.filter(function(e){return H({header:e,pinned:s,headers:l,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r,f]),p=s?"pinned-".concat(s):"default";return e(Me,m({childRef:u,group:p},{children:e("div",m({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,width:h,position:"relative"}},{children:e(n,{children:v.map(function(n){return e(sn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},dn=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(dn)):1},hn=function(n){var r=n.centerHeaderRef,o=n.headers,i=n.mainTemplateColumns,l=n.pinnedLeftColumns,c=n.pinnedLeftTemplateColumns,s=n.pinnedRightColumns,u=n.pinnedRightTemplateColumns,d=n.sort,h=n.pinnedLeftWidth,f=n.pinnedRightWidth,v=q(),p=v.headerContainerRef,g=v.pinnedLeftRef,w=v.pinnedRightRef,y=v.collapsedHeaders,b=a(function(){return Be({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s,collapsedHeaders:y})},[o,l,s,y]),S=a(function(){var e=0,n=C(C(C([],l,!0),o,!0),s,!0);return o.forEach(function(t){if(H({header:t,headers:n,collapsedHeaders:y})){var r=dn(t);e=Math.max(e,r)}}),{maxDepth:e}},[o,l,s,y]).maxDepth;return t("div",m({className:"st-header-container",ref:p},{children:[ue(o,"left")&&e(un,{columnIndices:b,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:S,pinned:"left",sectionRef:g,sort:d,width:h}),e(un,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:S,sectionRef:r,sort:d}),ue(o,"right")&&e(un,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:S,pinned:"right",sectionRef:w,sort:d,width:f})]}))},fn=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen});r({headers:i,flattenedHeaders:o})}else o.push(e)}),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},vn=function(n){var r=n.pinnedLeftWidth,o=n.pinnedRightWidth,l=n.setScrollTop,c=n.sort,s=n.tableRows,u=n.rowsToRender,d=q(),h=d.columnResizing,f=d.editColumns,v=d.headers,p=d.collapsedHeaders,g=i(null),w=v.filter(function(e){return!e.pinned}),y=v.filter(function(e){return"left"===e.pinned}),b=v.filter(function(e){return"right"===e.pinned}),C=a(function(){return fn({headers:y,collapsedHeaders:p})},[y,p]),S=a(function(){return fn({headers:w,collapsedHeaders:p})},[w,p]),I=a(function(){return fn({headers:b,collapsedHeaders:p})},[b,p]),x={centerHeaderRef:g,headers:v,mainTemplateColumns:S,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedRightColumns:b,pinnedRightTemplateColumns:I,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},R={tableRows:s,mainTemplateColumns:S,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedLeftWidth:r,pinnedRightColumns:b,pinnedRightTemplateColumns:I,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return t("div",m({className:"st-content ".concat(h?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e(hn,m({},x)),e(Oe,m({},R))]}))},pn=function(n){var r=n.mainBodyWidth,a=n.mainBodyRef,l=n.pinnedLeftWidth,s=n.pinnedRightWidth,u=n.pinnedLeftContentWidth,d=n.pinnedRightContentWidth,h=n.tableBodyContainerRef,f=q().editColumns,v=o(!1),p=v[0],g=v[1],w=i(null),y=i(null),b=i(null),C=h.current&&h.current.scrollHeight>h.current.clientHeight,S=f?28:0,I=(f?s+1:s)+(h.current&&C?h.current.offsetWidth-h.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(a.current){var e=a.current.clientWidth;g(r>e)}}()},1)},[a,r]),p?t("div",m({className:"st-horizontal-scrollbar-container"},{children:[l>0&&e(Me,m({childRef:y,group:"pinned-left"},{children:e("div",m({className:"st-horizontal-scrollbar-left",ref:y,style:{width:l}},{children:e("div",{style:{width:u}})}))})),r>0&&e(Me,m({childRef:w},{children:e("div",m({className:"st-horizontal-scrollbar-middle",ref:w},{children:e("div",{style:{width:r}})}))})),s>0&&e(Me,m({childRef:b,group:"pinned-right"},{children:e("div",m({className:"st-horizontal-scrollbar-right",ref:b,style:{width:I}},{children:e("div",{style:{width:d}})}))})),S>0&&e("div",{style:{width:S-1.5,height:"100%",flexShrink:0}})]})):null},gn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return gn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?gn.string(e,n,t):"number"==typeof e&&"number"==typeof n?gn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?gn.boolean(e,n,t):gn.string(String(e),String(n),t)}},wn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return C([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return gn.number(i,a,r)}return"date"===t?gn.date(String(e),String(n),r):"boolean"===t?gn.boolean(Boolean(e),Boolean(n),r):"enum"===t?gn.enum(String(e),String(n),r):gn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},mn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return wn({rows:t,sortColumn:r,headers:n})},yn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):mn({headers:i,rows:t,sortColumn:r}):t},bn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;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}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(bn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},Cn=function(e){return e.every(function(e){return e.hide})},Sn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Sn(e.children),Cn(e.children)&&(e.hide=!0))})},In=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),h=d[0],f=d[1],v=q(),p=v.expandIcon,g=v.headers,w=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",b=s.children&&s.children.length>0,S=null!=u?u:s.hide||b&&s.children&&Cn(s.children);return t(n,{children:[t("div",m({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",m({className:"st-header-icon-container"},{children:b?e("div",m({className:"st-collapsible-header-icon st-expand-icon-container ".concat(h?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!h)}},{children:p})):null})),e(Ne,m({checked:S,onChange:function(e){(s.hide=e,e)?Sn(i):(bn(i,s.accessor),b&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,bn(i,s.children[0].accessor)));w(C([],g,!0))}},{children:s.label}))]})),b&&h&&s.children&&e("div",m({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(In,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!S||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},xn=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",m({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",m({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e(In,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},Rn=function(n){var r=n.columnEditorText,i=n.editColumns,a=n.editColumnsInitOpen,l=n.headers,c=n.position,s=void 0===c?"right":c,u=o(a),d=u[0],h=u[1];return i?t("div",m({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){h(e)}(!d)},style:{width:28}},{children:[e("div",m({className:"st-column-editor-text"},{children:r})),e(xn,{headers:l,open:d,position:s})]})):null},En=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("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"})}))},Nn=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("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"})}))},Hn=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach(function(n){e!==n&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),h=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(De.Provider,m({value:{registerPane:d,unregisterPane:h}},{children:r.Children.only(t)}))},kn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=je[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},An=function(){var n=q(),r=n.filters,o=n.handleClearFilter,i=n.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",m({className:"st-filter-bar"},{children:e("div",m({className:"st-filter-bar-content"},{children:e("div",m({className:"st-filter-chips"},{children:a.map(function(n){return t("div",m({className:"st-filter-chip"},{children:[e("span",m({className:"st-filter-chip-text"},{children:kn(n,i)})),e("button",m({className:"st-filter-chip-remove",onClick:function(){return o(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},Fn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).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||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(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(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var h=o.map(Number);return u=h[0],d=h[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=ne(e),v=ne(String(r||"")),p=ee(f),g=ee(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var w=o.map(function(e){return ee(ne(String(e||"")))}),m=w[0],y=w[1];return p>=m&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return ee(ne(String(e||"")))});return m=b[0],y=b[1],p<m||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(Array.isArray(e)){var S=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=S}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var I=String(e),x=o.includes(I);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return R===E;case"notEquals":return R!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},Wn=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return x(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&D(l)){var c=i(l,t+1),s=m({},n);return s[o]=c,e.forEach(function(e){var n=Tn(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},Tn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&D(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=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===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},Dn=function(e){if(null==e)return"";var n=String(e);if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},Mn=function(e,n,t){var r=function(e,n){var t=function(e){var n=[],t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];i.hide||i.isSelectionColumn||(i.children&&i.children.length>0?t(i.children):n.push(i))}};return t(e),n}(n);return C([t.map(function(e){return Dn(e.label)}).join(",")],e.map(function(e){var n=e.row;return t.map(function(e){var t=n[e.accessor];return Dn(t)}).join(",")}),!0).join("\n")}(e,n);!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)}(r,t)},Ln=function(e){var n=e.rows,t=e.rowIdAccessor,r=e.onRowSelectionChange,i=e.enableRowSelection,c=void 0!==i&&i,s=o(new Set),u=s[0],d=s[1],h=l(function(e){return!!c&&function(e,n){return n.has(e)}(e,u)},[u,c]),f=l(function(){return!!c&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(n,t,u)},[n,t,u,c]),v=a(function(){return c?function(e){return e.size}(u):0},[u,c]),p=a(function(){return c?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(n,t,u):[]},[n,t,u,c]),g=l(function(e,o){if(c){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(d(i),r){var a=n.find(function(n){return String(n[t])===e});a&&r({row:a,isSelected:o,selectedRows:i})}}},[u,n,t,r,c]),w=l(function(e){var o;c&&(e?(o=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(n,t),r&&n.forEach(function(e){return r({row:e,isSelected:!0,selectedRows:o})})):(o=new Set,r&&u.forEach(function(e){var i=n.find(function(n){return String(n[t])===e});i&&r({row:i,isSelected:!1,selectedRows:o})})),d(o))},[n,t,r,u,c]),m=l(function(e){if(c){var n=h(e);g(e,!n)}},[h,g,c]),y=l(function(){if(c){if(r){var e=new Set;u.forEach(function(o){var i=n.find(function(e){return String(e[t])===o});i&&r({row:i,isSelected:!1,selectedRows:e})})}d(new Set)}},[u,n,t,r,c]);return{selectedRows:u,setSelectedRows:d,isRowSelected:h,areAllRowsSelected:f,selectedRowCount:v,selectedRowsData:p,handleRowSelect:g,handleSelectAll:w,handleToggleRow:m,clearSelection:y}},Bn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(On,m({},n)):null},On=function(n){var r=n.allowAnimations,s=void 0!==r&&r,u=n.cellUpdateFlash,h=void 0!==u&&u,f=n.className,v=n.columnBorders,p=void 0!==v&&v,g=n.columnEditorPosition,I=void 0===g?"right":g,x=n.columnEditorText,E=void 0===x?"Columns":x,N=n.columnReordering,H=void 0!==N&&N,W=n.columnResizing,T=void 0!==W&&W,O=n.defaultHeaders,q=n.editColumns,U=void 0!==q&&q,V=n.editColumnsInitOpen,K=void 0!==V&&V,J=n.enableHeaderEditing,X=void 0!==J&&J,_=n.enableRowSelection,$=void 0!==_&&_,Q=n.expandAll,Z=void 0===Q||Q,ee=n.expandIcon,ne=void 0===ee?e(Y,{className:"st-expand-icon"}):ee,te=n.externalFilterHandling,re=void 0!==te&&te,oe=n.externalSortHandling,ie=void 0!==oe&&oe,ae=n.footerRenderer,le=n.headerCollapseIcon,se=void 0===le?e(Y,{className:"st-header-icon"}):le,ue=n.headerExpandIcon,de=void 0===ue?e(j,{className:"st-header-icon"}):ue,he=n.headerDropdown,fe=n.headerHeight,ve=n.height,pe=n.hideFooter,ge=void 0!==pe&&pe,we=n.nextIcon,me=void 0===we?e(Y,{className:"st-next-prev-icon"}):we,be=n.onCellEdit,Ce=n.onCellClick,Se=n.onColumnOrderChange,Ie=n.onColumnSelect,xe=n.onFilterChange,Re=n.onGridReady,Ee=n.onHeaderEdit,Ne=n.onLoadMore,He=n.onNextPage,ke=n.onRowSelectionChange,Ae=n.onSortChange,Fe=n.prevIcon,We=void 0===Fe?e(j,{className:"st-next-prev-icon"}):Fe,Te=n.rowButtons,De=n.rowGrouping,Me=n.rowHeight,Le=void 0===Me?32:Me,Be=n.rowIdAccessor,Oe=n.rows,Pe=n.selectionColumnWidth,qe=void 0===Pe?42:Pe,ze=n.rowsPerPage,je=void 0===ze?10:ze,Ye=n.selectableCells,Ge=void 0!==Ye&&Ye,Ue=n.selectableColumns,Ve=void 0!==Ue&&Ue,Ke=n.shouldPaginate,Je=void 0!==Ke&&Ke,Xe=n.sortDownIcon,_e=void 0===Xe?e(En,{className:"st-header-icon"}):Xe,$e=n.sortUpIcon,Qe=void 0===$e?e(Nn,{className:"st-header-icon"}):$e,Ze=n.tableRef,en=n.theme,nn=void 0===en?"light":en,tn=n.useHoverRowBackground,rn=void 0===tn||tn,on=n.useOddEvenRowBackground,an=void 0!==on&&on,ln=n.useOddColumnBackground,cn=void 0!==ln&&ln;cn&&(an=!1),p&&(rn=!1);var sn=w(function(e){return e+1},0)[1],un=i(null),dn=i(null),hn=i(null),fn=i(null),gn=i(null),wn=i(null),bn=i(null),Cn=o(1),Sn=Cn[0],In=Cn[1],xn=o(O),kn=xn[0],Tn=xn[1],Dn=o(!1),Bn=Dn[0],On=Dn[1],Pn=o(!1),qn=Pn[0],zn=Pn[1],jn=o(null),Yn=jn[0],Gn=jn[1],Un=o(new Set),Vn=Un[0],Kn=Un[1];c(function(){Tn(O)},[O]);var Jn=Ln({rows:Oe,rowIdAccessor:Be,onRowSelectionChange:ke,enableRowSelection:$}),Xn=Jn.selectedRows,_n=Jn.setSelectedRows,$n=Jn.isRowSelected,Qn=Jn.areAllRowsSelected,Zn=Jn.selectedRowCount,et=Jn.selectedRowsData,nt=Jn.handleRowSelect,tt=Jn.handleSelectAll,rt=Jn.handleToggleRow,ot=Jn.clearSelection,it=a(function(){var e,n=C([],kn,!0);$&&!(null===(e=null==kn?void 0:kn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=C([{accessor:"__row_selection__",label:"",width:qe,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[$,kn,qe]),at=o(0),lt=at[0],ct=at[1],st=o(new Set),ut=st[0],dt=st[1],ht=function(e){var n=e.tableBodyContainerRef,t=o(0),r=t[0],i=t[1];return d(function(){if(n.current){var e=n.current.offsetWidth-n.current.clientWidth;i(e)}},[n]),{setScrollbarWidth:i,scrollbarWidth:r,tableBodyContainerRef:n}}({tableBodyContainerRef:wn}),ft=ht.scrollbarWidth,vt=ht.setScrollbarWidth,pt=o(0),gt=pt[0],wt=pt[1];d(function(){var e=function(){wn.current&&wt(wn.current.clientWidth)};e();var n=null;return wn.current&&(n=new ResizeObserver(e)).observe(wn.current),function(){n&&n.disconnect()}},[]);var mt=a(function(){var e=S(window.innerWidth),n=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,l=0,c=0;n.forEach(function(e){if(!e.hide){var n=A(e,i).reduce(function(e,n){return e+F(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?l+=n:c+=n}});var s=a,u=l;if(t&&t>0){var d=t*o;a>d&&(a=d),l>d&&(l=d)}return{leftWidth:R(a),rightWidth:R(l),mainWidth:c,leftContentWidth:s,rightContentWidth:u}}({headers:it,containerWidth:gt,maxPinnedWidthPercent:e,collapsedHeaders:Vn});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[it,gt,Vn]),yt=mt.mainBodyWidth,bt=mt.pinnedLeftWidth,Ct=mt.pinnedRightWidth,St=mt.pinnedLeftContentWidth,It=mt.pinnedRightContentWidth,xt=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if("string"==typeof n)if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;else o=n;return Math.max(0,o-t)},[n,t])}({height:ve,rowHeight:Le}),Rt=Wn({rows:Oe,headers:kn,rowGrouping:De}),Et=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return Fn({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=m(m({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),h=l(function(e){var n=m({},c);delete n[e],s(n),null==r||r(n)},[c,r]),f=l(function(){s({}),null==r||r({})},[r]),v=l(function(e){var r,o=m(m({},c),((r={})[e.accessor]=e,r));return Fn({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:h,clearAllFilters:f,filters:c,computeFilteredRowsPreview:v}}({rows:Rt,externalFilterHandling:re,onFilterChange:xe}),Nt=Et.filters,Ht=Et.filteredRows,kt=Et.updateFilter,At=Et.clearFilter,Ft=Et.clearAllFilters,Wt=Et.computeFilteredRowsPreview,Tt=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,c=e.rowGrouping,s=o(null),u=s[0],d=s[1],h=l(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,o=e.sortColumn,i=mn({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(D(a)){var l=h({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return m(m({},e),((r={})[i]=l,r))}return e}):i},[]),f=a(function(){return yn({externalSortHandling:r,tableRows:t,sortColumn:u,rowGrouping:c,headers:n,sortNestedRows:h})},[t,u,n,r,c,h]),v=l(function(e){var t=function(n){for(var r=0,o=n;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},r=t(n);if(r){var o=null;u&&u.key.accessor===e?"ascending"===u.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},d(o),null==i||i(o)}},[u,n,i]),p=l(function(e){var o=function(n){for(var t=0,r=n;t<r.length;t++){var i=r[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(n);if(!i)return t;var a=null;return u&&u.key.accessor===e?"ascending"===u.direction&&(a={key:i,direction:"descending"}):a={key:i,direction:"ascending"},yn({externalSortHandling:r,tableRows:t,sortColumn:a,rowGrouping:c,headers:n,sortNestedRows:h})},[u,n,t,r,c,h]);return{sort:u,sortedRows:f,updateSort:v,computeSortedRowsPreview:p}}({headers:kn,tableRows:Ht,externalSortHandling:ie,onSortChange:Ae,rowGrouping:De}),Dt=Tt.sort,Mt=Tt.sortedRows,Lt=Tt.updateSort,Bt=function(e){var n=e.allowAnimations,t=e.sortedRows,r=e.originalRows,c=e.currentPage,s=e.rowsPerPage,u=e.shouldPaginate,h=e.rowGrouping,f=e.rowIdAccessor,v=e.unexpandedRows,p=e.expandAll,g=e.contentHeight,w=e.rowHeight,y=e.scrollTop,b=e.computeFilteredRowsPreview,S=e.computeSortedRowsPreview,I=o(!1),x=I[0],R=I[1],E=o([]),N=E[0],H=E[1],k=i([]),A=i([]),F=i(new Map),W=i(null),T=l(function(e){var n=u?e.slice((c-1)*s,c*s):e;return h&&0!==h.length?L({rows:n,rowGrouping:h,rowIdAccessor:f,unexpandedRows:v,expandAll:p}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,h,f,v,p]);a(function(){if(0===F.current.size){var e=T(r),n=new Map;e.forEach(function(e){var t=String(M({row:e.row,rowIdAccessor:f}));n.set(t,e.position)}),F.current=n}},[r,T,f]);var D=a(function(){return T(t)},[t,T]),B=a(function(){return G({bufferRowCount:5,contentHeight:g,tableRows:D,rowHeight:w,scrollTop:y})},[D,g,w,y]),O=l(function(e,n){var t=new Set(e.map(function(e){return String(M({row:e.row,rowIdAccessor:f}))})),r=new Set(n.map(function(e){return String(M({row:e.row,rowIdAccessor:f}))}));return{staying:n.filter(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return t.has(n)}),entering:n.filter(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return!r.has(n)})}},[f]),P=a(function(){if(0===k.current.length)return!1;var e=D.map(function(e){return String(M({row:e.row,rowIdAccessor:f}))}),n=k.current.map(function(e){return String(M({row:e.row,rowIdAccessor:f}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[D,f]);d(function(){if(!x){if(!n||u)return H([]),k.current=D,void(A.current=B);if(0===k.current.length)return H([]),k.current=D,void(A.current=B);if(!P)return H([]),k.current=D,void(A.current=B);W.current={tableRows:D,visibleRows:B},R(!0)}},[n,D,P,x,u,B]),d(function(){if(x&&W.current&&N.length>0){var e=setTimeout(function(){var e=W.current;R(!1),H([]),k.current=e.tableRows,A.current=e.visibleRows,W.current=null},ye.duration+100);return function(){return clearTimeout(e)}}},[x,N.length]);var q=a(function(){if(!n||u)return B;if(N.length>0){var e=new Map;return D.forEach(function(n){var t=String(M({row:n.row,rowIdAccessor:f}));e.set(t,n.position)}),N.map(function(n){var t=String(M({row:n.row,rowIdAccessor:f})),r=e.get(t);return void 0!==r?m(m({},n),{position:r}):n})}return B},[B,N,D,n,u,f]),z=l(function(e){if(n&&!u){var t=b(e),r=T(t),o=G({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return D.find(function(e){return String(M({row:e.row,rowIdAccessor:f}))===n})||e}).filter(Boolean);i.length>0&&H(C(C([],B,!0),i,!0))}},[n,u,b,T,g,w,y,O,D,B,f]),j=l(function(e){if(n&&!u){var t=S(e),r=T(t),o=G({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return D.find(function(e){return String(M({row:e.row,rowIdAccessor:f}))===n})||e}).filter(Boolean);i.length>0&&H(C(C([],B,!0),i,!0))}},[n,u,S,T,g,w,y,O,D,B,f]);return{currentTableRows:D,currentVisibleRows:B,isAnimating:x,prepareForFilterChange:z,prepareForSortChange:j,rowsToRender:q}}({allowAnimations:s,sortedRows:Mt,originalRows:Rt,currentPage:Sn,rowsPerPage:je,shouldPaginate:Je,rowGrouping:De,rowIdAccessor:Be,unexpandedRows:ut,expandAll:Z,contentHeight:xt,rowHeight:Le,scrollTop:lt,computeFilteredRowsPreview:Wt,computeSortedRowsPreview:Tt.computeSortedRowsPreview}),Ot=Bt.currentTableRows,Pt=Bt.rowsToRender,qt=Bt.prepareForFilterChange,zt=Bt.prepareForSortChange,jt=Bt.isAnimating,Yt=i(new Map),Gt=i(new Map),Ut=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,h=e.collapsedHeaders,f=o(new Set),v=f[0],p=f[1],g=o(new Set),w=g[0],m=g[1],C=o(null),S=C[0],I=C[1],x=o(null),R=x[0],E=x[1],N=o(new Set),H=N[0],k=N[1],F=o(new Set),W=F[0],T=F[1],D=i(!1),L=i(null),O=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),w.forEach(function(n){e.add(n)}),e},[v,w]),P=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),w.size>0&&r.forEach(function(n){var t=M({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[v,w,r,s]),q=a(function(){return t.flatMap(function(e){return A(e,h)})},[t,h]),z=l(function(){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(v).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");v.size>0&&(navigator.clipboard.writeText(o),k(new Set(v)),setTimeout(function(){k(new Set)},800))},[q,v,r]),j=l(function(){return y(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return b(this,function(h){switch(h.label){case 0:if(!R)return[2];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=h.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=q.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=R.rowIndex,l=R.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var h=a+n,f=l+c;if(!(h>=r.length||f>=t.length)){var v=r[h],p=t[f],g=M({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=Number(e);isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(w=y)}if(v.row[p.accessor]=w,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(w)}null==u||u({accessor:p.accessor,newValue:w,row:v.row,rowIndex:h});var S=B({colIndex:f,rowIndex:h,rowId:g});o.add(S)}else{var I=B({colIndex:f,rowIndex:h,rowId:g});i.add(I)}}})}),o.size>0&&(k(o),setTimeout(function(){k(new Set)},800)),i.size>0&&(T(i),setTimeout(function(){T(new Set)},800)),[3,4]):[2];case 3:return c=h.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[R,q,r,s,u,d]),Y=l(function(){if(0!==v.size){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(v).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],h=e[l],f=M({row:c.row,rowIdAccessor:s});if(null==h?void 0:h.isEditable){var v=null;if(v="string"===h.type?"":"number"===h.type?null:"boolean"!==h.type&&("date"===h.type?null:Array.isArray(c.row[h.accessor])?[]:""),c.row[h.accessor]=v,d){var p="".concat(f,"-").concat(h.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:h.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(k(t),setTimeout(function(){k(new Set)},800)),o.size>0&&(T(o),setTimeout(function(){T(new Set)},800))}},[v,q,r,s,u,d]),G=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=M({row:r[c].row,rowIdAccessor:s});t.add(B({colIndex:u,rowIndex:c,rowId:d}))}m(new Set),I(null),p(t)},[r,s,m,I,p]),U=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<q.length){var n=B(e);m(new Set),I(null),p(new Set([n])),E(e)}},[q.length,r.length,m,I,p,E]),V=l(function(e,n){void 0===n&&(n=!1),p(new Set),E(null),m(function(t){var r=new Set(n?t:[]);return e.forEach(function(e){return r.add(e)}),r}),e.length>0&&I(e[e.length-1])},[p,E,m,I]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void j();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void Y();if(M({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return M({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=M({row:r[o-1].row,rowIdAccessor:s});U({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=M({row:r[o+1].row,rowIdAccessor:s}),U({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=M({row:r[o].row,rowIdAccessor:s}),U({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<q.length-1&&(c=M({row:r[o].row,rowIdAccessor:s}),U({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(p(new Set),m(new Set),I(null),L.current=null,E(null))}else z()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[z,q.length,R,s,G,U,n,r,j,Y]);var K=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=B({colIndex:n,rowIndex:t,rowId:r}),i=v.has(o),a=w.has(n);return i||a},[v,w]),J=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?M({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?M({row:r[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},h={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!K(c)||w.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!K(u)||w.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),K(d)||i.push("st-selected-left-border"),K(h)||i.push("st-selected-right-border"),i.join(" ")},[K,r,w,s]),X=a(function(){return R?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===R.rowIndex&&t===R.colIndex&&r===R.rowId}:function(){return!1}},[R]),_=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=B({colIndex:n,rowIndex:t,rowId:r});return H.has(o)},[H]),$=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=B({colIndex:n,rowIndex:t,rowId:r});return W.has(o)},[W]);return{getBorderClass:J,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(D.current=!0,L.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){m(new Set),I(null);var e=B({colIndex:t,rowIndex:r,rowId:o});p(new Set([e])),E({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&D.current&&L.current){for(var i=new Set,a=Math.min(L.current.rowIndex,o),l=Math.max(L.current.rowIndex,o),c=Math.min(L.current.colIndex,t),u=Math.max(L.current.colIndex,t),d=a;d<=l;d++)for(var h=c;h<=u;h++)if(d>=0&&d<r.length){var f=M({row:r[d].row,rowIdAccessor:s});i.add(B({colIndex:h,rowIndex:d,rowId:f}))}p(i)}},handleMouseUp:function(){D.current=!1},isCopyFlashing:_,isWarningFlashing:$,isInitialFocusedCell:X,isSelected:K,lastSelectedColumnIndex:S,pasteFromClipboard:j,selectColumns:V,selectedCells:v,selectedColumns:w,setInitialFocusedCell:E,setSelectedCells:p,setSelectedColumns:m,deleteSelectedCells:Y,columnsWithSelectedCells:O,rowsWithSelectedCells:P}}({selectableCells:Ge,headers:kn,tableRows:Ot,rowIdAccessor:Be,onCellEdit:be,cellRegistry:Yt.current,collapsedHeaders:Vn}),Vt=Ut.getBorderClass,Kt=Ut.handleMouseDown,Jt=Ut.handleMouseOver,Xt=Ut.handleMouseUp,_t=Ut.isCopyFlashing,$t=Ut.isInitialFocusedCell,Qt=Ut.isSelected,Zt=Ut.isWarningFlashing,er=Ut.selectColumns,nr=Ut.selectedCells,tr=Ut.selectedColumns,rr=Ut.setInitialFocusedCell,or=Ut.setSelectedCells,ir=Ut.setSelectedColumns,ar=Ut.columnsWithSelectedCells,lr=Ut.rowsWithSelectedCells,cr=l(function(e){zt(e),setTimeout(function(){Lt(e)},0)},[zt,Lt]),sr=l(function(e){Tn(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns,a=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;c(function(){var e=function(e){var c=e.target;c.closest(".editable-cell-input")&&c.closest(".st-header-cell")||(a&&l&&(c.closest(".st-header-cell")||c.closest(".dropdown-content")||l(null)),c.closest(".st-cell")||n&&(c.classList.contains("st-header-cell")||c.classList.contains("st-header-label")||c.classList.contains("st-header-label-text"))||(t.size>0&&o(new Set),r.size>0&&i(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i,a,l])}({selectableColumns:Ve,selectedCells:nr,selectedColumns:tr,setSelectedCells:or,setSelectedColumns:ir,activeHeaderDropdown:Yn,setActiveHeaderDropdown:Gn}),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;d(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:sn,tableBodyContainerRef:wn,setScrollbarWidth:vt}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:Re}),function(e){var n=e.cellRegistryRef,t=e.currentTableRows,r=e.headerRegistryRef,o=e.headers,i=e.rowIdAccessor,a=e.rows,l=e.tableRef,s=e.visibleRows;c(function(){l&&(l.current={updateData:function(e){var t=e.accessor,r=e.rowIndex,o=e.newValue,l=null==a?void 0:a[r];if(l){var c=M({row:l,rowIdAccessor:i}),s=k({rowId:c,accessor:t}),u=n.current.get(s);u&&u.updateContent(o),void 0!==l[t]&&(l[t]=o)}},setHeaderRename:function(e){var n=e.accessor,t=r.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return s},exportToCSV:function(e){var n=(void 0===e?{}:e).filename;Mn(t,o,n)}})},[n,t,r,o,i,a,l,s])}({cellRegistryRef:Yt,currentTableRows:Ot,headerRegistryRef:Gt,headers:it,rowIdAccessor:Be,rows:Oe,tableRef:Ze,visibleRows:Pt}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:Nt,onFilterChange:xe}),function(e){var n=e.sort,t=e.onSortChange,r=ce(n);c(function(){!n||(null==r?void 0:r.key.accessor)===n.key.accessor&&(null==r?void 0:r.direction)===n.direction?!n&&r&&(null==t||t(null)):null==t||t(n)},[n,r,t])}({sort:Dt,onSortChange:Ae});var ur=l(function(e){qt(e),setTimeout(function(){kt(e)},0)},[qt,kt]);return e(P,m({value:{allowAnimations:s,areAllRowsSelected:Qn,cellRegistry:Yt.current,cellUpdateFlash:h,clearSelection:ot,collapsedHeaders:Vn,columnBorders:p,columnReordering:H,columnResizing:T,draggedHeaderRef:un,editColumns:U,enableHeaderEditing:X,enableRowSelection:$,expandIcon:ne,filters:Nt,forceUpdate:sn,getBorderClass:Vt,handleApplyFilter:ur,handleClearAllFilters:Ft,handleClearFilter:At,handleMouseDown:Kt,handleMouseOver:Jt,handleRowSelect:nt,handleSelectAll:tt,handleToggleRow:rt,headerCollapseIcon:se,headerContainerRef:bn,headerDropdown:he,headerExpandIcon:de,headerRegistry:Gt.current,headers:it,hoveredHeaderRef:dn,isAnimating:jt,isCopyFlashing:_t,isInitialFocusedCell:$t,isResizing:Bn,isRowSelected:$n,isScrolling:qn,isSelected:Qt,isWarningFlashing:Zt,mainBodyRef:hn,nextIcon:me,onCellEdit:be,onCellClick:Ce,onColumnOrderChange:Se,onColumnSelect:Ie,onLoadMore:Ne,onSort:cr,onTableHeaderDragEnd:sr,pinnedLeftRef:fn,pinnedRightRef:gn,prevIcon:We,rowButtons:Te,rowGrouping:De,rowHeight:Le,headerHeight:null!=fe?fe:Le,rowIdAccessor:Be,scrollbarWidth:ft,selectColumns:er,selectableColumns:Ve,selectedColumns:tr,columnsWithSelectedCells:ar,rowsWithSelectedCells:lr,selectedRows:Xn,selectedRowCount:Zn,selectedRowsData:et,setCollapsedHeaders:Kn,setHeaders:Tn,setInitialFocusedCell:rr,setIsResizing:On,setIsScrolling:zn,setSelectedCells:or,setSelectedColumns:ir,setSelectedRows:_n,setUnexpandedRows:dt,shouldPaginate:Je,sortDownIcon:_e,sortUpIcon:Qe,tableBodyContainerRef:wn,tableRows:Ot,theme:nn,unexpandedRows:ut,useHoverRowBackground:rn,useOddColumnBackground:cn,useOddEvenRowBackground:an,activeHeaderDropdown:Yn,setActiveHeaderDropdown:Gn,onHeaderEdit:Ee}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(nn," ").concat(null!=f?f:""," ").concat(p?"st-column-borders":""),style:ve?{height:ve}:{}},{children:e(Hn,{children:t("div",m({className:"st-wrapper-container"},{children:[e(An,{}),t("div",m({className:"st-content-wrapper",onMouseUp:Xt,onMouseLeave:Xt},{children:[e(vn,{pinnedLeftWidth:bt,pinnedRightWidth:Ct,setScrollTop:ct,sort:Dt,tableRows:Ot,rowsToRender:Pt}),e(Rn,{columnEditorText:E,editColumns:U,editColumnsInitOpen:K,headers:kn,position:I})]})),e(pn,{mainBodyRef:hn,mainBodyWidth:yt,pinnedLeftWidth:bt,pinnedRightWidth:Ct,pinnedLeftContentWidth:St,pinnedRightContentWidth:It,tableBodyContainerRef:wn}),e(z,{currentPage:Sn,footerRenderer:ae,hideFooter:ge,onPageChange:In,onNextPage:He,rowsPerPage:je,shouldPaginate:Je,totalPages:Math.ceil(Mt.length/je),totalRows:Mt.length})]}))})}))}))};export{Bn as SimpleTable};
|
|
1
|
+
import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import r,{useState as o,useRef as i,useMemo as a,useCallback as l,useEffect as c,createContext as s,useContext as u,useLayoutEffect as d,Fragment as h,cloneElement as f,forwardRef as v,useImperativeHandle as p,isValidElement as g,useReducer as w}from"react";var m=function(){return m=Object.assign||function(e){for(var n,t=1,r=arguments.length;t<r;t++)for(var o in n=arguments[t])Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o]);return e},m.apply(this,arguments)};function y(e,n,t,r){return new(t||(t=Promise))(function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function l(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(a,l)}c((r=r.apply(e,n||[])).next())})}function b(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=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(c){return function(l){if(t)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(t=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=n.call(e,i)}catch(e){l=[6,e],r=0}finally{t=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,c])}}}function C(e,n,t){if(t||2===arguments.length)for(var r,o=0,i=n.length;o<i;o++)!r&&o in n||(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return e.concat(r||Array.prototype.slice.call(n))}"function"==typeof SuppressedError&&SuppressedError;var I=function(e){return e<480?.3:e<768?.4:.8},S=function(e,n){if(!e.children||0===e.children.length)return[n];var t=[],r=function(e,n){if(!e.children||0===e.children.length)return t.push(n),n+1;for(var o=n,i=0,a=e.children;i<a.length;i++){var l=a[i];o=r(l,o)}return o};return r(e,n),t},x=function(e){return e.flatMap(function(e){var n=[e];return e.children&&e.children.length>0&&n.push.apply(n,x(e.children)),n})},R=function(e){return void 0===e&&(e=0),e?e+1:0},E=function(e,n,t){var r=function(e,n){for(var t=0,r=x(e);t<r.length;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);return!!r&&(t.has(r.accessor)?"parentExpanded"===e.showWhen:"parentCollapsed"===e.showWhen)},N=function(e){var n=e.accessor,t=e.rowId;return"".concat(t,"-").concat(n)},H=function(e){var n=e.header,t=e.pinned,r=e.headers,o=e.collapsedHeaders;return n.hide||(t||n.pinned)&&n.pinned!==t?null:!(r&&o&&E(n,r,o))||null},k=function(e){var n=e.rowId,t=e.accessor;return"".concat(n,"-").concat(t)},A=function(e,n){return e.hide?[]:e.children&&0!==e.children.length?n&&n.has(e.accessor)?e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}).flatMap(function(e){return A(e,n)}):e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen}).flatMap(function(e){return A(e,n)}):[e]},F=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(N({accessor:e.accessor,rowId:"header"}));return(null==n?void 0:n.offsetWidth)||150},W=function(e){var n,t=e.width;"string"==typeof t&&t.includes("fr")&&(e.width=(null===(n=document.getElementById(N({accessor:e.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth)||150),e.children&&e.children.length>0&&e.children.forEach(function(e){W(e)})},T=function(e){return"number"==typeof e.minWidth?e.minWidth:40},D=function(e){return Array.isArray(e)&&e.length>0&&"object"==typeof e[0]&&null!==e[0]},M=function(e){return e.row[e.rowIdAccessor]},L=function(e){var n=e.depth,t=void 0===n?0:n,r=e.expandAll,o=void 0!==r&&r,i=e.unexpandedRows,a=e.rowGrouping,l=void 0===a?[]:a,c=e.rowIdAccessor,s=e.rows,u=[],d=function(e,n,t){void 0===t&&(t=0);var r=t;return e.forEach(function(t,a){var s=M({row:t,rowIdAccessor:c}),h=l[n],f=0===n&&a===e.length-1;u.push({row:t,depth:n,groupingKey:h,position:r,isLastGroupRow:f}),r++;var v=String(s);if((o?!i.has(v):i.has(v))&&n<l.length){var p=function(e,n){var t=e[n];return D(t)?t:[]}(t,h);p.length>0&&(r=d(p,n+1,r))}}),r};return d(s,t),u},B=function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return"".concat(n,"-").concat(t,"-").concat(r)},O=s(void 0),P=function(n){var t=n.children,r=n.value;return e(O.Provider,m({value:r},{children:t}))},q=function(){var e=u(O);if(void 0===e)throw new Error("useTableContext must be used within a TableProvider");return e},z=function(r){var i=r.currentPage,a=r.footerRenderer,l=r.hideFooter,c=r.onPageChange,s=r.onNextPage,u=r.rowsPerPage,d=r.shouldPaginate,h=r.totalPages,f=r.totalRows,v=q(),p=v.nextIcon,g=v.prevIcon,w=o(!0),C=w[0],I=w[1],S=!(i>1),x=!(i<h)&&!s||!C&&i===h,R=function(){var e=i-1;e>=1&&c(e)},E=function(){return y(void 0,void 0,void 0,function(){var e,n;return b(this,function(t){switch(t.label){case 0:return e=i===h,n=i+1,s&&e?[4,s(i)]:[3,2];case 1:if(!t.sent())return I(!1),[2];t.label=2;case 2:return(n<=h||s)&&c(n),[2]}})})};if(l||!d)return null;if(a){var N=Math.min((i-1)*u+1,f),H=Math.min(i*u,f);return e(n,{children:a({currentPage:i,totalPages:h,rowsPerPage:u,totalRows:f,startRow:N,endRow:H,onPageChange:c,onNextPage:E,onPrevPage:R,hasNextPage:!x,hasPrevPage:!S,nextIcon:p,prevIcon:g})})}var k=function(){if(h<=15)return Array.from({length:h},function(e,n){return n+1});var e,n,t=[],r=15;if(i<=Math.ceil(7.5))e=1,n=14;else if(i>=h-Math.floor(7.5))e=Math.max(1,h-r+1),n=h;else{var o=Math.floor(7);e=i-o,n=i+(r-o-1)}for(var a=e;a<=n;a++)t.push(a);return n<h-1&&(t.push(-1),t.push(h)),t}();return t("div",m({className:"st-footer"},{children:[e("button",m({className:"st-next-prev-btn ".concat(S?"disabled":""),onClick:R,disabled:S},{children:g})),e("button",m({className:"st-next-prev-btn ".concat(x?"disabled":""),onClick:E,disabled:x},{children:p})),k.map(function(n,t){return n<0?e("span",m({className:"st-page-ellipsis"},{children:"..."}),"ellipsis-".concat(n)):e("button",m({onClick:function(){return function(e){e>=1&&e<=h&&c(e)}(n)},className:"st-page-btn ".concat(i===n?"active":"")},{children:n}),"page-".concat(n))})]}))},j=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"})}))},Y=function(n){var t=n.className;return e("svg",m({className:t,viewBox:"0 0 24 24",width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg"},{children:e("path",{d:"M8.59 16.59L10 18l6-6-6-6-1.41 1.41L13.17 12z"})}))},G=function(e){var n=e.bufferRowCount,t=e.contentHeight,r=e.rowHeight,o=e.scrollTop,i=e.tableRows,a=r+1,l=Math.max(0,o-a*n),c=o+t+a*n,s=Math.max(0,Math.floor(l/a)),u=Math.min(i.length,Math.ceil(c/a));return i.slice(s,u)},U=function(e){return e.position*(e.rowHeight+1)-1},V=function(e){return e.position*(e.rowHeight+1)},K=function(n){var t=n.children,r=n.onClose,a=n.open,l=n.overflow,s=void 0===l?"auto":l,u=n.setOpen,d=n.width,h=n.containerRef,f=n.positioning,v=void 0===f?"fixed":f,p=q().mainBodyRef,g=i(null),w=i(null),y=o("bottom-left"),b=y[0],C=y[1],I=o({}),S=I[0],x=I[1],R=o(!1),E=R[0],N=R[1];return c(function(){a&&g.current?(N(!1),!w.current&&g.current.parentElement&&(w.current=g.current.parentElement),requestAnimationFrame(function(){if(g.current&&w.current){var e,n=g.current,t=w.current.getBoundingClientRect(),r=n.offsetHeight,o=d||n.offsetWidth,i=(e=(null==h?void 0:h.current)?h.current.getBoundingClientRect():(null==p?void 0:p.current)?p.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,l="bottom",c={};(r>i&&r<=a||r>i&&a>i)&&(l="top");var s="left";o>e.right-t.right+t.width&&(s="right"),"fixed"===v?("bottom"===l?c.top=t.bottom+4:c.bottom=window.innerHeight-t.top+4,"left"===s?c.left=t.left:c.right=window.innerWidth-t.right):("bottom"===l?c.top=t.height+4:c.bottom=t.height+4,"left"===s?c.left=0:c.right=0),C("".concat(l,"-").concat(s)),x(c),N(!0)}})):a||N(!1)},[a,d,h,p,v]),c(function(){var e=function(e){if(a&&g.current){var n=e.target;g.current&&!g.current.contains(n)&&(u(!1),null==r||r())}};return a&&window.addEventListener("scroll",e,!0),function(){window.removeEventListener("scroll",e,!0)}},[a,r,u]),c(function(){var e=function(e){if(g.current&&!g.current.contains(e.target)){var n=g.current.parentElement;n&&!n.contains(e.target)&&(u(!1),null==r||r())}};return a&&document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[r,a,u]),c(function(){var e=function(e){"Escape"===e.key&&a&&(u(!1),null==r||r())};return a&&document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[r,a,u]),a?e("div",m({ref:g,className:"st-dropdown-content st-dropdown-".concat(b),onClick:function(e){return e.stopPropagation()},style:m(m({position:v,width:d?"".concat(d,"px"):"auto",visibility:E?"visible":"hidden"},S),{overflow:s})},{children:t})):null},J=function(n){var t=n.children,r=n.onClick,o=n.isSelected,i=void 0!==o&&o,a=n.disabled,l=void 0!==a&&a,c=n.className,s=void 0===c?"":c;return e("div",m({className:"st-dropdown-item ".concat(i?"selected":""," ").concat(l?"disabled":""," ").concat(s),onClick:function(){!l&&r&&r()},role:"option","aria-selected":i,"aria-disabled":l},{children:t}))},X=function(n){var r=n.onBlur,i=n.onChange,a=n.open,l=n.setOpen,c=n.value,s=o(c),u=s[0],d=s[1],h=function(e){d(e),i(e),l(!1),r()};return t(K,m({open:a,onClose:function(){r()},setOpen:l,width:120},{children:[e(J,m({isSelected:!0===u,onClick:function(){return h(!0)}},{children:"True"})),e(J,m({isSelected:!1===u,onClick:function(){return h(!1)}},{children:"False"}))]}))},_=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,type:"text",defaultValue:null!=t?t:"",onBlur:r,onChange:function(e){var n=e.target.value;o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},$=function(n){var t=n.defaultValue,r=n.onBlur,o=n.onChange,a=i(null);return e("input",{className:"editable-cell-input",ref:a,autoFocus:!0,defaultValue:t.toString(),onBlur:r,onChange:function(e){var n=e.target.value;/^\d*\.?\d*$/.test(n)&&o(n)},onKeyDown:function(e){e.stopPropagation(),"Enter"!==e.key&&"Escape"!==e.key||r()},onMouseDown:function(e){e.stopPropagation()}})},Q=function(r){var i,a,l=r.onChange,c=r.onClose,s=r.value,u=q(),d=u.nextIcon,h=u.prevIcon,f=o(s||new Date),v=f[0],p=f[1],g=o("days"),w=g[0],y=g[1],b=function(e,n){return new Date(e,n+1,0).getDate()};return t("div",m({className:"st-datepicker"},{children:[t("div",m({className:"st-datepicker-header"},{children:["days"===w&&t(n,{children:[e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()-1,1))},className:"st-datepicker-nav-btn"},{children:h})),t("div",m({className:"st-datepicker-header-label",onClick:function(){return y("months")}},{children:[(a=v,a.toLocaleString("default",{month:"long"}))," ",v.getFullYear()]})),e("button",m({onClick:function(){p(new Date(v.getFullYear(),v.getMonth()+1,1))},className:"st-datepicker-nav-btn"},{children:d}))]}),"months"===w&&e("div",m({className:"st-datepicker-header-label",onClick:function(){return y("years")}},{children:v.getFullYear()})),"years"===w&&e("div",m({className:"st-datepicker-header-label"},{children:"Select Year"}))]})),t("div",m({className:"st-datepicker-grid st-datepicker-".concat(w,"-grid")},{children:["days"===w&&function(){var n=[],t=v.getFullYear(),r=v.getMonth(),o=b(t,r),i=function(e,n){return new Date(e,n,1).getDay()}(t,r),a=b(t,r-1);["Su","Mo","Tu","We","Th","Fr","Sa"].forEach(function(t,r){n.push(e("div",m({className:"st-datepicker-weekday"},{children:t}),"header-".concat(r)))});for(var u=function(t){var r=a-i+t+1;n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()-1,e,12,0,0);p(n),l(n),null==c||c()}(r)}},{children:r}),"prev-".concat(r)))},d=0;d<i;d++)u(d);for(var h=function(o){var i=o===(new Date).getDate()&&r===(new Date).getMonth()&&t===(new Date).getFullYear(),a=new Date(s),u=o===a.getDate()&&r===a.getMonth()&&t===a.getFullYear();n.push(e("div",m({className:"st-datepicker-day ".concat(i?"today":""," ").concat(u?"selected":""),onClick:function(){return function(e){var n=v.getFullYear(),t=v.getMonth(),r=new Date(n,t,e,12,0,0);p(r),l(r),null==c||c()}(o)}},{children:o}),"day-".concat(o)))},f=1;f<=o;f++)h(f);var g=35-(i+o),w=function(t){n.push(e("div",m({className:"st-datepicker-day other-month",onClick:function(){return function(e){var n=new Date(v.getFullYear(),v.getMonth()+1,e,12,0,0);p(n),l(n),null==c||c()}(t)}},{children:t}),"next-".concat(t)))};for(f=1;f<=g;f++)w(f);return n}(),"months"===w&&(i=[],Array.from({length:12},function(e,n){return new Date(2e3,n,1).toLocaleString("default",{month:"short"})}).forEach(function(n,t){var r=t===v.getMonth();i.push(e("div",m({className:"st-datepicker-month ".concat(r?"selected":""),onClick:function(){return function(e){p(new Date(v.getFullYear(),e,1)),y("days")}(t)}},{children:n}),"month-".concat(t)))}),i),"years"===w&&function(){for(var n=[],t=v.getFullYear(),r=t-6,o=function(r){var o=r===t;n.push(e("div",m({className:"st-datepicker-year ".concat(o?"selected":""),onClick:function(){return function(e){p(new Date(e,v.getMonth(),1)),y("months")}(r)}},{children:r}),"year-".concat(r)))},i=r;i<r+12;i++)o(i);return n}()]})),e("div",m({className:"st-datepicker-footer"},{children:e("button",m({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),l(n),null==c||c()}},{children:"Today"}))}))]}))},Z=function(e){if(!e)return new Date;if(/^\d{4}-\d{2}-\d{2}$/.test(e)){var n=e.split("-").map(Number),t=n[0],r=n[1],o=n[2];return new Date(t,r-1,o,12,0,0)}var i=new Date(e);return isNaN(i.getTime())?new Date:new Date(i.getFullYear(),i.getMonth(),i.getDate(),12,0,0)},ee=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0)},ne=function(e){if(!e)return new Date;if("string"==typeof e)return Z(e);if("number"==typeof e){var n=new Date(e);return isNaN(n.getTime())?new Date:ee(n)}return e instanceof Date?ee(e):new Date},te=function(e){return e?Z(e.toString()):new Date},re=function(n){var t=n.onBlur,r=n.onChange,o=n.open,i=n.setOpen,a=n.value;c(function(){var e=setTimeout(function(){var e=document.querySelector(".st-dropdown-container");e instanceof HTMLElement&&e.focus()},0);return function(){return clearTimeout(e)}},[]);var l=function(){t()};return e(K,m({open:o,onClose:l,setOpen:i,width:280},{children:e(Q,{value:te(a),onChange:function(e){var n=e.toISOString().split("T")[0];r(n),i(!1),t()},onClose:l})}))},oe=function(n){var t=n.onBlur,r=n.onChange,i=n.open,a=n.options,l=n.setOpen,c=n.value,s=o(c||""),u=s[0],d=s[1];return e(K,m({open:i,onClose:function(){t()},setOpen:l,width:150},{children:e("div",m({className:"st-enum-dropdown-content"},{children:a.map(function(n){return e(J,m({isSelected:u===n.value,onClick:function(){return e=n.value,d(e),r(e),l(!1),void t();var e}},{children:n.label}),n.value)})}))}))},ie=function(n){var t=n.enumOptions,r=void 0===t?[]:t,o=n.onChange,i=n.setIsEditing,a=n.type,l=void 0===a?"string":a,c=n.value,s=function(){i(!1)};if("boolean"===l&&"boolean"==typeof c)return e(X,{onBlur:s,onChange:function(e){return o(e)},open:!0,setOpen:i,value:c});if("date"===l)return e(re,{onBlur:s,onChange:o,open:!0,setOpen:i,value:c});if("enum"===l)return e(oe,{onBlur:s,onChange:o,open:!0,options:r,setOpen:i,value:"string"==typeof c?c:""});if("number"===l&&"number"==typeof c)return e($,{defaultValue:c,onBlur:s,onChange:function(e){var n=""===e?0:parseFloat(e);o(isNaN(n)?0:n)}});var u=null==c?"":String(c);return e(_,{defaultValue:u,onBlur:s,onChange:o})},ae=0,le=function(){return function(e){var n=e.callback,t=e.callbackProps,r=e.limit,o=Date.now();(0===ae||o-ae>=r)&&(ae=o,n(t))}},ce=function(e){var n=i(e);return c(function(){JSON.stringify(n.current)!==JSON.stringify(e)&&(n.current=e)},[e]),n.current},se=function(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(se);var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=se(e[t]));return n},ue=function(e,n){return e.filter(function(e){return e.pinned===n}).some(function(e){return!e.hide})},de=Date.now(),he={screenX:0,screenY:0},fe=function(e,n,t){void 0===t&&(t=[]);for(var r=0;r<e.length;r++){var o=e[r];if(o.accessor===n)return C(C([],t,!0),[r],!1);if(o.children&&o.children.length>0){var i=fe(o.children,n,C(C([],t,!0),[r],!1));if(i)return i}}return null},ve=function(e){return"left"===e.pinned?"left":"right"===e.pinned?"right":"main"};function pe(e,n,t){var r,o,i=se(e),a=!1;try{var l=ve(t),c=i.findIndex(function(e){return e.accessor===n.accessor}),s=i.findIndex(function(e){return e.accessor===t.accessor});if(-1===c||-1===s)return{newHeaders:i,emergencyBreak:a=!0};var u=i.splice(c,1)[0],d=(r=l,o=m({},u),"left"===r?o.pinned="left":"right"===r?o.pinned="right":delete o.pinned,o),h=s;i.splice(h,0,d)}catch(e){console.error("Error in insertHeaderAcrossSections:",e),a=!0}return{newHeaders:i,emergencyBreak:a}}var ge=function(e){var n=e.draggedHeaderRef,t=e.headers,r=e.hoveredHeaderRef,o=e.onColumnOrderChange,i=e.onTableHeaderDragEnd,a=q().setHeaders,l=ce(t);return{handleDragStart:function(e){n.current=e,de=Date.now()},handleDragOver:function(e){var o=e.event,a=e.hoveredHeader;if(o.preventDefault(),t&&n.current){var c=o.currentTarget.getAnimations().some(function(e){return"running"===e.playState}),s=o.screenX,u=o.screenY,d=Math.sqrt(Math.pow(s-he.screenX,2)+Math.pow(u-he.screenY,2));r.current=a;var h,f=n.current,v=!1;if(ve(f)!==ve(a)){h=(I=pe(t,f,a)).newHeaders,v=I.emergencyBreak}else{var p=t,g=fe(p,f.accessor),w=fe(p,a.accessor);if(!g||!w)return;var m=g.length,y=w.length,b=w;if(m!==y){var C=y-m;C>0&&(b=w.slice(0,-C))}var I=function(e,n,t){var r=se(e),o=!1;function i(e,n){for(var t=e,r=0;r<n.length-1;r++)t=t[n[r]].children;return t[n[n.length-1]]}function a(e,n,t){for(var r=e,i=0;i<n.length-1;i++){if(!r[n[i]].children){o=!0;break}r=r[n[i]].children}r[n[n.length-1]]=t}var l=i(r,n);return a(r,n,i(r,t)),a(r,t,l),{newHeaders:r,emergencyBreak:o}}(p,g,b);h=I.newHeaders,v=I.emergencyBreak}if(!(c||a.accessor===f.accessor||d<10||JSON.stringify(h)===JSON.stringify(t)||v)){var S=Date.now();JSON.stringify(h)===JSON.stringify(l)&&(S-de<1500||d<40)||(de=S,he={screenX:s,screenY:u},i(h))}}},handleDragEnd:function(){n.current=null,r.current=null,setTimeout(function(){a(function(e){return C([],e,!0)}),null==o||o(t)},10)}}},we=function(){return"undefined"!=typeof window&&window.matchMedia("(prefers-reduced-motion: reduce)").matches},me={duration:180,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},ye={duration:200,easing:"cubic-bezier(0.2, 0.0, 0.2, 1)",delay:0},be={duration:150,easing:"ease-out",delay:0},Ce=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")},Ie=function(e,n,t,r){return void 0===t&&(t={}),new Promise(function(r){e.offsetHeight,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(){Ce(e),e.removeEventListener("transitionend",o),t.onComplete&&t.onComplete(),r()};e.addEventListener("transitionend",o),setTimeout(o,n.duration+(n.delay||0)+50)})},Se=function(e){var n=e.element,t=e.finalConfig,r=e.fromBounds,o=e.toBounds;return y(void 0,void 0,void 0,function(){var e,i,a;return b(this,function(l){switch(l.label){case 0:return e=function(e,n){var t="x"in e?e.x:e.left,r="y"in e?e.y:e.top;return{x:t-n.x,y:r-n.y}}(r,o),0===e.x&&0===e.y?[2]:we()&&!1!==t.respectReducedMotion?[2]:(i=Math.abs(e.x)>Math.abs(e.y),a=function(e,n){return void 0===e&&(e={}),we()?m(m({},be),e):m(m({},"column"===n?me:ye),e)}(t,i?"column":"row"),Ce(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,Ie(n,a,t)]);case 1:return l.sent(),[2]}})})},xe=function(e){var n=e.element,t=e.options;return y(void 0,void 0,void 0,function(){var e,r,o,i,a,l,c,s,u,d,h,f,v,p,g,w;return b(this,function(m){return e=t.startY,r=t.endY,o=t.finalY,i=t.duration,a=void 0===i?300:i,l=t.easing,c=void 0===l?"cubic-bezier(0.2, 0.0, 0.2, 1)":l,s=t.delay,u=void 0===s?0:s,d=t.onComplete,h=t.respectReducedMotion,f=void 0===h||h,we()&&f?(void 0!==o&&(n.style.transform="",n.style.top="".concat(o,"px")),d&&d(),[2]):(v=n.getBoundingClientRect(),p=v.top,g=e-p,w=r-p,[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(g,"px, 0)"),n.style.transition="none",n.style.willChange="transform",n.style.backfaceVisibility="hidden",n.classList.add("st-animating"),n.offsetHeight,n.style.transition="transform ".concat(a,"ms ").concat(c),u&&(n.style.transitionDelay="".concat(u,"ms")),n.style.transform="translate3d(0, ".concat(w,"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),d&&d(),e()};n.addEventListener("transitionend",t),setTimeout(t,a+(u||0)+50)})])})})},Re=function(n){var t=n.children,r=n.id,o=n.parentRef,a=n.tableRow,l=function(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}(n,["children","id","parentRef","tableRow"]),c=q(),s=c.allowAnimations,u=c.isResizing,h=c.isScrolling,f=c.rowHeight,v=i(null),p=i(null),g=ce(h),w=ce(u);return d(function(){var e,n,t,r;if(s&&v.current&&!u){var i=v.current.getBoundingClientRect(),l=p.current;if(!h)if(!g||h)if(!w||u){if(p.current=i,l){var c=i.x-l.x,d=i.y-l.y;if(!(Math.abs(c)<50&&Math.abs(d)<=5)){if(Math.abs(c)>5||Math.abs(d)>5){var y=m(m({},ye),{onComplete:function(){v.current&&(v.current.style.zIndex="",v.current.style.position="",v.current.style.top="")}}),b=null===(e=null==o?void 0:o.current)||void 0===e?void 0:e.scrollTop,C=null===(n=null==o?void 0:o.current)||void 0===n?void 0:n.clientHeight,I=null===(t=null==o?void 0:o.current)||void 0===t?void 0:t.scrollHeight;if(void 0!==b&&void 0!==C&&void 0!==I){var S=5*f,x=b-S,R=b+C+S,E=l.y>x&&l.y<R,N=i.y>x&&i.y<R,H=i.y<b,k=i.y>b+C,A=null!==(r=null==a?void 0:a.position)&&void 0!==r?r:0,F=.6*f,W=function(e,n,t){var r=Math.min(Math.abs(e-n),Math.abs(e-t));return Math.min(900,Math.max(100,100+80*Math.log10(Math.max(1,r))))};if(E&&!N&&k){var T=b+C+W(i.y,b,b+C)+A%15*F*2.5+A%7*(.4*f);return void xe({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(E&&!N&&H){T=b-W(i.y,b,b+C)-A%15*F*2.5-A%7*(.4*f);return void xe({element:v.current,options:{startY:l.y,endY:T,finalY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y>b+C){var D=b+C+W(l.y,b,b+C)+A%10*F*1;return void xe({element:v.current,options:{startY:D,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}if(!E&&N&&l.y<b){D=b-W(l.y,b,b+C)-A%10*F*1;return void xe({element:v.current,options:{startY:D,endY:i.y,duration:y.duration,easing:y.easing,onComplete:y.onComplete}})}}Se({element:v.current,fromBounds:l,toBounds:i,finalConfig:y})}}}}else p.current=i;else p.current=i}},[s,u,h,o,g,w,f,null==a?void 0:a.position,a]),e("div",m({ref:v,"data-animate-id":r,id:String(r)},l,{children:t}))};Re.displayName="Animate";var Ee=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:t,style:m({height:"10px"},r)},{children:e("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"})}))},Ne=function(n){var r=n.checked,o=void 0!==r&&r,i=n.children,a=n.onChange;return t("label",m({className:"st-checkbox-label"},{children:[e("input",{checked:o,className:"st-checkbox-input",onChange:function(){a&&a(!o)},type:"checkbox"}),e("span",m({className:"st-checkbox-custom ".concat(o?"st-checked":"")},{children:o&&e(Ee,{className:"st-checkbox-checkmark"})})),i]}))},He=function(e){var n=e.content,t=e.header;return"boolean"==typeof n?n?"True":"False":Array.isArray(n)?0===n.length?"[]":n.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", "):"date"===t.type&&null!==n&&("string"==typeof n||"number"==typeof n||"object"==typeof n&&n instanceof Date)?ne(n).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):n},ke=function(n){var r=n.borderClass,s=n.colIndex,u=n.header,d=n.isHighlighted,h=n.isInitialFocused,f=n.nestedIndex,v=n.rowIndex,p=n.tableRow,g=q(),w=g.cellRegistry,y=g.cellUpdateFlash,b=g.columnBorders,C=g.draggedHeaderRef,I=g.enableRowSelection,S=g.expandIcon,x=g.handleMouseDown,R=g.handleMouseOver,E=g.handleRowSelect,H=g.headers,A=g.hoveredHeaderRef,F=g.isCopyFlashing,W=g.isRowSelected,T=g.isWarningFlashing,L=g.onCellEdit,B=g.onCellClick,O=g.onTableHeaderDragEnd,P=g.rowButtons,z=g.rowGrouping,j=g.rowIdAccessor,Y=g.rowsWithSelectedCells,G=g.selectedColumns,U=g.setUnexpandedRows,V=g.tableBodyContainerRef,K=g.theme,J=g.unexpandedRows,X=g.useOddColumnBackground,_=p.depth,$=p.row,Q=o($[u.accessor]),Z=Q[0],ee=Q[1],ne=o(!1),te=ne[0],re=ne[1],oe=o(!1),ae=oe[0],ce=oe[1],se=o(!1),ue=se[0],de=se[1],he=i(null),fe=M({row:$,rowIdAccessor:j}),ve=z&&z[_],pe=!!ve&&function(e,n){if(!n)return!1;var t=e[n];return D(t)}($,ve),we=!J.has(String(fe)),me=F({rowIndex:v,colIndex:s,rowId:fe}),ye=T({rowIndex:v,colIndex:s,rowId:fe}),be=a(function(){var e,n,t;if(!b)return!1;var r=H.filter(function(e){return"left"===e.pinned}),o=H.filter(function(e){return!e.pinned}),i=H.filter(function(e){return"right"===e.pinned});return"left"===u.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===u.accessor:"right"===u.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===u.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===u.accessor},[b,H,u.accessor,u.pinned]),Ce=ge({draggedHeaderRef:C,headers:H,hoveredHeaderRef:A,onTableHeaderDragEnd:O}).handleDragOver,Ie=le(),Se=N({accessor:u.accessor,rowId:fe}),xe=k({rowId:fe,accessor:u.accessor}),Ee=u.isSelectionColumn&&I;c(function(){if(w){var e="".concat(fe,"-").concat(u.accessor);return w.set(e,{updateContent:function(e){Z!==e?(ee(e),y&&(ce(!0),he.current&&clearTimeout(he.current),he.current=setTimeout(function(){ce(!1)},800))):ee(e)}}),function(){w.delete(e),he.current&&clearTimeout(he.current)}}},[w,y,fe,u.accessor,Z]),c(function(){if(ae){var e=setTimeout(function(){ce(!1)},850);return function(){return clearTimeout(e)}}},[ae]),c(function(){ee($[u.accessor])},[$,u.accessor]);var ke="boolean"===u.type||"date"===u.type||"enum"===u.type,Ae=Boolean(null==u?void 0:u.isEditable),Fe=G.has(s),We=d&&!Fe,Te=a(function(){return!!Ee&&Y.has(String(fe))},[Ee,Y,fe]),De="st-cell ".concat(_>0&&u.expandable?"st-cell-depth-".concat(_):""," ").concat(We?h?"st-cell-selected-first ".concat(r):"st-cell-selected ".concat(r):""," ").concat(Fe?h?"st-cell-column-selected-first":"st-cell-column-selected":""," ").concat(Ae?"clickable":""," ").concat(ae?h?"st-cell-updating-first":"st-cell-updating":""," ").concat(me?h?"st-cell-copy-flash-first":"st-cell-copy-flash":""," ").concat(ye?h?"st-cell-warning-flash-first":"st-cell-warning-flash":""," ").concat(X?f%2==0?"even-column":"odd-column":""," ").concat(Ee?"st-selection-cell":""," ").concat(Te?"st-selection-has-highlighted-cell":""," ").concat(be?"st-last-column":""),Me=l(function(e){null==e&&(e="number"===u.type?0:"boolean"!==u.type&&""),ee(e),$[u.accessor]=e,null==L||L({accessor:u.accessor,newValue:e,row:$,rowIndex:v})},[u.accessor,u.type,L,$,v]),Le=l(function(){U(function(e){var n=new Set(e),t=String(fe);return n.has(t)?n.delete(t):n.add(t),n})},[fe,U]);return!te||ke||Ee?t(Re,m({className:De,"data-accessor":u.accessor,"data-col-index":s,"data-row-id":fe,"data-row-index":v,id:Se,onClick:function(){B&&!Ee&&B({accessor:u.accessor,colIndex:s,row:$,rowId:fe,rowIndex:v,value:Z})},onDoubleClick:function(){return u.isEditable&&!Ee&&re(!0)},onDragOver:function(e){Ee||Ie({callback:Ce,callbackProps:{event:e,hoveredHeader:u},limit:50})},onKeyDown:function(e){te||Ee||"F2"!==e.key&&"Enter"!==e.key||!u.isEditable||te||(e.preventDefault(),re(!0))},onMouseDown:function(){te||Ee||x({rowIndex:v,colIndex:s,rowId:fe})},onMouseEnter:function(){de(!0)},onMouseLeave:function(){de(!1)},onMouseOver:function(){te||Ee||R({rowIndex:v,colIndex:s,rowId:fe})},parentRef:V,tableRow:p},{children:[u.expandable&&pe?e("div",m({className:"st-icon-container st-expand-icon-container ".concat(we?"expanded":"collapsed"),onClick:Le},{children:S})):null,e("span",m({className:"st-cell-content ".concat("right"===u.align?"right-aligned":"center"===u.align?"center-aligned":"left-aligned")},{children:e("span",{children:Ee?t("div",m({className:"st-selection-cell-content"},{children:[e("div",m({className:"st-selection-control"},{children:ue||W&&W(String(fe))?e(Ne,{checked:!!W&&W(String(fe)),onChange:function(e){E&&E(String(fe),e)}}):e("span",m({className:"st-row-number"},{children:v+1}))})),function(){if(!P||!Ee||0===P.length)return null;if(!(ue||W&&W(String(fe))))return null;var n={row:$};return e("div",m({className:"st-row-buttons"},{children:P.map(function(t,r){return e("span",m({className:"st-row-button"},{children:t(n)}),r)})}))}()]})):u.cellRenderer?u.cellRenderer({accessor:u.accessor,colIndex:s,row:$,theme:K}):He({content:Z,header:u})})})),te&&ke&&!Ee&&e(ie,{enumOptions:u.enumOptions,onChange:Me,setIsEditing:re,type:u.type,value:Z})]}),xe):e("div",m({className:"st-cell-editing",id:N({accessor:u.accessor,rowId:fe}),onMouseDown:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()}},{children:e(ie,{enumOptions:u.enumOptions,onChange:Me,setIsEditing:re,type:u.type,value:Z})}))},Ae=function(t){var r=t.columnIndexStart,o=t.columnIndices,i=t.headers,a=t.pinned,l=t.rowIndex,c=t.rowIndices,s=t.tableRow,u=q(),d=u.rowIdAccessor,h=u.collapsedHeaders,f=i.filter(function(e){return H({header:e,pinned:a,headers:i,collapsedHeaders:h})});return e(n,{children:f.map(function(n,t){var u=M({row:s.row,rowIdAccessor:d}),h=N({accessor:n.accessor,rowId:u});return e(Fe,{columnIndices:o,header:n,headers:i,nestedIndex:t+(null!=r?r:0),pinned:a,rowIndex:l,rowIndices:c,tableRow:s},h)})})},Fe=function(n){var t=n.columnIndices,r=n.header,o=n.headers,i=n.nestedIndex,a=n.pinned,l=n.rowIndex,c=n.rowIndices,s=n.tableRow,u=t[r.accessor],d=q(),f=d.getBorderClass,v=d.isSelected,p=d.isInitialFocusedCell,g=d.rowIdAccessor,w=d.collapsedHeaders,m=M({row:s.row,rowIdAccessor:g});if(r.children&&r.children.length>0){var y=r.children.filter(function(e){return H({header:e,pinned:a,headers:o,collapsedHeaders:w})});return e(h,{children:y.map(function(n){var r=N({accessor:n.accessor,rowId:m});return e(Fe,{columnIndices:t,header:n,headers:o,nestedIndex:i,pinned:a,rowIndex:l,rowIndices:c,tableRow:s},r)})})}var b={rowIndex:l,colIndex:u,rowId:m},C=f(b),I=v(b),S=p(b),x=N({accessor:r.accessor,rowId:m});return e(ke,{borderClass:C,colIndex:u,header:r,isHighlighted:I,isInitialFocused:S,nestedIndex:i,rowIndex:l,tableRow:s},x)},We=function(n){var t=n.columnIndices,r=n.columnIndexStart,o=n.gridTemplateColumns,i=n.headers,a=n.index,l=n.pinned,c=n.rowHeight,s=n.rowIndices,u=n.setHoveredIndex,d=n.tableRow,h=q(),f=h.useHoverRowBackground,v=h.rowIdAccessor,p=h.isAnimating,g=h.isRowSelected,w=h.useOddEvenRowBackground,y=d.position,b=y%2==0,C=M({row:d.row,rowIdAccessor:v}),I=!!g&&g(String(C));return e("div",m({className:"st-row ".concat(w?b?"even":"odd":""," ").concat(I?"selected":""),"data-index":a,onMouseEnter:function(){!p&&f&&u(a)},style:{gridTemplateColumns:o,top:V({position:y,rowHeight:c}),height:"".concat(c,"px")}},{children:e(Ae,{columnIndexStart:r,columnIndices:t,headers:i,pinned:l,rowIndex:y,rowIndices:s,tableRow:d},C)}))},Te=function(n){var t=n.displayStrongBorder,r=n.position,o=n.rowHeight,a=n.templateColumns,l=n.rowIndex,c=i(null);return e("div",m({className:"st-row-separator ".concat(t?"st-last-group-row":""),onMouseDown:function(e){if(void 0!==l){for(var n=e.currentTarget.getBoundingClientRect(),t=e.clientX-n.left,r=a.split(" ").map(function(e){if(e.includes("px"))return parseFloat(e);if(e.includes("fr")){var t=a.split(" ").filter(function(e){return e.includes("fr")}).length;return n.width/t}return 100}),o=0,i=0,s=0;s<r.length;s++){if(t<=o+r[s]){i=s;break}o+=r[s],i=s}var u="cell-".concat(l+1,"-").concat(i+1),d=document.getElementById(u);if(d){c.current=d;var h=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window,button:0});d.dispatchEvent(h)}}},onMouseUp:function(){if(c.current){var e=new MouseEvent("mouseup",{bubbles:!0,cancelable:!0,view:window,button:0});c.current.dispatchEvent(e),c.current=null}},style:{gridTemplateColumns:a,top:U({position:r,rowHeight:o})}},{children:e("div",{style:{gridColumn:"1 / -1"}})}))},De=s(void 0),Me=function(e){var n=e.childRef,t=e.children,r=e.group,o=void 0===r?"default":r,i=function(){var e=u(De);if(!e)throw new Error("useScrollSyncContext must be used within a ScrollSyncProvider");return e}(),a=i.registerPane,l=i.unregisterPane;return c(function(){var e=[o];return n.current&&a(n.current,e),function(){n.current&&l(n.current,e)}},[n,a,l,o]),f(t,{ref:function(e){n.current=e}})},Le=v(function(n,r){var o=n.columnIndexStart,l=n.columnIndices,c=n.headers,s=n.pinned,u=n.rowHeight,d=n.rowIndices,f=n.setHoveredIndex,v=n.templateColumns,g=n.totalHeight,w=n.rowsToRender,y=n.width,b=s?"st-body-pinned-".concat(s):"st-body-main",C=q().rowIdAccessor,I=i(null);if(p(r,function(){return I.current},[]),!a(function(){return ue(c,s)},[c,s]))return null;var S=s?"pinned-".concat(s):"default";return e(Me,m({childRef:I,group:S},{children:e("div",m({className:b,ref:I,style:m({position:"relative",height:"".concat(g,"px"),width:y},!s&&{flexGrow:1})},{children:w.map(function(n,r){var i=M({row:n.row,rowIdAccessor:C});return t(h,{children:[0!==r&&e(Te,{displayStrongBorder:n.isLastGroupRow,position:n.position,rowHeight:u,templateColumns:v,rowIndex:r-1}),e(We,{columnIndexStart:o,columnIndices:l,gridTemplateColumns:v,headers:c,index:r,pinned:s,rowHeight:u,rowIndices:d,setHoveredIndex:f,tableRow:n},i)]},i)})}))}))});function Be(e){var n=e.headers,t=e.pinnedLeftColumns,r=e.pinnedRightColumns,o=e.collapsedHeaders,i={},a=0,l=C(C(C([],t,!0),n,!0),r,!0),c=function(e,n){void 0===n&&(n=!1),n||a++,i[e.accessor]=a,e.children&&e.children.length>0&&e.children.filter(function(e){return H({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){c(e,0===n)})};return t.forEach(function(e,n){c(e,0===n)}),n.filter(function(e){return!e.pinned&&H({header:e,headers:l,collapsedHeaders:o})}).forEach(function(e,n){var r=0===n&&0===t.length;c(e,r)}),r.forEach(function(e){c(e,!1)}),i}Le.displayName="TableSection";var Oe=function(n){var r=n.mainTemplateColumns,s=n.pinnedLeftColumns,u=n.pinnedLeftTemplateColumns,d=n.pinnedLeftWidth,h=n.pinnedRightColumns,f=n.pinnedRightTemplateColumns,v=n.pinnedRightWidth,p=n.rowsToRender,g=n.setScrollTop,w=n.tableRows,y=q(),b=y.collapsedHeaders,C=y.headerContainerRef,I=y.headers,S=y.isAnimating,x=y.mainBodyRef,R=y.onLoadMore,E=y.rowHeight,N=y.rowIdAccessor,H=y.scrollbarWidth,k=y.setIsScrolling,A=y.shouldPaginate,F=y.tableBodyContainerRef,W=o(!1),T=W[0],D=W[1],L=i(new Set),B=l(function(e){(L.current.forEach(function(e){return e.classList.remove("hovered")}),L.current.clear(),null!==e)&&document.querySelectorAll('.st-body-container .st-row[data-index="'.concat(e,'"]')).forEach(function(e){e.classList.add("hovered"),L.current.add(e)})},[]);c(function(){S&&B(null)},[S,B]),function(e){var n=e.headerContainerRef,t=e.mainSectionRef,r=e.scrollbarWidth,i=o(!1),a=i[0],l=i[1];c(function(){var e=null==n?void 0:n.current;if(a&&e)return e.classList.add("st-header-scroll-padding"),e.style.setProperty("--st-after-width","".concat(r,"px")),function(){e.classList.remove("st-header-scroll-padding")}},[n,a,r]),c(function(){var e=null==n?void 0:n.current,r=null==t?void 0:t.current;if(r&&e){var o=function(){if(r){var e=r.scrollHeight>r.clientHeight;l(e)}};o();var i=new ResizeObserver(function(){o()});return i.observe(r),function(){r&&i.unobserve(r)}}},[n,t])}({headerContainerRef:C,mainSectionRef:F,scrollbarWidth:H}),c(function(){return function(){P.current&&clearTimeout(P.current)}},[]);var O=i(null),P=i(null),z=i(0),j=function(e){return e.length}(w),Y=j*(E+1)-1,G=a(function(){return Be({headers:I,pinnedLeftColumns:s,pinnedRightColumns:h,collapsedHeaders:b})},[I,s,h,b]),U=a(function(){var e={};return p.forEach(function(n,t){var r=String(M({row:n.row,rowIdAccessor:N}));e[r]=t}),e},[p,N]),V=l(function(e,n){if(R&&!A&&!T){e.scrollHeight-(n+e.clientHeight)<=200&&n>z.current&&(D(!0),R(),setTimeout(function(){D(!1)},1e3))}},[R,A,T]),K={columnIndices:G,headerContainerRef:C,headers:I,rowHeight:E,rowIndices:U,rowsToRender:p,setHoveredIndex:B};return t("div",m({className:"st-body-container",onMouseLeave:function(){return B(null)},onScroll:function(e){var n=e.currentTarget,t=n.scrollTop;k(!0),P.current&&clearTimeout(P.current),P.current=setTimeout(function(){k(!1)},150),O.current&&cancelAnimationFrame(O.current),O.current=requestAnimationFrame(function(){g(t),V(n,t),z.current=t})},ref:F},{children:[e(Le,m({},K,{pinned:"left",templateColumns:u,totalHeight:Y,width:d})),e(Le,m({},K,{columnIndexStart:s.length,ref:x,templateColumns:r,totalHeight:Y})),e(Le,m({},K,{columnIndexStart:s.length+r.length,pinned:"right",templateColumns:f,totalHeight:Y,width:v}))]}))},Pe=function(e){var n=e.event;e.gridColumnEnd,e.gridColumnStart;var t=e.header,r=e.headers,o=e.setHeaders,i=e.setIsResizing,a=e.startWidth,l=e.collapsedHeaders;n.preventDefault();var c="clientX"in n?n.clientX:n.touches[0].clientX,s="touches"in n;if(t&&!t.hide){i(!0);var u,d=T(t);if(t.children&&t.children.length>0){var h=A(t,l);u=h.length>0?h:[t]}else u=[t];var f=function(e){var n="right"===t.pinned?c-e:e-c,i=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=i*I(window.innerWidth);if(!n.pinned)return Math.max(.6*i,600);var l=a-t.filter(function(e){return e.pinned===n.pinned&&e.accessor!==n.accessor}).reduce(function(e,n){return n.hide?e:e+A(n,r).reduce(function(e,n){return e+F(n)},0)},0),c=T(n);return l<c?(console.warn("Header ".concat(n.accessor," exceeds pinned section width limit")),c):l}({header:t,headers:r,collapsedHeaders:l});if(u.length>1)qe({delta:n,leafHeaders:u,minWidth:d,startWidth:a,maxWidth:i});else{var s=Math.max(Math.min(a+n,i),d);u[0].width=s}r.forEach(function(e){W(e)});var h=C([],r,!0);o(h)};if(s){var v=function(e){var n=e.touches[0];f(n.clientX)},p=function(){document.removeEventListener("touchmove",v),document.removeEventListener("touchend",p),i(!1)};document.addEventListener("touchmove",v),document.addEventListener("touchend",p)}else{var g=function(e){f(e.clientX)},w=function(){document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",w),i(!1)};document.addEventListener("mousemove",g),document.addEventListener("mouseup",w)}}},qe=function(e){var n=e.delta,t=e.leafHeaders,r=e.minWidth,o=e.startWidth,i=e.maxWidth,a=t.reduce(function(e,n){return Math.min(e,T(n))},40),l=t.reduce(function(e,n){return e+("number"==typeof n.width?n.width:150)},0),c=Math.max(Math.min(o+n,i),a)-l;t.forEach(function(e){var n="number"==typeof e.width?e.width:150,t=c*(n/l),o=Math.max(n+t,r);e.width=o})},ze={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"},je=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"]}},Ye=function(e){return!["between","notBetween","in","notIn","isEmpty","isNotEmpty"].includes(e)},Ge=function(e){return["between","notBetween","in","notIn"].includes(e)},Ue=function(e){return["isEmpty","isNotEmpty"].includes(e)},Ve=function(n){var t=n.children;return e("div",m({className:"st-filter-container"},{children:t}))},Ke=function(){return e("svg",m({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("path",{d:"M3 4.5L6 7.5L9 4.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}))},Je=function(n){var r=n.value,a=n.onChange,l=n.options,s=n.placeholder,u=void 0===s?"Select...":s,d=n.className,h=void 0===d?"":d,f=n.disabled,v=void 0!==f&&f,p=o(!1),g=p[0],w=p[1],y=o(-1),b=y[0],C=y[1],I=i(null),S=l.find(function(e){return e.value===r});c(function(){var e=function(e){if(g)switch(e.key){case"ArrowDown":e.preventDefault(),C(function(e){return e<l.length-1?e+1:0});break;case"ArrowUp":e.preventDefault(),C(function(e){return e>0?e-1:l.length-1});break;case"Enter":e.preventDefault(),b>=0&&(a(l[b].value),w(!1),C(-1));break;case"Escape":e.preventDefault(),w(!1),C(-1)}};if(g)return document.addEventListener("keydown",e),function(){return document.removeEventListener("keydown",e)}},[g,b,l,a]);return t("div",m({ref:I,className:"st-custom-select ".concat(h," ").concat(v?"st-custom-select-disabled":""," ").concat(g?"st-custom-select-open":"").trim()},{children:[t("button",m({type:"button",className:"st-custom-select-trigger",onClick:function(){if(!v)if(w(!g),g)C(-1);else{var e=l.findIndex(function(e){return e.value===r});C(e>=0?e:0)}},disabled:v,"aria-haspopup":"listbox","aria-expanded":g,"aria-labelledby":"select-label"},{children:[e("span",m({className:"st-custom-select-value"},{children:S?S.label:u})),e(Ke,{})]})),e(K,m({open:g,setOpen:w,onClose:function(){w(!1),C(-1)},positioning:"absolute",overflow:"auto"},{children:e("div",m({className:"st-custom-select-options",role:"listbox"},{children:l.map(function(n,t){return e("div",m({className:"st-custom-select-option ".concat(n.value===r?"st-custom-select-option-selected":""," ").concat(t===b?"st-custom-select-option-focused":"").trim(),role:"option","aria-selected":n.value===r,onClick:function(){return e=n.value,a(e),w(!1),void C(-1);var e}},{children:n.label}),t)})}))}))]}))},Xe=function(n){var t=n.value,r=n.onChange,o=n.operators.map(function(e){return{value:e,label:ze[e]}});return e("div",m({className:"st-filter-section"},{children:e(Je,{value:t,onChange:function(e){r(e)},options:o})}))},_e=function(n){var t=n.type,r=void 0===t?"text":t,o=n.value,i=n.onChange,a=n.placeholder,l=n.autoFocus,c=void 0!==l&&l,s=n.className,u=void 0===s?"":s,d=n.onEnterPress;return e("input",{type:r,value:o,onChange:function(e){return i(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&d&&d()},placeholder:a,autoFocus:c,className:"st-filter-input ".concat(u).trim()})},$e=function(n){var t=n.children,r=n.className;return e("div",m({className:"st-filter-section ".concat(void 0===r?"":r).trim()},{children:t}))},Qe=function(n){var r=n.onApply,o=n.onClear,i=n.canApply,a=n.showClear;return t("div",m({className:"st-filter-actions"},{children:[e("button",m({onClick:r,disabled:!i,className:"st-filter-button st-filter-button-apply ".concat(i?"":"st-filter-button-disabled")},{children:"Apply"})),a&&o&&e("button",m({onClick:o,className:"st-filter-button st-filter-button-clear"},{children:"Clear"}))]}))},Ze=function(n){var r=n.header,i=n.currentFilter,a=n.onApplyFilter,l=n.onClearFilter,s=o((null==i?void 0:i.operator)||"contains"),u=s[0],d=s[1],h=o(String((null==i?void 0:i.value)||"")),f=h[0],v=h[1],p=je("string");c(function(){i?(d(i.operator),v(String(i.value||""))):(d("contains"),v(""))},[i]);var g=function(){var e=m({accessor:r.accessor,operator:u},Ye(u)&&{value:f});a(e)},w=Ue(u)||f.trim();return t(Ve,{children:[e(Xe,{value:u,onChange:d,operators:p}),Ye(u)&&e($e,{children:e(_e,{type:"text",value:f,onChange:v,placeholder:"Filter...",autoFocus:!0,onEnterPress:g})}),e(Qe,{onApply:g,onClear:l,canApply:!!w,showClear:!!i})]})},en=function(n){var r,i,a=n.header,l=n.currentFilter,s=n.onApplyFilter,u=n.onClearFilter,d=o((null==l?void 0:l.operator)||"equals"),h=d[0],f=d[1],v=o(String((null==l?void 0:l.value)||"")),p=v[0],g=v[1],w=o(String((null===(r=null==l?void 0:l.values)||void 0===r?void 0:r[0])||"")),m=w[0],y=w[1],b=o(String((null===(i=null==l?void 0:l.values)||void 0===i?void 0:i[1])||"")),C=b[0],I=b[1],S=je("number");c(function(){var e,n;l?(f(l.operator),g(String(l.value||"")),y(String((null===(e=l.values)||void 0===e?void 0:e[0])||"")),I(String((null===(n=l.values)||void 0===n?void 0:n[1])||""))):(f("equals"),g(""),y(""),I(""))},[l]);var x=function(){var e={accessor:a.accessor,operator:h};Ye(h)?e.value=parseFloat(p):Ge(h)&&(e.values=[parseFloat(m.toString()),parseFloat(C.toString())]),s(e)};return t(Ve,{children:[e(Xe,{value:h,onChange:f,operators:S}),Ye(h)&&e($e,{children:e(_e,{type:"number",value:p,onChange:g,placeholder:"Enter number...",autoFocus:!0,onEnterPress:x})}),Ge(h)&&t($e,{children:[e(_e,{type:"number",value:m,onChange:y,placeholder:"From...",autoFocus:!0,className:"st-filter-input-range-from",onEnterPress:x}),e(_e,{type:"number",value:C,onChange:I,placeholder:"To...",onEnterPress:x})]}),e(Qe,{onApply:x,onClear:u,canApply:!!Ue(h)||(Ye(h)?""!==p.trim():!!Ge(h)&&""!==String(m).trim()&&""!==String(C).trim()),showClear:!!l})]})},nn=function(n){var t=n.value,r=n.onChange,o=n.options,i=n.className,a=void 0===i?"":i,l=n.placeholder;return e(Je,{value:t,onChange:r,options:o,className:a,placeholder:l})},tn=function(n){var r=n.header,i=n.currentFilter,a=n.onApplyFilter,l=n.onClearFilter,s=o((null==i?void 0:i.operator)||"equals"),u=s[0],d=s[1],h=o(void 0!==(null==i?void 0:i.value)?String(i.value):"true"),f=h[0],v=h[1],p=je("boolean");c(function(){i?(d(i.operator),v(void 0!==i.value?String(i.value):"true")):(d("equals"),v("true"))},[i]);var g=Ue(u)||""!==f;return t(Ve,{children:[e(Xe,{value:u,onChange:d,operators:p}),Ye(u)&&e($e,{children:e(nn,{value:f,onChange:v,options:[{value:"true",label:"True"},{value:"false",label:"False"}]})}),e(Qe,{onApply:function(){var e={accessor:r.accessor,operator:u};Ye(u)&&(e.value="true"===f),a(e)},onClear:l,canApply:g,showClear:!!i})]})},rn=function(n){var r,a,l=n.header,s=n.currentFilter,u=n.onApplyFilter,d=n.onClearFilter,h=o((null==s?void 0:s.operator)||"equals"),f=h[0],v=h[1],p=o((null==s?void 0:s.value)?String(s.value):""),g=p[0],w=p[1],y=o((null===(r=null==s?void 0:s.values)||void 0===r?void 0:r[0])?String(s.values[0]):""),b=y[0],C=y[1],I=o(String((null===(a=null==s?void 0:s.values)||void 0===a?void 0:a[1])||"")),S=I[0],x=I[1],R=je("date");c(function(){var e,n;s?(v(s.operator),w(String(s.value||"")),C(String((null===(e=s.values)||void 0===e?void 0:e[0])||"")),x(String((null===(n=s.values)||void 0===n?void 0:n[1])||""))):(v("equals"),w(""),C(""),x(""))},[s]);var E=function(n){var r=n.value,a=n.onChange,l=n.placeholder,s=n.autoFocus,u=n.className,d=o(!1),h=d[0],f=d[1],v=o(""),p=v[0],g=v[1],w=i(null);c(function(){if(r){var e=ne(r);isNaN(e.getTime())||g(e.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}))}else g("")},[r]),c(function(){s&&w.current&&w.current.focus()},[s]);var y=r?ne(r):new Date;return t("div",m({className:"st-date-input-container",style:{position:"relative"}},{children:[e("input",{ref:w,type:"text",value:p,placeholder:l,onClick:function(){f(!h)},onKeyDown:function(e){"Enter"===e.key||" "===e.key?(e.preventDefault(),f(!h)):"Escape"===e.key&&f(!1)},readOnly:!0,className:"st-filter-input ".concat(u||""),style:{cursor:"pointer"}}),e(K,m({open:h,setOpen:f,onClose:function(){f(!1)},positioning:"absolute",overflow:"visible"},{children:e(Q,{value:y,onChange:function(e){var n=e.toISOString().split("T")[0];a(n),f(!1)},onClose:function(){return f(!1)}})}))]}))};return t(Ve,{children:[e(Xe,{value:f,onChange:v,operators:R}),Ye(f)&&e($e,{children:e(E,{value:g,onChange:w,placeholder:"Select date...",autoFocus:!0})}),Ge(f)&&t($e,{children:[e(E,{value:b,onChange:C,placeholder:"From date...",autoFocus:!0,className:"st-filter-input-range-from"}),e(E,{value:S,onChange:x,placeholder:"To date..."})]}),e(Qe,{onApply:function(){var e={accessor:l.accessor,operator:f};Ye(f)?e.value=g:Ge(f)&&(e.values=[b,S]),u(e)},onClear:d,canApply:!!Ue(f)||(Ye(f)?""!==g.trim():!!Ge(f)&&""!==b.trim()&&""!==S.trim()),showClear:!!s})]})},on=function(n){var r=n.header,i=n.currentFilter,l=n.onApplyFilter,s=n.onClearFilter,u=a(function(){return r.enumOptions||[]},[r.enumOptions]),d=a(function(){return u.map(function(e){return e.value})},[u]),h=o((null==i?void 0:i.values)?i.values.map(String):d),f=h[0],v=h[1],p=o(""),g=p[0],w=p[1],y=a(function(){if(!g)return u;var e=g.toLowerCase();return u.filter(function(n){return n.label.toLowerCase().includes(e)})},[u,g]);c(function(){v(i?i.values?i.values.map(String):[]:d)},[i,d]);var b=f.length===d.length,I=u.length>10;return t(Ve,{children:[e($e,{children:t("div",m({className:"st-enum-filter-options"},{children:[e("div",m({className:"st-enum-select-all"},{children:e(Ne,m({checked:b,onChange:function(e){v(e?d:[])}},{children:e("span",m({className:"st-enum-option-label st-enum-select-all-label"},{children:"Select All"}))}))})),I&&e("div",m({className:"st-enum-search"},{children:e(_e,{type:"text",value:g,onChange:w,placeholder:"Search..."})})),y.map(function(n,t){return e(Ne,m({checked:f.includes(n.value),onChange:function(){return e=n.value,void v(function(n){return n.includes(e)?n.filter(function(n){return n!==e}):C(C([],n,!0),[e],!1)});var e}},{children:e("span",m({className:"st-enum-option-label"},{children:n.label}))}),t)}),g&&0===y.length&&e("div",m({className:"st-enum-no-results"},{children:"No matching options"}))]}))}),e(Qe,{onApply:function(){if(f.length!==d.length){var e={accessor:r.accessor,operator:"in",values:f};l(e)}else s()},onClear:s,canApply:0!==f.length&&f.length!==d.length,showClear:!!i})]})},an=function(t){var r=t.header,o=t.currentFilter,i=t.onApplyFilter,a=t.onClearFilter;return e(n,{children:function(){switch(r.type){case"number":return e(en,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"boolean":return e(tn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"date":return e(rn,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});case"enum":return e(on,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a});default:return e(Ze,{header:r,currentFilter:o,onApplyFilter:i,onClearFilter:a})}}()})},ln=function(r){var a=r.content,l=r.children,s=r.delay,u=void 0===s?500:s,d=o(!1),h=d[0],v=d[1],p=o({top:0,left:0}),w=p[0],y=p[1],b=i(null),C=i(null);if(c(function(){return function(){b.current&&clearTimeout(b.current)}},[]),!a||!g(l))return e(n,{children:l});var I=f(l,{ref:C,onMouseEnter:function(){b.current=setTimeout(function(){if(C.current&&a.trim()){var e=C.current.getBoundingClientRect();if(e.width>0&&e.height>0){var n=e.left+e.width/2-100,t=e.bottom+8;n<8?n=8:n+200>window.innerWidth-8&&(n=window.innerWidth-200-8),t+40>window.innerHeight-8&&(t=e.top-40-8),y({top:t,left:n}),v(!0)}}},u)},onMouseLeave:function(){b.current&&(clearTimeout(b.current),b.current=null),v(!1)}});return t(n,{children:[I,h&&e("div",m({className:"st-tooltip",style:{position:"fixed",top:"".concat(w.top,"px"),left:"".concat(w.left,"px"),zIndex:1e4}},{children:a}))]})},cn=function(n){var r,s,u=n.colIndex,d=n.gridColumnEnd,h=n.gridColumnStart,v=n.gridRowEnd,p=n.gridRowStart,g=n.header,w=n.reverse,y=n.sort,b=o(!1),I=b[0],x=b[1],R=o(!1),E=R[0],H=R[1],k=o(g.label||""),A=k[0],F=k[1],W=q(),T=W.activeHeaderDropdown,D=W.areAllRowsSelected,M=W.collapsedHeaders,L=W.columnBorders,B=W.columnReordering,O=W.columnResizing,P=W.columnsWithSelectedCells,z=W.draggedHeaderRef,j=W.enableHeaderEditing,Y=W.enableRowSelection,G=W.filterIcon,U=W.filters,V=W.handleApplyFilter,J=W.handleClearFilter,X=W.handleSelectAll,$=W.headerCollapseIcon,Q=W.headerDropdown,Z=W.headerExpandIcon,ee=W.headerRegistry,ne=W.headers,te=W.hoveredHeaderRef,re=W.onColumnOrderChange,oe=W.onColumnSelect,ie=W.onHeaderEdit,ae=W.onSort,ce=W.onTableHeaderDragEnd,se=W.headerHeight,ue=W.selectColumns,de=W.selectableColumns,he=W.selectedColumns,fe=W.setActiveHeaderDropdown,ve=W.setCollapsedHeaders,pe=W.setHeaders,we=W.setInitialFocusedCell,me=W.setIsResizing,ye=W.setSelectedCells,be=W.setSelectedColumns,Ce=W.sortDownIcon,Ie=W.sortUpIcon,Se=Boolean(null==g?void 0:g.isSortable),xe=Boolean(null==g?void 0:g.filterable),Ee=U[g.accessor],He=(null==T?void 0:T.accessor)===g.accessor,ke=g.isSelectionColumn&&Y,Ae=function(e){var n;return Boolean((null===(n=e.children)||void 0===n?void 0:n.length)&&e.collapsible)}(g),Fe=M.has(g.accessor),We=function(e){var n=e.isOpen,t=e.estimatedHeight,r=void 0===t?200:t,a=e.estimatedWidth,l=void 0===a?250:a,s=e.margin,u=void 0===s?4:s,d=i(null),h=o({}),f=h[0],v=h[1];return c(function(){if(n&&d.current){var e=function(){if(d.current){var e=d.current.getBoundingClientRect(),n=window.innerHeight-e.bottom,t=e.top,o=window.innerWidth-e.right,i="bottom",a={};r>n&&r<=t&&(i="top");var c="left";l>o+e.width&&(c="right"),"bottom"===i?a.top=e.bottom+u:a.bottom=window.innerHeight-e.top+u,"left"===c?a.left=e.left:a.right=window.innerWidth-e.right,v(a)}};requestAnimationFrame(e);var t=function(){return requestAnimationFrame(e)},o=function(){return requestAnimationFrame(e)};return window.addEventListener("resize",t),window.addEventListener("scroll",o,!0),function(){window.removeEventListener("resize",t),window.removeEventListener("scroll",o,!0)}}v({})},[n,r,l,u]),{triggerRef:d,position:f}}({isOpen:He,estimatedHeight:200,estimatedWidth:250,margin:4}),Te=We.triggerRef,De=We.position,Me=a(function(){var e,n,t;if(!L)return!1;var r=ne.filter(function(e){return"left"===e.pinned}),o=ne.filter(function(e){return!e.pinned}),i=ne.filter(function(e){return"right"===e.pinned});return"left"===g.pinned?(null===(e=r[r.length-1])||void 0===e?void 0:e.accessor)===g.accessor:"right"===g.pinned?(null===(n=i[i.length-1])||void 0===n?void 0:n.accessor)===g.accessor:(null===(t=o[o.length-1])||void 0===t?void 0:t.accessor)===g.accessor},[L,ne,g.accessor,g.pinned]),Le=a(function(){return!(!de||ke)&&S(g,u).some(function(e){return he.has(e)})},[de,ke,g,u,he]),Be=a(function(){return!ke&&S(g,u).some(function(e){return P.has(e)})},[ke,g,u,P]),Oe=a(function(){return!(!g.children||0===g.children.length)&&(!Fe||g.children.some(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen}))},[g.children,Fe]),qe="st-header-cell ".concat(g.accessor===(null===(r=te.current)||void 0===r?void 0:r.accessor)?"st-hovered":""," ").concat((null===(s=z.current)||void 0===s?void 0:s.accessor)===g.accessor?"st-dragging":""," ").concat(Se?"clickable":""," ").concat(B&&!Se?"columnReordering":""," ").concat(Oe?"parent":""," ").concat(Me?"st-last-column":""," ").concat(j&&!ke?"st-header-editable":""," ").concat(Le?"st-header-selected":""," ").concat(Be&&!Le?"st-header-has-highlighted-cell":""),ze=ge({draggedHeaderRef:z,headers:ne,hoveredHeaderRef:te,onColumnOrderChange:re,onTableHeaderDragEnd:ce}),je=ze.handleDragStart,Ye=ze.handleDragEnd,Ge=ze.handleDragOver,Ue=le();c(function(){if(ee&&!g.isSelectionColumn){var e=String(g.accessor);return ee.set(e,{setEditing:function(e){H(e)}}),function(){ee.delete(e)}}},[ee,g.accessor,g.isSelectionColumn]),c(function(){F(g.label||"")},[g.label]);var Ve=l(function(e){F(e);var n=ne.map(function(n){return n.accessor===g.accessor?m(m({},n),{label:e}):n});pe(n),ie&&ie(g,e)},[ne,pe,ie,g]),Ke=l(function(){fe&&fe(null)},[fe]),Je=l(function(e){e.stopPropagation(),ve(function(e){var n=new Set(e);return Fe?n.delete(g.accessor):n.add(g.accessor),n})},[ve,Fe,g.accessor]),Xe=function(e){var n=e.event,t=e.header;if(!t.isSelectionColumn){if(de){var r=S(t,u),o=r.some(function(e){return he.has(e)});if(j&&o&&!n.shiftKey)return Q&&He&&Ke(),void H(!0);n.shiftKey&&ue?be(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);t<i&&(i=t,o=e)});var a,l,c,s,u=C(C([],(a=o,l=n,c=Math.min(a,l),s=Math.max(a,l),Array.from({length:s-c+1},function(e,n){return c+n})),!0),r,!0);return new Set(C(C([],Array.from(e),!0),u,!0))}):ue&&ue(r),ye(new Set),we(null)}oe&&oe(t),!de&&t.isSortable&&ae(t.accessor)}};if(c(function(){var e=function(e){e.preventDefault(),e.dataTransfer.dropEffect="move"};return document.addEventListener("dragover",e),function(){document.removeEventListener("dragover",e)}},[]),!g)return null;var _e=O&&!ke&&e("div",m({className:"st-header-resize-handle-container",onMouseDown:function(e){var n,t=null===(n=document.getElementById(N({accessor:g.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ue({callback:Pe,callbackProps:{event:e.nativeEvent,gridColumnEnd:d,gridColumnStart:h,header:g,headers:ne,setHeaders:pe,setIsResizing:me,startWidth:t,collapsedHeaders:M},limit:10})},onTouchStart:function(e){var n,t=null===(n=document.getElementById(N({accessor:g.accessor,rowId:"header"})))||void 0===n?void 0:n.offsetWidth;Ue({callback:Pe,callbackProps:{event:e,gridColumnEnd:d,gridColumnStart:h,header:g,headers:ne,setHeaders:pe,setIsResizing:me,startWidth:t,collapsedHeaders:M},limit:10})}},{children:e("div",{className:"st-header-resize-handle"})})),$e=y&&y.key.accessor===g.accessor&&t("div",m({className:"st-icon-container",onClick:function(e){return Xe({event:e,header:g})}},{children:["ascending"===y.direction&&Ie&&Ie,"descending"===y.direction&&Ce&&Ce]})),Qe=xe&&G&&t("div",m({className:"st-icon-container",onClick:function(e){e.stopPropagation(),x(!I)}},{children:[f(G,{style:{fill:Ee?"var(--st-button-active-background-color)":"var(--st-header-icon-color)"}}),e(K,m({open:I,overflow:"visible",setOpen:x,onClose:function(){return x(!1)}},{children:e(an,{header:g,currentFilter:Ee,onApplyFilter:function(e){V(e),x(!1)},onClearFilter:function(){J(g.accessor),x(!1)}})}))]})),Ze=Ae&&!ke&&e("div",m({className:"st-icon-container st-collapse-icon-container",onClick:Je},{children:Fe?$:Z}));return t(Re,m({className:qe,id:N({accessor:g.accessor,rowId:"header"}),onDragOver:function(e){ke||Ue({callback:Ge,callbackProps:{event:e,hoveredHeader:g},limit:50})},style:m({gridRowStart:p,gridRowEnd:v,gridColumnStart:h,gridColumnEnd:d},v-p>1?{}:{height:se})},{children:[w&&_e,"right"===g.align&&Ze,"right"===g.align&&Qe,"right"===g.align&&$e,e("div",m({ref:Te,className:"st-header-label",draggable:B&&!g.disableReorder&&!ke,onClick:function(e){ke||Xe({event:e,header:g})},onDoubleClick:function(e){ke||function(e){e.event;var n=e.header;n.isSelectionColumn||de&&n.isSortable&&ae(n.accessor)}({event:e,header:g})},onDragEnd:ke?void 0:function(e){e.preventDefault(),Ye()},onDragStart:ke?void 0:function(e){B&&g&&function(e){je(e)}(g)}},{children:e(ln,m({content:g.tooltip||""},{children:e("span",m({className:"st-header-label-text ".concat("right"===g.align?"right-aligned":"center"===g.align?"center-aligned":"left-aligned")},{children:ke?e(Ne,{checked:!!D&&D(),onChange:function(e){X&&X(e)}}):E?e(_,{defaultValue:A,onBlur:function(){return H(!1)},onChange:Ve}):g.headerRenderer?g.headerRenderer({accessor:g.accessor,colIndex:u,header:g}):A||(null==g?void 0:g.label)}))}))})),"right"!==g.align&&$e,"right"!==g.align&&Qe,"right"!==g.align&&Ze,!w&&_e,Q&&!ke&&e("div",m({className:"st-header-dropdown-container"},{children:Q({accessor:g.accessor,colIndex:u,header:g,isOpen:He,onClose:Ke,position:De})}))]}))},sn=function(t){var r=t.columnIndices,o=t.gridTemplateColumns,i=t.handleScroll,l=t.headers,c=t.maxDepth,s=t.pinned,u=t.sectionRef,d=t.sort,h=t.width,f=q().collapsedHeaders,v=a(function(){var e=[],n=1,t=function(o,i,a){var u,d;if(void 0===a&&(a=!1),!H({header:o,pinned:s,headers:l,collapsedHeaders:f}))return 0;a||n++;var h=null!==(d=null===(u=o.children)||void 0===u?void 0:u.filter(function(e){return H({header:e,pinned:s,headers:l,collapsedHeaders:f})}).length)&&void 0!==d?d:0,v=n,p=h>0?v+h:v+1,g=i,w=h>0?i+1:c+1;if(e.push({header:o,gridColumnStart:v,gridColumnEnd:p,gridRowStart:g,gridRowEnd:w,colIndex:r[o.accessor]}),o.children&&o.children.length>0){var m=!0;o.children.forEach(function(e){H({header:e,pinned:s,headers:l,collapsedHeaders:f})&&(t(e,i+1,m),m=!1)})}return p-v},o=l.filter(function(e){return H({header:e,pinned:s,headers:l,collapsedHeaders:f})}),i=!0;return o.forEach(function(e){t(e,1,i),i=!1}),e},[l,c,s,r,f]),p=s?"pinned-".concat(s):"default";return e(Me,m({childRef:u,group:p},{children:e("div",m({className:"st-header-".concat(s?"pinned-".concat(s):"main")},i&&{onScroll:i},{ref:u,style:{gridTemplateColumns:o,width:h,position:"relative"}},{children:e(n,{children:v.map(function(n){return e(cn,{colIndex:n.colIndex,gridColumnEnd:n.gridColumnEnd,gridColumnStart:n.gridColumnStart,gridRowEnd:n.gridRowEnd,gridRowStart:n.gridRowStart,header:n.header,reverse:"right"===s,sort:d},n.header.accessor)})})}))}))},un=function(e){var n;return(null===(n=e.children)||void 0===n?void 0:n.length)?1+Math.max.apply(Math,e.children.map(un)):1},dn=function(n){var r=n.centerHeaderRef,o=n.headers,i=n.mainTemplateColumns,l=n.pinnedLeftColumns,c=n.pinnedLeftTemplateColumns,s=n.pinnedRightColumns,u=n.pinnedRightTemplateColumns,d=n.sort,h=n.pinnedLeftWidth,f=n.pinnedRightWidth,v=q(),p=v.headerContainerRef,g=v.pinnedLeftRef,w=v.pinnedRightRef,y=v.collapsedHeaders,b=a(function(){return Be({headers:o,pinnedLeftColumns:l,pinnedRightColumns:s,collapsedHeaders:y})},[o,l,s,y]),I=a(function(){var e=0,n=C(C(C([],l,!0),o,!0),s,!0);return o.forEach(function(t){if(H({header:t,headers:n,collapsedHeaders:y})){var r=un(t);e=Math.max(e,r)}}),{maxDepth:e}},[o,l,s,y]).maxDepth;return t("div",m({className:"st-header-container",ref:p},{children:[ue(o,"left")&&e(sn,{columnIndices:b,gridTemplateColumns:c,handleScroll:void 0,headers:o,maxDepth:I,pinned:"left",sectionRef:g,sort:d,width:h}),e(sn,{columnIndices:b,gridTemplateColumns:i,handleScroll:void 0,headers:o,maxDepth:I,sectionRef:r,sort:d}),ue(o,"right")&&e(sn,{columnIndices:b,gridTemplateColumns:u,handleScroll:void 0,headers:o,maxDepth:I,pinned:"right",sectionRef:w,sort:d,width:f})]}))},hn=function(e){var n=e.headers,t=e.collapsedHeaders,r=function(e){var n=e.headers,o=e.flattenedHeaders;return n.forEach(function(e){if(!e.hide)if(e.children&&e.children.length>0)if(t&&t.has(e.accessor)){var n=e.children.filter(function(e){return"parentCollapsed"===e.showWhen||"always"===e.showWhen});n.length>0?r({headers:n,flattenedHeaders:o}):o.push(e)}else{var i=e.children.filter(function(e){return"parentExpanded"===e.showWhen||"always"===e.showWhen||!e.showWhen});r({headers:i,flattenedHeaders:o})}else o.push(e)}),o},o=r({headers:n,flattenedHeaders:[]});return"".concat(o.map(function(e){return function(e){var n=e.minWidth,t=e.width;return"number"==typeof t&&(t="".concat(t,"px")),n&&"number"==typeof n&&(n="".concat(n,"px")),void 0!==n?"string"==typeof t&&t.endsWith("fr")?"minmax(".concat(n,", ").concat(t,")"):"max(".concat(n,", ").concat(t,")"):t}(e)}).join(" "))},fn=function(n){var r=n.pinnedLeftWidth,o=n.pinnedRightWidth,l=n.setScrollTop,c=n.sort,s=n.tableRows,u=n.rowsToRender,d=q(),h=d.columnResizing,f=d.editColumns,v=d.headers,p=d.collapsedHeaders,g=i(null),w=v.filter(function(e){return!e.pinned}),y=v.filter(function(e){return"left"===e.pinned}),b=v.filter(function(e){return"right"===e.pinned}),C=a(function(){return hn({headers:y,collapsedHeaders:p})},[y,p]),I=a(function(){return hn({headers:w,collapsedHeaders:p})},[w,p]),S=a(function(){return hn({headers:b,collapsedHeaders:p})},[b,p]),x={centerHeaderRef:g,headers:v,mainTemplateColumns:I,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedRightColumns:b,pinnedRightTemplateColumns:S,sort:c,pinnedLeftWidth:r,pinnedRightWidth:o},R={tableRows:s,mainTemplateColumns:I,pinnedLeftColumns:y,pinnedLeftTemplateColumns:C,pinnedLeftWidth:r,pinnedRightColumns:b,pinnedRightTemplateColumns:S,pinnedRightWidth:o,setScrollTop:l,rowsToRender:u};return t("div",m({className:"st-content ".concat(h?"st-resizeable":"st-not-resizeable"),style:{width:f?"calc(100% - 27.5px)":"100%"}},{children:[e(dn,m({},x)),e(Oe,m({},R))]}))},vn=function(n){var r=n.mainBodyWidth,a=n.mainBodyRef,l=n.pinnedLeftWidth,s=n.pinnedRightWidth,u=n.pinnedLeftContentWidth,d=n.pinnedRightContentWidth,h=n.tableBodyContainerRef,f=q().editColumns,v=o(!1),p=v[0],g=v[1],w=i(null),y=i(null),b=i(null),C=h.current&&h.current.scrollHeight>h.current.clientHeight,I=f?28:0,S=(f?s+1:s)+(h.current&&C?h.current.offsetWidth-h.current.clientWidth:0);return c(function(){setTimeout(function(){!function(){if(a.current){var e=a.current.clientWidth;g(r>e)}}()},1)},[a,r]),p?t("div",m({className:"st-horizontal-scrollbar-container"},{children:[l>0&&e(Me,m({childRef:y,group:"pinned-left"},{children:e("div",m({className:"st-horizontal-scrollbar-left",ref:y,style:{width:l}},{children:e("div",{style:{width:u}})}))})),r>0&&e(Me,m({childRef:w},{children:e("div",m({className:"st-horizontal-scrollbar-middle",ref:w},{children:e("div",{style:{width:r}})}))})),s>0&&e(Me,m({childRef:b,group:"pinned-right"},{children:e("div",m({className:"st-horizontal-scrollbar-right",ref:b,style:{width:S}},{children:e("div",{style:{width:d}})}))})),I>0&&e("div",{style:{width:I-1.5,height:"100%",flexShrink:0}})]})):null},pn={string:function(e,n,t){if(e===n)return 0;var r=e.localeCompare(n);return"ascending"===t?r:-r},number:function(e,n,t){if(e===n)return 0;var r=e-n;return"ascending"===t?r:-r},boolean:function(e,n,t){if(e===n)return 0;var r=e===n?0:e?-1:1;return"ascending"===t?r:-r},date:function(e,n,t){var r=new Date(e),o=new Date(n);if(r.getTime()===o.getTime())return 0;var i=r.getTime()-o.getTime();return"ascending"===t?i:-i},enum:function(e,n,t){return pn.string(e,n,t)},default:function(e,n,t){return e===n?0:null==e?"ascending"===t?-1:1:null==n?"ascending"===t?1:-1:"string"==typeof e&&"string"==typeof n?pn.string(e,n,t):"number"==typeof e&&"number"==typeof n?pn.number(e,n,t):"boolean"==typeof e&&"boolean"==typeof n?pn.boolean(e,n,t):pn.string(String(e),String(n),t)}},gn=function(e){var n=e.rows,t=e.sortColumn,r=e.headers,o=function(e,n){for(var t=0,r=e;t<r.length;t++){var i=r[t];if(i.accessor===n)return i;if(i.children&&i.children.length>0){var a=o(i.children,n);if(a)return a}}},i=o(r,t.key.accessor),a=(null==i?void 0:i.type)||"string",l=t.direction;return C([],n,!0).sort(function(e,n){var r=t.key.accessor;return function(e,n,t,r){if(void 0===t&&(t="string"),null==e||""===e)return"ascending"===r?-1:1;if(null==n||""===n)return"ascending"===r?1:-1;if("number"===t){var o=function(e){var n;if("number"==typeof e)return e;var t=String(e);if("string"==typeof t){var r=t.replace(/[$,]/g,"").match(/^([-+]?\d*\.?\d+)([TBMKtbmk])?/);if(r){var o=parseFloat(r[1]),i=null===(n=r[2])||void 0===n?void 0:n.toUpperCase();return"T"===i?o*=1e12:"B"===i?o*=1e9:"M"===i?o*=1e6:"K"===i&&(o*=1e3),o}}return parseFloat(t)||0},i=o(e),a=o(n);return pn.number(i,a,r)}return"date"===t?pn.date(String(e),String(n),r):"boolean"===t?pn.boolean(Boolean(e),Boolean(n),r):"enum"===t?pn.enum(String(e),String(n),r):pn.string(String(e),String(n),r)}(e[r],n[r],a,l)})},wn=function(e){var n=e.headers,t=e.rows,r=e.sortColumn;return gn({rows:t,sortColumn:r,headers:n})},mn=function(e){var n=e.externalSortHandling,t=e.tableRows,r=e.sortColumn,o=e.rowGrouping,i=e.headers,a=e.sortNestedRows;return n?t:r?o&&o.length>0?a({groupingKeys:o,headers:i,rows:t,sortColumn:r}):wn({headers:i,rows:t,sortColumn:r}):t},yn=function(e,n,t){void 0===t&&(t=new Set);for(var r=0,o=e;r<o.length;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}),l=!1;if(!a)for(var c=0,s=i.children;c<s.length;c++){var u=s[c];if(yn([u],n,t),!1===u.hide){l=!0;break}}(a||l)&&(i.hide=!1)}}},bn=function(e){return e.every(function(e){return e.hide})},Cn=function(e){e.forEach(function(e){e.children&&e.children.length>0&&(Cn(e.children),bn(e.children)&&(e.hide=!0))})},In=function(r){var i=r.allHeaders,a=r.depth,l=void 0===a?0:a,c=r.doesAnyHeaderHaveChildren,s=r.header,u=r.isCheckedOverride,d=o(!0),h=d[0],f=d[1],v=q(),p=v.expandIcon,g=v.headers,w=v.setHeaders,y=c?"".concat(16*l,"px"):"8px",b=s.children&&s.children.length>0,I=null!=u?u:s.hide||b&&s.children&&bn(s.children);return t(n,{children:[t("div",m({className:"st-header-checkbox-item",style:{paddingLeft:y}},{children:[c&&e("div",m({className:"st-header-icon-container"},{children:b?e("div",m({className:"st-collapsible-header-icon st-expand-icon-container ".concat(h?"expanded":"collapsed"),onClick:function(e){e.stopPropagation(),f(!h)}},{children:p})):null})),e(Ne,m({checked:I,onChange:function(e){(s.hide=e,e)?Cn(i):(yn(i,s.accessor),b&&s.children&&s.children.length>0&&s.children.every(function(e){return!0===e.hide})&&s.children[0]&&(s.children[0].hide=!1,yn(i,s.children[0].accessor)));w(C([],g,!0))}},{children:s.label}))]})),b&&h&&s.children&&e("div",m({className:"st-nested-headers"},{children:s.children.map(function(n,t){return e(In,{allHeaders:i,depth:l+1,doesAnyHeaderHaveChildren:c,header:n,isCheckedOverride:!!I||void 0},"".concat(n.accessor,"-").concat(t))})}))]})},Sn=function(n){var t=n.headers,r=n.open,o="left"===n.position?"left":"",i=a(function(){return t.some(function(e){return e.children&&e.children.length>0})},[t]);return e("div",m({className:"st-column-editor-popout ".concat(r?"open":""," ").concat(o),onClick:function(e){return e.stopPropagation()}},{children:e("div",m({className:"st-column-editor-popout-content"},{children:t.map(function(n,r){return n.isSelectionColumn?null:e(In,{doesAnyHeaderHaveChildren:i,header:n,allHeaders:t},"".concat(n.accessor,"-").concat(r))})}))}))},xn=function(n){var r=n.columnEditorText,i=n.editColumns,a=n.editColumnsInitOpen,l=n.headers,c=n.position,s=void 0===c?"right":c,u=o(a),d=u[0],h=u[1];return i?t("div",m({className:"st-column-editor ".concat(d?"open":""," ").concat(s),onClick:function(){return function(e){h(e)}(!d)},style:{width:28}},{children:[e("div",m({className:"st-column-editor-text"},{children:r})),e(Sn,{headers:l,open:d,position:s})]})):null},Rn=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("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"})}))},En=function(n){var t=n.className;return e("svg",m({"aria-hidden":"true",focusable:"false",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 320 512",className:t,style:{height:"1em"}},{children:e("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"})}))},Nn=function(n){var t=n.className,r=n.style;return e("svg",m({"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",className:t,style:m({height:"1em"},r)},{children:e("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"})}))},Hn=function(n){var t=n.children,o=i({}),a=l(function(e,n){return!!o.current[n]&&o.current[n].find(function(n){return n===e})},[]),c=l(function(e,n){var t=e.clientWidth,r=e.scrollLeft;e.scrollWidth-t>0&&(n.scrollLeft=r)},[]),s=l(function(e){e.onscroll=null},[]),u=l(function(e,n){e.onscroll=function(){window.requestAnimationFrame(function(){n.forEach(function(n){var t;null===(t=o.current[n])||void 0===t||t.forEach(function(n){e!==n&&(s(n),c(e,n),window.requestAnimationFrame(function(){var e=Object.keys(o.current).filter(function(e){return o.current[e].includes(n)});u(n,e)}))})})})}},[s,c]),d=l(function(e,n){n.forEach(function(n){o.current[n]||(o.current[n]=[]),a(e,n)||(o.current[n].length>0&&c(o.current[n][0],e),o.current[n].push(e))}),u(e,n)},[a,c,u]),h=l(function(e,n){n.forEach(function(n){if(a(e,n)){s(e);var t=o.current[n].indexOf(e);-1!==t&&o.current[n].splice(t,1)}})},[a,s]);return e(De.Provider,m({value:{registerPane:d,unregisterPane:h}},{children:r.Children.only(t)}))},kn=function(e,n){var t=n.find(function(n){return n.accessor===e.accessor}),r=(null==t?void 0:t.label)||e.accessor,o=ze[e.operator],i="";return void 0!==e.value?i="boolean"==typeof e.value?e.value?"True":"False":String(e.value):e.values&&Array.isArray(e.values)&&("between"===e.operator||"notBetween"===e.operator?i="".concat(e.values[0]," - ").concat(e.values[1]):"in"!==e.operator&&"notIn"!==e.operator||(i=e.values.join(", "))),"isEmpty"===e.operator||"isNotEmpty"===e.operator?"".concat(r,": ").concat(o):"".concat(r,": ").concat(o," ").concat(i)},An=function(){var n=q(),r=n.filters,o=n.handleClearFilter,i=n.headers,a=Object.values(r);return 0===a.length||a.length>0?null:e("div",m({className:"st-filter-bar"},{children:e("div",m({className:"st-filter-bar-content"},{children:e("div",m({className:"st-filter-chips"},{children:a.map(function(n){return t("div",m({className:"st-filter-chip"},{children:[e("span",m({className:"st-filter-chip-text"},{children:kn(n,i)})),e("button",m({className:"st-filter-chip-remove",onClick:function(){return o(n.accessor)},"aria-label":"Remove filter for ".concat(n.accessor)},{children:"×"}))]}),n.accessor)})}))}))}))},Fn=function(e){var n=e.externalFilterHandling,t=e.tableRows,r=e.filterState;return n?t:r&&0!==Object.keys(r).length?t.filter(function(e){return Object.values(r).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||""===String(e).trim();if("isNotEmpty"===t)return e&&""!==String(e).trim();if("string"==typeof e||"contains"===t||"notContains"===t||"startsWith"===t||"endsWith"===t){var i=String(e).toLowerCase(),a=r?String(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(Number(e))){var l=Number(e),c=Number(r);switch(t){case"equals":return l===c;case"notEquals":return l!==c;case"greaterThan":return l>c;case"lessThan":return l<c;case"greaterThanOrEqual":return l>=c;case"lessThanOrEqual":return l<=c;case"between":if(o&&2===o.length){var s=o.map(Number),u=s[0],d=s[1];return l>=u&&l<=d}return!1;case"notBetween":if(o&&2===o.length){var h=o.map(Number);return u=h[0],d=h[1],l<u||l>d}return!0}}if(e instanceof Date||!isNaN(Date.parse(e))){var f=ne(e),v=ne(String(r||"")),p=ee(f),g=ee(v);switch(t){case"equals":return p.getTime()===g.getTime();case"notEquals":return p.getTime()!==g.getTime();case"before":return p<g;case"after":return p>g;case"between":if(o&&2===o.length){var w=o.map(function(e){return ee(ne(String(e||"")))}),m=w[0],y=w[1];return p>=m&&p<=y}return!1;case"notBetween":if(o&&2===o.length){var b=o.map(function(e){return ee(ne(String(e||"")))});return m=b[0],y=b[1],p<m||p>y}return!0}}if("boolean"==typeof e){var C=Boolean(r);if("equals"===t)return e===C}if(Array.isArray(e)){var I=e.map(function(e){return"object"==typeof e&&null!==e?JSON.stringify(e):String(e)}).join(", ");e=I}if("in"===t||"notIn"===t){if(o&&Array.isArray(o)){var S=String(e),x=o.includes(S);return"in"===t?x:!x}return!1}var R=String(e).toLowerCase(),E=r?String(r).toLowerCase():"";switch(t){case"equals":return R===E;case"notEquals":return R!==E;default:return!0}}(e[n.accessor],n)}catch(e){return console.warn("Filter error for accessor ".concat(n.accessor,":"),e),!0}})}):t},Wn=function(e){var n=e.rows,t=e.headers,r=e.rowGrouping;return a(function(){if(!r||0===r.length)return n;var e=function(e){return x(e).filter(function(e){return e.aggregation})}(t);if(0===e.length)return n;var o=JSON.parse(JSON.stringify(n)),i=function(n,t){return void 0===t&&(t=0),n.map(function(n){var o=r[t],a=r[t+1],l=n[o];if(l&&D(l)){var c=i(l,t+1),s=m({},n);return s[o]=c,e.forEach(function(e){var n=Tn(c,e.accessor,e.aggregation,a);void 0!==n&&(s[e.accessor]=n)}),s}return n})};return i(o)},[n,t,r])},Tn=function(e,n,t,r){var o=[],i=function(e){e.forEach(function(e){var t=r?e[r]:void 0;r&&t&&D(t)?i(t):void 0!==e[n]&&null!==e[n]&&o.push(e[n])})};if(i(e),0!==o.length){if("custom"===t.type&&t.customFn)return t.customFn(o);var a,l=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===l.length)return"count"===t.type?o.length:void 0;switch(t.type){case"sum":a=l.reduce(function(e,n){return e+n},0);break;case"average":a=l.reduce(function(e,n){return e+n},0)/l.length;break;case"count":a=o.length;break;case"min":a=Math.min.apply(Math,l);break;case"max":a=Math.max.apply(Math,l);break;default:return}return t.formatResult?t.formatResult(a):a}},Dn=function(e){if(null==e)return"";var n=String(e);if(n.includes(",")||n.includes('"')||n.includes("\n")||n.includes("\r")){var t=n.replace(/"/g,'""');return'"'.concat(t,'"')}return n},Mn=function(e,n,t){var r=function(e,n){var t=function(e){var n=[],t=function(e){for(var r=0,o=e;r<o.length;r++){var i=o[r];i.hide||i.isSelectionColumn||(i.children&&i.children.length>0?t(i.children):n.push(i))}};return t(e),n}(n);return C([t.map(function(e){return Dn(e.label)}).join(",")],e.map(function(e){var n=e.row;return t.map(function(e){var t=n[e.accessor];return Dn(t)}).join(",")}),!0).join("\n")}(e,n);!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)}(r,t)},Ln=function(e){var n=e.rows,t=e.rowIdAccessor,r=e.onRowSelectionChange,i=e.enableRowSelection,c=void 0!==i&&i,s=o(new Set),u=s[0],d=s[1],h=l(function(e){return!!c&&function(e,n){return n.has(e)}(e,u)},[u,c]),f=l(function(){return!!c&&function(e,n,t){return 0!==e.length&&e.every(function(e){return t.has(String(e[n]))})}(n,t,u)},[n,t,u,c]),v=a(function(){return c?function(e){return e.size}(u):0},[u,c]),p=a(function(){return c?function(e,n,t){return e.filter(function(e){return t.has(String(e[n]))})}(n,t,u):[]},[n,t,u,c]),g=l(function(e,o){if(c){var i=function(e,n){var t=new Set(n);return t.has(e)?t.delete(e):t.add(e),t}(e,u);if(d(i),r){var a=n.find(function(n){return String(n[t])===e});a&&r({row:a,isSelected:o,selectedRows:i})}}},[u,n,t,r,c]),w=l(function(e){var o;c&&(e?(o=function(e,n){return new Set(e.map(function(e){return String(e[n])}))}(n,t),r&&n.forEach(function(e){return r({row:e,isSelected:!0,selectedRows:o})})):(o=new Set,r&&u.forEach(function(e){var i=n.find(function(n){return String(n[t])===e});i&&r({row:i,isSelected:!1,selectedRows:o})})),d(o))},[n,t,r,u,c]),m=l(function(e){if(c){var n=h(e);g(e,!n)}},[h,g,c]),y=l(function(){if(c){if(r){var e=new Set;u.forEach(function(o){var i=n.find(function(e){return String(e[t])===o});i&&r({row:i,isSelected:!1,selectedRows:e})})}d(new Set)}},[u,n,t,r,c]);return{selectedRows:u,setSelectedRows:d,isRowSelected:h,areAllRowsSelected:f,selectedRowCount:v,selectedRowsData:p,handleRowSelect:g,handleSelectAll:w,handleToggleRow:m,clearSelection:y}},Bn=function(n){var t=o(!1),r=t[0],i=t[1];return c(function(){i(!0)},[]),r?e(On,m({},n)):null},On=function(n){var r=n.allowAnimations,s=void 0!==r&&r,u=n.cellUpdateFlash,h=void 0!==u&&u,f=n.className,v=n.columnBorders,p=void 0!==v&&v,g=n.columnEditorPosition,S=void 0===g?"right":g,x=n.columnEditorText,E=void 0===x?"Columns":x,N=n.columnReordering,H=void 0!==N&&N,W=n.columnResizing,T=void 0!==W&&W,O=n.defaultHeaders,q=n.editColumns,U=void 0!==q&&q,V=n.editColumnsInitOpen,K=void 0!==V&&V,J=n.enableHeaderEditing,X=void 0!==J&&J,_=n.enableRowSelection,$=void 0!==_&&_,Q=n.expandAll,Z=void 0===Q||Q,ee=n.expandIcon,ne=void 0===ee?e(Y,{className:"st-expand-icon"}):ee,te=n.externalFilterHandling,re=void 0!==te&&te,oe=n.externalSortHandling,ie=void 0!==oe&&oe,ae=n.filterIcon,le=void 0===ae?e(Nn,{className:"st-header-icon"}):ae,se=n.footerRenderer,ue=n.headerCollapseIcon,de=void 0===ue?e(Y,{className:"st-header-icon"}):ue,he=n.headerExpandIcon,fe=void 0===he?e(j,{className:"st-header-icon"}):he,ve=n.headerDropdown,pe=n.headerHeight,ge=n.height,we=n.hideFooter,me=void 0!==we&&we,be=n.nextIcon,Ce=void 0===be?e(Y,{className:"st-next-prev-icon"}):be,Ie=n.onCellEdit,Se=n.onCellClick,xe=n.onColumnOrderChange,Re=n.onColumnSelect,Ee=n.onFilterChange,Ne=n.onGridReady,He=n.onHeaderEdit,ke=n.onLoadMore,Ae=n.onNextPage,Fe=n.onRowSelectionChange,We=n.onSortChange,Te=n.prevIcon,De=void 0===Te?e(j,{className:"st-next-prev-icon"}):Te,Me=n.rowButtons,Le=n.rowGrouping,Be=n.rowHeight,Oe=void 0===Be?32:Be,Pe=n.rowIdAccessor,qe=n.rows,ze=n.selectionColumnWidth,je=void 0===ze?42:ze,Ye=n.rowsPerPage,Ge=void 0===Ye?10:Ye,Ue=n.selectableCells,Ve=void 0!==Ue&&Ue,Ke=n.selectableColumns,Je=void 0!==Ke&&Ke,Xe=n.shouldPaginate,_e=void 0!==Xe&&Xe,$e=n.sortDownIcon,Qe=void 0===$e?e(Rn,{className:"st-header-icon"}):$e,Ze=n.sortUpIcon,en=void 0===Ze?e(En,{className:"st-header-icon"}):Ze,nn=n.tableRef,tn=n.theme,rn=void 0===tn?"light":tn,on=n.useHoverRowBackground,an=void 0===on||on,ln=n.useOddEvenRowBackground,cn=void 0!==ln&&ln,sn=n.useOddColumnBackground,un=void 0!==sn&&sn;un&&(cn=!1),p&&(an=!1);var dn=w(function(e){return e+1},0)[1],hn=i(null),pn=i(null),gn=i(null),yn=i(null),bn=i(null),Cn=i(null),In=i(null),Sn=o(1),kn=Sn[0],Tn=Sn[1],Dn=o(O),Bn=Dn[0],On=Dn[1],Pn=o(!1),qn=Pn[0],zn=Pn[1],jn=o(!1),Yn=jn[0],Gn=jn[1],Un=o(null),Vn=Un[0],Kn=Un[1],Jn=o(new Set),Xn=Jn[0],_n=Jn[1];c(function(){On(O)},[O]);var $n=Ln({rows:qe,rowIdAccessor:Pe,onRowSelectionChange:Fe,enableRowSelection:$}),Qn=$n.selectedRows,Zn=$n.setSelectedRows,et=$n.isRowSelected,nt=$n.areAllRowsSelected,tt=$n.selectedRowCount,rt=$n.selectedRowsData,ot=$n.handleRowSelect,it=$n.handleSelectAll,at=$n.handleToggleRow,lt=$n.clearSelection,ct=a(function(){var e,n=C([],Bn,!0);$&&!(null===(e=null==Bn?void 0:Bn[0])||void 0===e?void 0:e.isSelectionColumn)&&(n=C([{accessor:"__row_selection__",label:"",width:je,isEditable:!1,type:"boolean",pinned:"left",isSelectionColumn:!0,isSortable:!1,filterable:!1,align:"center"}],n,!0));return n},[$,Bn,je]),st=o(0),ut=st[0],dt=st[1],ht=o(new Set),ft=ht[0],vt=ht[1],pt=function(e){var n=e.tableBodyContainerRef,t=o(0),r=t[0],i=t[1];return d(function(){if(n.current){var e=n.current.offsetWidth-n.current.clientWidth;i(e)}},[n]),{setScrollbarWidth:i,scrollbarWidth:r,tableBodyContainerRef:n}}({tableBodyContainerRef:Cn}),gt=pt.scrollbarWidth,wt=pt.setScrollbarWidth,mt=o(0),yt=mt[0],bt=mt[1];d(function(){var e=function(){Cn.current&&bt(Cn.current.clientWidth)};e();var n=null;return Cn.current&&(n=new ResizeObserver(e)).observe(Cn.current),function(){n&&n.disconnect()}},[]);var Ct=a(function(){var e=I(window.innerWidth),n=function(e){var n=e.headers,t=e.containerWidth,r=e.maxPinnedWidthPercent,o=void 0===r?.8:r,i=e.collapsedHeaders,a=0,l=0,c=0;n.forEach(function(e){if(!e.hide){var n=A(e,i).reduce(function(e,n){return e+F(n)},0);"left"===e.pinned?a+=n:"right"===e.pinned?l+=n:c+=n}});var s=a,u=l;if(t&&t>0){var d=t*o;a>d&&(a=d),l>d&&(l=d)}return{leftWidth:R(a),rightWidth:R(l),mainWidth:c,leftContentWidth:s,rightContentWidth:u}}({headers:ct,containerWidth:yt,maxPinnedWidthPercent:e,collapsedHeaders:Xn});return{mainBodyWidth:n.mainWidth,pinnedLeftWidth:n.leftWidth,pinnedRightWidth:n.rightWidth,pinnedLeftContentWidth:n.leftContentWidth,pinnedRightContentWidth:n.rightContentWidth}},[ct,yt,Xn]),It=Ct.mainBodyWidth,St=Ct.pinnedLeftWidth,xt=Ct.pinnedRightWidth,Rt=Ct.pinnedLeftContentWidth,Et=Ct.pinnedRightContentWidth,Nt=function(e){var n=e.height,t=e.rowHeight;return a(function(){var e;if(!n)return window.innerHeight-t;var r=document.querySelector(".simple-table-root"),o=0;if("string"==typeof n)if(n.endsWith("px"))o=parseInt(n,10);else if(n.endsWith("vh")){var i=parseInt(n,10);o=window.innerHeight*i/100}else if(n.endsWith("%")){var a=parseInt(n,10);o=((null===(e=null==r?void 0:r.parentElement)||void 0===e?void 0:e.clientHeight)||window.innerHeight)*a/100}else o=window.innerHeight;else o=n;return Math.max(0,o-t)},[n,t])}({height:ge,rowHeight:Oe}),Ht=Wn({rows:qe,headers:Bn,rowGrouping:Le}),kt=function(e){var n=e.rows,t=e.externalFilterHandling,r=e.onFilterChange,i=o({}),c=i[0],s=i[1],u=a(function(){return Fn({externalFilterHandling:t,tableRows:n,filterState:c})},[n,c,t]),d=l(function(e){var n,t=m(m({},c),((n={})[e.accessor]=e,n));s(t),null==r||r(t)},[c,r]),h=l(function(e){var n=m({},c);delete n[e],s(n),null==r||r(n)},[c,r]),f=l(function(){s({}),null==r||r({})},[r]),v=l(function(e){var r,o=m(m({},c),((r={})[e.accessor]=e,r));return Fn({externalFilterHandling:t,tableRows:n,filterState:o})},[c,n,t]);return{filteredRows:u,updateFilter:d,clearFilter:h,clearAllFilters:f,filters:c,computeFilteredRowsPreview:v}}({rows:Ht,externalFilterHandling:re,onFilterChange:Ee}),At=kt.filters,Ft=kt.filteredRows,Wt=kt.updateFilter,Tt=kt.clearFilter,Dt=kt.clearAllFilters,Mt=kt.computeFilteredRowsPreview,Lt=function(e){var n=e.headers,t=e.tableRows,r=e.externalSortHandling,i=e.onSortChange,c=e.rowGrouping,s=o(null),u=s[0],d=s[1],h=l(function(e){var n=e.groupingKeys,t=e.headers,r=e.rows,o=e.sortColumn,i=wn({headers:t,rows:r,sortColumn:o});return n&&0!==n.length?i.map(function(e){var r,i=n[0],a=e[i];if(D(a)){var l=h({rows:a,sortColumn:o,headers:t,groupingKeys:n.slice(1)});return m(m({},e),((r={})[i]=l,r))}return e}):i},[]),f=a(function(){return mn({externalSortHandling:r,tableRows:t,sortColumn:u,rowGrouping:c,headers:n,sortNestedRows:h})},[t,u,n,r,c,h]),v=l(function(e){var t=function(n){for(var r=0,o=n;r<o.length;r++){var i=o[r];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=t(i.children);if(a)return a}}},r=t(n);if(r){var o=null;u&&u.key.accessor===e?"ascending"===u.direction&&(o={key:r,direction:"descending"}):o={key:r,direction:"ascending"},d(o),null==i||i(o)}},[u,n,i]),p=l(function(e){var o=function(n){for(var t=0,r=n;t<r.length;t++){var i=r[t];if(i.accessor===e)return i;if(i.children&&i.children.length>0){var a=o(i.children);if(a)return a}}},i=o(n);if(!i)return t;var a=null;return u&&u.key.accessor===e?"ascending"===u.direction&&(a={key:i,direction:"descending"}):a={key:i,direction:"ascending"},mn({externalSortHandling:r,tableRows:t,sortColumn:a,rowGrouping:c,headers:n,sortNestedRows:h})},[u,n,t,r,c,h]);return{sort:u,sortedRows:f,updateSort:v,computeSortedRowsPreview:p}}({headers:Bn,tableRows:Ft,externalSortHandling:ie,onSortChange:We,rowGrouping:Le}),Bt=Lt.sort,Ot=Lt.sortedRows,Pt=Lt.updateSort,qt=function(e){var n=e.allowAnimations,t=e.sortedRows,r=e.originalRows,c=e.currentPage,s=e.rowsPerPage,u=e.shouldPaginate,h=e.rowGrouping,f=e.rowIdAccessor,v=e.unexpandedRows,p=e.expandAll,g=e.contentHeight,w=e.rowHeight,y=e.scrollTop,b=e.computeFilteredRowsPreview,I=e.computeSortedRowsPreview,S=o(!1),x=S[0],R=S[1],E=o([]),N=E[0],H=E[1],k=i([]),A=i([]),F=i(new Map),W=i(null),T=l(function(e){var n=u?e.slice((c-1)*s,c*s):e;return h&&0!==h.length?L({rows:n,rowGrouping:h,rowIdAccessor:f,unexpandedRows:v,expandAll:p}):n.map(function(e,n){return{row:e,depth:0,groupingKey:void 0,position:n,isLastGroupRow:!1}})},[c,s,u,h,f,v,p]);a(function(){if(0===F.current.size){var e=T(r),n=new Map;e.forEach(function(e){var t=String(M({row:e.row,rowIdAccessor:f}));n.set(t,e.position)}),F.current=n}},[r,T,f]);var D=a(function(){return T(t)},[t,T]),B=a(function(){return G({bufferRowCount:5,contentHeight:g,tableRows:D,rowHeight:w,scrollTop:y})},[D,g,w,y]),O=l(function(e,n){var t=new Set(e.map(function(e){return String(M({row:e.row,rowIdAccessor:f}))})),r=new Set(n.map(function(e){return String(M({row:e.row,rowIdAccessor:f}))}));return{staying:n.filter(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return t.has(n)}),entering:n.filter(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return!t.has(n)}),leaving:e.filter(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return!r.has(n)})}},[f]),P=a(function(){if(0===k.current.length)return!1;var e=D.map(function(e){return String(M({row:e.row,rowIdAccessor:f}))}),n=k.current.map(function(e){return String(M({row:e.row,rowIdAccessor:f}))});return e.length!==n.length||!e.every(function(e,t){return e===n[t]})},[D,f]);d(function(){if(!x){if(!n||u)return H([]),k.current=D,void(A.current=B);if(0===k.current.length)return H([]),k.current=D,void(A.current=B);if(!P)return H([]),k.current=D,void(A.current=B);W.current={tableRows:D,visibleRows:B},R(!0)}},[n,D,P,x,u,B]),d(function(){if(x&&W.current&&N.length>0){var e=setTimeout(function(){var e=W.current;R(!1),H([]),k.current=e.tableRows,A.current=e.visibleRows,W.current=null},ye.duration+100);return function(){return clearTimeout(e)}}},[x,N.length]);var q=a(function(){if(!n||u)return B;if(N.length>0){var e=new Map;return D.forEach(function(n){var t=String(M({row:n.row,rowIdAccessor:f}));e.set(t,n.position)}),N.map(function(n){var t=String(M({row:n.row,rowIdAccessor:f})),r=e.get(t);return void 0!==r?m(m({},n),{position:r}):n})}return B},[B,N,D,n,u,f]),z=l(function(e){if(n&&!u){var t=b(e),r=T(t),o=G({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return D.find(function(e){return String(M({row:e.row,rowIdAccessor:f}))===n})||e}).filter(Boolean);i.length>0&&H(C(C([],B,!0),i,!0))}},[n,u,b,T,g,w,y,O,D,B,f]),j=l(function(e){if(n&&!u){var t=I(e),r=T(t),o=G({bufferRowCount:5,contentHeight:g,tableRows:r,rowHeight:w,scrollTop:y}),i=O(B,o).entering.map(function(e){var n=String(M({row:e.row,rowIdAccessor:f}));return D.find(function(e){return String(M({row:e.row,rowIdAccessor:f}))===n})||e}).filter(Boolean);i.length>0&&H(C(C([],B,!0),i,!0))}},[n,u,I,T,g,w,y,O,D,B,f]);return{currentTableRows:D,currentVisibleRows:B,isAnimating:x,prepareForFilterChange:z,prepareForSortChange:j,rowsToRender:q}}({allowAnimations:s,sortedRows:Ot,originalRows:Ht,currentPage:kn,rowsPerPage:Ge,shouldPaginate:_e,rowGrouping:Le,rowIdAccessor:Pe,unexpandedRows:ft,expandAll:Z,contentHeight:Nt,rowHeight:Oe,scrollTop:ut,computeFilteredRowsPreview:Mt,computeSortedRowsPreview:Lt.computeSortedRowsPreview}),zt=qt.currentTableRows,jt=qt.rowsToRender,Yt=qt.prepareForFilterChange,Gt=qt.prepareForSortChange,Ut=qt.isAnimating,Vt=i(new Map),Kt=i(new Map),Jt=function(e){var n=e.selectableCells,t=e.headers,r=e.tableRows,s=e.rowIdAccessor,u=e.onCellEdit,d=e.cellRegistry,h=e.collapsedHeaders,f=o(new Set),v=f[0],p=f[1],g=o(new Set),w=g[0],m=g[1],C=o(null),I=C[0],S=C[1],x=o(null),R=x[0],E=x[1],N=o(new Set),H=N[0],k=N[1],F=o(new Set),W=F[0],T=F[1],D=i(!1),L=i(null),O=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=2){var r=parseInt(t[1],10);isNaN(r)||e.add(r)}}),w.forEach(function(n){e.add(n)}),e},[v,w]),P=a(function(){var e=new Set;return v.forEach(function(n){var t=n.split("-");if(t.length>=3){var r=t.slice(2).join("-");e.add(r)}}),w.size>0&&r.forEach(function(n){var t=M({row:n.row,rowIdAccessor:s});e.add(String(t))}),e},[v,w,r,s]),q=a(function(){return t.flatMap(function(e){return A(e,h)})},[t,h]),z=l(function(){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=Array.from(v).reduce(function(e,t){var o,i=t.split("-").map(Number),a=i[0],l=i[1];e[a]||(e[a]=[]);var c=n.get(l);return c&&(null===(o=r[a])||void 0===o?void 0:o.row)?e[a][l]=r[a].row[c]:e[a][l]="",e},{}),o=Object.values(t).map(function(e){return Object.values(e).join("\t")}).join("\n");v.size>0&&(navigator.clipboard.writeText(o),k(new Set(v)),setTimeout(function(){k(new Set)},800))},[q,v,r]),j=l(function(){return y(void 0,void 0,void 0,function(){var e,n,t,o,i,a,l,c;return b(this,function(h){switch(h.label){case 0:if(!R)return[2];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,navigator.clipboard.readText()];case 2:return(e=h.sent())?0===(n=e.split("\n").filter(function(e){return e.length>0})).length?[2]:(t=q.filter(function(e){return!e.hide}),o=new Set,i=new Set,a=R.rowIndex,l=R.colIndex,n.forEach(function(e,n){e.split("\t").forEach(function(e,c){var h=a+n,f=l+c;if(!(h>=r.length||f>=t.length)){var v=r[h],p=t[f],g=M({row:v.row,rowIdAccessor:s});if(null==p?void 0:p.isEditable){var w=e;if("number"===p.type){var m=Number(e);isNaN(m)||(w=m)}else if("boolean"===p.type)w="true"===e.toLowerCase()||"1"===e;else if("date"===p.type){var y=new Date(e);isNaN(y.getTime())||(w=y)}if(v.row[p.accessor]=w,d){var b="".concat(g,"-").concat(p.accessor),C=d.get(b);C&&C.updateContent(w)}null==u||u({accessor:p.accessor,newValue:w,row:v.row,rowIndex:h});var I=B({colIndex:f,rowIndex:h,rowId:g});o.add(I)}else{var S=B({colIndex:f,rowIndex:h,rowId:g});i.add(S)}}})}),o.size>0&&(k(o),setTimeout(function(){k(new Set)},800)),i.size>0&&(T(i),setTimeout(function(){T(new Set)},800)),[3,4]):[2];case 3:return c=h.sent(),console.warn("Failed to paste from clipboard:",c),[3,4];case 4:return[2]}})})},[R,q,r,s,u,d]),Y=l(function(){if(0!==v.size){var e=q.filter(function(e){return!e.hide}),n=new Map;e.forEach(function(e,t){n.set(t,e.accessor)});var t=new Set,o=new Set;Array.from(v).forEach(function(n){var i=n.split("-").map(Number),a=i[0],l=i[1];if(!(a>=r.length||l>=e.length)){var c=r[a],h=e[l],f=M({row:c.row,rowIdAccessor:s});if(null==h?void 0:h.isEditable){var v=null;if(v="string"===h.type?"":"number"===h.type?null:"boolean"!==h.type&&("date"===h.type?null:Array.isArray(c.row[h.accessor])?[]:""),c.row[h.accessor]=v,d){var p="".concat(f,"-").concat(h.accessor),g=d.get(p);g&&g.updateContent(v)}null==u||u({accessor:h.accessor,newValue:v,row:c.row,rowIndex:a}),t.add(n)}else o.add(n)}}),t.size>0&&(k(t),setTimeout(function(){k(new Set)},800)),o.size>0&&(T(o),setTimeout(function(){T(new Set)},800))}},[v,q,r,s,u,d]),G=l(function(e,n){for(var t=new Set,o=Math.min(e.rowIndex,n.rowIndex),i=Math.max(e.rowIndex,n.rowIndex),a=Math.min(e.colIndex,n.colIndex),l=Math.max(e.colIndex,n.colIndex),c=o;c<=i;c++)for(var u=a;u<=l;u++)if(c>=0&&c<r.length){var d=M({row:r[c].row,rowIdAccessor:s});t.add(B({colIndex:u,rowIndex:c,rowId:d}))}m(new Set),S(null),p(t)},[r,s,m,S,p]),U=l(function(e){if(e.rowIndex>=0&&e.rowIndex<r.length&&e.colIndex>=0&&e.colIndex<q.length){var n=B(e);m(new Set),S(null),p(new Set([n])),E(e)}},[q.length,r.length,m,S,p,E]),V=l(function(e,n){void 0===n&&(n=!1),p(new Set),E(null),m(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])},[p,E,m,S]);c(function(){var e=function(e){var t;if(n&&R){var o=R.rowIndex,i=R.colIndex,a=R.rowId;if(!e.ctrlKey&&!e.metaKey||"c"!==e.key){if((e.ctrlKey||e.metaKey)&&"v"===e.key)return e.preventDefault(),void j();if("Delete"===e.key||"Backspace"===e.key)return e.preventDefault(),void Y();if(M({row:null===(t=r[o])||void 0===t?void 0:t.row,rowIdAccessor:s})!==a){var l=r.findIndex(function(e,n){return M({row:e.row,rowIdAccessor:s})===a});if(-1===l)return;o=l}if("ArrowUp"===e.key){if(e.preventDefault(),o>0){var c=M({row:r[o-1].row,rowIdAccessor:s});U({rowIndex:o-1,colIndex:i,rowId:c})}}else"ArrowDown"===e.key?(e.preventDefault(),o<r.length-1&&(c=M({row:r[o+1].row,rowIdAccessor:s}),U({rowIndex:o+1,colIndex:i,rowId:c}))):"ArrowLeft"===e.key||"Tab"===e.key&&e.shiftKey?(e.preventDefault(),i>0&&(c=M({row:r[o].row,rowIdAccessor:s}),U({rowIndex:o,colIndex:i-1,rowId:c}))):"ArrowRight"===e.key||"Tab"===e.key?(e.preventDefault(),i<q.length-1&&(c=M({row:r[o].row,rowIdAccessor:s}),U({rowIndex:o,colIndex:i+1,rowId:c}))):"Escape"===e.key&&(p(new Set),m(new Set),S(null),L.current=null,E(null))}else z()}};return document.addEventListener("keydown",e),function(){document.removeEventListener("keydown",e)}},[z,q.length,R,s,G,U,n,r,j,Y]);var K=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=B({colIndex:n,rowIndex:t,rowId:r}),i=v.has(o),a=w.has(n);return i||a},[v,w]),J=l(function(e){var n=e.colIndex,t=e.rowIndex,o=e.rowId,i=[],a=r[t-1]?M({row:r[t-1].row,rowIdAccessor:s}):null,l=r[t+1]?M({row:r[t+1].row,rowIdAccessor:s}):null,c=null!==a?{colIndex:n,rowIndex:t-1,rowId:a}:null,u=null!==l?{colIndex:n,rowIndex:t+1,rowId:l}:null,d={colIndex:n-1,rowIndex:t,rowId:o},h={colIndex:n+1,rowIndex:t,rowId:o};return(!c||!K(c)||w.has(n)&&0===t)&&i.push("st-selected-top-border"),(!u||!K(u)||w.has(n)&&t===r.length-1)&&i.push("st-selected-bottom-border"),K(d)||i.push("st-selected-left-border"),K(h)||i.push("st-selected-right-border"),i.join(" ")},[K,r,w,s]),X=a(function(){return R?function(e){var n=e.rowIndex,t=e.colIndex,r=e.rowId;return n===R.rowIndex&&t===R.colIndex&&r===R.rowId}:function(){return!1}},[R]),_=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=B({colIndex:n,rowIndex:t,rowId:r});return H.has(o)},[H]),$=l(function(e){var n=e.colIndex,t=e.rowIndex,r=e.rowId,o=B({colIndex:n,rowIndex:t,rowId:r});return W.has(o)},[W]);return{getBorderClass:J,handleMouseDown:function(e){var t=e.colIndex,r=e.rowIndex,o=e.rowId;n&&(D.current=!0,L.current={rowIndex:r,colIndex:t,rowId:o},setTimeout(function(){m(new Set),S(null);var e=B({colIndex:t,rowIndex:r,rowId:o});p(new Set([e])),E({rowIndex:r,colIndex:t,rowId:o})},0))},handleMouseOver:function(e){var t=e.colIndex,o=e.rowIndex;if(e.rowId,n&&D.current&&L.current){for(var i=new Set,a=Math.min(L.current.rowIndex,o),l=Math.max(L.current.rowIndex,o),c=Math.min(L.current.colIndex,t),u=Math.max(L.current.colIndex,t),d=a;d<=l;d++)for(var h=c;h<=u;h++)if(d>=0&&d<r.length){var f=M({row:r[d].row,rowIdAccessor:s});i.add(B({colIndex:h,rowIndex:d,rowId:f}))}p(i)}},handleMouseUp:function(){D.current=!1},isCopyFlashing:_,isWarningFlashing:$,isInitialFocusedCell:X,isSelected:K,lastSelectedColumnIndex:I,pasteFromClipboard:j,selectColumns:V,selectedCells:v,selectedColumns:w,setInitialFocusedCell:E,setSelectedCells:p,setSelectedColumns:m,deleteSelectedCells:Y,columnsWithSelectedCells:O,rowsWithSelectedCells:P}}({selectableCells:Ve,headers:Bn,tableRows:zt,rowIdAccessor:Pe,onCellEdit:Ie,cellRegistry:Vt.current,collapsedHeaders:Xn}),Xt=Jt.getBorderClass,_t=Jt.handleMouseDown,$t=Jt.handleMouseOver,Qt=Jt.handleMouseUp,Zt=Jt.isCopyFlashing,er=Jt.isInitialFocusedCell,nr=Jt.isSelected,tr=Jt.isWarningFlashing,rr=Jt.selectColumns,or=Jt.selectedCells,ir=Jt.selectedColumns,ar=Jt.setInitialFocusedCell,lr=Jt.setSelectedCells,cr=Jt.setSelectedColumns,sr=Jt.columnsWithSelectedCells,ur=Jt.rowsWithSelectedCells,dr=l(function(e){Gt(e),setTimeout(function(){Pt(e)},0)},[Gt,Pt]),hr=l(function(e){On(e)},[]);!function(e){var n=e.selectableColumns,t=e.selectedCells,r=e.selectedColumns,o=e.setSelectedCells,i=e.setSelectedColumns,a=e.activeHeaderDropdown,l=e.setActiveHeaderDropdown;c(function(){var e=function(e){var c=e.target;c.closest(".editable-cell-input")&&c.closest(".st-header-cell")||(a&&l&&(c.closest(".st-header-cell")||c.closest(".dropdown-content")||l(null)),c.closest(".st-cell")||n&&(c.classList.contains("st-header-cell")||c.classList.contains("st-header-label")||c.classList.contains("st-header-label-text"))||(t.size>0&&o(new Set),r.size>0&&i(new Set)))};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}},[n,t,r,o,i,a,l])}({selectableColumns:Je,selectedCells:or,selectedColumns:ir,setSelectedCells:lr,setSelectedColumns:cr,activeHeaderDropdown:Vn,setActiveHeaderDropdown:Kn}),function(e){var n=e.forceUpdate,t=e.tableBodyContainerRef,r=e.setScrollbarWidth;d(function(){var e=function(){if(n(),t.current){var e=t.current.offsetWidth-t.current.clientWidth;r(e)}};return window.addEventListener("resize",e),function(){window.removeEventListener("resize",e)}},[n,t,r])}({forceUpdate:dn,tableBodyContainerRef:Cn,setScrollbarWidth:wt}),function(e){var n=e.onGridReady;c(function(){null==n||n()},[n])}({onGridReady:Ne}),function(e){var n=e.cellRegistryRef,t=e.currentTableRows,r=e.headerRegistryRef,o=e.headers,i=e.rowIdAccessor,a=e.rows,l=e.tableRef,s=e.visibleRows;c(function(){l&&(l.current={updateData:function(e){var t=e.accessor,r=e.rowIndex,o=e.newValue,l=null==a?void 0:a[r];if(l){var c=M({row:l,rowIdAccessor:i}),s=k({rowId:c,accessor:t}),u=n.current.get(s);u&&u.updateContent(o),void 0!==l[t]&&(l[t]=o)}},setHeaderRename:function(e){var n=e.accessor,t=r.current.get(String(n));t&&t.setEditing(!0)},getVisibleRows:function(){return s},exportToCSV:function(e){var n=(void 0===e?{}:e).filename;Mn(t,o,n)}})},[n,t,r,o,i,a,l,s])}({cellRegistryRef:Vt,currentTableRows:zt,headerRegistryRef:Kt,headers:ct,rowIdAccessor:Pe,rows:qe,tableRef:nn,visibleRows:jt}),function(e){var n=e.filters,t=e.onFilterChange;c(function(){null==t||t(n)},[n,t])}({filters:At,onFilterChange:Ee}),function(e){var n=e.sort,t=e.onSortChange,r=ce(n);c(function(){!n||(null==r?void 0:r.key.accessor)===n.key.accessor&&(null==r?void 0:r.direction)===n.direction?!n&&r&&(null==t||t(null)):null==t||t(n)},[n,r,t])}({sort:Bt,onSortChange:We});var fr=l(function(e){Yt(e),setTimeout(function(){Wt(e)},0)},[Yt,Wt]);return e(P,m({value:{allowAnimations:s,areAllRowsSelected:nt,cellRegistry:Vt.current,cellUpdateFlash:h,clearSelection:lt,collapsedHeaders:Xn,columnBorders:p,columnReordering:H,columnResizing:T,draggedHeaderRef:hn,editColumns:U,enableHeaderEditing:X,enableRowSelection:$,expandIcon:ne,filterIcon:le,filters:At,forceUpdate:dn,getBorderClass:Xt,handleApplyFilter:fr,handleClearAllFilters:Dt,handleClearFilter:Tt,handleMouseDown:_t,handleMouseOver:$t,handleRowSelect:ot,handleSelectAll:it,handleToggleRow:at,headerCollapseIcon:de,headerContainerRef:In,headerDropdown:ve,headerExpandIcon:fe,headerRegistry:Kt.current,headers:ct,hoveredHeaderRef:pn,isAnimating:Ut,isCopyFlashing:Zt,isInitialFocusedCell:er,isResizing:qn,isRowSelected:et,isScrolling:Yn,isSelected:nr,isWarningFlashing:tr,mainBodyRef:gn,nextIcon:Ce,onCellEdit:Ie,onCellClick:Se,onColumnOrderChange:xe,onColumnSelect:Re,onLoadMore:ke,onSort:dr,onTableHeaderDragEnd:hr,pinnedLeftRef:yn,pinnedRightRef:bn,prevIcon:De,rowButtons:Me,rowGrouping:Le,rowHeight:Oe,headerHeight:null!=pe?pe:Oe,rowIdAccessor:Pe,scrollbarWidth:gt,selectColumns:rr,selectableColumns:Je,selectedColumns:ir,columnsWithSelectedCells:sr,rowsWithSelectedCells:ur,selectedRows:Qn,selectedRowCount:tt,selectedRowsData:rt,setCollapsedHeaders:_n,setHeaders:On,setInitialFocusedCell:ar,setIsResizing:zn,setIsScrolling:Gn,setSelectedCells:lr,setSelectedColumns:cr,setSelectedRows:Zn,setUnexpandedRows:vt,shouldPaginate:_e,sortDownIcon:Qe,sortUpIcon:en,tableBodyContainerRef:Cn,tableRows:zt,theme:rn,unexpandedRows:ft,useHoverRowBackground:an,useOddColumnBackground:un,useOddEvenRowBackground:cn,activeHeaderDropdown:Vn,setActiveHeaderDropdown:Kn,onHeaderEdit:He}},{children:e("div",m({className:"simple-table-root st-wrapper theme-".concat(rn," ").concat(null!=f?f:""," ").concat(p?"st-column-borders":""),style:ge?{height:ge}:{}},{children:e(Hn,{children:t("div",m({className:"st-wrapper-container"},{children:[e(An,{}),t("div",m({className:"st-content-wrapper",onMouseUp:Qt,onMouseLeave:Qt},{children:[e(fn,{pinnedLeftWidth:St,pinnedRightWidth:xt,setScrollTop:dt,sort:Bt,tableRows:zt,rowsToRender:jt}),e(xn,{columnEditorText:E,editColumns:U,editColumnsInitOpen:K,headers:Bn,position:S})]})),e(vn,{mainBodyRef:gn,mainBodyWidth:It,pinnedLeftWidth:St,pinnedRightWidth:xt,pinnedLeftContentWidth:Rt,pinnedRightContentWidth:Et,tableBodyContainerRef:Cn}),e(z,{currentPage:kn,footerRenderer:se,hideFooter:me,onPageChange:Tn,onNextPage:Ae,rowsPerPage:Ge,shouldPaginate:_e,totalPages:Math.ceil(Ot.length/Ge),totalRows:Ot.length})]}))})}))}))};export{Bn as SimpleTable};
|
|
2
2
|
//# sourceMappingURL=index.es.js.map
|